sproutcore 1.6.0.rc.1-x86-mingw32 → 1.6.0.rc.2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +31 -6
- data/{History.txt → History.rdoc} +0 -0
- data/{README.txt → README.rdoc} +3 -2
- data/Rakefile +15 -15
- data/{Todo.txt → Todo.rdoc} +0 -0
- data/VERSION.yml +1 -1
- data/lib/buildtasks/manifest.rake +11 -4
- data/lib/buildtasks/target.rake +20 -23
- data/lib/frameworks/sproutcore/CHANGELOG.md +36 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +2 -42
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +29 -12
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +63 -26
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +25 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +26 -3
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +74 -53
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +6 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +6 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +25 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +46 -49
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +14 -2
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +2 -76
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +3348 -1591
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +25 -5
- data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +0 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/requiredObjectForPropertyPath.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue.js +98 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +1 -1
- data/lib/gen/language/Buildfile +1 -1
- data/lib/sproutcore.rb +1 -14
- data/lib/sproutcore/buildfile/string_ext.rb +0 -4
- data/lib/sproutcore/helpers/cssmin.rb +44 -59
- data/lib/sproutcore/helpers/text_helper.rb +11 -13
- data/lib/sproutcore/models/manifest.rb +4 -4
- data/lib/sproutcore/models/target.rb +11 -110
- data/lib/sproutcore/rack.rb +0 -1
- data/lib/sproutcore/rack/dev.rb +0 -1
- data/lib/sproutcore/rack/proxy.rb +9 -8
- data/lib/sproutcore/rack/service.rb +1 -1
- data/lib/sproutcore/render_engines/haml.rb +2 -5
- data/lib/sproutcore/tools/build.rb +2 -0
- data/lib/sproutcore/tools/docs.rb +7 -36
- data/lib/sproutcore/tools/manifest.rb +1 -1
- data/spec/buildtasks/target_spec.rb +9 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +1 -1
- data/sproutcore.gemspec +3 -4
- data/vendor/chance/lib/chance/instance.rb +5 -8
- metadata +41 -207
- data/lib/doc_templates/jsdoc/allclasses.tmpl +0 -17
- data/lib/doc_templates/jsdoc/allfiles.tmpl +0 -56
- data/lib/doc_templates/jsdoc/class.tmpl +0 -487
- data/lib/doc_templates/jsdoc/index.tmpl +0 -38
- data/lib/doc_templates/jsdoc/publish.js +0 -170
- data/lib/doc_templates/jsdoc/static/default.css +0 -162
- data/lib/doc_templates/jsdoc/static/header.html +0 -2
- data/lib/doc_templates/jsdoc/static/index.html +0 -19
- data/lib/doc_templates/jsdoc/symbol.tmpl +0 -35
- data/lib/doc_templates/sproutcore/allclasses.tmpl +0 -0
- data/lib/doc_templates/sproutcore/allfiles.tmpl +0 -56
- data/lib/doc_templates/sproutcore/class.tmpl +0 -674
- data/lib/doc_templates/sproutcore/classes-json.tmpl +0 -55
- data/lib/doc_templates/sproutcore/index.tmpl +0 -62
- data/lib/doc_templates/sproutcore/publish.js +0 -346
- data/lib/doc_templates/sproutcore/static/default.css +0 -258
- data/lib/doc_templates/sproutcore/static/header.html +0 -2
- data/lib/doc_templates/sproutcore/static/index.html +0 -19
- data/lib/doc_templates/sproutcore/symbol.tmpl +0 -35
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +0 -55
- data/lib/sproutcore/rack/docs.rb +0 -24
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
- data/vendor/jsdoc/README.txt +0 -151
- data/vendor/jsdoc/app/frame.js +0 -33
- data/vendor/jsdoc/app/frame/Chain.js +0 -102
- data/vendor/jsdoc/app/frame/Dumper.js +0 -144
- data/vendor/jsdoc/app/frame/Hash.js +0 -47
- data/vendor/jsdoc/app/frame/Link.js +0 -142
- data/vendor/jsdoc/app/frame/Namespace.js +0 -10
- data/vendor/jsdoc/app/frame/Opt.js +0 -134
- data/vendor/jsdoc/app/frame/Reflection.js +0 -26
- data/vendor/jsdoc/app/frame/String.js +0 -93
- data/vendor/jsdoc/app/frame/Testrun.js +0 -129
- data/vendor/jsdoc/app/handlers/FOODOC.js +0 -26
- data/vendor/jsdoc/app/handlers/XMLDOC.js +0 -26
- data/vendor/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -159
- data/vendor/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -16
- data/vendor/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -292
- data/vendor/jsdoc/app/lib/JSDOC.js +0 -98
- data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
- data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
- data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +0 -162
- data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
- data/vendor/jsdoc/app/lib/JSDOC/Lang.js +0 -144
- data/vendor/jsdoc/app/lib/JSDOC/Parser.js +0 -109
- data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
- data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +0 -681
- data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -226
- data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
- data/vendor/jsdoc/app/lib/JSDOC/Token.js +0 -18
- data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +0 -332
- data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
- data/vendor/jsdoc/app/lib/JSDOC/Util.js +0 -32
- data/vendor/jsdoc/app/lib/JSDOC/Walker.js +0 -453
- data/vendor/jsdoc/app/main.js +0 -74
- data/vendor/jsdoc/app/plugins/commentSrcJson.js +0 -19
- data/vendor/jsdoc/app/plugins/frameworkPrototype.js +0 -16
- data/vendor/jsdoc/app/plugins/functionCall.js +0 -10
- data/vendor/jsdoc/app/plugins/publishSrcHilite.js +0 -62
- data/vendor/jsdoc/app/plugins/sproutcoreTags.js +0 -26
- data/vendor/jsdoc/app/plugins/symbolLink.js +0 -9
- data/vendor/jsdoc/app/plugins/tagParamConfig.js +0 -31
- data/vendor/jsdoc/app/plugins/tagSynonyms.js +0 -43
- data/vendor/jsdoc/app/run.js +0 -346
- data/vendor/jsdoc/app/t/TestDoc.js +0 -144
- data/vendor/jsdoc/app/t/runner.js +0 -13
- data/vendor/jsdoc/app/test.js +0 -304
- data/vendor/jsdoc/app/test/addon.js +0 -24
- data/vendor/jsdoc/app/test/anon_inner.js +0 -14
- data/vendor/jsdoc/app/test/augments.js +0 -31
- data/vendor/jsdoc/app/test/augments2.js +0 -26
- data/vendor/jsdoc/app/test/borrows.js +0 -41
- data/vendor/jsdoc/app/test/borrows2.js +0 -23
- data/vendor/jsdoc/app/test/config.js +0 -22
- data/vendor/jsdoc/app/test/constructs.js +0 -18
- data/vendor/jsdoc/app/test/encoding.js +0 -10
- data/vendor/jsdoc/app/test/encoding_other.js +0 -12
- data/vendor/jsdoc/app/test/functions_anon.js +0 -39
- data/vendor/jsdoc/app/test/functions_nested.js +0 -33
- data/vendor/jsdoc/app/test/global.js +0 -13
- data/vendor/jsdoc/app/test/globals.js +0 -25
- data/vendor/jsdoc/app/test/ignore.js +0 -10
- data/vendor/jsdoc/app/test/inner.js +0 -16
- data/vendor/jsdoc/app/test/jsdoc_test.js +0 -477
- data/vendor/jsdoc/app/test/lend.js +0 -33
- data/vendor/jsdoc/app/test/memberof.js +0 -20
- data/vendor/jsdoc/app/test/memberof_constructor.js +0 -15
- data/vendor/jsdoc/app/test/name.js +0 -19
- data/vendor/jsdoc/app/test/namespace_nested.js +0 -23
- data/vendor/jsdoc/app/test/nocode.js +0 -13
- data/vendor/jsdoc/app/test/oblit_anon.js +0 -20
- data/vendor/jsdoc/app/test/overview.js +0 -20
- data/vendor/jsdoc/app/test/param_inline.js +0 -37
- data/vendor/jsdoc/app/test/params_optional.js +0 -8
- data/vendor/jsdoc/app/test/prototype.js +0 -17
- data/vendor/jsdoc/app/test/prototype_nested.js +0 -9
- data/vendor/jsdoc/app/test/prototype_oblit.js +0 -13
- data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +0 -24
- data/vendor/jsdoc/app/test/public.js +0 -10
- data/vendor/jsdoc/app/test/shared.js +0 -42
- data/vendor/jsdoc/app/test/shared2.js +0 -2
- data/vendor/jsdoc/app/test/shortcuts.js +0 -22
- data/vendor/jsdoc/app/test/static_this.js +0 -13
- data/vendor/jsdoc/app/test/synonyms.js +0 -23
- data/vendor/jsdoc/app/test/tosource.js +0 -23
- data/vendor/jsdoc/app/test/variable_redefine.js +0 -14
- data/vendor/jsdoc/changes.txt +0 -47
- data/vendor/jsdoc/conf/sample.conf +0 -31
- data/vendor/jsdoc/java/build.xml +0 -36
- data/vendor/jsdoc/java/build_1.4.xml +0 -36
- data/vendor/jsdoc/java/classes/js.jar +0 -0
- data/vendor/jsdoc/java/src/JsDebugRun.java +0 -21
- data/vendor/jsdoc/java/src/JsRun.java +0 -21
- data/vendor/jsdoc/jsdebug.jar +0 -0
- data/vendor/jsdoc/jsrun.jar +0 -0
- data/vendor/jsdoc/t/TestDoc.js +0 -144
- data/vendor/jsdoc/t/runner.js +0 -13
- data/vendor/jsdoc/test.js +0 -304
- data/vendor/jsdoc/test/addon.js +0 -24
- data/vendor/jsdoc/test/anon_inner.js +0 -14
- data/vendor/jsdoc/test/augments.js +0 -31
- data/vendor/jsdoc/test/augments2.js +0 -26
- data/vendor/jsdoc/test/borrows.js +0 -41
- data/vendor/jsdoc/test/borrows2.js +0 -23
- data/vendor/jsdoc/test/config.js +0 -22
- data/vendor/jsdoc/test/constructs.js +0 -18
- data/vendor/jsdoc/test/encoding.js +0 -10
- data/vendor/jsdoc/test/encoding_other.js +0 -12
- data/vendor/jsdoc/test/functions_anon.js +0 -39
- data/vendor/jsdoc/test/functions_nested.js +0 -33
- data/vendor/jsdoc/test/global.js +0 -13
- data/vendor/jsdoc/test/globals.js +0 -25
- data/vendor/jsdoc/test/ignore.js +0 -10
- data/vendor/jsdoc/test/inner.js +0 -16
- data/vendor/jsdoc/test/jsdoc_test.js +0 -477
- data/vendor/jsdoc/test/lend.js +0 -33
- data/vendor/jsdoc/test/memberof.js +0 -20
- data/vendor/jsdoc/test/memberof_constructor.js +0 -15
- data/vendor/jsdoc/test/name.js +0 -19
- data/vendor/jsdoc/test/namespace_nested.js +0 -23
- data/vendor/jsdoc/test/nocode.js +0 -13
- data/vendor/jsdoc/test/oblit_anon.js +0 -20
- data/vendor/jsdoc/test/overview.js +0 -20
- data/vendor/jsdoc/test/param_inline.js +0 -37
- data/vendor/jsdoc/test/params_optional.js +0 -8
- data/vendor/jsdoc/test/prototype.js +0 -17
- data/vendor/jsdoc/test/prototype_nested.js +0 -9
- data/vendor/jsdoc/test/prototype_oblit.js +0 -13
- data/vendor/jsdoc/test/prototype_oblit_constructor.js +0 -24
- data/vendor/jsdoc/test/public.js +0 -10
- data/vendor/jsdoc/test/shared.js +0 -42
- data/vendor/jsdoc/test/shared2.js +0 -2
- data/vendor/jsdoc/test/shortcuts.js +0 -22
- data/vendor/jsdoc/test/static_this.js +0 -13
- data/vendor/jsdoc/test/synonyms.js +0 -23
- data/vendor/jsdoc/test/tosource.js +0 -23
- data/vendor/jsdoc/test/variable_redefine.js +0 -14
@@ -333,7 +333,6 @@ SC.AlertPane = SC.PanelPane.extend(
|
|
333
333
|
localize: YES,
|
334
334
|
titleMinWidth: 64,
|
335
335
|
layout: { right: 5, height: 'auto', width: 'auto', bottom: 0 },
|
336
|
-
theme: 'capsule',
|
337
336
|
isCancel: YES,
|
338
337
|
action: "dismiss",
|
339
338
|
isVisible: NO
|
@@ -345,7 +344,6 @@ SC.AlertPane = SC.PanelPane.extend(
|
|
345
344
|
localize: YES,
|
346
345
|
titleMinWidth: 64,
|
347
346
|
layout: { left: 0, height: 'auto', width: 'auto', bottom: 0 },
|
348
|
-
theme: 'capsule',
|
349
347
|
isDefault: YES,
|
350
348
|
action: "dismiss",
|
351
349
|
isVisible: NO
|
@@ -361,7 +359,6 @@ SC.AlertPane = SC.PanelPane.extend(
|
|
361
359
|
localize: YES,
|
362
360
|
titleMinWidth: 64,
|
363
361
|
layout: { left: 0, height: 'auto', width: 'auto', bottom: 0 },
|
364
|
-
theme: 'capsule',
|
365
362
|
action: "dismiss",
|
366
363
|
isVisible: NO
|
367
364
|
})]
|
@@ -444,7 +441,7 @@ SC.AlertPane.mixin(
|
|
444
441
|
var pane = this.create(args),
|
445
442
|
idx = 0,
|
446
443
|
buttons = args.buttons,
|
447
|
-
buttonView, title, action, target;
|
444
|
+
buttonView, title, action, target, themeName;
|
448
445
|
|
449
446
|
if(buttons) {
|
450
447
|
buttons.forEach(function(button) {
|
@@ -454,14 +451,15 @@ SC.AlertPane.mixin(
|
|
454
451
|
title = button.title;
|
455
452
|
action = button.action;
|
456
453
|
target = button.target;
|
454
|
+
themeName = args.themeName || 'capsule';
|
457
455
|
|
458
456
|
buttonView.set('title'.fmt(idx), title);
|
459
457
|
if(action) buttonView.set('customAction'.fmt(idx), action);
|
460
458
|
if(target) buttonView.set('target'.fmt(idx), target);
|
461
459
|
buttonView.set('isVisible', !!title);
|
460
|
+
buttonView.set('themeName', themeName);
|
462
461
|
});
|
463
|
-
}
|
464
|
-
else {
|
462
|
+
} else {
|
465
463
|
// if there are no buttons defined, just add the standard OK button
|
466
464
|
buttonView = pane.get('button1');
|
467
465
|
buttonView.set('title', "OK");
|
@@ -556,7 +554,8 @@ SC.AlertPane.mixin(
|
|
556
554
|
description: normalizedArgs[1],
|
557
555
|
caption: normalizedArgs[2],
|
558
556
|
delegate: normalizedArgs[7],
|
559
|
-
icon: (normalizedArgs[6] || 'sc-icon-alert-48')
|
557
|
+
icon: (normalizedArgs[6] || 'sc-icon-alert-48'),
|
558
|
+
themeName: 'capsule'
|
560
559
|
};
|
561
560
|
|
562
561
|
// set buttons if there are any (and check if it's a string, since last
|
@@ -803,14 +803,17 @@ SC.PickerPane = SC.PalettePane.extend(
|
|
803
803
|
target = this.get('removeTarget') || null,
|
804
804
|
action = this.get('removeAction'),
|
805
805
|
rootResponder = this.get('rootResponder');
|
806
|
-
|
806
|
+
|
807
807
|
if (!this.clickInside(f, evt)) {
|
808
|
+
// We're not in the Pane so we must be in the modal
|
808
809
|
if (action) {
|
809
810
|
rootResponder.sendAction(action, target, this, this, null, this);
|
810
811
|
} else this.remove();
|
812
|
+
|
813
|
+
return YES;
|
811
814
|
}
|
812
|
-
|
813
|
-
return
|
815
|
+
|
816
|
+
return NO;
|
814
817
|
},
|
815
818
|
|
816
819
|
/** @private */
|
@@ -12,7 +12,7 @@ module("SC.AlertPane UI");
|
|
12
12
|
|
13
13
|
var pane ;
|
14
14
|
|
15
|
-
function evaluatePane(pane, message, description, caption, button1Title, button2Title, button3Title, iconClass) {
|
15
|
+
function evaluatePane(pane, message, description, caption, button1Title, button2Title, button3Title, iconClass, themeName) {
|
16
16
|
// wrapper
|
17
17
|
ok(pane.get('isVisibleInWindow'), 'pane.isVisibleInWindow should be YES');
|
18
18
|
ok(pane.$().hasClass('sc-alert'), 'pane should have sc-alert class');
|
@@ -67,6 +67,11 @@ function evaluatePane(pane, message, description, caption, button1Title, button2
|
|
67
67
|
} else {
|
68
68
|
ok(button3.$().hasClass('sc-hidden'), 'pane.div button3 should be hidden');
|
69
69
|
}
|
70
|
+
|
71
|
+
if (!themeName) themeName = 'capsule';
|
72
|
+
ok(button1.$().hasClass(themeName), 'pane.div.div button1 shoud have class ' + themeName);
|
73
|
+
ok(button2.$().hasClass(themeName), 'pane.div.div button2 shoud have class ' + themeName);
|
74
|
+
ok(button3.$().hasClass(themeName), 'pane.div.div button3 shoud have class ' + themeName);
|
70
75
|
}
|
71
76
|
|
72
77
|
test("AlertPane.show with icon, message, description, caption and 3 buttons", function() {
|
@@ -318,3 +323,22 @@ test("users interaction with mutiple alert panes with 1-3 buttons - old style",
|
|
318
323
|
|
319
324
|
ok(didDismiss, "should dismiss all buttons");
|
320
325
|
}) ;
|
326
|
+
|
327
|
+
|
328
|
+
test("AlertPane.show with custom themeName", function() {
|
329
|
+
pane = SC.AlertPane.show({
|
330
|
+
themeName: 'AlertPane.themeName',
|
331
|
+
message: 'AlertPane.message',
|
332
|
+
description: 'AlertPane.description',
|
333
|
+
caption: 'AlertPane.caption',
|
334
|
+
icon: 'sc-icon-tools-24',
|
335
|
+
delegate: this,
|
336
|
+
buttons: [
|
337
|
+
{ title: 'okButtonTitle' },
|
338
|
+
{ title: 'cancelButtonTitle' },
|
339
|
+
{ title: 'extraButtonTitle' }
|
340
|
+
]
|
341
|
+
});
|
342
|
+
evaluatePane(pane, "AlertPane.message", 'AlertPane.description', 'AlertPane.caption', "okButtonTitle", "cancelButtonTitle", 'extraButtonTitle', 'sc-icon-tools-24', 'AlertPane.themeName');
|
343
|
+
pane.dismiss();
|
344
|
+
});
|
@@ -25,6 +25,7 @@
|
|
25
25
|
itemTitleKey: 'title',
|
26
26
|
itemValueKey: 'value',
|
27
27
|
itemIconKey: 'icon',
|
28
|
+
controlSize: SC.LARGE_CONTROL_SIZE,
|
28
29
|
layout: { left:12, height: 200, right:12, top:12 }
|
29
30
|
|
30
31
|
})
|
@@ -40,9 +41,11 @@
|
|
40
41
|
|
41
42
|
itemTitleKey: 'title',
|
42
43
|
itemValueKey: 'value',
|
44
|
+
controlSize: SC.SMALL_CONTROL_SIZE,
|
43
45
|
layout: { left:12, height: 200, right:12, top:12 }
|
44
46
|
|
45
47
|
})
|
48
|
+
|
46
49
|
.add("tabView3", SC.TabView, {
|
47
50
|
|
48
51
|
items: [
|
@@ -81,11 +84,27 @@
|
|
81
84
|
|
82
85
|
test("Check that the tabView has the right classes set", function() {
|
83
86
|
var view = pane.view('tabView1');
|
84
|
-
var viewElem = view.$()
|
87
|
+
var viewElem = view.$(),
|
88
|
+
segmentedView;
|
89
|
+
|
90
|
+
segmentedView = view.get('segmentedView');
|
91
|
+
|
85
92
|
ok(viewElem.hasClass('sc-view'), 'tabView1.hasClass(sc-view) should be YES');
|
86
93
|
ok(viewElem.hasClass('sc-tab-view'), 'tabView1.hasClass(sc-tab-view) should be YES');
|
87
94
|
ok(view.$('.sc-segmented-view').length, 'tabView1 should contain a segmented view');
|
88
95
|
ok(view.$('.sc-container-view').length, 'tabView1 should contain a container view');
|
96
|
+
ok(view.$('.sc-segmented-view').hasClass('sc-large-size'), 'tabView1 should contain a segmented view with sc-large-size class');
|
97
|
+
equals(SC.LARGE_CONTROL_SIZE, segmentedView.get('controlSize'), "tabView1's segmentedView's controlSize");
|
98
|
+
|
99
|
+
view = pane.view('tabView2');
|
100
|
+
segmentedView = view.get('segmentedView');
|
101
|
+
ok(view.$('.sc-segmented-view').hasClass('sc-small-size'), 'tabView2 should contain a segmented view with sc-small-size class');
|
102
|
+
equals(SC.SMALL_CONTROL_SIZE, segmentedView.get('controlSize'), "tabView2's segmentedView's controlSize");
|
103
|
+
|
104
|
+
view = pane.view('tabView3');
|
105
|
+
segmentedView = view.get('segmentedView');
|
106
|
+
ok(view.$('.sc-segmented-view').hasClass('sc-regular-size'), 'tabView3 should contain a segmented view with sc-regular-size class');
|
107
|
+
equals(undefined, segmentedView.get('controlSize'), "tabView3's segmentedView's controlSize");
|
89
108
|
});
|
90
109
|
|
91
110
|
|
@@ -28,13 +28,13 @@ SC.TOP_TOOLBAR_LOCATION = 'top-toolbar';
|
|
28
28
|
*/
|
29
29
|
SC.BOTTOM_LOCATION = 'bottom';
|
30
30
|
|
31
|
-
/**
|
31
|
+
/**
|
32
32
|
@class
|
33
33
|
|
34
34
|
Incorporates a segmented view and a container view to display the selected
|
35
35
|
tab. Provide an array of items, which will be passed onto the segmented
|
36
36
|
view.
|
37
|
-
|
37
|
+
|
38
38
|
@extends SC.View
|
39
39
|
@since SproutCore 1.0
|
40
40
|
*/
|
@@ -47,7 +47,7 @@ SC.TabView = SC.View.extend(
|
|
47
47
|
@see SC.View#classNames
|
48
48
|
*/
|
49
49
|
classNames: ['sc-tab-view'],
|
50
|
-
|
50
|
+
|
51
51
|
/**
|
52
52
|
@type Array
|
53
53
|
@default ['nowShowing']
|
@@ -57,97 +57,97 @@ SC.TabView = SC.View.extend(
|
|
57
57
|
|
58
58
|
// ..........................................................
|
59
59
|
// PROPERTIES
|
60
|
-
//
|
60
|
+
//
|
61
61
|
|
62
|
-
/**
|
62
|
+
/**
|
63
63
|
Set nowShowing with the page you want to display.
|
64
|
-
|
64
|
+
|
65
65
|
@type String
|
66
66
|
@default null
|
67
67
|
*/
|
68
68
|
nowShowing: null,
|
69
|
-
|
69
|
+
|
70
70
|
/**
|
71
71
|
@type Array
|
72
72
|
@default []
|
73
73
|
*/
|
74
74
|
items: [],
|
75
|
-
|
75
|
+
|
76
76
|
/**
|
77
77
|
@type Boolean
|
78
78
|
@default YES
|
79
79
|
*/
|
80
80
|
isEnabled: YES,
|
81
|
-
|
81
|
+
|
82
82
|
/**
|
83
83
|
@type String
|
84
84
|
@default null
|
85
85
|
*/
|
86
86
|
itemTitleKey: null,
|
87
|
-
|
87
|
+
|
88
88
|
/**
|
89
89
|
@type String
|
90
90
|
@default null
|
91
91
|
*/
|
92
92
|
itemValueKey: null,
|
93
|
-
|
93
|
+
|
94
94
|
/**
|
95
95
|
@type String
|
96
96
|
@default null
|
97
97
|
*/
|
98
98
|
itemIsEnabledKey: null,
|
99
|
-
|
99
|
+
|
100
100
|
/**
|
101
101
|
@type String
|
102
102
|
@default null
|
103
103
|
*/
|
104
104
|
itemIconKey: null,
|
105
|
-
|
105
|
+
|
106
106
|
/**
|
107
107
|
@type String
|
108
108
|
@default null
|
109
109
|
*/
|
110
110
|
itemWidthKey: null,
|
111
|
-
|
111
|
+
|
112
112
|
/**
|
113
113
|
@type String
|
114
114
|
@default null
|
115
115
|
*/
|
116
116
|
itemToolTipKey: null,
|
117
|
-
|
117
|
+
|
118
118
|
/**
|
119
119
|
@type Number
|
120
120
|
@default SC.REGULAR_BUTTON_HEIGHT
|
121
121
|
*/
|
122
122
|
tabHeight: SC.REGULAR_BUTTON_HEIGHT,
|
123
|
-
|
123
|
+
|
124
124
|
/**
|
125
125
|
Possible values:
|
126
|
-
|
126
|
+
|
127
127
|
- SC.TOP_LOCATION
|
128
128
|
- SC.TOP_TOOLBAR_LOCATION
|
129
129
|
- SC.BOTTOM_LOCATION
|
130
|
-
|
130
|
+
|
131
131
|
@type String
|
132
132
|
@default SC.TOP_LOCATION
|
133
133
|
*/
|
134
134
|
tabLocation: SC.TOP_LOCATION,
|
135
|
-
|
136
|
-
/**
|
135
|
+
|
136
|
+
/**
|
137
137
|
If set, then the tab location will be automatically saved in the user
|
138
138
|
defaults. Browsers that support localStorage will automatically store
|
139
139
|
this information locally.
|
140
|
-
|
140
|
+
|
141
141
|
@type String
|
142
142
|
@default null
|
143
143
|
*/
|
144
144
|
userDefaultKey: null,
|
145
|
-
|
146
|
-
|
145
|
+
|
146
|
+
|
147
147
|
// ..........................................................
|
148
148
|
// FORWARDING PROPERTIES
|
149
|
-
//
|
150
|
-
|
149
|
+
//
|
150
|
+
|
151
151
|
// forward important changes on to child views
|
152
152
|
/** @private */
|
153
153
|
_tab_nowShowingDidChange: function() {
|
@@ -166,11 +166,11 @@ SC.TabView = SC.View.extend(
|
|
166
166
|
SC.userDefaults.set([defaultKey,'nowShowing'].join(':'), v);
|
167
167
|
}
|
168
168
|
}.observes('nowShowing'),
|
169
|
-
|
169
|
+
|
170
170
|
/** @private */
|
171
171
|
_tab_itemsDidChange: function() {
|
172
172
|
this.get('segmentedView').set('items', this.get('items'));
|
173
|
-
return this ;
|
173
|
+
return this ;
|
174
174
|
}.observes('items'),
|
175
175
|
|
176
176
|
/** @private
|
@@ -183,7 +183,7 @@ SC.TabView = SC.View.extend(
|
|
183
183
|
|
184
184
|
/** @private */
|
185
185
|
awake: function() {
|
186
|
-
sc_super();
|
186
|
+
sc_super();
|
187
187
|
var defaultKey = this.get('userDefaultKey');
|
188
188
|
if (defaultKey) {
|
189
189
|
defaultKey = [defaultKey,'nowShowing'].join(':');
|
@@ -192,12 +192,13 @@ SC.TabView = SC.View.extend(
|
|
192
192
|
}
|
193
193
|
|
194
194
|
},
|
195
|
-
|
195
|
+
|
196
196
|
/** @private */
|
197
197
|
createChildViews: function() {
|
198
198
|
var childViews = [], view, containerView, layout,
|
199
199
|
tabLocation = this.get('tabLocation'),
|
200
|
-
tabHeight = this.get('tabHeight')
|
200
|
+
tabHeight = this.get('tabHeight'),
|
201
|
+
controlSize = this.get('controlSize');
|
201
202
|
|
202
203
|
if (tabLocation === SC.TOP_LOCATION) {
|
203
204
|
layout = { top: tabHeight/2+1, left: 0, right: 0, bottom: 0, border: 1 };
|
@@ -215,11 +216,11 @@ SC.TabView = SC.View.extend(
|
|
215
216
|
|
216
217
|
view = this.containerView = this.createChildView(containerView) ;
|
217
218
|
childViews.push(view);
|
218
|
-
|
219
|
+
|
219
220
|
// The segmentedView managed by this tab view. Note that this TabView uses
|
220
221
|
// a custom segmented view. You can access this view but you cannot change
|
221
222
|
// it.
|
222
|
-
layout = (tabLocation === SC.TOP_LOCATION ||
|
223
|
+
layout = (tabLocation === SC.TOP_LOCATION ||
|
223
224
|
tabLocation === SC.TOP_TOOLBAR_LOCATION) ?
|
224
225
|
{ height: tabHeight, left: 0, right: 0, top: 0 } :
|
225
226
|
{ height: tabHeight, left: 0, right: 0, bottom: 0 } ;
|
@@ -227,23 +228,19 @@ SC.TabView = SC.View.extend(
|
|
227
228
|
this.segmentedView = this.get('segmentedView').extend({
|
228
229
|
layout: layout,
|
229
230
|
|
231
|
+
controlSize: controlSize,
|
232
|
+
|
230
233
|
/** @private
|
231
234
|
When the value changes, update the parentView's value as well.
|
232
235
|
*/
|
233
236
|
_sc_tab_segmented_valueDidChange: function() {
|
234
237
|
var pv = this.get('parentView');
|
235
238
|
if (pv) pv.set('nowShowing', this.get('value'));
|
236
|
-
|
237
|
-
// FIXME: why is this necessary? 'value' is a displayProperty and should
|
238
|
-
// automatically cause displayDidChange() to fire, which should cause
|
239
|
-
// the two lines below to execute in the normal course of things...
|
240
|
-
this.set('layerNeedsUpdate', YES) ;
|
241
|
-
this.invokeOnce(this.updateLayerIfNeeded) ;
|
242
239
|
}.observes('value'),
|
243
240
|
|
244
241
|
/** @private */
|
245
242
|
init: function() {
|
246
|
-
// before we setup the rest of the view, copy key config properties
|
243
|
+
// before we setup the rest of the view, copy key config properties
|
247
244
|
// from the owner view...
|
248
245
|
var pv = this.get('parentView');
|
249
246
|
if (pv) {
|
@@ -252,35 +249,35 @@ SC.TabView = SC.View.extend(
|
|
252
249
|
return sc_super();
|
253
250
|
}
|
254
251
|
});
|
255
|
-
|
252
|
+
|
256
253
|
view = this.segmentedView = this.createChildView(this.segmentedView) ;
|
257
254
|
childViews.push(view);
|
258
|
-
|
255
|
+
|
259
256
|
this.set('childViews', childViews);
|
260
|
-
return this;
|
257
|
+
return this;
|
261
258
|
},
|
262
|
-
|
259
|
+
|
263
260
|
// ..........................................................
|
264
261
|
// COMPONENT VIEWS
|
265
|
-
//
|
262
|
+
//
|
266
263
|
|
267
264
|
/**
|
268
|
-
The containerView managed by this tab view. Note that TabView uses a
|
269
|
-
custom container view. You can access this view but you cannot change
|
265
|
+
The containerView managed by this tab view. Note that TabView uses a
|
266
|
+
custom container view. You can access this view but you cannot change
|
270
267
|
it.
|
271
|
-
|
268
|
+
|
272
269
|
@type SC.View
|
273
270
|
@default SC.ContainerView
|
274
271
|
@readOnly
|
275
272
|
*/
|
276
273
|
containerView: SC.ContainerView.extend({ renderDelegateName: 'wellRenderDelegate' }),
|
277
|
-
|
274
|
+
|
278
275
|
/**
|
279
276
|
@type SC.View
|
280
277
|
@default SC.SegmentedView
|
281
278
|
*/
|
282
279
|
segmentedView: SC.SegmentedView
|
283
|
-
|
280
|
+
|
284
281
|
}) ;
|
285
282
|
|
286
283
|
SC._TAB_ITEM_KEYS = ['itemTitleKey', 'itemValueKey', 'itemIsEnabledKey', 'itemIconKey', 'itemWidthKey', 'itemToolTipKey', 'itemActionKey', 'itemTargetKey'];
|