Permalink
Browse files

Merge branch 'postback'

  • Loading branch information...
wagenet committed Jun 1, 2011
2 parents e7070ba + 205887c commit b460b3f505550aaeb7d5c12b6d3b134d26465831
Showing with 4,299 additions and 774 deletions.
  1. +5 −1 Buildfile
  2. +12 −0 apps/test_controls/controllers/select.js
  3. +19 −5 apps/test_controls/resources/select_page.js
  4. +28 −27 frameworks/ajax/system/request.js
  5. +7 −0 frameworks/ajax/system/response.js
  6. +1 −1 frameworks/core_foundation/mixins/responder_context.js
  7. +2 −0 frameworks/core_foundation/panes/keyboard.js
  8. +11 −3 frameworks/core_foundation/panes/pane.js
  9. +80 −0 frameworks/core_foundation/resources/base.css
  10. +39 −0 frameworks/core_foundation/resources/fonts.css
  11. +126 −0 frameworks/core_foundation/resources/reset.css
  12. +157 −5 frameworks/core_foundation/system/locale.js
  13. +5 −5 frameworks/core_foundation/system/render_context.js
  14. +9 −3 frameworks/core_foundation/system/root_responder.js
  15. +100 −0 frameworks/core_foundation/system/string.js
  16. +3 −56 frameworks/core_foundation/system/theme.js
  17. +41 −1 frameworks/core_foundation/tests/mixins/string.js
  18. +10 −6 frameworks/core_foundation/tests/views/view/insertBefore.js
  19. +18 −1 frameworks/core_foundation/tests/views/view/keyboard.js
  20. +7 −2 frameworks/core_foundation/views/view.js
  21. +15 −3 frameworks/core_foundation/views/view/keyboard.js
  22. +8 −18 frameworks/core_foundation/views/view/theming.js
  23. +1 −1 frameworks/datastore/system/nested_store.js
  24. +1 −0 frameworks/desktop/panes/alert.js
  25. +18 −1 frameworks/desktop/panes/menu.js
  26. +9 −0 frameworks/desktop/panes/panel.js
  27. +1 −1 frameworks/desktop/render_delegates/button.js
  28. +1 −1 frameworks/desktop/render_delegates/checkbox.js
  29. +1 −1 frameworks/desktop/render_delegates/collection.js
  30. +1 −1 frameworks/desktop/render_delegates/disclosure.js
  31. +1 −1 frameworks/desktop/render_delegates/image_button.js
  32. +3 −2 frameworks/desktop/render_delegates/master_detail.js
  33. +12 −2 frameworks/desktop/render_delegates/menu.js
  34. +1 −1 frameworks/desktop/render_delegates/panel.js
  35. +1 −1 frameworks/desktop/render_delegates/picker.js
  36. +1 −1 frameworks/desktop/render_delegates/progress.js
  37. +1 −1 frameworks/desktop/render_delegates/radio.js
  38. +2 −2 frameworks/desktop/render_delegates/radio_group.js
  39. +1 −1 frameworks/desktop/render_delegates/segment.js
  40. +1 −1 frameworks/desktop/render_delegates/segmented.js
  41. +1 −1 frameworks/desktop/render_delegates/slider.js
  42. +1 −1 frameworks/desktop/render_delegates/toolbar.js
  43. +1 −1 frameworks/desktop/render_delegates/well.js
  44. +1 −1 frameworks/desktop/render_delegates/workspace.js
  45. +1 −0 frameworks/desktop/resources/segmented.css
  46. +20 −1 frameworks/desktop/tests/panes/panel/methods.js
  47. +10 −3 frameworks/desktop/tests/views/checkbox/methods.js
  48. +34 −7 frameworks/desktop/tests/views/date_field/methods.js
  49. +14 −15 frameworks/desktop/views/button.js
  50. +40 −14 frameworks/desktop/views/checkbox.js
  51. +2 −2 frameworks/desktop/views/list_item.js
  52. +11 −1 frameworks/desktop/views/master_detail.js
  53. +16 −6 frameworks/desktop/views/menu_item.js
  54. +49 −7 frameworks/desktop/views/radio.js
  55. +4 −1 frameworks/desktop/views/select_field.js
  56. +4 −26 frameworks/desktop/views/slider.js
  57. +20 −19 frameworks/desktop/views/web.js
  58. +0 −5 frameworks/experimental/frameworks/forms/english.lproj/default_styles.css
  59. +0 −15 frameworks/experimental/frameworks/forms/english.lproj/strings.js
  60. +13 −5 frameworks/experimental/frameworks/forms/mixins/edit_mode.js
  61. +53 −37 frameworks/experimental/frameworks/forms/mixins/emptiness.js
  62. +2 −1 frameworks/experimental/frameworks/forms/render_delegates/form.js
  63. +3 −11 frameworks/experimental/frameworks/forms/render_delegates/form_row.js
  64. +53 −0 frameworks/experimental/frameworks/forms/tests/mixins/edit_mode.js
  65. +114 −0 frameworks/experimental/frameworks/forms/tests/mixins/emptiness.js
  66. +174 −6 frameworks/experimental/frameworks/forms/tests/views/form.js
  67. +0 −17 frameworks/experimental/frameworks/forms/tests/views/form_checkbox_field.js
  68. +0 −17 frameworks/experimental/frameworks/forms/tests/views/form_field.js
  69. +0 −17 frameworks/experimental/frameworks/forms/tests/views/form_label.js
  70. +0 −17 frameworks/experimental/frameworks/forms/tests/views/form_radio_field.js
  71. +86 −6 frameworks/experimental/frameworks/forms/tests/views/form_row.js
  72. +0 −17 frameworks/experimental/frameworks/forms/tests/views/form_text_field.js
  73. +80 −110 frameworks/experimental/frameworks/forms/views/form.js
  74. +96 −97 frameworks/experimental/frameworks/forms/views/form_row.js
  75. +121 −0 frameworks/experimental/frameworks/select_view/ext/menu.js
  76. +90 −0 frameworks/experimental/frameworks/select_view/ext/menu_item.js
  77. +139 −0 frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js
  78. +14 −0 frameworks/experimental/frameworks/select_view/render_delegates/select_button.js
  79. +25 −0 frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js
  80. +43 −0 frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js
  81. +32 −0 frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js
  82. +40 −0 frameworks/experimental/frameworks/select_view/tests/views/popup_button/menu_setup.js
  83. +45 −0 frameworks/experimental/frameworks/select_view/tests/views/popup_button/show_menu.js
  84. +49 −0 frameworks/experimental/frameworks/select_view/tests/views/select/menu_width.js
  85. +191 −0 frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js
  86. +264 −0 frameworks/experimental/frameworks/select_view/views/popup_button.js
  87. +450 −0 frameworks/experimental/frameworks/select_view/views/select.js
  88. +13 −5 frameworks/experimental/frameworks/split_view/mixins/split_child.js
  89. +1 −1 frameworks/experimental/frameworks/split_view/render_delegates/split.js
  90. +1 −1 frameworks/experimental/frameworks/split_view/render_delegates/split_divider.js
  91. +9 −0 frameworks/experimental/frameworks/split_view/views/split.js
  92. +7 −17 frameworks/foundation/mixins/auto_resize.js
  93. +35 −8 frameworks/foundation/mixins/flowed_layout.js
  94. +1 −1 frameworks/foundation/render_delegates/canvas_image.js
  95. +1 −1 frameworks/foundation/render_delegates/image.js
  96. +1 −1 frameworks/foundation/render_delegates/label.js
  97. +6 −6 frameworks/foundation/render_delegates/render_delegate.js
  98. BIN frameworks/foundation/resources/images/favicon.ico
  99. +0 −2 frameworks/foundation/resources/text_field.css
  100. +4 −2 frameworks/foundation/system/exception_handler.js
  101. +13 −0 frameworks/foundation/system/module.js
  102. +6 −9 frameworks/foundation/system/utils/string_measurement.js
  103. +912 −0 frameworks/foundation/tests/mixins/flowed_layout/tests.js
  104. +0 −15 frameworks/foundation/views/field.js
  105. +1 −1 frameworks/foundation/views/text_field.js
  106. +1 −1 frameworks/handlebars/handlebars.js
  107. +13 −7 frameworks/runtime/core.js
  108. +3 −2 frameworks/runtime/mixins/copyable.js
  109. +14 −14 frameworks/runtime/system/binding.js
  110. +3 −0 frameworks/runtime/system/error.js
  111. +1 −1 frameworks/runtime/system/logger.js
  112. +3 −3 frameworks/runtime/system/run_loop.js
  113. +15 −16 frameworks/runtime/system/set.js
  114. +6 −2 frameworks/runtime/tests/core/itemType.js
  115. +30 −0 frameworks/runtime/tests/system/object/enhance.js
  116. +4 −0 frameworks/statechart/system/state.js
  117. +2 −0 frameworks/statechart/system/statechart.js
  118. +0 −1 frameworks/testing/resources/runner.css
  119. +0 −4 frameworks/yuireset/resources/core.css
  120. +2 −1 lib/index.rhtml
  121. +3 −3 themes/ace/resources/collection/normal/list.css
  122. +2 −2 themes/ace/resources/collection/normal/list_item.css
  123. +9 −0 themes/ace/resources/form/form.css
  124. +3 −1 themes/ace/resources/menu/menu.css
  125. +1 −1 themes/ace/resources/picker/popover/picker.js
  126. +1 −1 themes/ace/resources/picker/popover/workspace.js
  127. +1 −1 themes/legacy_theme/render_delegates/button.js
  128. +1 −1 themes/legacy_theme/render_delegates/panel.js
  129. +2 −0 themes/legacy_theme/render_delegates/progress.js
  130. +1 −1 themes/legacy_theme/render_delegates/slider.js
  131. +1 −1 themes/legacy_theme/render_delegates/well.js
View
@@ -86,7 +86,11 @@ config :ace,
# CONFIGURE APPS
config :core_tools, :required => [
:desktop, :datastore, :animation, "sproutcore/experimental/forms",
- "sproutcore/ace", "sproutcore/experimental/split_view"
+ "sproutcore/ace",
+
+ # The SC apps will use the experimental version of these controls:
+ "sproutcore/experimental/select_view",
+ "sproutcore/experimental/split_view"
]
# mode :debug do
@@ -0,0 +1,12 @@
+// ==========================================================================
+// Project: SproutCore - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals TestControls */
+
+TestControls.buttonsController = SC.Controller.create({
+ selectedValue: 'printer:a'
+});
+
@@ -11,7 +11,7 @@ TestControls.selectPage = SC.View.design({
form: SC.FormView.design({
classNames: ["sample_controls"],
layout: { left: 20, top: 40, right: 20, bottom: 40 },
- childViews: "header normal disabled".w(),
+ childViews: "header normal strings disabled".w(),
// Plain Views
header: SC.LabelView.design({
@@ -27,16 +27,30 @@ TestControls.selectPage = SC.View.design({
{"name": "Printer A", "value": "printer:a"},
{"name": "Printer B", "value": "printer:b"},
{"name": "Printer C", "value": "printer:c"},
- {"separator": YES, name: "none" },
+
{"name": "Printer D", "value": "printer:d"},
{"name": "Printer E", "value": "printer:e"},
{"name": "Printer F", "value": "printer:f"},
+
+ {"separator": YES, name: "none" },
{"name": "MICR 1", "value": "printer:m1"},
- {"name": "MICR 2", "value": "printer:m2"}
+ {"name": "MICR 2", "value": "printer:m2"},
+
+ {"separator": YES, name: "Hi" },
+ {"name": "This name is Really Really Long, OK?", "value": "LONG" }
],
itemTitleKey: "name", itemValueKey: "value", itemSeparatorKey: "separator",
- value: null
+ value: 'printer:a',
+ valueBinding: 'TestControls.buttonsController.selectedValue'
})),
+
+ strings: SC.FormView.row(SC.SelectView.design({
+ layout: { width: 150, height: 24 },
+ items: ["printer:a", "printer:b", "printer:c", "printer:d", "printer:e", "printer:f", "printer:m1", "printer:m2", "LONG"],
+ value: 'printer:a',
+ valueBinding: 'TestControls.buttonsController.selectedValue'
+ })),
+
disabled: SC.FormView.row(SC.SelectView.design({
layout: { width: 150, height: 24 },
@@ -58,4 +72,4 @@ TestControls.selectPage = SC.View.design({
value: null
}))
})
-});
+});
@@ -64,18 +64,19 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
X-SproutCore-Version headers to all outgoing requests. This allows
you to override that behavior.
+ You may want to set this to NO if you are making simple CORS requests
+ in compatible browsers. See <a href="http://www.w3.org/TR/cors/">CORS
+ Spec for more informatinon.</a>
+
+ TODO: Add unit tests for this feature
+
@type Boolean
@default YES
*/
attachIdentifyingHeaders: YES,
init: function() {
sc_super();
-
- if (this.get('attachIdentifyingHeaders') !== NO) {
- this.header('X-Requested-With', 'XMLHttpRequest');
- this.header('X-SproutCore-Version', SC.VERSION);
- }
},
/**
@@ -354,15 +355,19 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
if (flag) { this.set('isJSON', NO); }
return this.set('isXML', flag);
},
-
- /**
- @private
-
- Called just before a request is enqueued. This will encode the body
- into JSON if it is not already encoded.
+
+ /**
+ Called just before a request is enqueued. This will encode the body
+ into JSON if it is not already encoded, and set identifying headers
*/
_prep: function() {
var hasContentType = !!this.header('Content-Type');
+
+ if(this.get('attachIdentifyingHeaders')) {
+ this.header('X-Requested-With', 'XMLHttpRequest');
+ this.header('X-SproutCore-Version', SC.VERSION);
+ }
+
if (this.get('isJSON') && !hasContentType) {
this.header('Content-Type', 'application/json');
} else if (this.get('isXML') && !hasContentType) {
@@ -469,50 +474,46 @@ SC.Request.mixin(
Helper method for quickly setting up a GET request.
@param {String} address url of request
- @param {Boolean} [attachHeaders] See documentation for SC.Request#attachIdentifyingHeaders
@returns {SC.Request} receiver
*/
- getUrl: function(address, attachHeaders) {
- return this.create({attachIdentifyingHeaders: attachHeaders}).set('address', address).set('type', 'GET');
+ getUrl: function(address) {
+ return this.create().set('address', address).set('type', 'GET');
},
/**
Helper method for quickly setting up a POST request.
@param {String} address url of request
@param {String} body
- @param {Boolean} [attachHeaders] See documentation for SC.Request#attachIdentifyingHeaders
@returns {SC.Request} receiver
*/
- postUrl: function(address, body, attachHeaders) {
- var req = this.create({attachIdentifyingHeaders: attachHeaders}).set('address', address).set('type', 'POST');
- if(body) { req.set('body', body); }
- return req;
+ postUrl: function(address, body) {
+ var req = this.create().set('address', address).set('type', 'POST');
+ if(body) { req.set('body', body) ; }
+ return req ;
},
/**
Helper method for quickly setting up a DELETE request.
@param {String} address url of request
- @param {Boolean} [attachHeaders] See documentation for SC.Request#attachIdentifyingHeaders
@returns {SC.Request} receiver
*/
- deleteUrl: function(address, attachHeaders) {
- return this.create({attachIdentifyingHeaders: attachHeaders}).set('address', address).set('type', 'DELETE');
+ deleteUrl: function(address) {
+ return this.create().set('address', address).set('type', 'DELETE');
},
/**
Helper method for quickly setting up a PUT request.
@param {String} address url of request
@param {String} body
- @param {Boolean} [attachHeaders] See documentation for SC.Request#attachIdentifyingHeaders
@returns {SC.Request} receiver
*/
- putUrl: function(address, body, attachHeaders) {
- var req = this.create({attachIdentifyingHeaders: attachHeaders}).set('address', address).set('type', 'PUT');
- if(body) { req.set('body', body); }
- return req;
+ putUrl: function(address, body) {
+ var req = this.create().set('address', address).set('type', 'PUT');
+ if(body) { req.set('body', body) ; }
+ return req ;
}
});
@@ -22,6 +22,13 @@
SC.Response = SC.Object.extend(
/** @scope SC.Response.prototype */ {
+ /**
+ Walk like a duck
+
+ @type Boolean
+ */
+ isResponse: YES,
+
/**
Becomes true if there was a failure. Makes this into an error object.
@@ -167,7 +167,7 @@ SC.ResponderContext = {
if (responder) responder.set('isFirstResponder', YES);
this._notifyDidBecomeFirstResponder(responder, responder, common);
-
+
// now, tell everyone the good news!
this.endPropertyChanges();
@@ -52,6 +52,8 @@ SC.Pane.reopen(
if (nextValidKeyView) {
this.makeFirstResponder(nextValidKeyView);
return YES;
+ }else if(!SC.TABBING_ONLY_INSIDE_DOCUMENT){
+ evt.allowDefault();
}
}
@@ -260,7 +260,9 @@ SC.Pane = SC.View.extend(SC.ResponderContext,
// if we are currently key pane, then notify key views of change also
if (isKeyPane) {
if (current) { current.tryToPerform('willLoseKeyResponderTo', view); }
- if (view) { view.tryToPerform('willBecomeKeyResponderFrom', current); }
+ if (view) {
+ view.tryToPerform('willBecomeKeyResponderFrom', current);
+ }
}
if (current) {
@@ -280,8 +282,12 @@ SC.Pane = SC.View.extend(SC.ResponderContext,
// and notify again if needed.
if (isKeyPane) {
- if (view) { view.tryToPerform('didBecomeKeyResponderFrom', current); }
- if (current) { current.tryToPerform('didLoseKeyResponderTo', view); }
+ if (view) {
+ console.log(view.toString());
+ view.tryToPerform('didBecomeKeyResponderFrom', current); }
+ if (current) {
+ current.tryToPerform('didLoseKeyResponderTo', view);
+ }
}
return this ;
@@ -315,6 +321,8 @@ SC.Pane = SC.View.extend(SC.ResponderContext,
},
+ didBecomeKeyResponderFrom: function(responder) {},
+
/**
Called just after the pane has lost its keyPane status. Notifies the
current keyView of the change. The keyView can use this method to do any
@@ -0,0 +1,80 @@
+/*
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 3.3.0
+build: 3167
+*/
+/* base.css, part of YUI's CSS Foundation */
+h1 {
+ /*18px via YUI Fonts CSS foundation*/
+ font-size:138.5%;
+}
+h2 {
+ /*16px via YUI Fonts CSS foundation*/
+ font-size:123.1%;
+}
+h3 {
+ /*14px via YUI Fonts CSS foundation*/
+ font-size:108%;
+}
+h1,h2,h3 {
+ /* top & bottom margin based on font size */
+ margin:1em 0;
+}
+h1,h2,h3,h4,h5,h6,strong {
+ /*bringing boldness back to headers and the strong element*/
+ font-weight:bold;
+}
+abbr,acronym {
+ /*indicating to users that more info is available */
+ border-bottom:1px dotted #000;
+ cursor:help;
+}
+em {
+ /*bringing italics back to the em element*/
+ font-style:italic;
+}
+blockquote,ul,ol,dl {
+ /*giving blockquotes and lists room to breath*/
+ margin:1em;
+}
+ol,ul,dl {
+ /*bringing lists on to the page with breathing room */
+ margin-left:2em;
+}
+ol li {
+ /*giving OL's LIs generated numbers*/
+ list-style: decimal outside;
+}
+ul li {
+ /*giving UL's LIs generated disc markers*/
+ list-style: disc outside;
+}
+dl dd {
+ /*providing spacing for definition terms*/
+ margin-left:1em;
+}
+th,td {
+ /*borders and padding to make the table readable*/
+ border:1px solid #000;
+ padding:.5em;
+}
+th {
+ /*distinguishing table headers from data cells*/
+ font-weight:bold;
+ text-align:center;
+}
+caption {
+ /*coordinated margin to match cell's padding*/
+ margin-bottom:.5em;
+ /*centered so it doesn't blend in to other content*/
+ text-align:center;
+}
+p,fieldset,table,pre {
+ /*so things don't run into each other*/
+ margin-bottom:1em;
+}
+/* setting a consistent width, 160px;
+ control of type=file still not possible */
+input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
@@ -0,0 +1,39 @@
+/*
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 3.3.0
+build: 3167
+*/
+
+
+/**
+ * Nudge down to get to 13px equivalent for these form elements
+ */
+select,
+input,
+button,
+textarea {
+ font:99% arial,helvetica,clean,sans-serif;
+}
+
+/**
+ * To help tables remember to inherit
+ */
+table {
+ font-size:inherit;
+ font:100%;
+}
+
+/**
+ * Bump up IE to get to 13px equivalent for these fixed-width elements
+ */
+pre,
+code,
+kbd,
+samp,
+tt {
+ font-family:monospace;
+ *font-size:108%;
+ line-height:100%;
+}
Oops, something went wrong.

0 comments on commit b460b3f

Please sign in to comment.