sproutcore 1.10.3.1 → 1.11.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +4 -8
  3. data/VERSION.yml +2 -2
  4. data/lib/frameworks/sproutcore/Buildfile +5 -4
  5. data/lib/frameworks/sproutcore/CHANGELOG.md +274 -40
  6. data/lib/frameworks/sproutcore/CONTRIBUTORS.md +133 -0
  7. data/lib/frameworks/sproutcore/README.md +31 -144
  8. data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +9 -4
  9. data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +5 -0
  10. data/lib/frameworks/sproutcore/apps/showcase/system/views_item_content.js +1 -1
  11. data/lib/frameworks/sproutcore/apps/showcase/views/split_views.js +15 -2
  12. data/lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js +1 -1
  13. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +11 -1
  14. data/lib/frameworks/sproutcore/frameworks/ajax/mixins/websocket_delegate.js +90 -0
  15. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +81 -5
  16. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +23 -4
  17. data/lib/frameworks/sproutcore/frameworks/ajax/system/websocket.js +475 -0
  18. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +149 -26
  19. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/websocket.js +197 -0
  20. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/xhr_response_test.js +65 -0
  21. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +4 -0
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +232 -52
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +235 -49
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +23 -13
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +3 -1
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +81 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js +17 -0
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/string.js +7 -0
  29. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/views/disclosure/methods.js → core_foundation/french.lproj/ordinal.js} +7 -4
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +2 -6
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -1
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +104 -69
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +6 -1
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +59 -0
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +18 -1
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +192 -0
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/bezier_curves.js +52 -0
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +384 -64
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +6 -14
  40. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +21 -35
  41. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +72 -36
  42. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +90 -34
  43. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +55 -7
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +20 -15
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/req_anim_frame.js +9 -10
  46. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +763 -542
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +4 -3
  48. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +1 -7
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +14 -0
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/touch.js +538 -0
  51. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +56 -1
  52. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +99 -4
  53. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_case.js +25 -19
  54. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/core_tests.js +75 -0
  55. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/ext/number_test.js +81 -0
  56. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/action_support.js +4 -4
  57. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/responder_context.js +4 -4
  58. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +19 -1
  59. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/color.js +36 -20
  60. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/design_modes_test.js +83 -0
  61. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMainPane.js +7 -3
  62. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/mouse_events.js +338 -0
  63. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js +14 -89
  64. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/touch.js +106 -0
  65. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +2 -2
  66. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/touch.js +136 -0
  67. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/rect.js +42 -1
  68. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +11 -0
  69. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +5 -5
  70. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/design_mode_test.js +457 -0
  71. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +36 -10
  72. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/background_color.js +44 -0
  73. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +51 -24
  74. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/childViewLayout_test.js +176 -1
  75. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +46 -16
  76. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +69 -15
  77. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +2 -2
  78. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +7 -1
  79. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +30 -10
  80. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +376 -71
  81. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +0 -10
  82. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +117 -34
  83. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +52 -2
  84. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +656 -42
  85. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +159 -38
  86. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +0 -7
  87. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/design_mode.js +206 -0
  88. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +0 -28
  89. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +21 -6
  90. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +372 -450
  91. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +28 -13
  92. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +22 -51
  93. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +59 -30
  94. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +0 -29
  95. data/lib/frameworks/sproutcore/frameworks/datastore/mixins/relationship_support.js +22 -10
  96. data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +42 -36
  97. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +54 -3
  98. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +178 -59
  99. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +2 -2
  100. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +206 -132
  101. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +214 -118
  102. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +96 -13
  103. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +14 -4
  104. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +82 -42
  105. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +272 -177
  106. data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/store_interaction_test.js +54 -0
  107. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/datetime_recordattribute.js +24 -16
  108. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +6 -3
  109. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +267 -35
  110. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +57 -46
  111. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +150 -53
  112. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +57 -17
  113. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +13 -9
  114. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/many.js +2 -2
  115. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/simple.js +0 -0
  116. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/single.js +12 -2
  117. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +20 -15
  118. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +9 -2
  119. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +80 -14
  120. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/autonomous_dataSourceCallbacks.js +280 -0
  121. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/autonomous_pushChanges.js +232 -0
  122. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +31 -5
  123. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +16 -2
  124. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +60 -40
  125. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/materializeRecord.js +78 -0
  126. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +13 -1
  127. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +20 -0
  128. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/{resources → english.lproj}/strings.js +0 -0
  129. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/french.lproj/strings.js +45 -0
  130. data/lib/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +7 -3
  131. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +125 -44
  132. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +139 -48
  133. data/lib/frameworks/sproutcore/frameworks/desktop/panes/draggable.js +202 -0
  134. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +59 -56
  135. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +13 -49
  136. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +466 -305
  137. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +49 -12
  138. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +79 -21
  139. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/split.js +12 -2
  140. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +8 -0
  141. data/lib/frameworks/sproutcore/frameworks/desktop/resources/overlay-scroller.css +187 -0
  142. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +94 -30
  143. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +163 -3
  144. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +97 -78
  145. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +61 -1
  146. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +7 -3
  147. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +47 -22
  148. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +66 -9
  149. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +21 -11
  150. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +12 -18
  151. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +17 -14
  152. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +2 -1
  153. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +9 -6
  154. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/collection_fast_path.js +54 -21
  155. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +52 -20
  156. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +94 -4
  157. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/keyboard.js +177 -0
  158. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +13 -1
  159. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +9 -9
  160. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +18 -0
  161. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +104 -0
  162. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +48 -49
  163. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/drag_and_drop.js +22 -18
  164. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +17 -5
  165. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/link_view_test.js +136 -0
  166. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/contentIndexesInRect.js +77 -0
  167. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/drag_and_drop.js +53 -16
  168. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/layoutForContentIndex.js +41 -0
  169. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +25 -25
  170. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +102 -27
  171. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/{rowHeightForContentIndex.js → rowSizeForContentIndex.js} +7 -6
  172. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +2 -0
  173. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +70 -75
  174. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +29 -30
  175. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +57 -0
  176. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/menu_scroll_view/menu_scroll_view_test.js +206 -0
  177. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +15 -0
  178. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +15 -7
  179. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/integration.js +16 -11
  180. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +164 -12
  181. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/scale.js +387 -0
  182. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/touch.js +549 -0
  183. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +214 -45
  184. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +5 -5
  185. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +73 -22
  186. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +88 -3
  187. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +8 -0
  188. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/methods.js +16 -1
  189. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/ui.js +54 -0
  190. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/dividers.js +21 -2
  191. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +31 -25
  192. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +109 -29
  193. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +10 -1
  194. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +3 -0
  195. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +779 -603
  196. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +106 -7
  197. data/lib/frameworks/sproutcore/frameworks/desktop/views/link_view.js +406 -0
  198. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +437 -245
  199. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +13 -0
  200. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +124 -62
  201. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +176 -597
  202. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroller_view.js +206 -0
  203. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +3 -0
  204. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +5 -4
  205. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +3 -0
  206. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +56 -158
  207. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +2560 -0
  208. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +458 -242
  209. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +117 -54
  210. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +18 -12
  211. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +162 -34
  212. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +30 -15
  213. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +33 -7
  214. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +22 -2
  215. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +47 -22
  216. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +0 -6
  217. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +2 -1
  218. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +21 -21
  219. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +14 -3
  220. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js +24 -10
  221. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js +1 -1
  222. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js +7 -4
  223. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js +7 -9
  224. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/panes/select_button/methods.js → experimental/frameworks/select_view/tests/views/select/method.js} +54 -76
  225. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js +35 -0
  226. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/panes/select_button → experimental/frameworks/select_view/tests/views/select}/ui.js +107 -36
  227. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +225 -66
  228. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +39 -38
  229. data/lib/frameworks/sproutcore/frameworks/foundation/core.js +5 -18
  230. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +12 -0
  231. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/inflections.js +84 -0
  232. data/lib/frameworks/sproutcore/frameworks/foundation/french.lproj/inflections.js +41 -0
  233. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +1 -0
  234. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +7 -0
  235. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +3 -4
  236. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +6 -2
  237. data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +408 -239
  238. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +1 -1
  239. data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +2 -1
  240. data/lib/frameworks/sproutcore/frameworks/foundation/spanish.lproj/inflections.js +38 -0
  241. data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +104 -76
  242. data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +20 -94
  243. data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +33 -22
  244. data/lib/frameworks/sproutcore/frameworks/foundation/system/undo_manager.js +475 -0
  245. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +163 -1
  246. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +41 -0
  247. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +2 -5
  248. data/lib/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/methods.js +268 -0
  249. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/undo_manager.js +231 -0
  250. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +16 -0
  251. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +27 -0
  252. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +24 -0
  253. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +135 -6
  254. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +6 -0
  255. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +7 -0
  256. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +6 -0
  257. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +4 -0
  258. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_dissolve_transition.js +3 -1
  259. data/lib/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +21 -21
  260. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +65 -15
  261. data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +4 -1
  262. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
  263. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +193 -213
  264. data/lib/frameworks/sproutcore/frameworks/jquery/{jquery-1.8.3-patched.js → jquery-1.11.1.js} +7507 -6684
  265. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +28 -11
  266. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +26 -0
  267. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +54 -25
  268. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +0 -6
  269. data/lib/frameworks/sproutcore/frameworks/runtime/ext/number.js +36 -0
  270. data/lib/frameworks/sproutcore/frameworks/runtime/ext/window.js +25 -0
  271. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +3 -3
  272. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1 -1
  273. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +156 -66
  274. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +2 -2
  275. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +150 -65
  276. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +57 -11
  277. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +68 -49
  278. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +14 -6
  279. data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +23 -23
  280. data/lib/frameworks/sproutcore/frameworks/runtime/tests/ext/number_test.js +44 -0
  281. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +0 -10
  282. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +340 -285
  283. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +104 -3
  284. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +14 -1
  285. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/string.js +15 -2
  286. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +21 -18
  287. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +52 -19
  288. data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/responder/pane.js +27 -24
  289. data/lib/frameworks/sproutcore/frameworks/template_view/controls/button.js +30 -0
  290. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/bind.js +1 -1
  291. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/collection.js +2 -0
  292. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/view.js +1 -0
  293. data/lib/frameworks/sproutcore/frameworks/template_view/tests/mixins/template_helpers/checkbox_support.js +2 -2
  294. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/handlebars.js +4 -2
  295. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +1 -1
  296. data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +16 -14
  297. data/lib/frameworks/sproutcore/frameworks/testing/core.js +5 -3
  298. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +13 -0
  299. data/lib/frameworks/sproutcore/lib/index.rhtml +2 -2
  300. data/lib/frameworks/sproutcore/phantomjs/test_runner.js +28 -7
  301. data/lib/frameworks/sproutcore/scripts/run_sc_server_master.sh +1 -1
  302. data/lib/frameworks/sproutcore/themes/ace/resources/_variables.css +2 -0
  303. data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure.css +1 -0
  304. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover.css +3 -4
  305. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal.css +15 -15
  306. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_overlay.css +74 -0
  307. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical.css +11 -13
  308. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical_overlay.css +74 -0
  309. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob-active.png +0 -0
  310. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob-active@2x.png +0 -0
  311. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob.png +0 -0
  312. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob@2x.png +0 -0
  313. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/{22px → jumbo}/slider.css +9 -4
  314. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/track.png +0 -0
  315. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/track@2x.png +0 -0
  316. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob-active.png +0 -0
  317. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob-active@2x.png +0 -0
  318. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob.png +0 -0
  319. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob@2x.png +0 -0
  320. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/slider.css +32 -0
  321. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/track.png +0 -0
  322. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/track@2x.png +0 -0
  323. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/slider.css +13 -0
  324. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob-active.png +0 -0
  325. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob-active@2x.png +0 -0
  326. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob.png +0 -0
  327. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob@2x.png +0 -0
  328. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/slider.css +32 -0
  329. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/track.png +0 -0
  330. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/track@2x.png +0 -0
  331. data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +2 -3
  332. data/lib/sproutcore/builders/chance_file.rb +3 -3
  333. data/lib/sproutcore/helpers/minifier.rb +1 -0
  334. data/vendor/chance/lib/chance/instance.rb +34 -34
  335. data/vendor/chance/lib/chance/instance/spriting.rb +21 -16
  336. metadata +81 -58
  337. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +0 -17
  338. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +0 -710
  339. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +0 -267
  340. data/lib/frameworks/sproutcore/frameworks/desktop/resources/touch-scroller.css +0 -196
  341. data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +0 -224
  342. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +0 -163
  343. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +0 -177
  344. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +0 -2053
  345. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +0 -1024
  346. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +0 -404
  347. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/render_delegates/menu_scroller.js +0 -28
  348. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/tests/menu/scroll.js +0 -235
  349. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroll.js +0 -363
  350. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroller.js +0 -250
  351. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +0 -47
  352. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +0 -134
  353. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +0 -92
  354. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/native_scroll.js +0 -25
  355. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js +0 -33
  356. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/touch_scroller.js +0 -76
  357. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/integration.js +0 -25
  358. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/methods.js +0 -143
  359. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +0 -256
  360. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroll.js +0 -1164
  361. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroller.js +0 -332
  362. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroll.js +0 -236
  363. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroller.js +0 -347
  364. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroll.js +0 -15
  365. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroller.js +0 -10
  366. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroll.js +0 -804
  367. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroller.js +0 -133
  368. data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +0 -41
  369. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_touch.css +0 -91
  370. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical_touch.css +0 -92
  371. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob.png +0 -0
  372. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob_active.png +0 -0
  373. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/slider.css +0 -27
  374. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob.png +0 -0
  375. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob_active.png +0 -0
  376. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/slider.css +0 -27
  377. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob.png +0 -0
  378. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob_active.png +0 -0
  379. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/track.png +0 -0
  380. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/track.png +0 -0
@@ -16,6 +16,9 @@ SC.mixin(SC.View,
16
16
  */
17
17
  FADE_IN: {
18
18
 
19
+ /* @private */
20
+ layoutProperties: ['opacity'],
21
+
19
22
  /** @private */
20
23
  setup: function (view, options, inPlace) {
21
24
  view.adjust({ opacity: inPlace ? view.get('layout').opacity || 0 : 0 });
@@ -43,6 +46,9 @@ SC.mixin(SC.View,
43
46
  */
44
47
  FADE_OUT: {
45
48
 
49
+ /* @private */
50
+ layoutProperties: ['opacity'],
51
+
46
52
  /** @private */
47
53
  run: function (view, options) {
48
54
  view.animate('opacity', 0, {
@@ -14,6 +14,10 @@ SC.mixin(SC.View,
14
14
  @since Version 1.10
15
15
  */
16
16
  POP_IN: {
17
+
18
+ /* @private */
19
+ layoutProperties: ['scale'],
20
+
17
21
  /** @private */
18
22
  setup: function (view, options, inPlace) {
19
23
  view.adjust({ scale: inPlace ? view.get('layout').scale || 0 : 0 });
@@ -55,6 +59,9 @@ SC.mixin(SC.View,
55
59
  */
56
60
  POP_OUT: {
57
61
 
62
+ /* @private */
63
+ layoutProperties: ['scale'],
64
+
58
65
  /** @private */
59
66
  run: function (view, options) {
60
67
  var bigScale,
@@ -15,6 +15,9 @@ SC.mixin(SC.View,
15
15
  */
16
16
  SCALE_IN: {
17
17
 
18
+ /* @private */
19
+ layoutProperties: ['scale'],
20
+
18
21
  /** @private */
19
22
  setup: function (view, options, inPlace) {
20
23
  view.adjust({ scale: inPlace ? view.get('layout').scale || 0 : 0 });
@@ -41,6 +44,9 @@ SC.mixin(SC.View,
41
44
  */
42
45
  SCALE_OUT: {
43
46
 
47
+ /* @private */
48
+ layoutProperties: ['scale'],
49
+
44
50
  /** @private */
45
51
  run: function (view, options) {
46
52
  view.animate('scale', 0, {
@@ -16,6 +16,8 @@ SC.mixin(SC.View,
16
16
  */
17
17
  SLIDE_IN: {
18
18
 
19
+ layoutProperties: ['top', 'bottom', 'left', 'right', 'height', 'width', 'centerX', 'centerY'],
20
+
19
21
  /** @private Starts from outside of parent unless inPlace is true. */
20
22
  setup: function (view, options, inPlace) {
21
23
  var parentView = view.get('parentView'),
@@ -86,6 +88,8 @@ SC.mixin(SC.View,
86
88
  */
87
89
  SLIDE_OUT: {
88
90
 
91
+ layoutProperties: ['top', 'bottom', 'left', 'right', 'height', 'width', 'centerX', 'centerY'],
92
+
89
93
  /** @private Starts from current position. */
90
94
  setup: function (view, options) {
91
95
  var viewFrame = view.get('borderFrame'),
@@ -52,7 +52,9 @@ SC.mixin(SC.ContainerView,
52
52
  duration: options.duration || 0.4,
53
53
  timing: options.timing || 'ease'
54
54
  }, function (data) {
55
- statechart.exited();
55
+ if (!data.isCancelled) {
56
+ statechart.exited();
57
+ }
56
58
  });
57
59
  }
58
60
  },
@@ -8,15 +8,15 @@
8
8
  sc_require('validators/validator') ;
9
9
 
10
10
  /** @class
11
- Validate a field value as a credit card number.
12
-
11
+ Validate a field value as a credit card number.
12
+
13
13
  This validator will perform a basic check to ensure the credit card number
14
14
  is mathematically valid. It will also accept numbers with spaces, dashes
15
- or other punctuation.
16
-
15
+ or other punctuation.
16
+
17
17
  Converted credit card numbers are broken into units of 4.
18
-
19
- Basic credit card validation courtesy David Leppek
18
+
19
+ Basic credit card validation courtesy David Leppek
20
20
  (https://www.azcode.com/Mod10)
21
21
 
22
22
  @extends SC.Validator
@@ -41,30 +41,30 @@ SC.Validator.CreditCard = SC.Validator.extend(
41
41
  objectForFieldValue: function(value, form, field) {
42
42
  return value.replace(/[\s-\.\:]/g,'') ;
43
43
  },
44
-
45
- validate: function(form, field) {
46
- return this.checkNumber(field.get('fieldValue')) ;
44
+
45
+ validate: function(form, field) {
46
+ return this.checkNumber(field.get('fieldValue')) ;
47
47
  },
48
-
48
+
49
49
  validateError: function(form, field) {
50
50
  var label = field.get('errorLabel') || 'Field' ;
51
51
  return SC.$error(SC.String.loc("Invalid.CreditCard(%@)", label), label);
52
52
  },
53
-
54
- /**
55
- Allow only numbers, dashes, and spaces
53
+
54
+ /**
55
+ Allow only numbers, dashes, and spaces
56
56
  */
57
57
  validateKeyDown: function(form, field, charStr) {
58
58
  return !!charStr.match(/[0-9\- ]/);
59
59
  },
60
-
60
+
61
61
  checkNumber: function(ccNumb) {
62
-
62
+
63
63
  if (!ccNumb || ccNumb.length===0) return YES; // do not validate empty
64
-
64
+
65
65
  // remove any spaces or dashes
66
66
  ccNumb = ccNumb.replace(/[^0-9]/g,'');
67
-
67
+
68
68
  var valid = "0123456789"; // Valid digits in a credit card number
69
69
  var len = ccNumb.length; // The length of the submitted cc number
70
70
  var iCCN = parseInt(ccNumb,0); // integer of ccNumb
@@ -82,11 +82,11 @@ SC.Validator.CreditCard = SC.Validator.extend(
82
82
  if (valid.indexOf(temp) == "-1"){bNum = false;}
83
83
  }
84
84
 
85
- // if it is NOT a number, you can either alert to the fact,
85
+ // if it is NOT a number, you can either alert to the fact,
86
86
  // or just pass a failure
87
87
  if(!bNum) bResult = false;
88
88
 
89
- // Determine if it is the proper length
89
+ // Determine if it is the proper length
90
90
  if((len === 0)&&(bResult)){ // nothing, field is blank AND passed above # check
91
91
  bResult = false;
92
92
  } else{ // ccNumb is a number and the proper length - let's see if it is a valid card number
@@ -108,7 +108,7 @@ SC.Validator.CreditCard = SC.Validator.extend(
108
108
  case 16: calc = 7; break; //8*2=16 & 1+6 = 7
109
109
  case 18: calc = 9; break; //9*2=18 & 1+8 = 9
110
110
  default: calc = calc; //4*2= 8 & 8 = 8 -same for all lower numbers
111
- }
111
+ }
112
112
  iCCN = iCCN / 10; // subtracts right most digit from ccNum
113
113
  iTotal += calc; // running total of the card number as we loop
114
114
  } // END OF LOOP
@@ -121,5 +121,5 @@ SC.Validator.CreditCard = SC.Validator.extend(
121
121
  }
122
122
  return bResult; // Return the results
123
123
  }
124
-
124
+
125
125
  }) ;
@@ -189,6 +189,22 @@ SC.ContainerView = SC.View.extend(
189
189
  this.set('nowShowing', view);
190
190
  }
191
191
  }
192
+
193
+ // Observe for changes to the content view and initialize once.
194
+ this.addObserver('contentView', this, this._sc_contentViewDidChange);
195
+ this._sc_contentViewDidChange();
196
+ },
197
+
198
+ /** @private Cancels the active transition. */
199
+ _sc_cancelTransitions: function () {
200
+ var contentStatecharts = this._contentStatecharts;
201
+
202
+ // Exit all the statecharts immediately. This mutates the array!
203
+ if (contentStatecharts) {
204
+ for (var i = contentStatecharts.length - 1; i >= 0; i--) {
205
+ contentStatecharts[i].doExit(true);
206
+ }
207
+ }
192
208
  },
193
209
 
194
210
  /** @private
@@ -223,20 +239,24 @@ SC.ContainerView = SC.View.extend(
223
239
  call replaceContent. Override replaceContent to change how the view is
224
240
  swapped out.
225
241
  */
226
- contentViewDidChange: function () {
227
- this.replaceContent(this.get('contentView'));
228
- }.observes('contentView'),
242
+ _sc_contentViewDidChange: function () {
243
+ var contentView = this.get('contentView');
244
+
245
+ // If it's an uninstantiated view, then attempt to instantiate it.
246
+ if (contentView && contentView.kindOf(SC.CoreView)) {
247
+ contentView = this.createChildView(contentView);
248
+ }
249
+
250
+ this.replaceContent(contentView);
251
+ },
229
252
 
230
253
  /** @private */
231
254
  destroy: function () {
232
- var contentStatecharts = this._contentStatecharts;
255
+ // Clean up observers.
256
+ this.removeObserver('contentView', this, this._sc_contentViewDidChange);
233
257
 
234
- // Exit all the statecharts immediately. This mutates the array!
235
- if (contentStatecharts) {
236
- for (var i = contentStatecharts.length - 1; i >= 0; i--) {
237
- contentStatecharts[i].doExit(true);
238
- }
239
- }
258
+ // Cancel any active transitions.
259
+ this._sc_cancelTransitions();
240
260
 
241
261
  // Remove our internal reference to the statecharts.
242
262
  this._contentStatecharts = this._currentStatechart = null;
@@ -255,20 +275,34 @@ SC.ContainerView = SC.View.extend(
255
275
 
256
276
  // If it's a string, try to turn it into the object it references...
257
277
  if (SC.typeOf(content) === SC.T_STRING && content.length > 0) {
258
- if (content.indexOf('.') > 0) {
259
- content = SC.objectForPropertyPath(content);
260
- } else {
261
- var tempContent = this.getPath(content);
278
+ var dotspot = content.indexOf('.');
279
+ // No dot means a local property, either to this view or this view's page.
280
+ if (dotspot === -1) {
281
+ var tempContent = this.get(content);
262
282
  content = SC.kindOf(tempContent, SC.CoreView) ? tempContent : SC.objectForPropertyPath(content, this.get('page'));
263
283
  }
284
+ // Dot at beginning means local property path.
285
+ else if (dotspot === 0) {
286
+ content = this.getPath(content.slice(1));
287
+ }
288
+ // Dot after the beginning
289
+ else {
290
+ content = SC.objectForPropertyPath(content);
291
+ }
264
292
  }
265
293
 
266
294
  // If it's an uninstantiated view, then attempt to instantiate it.
267
295
  if (content && content.kindOf(SC.CoreView)) {
268
296
  content = this.createChildView(content);
269
- } else {
297
+ }
298
+
299
+ //@if(debug)
300
+ // Prevent developers from assigning non-view content to a container.
301
+ if (content && !SC.kindOf(content, SC.CoreView)) {
302
+ SC.error("Developer Error: You should not assign non-View content to an SC.ContainerView.");
270
303
  content = null;
271
304
  }
305
+ //@endif
272
306
 
273
307
  // Sets the content.
274
308
  this.set('contentView', content);
@@ -351,6 +385,22 @@ SC.ContainerView = SC.View.extend(
351
385
 
352
386
  // Track the current statechart.
353
387
  this._currentStatechart = newStatechart;
388
+ },
389
+
390
+ /** @private SC.Observable.prototype */
391
+ set: function (key, value) {
392
+
393
+ // Changing the transitionSwap in the middle of a transition must cancel the transitions.
394
+ if (key === 'transitionSwap' && this.get('isTransitioning')) {
395
+ //@if(debug)
396
+ SC.warn("Developer Warning: You should not change the value of transitionSwap on %@ while the container view is transitioning. The transition was cancelled.".fmt(this));
397
+ //@endif
398
+
399
+ // Cancel the active transitions.
400
+ this._sc_cancelTransitions();
401
+ }
402
+
403
+ return sc_super();
354
404
  }
355
405
 
356
406
  });
@@ -54,10 +54,12 @@ SC.ImageView = SC.View.extend(SC.Control, SC.InnerFrame,
54
54
 
55
55
  displayProperties: ['align', 'scale', 'value', 'displayToolTip'],
56
56
 
57
+ /** @private */
57
58
  renderDelegateName: function () {
58
59
  return (this.get('useCanvas') ? 'canvasImage' : 'image') + "RenderDelegate";
59
60
  }.property('useCanvas').cacheable(),
60
61
 
62
+ /** @private */
61
63
  tagName: function () {
62
64
  return this.get('useCanvas') ? 'canvas' : 'div';
63
65
  }.property('useCanvas').cacheable(),
@@ -145,7 +147,7 @@ SC.ImageView = SC.View.extend(SC.Control, SC.InnerFrame,
145
147
  */
146
148
  useCanvas: function () {
147
149
  return SC.platform.supportsCanvas && !this.get('useStaticLayout');
148
- }.property('useStaticLayout', 'type').cacheable(),
150
+ }.property('useStaticLayout').cacheable(),
149
151
 
150
152
  /**
151
153
  If YES, image view will use the SC.imageQueue to control loading. This
@@ -174,6 +176,7 @@ SC.ImageView = SC.View.extend(SC.Control, SC.InnerFrame,
174
176
  @type String
175
177
  */
176
178
  value: null,
179
+ valueBindingDefault: SC.Binding.oneWay(),
177
180
 
178
181
  /**
179
182
  Recalculate our innerFrame if the outer frame has changed.
@@ -150,7 +150,7 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
150
150
  autoResizeText: function() { return this.get('displayTitle'); }
151
151
  .property('displayTitle').cacheable(),
152
152
 
153
- autoResizePadding: SC.propertyFromRenderDelegate('autoResizePadding', 10),
153
+ autoResizePadding: SC.propertyFromRenderDelegate('autoResizePadding', { height: 0, width: 10 }),
154
154
 
155
155
  /**
156
156
  The name of the theme's SC.LabelView render delegate.
@@ -7,7 +7,6 @@
7
7
 
8
8
  sc_require('views/field');
9
9
  sc_require('system/text_selection');
10
- sc_require('mixins/static_layout');
11
10
  sc_require('mixins/editable');
12
11
 
13
12
  SC.AUTOCAPITALIZE_NONE = 'none';
@@ -34,10 +33,10 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
34
33
  Walk like a duck.
35
34
 
36
35
  @type Boolean
37
- @default YES
36
+ @default true
38
37
  @readOnly
39
38
  */
40
- isTextField: YES,
39
+ isTextField: true,
41
40
 
42
41
  // ..........................................................
43
42
  // PROPERTIES
@@ -47,46 +46,37 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
47
46
  When `applyImmediately` is turned on, every keystroke will set the value
48
47
  of the underlying object. Turning it off will only set the value on blur.
49
48
 
50
- @type String
51
- @default YES
49
+ @type Boolean
50
+ @default true
52
51
  */
53
- applyImmediately: YES,
52
+ applyImmediately: true,
54
53
 
55
54
  /**
56
55
  Flag indicating whether the editor should automatically commit if you click
57
56
  outside it.
58
57
 
59
58
  @type Boolean
60
- @default YES
61
- */
62
- commitOnBlur: YES,
63
-
64
- /** @deprecated
65
- If `YES`, the field will hide its text from display.
66
- This value is deprecated. Please use `type` instead to `"password"`.
67
-
68
- @type Boolean
69
- @default NO
59
+ @default true
70
60
  */
71
- isPassword: NO,
61
+ commitOnBlur: true,
72
62
 
73
63
  /**
74
- If `YES` then allow multi-line input. This will also change the default
64
+ If `true` then allow multi-line input. This will also change the default
75
65
  tag type from "input" to "textarea". Otherwise, pressing return will
76
66
  trigger the default insertion handler.
77
67
 
78
68
  @type Boolean
79
- @default NO
69
+ @default false
80
70
  */
81
- isTextArea: NO,
71
+ isTextArea: false,
82
72
 
83
73
  /**
84
74
  Whether the text field is currently focused.
85
75
 
86
76
  @type Boolean
87
- @default NO
77
+ @default false
88
78
  */
89
- focused: NO,
79
+ focused: false,
90
80
 
91
81
  /**
92
82
  The hint to display while the field is not active.
@@ -105,18 +95,18 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
105
95
  type: 'text',
106
96
 
107
97
  /**
108
- This property will set a tabindex="-1" on your view if set to NO.
98
+ This property will set a tabindex="-1" on your view if set to false.
109
99
 
110
100
  This gives us control over the native tabbing behavior. When nextValidKeyView
111
101
  reaches the end of the views in the pane views tree, it won't go to a textfield
112
102
  that can accept the default tabbing behavior in any other pane. This was a
113
103
  problem when you had an alert on top of a mainPane with textfields.
114
104
 
115
- Modal panes set this to NO on all textfields that don't belong to itself.
105
+ Modal panes set this to false on all textfields that don't belong to itself.
116
106
  @type Boolean
117
- @default YES
107
+ @default true
118
108
  */
119
- isBrowserFocusable: YES,
109
+ isBrowserFocusable: true,
120
110
 
121
111
  /**
122
112
  Whether the browser should automatically correct the input.
@@ -125,9 +115,9 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
125
115
  the system defaults.
126
116
 
127
117
  @type Boolean
128
- @default YES
118
+ @default true
129
119
  */
130
- autoCorrect: YES,
120
+ autoCorrect: true,
131
121
 
132
122
  /**
133
123
  Specifies the autocapitalization behavior.
@@ -140,8 +130,8 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
140
130
  - `SC.AUTOCAPITALIZE_WORDS` -- Autocapitalize the first letter of each word.
141
131
  - `SC.AUTOCAPITALIZE_CHARACTERS` -- Autocapitalize all characters.
142
132
 
143
- Boolean values are also supported, with YES interpreted as
144
- `SC.AUTOCAPITALIZE_NONE` and NO as `SC.AUTOCAPITALIZE_SENTENCES`.
133
+ Boolean values are also supported, with `true` interpreted as
134
+ `SC.AUTOCAPITALIZE_NONE` and `false` as `SC.AUTOCAPITALIZE_SENTENCES`.
145
135
 
146
136
  When `autoCapitalize` is set to `null`, the browser will use
147
137
  the system defaults.
@@ -152,70 +142,85 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
152
142
  autoCapitalize: SC.CAPITALIZE_SENTENCES,
153
143
 
154
144
  /**
155
- Localizes the hint if necessary.
145
+ Whether the browser should automatically complete the input.
146
+
147
+ When `autoComplete` is set to `null`, the browser will use
148
+ the system defaults.
149
+
150
+ @type Boolean
151
+ @default null
152
+ */
153
+ autoComplete: null,
154
+
155
+ /**
156
+ Localizes and escapes the hint if necessary.
156
157
 
157
158
  @field
158
159
  @type String
159
160
  */
160
161
  formattedHint: function () {
161
162
  var hint = this.get('hint');
162
- return typeof(hint) === 'string' && this.get('localize') ? SC.String.loc(hint) : hint;
163
+ hint = typeof(hint) === 'string' && this.get('localize') ? SC.String.loc(hint) : hint;
164
+
165
+ // If the hint is appended via an overlay, ensure that the text is escaped in order to avoid XSS attacks.
166
+ if (this.get('useHintOverlay')) {
167
+ hint = this.get('escapeHTML') ? SC.RenderContext.escapeHTML(hint) : hint;
168
+ }
169
+
170
+ return hint;
163
171
  }.property('hint', 'localize').cacheable(),
164
172
 
165
173
  /**
166
- Whether to show the hint while the field has focus.
167
- If `YES`, it will disappear as soon as any character is in the field.
174
+ Whether to show the hint while the field still has focus.
175
+
176
+ While newer versions of Safari, Firefox and Chrome will act this way using the
177
+ placeholder attribute, other browsers will not. By setting this property
178
+ to true, we can ensure that the hint will always appear even when the
179
+ field has focus.
180
+
181
+ Note: If `hintOnFocus` is false, this doesn't necessarily mean that the
182
+ hint will disappear on focus, because some browsers will still not remove
183
+ the placeholder on focus when empty.
184
+
185
+ *Important:* You can not modify this property once the view has been rendered.
168
186
 
169
187
  @type Boolean
170
- @default YES
188
+ @default true
171
189
  */
172
- hintOnFocus: YES,
190
+ hintOnFocus: true,
173
191
 
174
192
  /**
175
193
  Whether the hint should be localized or not.
176
194
 
177
195
  @type Boolean
178
- @default YES
196
+ @default true
179
197
  */
180
- localize: YES,
198
+ localize: true,
181
199
 
182
200
  /**
183
- If `YES` then the text field is currently editing.
201
+ If `true` then the text field is currently editing.
184
202
 
185
203
  @type Boolean
186
- @default NO
204
+ @default false
187
205
  */
188
- isEditing: NO,
206
+ isEditing: false,
189
207
 
190
208
  /**
191
209
  If you set this property to false the tab key won't trigger its default
192
210
  behavior (tabbing to the next field).
193
211
 
194
212
  @type Boolean
195
- @default YES
213
+ @default true
196
214
  */
197
- defaultTabbingEnabled: YES,
215
+ defaultTabbingEnabled: true,
198
216
 
199
217
  /**
200
218
  Enabled context menu for textfields.
201
219
 
202
220
  @type Boolean
203
- @default YES
221
+ @default true
204
222
  */
205
- isContextMenuEnabled: YES,
206
-
207
- /**
208
- @deprecated Use #applyImmediately instead.
209
-
210
- If true, every change to the text in the text field updates `value`.
211
- If false, `value` is only updated when commitEditing() is called (this
212
- is called automatically when the text field loses focus), or whenever
213
- the return key is pressed while editing the field.
214
-
215
- @type Boolean
216
- @default null
217
- */
218
- continuouslyUpdatesValue: null,
223
+ isContextMenuEnabled: true,
219
224
 
220
225
  /**
221
226
  If no, will not allow transform or validation errors (SC.Error objects)
@@ -223,9 +228,9 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
223
228
  to its previous value.
224
229
 
225
230
  @type Boolean
226
- @default YES
231
+ @default true
227
232
  */
228
- allowsErrorAsValue: YES,
233
+ allowsErrorAsValue: true,
229
234
 
230
235
  /**
231
236
  An optional view instance, or view class reference, which will be visible
@@ -283,9 +288,9 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
283
288
  browser. As of today Safari 4+, Chrome 3+ and Firefox 3+ support it.
284
289
 
285
290
  @type Boolean
286
- @default YES
291
+ @default true
287
292
  */
288
- spellCheckEnabled: YES,
293
+ spellCheckEnabled: true,
289
294
 
290
295
  /**
291
296
  Maximum amount of characters this field will allow.
@@ -299,9 +304,9 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
299
304
  Whether to render a border or not.
300
305
 
301
306
  @type Boolean
302
- @default YES
307
+ @default true
303
308
  */
304
- shouldRenderBorder: YES,
309
+ shouldRenderBorder: true,
305
310
 
306
311
  // ..........................................................
307
312
  // SUPPORT FOR AUTOMATIC RESIZING
@@ -310,10 +315,10 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
310
315
  /**
311
316
  Text fields support auto resizing.
312
317
  @type Boolean
313
- @default YES
318
+ @default true
314
319
  @see SC.AutoResize#supportsAutoResize
315
320
  */
316
- supportsAutoResize: YES,
321
+ supportsAutoResize: true,
317
322
 
318
323
  /**
319
324
  The layer to automatically resize.
@@ -343,37 +348,16 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
343
348
  */
344
349
  autoResizePadding: SC.propertyFromRenderDelegate('autoResizePadding', 20),
345
350
 
346
- /** @private
347
- Whether to show hint or not.
348
- */
349
- _hintON: YES,
350
-
351
- init: function () {
352
- var val = this.get('value');
353
- this._hintON = ((!val || val && val.length === 0) && !this.get('hintOnFocus')) ? YES : NO;
354
-
355
- var continuouslyUpdatesValue = this.get('continouslyUpdatesValue');
356
- if (continuouslyUpdatesValue !== null && continuouslyUpdatesValue !== undefined) {
357
- this.set('applyImmediately', continuouslyUpdatesValue);
358
-
359
- // @if (debug)
360
- SC.Logger.warn("SC.TextFieldView#continuouslyUpdatesValue is deprecated. Please use #applyImmediately instead.");
361
- // @endif
362
- }
363
-
364
- return sc_super();
365
- },
366
-
367
351
  /**
368
352
  This property indicates if the value in the text field can be changed.
369
- If set to `NO`, a `readOnly` attribute will be added to the DOM Element.
353
+ If set to `false`, a `readOnly` attribute will be added to the DOM Element.
370
354
 
371
- Note if `isEnabledInPane` is `NO` this property will have no effect.
355
+ Note if `isEnabledInPane` is `false` this property will have no effect.
372
356
 
373
357
  @type Boolean
374
- @default YES
358
+ @default true
375
359
  */
376
- isEditable: YES,
360
+ isEditable: true,
377
361
 
378
362
  /**
379
363
  The current selection of the text field, returned as an SC.TextSelection
@@ -388,6 +372,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
388
372
  */
389
373
  selection: function (key, value) {
390
374
  var element = this.$input()[0],
375
+ direction = 'none',
391
376
  range, start, end;
392
377
 
393
378
  // Are we being asked to set the value, or return the current value?
@@ -402,12 +387,15 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
402
387
  } else {
403
388
  // In IE8, input elements don't have hasOwnProperty() defined.
404
389
  try {
405
- if ('selectionStart' in element) {
390
+ if (SC.platform.input.selectionStart) {
406
391
  start = element.selectionStart;
407
392
  }
408
- if ('selectionEnd' in element) {
393
+ if (SC.platform.input.selectionEnd) {
409
394
  end = element.selectionEnd;
410
395
  }
396
+ if (SC.platform.input.selectionDirection) {
397
+ direction = element.selectionDirection;
398
+ }
411
399
  }
412
400
  // In Firefox when you ask the selectionStart or End of a hidden
413
401
  // input, sometimes it throws a weird error.
@@ -446,7 +434,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
446
434
  }
447
435
  }
448
436
 
449
- return SC.TextSelection.create({ start: start, end: end });
437
+ return SC.TextSelection.create({ start: start, end: end, direction: direction });
450
438
  } else {
451
439
  return null;
452
440
  }
@@ -459,7 +447,18 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
459
447
 
460
448
  if (element) {
461
449
  if (element.setSelectionRange) {
462
- element.setSelectionRange(value.get('start'), value.get('end'));
450
+ try {
451
+ element.setSelectionRange(value.get('start'), value.get('end'), value.get('direction'));
452
+ } catch (e) {
453
+ // In Firefox & IE when you call setSelectionRange on a hidden input it will throw weird
454
+ // errors. Adding this to just ignore it.
455
+ return null;
456
+ }
457
+
458
+ if (!SC.platform.input.selectionDirection) {
459
+ // Browser doesn't support selectionDirection, set it to 'none' so the wrong value is not cached.
460
+ value.set('direction', 'none');
461
+ }
463
462
  } else {
464
463
  // Support Internet Explorer.
465
464
  range = element.createTextRange();
@@ -480,6 +479,29 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
480
479
  // whenever the field's value changes.
481
480
  }.property('fieldValue').cacheable(),
482
481
 
482
+ /**
483
+ Whether or not the text field view will use an overlaid label for the hint.
484
+
485
+ There are two conditions that will result in the text field adding an
486
+ overlaid label for the hint. The first is when the `hintOnFocus` property is
487
+ true. This allows the user to focus the text field and still see the hint
488
+ text while there is no value in the field. Since some browsers clear the
489
+ placeholder when the field has text, this is a way to ensure the same
490
+ behavior across all browsers.
491
+
492
+ The second is when the browser doesn't support the placeholder attribute
493
+ (i.e. < IE 10). By using an overlaid label rather than inserting the hint
494
+ into the input, we are able to show clear text hints over password fields.
495
+
496
+ @field
497
+ @type Boolean
498
+ @default true
499
+ @readonly
500
+ */
501
+ useHintOverlay: function () {
502
+ return this.get('hintOnFocus') || !SC.platform.input.placeholder;
503
+ }.property().cacheable(),
504
+
483
505
  // ..........................................................
484
506
  // INTERNAL SUPPORT
485
507
  //
@@ -488,7 +510,8 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
488
510
  // SC.Control. It is not a display property directly in SC.Control, because the use of it in
489
511
  // SC.Control is only applied to input fields, which very few consumers of SC.Control have.
490
512
  // TODO: Pull the disabled attribute updating out of SC.Control.
491
- displayProperties: ['isBrowserFocusable', 'formattedHint', 'fieldValue', 'isEditing', 'isEditable', 'isEnabledInPane', 'leftAccessoryView', 'rightAccessoryView', 'isTextArea'],
513
+ displayProperties: ['isBrowserFocusable', 'formattedHint', 'fieldValue', 'isEditing', 'isEditable', 'isEnabledInPane',
514
+ 'leftAccessoryView', 'rightAccessoryView', 'isTextArea', 'maxLength'],
492
515
 
493
516
  createChildViews: function () {
494
517
  sc_super();
@@ -598,11 +621,11 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
598
621
  force the field render to render like the firsttime to avoid writing extra
599
622
  code. This can be useful also
600
623
  */
601
- _forceRenderFirstTime: NO,
624
+ _forceRenderFirstTime: false,
602
625
 
603
626
  /** @private */
604
627
  _renderFieldLikeFirstTime: function () {
605
- this.set('_forceRenderFirstTime', YES);
628
+ this.set('_forceRenderFirstTime', true);
606
629
  }.observes('isTextArea'),
607
630
 
608
631
  /** @private */
@@ -611,17 +634,17 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
611
634
  // here, but currently SC.RenderContext will render sibling
612
635
  // contexts as parent/child.
613
636
  var hint = this.get('formattedHint'),
614
- hintOnFocus = this.get('hintOnFocus'),
615
- hintString = '',
637
+ hintAttr = '',
616
638
  maxLength = this.get('maxLength'),
617
639
  isTextArea = this.get('isTextArea'),
618
640
  isEnabledInPane = this.get('isEnabledInPane'),
619
641
  isEditable = this.get('isEditable'),
620
642
  autoCorrect = this.get('autoCorrect'),
621
643
  autoCapitalize = this.get('autoCapitalize'),
644
+ autoComplete = this.get('autoComplete'),
622
645
  isBrowserFocusable = this.get('isBrowserFocusable'),
623
646
  spellCheckString = '', autocapitalizeString = '', autocorrectString = '',
624
- activeStateString = '', browserFocusableString = '',
647
+ autocompleteString = '', activeStateString = '', browserFocusableString = '',
625
648
  name, adjustmentStyle, type, paddingElementStyle,
626
649
  fieldClassNames, isOldSafari;
627
650
 
@@ -635,7 +658,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
635
658
 
636
659
 
637
660
  if (firstTime || this._forceRenderFirstTime) {
638
- this._forceRenderFirstTime = NO;
661
+ this._forceRenderFirstTime = false;
639
662
  activeStateString = isEnabledInPane ? (isEditable ? '' : ' readonly="readonly"') : ' disabled="disabled"';
640
663
  name = this.get('layerId');
641
664
 
@@ -653,13 +676,12 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
653
676
  }
654
677
  }
655
678
 
656
- if (!isBrowserFocusable) {
657
- browserFocusableString = ' tabindex="-1"';
679
+ if (!SC.none(autoComplete)) {
680
+ autocompleteString = ' autocomplete=' + (!autoComplete ? '"off"' : '"on"');
658
681
  }
659
682
 
660
- // if hint is on and we don't want it to show on focus, create one
661
- if (SC.platform.input.placeholder && !hintOnFocus) {
662
- hintString = ' placeholder="' + hint + '"';
683
+ if (!isBrowserFocusable) {
684
+ browserFocusableString = ' tabindex="-1"';
663
685
  }
664
686
 
665
687
  if (this.get('shouldRenderBorder')) context.push('<div class="border"></div>');
@@ -676,15 +698,16 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
676
698
  context.push('<div class="padding" ' + adjustmentStyle + '>');
677
699
 
678
700
  value = this.get('escapeHTML') ? SC.RenderContext.escapeHTML(value) : value;
679
- if (this._hintON && !SC.platform.input.placeholder && (!value || (value && value.length === 0))) {
680
- value = hint;
681
- context.setClass('sc-hint', YES);
682
- }
683
701
 
684
- if (hintOnFocus) {
685
- var hintStr = '<div aria-hidden="true" class="hint ' +
702
+ // When hintOnFocus is true or the field doesn't support placeholders, ensure that a hint appears by adding an overlay hint element.
703
+ if (this.get('useHintOverlay')) {
704
+ var hintOverlay = '<div aria-hidden="true" class="hint ' +
686
705
  (isTextArea ? '':'ellipsis') + '%@">' + hint + '</div>';
687
- context.push(hintStr.fmt(value ? ' sc-hidden': ''));
706
+ context.push(hintOverlay.fmt(value ? ' sc-hidden': ''));
707
+
708
+ // Use the input placeholder attribute for the hint.
709
+ } else {
710
+ hintAttr = ' placeholder="' + hint + '"';
688
711
  }
689
712
 
690
713
  fieldClassNames = "field";
@@ -692,36 +715,30 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
692
715
  // Render the input/textarea field itself, and close off the padding.
693
716
  if (isTextArea) {
694
717
  context.push('<textarea aria-label="' + hint + '" class="' + fieldClassNames + '" aria-multiline="true"' +
695
- '" name="' + name + '"' + activeStateString + hintString +
718
+ '" name="' + name + '"' + activeStateString + hintAttr +
696
719
  spellCheckString + autocorrectString + autocapitalizeString +
697
720
  browserFocusableString + ' maxlength="' + maxLength +
698
721
  '">' + value + '</textarea></div>');
699
722
  } else {
700
723
  type = this.get('type');
701
-
702
- // Internet Explorer won't let us change the type attribute later
703
- // so we force it to password if needed now, or if the value is not the hint
704
- if (this.get('isPassword')) {
705
- // @if (debug)
706
- SC.Logger.warn("SC.TextFieldView#isPassword is deprecated. Please set SC.TextFieldView#type to password instead.");
707
- // @endif
708
-
709
- type = 'password';
710
- }
711
-
712
724
  context.push('<input aria-label="' + hint + '" class="' + fieldClassNames + '" type="' + type +
713
- '" name="' + name + '"' + activeStateString + hintString +
725
+ '" name="' + name + '"' + activeStateString + hintAttr +
714
726
  spellCheckString + autocorrectString + autocapitalizeString +
715
- browserFocusableString + ' maxlength="' + maxLength +
727
+ autocompleteString + browserFocusableString + ' maxlength="' + maxLength +
716
728
  '" value="' + value + '"' + '/></div>');
717
729
  }
718
730
  } else {
719
731
  var input = this.$input(),
720
- element = input[0],
721
- val = this.get('value');
732
+ element = input[0];
722
733
 
723
- if (hintOnFocus) context.$('.hint')[0].innerHTML = hint;
724
- else if (!hintOnFocus) element.placeholder = hint;
734
+ // Update the hint. If the overlay hint was used, update it.
735
+ if (this.get('useHintOverlay')) {
736
+ context.$('.hint')[0].innerHTML = hint;
737
+ } else {
738
+ input.attr('placeholder', hint);
739
+ }
740
+
741
+ input.attr('maxLength', maxLength);
725
742
 
726
743
  // IE8 has problems aligning the input text in the center
727
744
  // This is a workaround for centering it.
@@ -729,24 +746,6 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
729
746
  input.css('line-height', this.get('frame').height + 'px');
730
747
  }
731
748
 
732
- if (!val || (val && val.length === 0)) {
733
- if (this.get('isPassword')) { element.type = 'password'; }
734
-
735
- if (!SC.platform.input.placeholder && this._hintON) {
736
- if (!this.get('isFirstResponder')) {
737
- // Internet Explorer doesn't allow you to modify the type afterwards
738
- // jQuery throws an exception as well, so set attribute directly
739
- context.setClass('sc-hint', YES);
740
- input.val(hint);
741
- } else {
742
- // Internet Explorer doesn't allow you to modify the type afterwards
743
- // jQuery throws an exception as well, so set attribute directly
744
- context.setClass('sc-hint', NO);
745
- input.val('');
746
- }
747
- }
748
- }
749
-
750
749
  if (!SC.none(autoCorrect)) {
751
750
  input.attr('autocorrect', !autoCorrect ? 'off' : 'on');
752
751
  } else {
@@ -763,7 +762,11 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
763
762
  input.attr('autocapitalize', null);
764
763
  }
765
764
 
766
- if (!hintOnFocus && SC.platform.input.placeholder) input.attr('placeholder', hint);
765
+ if (!SC.none(autoComplete)) {
766
+ input.attr('autoComplete', !autoComplete ? 'off' : 'on');
767
+ } else {
768
+ input.attr('autoComplete', null);
769
+ }
767
770
 
768
771
  if (isBrowserFocusable) {
769
772
  input.removeAttr('tabindex');
@@ -837,7 +840,6 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
837
840
  didCreateLayer: function () {
838
841
  sc_super();
839
842
 
840
- if (!SC.platform.input.placeholder) this.invokeLast(this._setInitialPlaceHolderIE);
841
843
  // For some strange reason if we add focus/blur events to textarea
842
844
  // inmediately they won't work. However if I add them at the end of the
843
845
  // runLoop it works fine.
@@ -862,14 +864,14 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
862
864
  /**
863
865
  SC.View view state callback.
864
866
 
865
- Once the view is appended, fix up the text layout to sc-hints and inputs.
867
+ Once the view is appended, fix up the text layout to hint and input.
866
868
  */
867
869
  didAppendToDocument: function () {
868
870
  this._fixupTextLayout();
869
871
  },
870
872
 
871
873
  /** @private
872
- Apply proper text layout to sc-hints and inputs.
874
+ Apply proper text layout to hint and input.
873
875
  */
874
876
  _fixupTextLayout: function () {
875
877
  var height = this.get('frame').height;
@@ -879,26 +881,13 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
879
881
  this.$input().css('line-height', height + 'px');
880
882
  }
881
883
 
882
- if (this.get('hintOnFocus') && !this.get('isTextArea')) {
884
+ if (this.get('useHintOverlay') && !this.get('isTextArea')) {
883
885
  var hintJQ = this.$('.hint');
884
886
 
885
887
  hintJQ.css('line-height', hintJQ.outerHeight() + 'px');
886
888
  }
887
889
  },
888
890
 
889
- /** @private
890
- Set initial placeholder for IE
891
- */
892
- _setInitialPlaceHolderIE: function () {
893
- if (!SC.platform.input.placeholder && this._hintON) {
894
- var input = this.$input(),
895
- currentValue = input.val();
896
- if (!currentValue || (currentValue && currentValue.length === 0)) {
897
- input.val(this.get('formattedHint'));
898
- }
899
- }
900
- },
901
-
902
891
  /** @private
903
892
  Adds all the textarea events. This functions is called by didCreateLayer
904
893
  at different moments depending if it is a textarea or not. Appending
@@ -938,12 +927,8 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
938
927
  */
939
928
  _textField_fieldDidFocus: function (evt) {
940
929
  SC.run(function () {
941
- this.set('focused', YES);
930
+ this.set('focused', true);
942
931
  this.fieldDidFocus(evt);
943
- var val = this.get('value');
944
- if (!SC.platform.input.placeholder && ((!val) || (val && val.length === 0))) {
945
- this._hintON = NO;
946
- }
947
932
  }, this);
948
933
  },
949
934
 
@@ -952,15 +937,11 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
952
937
  */
953
938
  _textField_fieldDidBlur: function (evt) {
954
939
  SC.run(function () {
955
- this.set('focused', NO);
940
+ this.set('focused', false);
956
941
  // passing the original event here instead that was potentially set from
957
942
  // losing the responder on the inline text editor so that we can
958
943
  // use it for the delegate to end editing
959
944
  this.fieldDidBlur(this._origEvent || evt);
960
- var val = this.get('value');
961
- if (!SC.platform.input.placeholder && !this.get('hintOnFocus') && ((!val) || (val && val.length === 0))) {
962
- this._hintON = YES;
963
- }
964
945
  }, this);
965
946
  },
966
947
 
@@ -1004,9 +985,10 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1004
985
  _field_fieldValueDidChange: function (evt) {
1005
986
  if (this.get('focused')) {
1006
987
  SC.run(function () {
1007
- this.fieldValueDidChange(NO);
988
+ this.fieldValueDidChange(false);
1008
989
  }, this);
1009
990
  }
991
+
1010
992
  this.updateHintOnFocus();
1011
993
  },
1012
994
 
@@ -1028,10 +1010,10 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1028
1010
  Make sure to update visibility of hint if it changes
1029
1011
  */
1030
1012
  updateHintOnFocus: function () {
1031
- // if there is a value in the field, hide the hint
1032
- var hintOnFocus = this.get('hintOnFocus');
1033
- if (!hintOnFocus) return;
1013
+ // Fast path. If we aren't using the hind overlay, do nothing.
1014
+ if (!this.get('useHintOverlay')) return;
1034
1015
 
1016
+ // If there is a value in the field, hide the hint.
1035
1017
  if (this.getFieldValue()) {
1036
1018
  this.$('.hint').addClass('sc-hidden');
1037
1019
  } else {
@@ -1142,7 +1124,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1142
1124
 
1143
1125
  /** @private */
1144
1126
  keyDown: function (evt) {
1145
- return this.interpretKeyEvents(evt) || NO;
1127
+ return this.interpretKeyEvents(evt) || false;
1146
1128
  },
1147
1129
 
1148
1130
  /** @private */
@@ -1155,16 +1137,16 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1155
1137
  if (!SC.platform.input.maxlength && this.get('isTextArea')) {
1156
1138
  var val = this.get('value');
1157
1139
 
1158
- // This code is nasty. It's thanks gecko .keycode table that has charters like & with the same keycode as up arrow key
1140
+ // This code is nasty. It's thanks to Gecko .keycode table that has characters like '&' with the same keycode as up arrow key
1159
1141
  if (val && ((!SC.browser.isMozilla && which > 47) ||
1160
1142
  (SC.browser.isMozilla && ((which > 32 && which < 43) || which > 47) && !(keyCode > 36 && keyCode < 41))) &&
1161
1143
  (val.length >= this.get('maxLength'))) {
1162
1144
  maxLengthReached = true;
1163
1145
  }
1164
1146
  }
1165
- // validate keyDown...
1166
- // do not validate on touch, as it prevents return.
1167
- if ((this.performValidateKeyDown(evt) || SC.platform.touch) && !maxLengthReached) {
1147
+
1148
+ // Validate keyDown...
1149
+ if (this.performValidateKeyDown(evt) && !maxLengthReached) {
1168
1150
  evt.allowDefault();
1169
1151
  } else {
1170
1152
  evt.stop();
@@ -1177,7 +1159,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1177
1159
  this._fieldValueDidChangeTimer = this.invokeLater(this.fieldValueDidChange, 10);
1178
1160
  }
1179
1161
 
1180
- return YES;
1162
+ return true;
1181
1163
  },
1182
1164
 
1183
1165
  /** @private */
@@ -1192,7 +1174,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1192
1174
  var view = this.get('nextValidKeyView');
1193
1175
  if (view) view.becomeFirstResponder();
1194
1176
  else evt.allowDefault();
1195
- return YES; // handled
1177
+ return true; // handled
1196
1178
  },
1197
1179
 
1198
1180
  /** @private */
@@ -1207,7 +1189,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1207
1189
  var view = this.get('previousValidKeyView');
1208
1190
  if (view) view.becomeFirstResponder();
1209
1191
  else evt.allowDefault();
1210
- return YES; // handled
1192
+ return true; // handled
1211
1193
  },
1212
1194
 
1213
1195
  /**
@@ -1220,57 +1202,57 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1220
1202
  insertNewline: function (evt) {
1221
1203
  if (this.get('isTextArea') || evt.isIMEInput) {
1222
1204
  evt.allowDefault();
1223
- return YES; // handled
1205
+ return true; // handled
1224
1206
  }
1225
- return NO;
1207
+ return false;
1226
1208
  },
1227
1209
 
1228
1210
  /** @private */
1229
1211
  deleteForward: function (evt) {
1230
1212
  evt.allowDefault();
1231
- return YES;
1213
+ return true;
1232
1214
  },
1233
1215
 
1234
1216
  /** @private */
1235
1217
  deleteBackward: function (evt) {
1236
1218
  evt.allowDefault();
1237
- return YES;
1219
+ return true;
1238
1220
  },
1239
1221
 
1240
1222
  /** @private */
1241
1223
  moveLeft: function (evt) {
1242
1224
  evt.allowDefault();
1243
- return YES;
1225
+ return true;
1244
1226
  },
1245
1227
 
1246
1228
  /** @private */
1247
1229
  moveRight: function (evt) {
1248
1230
  evt.allowDefault();
1249
- return YES;
1231
+ return true;
1250
1232
  },
1251
1233
 
1252
1234
  /** @private */
1253
1235
  selectAll: function (evt) {
1254
1236
  evt.allowDefault();
1255
- return YES;
1237
+ return true;
1256
1238
  },
1257
1239
 
1258
1240
  /** @private */
1259
1241
  moveUp: function (evt) {
1260
1242
  if (this.get('isTextArea')) {
1261
1243
  evt.allowDefault();
1262
- return YES;
1244
+ return true;
1263
1245
  }
1264
- return NO;
1246
+ return false;
1265
1247
  },
1266
1248
 
1267
1249
  /** @private */
1268
1250
  moveDown: function (evt) {
1269
1251
  if (this.get('isTextArea')) {
1270
1252
  evt.allowDefault();
1271
- return YES;
1253
+ return true;
1272
1254
  }
1273
- return NO;
1255
+ return false;
1274
1256
  },
1275
1257
 
1276
1258
  keyUp: function (evt) {
@@ -1282,15 +1264,15 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1282
1264
  // processing.
1283
1265
  this.notifyPropertyChange('selection');
1284
1266
  evt.allowDefault();
1285
- return YES;
1267
+ return true;
1286
1268
  },
1287
1269
 
1288
1270
  mouseDown: function (evt) {
1289
1271
  if (!this.get('isEnabledInPane')) {
1290
1272
  evt.stop();
1291
- return YES;
1273
+ return true;
1292
1274
  } else {
1293
- this._txtFieldMouseDown = YES;
1275
+ this._txtFieldMouseDown = true;
1294
1276
  this.becomeFirstResponder();
1295
1277
 
1296
1278
  return sc_super();
@@ -1298,11 +1280,11 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1298
1280
  },
1299
1281
 
1300
1282
  mouseUp: function (evt) {
1301
- this._txtFieldMouseDown = NO;
1283
+ this._txtFieldMouseDown = false;
1302
1284
 
1303
1285
  if (!this.get('isEnabledInPane')) {
1304
1286
  evt.stop();
1305
- return YES;
1287
+ return true;
1306
1288
  }
1307
1289
 
1308
1290
  // The caret/selection could have moved. In some browsers, though, the
@@ -1326,8 +1308,8 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1326
1308
  mouseWheel: function (evt) {
1327
1309
  if (this.get('isTextArea')) {
1328
1310
  evt.allowDefault();
1329
- return YES;
1330
- } else return NO;
1311
+ return true;
1312
+ } else return false;
1331
1313
  },
1332
1314
 
1333
1315
  /**
@@ -1335,7 +1317,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1335
1317
  block text selection in all other views.
1336
1318
  */
1337
1319
  selectStart: function (evt) {
1338
- return YES;
1320
+ return true;
1339
1321
  },
1340
1322
 
1341
1323
  /** @private
@@ -1356,15 +1338,13 @@ SC.TextFieldView = SC.FieldView.extend(SC.Editable,
1356
1338
  */
1357
1339
  _valueObserver: function () {
1358
1340
  var val = this.get('value'), max;
1359
- if (val && val.length > 0) {
1360
- this._hintON = NO;
1361
1341
 
1342
+ if (val && val.length > 0) {
1362
1343
  max = this.get('maxLength');
1344
+
1363
1345
  if (!SC.platform.input.maxlength && val.length > max) {
1364
1346
  this.set('value', val.substr(0, max));
1365
1347
  }
1366
- } else if (!this.get('hintOnFocus')) {
1367
- this._hintON = YES;
1368
1348
  }
1369
1349
  }.observes('value')
1370
1350