sproutcore 1.6.0.rc.2-x86-mingw32 → 1.6.0.1-x86-mingw32

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.
Files changed (209) hide show
  1. data/CHANGELOG +12 -0
  2. data/VERSION.yml +1 -1
  3. data/bin/sc-docs +6 -1
  4. data/lib/buildtasks/target.rake +1 -1
  5. data/lib/frameworks/sproutcore/Buildfile +5 -1
  6. data/lib/frameworks/sproutcore/CHANGELOG.md +175 -1
  7. data/lib/frameworks/sproutcore/apps/test_controls/controllers/select.js +12 -0
  8. data/lib/frameworks/sproutcore/apps/test_controls/resources/select_page.js +19 -5
  9. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +28 -31
  10. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +9 -2
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +21 -1
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/responder_context.js +1 -1
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +6 -1
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +26 -8
  15. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +2 -0
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +12 -5
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +25 -9
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +157 -5
  19. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +7 -6
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +9 -3
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -8
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +104 -4
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +3 -56
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +4 -2
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/content_destroyed.js +59 -0
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +41 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +10 -2
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +16 -1
  29. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +1 -1
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -0
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +18 -2
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +10 -6
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +18 -1
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +9 -1
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +9 -4
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +15 -3
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +14 -8
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +8 -18
  39. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +12 -2
  40. data/lib/frameworks/sproutcore/frameworks/datastore/mixins/relationship_support.js +296 -0
  41. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +1 -1
  42. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +330 -326
  43. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +22 -1
  44. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +1 -1
  45. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +614 -614
  46. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/data_source.js +14 -1
  47. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +3 -1
  48. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +2 -0
  49. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +2 -0
  50. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +20 -13
  51. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +61 -46
  52. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +30 -30
  53. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +24 -24
  54. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/connectDataSource.js +31 -0
  55. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushRelationships.js +1177 -0
  56. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +4 -63
  57. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +1 -1
  58. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +1 -1
  59. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +7 -8
  60. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +18 -1
  61. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +9 -0
  62. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +3 -3
  63. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +3 -3
  64. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +1 -1
  65. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +1 -1
  66. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +1 -1
  67. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +1 -1
  68. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +1 -1
  69. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +3 -2
  70. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js +12 -2
  71. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +1 -1
  72. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +1 -1
  73. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +1 -1
  74. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +1 -1
  75. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +2 -2
  76. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +1 -1
  77. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +1 -1
  78. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +1 -1
  79. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/toolbar.js +1 -1
  80. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/well.js +1 -1
  81. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/workspace.js +1 -1
  82. data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +1 -0
  83. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +33 -22
  84. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +20 -1
  85. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +10 -3
  86. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +34 -7
  87. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +14 -15
  88. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +40 -14
  89. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +699 -700
  90. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +2 -2
  91. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +11 -1
  92. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +16 -6
  93. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +0 -1
  94. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +49 -7
  95. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +9 -0
  96. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +6 -2
  97. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +4 -26
  98. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +20 -19
  99. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
  100. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +249 -249
  101. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/edit_mode.js +13 -5
  102. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/emptiness.js +53 -37
  103. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form.js +2 -1
  104. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form_row.js +3 -11
  105. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/edit_mode.js +53 -0
  106. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/emptiness.js +114 -0
  107. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form.js +174 -6
  108. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_row.js +86 -6
  109. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +80 -110
  110. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +96 -97
  111. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +2 -1
  112. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +20 -36
  113. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +121 -0
  114. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu_item.js +90 -0
  115. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js +139 -0
  116. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/render_delegates/select_button.js +14 -0
  117. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js +25 -0
  118. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js +43 -0
  119. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js +32 -0
  120. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/menu_setup.js +40 -0
  121. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/show_menu.js +45 -0
  122. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/menu_width.js +49 -0
  123. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js +191 -0
  124. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/popup_button.js +264 -0
  125. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +450 -0
  126. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_child.js +14 -6
  127. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_thumb.js +1 -1
  128. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split.js +1 -1
  129. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split_divider.js +1 -1
  130. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +9 -0
  131. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +3 -2
  132. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +7 -17
  133. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +1 -1
  134. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +35 -8
  135. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
  136. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor.js +1 -1
  137. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor_delegate.js +1 -1
  138. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +1 -1
  139. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +1 -1
  140. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/helpers/sizing.js +2 -0
  141. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +1 -1
  142. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +1 -1
  143. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +6 -6
  144. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/favicon.ico +0 -0
  145. data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +0 -5
  146. data/lib/frameworks/sproutcore/frameworks/foundation/system/exception_handler.js +4 -2
  147. data/lib/frameworks/sproutcore/frameworks/foundation/system/math.js +2 -1
  148. data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +13 -0
  149. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +6 -9
  150. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +912 -0
  151. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +36 -7
  152. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +58 -4
  153. data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +1 -3
  154. data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +0 -15
  155. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +2 -2
  156. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +25 -14
  157. data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1 -1
  158. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +15 -9
  159. data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/flatten.js +24 -0
  160. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +2 -1
  161. data/lib/frameworks/sproutcore/frameworks/runtime/ext/function.js +5 -5
  162. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +19 -0
  163. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +3 -2
  164. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +1 -1
  165. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1 -1
  166. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +14 -14
  167. data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +3 -0
  168. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +2 -2
  169. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +2 -2
  170. data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
  171. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +3 -3
  172. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +15 -16
  173. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +6 -2
  174. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +30 -0
  175. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +17 -0
  176. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +9 -2
  177. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +3 -1
  178. data/lib/frameworks/sproutcore/frameworks/testing/resources/runner.css +0 -1
  179. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/base.css +80 -0
  180. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/core.css +0 -4
  181. data/lib/frameworks/sproutcore/lib/index.rhtml +2 -1
  182. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +3 -3
  183. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
  184. data/lib/frameworks/sproutcore/themes/ace/resources/form/form.css +9 -0
  185. data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +3 -1
  186. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/picker.js +1 -1
  187. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/workspace.js +1 -1
  188. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +1 -1
  189. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/panel.js +1 -1
  190. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +2 -0
  191. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +1 -1
  192. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/well.js +1 -1
  193. data/lib/sproutcore/builders/base.rb +5 -1
  194. data/lib/sproutcore/builders/handlebars.rb +12 -1
  195. data/lib/sproutcore/models/target.rb +1 -9
  196. data/lib/sproutcore/rack/proxy.rb +238 -92
  197. data/lib/sproutcore/tools/docs.rb +1 -7
  198. data/spec/fixtures/builder_tests/apps/handlebars_test/Buildfile +1 -0
  199. data/spec/fixtures/builder_tests/apps/handlebars_test/{template.handlebars → templates/template.handlebars} +2 -0
  200. data/spec/lib/builders/handlebars_spec.rb +10 -4
  201. data/sproutcore.gemspec +3 -1
  202. metadata +73 -44
  203. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/default_styles.css +0 -5
  204. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/strings.js +0 -15
  205. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_checkbox_field.js +0 -17
  206. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_field.js +0 -17
  207. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_label.js +0 -17
  208. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_radio_field.js +0 -17
  209. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_text_field.js +0 -17
@@ -0,0 +1,80 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 3.3.0
6
+ build: 3167
7
+ */
8
+ /* base.css, part of YUI's CSS Foundation */
9
+ h1 {
10
+ /*18px via YUI Fonts CSS foundation*/
11
+ font-size:138.5%;
12
+ }
13
+ h2 {
14
+ /*16px via YUI Fonts CSS foundation*/
15
+ font-size:123.1%;
16
+ }
17
+ h3 {
18
+ /*14px via YUI Fonts CSS foundation*/
19
+ font-size:108%;
20
+ }
21
+ h1,h2,h3 {
22
+ /* top & bottom margin based on font size */
23
+ margin:1em 0;
24
+ }
25
+ h1,h2,h3,h4,h5,h6,strong {
26
+ /*bringing boldness back to headers and the strong element*/
27
+ font-weight:bold;
28
+ }
29
+ abbr,acronym {
30
+ /*indicating to users that more info is available */
31
+ border-bottom:1px dotted #000;
32
+ cursor:help;
33
+ }
34
+ em {
35
+ /*bringing italics back to the em element*/
36
+ font-style:italic;
37
+ }
38
+ blockquote,ul,ol,dl {
39
+ /*giving blockquotes and lists room to breath*/
40
+ margin:1em;
41
+ }
42
+ ol,ul,dl {
43
+ /*bringing lists on to the page with breathing room */
44
+ margin-left:2em;
45
+ }
46
+ ol li {
47
+ /*giving OL's LIs generated numbers*/
48
+ list-style: decimal outside;
49
+ }
50
+ ul li {
51
+ /*giving UL's LIs generated disc markers*/
52
+ list-style: disc outside;
53
+ }
54
+ dl dd {
55
+ /*providing spacing for definition terms*/
56
+ margin-left:1em;
57
+ }
58
+ th,td {
59
+ /*borders and padding to make the table readable*/
60
+ border:1px solid #000;
61
+ padding:.5em;
62
+ }
63
+ th {
64
+ /*distinguishing table headers from data cells*/
65
+ font-weight:bold;
66
+ text-align:center;
67
+ }
68
+ caption {
69
+ /*coordinated margin to match cell's padding*/
70
+ margin-bottom:.5em;
71
+ /*centered so it doesn't blend in to other content*/
72
+ text-align:center;
73
+ }
74
+ p,fieldset,table,pre {
75
+ /*so things don't run into each other*/
76
+ margin-bottom:1em;
77
+ }
78
+ /* setting a consistent width, 160px;
79
+ control of type=file still not possible */
80
+ input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
@@ -18,7 +18,3 @@ body {
18
18
  line-height: 1.4;
19
19
  }
20
20
 
21
- /* 3D-accelerate panes in MobileSafari */
22
- .mobile-safari .sc-pane {
23
- -webkit-transform: translate3d(0,0,0);
24
- }
@@ -11,12 +11,13 @@
11
11
  <!DOCTYPE html>
12
12
  <html<% unless @content_for_html5_manifest.blank? %> manifest="app.manifest"<% end %>>
13
13
  <head>
14
+ <meta http-equiv="X-UA-Compatible" content="IE=edge<%= config.chrome_frame ? ',chrome=1' : '' %>" />
15
+
14
16
  <script>
15
17
  var SC_benchmarkPreloadEvents = { headStart: new Date().getTime() };
16
18
  </script>
17
19
 
18
20
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
19
- <meta http-equiv="X-UA-Compatible" content="IE=EDGE<%= config.chrome_frame ? ',chrome=1' : '' %>" />
20
21
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
21
22
  <meta name="apple-mobile-web-app-capable" content="yes" />
22
23
  <meta name="apple-mobile-web-app-status-bar-style" content="<%= config.status_bar_style || 'default' %>" />
@@ -1,12 +1,12 @@
1
- $theme.sc-collection-view {
1
+ $theme.collection {
2
2
  background: white;
3
- border-right: 1px #A8B0BA solid;
4
3
 
5
4
  &.alternating .sc-collection-item.even {
6
5
  background: #eef3f6;
7
6
  }
8
7
 
9
- .sc-view.sc-collection-item.sel {
8
+ &.alternating .sc-collection-item.even.sel,
9
+ .sc-collection-item.sel {
10
10
  color: white;
11
11
  background: #608AB9;
12
12
  }
@@ -1,13 +1,13 @@
1
1
  /* Overriding some of the styles on checkbox */
2
2
 
3
3
  $theme.sc-list-item-view {
4
- .sc-checkbox-view {
4
+ $theme.checkbox {
5
5
  background-color: transparent;
6
6
  border: 0 none;
7
7
  margin-top: -9px;
8
8
  }
9
9
 
10
- .disclosure {
10
+ $theme.disclosure {
11
11
  position: absolute;
12
12
  left: -6px;
13
13
  top: 50%;
@@ -0,0 +1,9 @@
1
+ /* This default stylesheet for forms maximizes fluidity. */
2
+ $theme.sc-form-label {
3
+ white-space:pre; text-align: right;
4
+ }
5
+
6
+ $theme.form-row {
7
+ overflow: visible;
8
+ }
9
+
@@ -37,7 +37,9 @@ $theme.menu {
37
37
 
38
38
  /* CHECKBOXES */
39
39
  .checkbox {
40
- top: 3px;
40
+ position: absolute;
41
+ left: 5px;
42
+ top: 4px;
41
43
  width: 12px; height: 12px;
42
44
  @include slice(checkmark.png);
43
45
  }
@@ -7,7 +7,7 @@
7
7
  sc_require("resources/picker/popover/popover");
8
8
 
9
9
  SC.AceTheme.Popover.pickerRenderDelegate = SC.RenderDelegate.create({
10
- name: 'picker',
10
+ className: 'picker',
11
11
 
12
12
  render: function(dataSource, context) {
13
13
  var preferType = dataSource.get('preferType');
@@ -6,7 +6,7 @@
6
6
  // ==========================================================================
7
7
 
8
8
  SC.AceTheme.Popover.workspaceRenderDelegate = SC.RenderDelegate.create({
9
- name: 'workspace',
9
+ className: 'workspace',
10
10
  render: function(dataSource, context) {
11
11
  context.setClass({
12
12
  'top-toolbar': dataSource.get('hasTopToolbar'),
@@ -9,7 +9,7 @@ sc_require("theme");
9
9
  Renders and updates the HTML representation of a button.
10
10
  */
11
11
  SC.LegacyTheme.buttonRenderDelegate = SC.RenderDelegate.create({
12
- name: 'button',
12
+ className: 'button',
13
13
 
14
14
  /**
15
15
  Called when we need to create the HTML that represents the button.
@@ -6,7 +6,7 @@
6
6
  // ==========================================================================
7
7
  sc_require("theme");
8
8
  SC.LegacyTheme.panelRenderDelegate = SC.RenderDelegate.create({
9
- name: 'panel',
9
+ className: 'panel',
10
10
 
11
11
  render: function(dataSource, context) {
12
12
  context.push(
@@ -41,6 +41,8 @@ SC.LegacyTheme.PROGRESS_OFFSET_RANGE = 24;
41
41
 
42
42
  */
43
43
  SC.LegacyTheme.progressRenderDelegate = SC.RenderDelegate.create({
44
+ className: 'progress',
45
+
44
46
  render: function(dataSource, context) {
45
47
  this.addSizeClassName(dataSource, context);
46
48
 
@@ -18,7 +18,7 @@ sc_require("theme");
18
18
 
19
19
  SC.LegacyTheme.sliderRenderDelegate = SC.RenderDelegate.create({
20
20
 
21
- name: 'slider',
21
+ className: 'slider',
22
22
 
23
23
  render: function(dataSource, context) {
24
24
  this.addSizeClassName(dataSource, context);
@@ -7,7 +7,7 @@
7
7
  sc_require("theme");
8
8
  // the 'well'-styled container
9
9
  SC.BaseTheme.wellRenderDelegate = SC.Object.create({
10
- name: 'well',
10
+ className: 'well',
11
11
 
12
12
  render: function(dataSource, context) {
13
13
  context.push("<div class='top-left-edge'></div>",
@@ -64,9 +64,13 @@ module SC
64
64
  writeline(dst_path,joinlines(lines))
65
65
  end
66
66
 
67
+ def sc_static_match
68
+ /(sc_static|static_url|sc_target)\(\s*['"]([^"']*?)['"]\s*\)/
69
+ end
70
+
67
71
  # Handles occurances of sc_static() or static_url()
68
72
  def replace_static_url(line)
69
- line.gsub!(/(sc_static|static_url|sc_target)\(\s*['"]([^"']*?)['"]\s*\)/) do | rsrc |
73
+ line.gsub!(sc_static_match) do | rsrc |
70
74
  entry_name = $2
71
75
  entry_name = "#{$2}:index.html" if $1 == 'sc_target'
72
76
 
@@ -22,8 +22,19 @@ module SC
22
22
 
23
23
  def build(dst_path)
24
24
  template_name = entry.rootname[/^.*\/([^\/]*)$/, 1]
25
- writelines dst_path, "SC.TEMPLATES[#{template_name.inspect}] = SC.Handlebars.compile(#{readlines(entry[:source_path]).to_json});"
25
+ template_code = readlines(entry[:source_path])
26
+ replace_static_url(template_code)
27
+ writelines dst_path, "SC.TEMPLATES[#{template_name.inspect}] = SC.Handlebars.compile(#{template_code.to_json});"
26
28
  end
29
+
30
+ def sc_static_match
31
+ /\{\{(sc_static|static_url|sc_target)\(\s*['"]([^"']*?)['"]\s*\)\}\}/
32
+ end
33
+
34
+ def static_url(url='')
35
+ url
36
+ end
37
+
27
38
  end
28
39
 
29
40
  end
@@ -643,15 +643,7 @@ module SC
643
643
  javascript_entries.each do |resource_name, entries|
644
644
  resource_name = resource_name.ext('js')
645
645
 
646
- if resource_name == 'javascript.js'
647
- pf = ['source/lproj/strings.js', 'source/core.js', 'source/utils.js']
648
- if manifest.target.target_type == :app
649
- target_name = manifest.target.target_name.to_s.split('/')[-1]
650
- pf.insert(2, "source/#{target_name}.js")
651
- end
652
- else
653
- pf = []
654
- end
646
+ pf = (resource_name == 'javascript.js') ? ['source/lproj/strings.js', 'source/core.js', 'source/utils.js'] : []
655
647
 
656
648
  SC::Helpers::EntrySorter.sort(entries, pf).each do |entry|
657
649
  if minify_js && entry[:minified]
@@ -5,17 +5,60 @@
5
5
  # and contributors
6
6
  # ===========================================================================
7
7
 
8
+ # We only require net/https to ensure that HTTPS is supported for
9
+ # proxy[:secure] requests
8
10
  begin
9
11
  require 'net/https'
10
12
  SC::HTTPS_ENABLED = true
11
13
  rescue LoadError => e
12
- require 'net/http'
13
14
  SC::HTTPS_ENABLED = false
14
15
  end
15
16
 
17
+ require 'eventmachine'
18
+ require 'em-http'
19
+ require 'thin'
20
+
21
+
16
22
  module SC
23
+
17
24
  module Rack
18
25
 
26
+ class DeferrableBody
27
+ include EM::Deferrable
28
+
29
+ def initialize(options = {})
30
+ @options = options
31
+ end
32
+
33
+ def call(body)
34
+ body.each do |chunk|
35
+ @body_callback.call(prepare_chunk(chunk))
36
+ end
37
+ end
38
+
39
+ def prepare_chunk(chunk)
40
+ if chunked?
41
+ size = chunk.respond_to?(:bytesize) ? chunk.bytesize : chunk.length
42
+ "#{size.to_s(16)}\r\n#{chunk}\r\n"
43
+ else
44
+ # Thin doesn't like null bodies
45
+ chunk || ''
46
+ end
47
+ end
48
+
49
+ def each(&blk)
50
+ @body_callback = blk
51
+ end
52
+
53
+ private
54
+
55
+ def chunked?
56
+ @options[:chunked]
57
+ end
58
+ end
59
+
60
+
61
+
19
62
  # Rack application proxies requests as needed for the given project.
20
63
  class Proxy
21
64
 
@@ -25,141 +68,244 @@ module SC
25
68
  end
26
69
 
27
70
  def call(env)
28
- url = env['PATH_INFO']
71
+ path = env['PATH_INFO']
29
72
 
30
73
  @proxies.each do |proxy, value|
31
- if url.match(/^#{Regexp.escape(proxy.to_s)}/)
32
- return handle_proxy(value, proxy.to_s, env)
74
+ # If the url matches a proxied url, handle it
75
+ if path.match(/^#{Regexp.escape(proxy.to_s)}/)
76
+ handle_proxy(value, proxy.to_s, env)
77
+
78
+ # Don't block waiting for a response
79
+ throw :async
33
80
  end
34
81
  end
35
82
 
36
83
  return [404, {}, "not found"]
37
84
  end
38
85
 
86
+ def chunked?(headers)
87
+ headers['Transfer-Encoding'] == "chunked"
88
+ end
89
+
39
90
  def handle_proxy(proxy, proxy_url, env)
91
+
40
92
  if proxy[:secure] && !SC::HTTPS_ENABLED
41
93
  SC.logger << "~ WARNING: HTTPS is not supported on your system, using HTTP instead.\n"
42
94
  SC.logger << " If you are using Ubuntu, you can run `apt-get install libopenssl-ruby`\n"
43
95
  proxy[:secure] = false
44
96
  end
45
97
 
46
- origin_host = env['SERVER_NAME'] # capture the origin host for cookies
47
- http_method = env['REQUEST_METHOD'].to_s.downcase
48
- url = env['PATH_INFO']
49
- params = env['QUERY_STRING']
98
+ headers = request_headers(env, proxy) # ex. {"Host"=>"localhost:4020", "Connection"=>"...
99
+ path = env['PATH_INFO'] # ex. /contacts
100
+ params = env['QUERY_STRING'] # ex. since=yesterday&unread=true
50
101
 
51
- # collect headers...
52
- headers = {}
53
- env.each do |key, value|
54
- next unless key =~ /^HTTP_/
55
- key = key.gsub(/^HTTP_/,'').downcase.sub(/^\w/){|l| l.upcase}.gsub(/_(\w)/){|l| "-#{$1.upcase}"} # remove HTTP_, dasherize and titleize
56
- if !key.eql? "Version"
57
- headers[key] = value
58
- end
59
- end
102
+ # Switch to https if proxy[:secure] configured
103
+ protocol = proxy[:secure] ? 'https' : 'http'
60
104
 
61
- # Rack documentation says CONTENT_TYPE and CONTENT_LENGTH aren't prefixed by HTTP_
62
- headers['Content-Type'] = env['CONTENT_TYPE'] if env['CONTENT_TYPE']
105
+ # Adjust the path if proxy[:url] configured
106
+ if proxy[:url]
107
+ path = path.sub(/^#{Regexp.escape proxy_url}/, proxy[:url])
108
+ end
63
109
 
64
- length = env['CONTENT_LENGTH']
65
- headers['Content-Length'] = length if length
110
+ # The endpoint URL
111
+ url = protocol + '://' + proxy[:to]
112
+ url += path unless path.empty?
113
+ url += '?' + params unless params.empty?
66
114
 
67
- http_host, http_port = proxy[:to].split(':')
68
- http_port = proxy[:secure] ? '443' : '80' if http_port.nil?
115
+ if env['CONTENT_LENGTH'] || env['HTTP_TRANSFER_ENCODING']
116
+ req_body = env['rack.input']
117
+ req_body.rewind # May not be necessary but can't hurt
69
118
 
70
- if proxy[:url]
71
- url = url.sub(/^#{Regexp.escape proxy_url}/, proxy[:url])
119
+ req_body = req_body.read
72
120
  end
73
121
 
74
- http_path = [url]
75
- http_path << params if params && params.size>0
76
- http_path = http_path.join('?')
122
+ # Options for the request
123
+ request_options = {}
124
+ request_options[:head] = headers
125
+ request_options[:body] = req_body if !!req_body
126
+ request_options[:timeout] = proxy[:timeout] if proxy[:timeout]
127
+ request_options[:redirects] = 10 if proxy[:redirect] != false
77
128
 
78
- response = nil
79
- no_body_method = %w(get copy head move options trace)
129
+ EventMachine.run {
130
+ body = nil
131
+ conn = EM::HttpRequest.new(url)
132
+ chunked = false
133
+ headers = {}
134
+ method = env['REQUEST_METHOD'].upcase
135
+ status = 0
80
136
 
81
- done = false
82
- tries = 0
83
- until done
84
- # added 4/23/09 per Charles Jolley, corrects problem
85
- # when making requests to virtual hosts
86
- headers['Host'] = "#{http_host}:#{http_port}"
137
+ case method
138
+ when 'GET'
139
+ http = conn.get request_options
140
+ when 'POST'
141
+ http = conn.post request_options
142
+ when 'PUT'
143
+ http = conn.put request_options
144
+ when 'DELETE'
145
+ http = conn.delete request_options
146
+ else
147
+ http = conn.head request_options
148
+ end
87
149
 
88
- http = ::Net::HTTP.new(http_host, http_port)
150
+ # Received error
151
+ http.errback {
152
+ status = http.response_header.status
153
+ path = env['PATH_INFO']
154
+ url = http.last_effective_url
155
+ SC.logger << "~ PROXY FAILED: #{method} #{path} -> #{status} #{url}\n"
89
156
 
90
- if proxy[:secure]
91
- http.use_ssl = true
92
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
93
- end
157
+ # If a body has been sent use it, otherwise respond with generic message
158
+ if !body
159
+ body = "Unable to proxy to #{url}. Received status: #{status}"
160
+ size = body.respond_to?(:bytesize) ? body.bytesize : body.length
161
+ headers = { 'Content-Length' => size.to_s }
162
+ body = [body]
163
+ end
94
164
 
95
- http.start do |web|
96
- if no_body_method.include?(http_method)
97
- response = web.send(http_method, http_path, headers)
165
+ env['async.callback'].call [502, headers, body]
166
+ }
167
+
168
+ # Received response
169
+ http.callback {
170
+
171
+ # Too many redirects
172
+ if redirect? status
173
+ body = "Unable to proxy to #{url}. Too many redirects."
174
+ size = body.respond_to?(:bytesize) ? body.bytesize : body.length
175
+ headers = { 'Content-Length' => size.to_s }
176
+
177
+ env['async.callback'].call [502, headers, [body]]
98
178
  else
99
- http_body = env['rack.input']
100
- http_body.rewind # May not be necessary but can't hurt
179
+ # Terminate the deferred body (which may have been chunked)
180
+ if body
181
+ body.call ['']
182
+ body.succeed
183
+ end
101
184
 
102
- req = Net::HTTPGenericRequest.new(http_method.upcase,
103
- true, true, http_path, headers)
104
- req.body_stream = http_body if length.to_i > 0
105
- response = web.request(req)
106
- end
107
- end
185
+ # Log the initial path and the final url
186
+ path = env['PATH_INFO']
187
+ url = http.last_effective_url
188
+ SC.logger << "~ PROXY: #{method} #{path} -> #{status} #{url}\n"
189
+ end
190
+ }
191
+
192
+ # Received headers
193
+ http.headers { |hash|
194
+ status = http.response_header.status
195
+
196
+ headers = response_headers(hash)
197
+
198
+ # Don't respond on redirection, but fail out on bad redirects
199
+ if redirect? status
200
+
201
+ if status == 304
202
+ env["async.callback"].call [status, headers, ['']]
203
+ SC.logger << "~ PROXY: #{method} #{path} -> #{status} #{url}\n"
204
+ elsif !headers['Location']
205
+ body = "Unable to proxy to #{url}. Received redirect with no Location."
206
+ size = body.respond_to?(:bytesize) ? body.bytesize : body.length
207
+ headers = { 'Content-Length' => size.to_s }
108
208
 
109
- status = response.code # http status code
110
- protocol = proxy[:secure] ? 'https' : 'http'
111
-
112
- SC.logger << "~ PROXY: #{http_method.upcase} #{status} #{url} -> #{protocol}://#{http_host}:#{http_port}#{http_path}\n"
113
-
114
- # display and construct specific response headers
115
- response_headers = {}
116
- ignore_headers = ['transfer-encoding', 'keep-alive', 'connection']
117
- response.each do |key, value|
118
- next if ignore_headers.include?(key.downcase)
119
- # If this is a cookie, strip out the domain. This technically may
120
- # break certain scenarios where services try to set cross-domain
121
- # cookies, but those services should not be doing that anyway...
122
- value.gsub!(/domain=[^\;]+\;? ?/,'') if key.downcase == 'set-cookie'
123
- # content-length is returning char count not bytesize
124
- if key.downcase == 'content-length'
125
- if response.body.respond_to?(:bytesize)
126
- value = response.body.bytesize.to_s
127
- elsif response.body.respond_to?(:size)
128
- value = response.body.size.to_s
129
- else
130
- value = '0'
209
+ http.close
131
210
  end
211
+
212
+ else
213
+ # Stream the body right across in the format it was sent
214
+ chunked = chunked?(headers)
215
+ body = DeferrableBody.new({ :chunked => chunked })
216
+
217
+ # Start responding to the client immediately
218
+ env["async.callback"].call [status, headers, body]
132
219
  end
220
+ }
133
221
 
134
- SC.logger << " #{key}: #{value}\n"
135
- response_headers[key] = value
222
+ # Received chunk of data
223
+ http.stream { |chunk|
224
+ # Ignore body of redirects
225
+ if !redirect? status
226
+ body.call [chunk]
227
+ end
228
+ }
229
+ }
230
+ end
231
+
232
+ def redirect?(status)
233
+ status >= 300 && status < 400
234
+ end
235
+
236
+ # collect headers...
237
+ def request_headers(env, proxy)
238
+ result = {}
239
+ env.each do |key, value|
240
+ next unless key =~ /^HTTP_/
241
+
242
+ key = headerize(key)
243
+ if !key.eql? "Version"
244
+ result[key] = value
136
245
  end
246
+ end
247
+
248
+ # Rack documentation says CONTENT_TYPE and CONTENT_LENGTH aren't prefixed by HTTP_
249
+ result['Content-Type'] = env['CONTENT_TYPE'] if env['CONTENT_TYPE']
250
+
251
+ length = env['CONTENT_LENGTH']
252
+ result['Content-Length'] = length if length
253
+
254
+ # added 4/23/09 per Charles Jolley, corrects problem
255
+ # when making requests to virtual hosts
256
+ result['Host'] = proxy[:to]
137
257
 
138
- if [301, 302, 303, 307].include?(status.to_i) && proxy[:redirect] != false
139
- SC.logger << '~ REDIRECTING: '+response_headers['location']+"\n"
258
+ result
259
+ end
260
+
261
+ # construct and display specific response headers
262
+ def response_headers(hash)
263
+ result = {}
264
+
265
+ hash.each do |key, value|
266
+ key = headerize(key)
140
267
 
141
- uri = URI.parse(response_headers['location']);
142
- if uri.host != http_host || uri.port != http_port
143
- response_body = response.body || ''
144
- return [status, ::Rack::Utils::HeaderHash.new(response_headers), [response_body]]
268
+ # Because Set-Cookie header can appear more the once in the response body,
269
+ # but Rack only accepts a hash of headers, we store it in a line break separated string
270
+ # for Ruby 1.9 and as an Array for Ruby 1.8
271
+ # See http://groups.google.com/group/rack-devel/browse_thread/thread/e8759b91a82c5a10/a8dbd4574fe97d69?#a8dbd4574fe97d69
272
+ if key.downcase == 'set-cookie'
273
+ cookies = []
274
+
275
+ case value
276
+ when Array then value.each { |c| cookies << strip_domain(c) }
277
+ when Hash then value.each { |_, c| cookies << strip_domain(c) }
278
+ else cookies << strip_domain(value)
145
279
  end
146
280
 
147
- http_path = uri.path
148
- http_path += '?'+uri.query if uri.query
281
+ # Remove nil values
282
+ result['Set-Cookie'] = [result['Set-Cookie'], cookies].compact
149
283
 
150
- tries += 1
151
- if tries > 10
152
- raise "Too many redirects!"
284
+ if Thin.ruby_18?
285
+ result['Set-Cookie'].flatten!
286
+ else
287
+ result['Set-Cookie'] = result['Set-Cookie'].join("\n")
153
288
  end
154
- else
155
- done = true
156
289
  end
290
+
291
+ SC.logger << " #{key}: #{value}\n"
292
+ result[key] = value
157
293
  end
158
294
 
159
- # Thin doesn't like null bodies
160
- response_body = response.body || ''
295
+ ::Rack::Utils::HeaderHash.new(result)
296
+ end
297
+
298
+ # remove HTTP_, dasherize and titleize
299
+ def headerize(str)
300
+ parts = str.gsub(/^HTTP_/, '').split('_')
301
+ parts.map! { |p| p.capitalize }.join('-')
302
+ end
161
303
 
162
- return [status, ::Rack::Utils::HeaderHash.new(response_headers), [response_body]]
304
+ # Strip out the domain of passed in cookie. This technically may
305
+ # break certain scenarios where services try to set cross-domain
306
+ # cookies, but those services should not be doing that anyway...
307
+ def strip_domain(cookie)
308
+ cookie.to_s.gsub!(/domain=[^\;]+\;? ?/,'')
163
309
  end
164
310
  end
165
311
  end