sproutcore 1.10.0.rc.1 → 1.10.0.rc.2
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.
- checksums.yaml +8 -8
- data/VERSION.yml +1 -1
- data/bin/sc-build +9 -12
- data/bin/sc-build-number +9 -12
- data/bin/sc-docs +15 -12
- data/bin/sc-gen +9 -12
- data/bin/sc-init +9 -12
- data/bin/sc-manifest +9 -12
- data/bin/sc-server +9 -12
- data/bin/sproutcore +9 -12
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +46 -31
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +8 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/escape_html.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +0 -4
- data/lib/frameworks/sproutcore/frameworks/designer/views/page_item_view.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +2 -2
- data/lib/frameworks/sproutcore/tests/phantomjs_runner.phantomjs +17 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDg1MjQwYWRlZjUzZGFmNjFkMGUyYjFjYmFhN2NjNGM3MzM1M2IyZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWEzMzgxNjhlYTJjOTBlMDQxNTgzYTYxOTNmYzE4MTU4ZmViOGQ2MA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2VkY2E5ZTBkNTY3MTdjZTk0YmY1YmU4YjAyYzFkYzc5Nzg1YzQxN2ViZmEz
|
10
|
+
MDlkMDBkOTZmMWY1YzNkMTgwNWNiNTcyNjcyOGJmMjY5YzViYTkyYmRiY2Uz
|
11
|
+
Mzk3OWI0ZjZhMTI4YjYyZTZhNzRmZDkxYjIwMjZkZGYwN2NmOTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWVlMzRiOGMxNGRkMWVmYWRjMmU5MTRjYjFjYTExZTYyZjRmYmU5NDZmZDBj
|
14
|
+
ZjRiMTA4YmNlZWJjZjMwMzZlNjFjZDYwNjgzZmY2YWZjZTYzOGRiNzYyNjg1
|
15
|
+
NzFhNDQ1ZGY4NjU0N2I4MWE3OTJjMzRhMDNlNTM4ZTA1YzBlZTE=
|
data/VERSION.yml
CHANGED
data/bin/sc-build
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke 'build'
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sc-build-number
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke :build_number
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sc-docs
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# ===========================================================================
|
4
|
+
# Project: Abbot - SproutCore Build Tools
|
5
|
+
# Copyright: ©2010 Apple Inc.
|
6
|
+
# portions copyright @2006-2011 Strobe Inc.
|
7
|
+
# and contributors
|
8
|
+
# ===========================================================================
|
8
9
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
10
|
+
require "sproutcore"
|
12
11
|
|
13
|
-
|
14
|
-
require '
|
12
|
+
begin
|
13
|
+
require 'sc_docs/cli'
|
14
|
+
ScDocs::CLI.start
|
15
|
+
rescue LoadError
|
16
|
+
puts "sc-docs is no longer bundled with SproutCore. Please install the sc-docs tool instead."
|
17
|
+
end
|
15
18
|
|
16
|
-
|
19
|
+
# EOF
|
data/bin/sc-gen
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke 'gen'
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sc-init
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke 'init'
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sc-manifest
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke :manifest
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sc-server
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.invoke 'server'
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
data/bin/sproutcore
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
2
|
+
# ===========================================================================
|
3
|
+
# Project: Abbot - SproutCore Build Tools
|
4
|
+
# Copyright: ©2010 Apple Inc.
|
5
|
+
# portions copyright @2006-2011 Strobe Inc.
|
6
|
+
# and contributors
|
7
|
+
# ===========================================================================
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require "sproutcore"
|
12
10
|
|
13
|
-
|
14
|
-
require 'bundler/setup'
|
11
|
+
SC::Tools.start
|
15
12
|
|
16
|
-
|
13
|
+
# EOF
|
@@ -9,7 +9,10 @@
|
|
9
9
|
// ========================================================================
|
10
10
|
/*globals module, test, ok, isObj, equals, expects */
|
11
11
|
|
12
|
-
var url, request, contents;
|
12
|
+
var url, request, contents, test_timeout=2500;
|
13
|
+
if(window._phantom) {
|
14
|
+
test_timeout=5000;
|
15
|
+
}
|
13
16
|
|
14
17
|
module("SC.Request", {
|
15
18
|
|
@@ -135,11 +138,11 @@ test("Test Asynchronous GET Request", function() {
|
|
135
138
|
window.start();
|
136
139
|
});
|
137
140
|
|
141
|
+
stop(test_timeout); // stops the test runner - wait for response
|
142
|
+
|
138
143
|
response = request.send();
|
139
144
|
ok(response !== null, 'request.send() should return a response object');
|
140
145
|
ok(response.get('status')<0, 'response should still not have a return code since this should be async');
|
141
|
-
|
142
|
-
stop(2500); // stops the test runner - wait for response
|
143
146
|
});
|
144
147
|
|
145
148
|
test("Test Synchronous GET Request", function() {
|
@@ -169,10 +172,9 @@ test("Test Asynchronous GET Request, auto-deserializing JSON", function() {
|
|
169
172
|
window.start();
|
170
173
|
});
|
171
174
|
|
172
|
-
|
173
|
-
|
174
|
-
stop(2500); // stops the test runner
|
175
|
+
stop(test_timeout); // stops the test runner
|
175
176
|
|
177
|
+
request.send();
|
176
178
|
});
|
177
179
|
|
178
180
|
test("Test auto-deserializing malformed JSON", function() {
|
@@ -197,9 +199,9 @@ test("Test auto-deserializing malformed JSON", function() {
|
|
197
199
|
window.start();
|
198
200
|
});
|
199
201
|
|
200
|
-
|
202
|
+
stop(test_timeout);
|
201
203
|
|
202
|
-
|
204
|
+
request.send();
|
203
205
|
});
|
204
206
|
|
205
207
|
test("Test Synchronous GET Request, auto-deserializing JSON", function() {
|
@@ -243,7 +245,7 @@ test("Test Multiple Asynchronous GET Request - two immediate, and two in serial"
|
|
243
245
|
SC.Request.getUrl(url).notify(this, observer).send();
|
244
246
|
SC.Request.getUrl(url).notify(this, observer).send();
|
245
247
|
|
246
|
-
stop(
|
248
|
+
stop(test_timeout); // stops the test runner
|
247
249
|
setTimeout( function(){
|
248
250
|
equals(requestCount, 6, "requestCount should be 6");
|
249
251
|
equals(responseCount, 6, "responseCount should be 6");
|
@@ -312,13 +314,13 @@ test("Timeouts - SC.Request didReceive callback", function() {
|
|
312
314
|
}
|
313
315
|
});
|
314
316
|
|
317
|
+
// Stop the test runner and wait for a timeout or a response.
|
318
|
+
stop(test_timeout);
|
319
|
+
|
315
320
|
SC.RunLoop.begin();
|
316
321
|
timeoutRequest.send();
|
317
322
|
SC.RunLoop.end();
|
318
323
|
|
319
|
-
// Stop the test runner and wait for a timeout or a response.
|
320
|
-
stop(2500);
|
321
|
-
|
322
324
|
// In case we never receive a timeout, just start unit testing again after
|
323
325
|
// 500ms.
|
324
326
|
checkstop = setTimeout(function() {
|
@@ -328,6 +330,9 @@ test("Timeouts - SC.Request didReceive callback", function() {
|
|
328
330
|
});
|
329
331
|
|
330
332
|
test("Timeouts - Status listener callback", function() {
|
333
|
+
// sanity check
|
334
|
+
equals(SC.Request.manager.inflight.length,0,"there should be no inflight requests");
|
335
|
+
|
331
336
|
// Make sure timeouts actually fire, and fire when expected.
|
332
337
|
// Point to local server so test works offline
|
333
338
|
var timeoutRequest = SC.Request.getUrl("/"),
|
@@ -345,12 +350,12 @@ test("Timeouts - Status listener callback", function() {
|
|
345
350
|
return YES;
|
346
351
|
});
|
347
352
|
|
353
|
+
stop(test_timeout); // stops the test runner
|
354
|
+
|
348
355
|
SC.RunLoop.begin();
|
349
356
|
timeoutRequest.send();
|
350
357
|
SC.RunLoop.end();
|
351
358
|
|
352
|
-
stop(2500); // stops the test runner
|
353
|
-
|
354
359
|
// in case nothing works
|
355
360
|
checkstop = setTimeout(function() {
|
356
361
|
ok(false, 'timeout did not fire at all');
|
@@ -362,27 +367,34 @@ test("Test Multiple listeners per single status response", function() {
|
|
362
367
|
var numResponses = 0;
|
363
368
|
var response;
|
364
369
|
|
365
|
-
expect(
|
370
|
+
expect(8);
|
371
|
+
|
372
|
+
// sanity check
|
373
|
+
equals(SC.Request.manager.inflight.length,0,"there should be no inflight requests");
|
366
374
|
|
367
375
|
request.notify(200, this, function(response) {
|
368
376
|
numResponses++;
|
369
|
-
ok(true, "Received a response");
|
370
|
-
|
371
|
-
if (numResponses === 2) { window.start(); }
|
377
|
+
ok(true, "Received a response on first listener");
|
372
378
|
});
|
373
379
|
|
374
380
|
request.notify(200, this, function(response) {
|
375
381
|
numResponses++;
|
376
|
-
ok(true, "Received a response");
|
377
|
-
|
378
|
-
if (numResponses === 2) { window.start(); }
|
382
|
+
ok(true, "Received a response on second listener");
|
379
383
|
});
|
384
|
+
|
385
|
+
setTimeout(function() {
|
386
|
+
equals(SC.Request.manager.inflight.length,0,"there should be no inflight requests after the timeout");
|
387
|
+
equals(numResponses, 2, "got two notifications");
|
388
|
+
if (numResponses === 2) { window.start(); }
|
389
|
+
}, ((test_timeout*5) - 500) );
|
390
|
+
|
391
|
+
// phantomjs (used in integration tests) needs a veeeery long timeout, just for this test
|
392
|
+
stop(test_timeout*5); // stops the test runner - wait for response
|
380
393
|
|
381
394
|
response = request.send();
|
382
395
|
ok(response !== null, 'request.send() should return a response object');
|
383
396
|
ok(response.get('status')<0, 'response should still not have a return code since this should be async');
|
384
|
-
|
385
|
-
stop(2500); // stops the test runner - wait for response
|
397
|
+
equals(SC.Request.manager.inflight.length,1,"there should be 1 inflight request after send()");
|
386
398
|
});
|
387
399
|
|
388
400
|
|
@@ -393,6 +405,9 @@ test("Test Multiple listeners per single status response", function() {
|
|
393
405
|
*/
|
394
406
|
test("Multiple arguments passed to notify()", function() {
|
395
407
|
var response;
|
408
|
+
|
409
|
+
// sanity check
|
410
|
+
equals(SC.Request.manager.inflight.length,0,"there should be no inflight requests");
|
396
411
|
|
397
412
|
request.notify(this, function(response, a, b, c) {
|
398
413
|
equals(a, 'a', "Listener called with argument 'a'");
|
@@ -408,9 +423,9 @@ test("Multiple arguments passed to notify()", function() {
|
|
408
423
|
window.start();
|
409
424
|
}, 'a', 'b', 'c');
|
410
425
|
|
411
|
-
|
426
|
+
stop(test_timeout); // stops the test runner - wait for response
|
412
427
|
|
413
|
-
|
428
|
+
response = request.send();
|
414
429
|
});
|
415
430
|
|
416
431
|
|
@@ -458,9 +473,9 @@ test("Test event listeners on successful request.", function() {
|
|
458
473
|
window.start();
|
459
474
|
});
|
460
475
|
|
461
|
-
|
476
|
+
stop(test_timeout); // stops the test runner - wait for response
|
462
477
|
|
463
|
-
|
478
|
+
response = request.send();
|
464
479
|
});
|
465
480
|
|
466
481
|
if (window.XMLHttpRequestProgressEvent) {
|
@@ -505,9 +520,9 @@ if (window.XMLHttpRequestProgressEvent) {
|
|
505
520
|
window.start();
|
506
521
|
});
|
507
522
|
|
508
|
-
|
523
|
+
stop(test_timeout); // stops the test runner - wait for response
|
509
524
|
|
510
|
-
|
525
|
+
response = request.send();
|
511
526
|
});
|
512
527
|
}
|
513
528
|
|
@@ -565,9 +580,9 @@ test("Test upload event listeners on successful request.", function() {
|
|
565
580
|
body['k' + i] = 'v' + i;
|
566
581
|
}
|
567
582
|
|
568
|
-
|
583
|
+
stop(test_timeout); // stops the test runner - wait for response
|
569
584
|
|
570
|
-
|
585
|
+
response = request.send(JSON.stringify(body));
|
571
586
|
});
|
572
587
|
|
573
588
|
|
@@ -1205,7 +1205,12 @@ SC.RenderContext = SC.Builder.create(
|
|
1205
1205
|
});
|
1206
1206
|
|
1207
1207
|
(function () {
|
1208
|
-
|
1208
|
+
// this regex matches all <, > or &, unless & is immediately followed by at last 1 up to 7 alphanumeric
|
1209
|
+
// characters and a ;. For instance:
|
1210
|
+
// Some evil <script src="evil.js"> but this is legal & these are not & &illegalese;
|
1211
|
+
// would become:
|
1212
|
+
// Some evil <script src="evil.js"> but this is legal & these are not & &illegalese;
|
1213
|
+
var _escapeHTMLRegex = /[<>]|&(?![\d\w#]{1,7};)/g, _escapeHTMLMethod = function (match) {
|
1209
1214
|
switch (match) {
|
1210
1215
|
case '&':
|
1211
1216
|
return '&';
|
@@ -1218,7 +1223,8 @@ SC.RenderContext = SC.Builder.create(
|
|
1218
1223
|
|
1219
1224
|
/**
|
1220
1225
|
Helper method escapes the passed string to ensure HTML is displayed as
|
1221
|
-
plain text
|
1226
|
+
plain text while preserving HTML entities like ' , à, etc.
|
1227
|
+
You should make sure you pass all user-entered data through
|
1222
1228
|
this method to avoid errors. You can also do this with the text() helper
|
1223
1229
|
method on a render context.
|
1224
1230
|
|
data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/escape_html.js
CHANGED
@@ -13,6 +13,14 @@ test("Escaping HTML", function() {
|
|
13
13
|
equals(output, '<p>HTML!</p><script>alert(\'hi\');</script> & Hello, World!', "Properly escapes HTML");
|
14
14
|
});
|
15
15
|
|
16
|
+
module("Render Context--Escaping , preserve HTML entities like '");
|
17
|
+
test("Escaping HTML, preserve HTML entities", function() {
|
18
|
+
var input = "<p>HTML!</p><script>alert('hi');<" + "/script> &illegalese; & & Hello, World!";
|
19
|
+
var output = SC.RenderContext.escapeHTML(input);
|
20
|
+
|
21
|
+
equals(output, '<p>HTML!</p><script>alert(\'hi\');</script> &illegalese; & & Hello, World!', "Properly escapes HTML");
|
22
|
+
});
|
23
|
+
|
16
24
|
test("Tests stolen from Prototype.js", function() {
|
17
25
|
var largeTextEscaped = '<span>test</span>',
|
18
26
|
largeTextUnescaped = '<span>test</span>';
|
@@ -285,10 +285,6 @@ SC.View.reopen(
|
|
285
285
|
|
286
286
|
// In the case of zero duration, just adjust and call the callback.
|
287
287
|
if (options.duration === 0) {
|
288
|
-
//@if(debug)
|
289
|
-
// Provide a little developer support if they are doing something that should be considered wrong.
|
290
|
-
SC.warn("Developer Warning: SC.View:animate() was called with a duration of 0 seconds. The view will be adjusted and the callback will fire immediately in the next run loop.");
|
291
|
-
//@endif
|
292
288
|
this.adjust(hash);
|
293
289
|
this.runAnimationCallback(options, null, NO);
|
294
290
|
return this;
|
@@ -3,17 +3,17 @@
|
|
3
3
|
// ==========================================================================
|
4
4
|
/*globals SC */
|
5
5
|
|
6
|
-
/**
|
6
|
+
/**
|
7
7
|
This View is used by Greenhouse when application is in design mode
|
8
8
|
Used for displaying page items
|
9
9
|
|
10
10
|
@extends SC.ListItemVIew
|
11
11
|
@author Mike Ball
|
12
|
-
|
12
|
+
|
13
13
|
*/
|
14
14
|
|
15
15
|
SC.pageItemView = SC.ListItemView.extend(
|
16
|
-
/** @scope SC.ListItemView.prototype */ {
|
16
|
+
/** @scope SC.ListItemView.prototype */ {
|
17
17
|
isDropTarget: YES,
|
18
18
|
|
19
19
|
dragEntered: function(drag, evt) {
|
@@ -22,42 +22,42 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
22
22
|
|
23
23
|
dragExited: function(drag, evt) {
|
24
24
|
this.$().removeClass('highlight');
|
25
|
-
|
25
|
+
|
26
26
|
},
|
27
27
|
|
28
28
|
dragEnded: function(drag, evt) {
|
29
29
|
this.$().removeClass('highlight');
|
30
|
-
|
30
|
+
|
31
31
|
},
|
32
32
|
|
33
33
|
/**
|
34
34
|
Called when the drag needs to determine which drag operations are
|
35
35
|
valid in a given area.
|
36
36
|
|
37
|
-
Override this method to return an OR'd mask of the allowed drag
|
38
|
-
operations. If the user drags over a droppable area within another
|
39
|
-
droppable area, the drag will latch onto the deepest view that returns one
|
37
|
+
Override this method to return an OR'd mask of the allowed drag
|
38
|
+
operations. If the user drags over a droppable area within another
|
39
|
+
droppable area, the drag will latch onto the deepest view that returns one
|
40
40
|
or more available operations.
|
41
41
|
|
42
42
|
The default implementation returns `SC.DRAG_NONE`
|
43
43
|
|
44
44
|
@param {SC.Drag} drag The current drag object
|
45
|
-
@param {SC.Event} evt The most recent mouse move event. Use to get
|
46
|
-
location
|
47
|
-
@returns {DragOps} A mask of all the drag operations allowed or
|
45
|
+
@param {SC.Event} evt The most recent mouse move event. Use to get
|
46
|
+
location
|
47
|
+
@returns {DragOps} A mask of all the drag operations allowed or
|
48
48
|
SC.DRAG_NONE
|
49
49
|
*/
|
50
|
-
computeDragOperations: function(drag, evt) {
|
50
|
+
computeDragOperations: function(drag, evt) {
|
51
51
|
if(drag.hasDataType('SC.Binding')){
|
52
52
|
return SC.DRAG_LINK;
|
53
53
|
}
|
54
|
-
return SC.DRAG_NONE;
|
54
|
+
return SC.DRAG_NONE;
|
55
55
|
},
|
56
56
|
|
57
57
|
/**
|
58
58
|
Called when the user releases the mouse.
|
59
59
|
|
60
|
-
This method gives your drop target one last opportunity to choose to
|
60
|
+
This method gives your drop target one last opportunity to choose to
|
61
61
|
accept the proposed drop operation. You might use this method to
|
62
62
|
perform fine-grained checks on the drop location, for example.
|
63
63
|
Return true to accept the drop operation.
|
@@ -68,7 +68,7 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
68
68
|
@param {DragOp} op The proposed drag operation. A drag constant
|
69
69
|
|
70
70
|
@return {Boolean} YES if operation is OK, NO to cancel.
|
71
|
-
*/
|
71
|
+
*/
|
72
72
|
acceptDragOperation: function(drag, op) { return YES; },
|
73
73
|
|
74
74
|
/**
|
@@ -87,11 +87,11 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
87
87
|
|
88
88
|
@return {DragOp} Drag Operation actually performed
|
89
89
|
*/
|
90
|
-
performDragOperation: function(drag, op) {
|
90
|
+
performDragOperation: function(drag, op) {
|
91
91
|
var data = drag.dataForType('SC.Binding'), that = this;
|
92
92
|
if(data && SC._Greenhouse){
|
93
93
|
var actionObj = SC.Object.create({
|
94
|
-
type: 'Binding',
|
94
|
+
type: 'Binding',
|
95
95
|
source: data,
|
96
96
|
target: that.get('content'),
|
97
97
|
addItem: function(from, to, designAttrs){
|
@@ -99,7 +99,7 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
99
99
|
var value = that._propertyPathForProp(this.getPath('target.view.page'),this.getPath('target.view'));
|
100
100
|
view[from+"Binding"] = designAttrs[from+"Binding"] = value+"."+to;
|
101
101
|
view.propertyDidChange(from+"Binding");
|
102
|
-
|
102
|
+
|
103
103
|
var designer = view.get('designer');
|
104
104
|
if(designer){
|
105
105
|
designer.designProperties.pushObject(from+"Binding");
|
@@ -114,10 +114,10 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
114
114
|
return SC.DRAG_LINK;
|
115
115
|
}
|
116
116
|
else{
|
117
|
-
return SC.DRAG_NONE;
|
117
|
+
return SC.DRAG_NONE;
|
118
118
|
}
|
119
119
|
},
|
120
|
-
|
120
|
+
|
121
121
|
_propertyPathForProp: function(page, prop){
|
122
122
|
for(var key in page){
|
123
123
|
if(page.hasOwnProperty(key)){
|
@@ -125,6 +125,6 @@ SC.pageItemView = SC.ListItemView.extend(
|
|
125
125
|
}
|
126
126
|
}
|
127
127
|
}
|
128
|
-
|
128
|
+
|
129
129
|
});
|
130
130
|
|
@@ -39,7 +39,8 @@ SC.BaseTheme.radioRenderDelegate = SC.RenderDelegate.create({
|
|
39
39
|
context.setClass({
|
40
40
|
active: dataSource.get('isActive'),
|
41
41
|
mixed: dataSource.get('isMixed'),
|
42
|
-
sel: dataSource.get('isSelected')
|
42
|
+
sel: dataSource.get('isSelected'),
|
43
|
+
disabled: !dataSource.get('isEnabled')
|
43
44
|
});
|
44
45
|
|
45
46
|
//accessing accessibility
|
@@ -69,7 +70,8 @@ SC.BaseTheme.radioRenderDelegate = SC.RenderDelegate.create({
|
|
69
70
|
jquery.setClass({
|
70
71
|
active: dataSource.get('isActive'),
|
71
72
|
mixed: dataSource.get('isMixed'),
|
72
|
-
sel: dataSource.get('isSelected')
|
73
|
+
sel: dataSource.get('isSelected'),
|
74
|
+
disabled: !dataSource.get('isEnabled')
|
73
75
|
});
|
74
76
|
|
75
77
|
jquery.attr('aria-disabled', dataSource.get('isEnabled') ? 'false' : 'true');
|
@@ -385,7 +385,7 @@ var pane;
|
|
385
385
|
var overflowEl = segments[segments.length - 1];
|
386
386
|
ok($(overflowEl).hasClass('sc-overflow-segment'), 'overflow segment should have .sc-overflow-segment class');
|
387
387
|
var overflowLabelEl = $(overflowEl).find('label')[0];
|
388
|
-
equals(overflowLabelEl.
|
388
|
+
equals(overflowLabelEl.innerHTML, "»", 'there should be "»" text in the overflow segment');
|
389
389
|
};
|
390
390
|
|
391
391
|
var lastIsSegment = function (sv, text) {
|
@@ -393,7 +393,7 @@ var pane;
|
|
393
393
|
var lastEl = segments[segments.length - 2];
|
394
394
|
ok(!$(lastEl).hasClass('sc-overflow-segment'), 'last segment should not have .sc-overflow-segment class');
|
395
395
|
var lastLabelEl = $(lastEl).find('label')[0];
|
396
|
-
equals(lastLabelEl.
|
396
|
+
equals(lastLabelEl.innerHTML, text, 'there should be "' + text + '" text in the last segment');
|
397
397
|
};
|
398
398
|
|
399
399
|
// the last item should be an overflow segment (ie. has .sc-overflow-segment class and text "»")
|
@@ -22,6 +22,7 @@ function waitFor(testFx, onReady, timeOutMillis) {
|
|
22
22
|
|
23
23
|
var env = require('system').env;
|
24
24
|
var args = require('system').args;
|
25
|
+
var fs = require('fs');
|
25
26
|
|
26
27
|
var travis=env['TRAVIS_JOB_ID']?env['TRAVIS_JOB_ID']:false,
|
27
28
|
verbose=env['VERBOSE']?env['VERBOSE']:false,
|
@@ -29,16 +30,6 @@ var travis=env['TRAVIS_JOB_ID']?env['TRAVIS_JOB_ID']:false,
|
|
29
30
|
host=env['IP']?env['IP']:"127.0.0.1",
|
30
31
|
filter=(args.length === 2 ? new RegExp(args[1]) : false);
|
31
32
|
|
32
|
-
if(!travis && verbose) {
|
33
|
-
page.onError = function(err, stack) {
|
34
|
-
console.log("CONSOLE ERROR: "+err);
|
35
|
-
};
|
36
|
-
|
37
|
-
page.onConsoleMessage = function(msg, lineNum, sourceId) {
|
38
|
-
console.log('CONSOLE: ' + msg);
|
39
|
-
};
|
40
|
-
}
|
41
|
-
|
42
33
|
var urls=[
|
43
34
|
{url:'sproutcore/core_foundation/en/current/tests/views/pane/layout.html'},
|
44
35
|
{url:'sproutcore/core_foundation/en/current/tests/views/pane/sendEvent.html'},
|
@@ -512,6 +503,19 @@ var outcome=0;
|
|
512
503
|
var failed=0;
|
513
504
|
var webpage = require('webpage');
|
514
505
|
|
506
|
+
function configure(page) {
|
507
|
+
if(!travis && verbose) {
|
508
|
+
page.onError = function(err, stack) {
|
509
|
+
console.log("CONSOLE ERROR: "+err);
|
510
|
+
};
|
511
|
+
|
512
|
+
page.onConsoleMessage = function(msg, lineNum, sourceId) {
|
513
|
+
console.log('CONSOLE: ' + msg);
|
514
|
+
};
|
515
|
+
}
|
516
|
+
return page;
|
517
|
+
}
|
518
|
+
|
515
519
|
function logResult(r,i) {
|
516
520
|
// output coloring
|
517
521
|
var red, blue, reset;
|
@@ -533,7 +537,7 @@ function runTest(idx, cb) {
|
|
533
537
|
if (!filter || url.match(filter)) {
|
534
538
|
run++;
|
535
539
|
var page = webpage.create();
|
536
|
-
page.viewportSize = { width: 1024, height: 768 };
|
540
|
+
configure(page).viewportSize = { width: 1024, height: 768 };
|
537
541
|
// Chrome/Linux
|
538
542
|
//page.settings.userAgent = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36";
|
539
543
|
page.open('http://'+host+':'+port+'/'+url, function (status) {
|
@@ -572,8 +576,10 @@ function runTest(idx, cb) {
|
|
572
576
|
urls[idx].resultText=resultText;
|
573
577
|
if(resultText.indexOf("failed")!=-1) {
|
574
578
|
urls[idx].status=TEST_FAILED; outcome=1; failed++;
|
579
|
+
fs.write((idx+1)+'.html', page.content, 'w');
|
575
580
|
} else if(resultText.indexOf("error")!=-1) {
|
576
581
|
urls[idx].status=TEST_ERROR; outcome=1; failed++;
|
582
|
+
fs.write((idx+1)+'.html', page.content, 'w');
|
577
583
|
} else {
|
578
584
|
urls[idx].status=TEST_PASSED;
|
579
585
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sproutcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.0.rc.
|
4
|
+
version: 1.10.0.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Strobe, Inc., Apple Inc. and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|