sproutcore 1.4.2 → 1.4.3
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 +11 -0
- data/Rakefile +27 -436
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG +32 -2
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +8 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +42 -2
- data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +7 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +22 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +38 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +8 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +14 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/system/datetime.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +25 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +46 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +7 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/media_slider.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/video.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +18 -23
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +13 -0
- data/lib/sproutcore/builders/base.rb +4 -4
- data/lib/sproutcore/builders/javascript.rb +0 -7
- data/lib/sproutcore/builders/stylesheet.rb +0 -7
- data/lib/sproutcore/rack/proxy.rb +28 -13
- metadata +4 -4
- data/DISTRIBUTION.yml +0 -20
@@ -20,9 +20,13 @@ SC.Validator.NotEmpty = SC.Validator.extend(
|
|
20
20
|
|
21
21
|
validate: function(form, field) {
|
22
22
|
var value = field.get('fieldValue');
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
if (SC.none(value))
|
24
|
+
return NO;
|
25
|
+
|
26
|
+
if (! SC.none(value.length))
|
27
|
+
return value.length > 0;
|
28
|
+
|
29
|
+
return YES;
|
26
30
|
},
|
27
31
|
|
28
32
|
validateError: function(form, field) {
|
@@ -208,7 +208,7 @@ SC.LabelView = SC.View.extend(SC.Control,
|
|
208
208
|
if (!this.get('isEditable')) return NO ;
|
209
209
|
|
210
210
|
var el = this.$(),
|
211
|
-
value = this.get('value')
|
211
|
+
value = this.get('value'),
|
212
212
|
f = SC.viewportOffset(el[0]),
|
213
213
|
frameTemp = this.convertFrameFromView(this.get('frame'), null) ;
|
214
214
|
f.width=frameTemp.width;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
8
|
sc_require('views/controls');
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
/*globals SC */
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
/*globals SC */
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
/*globals SC */
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
/*globals SC */
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2010 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
8
|
|
@@ -51,7 +51,7 @@ SC.ObserverSet = {
|
|
51
51
|
// context is really useful sometimes but not used that often so this
|
52
52
|
// implementation is intentionally lazy.
|
53
53
|
if (context !== undefined) {
|
54
|
-
if (!methods.contexts)
|
54
|
+
if (!methods.contexts) methods.contexts = {} ;
|
55
55
|
methods.contexts[SC.guidFor(method)] = context ;
|
56
56
|
}
|
57
57
|
|
@@ -782,6 +782,7 @@ function findClassNames() {
|
|
782
782
|
SC._object_foundObjectClassNames = true ;
|
783
783
|
|
784
784
|
var seen = [] ;
|
785
|
+
var detectedSC = false;
|
785
786
|
var searchObject = function(root, object, levels) {
|
786
787
|
levels-- ;
|
787
788
|
|
@@ -792,7 +793,12 @@ function findClassNames() {
|
|
792
793
|
for(var key in object) {
|
793
794
|
if (key == '__scope__') continue ;
|
794
795
|
if (key == 'superclass') continue ;
|
796
|
+
if (key == '__SC__') key = 'SC' ;
|
795
797
|
if (!key.match(/^[A-Z0-9]/)) continue ;
|
798
|
+
if (key == 'SC') {
|
799
|
+
if (detectedSC) continue;
|
800
|
+
detectedSC = true;
|
801
|
+
}
|
796
802
|
|
797
803
|
var path = (root) ? [root,key].join('.') : key ;
|
798
804
|
var value = object[key] ;
|
@@ -818,29 +824,18 @@ function findClassNames() {
|
|
818
824
|
}
|
819
825
|
} ;
|
820
826
|
|
827
|
+
// Fix for IE 7 and 8 in order to detect the SC global variable. When you create
|
828
|
+
// a global variable in IE, it is not added to the window object like in other
|
829
|
+
// browsers. Therefore the searchObject method will not pick it up. So we have to
|
830
|
+
// update the window object to have a reference to the global variable. And
|
831
|
+
// doing window['SC'] does not work since the global variable already exists. For
|
832
|
+
// any object that you create that is used act as a namespace, be sure to create it
|
833
|
+
// like so:
|
834
|
+
//
|
835
|
+
// window.MyApp = window.MyApp || SC.Object.create({ ... })
|
836
|
+
//
|
837
|
+
window['__SC__'] = SC;
|
821
838
|
searchObject(null, window, 2) ;
|
822
|
-
|
823
|
-
// Internet Explorer doesn't loop over global variables...
|
824
|
-
/*if ( SC.browser.isIE ) {
|
825
|
-
searchObject('SC', SC, 2) ; // get names for the SC classes
|
826
|
-
|
827
|
-
// get names for the model classes, including nested namespaces (untested)
|
828
|
-
for ( var i = 0; i < SC.Server.servers.length; i++ ) {
|
829
|
-
var server = SC.Server.servers[i];
|
830
|
-
if (server.prefix) {
|
831
|
-
for (var prefixLoc = 0; prefixLoc < server.prefix.length; prefixLoc++) {
|
832
|
-
var prefixParts = server.prefix[prefixLoc].split('.');
|
833
|
-
var namespace = window;
|
834
|
-
var namespaceName;
|
835
|
-
for (var prefixPartsLoc = 0; prefixPartsLoc < prefixParts.length; prefixPartsLoc++) {
|
836
|
-
namespace = namespace[prefixParts[prefixPartsLoc]] ;
|
837
|
-
namespaceName = prefixParts[prefixPartsLoc];
|
838
|
-
}
|
839
|
-
searchObject(namespaceName, namespace, 2) ;
|
840
|
-
}
|
841
|
-
}
|
842
|
-
}
|
843
|
-
}*/
|
844
839
|
}
|
845
840
|
|
846
841
|
/**
|
@@ -875,7 +870,7 @@ SC.kindOf = function(scObject, scClass) {
|
|
875
870
|
This method is used to allow classes to determine their own name.
|
876
871
|
*/
|
877
872
|
SC._object_className = function(obj) {
|
878
|
-
if (
|
873
|
+
if (SC.isReady === NO) return ''; // class names are not available until ready
|
879
874
|
if (!obj._object_className) findClassNames() ;
|
880
875
|
if (obj._object_className) return obj._object_className ;
|
881
876
|
|
@@ -550,6 +550,19 @@ test("should register an observer for a property - Special case of chained prope
|
|
550
550
|
equals('chainedPropertyObserved',ObjectC.normal2);
|
551
551
|
});
|
552
552
|
|
553
|
+
test("passing a context", function() {
|
554
|
+
var target = {
|
555
|
+
callback: function(target, key, nullVariable, context, revision) {
|
556
|
+
target.context = context;
|
557
|
+
}
|
558
|
+
};
|
559
|
+
|
560
|
+
ObjectC.context = null;
|
561
|
+
ObjectC.addObserver('normal', target, 'callback', 'context');
|
562
|
+
ObjectC.set('normal','newValue');
|
563
|
+
|
564
|
+
equals(ObjectC.context, 'context');
|
565
|
+
});
|
553
566
|
|
554
567
|
module("object.removeObserver()", {
|
555
568
|
setup: function() {
|
@@ -48,15 +48,15 @@ module SC
|
|
48
48
|
# joins the array of lines. this is where you can also do any final
|
49
49
|
# post-processing on the build
|
50
50
|
def joinlines(lines)
|
51
|
-
lines
|
51
|
+
lines.is_a?(Array) ? lines.join : lines
|
52
52
|
end
|
53
53
|
|
54
54
|
# writes the passed lines to the named file
|
55
55
|
def writelines(dst_path, lines)
|
56
56
|
FileUtils.mkdir_p(File.dirname(dst_path))
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
File.open(dst_path, 'w') do |f|
|
58
|
+
f.write joinlines(lines)
|
59
|
+
end
|
60
60
|
end
|
61
61
|
|
62
62
|
# Handles occurances of sc_static() or static_url()
|
@@ -24,13 +24,6 @@ module SC
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def writelines(dst_path, lines)
|
28
|
-
FileUtils.mkdir_p(File.dirname(dst_path))
|
29
|
-
File.open(dst_path, 'w') do |f|
|
30
|
-
f.write lines
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
27
|
def build(dst_path)
|
35
28
|
lines = ""
|
36
29
|
target_name = entry.target[:target_name].to_s.sub(/^\//,'')
|
@@ -26,13 +26,6 @@ module SC
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def writelines(dst_path, lines)
|
30
|
-
FileUtils.mkdir_p(File.dirname(dst_path))
|
31
|
-
File.open(dst_path, 'w') do |f|
|
32
|
-
f.write lines
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
29
|
def build(dst_path)
|
37
30
|
code = rewrite_inline_code(readlines(entry[:source_path]))
|
38
31
|
writelines dst_path, code
|
@@ -5,7 +5,14 @@
|
|
5
5
|
# and contributors
|
6
6
|
# ===========================================================================
|
7
7
|
|
8
|
-
|
8
|
+
begin
|
9
|
+
require 'net/https'
|
10
|
+
SC::HTTPS_ENABLED = true
|
11
|
+
rescue LoadError => e
|
12
|
+
require 'net/http'
|
13
|
+
SC::HTTPS_ENABLED = false
|
14
|
+
end
|
15
|
+
|
9
16
|
module SC
|
10
17
|
module Rack
|
11
18
|
|
@@ -30,6 +37,12 @@ module SC
|
|
30
37
|
end
|
31
38
|
|
32
39
|
def handle_proxy(proxy, proxy_url, env)
|
40
|
+
if proxy[:secure] && !SC::HTTPS_ENABLED
|
41
|
+
SC.logger << "~ WARNING: HTTPS is not supported on your system, using HTTP instead.\n"
|
42
|
+
SC.logger << " If you are using Ubuntu, you can run `apt-get install libopenssl-ruby`\n"
|
43
|
+
proxy[:secure] = false
|
44
|
+
end
|
45
|
+
|
33
46
|
origin_host = env['SERVER_NAME'] # capture the origin host for cookies
|
34
47
|
http_method = env['REQUEST_METHOD'].to_s.downcase
|
35
48
|
url = env['PATH_INFO']
|
@@ -50,7 +63,7 @@ module SC
|
|
50
63
|
headers['Content-Length'] = env['CONTENT_LENGTH'] if env['CONTENT_LENGTH']
|
51
64
|
|
52
65
|
http_host, http_port = proxy[:to].split(':')
|
53
|
-
http_port = '80' if http_port.nil?
|
66
|
+
http_port = proxy[:secure] ? '443' : '80' if http_port.nil?
|
54
67
|
|
55
68
|
# added 4/23/09 per Charles Jolley, corrects problem
|
56
69
|
# when making requests to virtual hosts
|
@@ -70,14 +83,16 @@ module SC
|
|
70
83
|
done = false
|
71
84
|
tries = 0
|
72
85
|
until done
|
73
|
-
::Net::HTTP.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
http = ::Net::HTTP.new(http_host, http_port)
|
87
|
+
|
88
|
+
if proxy[:secure]
|
89
|
+
http.use_ssl = true
|
90
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
91
|
+
end
|
78
92
|
|
93
|
+
http.start do |web|
|
79
94
|
if no_body_method.include?(http_method)
|
80
|
-
response =
|
95
|
+
response = web.send(http_method, http_path, headers)
|
81
96
|
else
|
82
97
|
http_body = env['rack.input']
|
83
98
|
http_body.rewind
|
@@ -86,13 +101,14 @@ module SC
|
|
86
101
|
true, true, http_path, headers
|
87
102
|
|
88
103
|
some_request.body_stream = http_body
|
89
|
-
response =
|
104
|
+
response = web.request(some_request)
|
90
105
|
end
|
91
106
|
end
|
92
107
|
|
93
108
|
status = response.code # http status code
|
109
|
+
protocol = proxy[:secure] ? 'https' : 'http'
|
94
110
|
|
95
|
-
SC.logger << "~ PROXY: #{http_method.upcase} #{status} #{url} ->
|
111
|
+
SC.logger << "~ PROXY: #{http_method.upcase} #{status} #{url} -> #{protocol}://#{http_host}:#{http_port}#{http_path}\n"
|
96
112
|
|
97
113
|
# display and construct specific response headers
|
98
114
|
response_headers = {}
|
@@ -120,15 +136,14 @@ module SC
|
|
120
136
|
response_headers[key] = value
|
121
137
|
end
|
122
138
|
|
123
|
-
if [301, 307].include?(status.to_i)
|
124
|
-
SC.logger << '~ REDIRECTING: '+response_headers['location']
|
139
|
+
if [301, 302, 303, 307].include?(status.to_i) && proxy[:redirect] != false
|
140
|
+
SC.logger << '~ REDIRECTING: '+response_headers['location']+"\n"
|
125
141
|
|
126
142
|
uri = URI.parse(response_headers['location']);
|
127
143
|
http_host = uri.host
|
128
144
|
http_port = uri.port
|
129
145
|
http_path = uri.path
|
130
146
|
http_path += '?'+uri.query if uri.query
|
131
|
-
headers = {}
|
132
147
|
|
133
148
|
tries += 1
|
134
149
|
if tries > 10
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
8
|
+
- 3
|
9
|
+
version: 1.4.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Strobe, Inc., Sprout Systems, Inc. Apple Inc. and contributors
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-19 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -228,7 +228,6 @@ extra_rdoc_files:
|
|
228
228
|
- README.txt
|
229
229
|
files:
|
230
230
|
- CHANGELOG
|
231
|
-
- DISTRIBUTION.yml
|
232
231
|
- Gemfile
|
233
232
|
- History.txt
|
234
233
|
- README.txt
|
@@ -1547,6 +1546,7 @@ files:
|
|
1547
1546
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/rect.js
|
1548
1547
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js
|
1549
1548
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js
|
1549
|
+
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js
|
1550
1550
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js
|
1551
1551
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js
|
1552
1552
|
- lib/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js
|
data/DISTRIBUTION.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file lists all subprojects that need to be installed in the directory
|
2
|
-
# for release. The Rakefile will track Git hash codes for each project in
|
3
|
-
# the VERSION.yml file
|
4
|
-
#
|
5
|
-
# Each entry should have the following format:
|
6
|
-
#
|
7
|
-
# path/to/item:
|
8
|
-
# repo: GIT/SVN URL
|
9
|
-
# scm: git|svn <- type of source control system. defaults to git
|
10
|
-
#
|
11
|
-
# Note that if you are maintaining private versions of any of these
|
12
|
-
# frameworks you can also create a file called LOCAL.yml that can contain
|
13
|
-
# any overrides to the distirbution info contained here.
|
14
|
-
#
|
15
|
-
|
16
|
-
frameworks/sproutcore:
|
17
|
-
repo: "git://github.com/sproutit/sproutcore.git"
|
18
|
-
branch: "master"
|
19
|
-
|
20
|
-
|