Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Squashed commit of the following:

commit 8cdb380e256094b7ec080526b77e4cfeb69b4675
Author: Charles Jolley <charles@sproutit.com>
Date:   Wed Jun 16 00:27:38 2010 -0700

    Temporarily remove features we don't want to postback just yet.

commit 006afa875a20ac837fe7f8f0810a9dd30210332a
Author: Alex Iskander <alex@sproutcore.com>
Date:   Fri Jun 11 14:04:42 2010 -0700

    Make RenderContext honor the lack of "px" on zIndex. There may be a more general way to do this, but it could cause regressions.

commit 54373f260496523489e2f8a759887ef98966daa0
Author: teresa <teresa.tsui@gmail.com>
Date:   Mon Jun 7 18:11:28 2010 -0700

    fix regression of not calculating window clipping introduced by using getBoundingClientRect to enhence performance

commit e9461011404048bd1059618d5514fa07c3374941
Author: Juan Pinzon <juanpin@me.com>
Date:   Fri Jun 4 00:53:18 2010 -0700

    Reverting this change until we revise the rules of how sc handles exceptions on timers.

    Revert "Add try/catch to timers to make sure timers continue to run even if there is an exception"

    This reverts commit 58ea887f91589318cce102c431bcb1a3436d5078.

commit ec77154ae1f36f1d68a087be15f067e496f97c36
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Mon Jun 7 19:32:13 2010 -0700

    Remove touch approximation code.

commit 2bb19e979b562dc1ddd6b13f5987969bce53d53e
Author: Charles Jolley <charles@sproutit.com>
Date:   Wed Jun 2 13:59:16 2010 -0700

    Make SC.Record#normalize() respect alternate keys

commit 3cb7fcf7906274cc387ecbbc1c46c9ea6add57ae
Author: Alex Iskander <alex@Alex-Iskanders-Mac-Pro.local>
Date:   Wed Jun 2 17:23:56 2010 -0700

    SC.View has a new feature: live-changing layerId. The feature was broken. Now it is fixed. And there was much rejoice.

commit 81e83b37205c20d71aa961c20bc7e15295f82832
Author: Alex Iskander <alex@Alex-Iskanders-Mac-Pro.local>
Date:   Wed Jun 2 16:48:04 2010 -0700

    Fix _touchIntercept undefined bug.

commit d20880e34a38b2b7a5d83676080e116494f173ea
Author: bsnavin <bsnavin@apple.com>
Date:   Fri May 21 23:01:17 2010 -0700

    Added a property to detect if a run loop is already in progress & an additional parameter to SC.run to support not creating a new run loop is one is already running

commit 8f3962d6c8ffc084782f506fd65b8805701f06bc
Author: bsnavin <bsnavin@apple.com>
Date:   Sat May 1 22:02:28 2010 -0700

    Added unit tests for isEditable handling in single attribute

commit 143fc65548b5f86f4754fb852e04ebad4e1b591f
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue Jun 1 15:16:41 2010 -0700

    Accelerate resizing of touch scrollers.

commit a1a66cf4bcbea462c5d60aa7968f73df132a1aa2
Author: Juan Pinzon <juanpin@me.com>
Date:   Tue Jun 1 14:15:28 2010 -0700

    Fix for IME input and Firefox. Firefox only reports enter key to confirm IME input on keyUp. It doesn't report keydowns, so it's not going to behave exactly like other browsers but this should at least report a value change

commit 27c3ac98e9bbeafa4927e698a820a62131d59451
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue Jun 1 09:40:58 2010 -0700

    Bug fixes to fast collection view.

commit 57ab4999211bb15f1ad81ee427ee2e2cd006cae3
Author: Juan Pinzon <juanpin@me.com>
Date:   Tue Jun 1 13:25:09 2010 -0700

    Fix for window focus events on IE. I had to use onfocusin and onfocusout. Using just onFocus on IE doesn't work as you inmediately get a blur event after every focus event.

commit 02ff9c0fbdec5f7a4d1f9bb36e06ce74173eedef
Author: Juan Pinzon <juanpin@me.com>
Date:   Mon May 31 13:34:27 2010 -0700

    Setting orientation on window resize for touch devices instead of onOrientationChange

commit 6bda23fff9be70abe5bbbe5659e5256ff7fb49fb
Author: Juan Pinzon <juanpin@me.com>
Date:   Sat May 29 19:36:24 2010 -0700

    Fix for IME input to take field changes as they are typed

commit 8090e081db27e5ea2d0b4934425802184448d227
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 28 14:03:22 2010 -0700

    Nice backwards-compatibility improvements...

commit 230ac2d9c4919bb9114c0b73effa2a8274882edc
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 28 09:20:35 2010 -0700

    Fix some obvious-in-hindsight bugs in collection view fast path.

commit aa554696a8684d20ba886368f9208bf099943bf8
Author: William Kakes <bkakes@funke.apple.com>
Date:   Fri May 28 13:58:48 2010 -0700

    Be sure that when you call commitRecords() with a subset of the changelog (via the supported method), that those keys actually get removed from the changelog.

commit 8e5214f6bbec3e10912969bcd508aa77c32e21f4
Author: William Kakes <bkakes@funke.apple.com>
Date:   Fri May 28 13:52:33 2010 -0700

    Correct documentation

commit 844b1e60b9b91aa99fd3a2284a6e41bddc428bc9
Author: William Kakes <bkakes@funke.apple.com>
Date:   Fri May 28 13:38:35 2010 -0700

    Be sure to call sc_super() inside SC.TextFieldView#createChildViews, and don't *mutate* the accessory view's 'classNames', because that can inadvertently mutate the prototype.  Instead, clone and set it for just that instance.

commit 3e9437965823d8ba3f08fb168c0c90abc663209b
Author: Juan Pinzon <juanpin@me.com>
Date:   Fri May 28 00:51:58 2010 -0700

    Fix number validator to work with IME input

commit d417776837724b83510f4037723ffd66471e3e92
Author: Juan Pinzon <juanpin@me.com>
Date:   Fri May 28 00:51:38 2010 -0700

    Adding reset css rule for ie7

commit 9eea7268e01d565966cbfc3524deb517172f850a
Author: Juan Pinzon <juanpin@me.com>
Date:   Fri May 28 00:51:03 2010 -0700

    Regression: shorcuts like ctrl_t not passing to the browser

commit 7423acb12dc0918789781fffb4a5c654c6f943a4
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 27 16:59:40 2010 -0700

    Disable other mouse events while dealing with inputs.

commit c70355e72501e65a108df1295fc7df8374f00663
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 27 16:59:17 2010 -0700

    Touch intercept pane should be transparent.

commit 8bc37406dd5733f3c81cde2740f5af055f36750b
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 27 15:00:52 2010 -0700

    Hack touch intercept to handle text fields.

commit 419222ce955bb77c0bd43392a174e5245ac0910c
Author: Juan Pinzon <juanpin@me.com>
Date:   Thu May 27 18:49:33 2010 -0700

    Adding fix for strange white screen bug on ie7

commit 496983d9bb5193a59087796fb98c48ecd984a948
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 26 23:43:38 2010 -0700

    Make unload event cleanup for IE only

commit 6499551daebae254e86d3bb309c440141d4afc92
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 27 11:21:57 2010 -0700

    Make sure we require SC.platform so it exists before SC.device loads.

commit fa26a19b93b62d6ee0dcd00639fde309a94c1a32
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 27 11:09:57 2010 -0700

    Clean up browser object to remove redundant code. Move feature detection from SC.browser to SC.platform.

commit 06b84946ab303527a37a3ee3b438f05ccc0c9c29
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Thu May 27 11:26:59 2010 -0700

    Make inline text editor inherit escapeHTML from the list item view

commit 4e67d173c9bb2f9c9d47d8118131abbc40ec92eb
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 27 08:41:42 2010 -0700

    Use 3D transforms when possible.

commit cf343f004fef1844007a19aae591a6e1a12247c9
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 27 08:37:57 2010 -0700

    Disable one optimization that breaks things (cross-reload dom pooling).

commit 6e7948a609248d3ef123d963d4294d98834702fc
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Tue May 25 14:58:35 2010 -0700

    Fixed RenderContext to properly handle CSS browser prefixes

commit 29d166d1e40b300630b807082558f522634df9f9
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Fri May 21 15:24:36 2010 -0700

    Fixed style attribute dasherize

commit 7d341f179ad795bd2e3ce450434f53be7d190b4d
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Fri May 21 15:03:09 2010 -0700

    RenderContext matches leading dash on style attributes

commit ca74fc0b75ecdf418688b1c58f287a1b1dde2170
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Fri May 21 13:56:38 2010 -0700

    Better fix for RenderContext styles

commit e5520170b39a895cc03fac3392c3268713f95b99
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Fri May 21 12:48:32 2010 -0700

    Fixed RenderContext to properly handle styles starting with a dash

commit a4f58b1ec7a4c708e979b4f62a0f4486e8475e66
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Tue May 25 17:51:01 2010 -0700

    Fixed SC.Animatable callbacks

commit 2dfac9f92a3e05dd6dea2808a9e9d26bce733c83
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Tue May 25 14:58:59 2010 -0700

    Changed hasAcceleratedLayer to not use 3d tranforms

commit 8f84f79983b05459940e1168da393224330fec34
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Tue May 25 14:58:06 2010 -0700

    Fixes and improvements to SC.Animatable with hasAcceleratedLayer

commit d3aca133144a5e6e6cf94320f8f3fac26cff6b68
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Tue May 25 14:56:20 2010 -0700

    Added domCSSPrefix to SC.platform

commit a583251b809805ac870a208ddf38c58b738186a8
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Mon May 24 18:30:51 2010 -0700

    Adjusted AcceleratedLayer handling to more closely match SC.Animatable

commit e0ff6c450bac04a8258c68d783effde8d3b88d1c
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Mon May 24 18:30:32 2010 -0700

    Fixed SC.Animatable to work with accelerated layers

commit dd6db1b73fe7fdcfa7e90d27c477dc7218b84688
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Mon May 24 12:23:34 2010 -0700

    Moved CSSTranform checks to SC.platform

commit ed1698f4b6bd529adfc427ef4fd8497306aeeadd
Author: Peter Wagenet <peter.wagenet@gmail.com>
Date:   Sat May 22 10:17:35 2010 -0700

    Accelerated Layout Positioning Support

commit 50869f09d2233c5c40949cf736dd58e482c550c7
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Wed May 26 09:18:32 2010 -0700

    Hack around a bug. :(

commit 34887b203378dc070244cf023df6bdf9e44cf89f
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 26 18:54:59 2010 -0700

    Regression by trying to remove invokeLater from keyDown in textfield

commit 1de4ad6ee51f91abba8d3280105bd036592a0443
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 26 16:54:43 2010 -0700

    Removing legacy code that shouldn't be in touch responder code

commit 0df9951e88556ad61af1e0724f01c25ef83d690b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 25 14:00:48 2010 -0700

    Changing the default SC Buildfile, desktop shouldn't require all other frameworks to load same with media framework

commit 8bc9f842e8af98355ae504e265a2a94795a785a2
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 25 13:58:38 2010 -0700

    If the return key or other keys are hit when a menu is open , they shouldn't go down to other responders

commit d8485b22c4ba9285fcec927799f4efe07ef2e0e8
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 25 13:56:28 2010 -0700

    Enable context menus on textfields

commit ff87a165ff2dc654feceb6e4f7e594175fba7e8b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 25 13:55:57 2010 -0700

    Disable context menus by default

commit 24363a7726bf0f52d734cce4ae963931fb5b02f6
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 25 13:55:30 2010 -0700

    Improve Perf of progress bar and slider by enabling css 3d transform

commit c752c96d737fda77cc6a27d67238fd40f354d354
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 25 14:28:22 2010 -0700

    Add a task queue to SproutCore, capable of running tasks in the "background"; that is, while idle.

commit b7aeda3b8873e8c6133ac144f3c66220b441ad84
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 25 14:27:39 2010 -0700

    ScrollView should just send the offset. The 3x clipping frame can break other things, and the live-update method is the proper way anyway.

commit 3eaa5ef36e04c6dc05077d02215e7763cb69b69e
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 25 14:26:21 2010 -0700

    A bit of stabilization.

commit 623138c177638ebdb9b8e9f2d2cfde74a63380e4
Author: SantoshShan <sshanbogue@apple.com>
Date:   Mon May 24 20:13:19 2010 -0700

    If isEnabledKey is provided check whether the object is an array or not
    accordingly get the value.

commit 0ef98bf59c727cd84150b835228a3f32d4553962
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon May 24 15:01:37 2010 -0700

    Change the value of the texfield on keyDown to reflect key repetions. Also adding a property to enable/disable textfield tabbing.

commit ebe584b7421b78a5c4780b624ba0203278a639e4
Author: adrain <adrain@apple.com>
Date:   Mon May 24 13:25:14 2010 -0700

    Fixed issue with underscore characters not appearing in IE text fields.

commit c315a0df58b45605df3f5ce91fed09746ab4ecaf
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 20 00:06:36 2010 -0700

    Modified onBeforeDeactivate event for IE that blocks default blurring to be off by default, and only enable on specific views as this disables expected textfield blurring

commit 5a876cf847836a36e877ac5c6c6c030b9bcd0a53
Author: Tom Dale <tdale@apple.com>
Date:   Mon May 24 10:59:39 2010 -0700

    Prevent other menu items from being highlighted when a menu flash is in progress.

commit 94a9f669e44dba006190782aef1ac7305bc18431
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Mon May 24 07:56:48 2010 -0700

    Robustify ScrollView's in-scroll functionality.

commit 7acd711178c92c49b09e158876f77ea90b47b3ec
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 21 18:54:13 2010 -0700

    Move touch scroller theme to a more general location.

commit 6a5aa1b5a6d14c193e927950a2dcfbf4fd6d12f1
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 21 17:47:49 2010 -0700

    Move deceleration rate into a parameter.

commit 4c074a0f6cf996cbc54252e4740af7ab7ff59d1f
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 21 15:25:52 2010 -0700

    Add scroll indicators.

commit e83c0ab5a4550a1d70709a85b773bef59bb3327f
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 21 14:40:47 2010 -0700

    Change API, adding touchScrollDidStart/touchScrollDidEnd.

commit 24d0ed1664e13314d3181d5501e6119d3a061da3
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:41:32 2010 -0700

    Add an option to CollectionView to use the currently very experimental fast path.

commit 07bc58d58db0ecb25112ce5f80085bb64d58a588
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:34:59 2010 -0700

    Make a mixin for a fast-path for collection view.

commit ac8af76da1a2851119496a228203564e10a34673
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:34:03 2010 -0700

    Refine calculation of velocity to consider possibility that the frame took longer than 10ms.

commit c73630970513c79ce564aa58c815682deb471164
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:33:44 2010 -0700

    Fix some bugs where "touch" was not cleared.

commit 6e8ed4842fb794f2a000137df60c493b555735d0
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:32:35 2010 -0700

    Separate scrollToRect after scrollToVisible.

commit f0e0a7ef8ede2a133e0b96822665d406de0e1a84
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:32:01 2010 -0700

    Allow in-scroll content updating.

commit a42fe90ce8ba27baa710d67ded8cc75a97625eea
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:29:50 2010 -0700

    ScrollView should restore the touch responder to itself if it was not recaptured.

commit 5559a2f5fa0548c1e06b264a371f528d6ef381aa
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:28:58 2010 -0700

    CollectionView should release touches back to ScrollView.

commit 6dfd411ff76b03a0868ed208b83a695f6c01e254
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Thu May 20 16:28:29 2010 -0700

    Make views update their layer's layerId if their layerId changes.

commit 73bd2065193f959d69e008359bb3d47e7d13af34
Author: Tom Dale <tdale@apple.com>
Date:   Fri May 21 18:02:12 2010 -0700

    Properly notify child views that their clipping frame when the parent view's frame is modified.

commit 7b6b445dfdd45660bdee4bbc317e78eceb927ebf
Author: Tom Dale <tdale@apple.com>
Date:   Fri May 21 15:11:39 2010 -0700

    Fix behavior of scrollers when clicking in the track.

commit 15860198fff6434a3ca049db7615f0f2d7fd4fdd
Author: Tom Dale <tdale@apple.com>
Date:   Fri May 21 15:08:19 2010 -0700

    Add a mouseLocation computed property to SC.device.

commit aa81c5a5c55993a24066c047b526a193437ff23a
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 20 15:55:32 2010 -0700

    Don't call focus on mousedown event targets. In IE, this could potentially reset the scrollTop property of a scroll view. This was put in place to work around IFRAME issues, but we need to find a more robust solution that doesn't affect scroll views.

commit da1dc300d519449289e9b91227fc56afc065d931
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri May 21 18:19:04 2010 -0700

    Perf updates to slider. Quicktime video on IE. jslint media slider

commit 3fbbd2469c799db72042bcd09a188a510895d67f
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 20 14:52:22 2010 -0700

    Added try/catch to avoid possible fatal errors in IE8 with textfield focusing

commit 000f8ff81d83c98a18a40db7c45d9777a38382f0
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 20 13:34:33 2010 -0700

    Left some logging statements in the last commit.

commit 29013c489dcea6de8a19b1d0f16ab447b1369b64
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 20 13:30:18 2010 -0700

    Menu panes with the SC.PICKER_MENU_POINTER prefer type should resize to remain within the bounds of the viewport.

commit da7b6218e4d20d37aab9ca538513d5737d4f4562
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 20 13:29:53 2010 -0700

    This value was not correct. Always verify the size of the window when positioning a picker pane.

commit 8d76895dad3750fda1adbee76ef493bc66c3d8ba
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 18 14:09:46 2010 -0700

    Since we bind the active state of the popup button to the menu's visibility, no need to set it manually.

commit 312b4885d1b43516acac48663c208d1e19e6a2d2
Author: Juan Pinzon <juanpin@67-218-105-120.cust.layer42.net>
Date:   Thu May 20 11:08:02 2010 -0700

    Fixed hint problems in firefox if the value changed with a binding

commit 70d66745f43bb28a85ab66aba6f4e2335b275080
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Wed May 19 17:17:48 2010 -0700

    Adds API to re-enter first responder (resetFirstResponder) and some tests.

commit ef24e05f35eb59a48fe2fba883618d9084e452f3
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Wed May 19 16:38:51 2010 -0700

    Add trigger() method to SC.routes to trigger the current route.

commit 83f42e771c692dd87668d5ca5c1cb2f25d1a0417
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 20 00:06:36 2010 -0700

    Modified onBeforeDeactivate event for IE that blocks default blurring to be off by default, and only enable on specific views as this disables expected textfield blurring

commit 3d71953c0a7bf6579c605dffadc2d21e825051a7
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Wed May 19 15:31:27 2010 -0700

    Localized versions of strings may be empty in some languages; also, added tests for these cases.

commit 5854ee09c6d3f9f3dd4e417ad15d03c9d21e1ff7
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 19 15:11:06 2010 -0700

    Add parentheses to correct the check to apply the Firefox "manually route the keypress event to the root responder".  Previously, in Firefox 3.6 on Windows (but not Mac, oddly enough) it would not invoke the special-case code if there was selected text (not just a caret) and the selection extended to the end of the input field.

commit ee5d31d3286d441f9fa429094783daf3c404c067
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue May 18 17:50:03 2010 -0700

    Reverting part of the change I made in c57798a8 because it's causing some regressions.  It probably is the correct thing to do long-term, however, so marking it with a TODO for now.

commit b04e18194069485b49669e8da8677c74d632e734
Author: Juan Pinzon <juanpin@67-218-107-50.cust.layer42.net>
Date:   Tue May 18 18:31:37 2010 -0700

    Adding extra validation to avoid incorrect appearance of hint when deleting all text while using firefox

commit a89ad4dbe7f566682b0534b8b8ad605cffe74cae
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 17:07:47 2010 -0700

    Replacing web app loading image with transparent pngs

commit fa6a4fd5cca72c1cabf07f0eee14ca8e23ac700e
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 17:06:13 2010 -0700

    Adding validation to before deactivate event on IE8

commit 4912d3271a308aa8ab0e883f840ce0e6e10b5491
Author: Sharath <sharath_raj@infosys.com>
Date:   Thu May 13 17:46:55 2010 +0530

    <rdar://problem/7964924> Calendar Chooser on event inspector doesn't resize smaller

commit 3e6ddf7c80f818a7bcef788352ba20614851cb2d
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue May 18 15:43:57 2010 -0700

    Update propagateToAggregates() to mark aggregated parent records as DIRTY when a child record is destroyed or created.  Similarly, also invoked propagateToAggregates() any time we notice that the store changed our record's properties.

commit 53bba8972fc359daf87f2f7e6b50a606857f8012
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 15:35:45 2010 -0700

    Revert "Optimizations to collectionView"

    This reverts commit 67f1280cf5b344f87d00feb7814f4aa84d72e215.

commit 0149fe763b779a72c885df7b0c268a1884480bdd
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 15:27:38 2010 -0700

    Adding maxlenght property to texfield view

commit 200eb3b69bf94edfc22071370fb1d217044d4b1b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 15:12:26 2010 -0700

    Reverting textfield regression and removing invokeLater

commit a1db634656f62591aa3e88a560e1bb0424cd8820
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 15:11:27 2010 -0700

    Reverting textfield regression and removing invokeLater

commit 4a456269c96f01ab4a6fa2f2b84aca8e13f37571
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 15:06:49 2010 -0700

    Revert "Removing applyImmediately as it's legacy code that is not doing anything."

    This reverts commit 2a972f6be4b48dcca34c42c700c657a6ee114d3d.

commit addac07b4b508e7212fa9d876c5024ec1330e446
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 14:42:59 2010 -0700

    Destroy the layer before removing from parent , otherwise the view will leak

commit b761b9c7f80fdd496fb7be99555222614915598b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 18 13:49:07 2010 -0700

    Adding orientation support for loading screen using media queries

commit a23393cb4201f64b533abb68479d7758e077875e
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 18 10:36:50 2010 -0700

    Ignore moveRight and moveLeft events if the user has a control or meta key held down. Otherwise, we may inadvertently block browser keyboard shortcuts.

commit f02e52e28b37abec17cb6b31a9155d8a78b66179
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 18 10:01:30 2010 -0700

    CollectionView was returning MIXED_STATE which is legacy. Just return YES.

commit 8703d31b7febb9f28d0af530ace4f623b8409e7b
Author: Luke Burton <luke.burton@apple.com>
Date:   Mon May 17 16:44:10 2010 -0700

    SC.SegmentedView displayItemIndexForPosition should handle vertically aligned controls.

commit 30b8655254ee7f62dabce8f7c2cf1f50bd03d160
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 17 20:49:09 2010 -0700

    There's no reason to clone the frame unless it's going to be mutated by the touch code.

commit a7ead2776588539b34065329f4eba6c30c3637cc
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 17 20:46:12 2010 -0700

    Correct an error I introduced in 5027445f where the clipping frames of our child views (grandchildren and below) would not be properly invalidated.  This is because I changed it to no longer be an observer -- so it's always run inline at the appropriate time -- but I neglected to change it to also correctly recurse down the child view hierarchy.  (The observer portion effectively handled that for us before.)

commit 992b8078a8ac87781aea8775c4f33aa75a8ebda7
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 17 19:11:17 2010 -0700

    Correct incorrect documentation

commit dfa3040ccb225c087348f7ea61e91996e835578c
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 17 19:06:39 2010 -0700

    Correct incorrect documentation.

commit 57d586b622f74db3ba05bca4b284c7464c5fdcb7
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 17 19:02:36 2010 -0700

    Have SC.stringFromRect() handle null, for client convenience.

commit 0e423eb0d8734bf149da2238cb2e879f41882b50
Author: Tom Dale <tdale@apple.com>
Date:   Mon May 17 13:36:13 2010 -0700

    Only monkeypatch if the browser is MobileSafari.

commit 81c609a56f7499057b8cd8282f9d3ef27d86f832
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon May 17 09:37:19 2010 -0700

    Add try/catch to timers to make sure timers continue to run even if there is an exception

commit 09b4c47dc06a22e92a2f9e5c2edbb21efe2aed5c
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Sun May 16 23:15:29 2010 -0700

    Added support for double byte japanese numbers

commit f74e9bf9d03b2b5ba386ed4455be330591b0dac2
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Sat May 15 20:42:02 2010 -0700

    Adding try/catch to play method, some plugins might not be ready at loading time and throw errors if you start clicking around controls during loading.

commit 7176817d4b9bb8ef4444cf8f8d2cf33706e2b8fe
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Sat May 15 20:18:28 2010 -0700

    Removing applyImmediately as it's legacy code that is not doing anything.

commit 3ad627c51c7e3708ed7529bcf9958838b524aae1
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Sat May 15 20:04:34 2010 -0700

    Adding missing delegate method to be able to edit list item

commit 399a3215c63ece104949d54cd0e5d4cd82beb132
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Sat May 15 16:32:21 2010 -0700

    Fix for text selection regression on IE. Due to addition of beforedeactivate event

commit 380693f866376cebee950171db980256ee8da587
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 14 17:14:09 2010 -0700

    Add a time of the last run loop so we can do idle processes.

commit b8f967ec6ea4adc5861100b74c6781964333198c
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Fri May 14 17:13:08 2010 -0700

    Move Date.now() into runtime, and only implement if the browser does not.

commit a7864cde70fdb247a224b35389d15c5f0efad9fb
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri May 14 17:38:54 2010 -0700

    Code cleanup to computeAnchorRect

commit ceb1b3fbd49aceacf4c9b26563fdacb4132d4176
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri May 14 15:15:22 2010 -0700

    REverting change that gets the layer out of sync with current state of the view

commit ec1148f606187b826cb92f5d2df55113ca599709
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri May 14 01:02:20 2010 -0700

    computeAnchorRect was not returning width and height for IE8 causing all pickers to fail positioning

commit 9d50110c0b68d519f8236b03c8c8046ebccc6685
Author: William Kakes <bkakes@funke.apple.com>
Date:   Thu May 13 17:30:01 2010 -0700

    Correct a now-outdated comment.

commit e01f3d971def23e9b12a29ca1b2ca205024b2919
Author: William Kakes <bkakes@funke.apple.com>
Date:   Thu May 13 17:27:16 2010 -0700

    After talking with Charles, re-visiting the mechanism in which we guarantee that layoutDidChange() is always called immediately after 'layout' is set.  We want to be careful before we introduce a generalized mechanism for "immediate" observers.

    This also mostly obviates the need for the "did the frame/clippingFrame actually change?" checks, which would do the computation potentially needlessly.  Now, such needless invalidations are rare enough that we should tackle them from the other angle (adding more sophistication to the "will this layout change affect the frame?" check), if at all.

commit 5446eb57151009ad19b0d9edba44414bc69b906c
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 12 17:45:48 2010 -0700

    Restore erroneously deleted line

commit 2006e1542f8d9521045ca98c623ed45dd9a71d57
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 12 15:52:00 2010 -0700

    It's more appropriate to run propagateToAggregates() from recordDidChange() rather than just in writeAttribute().

commit 44544ba64614cca4b04a6a2ae526180925d7bc22
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue May 11 18:48:24 2010 -0700

    Add some more documentation to the new 'alwaysImmediatelyNotifyFor' functionality.

commit b23db516d2652d4941b894a55e8ed34b4d2d7b24
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon May 10 15:28:03 2010 -0700

    Ensure that the (potentially cached) 'frame' property is always properly invalidated whenever the 'layout' property changes in a way that affects the frame.  The previous code used layoutDidChange() to do the invalidation but did not ensure that it would always be run immediately when 'layout' changed, leaving windows of opportunity for stale cached values.

commit f630892f1a98aff4c78d4ce2c7b2a7b7dac163ec
Author: Chris Hyle <chx@hyle.apple.com>
Date:   Wed May 12 17:53:39 2010 -0700

    Added inflector functions to SC.String: singularize() and pluralize()

commit 7f7f0b90b4922ae0c09ec8336a4d5ba118454626
Author: Kennard Smith <kennard@apple.com>
Date:   Thu May 6 13:43:22 2010 -0700

    root responder should try to find the target on the sender if it can't find it in the window context

commit aa5e29c9648a18d0ddc36746b2b8406f4b681afd
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Wed May 12 09:44:14 2010 -0700

    Use hasClass for extra stability.

commit 71514e3f1505266617e48d90a69f36d9617078b7
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 18:19:58 2010 -0700

    Update target as well as targetView.

commit 2f9f36421a2e879d6106725814e37bc9cedc72f9
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 17:00:49 2010 -0700

    Allow touch intercepting elements.

commit 4ddee12bfd8ebbca4fc7935e1f1e01681d5af000
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 16:43:58 2010 -0700

    Remove the touchEntered/touchExited code (views should handle it).

commit b1bcc548a850cfe45a02b27f77c46540888beaa7
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 16:39:33 2010 -0700

    Without this patch things work, but this is "more proper."

commit f51902ac2e6404571c1d91194ce2491ca43f6442
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 16:39:11 2010 -0700

    SegmentedView ought to work. It didn't. Now it does.

commit 30f62254ed5a06832708f761acc7e0fec75af691
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 16:38:54 2010 -0700

    Button should use touch boundary helpers.

commit 82770f825a3208982ee7afd80214be2ec88b5beb
Author: Alex Iskander <alexiskander@Alex-Iskanders-MacBook-Air.local>
Date:   Tue May 11 16:38:06 2010 -0700

    Add touch boundary helpers to SC.View.

commit adc01ed9916928b7a8348f1ea19c32919be2a2c6
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 11 15:13:06 2010 -0700

    Touch events should have a clickCount property.

commit 2f02da1af57edfc4087a330123660a9780247df9
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 11 15:10:46 2010 -0700

    ScrollerView's thumbLength should ensure it does not return NaN.

commit 20120f066faf64ae52bba5f1ec6ca1c08dea1b8c
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 12 16:34:47 2010 -0700

    Optimizations to collectionView

commit ec81c3df8b1047bc1b2919500135cbd7f9934863
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 12 16:32:32 2010 -0700

    Getting rootResponder to pass jslint

commit 0bd2092228159533e2a917b9fad7d2eb405cd860
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 12 16:32:01 2010 -0700

    Adding mousewheel support to textareas. Better documentation

commit c363cae23c355546230ae573a82345dd9d46af5d
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Mon May 10 17:20:45 2010 -0700

    Re-center sheet panes after animation is complete.

commit 3b27b0af5e379e6307c9b5798792c6cbe2a9e9d8
Author: Tom Dale <tdale@apple.com>
Date:   Mon May 10 13:54:47 2010 -0700

    RootResponder's performKeyEquivalent should check the menupane before the keypane.

commit 2214ffb1c63b8cfbe9f639af34508f8ab99ce77e
Author: Tom Dale <tdale@apple.com>
Date:   Mon May 10 13:54:25 2010 -0700

    Have menus close themselves if they receive an unhandled escape key press.

commit df2f9fe442e68ee6647eda05503eab9e82129e95
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon May 10 17:07:16 2010 -0700

    Adding HTML5 spellCheck support for textfields. It works with the latest versions of Firefox, Sproutcore, Chrome

commit 58b4d8e72b2c34634eaf3ff97027a6a893bfd021
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon May 10 12:50:06 2010 -0700

    Setting a color to a placeholder is buggy therefore i'm disabling the use of placeholders for future

commit bd26f04a2910bce7a72d33065315a2a77e5ec7d7
Author: Tom Dale <tomdale@67-218-106-82.cust.layer42.net>
Date:   Fri May 7 09:22:24 2010 -0700

    Should only apply 3D transform to panes in the MobileSafari environment.

commit aa98ceae05c650464e151c03fde2d87c9248cf11
Author: Tom Dale <tdale@apple.com>
Date:   Fri May 7 08:19:50 2010 -0700

    Add animation event handling to Root Responder.

commit 40c1b2341728180038dd3dc18045d622c6d485f1
Author: Tom Dale <tdale@apple.com>
Date:   Fri May 7 08:18:34 2010 -0700

    Add animation-related properties to SC.Event's copyable properties.

commit 91f44be8e5dd14084f26de8e0eceafc4f2f8affd
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 6 13:59:28 2010 -0700

    Automatically simulate touch events if the user agent reports the browser as MobileSafari but touch events aren't present.

commit d4a0d6b184ca0aaeb7db37d4820c06ce616e0d5c
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 6 17:01:54 2010 -0700

    Fix textfield focus regression with touch devices

commit a2b895c203461d4348af827e6ed8a3aa13c0d975
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Thu May 6 13:22:51 2010 -0700

    Make sure we are passing the fact that the inline field was discarded to the inlineEditorShouldEndEditing delegate

commit d2eec7272ce8aa1c381b23d99163a7911b6dfd8b
Author: Tom Dale <tdale@apple.com>
Date:   Thu May 6 10:19:39 2010 -0700

    Touch events should have a type property.

commit 29dda819e40c1b911999a0e8d3cd5a78bce9ba7c
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 6 15:38:22 2010 -0700

    Adding touchEntered, touchExited support

commit d7a9d1ecc5f6eb0824d75a5943c734b946766f8d
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu May 6 00:40:11 2010 -0700

    optimizations to touchmove

commit af43a869856a7d8133f30dc5b06225127dc52997
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 5 17:42:30 2010 -0700

    Inside computeAnchorRect(), use getBoundingClientRect() when it's available.  This gives about double the performance of the previous implementation in our project.

    Also, fix up setupPointer() a bit to avoid duplicitous lookups, etc.

commit cb953b9e64fc107e75c1a61cb1a3647f7accea91
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 5 16:42:38 2010 -0700

    Only look up SC.logBundleLoading at most once per function.

commit 7459d1f6e24e3283bc37f9f08c15fa8b391b0184
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 5 15:58:15 2010 -0700

    Add a few simple optimizations to SC.RenderContext of the "don't needlessly dereference hash values multiple times" variety.

commit 550ce844ba270b93a1ecb2f73c7db2cdd60f9a0f
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed May 5 13:33:30 2010 -0700

    Add a simple (partially pre-populated) cache for String#dasherize.  Most of the strings being used for dasherize in real-world applications (via SC.RenderContext, etc.) belong to a limited subset, and on slower browsers/devices, the cache can help a lot.

commit 71c3093b17c1a34d6eb21b7cf29f6bd363cbd5fc
Author: Tom Dale <tdale@apple.com>
Date:   Wed May 5 17:43:32 2010 -0700

    Verify we have a root responder before sending an event.

commit ba2cfd34dcfc4e7166ebd7567775d56ab6f47179
Author: Jason Ketterman <ketterman@apple.com>
Date:   Tue Mar 16 17:39:26 2010 -0700

    Allow configuration of the touch icons and status bar, as well as favicon via Buildfile.

commit 049da09adaf9f7bae091da05484515fbff7992a3
Author: Jason Ketterman <ketterman@apple.com>
Date:   Tue Apr 6 00:00:08 2010 -0700

    Provide additional sanity check to prevent crash if
    isVisibleInWindow is not properly calculated.

commit df371b0beb99a0e40c3ad06aff2fe368bc36d0ab
Author: Kennard Smith <kennard@apple.com>
Date:   Mon May 3 15:19:03 2010 -0700

    touchStart should perform the select action.

commit f564501a4084dfdfa6103797f1834162236a7582
Author: Charles Jolley <charles@sproutit.com>
Date:   Wed May 5 15:43:40 2010 -0700

    Put all panes onto a 3d transform for iPad

commit 19eb22413132ee510c3616a7208b3d99dbcbf359
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Wed May 5 16:50:23 2010 -0700

    Making it more clear where isOffline property is coming from

commit af3e5781ca2b76a97044f494da3c40eca8b64157
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Wed May 5 16:48:20 2010 -0700

    Adding some more documentation to SC.device

commit 75e898d49a3d974ec6be62efcb5fd06c5a2d8d30
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Wed May 5 16:40:49 2010 -0700

    Do a boolean check of navigator.onLine

commit ab1ed6d202cb152f9e55d9219ae40564daddf360
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Wed May 5 16:33:16 2010 -0700

    Adding new SC.device object for states such as orientation, online and offline (and moving orientation out from root responder)

commit c5b9b2a7fade11968b7a55a54e7488b25cbdff10
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 17:22:44 2010 -0700

    Fix for vertical aligment pre/post gecko 1.9.2

commit 220fd919c0b976537f63d309ed2efda8f5b7d7f2
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 17:14:15 2010 -0700

    Fix for vertical aligment pre/post gecko 1.9.2

commit ce36c863c74b08e2ee9f95cc6b843f0fcb16e200
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 15:47:26 2010 -0700

    Revert "Update Layer using invokeOnce and call parentDidResize using invokeLast. Using separate queues solves an issue with IE buttons not getting rendered after display properties change."

    This reverts commit a1f854180bc864e602073b72599c612dad4ce3d2.

commit c0ddc62b150b5d8ce7bb0bb5b40428f5dbb40989
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 11:03:48 2010 -0700

    Revert "Ensure view changes propagate consistently by deferring them until the end of the runloop, and having a monolithic 'flush' method that enacts those changes in order."

    This reverts commit 3afc961ebc66c201a132837a63d53221a5ad3b7a.

commit b932f99018936753ccb7fcce8eb5b994fd28823b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 11:03:19 2010 -0700

    Revert "layerNeedsUpdate should only be set if visibility changed."

    This reverts commit c94bc9886c5d257b0c80c7bb79b0fc3d0dec05de.

commit f5900733eca3c12e6894e81a2001c517a73ce0f9
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 11:03:01 2010 -0700

    Revert "Move updateLayerIfNeeded into flush() method."

    This reverts commit dd991d3ac65858b249baa71219dead30091f39e3.

commit 5199b36aa7fa68024ca8cd695b636b2edce466cb
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed May 5 11:02:41 2010 -0700

    Revert "frameNeedsUpdate isn't a real flag; we should invalidate clippingFrame immediately."

    This reverts commit 737504387ff4b4918e50746328426ee0bdc88f18.

commit 7ec24041b4e4a8f70ffac7f8efc1180faeaf3fd5
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue May 4 20:03:51 2010 -0700

    Fix css positioning issues for textareas in textfield

commit 30a7bc17c28a63c9fef965897cf830759d8073be
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue May 4 14:04:26 2010 -0700

    frameNeedsUpdate isn't a real flag; we should invalidate clippingFrame immediately.

commit ebbd3dd853ad8e3fa7486a023d4444b0a2704f45
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue May 4 13:02:27 2010 -0700

    Move updateLayerIfNeeded into flush() method.

commit f0be843e1cb0e5f637dc64d853ef8043d8f901e0
Author: Tom Dale <tdale@apple.com>
Date:   Tue May 4 11:49:12 2010 -0700

    layerNeedsUpdate should only be set if visibility changed.

commit cc69bb6d734dfefa81eca6355429faf9116a7202
Author: Jason Ketterman <ketterman@apple.com>
Date:   Sat May 1 01:55:31 2010 -0700

    Better mobileSafari and iPhone detection.

commit ae86fd48a212b07644606426f5321db913c9af42
Author: Kennard Smith <kennard@apple.com>
Date:   Fri Apr 30 15:22:27 2010 -0700

    Actually fix the wheel delta properly

commit 7d0d87eb3b2f38be6ad0ab5910a15c1a10c75815
Author: Kennard Smith <kennard@apple.com>
Date:   Wed Apr 28 10:12:23 2010 -0700

    A little more lenient scroll lock.

    This is a hack, as the SC team is still working on this and I don't want any changes I make to be clobbered.

    What should happen is the scrollLock for a touch should only apply up until a certain point.  Because of the deceleration, it gives the impression the animation has stopped... but it hasn't.  One should only need to check for the current acceleration to determine if a scrollLock should apply.

    For now, we make it just work.

commit dc74480dbc24adedad8fe874630696929bc9d4b2
Author: Jason Ketterman <ketterman@apple.com>
Date:   Tue Apr 20 14:20:08 2010 -0700

    Allow outlet to specify a different root.

commit 0c1c4f33c5abe683760fc09e40e8f8d79b82914e
Author: Kennard Smith <kennard@apple.com>
Date:   Tue Apr 20 13:35:04 2010 -0700

    Label's default behavior for inline editing should be the property of isEditable

commit 477c0e600bf02afa27d349157d33aa282bcd196d
Author: Charles Jolley <charles@sproutit.com>
Date:   Sat May 1 17:30:43 2010 -0700

    Log benchmark reports on separate lines to make it easier to see on an iPad

commit c7c00993062cace2ffd7625449c4568e22cbbd68
Author: William Kakes <bkakes@funke.apple.com>
Date:   Thu Apr 29 18:48:21 2010 -0700

    Fix typo

commit 64df341867a08bd6792d0bee77ce2c4d63cc1af1
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed Apr 28 16:21:22 2010 -0700

    Use a for() loop rather than a closure for iterating through the outlets during awake(), for a minor efficiency gain.

commit b31ddfea8576fa5430bdf98791ad089dd87355e3
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue May 4 10:08:53 2010 -0700

    Ensure view changes propagate consistently by deferring them until the end of the runloop, and having a monolithic 'flush' method that enacts those changes in order.

commit 59db0fa2e612600f3d0d92b9a3ca4db71fc3d485
Author: Tom Dale <tomdale@67-218-106-62.cust.layer42.net>
Date:   Tue May 4 09:21:45 2010 -0700

    Renamed isEnabledObserver to reduce the likelihood of naming collisions.

commit 25044486b5be06f7d75732a4a19376eb80d9ecdb
Author: Tom Dale <tomdale@67-218-106-62.cust.layer42.net>
Date:   Tue May 4 09:21:28 2010 -0700

    Fixed a grammatical error in SC.View documentation.

commit 4898a31a6f53c443b469fe876e926a627d4cf488
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Fri Apr 30 16:17:41 2010 -0700

    Fixed checkbox/righticon/disclosure states in SC.ListItemView

commit 0097b928c34e29a8156ab43a9b5bac7a8e6f3b76
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri Apr 30 16:20:59 2010 -0700

    Adding check to makeFirstResponder for touch devices. As we don't have control over focus we cannot make any textfield firstresponder programatically

commit ab3122a5fd3d07a4aa73b33099ab12149da8e0db
Author: adrain <adrain@apple.com>
Date:   Fri Apr 30 00:28:16 2010 -0700

    Fixed regression caused in 4116073744c88589d68da9408c48853d9ffe1141

commit ee6034c59d7771d3d256938c3d66585138b5e995
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Fri Apr 30 00:55:50 2010 -0700

    Removing inneficient css rules according to pagespeed, and adding a couple of classnames to simplify selectors

commit f1aa3cab98c3d50ed519592c25098bb0b9116345
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu Apr 29 16:40:57 2010 -0700

    Code cleanup simple optimizations

commit 8d8b083688f75d52049b2e4378f879b9243234b3
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Thu Apr 29 16:40:33 2010 -0700

    Removing route touch code not need for touch anymore

commit 6daaa18fd69137771938b952ac5e717d2efbdeda
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed Apr 28 14:29:01 2010 -0700

    Fix two more off-by-one calculation errors in SC.ListView#contentIndexesInRect, in the same vein as 48efd593.

    These fixes obsolete the need for a specific '0-height' check, too.

commit e84276a37afbef47332e2d00a320df8851299e2d
Author: Charles Jolley <charles@Acme-Labs.local>
Date:   Wed Apr 28 14:54:32 2010 -0700

    Slightly more sophisticated handling of elements.  Should avoid problems when removing elements...

commit e10a58547b512cd91b9b3553eb807bd7441394dc
Author: adrain <adrain@apple.com>
Date:   Tue Apr 27 18:48:26 2010 -0700

    Update Layer using invokeOnce and call parentDidResize using invokeLast. Using separate queues solves an issue with IE buttons not getting rendered after display properties change.

commit a8a01ec6a9272d4c3f118f557830fd24c0ad65f9
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 18:38:16 2010 -0700

    Don't pass in a point to contentIndexesInRect(), as it expects a rectangle.  My "nothing is visible if the rectangle is zero-height" change broke drag-and-drop because it inadvertently relied on the bug.

commit 973559b67ced8db4144f84db4644c13ee398cefd
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 16:36:29 2010 -0700

    When we're notified that our parent view's size changed, rather than assuming our frame changed as a result and telling our child views, actually check to see whether it did.

    This incurs a minor memory hit (one "previous frame" per view), but has the benefit of potentially not needlessly invalidating frames.

commit f9ce0257f7a041d451578efffb08f6f2947dbcaa
Author: Tom Dale <tdale@apple.com>
Date:   Tue Apr 27 16:13:00 2010 -0700

    Update SelectButtonView to use target/action instead of deprecated function calls.

commit 518598d24235a680fe88ae78426568f7d44e6d49
Author: Juan Pinzon <juanpin@67-218-110-219.cust.layer42.net>
Date:   Tue Apr 27 18:18:00 2010 -0700

    Fix for hint regression. Turns out that placeholder support is only enabled for input tags. For textareas is only supported on the latest webkit

commit 5d7ff88b899e4cac7707937d74789ab72e977e21
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 15:27:57 2010 -0700

    Fix a typo

commit fa3c6f755d0dab7979225c54fd067247aa0e9d95
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 15:04:34 2010 -0700

    Remove trailing whitespace

commit e6f3c975a70146955812ffc2cd64ce3c183f5bd1
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 15:03:53 2010 -0700

    Don't needlessly re-calculate the scroller visibility and positions every time the contentView's frame changes (which happens every pixel that is scrolled!) if the size of the frame didn't change.

    Also, avoid a few duplicitous hash lookups.

commit ba92c0bf463e742a76f83f2e9d3c5e6162ed1dc5
Author: Tom Dale <tdale@apple.com>
Date:   Tue Apr 27 15:28:31 2010 -0700

    Invoke button actions after a delay if triggered by keyboard shortcuts.

commit 9adccd9a07343ebf0599219e915bd669d475c8fa
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 14:23:53 2010 -0700

    Adjust the layout using 'adjust' rather than 'set' to avoid potentially needlessly re-setting the same value.

commit 276c0f3a2e045d237033426559f6993d23fea5b2
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 14:14:29 2010 -0700

    Re-use the CoreQuery object rather than (potentially) creating multiple new ones during 'update'.

commit 170c0e8be54d257cd93713ce233b24ed55b9bd06
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 14:04:21 2010 -0700

    If views are using the new-in-SC-1.1 static layout support, automatically invalidate the frame when the DOM element has been added to the DOM.

commit 50907ed498b363b29a218d55b3171b197edc66b8
Author: William Kakes <bkakes@funke.apple.com>
Date:   Tue Apr 27 14:03:51 2010 -0700

    There are currently a number of places that invalidate 'clippingFrame', but it often hasn't actually changed.  Since this invalidation can trigger a non-trivial amount of work (especially for collection views, etc.), it seems worthwhile to check to make sure it actually changed before notifying our child views that the clipping frame has changed.

commit 7b623aa402f8a9eaa48cd8e81e1c3560db1f4ec1
Author: William Kakes <bkakes@funke.apple.com>
Date:   Mon Apr 26 18:03:50 2010 -0700

    When the list view has a 0 height, correctly return that no item is visible.  Previously, it would think that item 0 was visible.

commit 1f65db8c5b9989693aa51777931dc26e0061b8f2
Author: William Kakes <bkakes@funke.apple.com>
Date:   Wed Apr 21 18:02:29 2010 -0700

    Correct an off-by-one issue when calculating 'nowShowing'.  Previously, if the first item was scrolled just out of view (as in, by one pixel), it would still be included in the 'nowShowing' index set.

commit 02bbb231e040a01e177cf29e28675c2cd2c91f41
Author: Tom Dale <tdale@apple.com>
Date:   Tue Apr 27 13:26:06 2010 -0700

    Make PopupButtonView and SelectButtonView click and hold delay a constant. Also lowered default value.

commit 9721308a316942aad3663a28f138a5dc5e82e036
Author: Tom Dale <tdale@apple.com>
Date:   Tue Apr 27 10:40:35 2010 -0700

    Fixed typo in TouchApproximation documentation.

commit e87a24b98353d879c06d50edb837057c92f8450b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon Apr 26 11:14:38 2010 -0700

    Added orientation support for touch devices

commit 1e9459d41ad5371645c2e2e5434daed8816e21ec
Author: adrain <adrain@apple.com>
Date:   Sat Apr 24 22:08:36 2010 -0700

    Fix the default # added in FF and IE when using routes

commit 91818f31a6ef1438f319b03b3a7681c645e4943b
Author: adrain <adrain@apple.com>
Date:   Fri Apr 23 16:23:51 2010 -0700

    SC.View: updateLayer using invokeLast instead of invokeOnce. Solves timing issues with IE.

commit 588cd1f4d841399c390e4b301858f1a3b477e46f
Author: adrain <adrain@apple.com>
Date:   Fri Apr 23 11:58:53 2010 -0700

    SC.TextFieldView: Default hint as empty string to avoid IE displaying null in the text fields

commit 12a7bcfcd21b6dd97c895a571bf69b456d18ac9d
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Thu Apr 22 10:42:11 2010 -0700

    Put in a sanity check when selecting text field in SC.TextFieldView in case a redraw has blown away the input field

commit 7f5c6676063d8615580146f1f076d18428af76a5
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed Apr 21 18:08:20 2010 -0700

    Fixing regression on textfieldview and firefox

commit b3561a0ea0540b78b15ba5b800d13a4b8c5691ef
Author: Tom Dale <tdale@apple.com>
Date:   Wed Apr 21 17:29:30 2010 -0700

    Added SC.TouchApproximation mixin.

commit 6ee864e9c0b30e65b19d3b5285625149b737980d
Author: Onar Vikingstad <onar@onarvikingstad.apple.com>
Date:   Wed Apr 21 10:37:08 2010 -0700

    Adding lastObject() method to SC.Enumerable

commit 0cdff8cd1be76fa72dfb87185d69d726cb04d733
Author: Charles Jolley <charles@sproutit.com>
Date:   Wed Apr 21 11:07:52 2010 -0700

    Add deprecation warning to SC.Scrollable

commit ca92c89410d99efb390360a18e72072beb73b2b9
Author: adrain <adrain@apple.com>
Date:   Wed Apr 21 11:26:59 2010 -0700

    Do not have explicit escapeHTML in select button. This causes double escaping.

commit f275e155fa270c3266c21d7c93136f6c2a709e56
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed Apr 21 14:29:13 2010 -0700

    This change is big. I went back to not having the hint as a separate div in top of the field, but to beon the field itself. THis improved the reliability cross browser wise as well as perf

commit 755730a74db91bd7228675e0ca863ecad656316f
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 18:11:58 2010 -0700

    SelectButtonView and PopupButtonView should record their timestamps at the end of the runloop.

commit dff6593e51805e94f0f47cf3569fa23d2e3ab778
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 17:53:00 2010 -0700

    We don't need to call parentViewDidResize() in updateLayerLocation() because it would have been called by now if it was needed anyway.

commit b634cb6f79f9ed49ce2e09a04d11f6efe53986d3
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 17:50:43 2010 -0700

    parentViewDidResize should only be called once per runloop.

commit a0179ce5788308bd815060ec90fea8f03ccfd3b8
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 17:49:41 2010 -0700

    Update these unit tests to run in in a RunLoop, because the code they are testing is now called using invokeLast.

commit 18e84bc7ea989b993f68e9c2f2dca4355ba303f4
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 17:42:49 2010 -0700

    Make the SC.StaticContentView unit tests a little less brittle.

commit 218218e4d924b3e5dcaa3d19bf8c69ef000ceb19
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 17:13:46 2010 -0700

    We should only apply this workaround for MobileSafari.

commit e4a2a0dade5d364a3396ee2a68410151ec662c79
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 16:39:26 2010 -0700

    SC.Pane should not call sendAction from its sendEvent implementation.

commit de23e04a83b5bcadd11b8fc33847e3f71ba3b21d
Author: adrain <adrain@apple.com>
Date:   Mon Apr 19 18:25:31 2010 -0700

    SC.MenuItemView: Close menu before executing action.

commit 1bc0224bd14ed5283670d18cddf075df7e57b36d
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 09:44:55 2010 -0700

    Add some touch event logging.

commit 26eb14e49721df2d7d52e6413e246413bf7dec35
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Tue Apr 20 09:44:43 2010 -0700

    Improve our iPad hack/workaround thing. And also garbage collect at the end.

commit 27cea27ecd7689a1f34e960cf2cbcb2c0af50159
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Tue Apr 20 14:12:55 2010 -0700

    The mapDisplayNames code crashes when an app passes a static reference to javascript. Added a try/catch to ignore this objects

commit 19146df480821ba17069449d40fa7843f93c1444
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 19 12:14:39 2010 -0700

    Fix error when resolving merge conflict.

commit ae3b9c8ebaad874fceff1fbc6cf21c1040e18f81
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 19 11:56:29 2010 -0700

    Take into account text nodes in the iPad hack.

commit 3a20f5ef629c698da5656c0174041e5f1ba416e7
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 19 11:56:15 2010 -0700

    In PopupButtonView and SelectButtonView, make sure that we accurately account for mousedown time.

commit 240806499e53690abe49b1f91afe6af337a1d7c6
Author: Tom Dale <tdale@apple.com>
Date:   Fri Apr 16 13:51:23 2010 -0700

    Flash menu items in select button views if the user clicks and releases without moving the mouse.

commit c865a2d8d323769afa5e940bd8e044a55e2cda70
Author: SantoshShan <sshanbogue@apple.com>
Date:   Fri Apr 16 12:30:30 2010 -0700

    Determine the width of the menu View based on the menu Item View's escapeHTML property. For this we need to create a dummyMenuItemView object and get the escapeHTML property off it.

commit 49ba773801e5d151d48ee381a6e7fb8d26d83e4b
Author: adrain <adrain@apple.com>
Date:   Fri Apr 16 11:20:02 2010 -0700

    SC.SelectButtonView and SC.MenuItemView now escapeHTML by default.

commit ad42065a10cbaa2474cffca9211e0f934d9951e3
Author: adrain <adrain@apple.com>
Date:   Fri Apr 16 11:17:08 2010 -0700

    Revert "Made changes to use escapeHTML in case the value is a script"

    This reverts commit 43db5ee64ac09704253cc857c9b6cd4491e3fe45.

    Caused double escaping in SC.SelectButtonView.

commit 5c6adac35e12e33220eb4824955a1680d4cbfa5e
Author: SantoshShan <sshanbogue@apple.com>
Date:   Wed Apr 14 19:07:37 2010 -0700

    Made changes to use escapeHTML in case the value is a script

commit 36ce2b88a8d984235c2aafc3a78e3075291f36d8
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Thu Apr 15 01:32:39 2010 -0700

    Added support for showing the loaded progress in quicktime-based video views, so the movie now plays and shows dynamic loading progress in FF with the quicktime player.

commit 57504d0e36c576db80419f309cebeb31079aa7fe
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Thu Apr 15 01:08:25 2010 -0700

    Allowed the setting of the duration for a quicktime-based video view to happen at a timeout if the immediate attempt fails. This makes Firefox's player work correctly, and keeps Safari's tight.

commit 977a49697407b7a469a03030ab2414d18d65dc3c
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Thu Apr 15 00:40:03 2010 -0700

    Changing the loadedTimeRanges updater to look at the .buffered TimeRange list on the HTML5 video element, instead of the .seekable list. This actually returns which sections have been downloaded, and now FirstRun's video player is finally complete\!

commit 871ffd892bce9efa519bbffdad90418f655ad19b
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Wed Apr 14 23:18:10 2010 -0700

    Broke out the updater code for loadedRanges into its own function in VideoView, and called it from a couple other relevant places. Looks like the HTML5 video element doesn't fire its 'progress' event as a paused video buffers itself. Also directly observing the loadedTimeRanges array from the slider, instead of a binding, which I could not get to fire.

commit ff6ee5b9b8d2b470f0d5ae465da28b5559d8310f
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Wed Apr 14 13:55:52 2010 -0700

    Moved the rendering of loaded time ranges into an observer, which is also called from the main render function.

commit 7635e74ace2d69d1a1151a678935e02700730f0e
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Wed Apr 14 13:40:13 2010 -0700

    Added support for display of any number of loaded time ranges in video sliders. Each loaded time range is a clipped, fully rendered copy of the slider track in its fully loaded state. All these are layered between the base track and the slider knob. Each clone of the loaded slider track template is cached.

commit 4bbda693d4961ce98fe555af87c483777f6234ff
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Tue Apr 13 18:17:09 2010 -0700

    Left handle insets and widths configurable through one layer of the view tree, without using SC.Binding.notEmpty. When notEmpty works, will switch to it.

commit bf86b49af9c93b2673a787ae4c49898cb26eb6d6
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed Apr 14 10:02:38 2010 -0700

    Default iPhone loading screen for webapps

commit 66267708a530f865e563270c214390552ed7349b
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Wed Apr 14 09:59:09 2010 -0700

    Fix regression for qt audio player

commit 1a86b53eaf8a74e9429e4c4cf0153d7aa29099ea
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 12 17:52:45 2010 -0700

    Add some documentation and refinement to simulated touch events.

commit e6b3d85a20b2fbe7b45ac54d93218538bd931232
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 12 17:26:44 2010 -0700

    When simulating touch events, set SC.browser/SC.platform.touch to YES.

commit 4dafd89fb82315578d3eb9723188e4b74bc9f270
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Mon Apr 12 16:39:32 2010 -0700

    Dereference events properly.

commit 56b267f945672c41a67f5bb8f84bb782c7d11d87
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Mon Apr 12 16:39:21 2010 -0700

    Rudimentary touch-simulation support for debugging on the desktop.

commit ba05c982471a1240d5141c0924fc88d8002992e6
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Mon Apr 12 13:36:17 2010 -0700

    Increase time before resuming property change notifications when appending a menu pane.

commit 6195e5ac57ff1f470475e4d00c5e73321bb14914
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 12 10:43:23 2010 -0700

    parentViewDidResize should be invoked once at the end of the RunLoop, so we don't end up calling it a million times.

commit f098df8d5bf2c3a879205fcd7e79ebb3b611b781
Author: Tom Dale <tdale@apple.com>
Date:   Mon Apr 12 10:43:00 2010 -0700

    Pull in latest scrollview changes from Alex.

commit 0b8b9c28c077498f972b5f676cded95f5ae8e040
Author: SantoshShan <sshanbogue@apple.com>
Date:   Mon Apr 12 12:05:17 2010 -0700

    Made changes to use === instead of == while comparing values in computeIsSelectedForValue function

commit 1ae083ced641ce4881ce64e723334405f40dc475
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon Apr 12 11:07:38 2010 -0700

    Removing debugger

commit ed17360b1028f61c4a1bd6cf80408ae536359613
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon Apr 12 10:56:12 2010 -0700

    Fix for quicktime media timer regression

commit c2b62aecdb6adce5195cfc34b9655fc0ea4733dc
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon Apr 5 13:16:55 2010 -0700

    Changes to media slider to enable mouse scrolling with media

commit fb040924fd90dd5bda778f0f8eba9b5abbb84a40
Author: Juan Pinzon <juanpin@Juan-Pinzons-MacBook-Pro.local>
Date:   Mon Apr 12 10:44:53 2010 -0700

    Adding namespace to video/audio controls css

commit 6fd15a913e77d685959efad022fda410843641a1
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Fri Apr 9 16:02:16 2010 -0700

    Improve the look of the unstyled slider just a tad. Some work needs to be done here still.

commit c601f50d4e1cbb676a96d787bb20b0b9397e1191
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Fri Apr 9 15:51:00 2010 -0700

    Improve the look of the unstyled slider just a tad. Some work needs to be done here still.

commit 56e69f5bf85486b3b5ab09331d20ed58c60f8288
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Fri Apr 9 14:08:06 2010 -0700

    Adding simpleControls.js to the VideoView bits. Didn't add them last commit.

commit b0e08bc5a26f90d086a5f068c1ee320909adaf24
Author: Chuck Edwall <chuckedw@Chuck-Edwalls-Mac-Pro.local>
Date:   Fri Apr 9 14:07:04 2010 -0700

    Changes to the VideoView to make its sliders pixel-based instead of percentage-based, and to allow configurable insets for the extreme left- and right-handle-positions. Also added a simple controls view, which features nothing but a play-pause button and a play progress slider.

commit 5dde04832b9e26540615af9c6a44dd4743043db7
Author: Tom Dale <tdale@apple.com>
Date:   Fri Apr 9 10:10:49 2010 -0700

    Rudimentary for touch support for SC.Drag.

commit 1ead57d2017684d6b0aa7e58e9a25a65d003f0dd
Author: Tom Dale <tdale@apple.com>
Date:   Fri Apr 9 10:09:24 2010 -0700

    Menu items should proxy touchStart events to mouseEntered.

commit e6b18a92a8bed98d1cf25245d829c03b062fa91a
Author: Tom Dale <tomdale@Tom-Dales-MacBook-Pro.local>
Date:   Fri Apr 9 09:55:55 2010 -0700

    WIP on simulating touch events on the desktop.
  • Loading branch information...
commit 5551211a796661432e337a982a38a84606a8e3fc 1 parent e9af647
Charles Jolley authored
Showing with 4,588 additions and 1,113 deletions.
  1. +4 −2 Buildfile
  2. BIN  design/iphone-webapp-loading.psd
  3. +110 −104 frameworks/animation/core.js
  4. +3 −3 frameworks/animation/tests/core.js
  5. +2 −2 frameworks/bootstrap/system/browser.js
  6. +1 −0  frameworks/bootstrap/system/loader.js
  7. +57 −45 frameworks/datastore/models/record.js
  8. +1 −1  frameworks/datastore/system/nested_store.js
  9. +17 −8 frameworks/datastore/system/store.js
  10. +48 −1 frameworks/datastore/tests/models/single_attribute.js
  11. +7 −1 frameworks/debug/core.js
  12. +1 −1  frameworks/desktop/english.lproj/alert.css
  13. +1 −1  frameworks/desktop/english.lproj/menu_item_view.css
  14. +2 −0  frameworks/desktop/english.lproj/progress.css
  15. +2 −0  frameworks/desktop/english.lproj/slider.css
  16. +681 −0 frameworks/desktop/mixins/collection_fast_path.js
  17. +6 −0 frameworks/desktop/mixins/scrollable.js
  18. +1 −1  frameworks/desktop/panes/alert.js
  19. +16 −4 frameworks/desktop/panes/menu.js
  20. +87 −29 frameworks/desktop/panes/picker.js
  21. +61 −22 frameworks/desktop/panes/select_button.js
  22. +9 −1 frameworks/desktop/panes/sheet.js
  23. +1 −1  frameworks/desktop/tests/views/list/ui_simple.js
  24. +10 −4 frameworks/desktop/tests/views/static_content.js
  25. +99 −33 frameworks/desktop/views/button.js
  26. +32 −7 frameworks/desktop/views/collection.js
  27. +7 −6 frameworks/desktop/views/list.js
  28. +56 −57 frameworks/desktop/views/list_item.js
  29. +48 −11 frameworks/desktop/views/menu_item.js
  30. +1 −1  frameworks/desktop/views/menu_scroll.js
  31. +34 −9 frameworks/desktop/views/popup_button.js
  32. +233 −83 frameworks/desktop/views/scroll.js
  33. +71 −35 frameworks/desktop/views/scroller.js
  34. +70 −11 frameworks/desktop/views/segmented.js
  35. +8 −3 frameworks/desktop/views/slider.js
  36. +1 −1  frameworks/desktop/views/static_content.js
  37. +1 −0  frameworks/foundation/english.lproj/bootstrap.rhtml
  38. +14 −8 frameworks/foundation/english.lproj/core.css
  39. BIN  frameworks/foundation/english.lproj/images/sproutcore-logo.png
  40. BIN  frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.jpg
  41. BIN  frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.png
  42. BIN  frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.jpg
  43. BIN  frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.png
  44. BIN  frameworks/foundation/english.lproj/images/sproutcore-startup.png
  45. +16 −1 frameworks/foundation/english.lproj/text_field.css
  46. +5 −0 frameworks/foundation/english.lproj/view.css
  47. +1 −1  frameworks/foundation/mixins/button.js
  48. +23 −14 frameworks/foundation/mixins/inline_text_field.js
  49. +10 −0 frameworks/foundation/mixins/responder_context.js
  50. +173 −4 frameworks/foundation/mixins/string.js
  51. +94 −32 frameworks/foundation/panes/pane.js
  52. +4 −1 frameworks/foundation/system/benchmark.js
  53. +10 −41 frameworks/foundation/system/browser.js
  54. +17 −14 frameworks/foundation/system/bundle.js
  55. +143 −0 frameworks/foundation/system/device.js
  56. +3 −2 frameworks/foundation/system/event.js
  57. +6 −1 frameworks/foundation/system/locale.js
  58. +158 −4 frameworks/foundation/system/platform.js
  59. +102 −50 frameworks/foundation/system/render_context.js
  60. +289 −81 frameworks/foundation/system/root_responder.js
  61. +15 −2 frameworks/foundation/system/routes.js
  62. +150 −0 frameworks/foundation/system/task_queue.js
  63. +0 −5 frameworks/foundation/system/time.js
  64. +60 −40 frameworks/foundation/system/utils.js
  65. +41 −0 frameworks/foundation/tasks/preload_bundle.js
  66. +17 −0 frameworks/foundation/tasks/task.js
  67. +75 −0 frameworks/foundation/tests/mixins/responder_context.js
  68. +53 −2 frameworks/foundation/tests/mixins/string.js
  69. +6 −1 frameworks/foundation/tests/system/locale.js
  70. +5 −0 frameworks/foundation/tests/system/render_context/end.js
  71. +2 −2 frameworks/foundation/tests/system/render_context/helpers_style.js
  72. +11 −0 frameworks/foundation/tests/system/render_context/update.js
  73. +23 −0 frameworks/foundation/tests/system/routes.js
  74. +43 −0 frameworks/foundation/tests/system/task_queue.js
  75. +81 −3 frameworks/foundation/tests/views/view/layoutStyle.js
  76. +6 −5 frameworks/foundation/tests/views/view/viewDidResize.js
  77. +9 −2 frameworks/foundation/validators/number.js
  78. +6 −6 frameworks/foundation/views/label.js
  79. +195 −52 frameworks/foundation/views/text_field.js
  80. +335 −110 frameworks/foundation/views/view.js
  81. +61 −8 frameworks/media/resources/video.css
  82. +77 −64 frameworks/media/views/audio.js
  83. +5 −2 frameworks/media/views/controls.js
  84. +212 −0 frameworks/media/views/mediaSlider.js
  85. +55 −0 frameworks/media/views/simpleControls.js
  86. +115 −53 frameworks/media/views/video.js
  87. +10 −0 frameworks/runtime/core.js
  88. +12 −0 frameworks/runtime/mixins/enumerable.js
  89. +7 −2 frameworks/runtime/system/object.js
  90. +35 −5 frameworks/runtime/system/run_loop.js
  91. +2 −2 frameworks/runtime/system/sparse_array.js
  92. +7 −5 lib/index.rhtml
View
6 Buildfile
@@ -31,9 +31,11 @@ config :runtime, :required => []
config :foundation, :required => [:runtime]
config :datastore, :required => [:runtime]
config :statechart, :required => [:runtime]
+config :desktop, :required => [:foundation]
+config :media, :required => [:desktop]
# APP-LEVEL FRAMEWORKS
-%w(desktop mobile designer media).each do |app_framework|
+%w(mobile designer).each do |app_framework|
config app_framework, :required => [:runtime, :datastore, :foundation]
end
@@ -43,7 +45,7 @@ config :mobile,
# WRAPPER FRAMEWORKS
config :designer, :required => [:runtime, :foundation]
-config :sproutcore, :required => :desktop
+config :sproutcore, :required => [:desktop, :datastore]
config :mini, :required => [:runtime, :datastore]
View
BIN  design/iphone-webapp-loading.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
214 frameworks/animation/core.js
@@ -35,6 +35,8 @@ aView: SC.LabelView.design(SC.Animatable, {
@extends SC.Object
*/
SC.Animatable = {
+ /** @scope SC.Animatable.prototype */
+
/**
Walks like a duck.
*/
@@ -55,7 +57,7 @@ SC.Animatable = {
"right": "right", "bottom": "bottom",
"width": "width", "height": "height",
"opacity": "opacity",
- "transform": "transform"
+ "transform": (SC.platform.supportsCSSTransforms ? '-'+SC.platform.cssPrefix+'-transform' : "transform")
},
// properties that adjust should relay to style
@@ -81,6 +83,9 @@ SC.Animatable = {
this._animatable_original_willRemoveFromParent = this.willRemoveFromParent || function(){};
this.willRemoveFromParent = this._animatable_will_remove_from_parent;
+
+ // auto observers do not work when mixed in live, so make sure we do a manual observer
+ this.addObserver("style", this, "styleDidChange");
// for debugging
this._animateTickPixel.displayName = "animate-tick";
@@ -126,14 +131,14 @@ SC.Animatable = {
_animatable_didCreateLayer: function(){
this.resetAnimation();
- SC.Event.add(this.get('layer'), "webkitTransitionEnd", this, this.transitionEnd);
- SC.Event.add(this.get('layer'), "transitionend", this, this.transitionEnd);
+ SC.Event.add(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this.transitionEnd);
+ SC.Event.add(this.get('layer'), "transitionEnd", this, this.transitionEnd);
return this._animatable_original_didCreateLayer();
},
_animatable_willDestroyLayer: function(){
- SC.Event.remove(this.get('layer'), "webkitTransitionEnd", this, this.transitionEnd);
- SC.Event.remove(this.get('layer'), "transitionend", this, this.transitionEnd);
+ SC.Event.remove(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this.transitionEnd);
+ SC.Event.remove(this.get('layer'), "transitionEnd", this, this.transitionEnd);
return this._animatable_original_willDestroyLayer();
},
@@ -256,6 +261,7 @@ SC.Animatable = {
/**
Stops all JavaScript animations on the object. In their tracks. Hah hah.
+ @private
*/
_stopJavaScriptAnimations: function() {
for (var i in this._animators) {
@@ -325,6 +331,33 @@ SC.Animatable = {
},
/**
+ @private
+ Triggers updateStyle at end of run loop.
+ */
+ styleDidChange: function() {
+ this.invokeLast("updateStyle");
+ }, // observer set up manually in initMixin to allow live mixins
+
+
+ /**
+ Since transforms can only be animated singly, we don't accelerate the layer unless
+ top and left transitions have the same duration.
+ Not cacheable since transitions may be updated without using a setter.
+ */
+ hasAcceleratedLayer: function(){
+ var leftDuration = this.transitions['left'] && this.transitions['left'].duration,
+ topDuration = this.transitions['top'] && this.transitions['top'].duration;
+
+ if (leftDuration !== topDuration) {
+ return NO;
+ } else if ((topDuration || leftDuration) && !SC.platform.supportsCSSTransitions) {
+ return NO;
+ } else {
+ return sc_super();
+ }
+ }.property('wantsAcceleratedLayer', 'transitions'),
+
+ /**
Immediately applies styles to elements, and starts any needed transitions.
Called automatically when style changes, but if you need styles to be adjusted
@@ -342,18 +375,23 @@ SC.Animatable = {
/* SPECIAL CASES (done now because they need to happen whether or not animation will take place) */
////**SPECIAL TRANSFORM CASE**////
var specialTransform = NO, specialTransformValue = "";
- if (
- SC.Animatable.enableCSSTransforms &&
- this.transitions["left"] && this.transitions["top"] &&
- this.transitions["left"].duration === this.transitions["top"].duration &&
- this.transitions["left"].timing === this.transitions["top"].timing &&
- (SC.none(newStyle["right"]) || newStyle["right"] === "") &&
- (SC.none(newStyle["bottom"]) || newStyle["bottom"] === "")
- ) {
- specialTransform = YES;
- this._useSpecialCaseTransform = YES;
- } else {
- this._useSpecialCaseTransform = NO;
+ if (this.get('hasAcceleratedLayer')) {
+
+ var nT = newStyle['top'],
+ nB = newStyle['bottom'],
+ nL = newStyle['left'],
+ nR = newStyle['right'];
+
+ // NOTE: This needs to match exactly the conditions in layoutStyles
+ if (
+ (SC.empty(nT) || (!SC.isPercentage(nT) && SC.empty(nB))) &&
+ (SC.empty(nL) || (!SC.isPercentage(nL) && SC.empty(nR)))
+ ) {
+ specialTransform = YES;
+ this._useSpecialCaseTransform = YES;
+ } else {
+ this._useSpecialCaseTransform = NO;
+ }
}
////**/SPECIAL TRANSFORM CASE**////
@@ -400,7 +438,7 @@ SC.Animatable = {
// also prepare an array of CSS transitions to set up. Do this always so we get (and keep) all transitions.
var cssTransitions = this._TMP_CSS_TRANSITIONS;
- if (SC.Animatable.enableCSSTransitions) {
+ if (SC.platform.supportsCSSTransitions) {
// first, handle special cases
var timing_function;
@@ -408,20 +446,20 @@ SC.Animatable = {
// this is a VERY special case. If right or bottom are supplied, can't do it. If left+top need
// animation at different speeds: can't do it.
if (specialTransform) {
- specialTransform = YES;
- timing_function = this.cssTimingStringFor(this.transitions["left"]);
- cssTransitions.push("-webkit-transform " + this.transitions["left"].duration + "s " + timing_function);
+ var transitionForTiming = this.transitions['left'] || this.transitions['top'];
+ timing_function = this.cssTimingStringFor(transitionForTiming);
+ cssTransitions.push("-"+SC.platform.cssPrefix+"-transform " + transitionForTiming.duration + "s " + timing_function);
}
////**END SPECIAL TRANSFORM CASE**////
// loop
for (i in this.transitions) {
if (!this._cssTransitionFor[i]) continue;
-
+
////**SPECIAL TRANSFORM CASE**////
if (specialTransform && (i == "left" || i == "top")) {
if (this.transitions["left"].action){
- this._transitionCallbacks["-webkit-transform"] = {
+ this._transitionCallbacks["-"+SC.platform.cssPrefix+"-transform"] = {
source: this,
target: (this.transitions["left"].target || this),
action: this.transitions["left"].action
@@ -429,10 +467,10 @@ SC.Animatable = {
}
if (this.transitions["top"].action){
- this._transitionCallbacks["-webkit-transform"] = {
+ this._transitionCallbacks["-"+SC.platform.cssPrefix+"-transform"] = {
source: this,
- target: (this.transitions["right"].target || this),
- action: this.transitions["right"].action
+ target: (this.transitions["top"].target || this),
+ action: this.transitions["top"].action
};
}
continue;
@@ -473,14 +511,14 @@ SC.Animatable = {
}
// If there is an available CSS transition, use that.
- if (SC.Animatable.enableCSSTransitions && this._cssTransitionFor[i])
+ if (SC.platform.supportsCSSTransitions && this._cssTransitionFor[i])
{
// the transition is already set up.
// we can just set it as part of the starting point
endingPoint[i] = newStyle[i];
if (this.transitions[i].action){
- this._transitionCallbacks[i] = {
+ this._transitionCallbacks[this._cssTransitionFor[i]] = {
source: this,
target: (this.transitions[i].target || this),
action: this.transitions[i].action
@@ -573,7 +611,7 @@ SC.Animatable = {
// all our timers are scheduled, we should be good to go. YAY.
return this;
- }.observes("style"),
+ },
_style_opacity_helper: function(style, key, props)
{
@@ -583,6 +621,7 @@ SC.Animatable = {
},
/**
+ @private
Adjusts display and queues a change for the other properties.
layer: the layer to modify
@@ -602,8 +641,7 @@ SC.Animatable = {
// set CSS transitions very first thing
if (this._animatableSetCSS != this._last_transition_css) {
- layer.style["-webkit-transition"] = this._animatableSetCSS;
- layer.style["-moz-transition"] = this._animatableSetCSS;
+ layer.style[SC.platform.domCSSPrefix+"Transition"] = this._animatableSetCSS;
this._last_transition_css = this._animatableSetCSS;
needsRender = YES;
}
@@ -648,41 +686,22 @@ SC.Animatable = {
var newLayout = {}, updateLayout = NO, style = layer.style;
// we extract the layout portion so SproutCore can do its own thing...
- var specialTransform = "";
+ var transform = "";
for (var i in styles)
{
if (i == "display") continue;
if (this.holder._layoutStyles.indexOf(i) >= 0)
{
- ////**SPECIAL TRANSFORM CASE**////
- // handle special case for CSS transforms
- if (this.holder._useSpecialCaseTransform && i === "left") {
- newLayout[i] = 0;
- specialTransform += "translateX(" + styles[i] + "px) ";
- updateLayout = YES;
- continue;
- } else if (this.holder._useSpecialCaseTransform && i === "top") {
- newLayout[i] = 0;
- specialTransform += "translateY(" + styles[i] + "px) ";
- updateLayout = YES;
- continue;
- }
- ////**END SPECIAL TRANSFORM CASE**////
-
// otherwise, normal layout
newLayout[i] = styles[i];
updateLayout = YES;
continue;
}
+ else if (i == "transform") transform += " " + styles[i];
else if (styleHelpers[i]) styleHelpers[i](style, i, styles);
else style[i] = styles[i];
}
- // apply special case
- if (specialTransform) {
- style["webkitTransform"] = specialTransform;
- }
-
// don't want to set because we don't want updateLayout... again.
if (updateLayout) {
var prev = this.holder.layout;
@@ -750,6 +769,7 @@ SC.Animatable = {
},
/**
+ @private
Solves cubic bezier curves. Basically, returns the Y for the supplied X.
I have only a vague idea of how this works. But I do have a vague idea. It is originally
@@ -809,6 +829,7 @@ SC.Animatable = {
},
/**
+ @private
Manages a single step in a single animation.
NOTE: this=>an animator hash
*/
@@ -883,6 +904,7 @@ SC.Animatable = {
},
/**
+ @private
Manages a single step in a single animation.
NOTE: this=>an animator hash
*/
@@ -994,23 +1016,42 @@ SC.Animatable = {
Add Singleton Portion
*/
SC.mixin(SC.Animatable, {
+ /** @scope SC.Animatable */
NAMESPACE: 'SC.Animatable',
VERSION: '0.1.0',
- // CSS-only
+ /** Linear transition **/
TRANSITION_NONE: "linear",
+
+ /** 'ease' transition if using CSS transitions; otherwise linear. **/
TRANSITION_CSS_EASE: "ease",
+
+ /** 'ease-in' transition if using CSS transitions; otherwise linear. **/
TRANSITION_CSS_EASE_IN: "ease-in",
+
+ /** 'ease-out' transition if using CSS transitions; otherwise linear. **/
TRANSITION_CSS_EASE_OUT: "ease-out",
+
+ /** 'ease-in-out' transition if using CSS transitions; otherwise linear. **/
TRANSITION_CSS_EASE_IN_OUT: "ease-in-out",
- // JavaScript-enabled
+ /** 'ease' transition. **/
TRANSITION_EASE: [0.25, 0.1, 0.25, 1.0],
+
TRANSITION_LINEAR: [0.0, 0.0, 1.0, 1.0],
+
+ /** 'ease-in' transition. **/
TRANSITION_EASE_IN: [0.42, 0.0, 1.0, 1.0],
+
+ /** 'ease-out' transition. **/
TRANSITION_EASE_OUT: [0, 0, 0.58, 1.0],
+
+ /** 'ease-in-out' transition if using CSS transitions; otherwise linear. **/
TRANSITION_EASE_IN_OUT: [0.42, 0, 0.58, 1.0],
+ /**
+ The timing function which all SC.Animatables should default to.
+ */
defaultTimingFunction: null, // you can change to TRANSITION_EASE, etc., but that may impact performance.
// For performance, use a custom linked-list timer
@@ -1031,16 +1072,18 @@ SC.mixin(SC.Animatable, {
// the current time (a placeholder, really)
currentTime: new Date().getTime(),
- // global setting deciding whether CSS transitions should be enabled
- enableCSSTransitions: NO, // automatically calculated. You can override, but only from OUTSIDE.
-
- enableCSSTransforms: NO, // automatically calculated (or, will be)
-
- // keep track of some basic statistics in an object (so they can be observable)
+ /**
+ A hash of stats for any currently running animations. Currently has property
+ lastFPS, which is the FPS for the last JavaScript-based animation.
+ */
stats: SC.Object.create({
lastFPS: 0
}),
-
+
+ /**
+ Adds a timer.
+ @private
+ */
addTimer: function(animator) {
if (animator.isQueued) return;
animator.prev = SC.Animatable.baseTimer;
@@ -1051,6 +1094,10 @@ SC.mixin(SC.Animatable, {
if (!SC.Animatable.going) SC.Animatable.start();
},
+ /**
+ Removes a timer.
+ @private
+ */
removeTimer: function(animator) {
if (!animator.isQueued) return;
if (animator.next) animator.next.prev = animator.prev; // splice ;)
@@ -1137,50 +1184,9 @@ SC.mixin(SC.Animatable, {
// otherwise, try to execute action direction on target or send down
// responder chain.
} else {
- SC.RootResponder.responder.sendAction(callback.action, callback.target, callback.source);
+ SC.RootResponder.responder.sendAction(callback.action, callback.target, callback.source, callback.source.get("pane"), null, callback.source);
}
}
}
-});
-
-
-/*
-Test for CSS transition capability...
-*/
-(function(){
- var allowsCSSTransforms = NO, allowsCSSTransitions = NO;
-
- // a test element
- var el = document.createElement("div");
-
- // the css and javascript to test
- var css_browsers = ["-webkit-", "-moz-", "-o-", "-ms-"];
- var test_browsers = ["moz", "Moz", "o", "ms", "webkit"];
-
- // prepare css
- var css = "", i = null;
- for (i = 0; i < css_browsers.length; i++) {
- css += css_browsers[i] + "transition:all 1s linear;"
- css += css_browsers[i] + "transform: translate3d(1px, 1px, 1px)";
- }
-
- // set css text
- el.style.cssText = css;
-
- // test
- for (i = 0; i < test_browsers.length; i++)
- {
- if (el.style[test_browsers[i] + "TransitionProperty"] !== undefined) allowsCSSTransitions = YES;
- if (el.style[test_browsers[i] + "Transform"] !== undefined) allowsCSSTransforms = YES;
- }
-
-
- // test
-
- // console.error("Supports CSS transitions: " + testResult);
-
- // and apply what we found
- SC.Animatable.enableCSSTransitions = allowsCSSTransitions;
- SC.Animatable.enableCSSTransforms = allowsCSSTransforms;
-})();
+});
View
6 frameworks/animation/tests/core.js
@@ -84,8 +84,8 @@ test("animatable should handle concatenated transitions properly", function(){
});
test("animatable handler for layer update should ensure both layout and styles are set in the 'current style'.", function() {
- var original_transition_enabled = SC.Animatable.enableCSSTransitions;
- SC.Animatable.enableCSSTransitions = NO;
+ var original_transition_enabled = SC.platform.supportsCSSTransitions;
+ SC.platform.supportsCSSTransitions = NO;
// we should have a style (it is inside a pane)
var current = view.getCurrentJavaScriptStyles();
@@ -96,7 +96,7 @@ test("animatable handler for layer update should ensure both layout and styles a
equals(current["left"], 100, "left should be 100");
// go back to the beginning
- SC.Animatable.enableCSSTransitions = original_transition_enabled;
+ SC.platform.supportsCSSTransitions = original_transition_enabled;
});
test("animatable callbacks work in general", function(){
View
4 frameworks/bootstrap/system/browser.js
@@ -8,8 +8,8 @@
var SC = SC || { BUNDLE_INFO: {}, LAZY_INSTANTIATION: {} };
SC.browser = (function() {
- var userAgent = navigator.userAgent.toLowerCase();
- var version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ;
+ var userAgent = navigator.userAgent.toLowerCase(),
+ version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ;
var browser = {
version: version,
View
1  frameworks/bootstrap/system/loader.js
@@ -42,5 +42,6 @@ SC.setupBodyClassNames = function() {
classNames.push(platform) ;
if (parseInt(SC.browser.msie,0)==7) classNames.push('ie7') ;
if (SC.browser.mobileSafari) classNames.push('mobile-safari') ;
+ if ('createTouch' in document) classNames.push('touch');
el.className = classNames.join(' ') ;
} ;
View
102 frameworks/datastore/models/record.js
@@ -193,8 +193,8 @@ SC.Record = SC.Object.extend(
**/
readOnlyAttributes: function() {
var store = this.get('store'),
- storeKey = this.storeKey;
- var ret = store.readDataHash(storeKey);
+ storeKey = this.storeKey,
+ ret = store.readDataHash(storeKey);
if (ret) ret = SC.clone(ret);
@@ -238,7 +238,12 @@ SC.Record = SC.Object.extend(
*/
destroy: function() {
this.get('store').destroyRecord(null, null, this.get('storeKey'));
- this.propertyDidChange('status');
+ this.notifyPropertyChange('status');
+
+ // If there are any aggregate records, we might need to propagate our new
+ // status to them.
+ this.propagateToAggregates();
+
return this ;
},
@@ -259,6 +264,11 @@ SC.Record = SC.Object.extend(
recordDidChange: function(key) {
this.get('store').recordDidChange(null, null, this.get('storeKey'), key);
this.notifyPropertyChange('status');
+
+ // If there are any aggregate records, we might need to propagate our new
+ // status to them.
+ this.propagateToAggregates();
+
return this ;
},
@@ -332,8 +342,6 @@ SC.Record = SC.Object.extend(
var store = this.get('store'),
storeKey = this.storeKey,
status = store.peekStatus(storeKey),
- recordAttr = this[key],
- recordType = SC.Store.recordTypeFor(storeKey),
attrs;
attrs = store.readEditableDataHash(storeKey);
@@ -353,12 +361,6 @@ SC.Record = SC.Object.extend(
if(!ignoreDidChange) this.endEditing(key);
}
-
- // if any aggregates, propagate the state
- if(!recordType.aggregates || recordType.aggregates.length>0) {
- this.propagateToAggregates();
- }
-
return this ;
},
@@ -390,30 +392,40 @@ SC.Record = SC.Object.extend(
// now loop through all aggregate properties and mark their related
// record objects as dirty
- var K = SC.Record;
+ var K = SC.Record,
+ dirty = K.DIRTY,
+ readyNew = K.READY_NEW,
+ destroyed = K.DESTROYED,
+ readyClean = K.READY_CLEAN,
+ iter;
+
+ // If the child is dirty, then make sure the parent gets a dirty
+ // status. (If the child is created or destroyed, there's no need,
+ // because the parent will dirty itself when it modifies that
+ // relationship.)
+ iter = function(rec) {
+ var childStatus, parentStatus;
+
+ if (rec) {
+ childStatus = this.get('status');
+ if ((childStatus & dirty) ||
+ (childStatus & readyNew) || (childStatus & destroyed)) {
+ parentStatus = rec.get('status');
+ if (parentStatus === readyClean) {
+ // Note: storeDidChangeProperties() won't put it in the
+ // changelog!
+ rec.get('store').recordDidChange(rec.constructor, null, rec.get('storeKey'), null, YES);
+ }
+ }
+ }
+ };
+
for(idx=0,len=aggregates.length;idx<len;++idx) {
key = aggregates[idx];
val = this.get(key);
recs = SC.kindOf(val, SC.ManyArray) ? val : [val];
- recs.forEach(function(rec) {
- // If the child is dirty, then make sure the parent gets a dirty
- // status. (If the child is created or destroyed, there's no need,
- // because the parent will dirty itself when it modifies that
- // relationship.)
- if (rec) {
- var childStatus = this.get('status');
- if (childStatus & K.DIRTY) {
- var parentStatus = rec.get('status');
- if (parentStatus === K.READY_CLEAN) {
- // Note: storeDidChangeProperties() won't put it in the
- // changelog!
- rec.get('store').recordDidChange(rec.constructor, null, rec.get('storeKey'), null, YES);
- }
- }
- }
- }, this);
+ recs.forEach(iter, this);
}
-
},
/**
@@ -426,6 +438,8 @@ SC.Record = SC.Object.extend(
@returns {SC.Record} receiver
*/
storeDidChangeProperties: function(statusOnly, keys) {
+ // TODO: Should this function call propagateToAggregates() at the
+ // appropriate times?
if (statusOnly) this.notifyPropertyChange('status');
else {
if (keys) {
@@ -433,7 +447,7 @@ SC.Record = SC.Object.extend(
keys.forEach(function(k) { this.notifyPropertyChange(k); }, this);
this.notifyPropertyChange('status');
this.endPropertyChanges();
-
+
} else this.allPropertiesDidChange();
// also notify manyArrays
@@ -469,7 +483,7 @@ SC.Record = SC.Object.extend(
store = this.get('store'),
storeKey = this.get('storeKey'),
key, valueForKey, typeClass, recHash, attrValue, normChild, isRecord,
- isChild, defaultVal;
+ isChild, defaultVal, keyForDataHash;
var dataHash = store.readEditableDataHash(storeKey) || {};
dataHash[primaryKey] = recordId;
@@ -481,16 +495,17 @@ SC.Record = SC.Object.extend(
if (valueForKey) {
typeClass = valueForKey.typeClass;
if (typeClass) {
+ keyForDataHash = valueForKey.get('key') || key; // handle alt keys
isRecord = SC.typeOf(typeClass.call(valueForKey))===SC.T_CLASS;
isChild = valueForKey.isChildRecordTransform;
if (!isRecord && !isChild) {
attrValue = this.get(key);
if(attrValue!==undefined || (attrValue===null && includeNull)) {
- dataHash[key] = attrValue;
+ dataHash[keyForDataHash] = attrValue;
}
- }
- else if (isChild) {
+
+ } else if (isChild) {
attrValue = this.get(key);
// Sometimes a child attribute property does not refer to a child record.
@@ -498,31 +513,28 @@ SC.Record = SC.Object.extend(
if (attrValue && attrValue.normalize) {
attrValue.normalize();
}
- }
- else if (isRecord) {
+ } else if (isRecord) {
attrValue = recHash[key];
if (attrValue !== undefined) {
// write value already there
- dataHash[key] = attrValue;
- }
- else {
+ dataHash[keyForDataHash] = attrValue;
+ } else {
// or write default
defaultVal = valueForKey.get('defaultValue');
// computed default value
if (SC.typeOf(defaultVal)===SC.T_FUNCTION) {
- dataHash[key] = defaultVal(this, key, defaultVal);
- }
- else {
+ dataHash[keyForDataHash] = defaultVal(this, key, defaultVal);
+ } else {
// plain value
- dataHash[key] = defaultVal;
+ dataHash[keyForDataHash] = defaultVal;
}
}
}
}
}
}
-
+
return this;
},
View
2  frameworks/datastore/system/nested_store.js
@@ -95,7 +95,7 @@ SC.NestedStore = SC.Store.extend(
chained stores. For a log changes that may actually be committed back to
the server see the changelog property.
- @property {Array}
+ @property {SC.Set}
*/
chainedChanges: null,
View
25 frameworks/datastore/system/store.js
@@ -239,7 +239,7 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
you call commitRecords() without passing any other parameters, the keys
in this set will be committed instead.
- @property {Array}
+ @property {SC.Set}
*/
changelog: null,
@@ -672,7 +672,7 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
time.
@param {SC.Store} nestedStore the child store
- @param {Array} changes the array of changed store keys
+ @param {SC.Set} changes the set of changed store keys
@param {Boolean} force
@returns {SC.Store} receiver
*/
@@ -1068,7 +1068,8 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
@returns {SC.Record} Returns the created record
*/
createRecord: function(recordType, dataHash, id) {
- var primaryKey, storeKey, status, K = SC.Record, changelog, defaultVal;
+ var primaryKey, storeKey, status, K = SC.Record, changelog, defaultVal,
+ ret;
// First, try to get an id. If no id is passed, look it up in the
// dataHash.
@@ -1117,8 +1118,11 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
this.invokeLast(this.commitRecords);
}
- // finally return materialized record
- return this.materializeRecord(storeKey) ;
+ // Finally return materialized record, after we propagate the status to
+ // any aggregrate records.
+ ret = this.materializeRecord(storeKey);
+ if (ret) ret.propagateToAggregates();
+ return ret;
},
/**
@@ -1580,7 +1584,7 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
@param {Array} recordTypes the expected record types (SC.Record)
@param {Array} ids to commit
- @param {Array} storeKeys to commit
+ @param {SC.Set} storeKeys to commit
@param {Hash} params optional additional parameters to pass along to the
data source
@@ -1648,8 +1652,13 @@ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
}
//remove all commited changes from changelog
- if (ret && !recordTypes && !ids && storeKeys===this.changelog){
- this.changelog = null;
+ if (ret && !recordTypes && !ids) {
+ if (storeKeys === this.changelog) {
+ this.changelog = null;
+ }
+ else {
+ this.changelog.removeEach(storeKeys);
+ }
}
return ret ;
},
View
49 frameworks/datastore/tests/models/single_attribute.js
@@ -19,6 +19,11 @@ module("SC.RecordAttribute core methods", {
// test toOne relationships
relatedTo: SC.Record.toOne('MyApp.Foo'),
+
+ // test non-isEditable toOne relationships
+ readOnlyRelatedTo: SC.Record.toOne('MyApp.Bar', {
+ isEditable: NO
+ }),
// test toOne relationship with computed type
relatedToComputed: SC.Record.toOne(function() {
@@ -74,6 +79,13 @@ module("SC.RecordAttribute core methods", {
firstName: 'Joe',
lastName: 'Schmo',
barId: 'bar1'
+ },
+
+ {
+ guid: 'foo5',
+ firstName: "Jane",
+ lastName: "Doe",
+ readOnlyRelatedTo: 'bar1'
}
]);
@@ -234,4 +246,39 @@ test("modifying a keyed toOne relationship", function(){
rec4.set('barKeyed', bar2);
equals(rec4.get('barId'), 'bar2', 'foo4.barId should == bar2');
-});
+});
+
+test("isEditable NO should not allow editing", function() {
+ var bar1 = MyApp.store.find(MyApp.Bar, 'bar1');
+ var bar2 = MyApp.store.find(MyApp.Bar, 'bar2');
+ var rec5 = MyApp.store.find(MyApp.Foo, 'foo5');
+
+ equals(rec5.get('readOnlyRelatedTo'), bar1, 'precond - should find bar1');
+ equals(rec5.get('status'), SC.Record.READY_CLEAN, 'precond - foo5 should be READY_CLEAN');
+
+ rec5.set('readOnlyRelatedTo', bar2);
+
+ equals(rec5.get('readOnlyRelatedTo'), bar1, 'should still find bar1 after setting');
+ equals(rec5.get('status'), SC.Record.READY_CLEAN, 'foo5 status is still READY_CLEAN');
+});
+
+test("isEditable NO should not fire property change observer", function() {
+ var bar1 = MyApp.store.find(MyApp.Bar, 'bar1');
+ var bar2 = MyApp.store.find(MyApp.Bar, 'bar2');
+ var rec5 = MyApp.store.find(MyApp.Foo, 'foo5');
+
+ equals(rec5.get('readOnlyRelatedTo'), bar1, 'precond - should find bar1');
+
+ var readOnlyWasModified = NO;
+ var modifierListener = function() {
+ readOnlyWasModified = YES;
+ };
+ rec5.addObserver('readOnlyRelatedTo', modifierListener);
+
+ rec5.set('readOnlyRelatedTo', bar2);
+
+ equals(readOnlyWasModified, NO, 'property change observer should not have fired');
+
+ rec5.removeObserver('readOnlyRelatedTo', modifierListener);
+});
+
View
8 frameworks/debug/core.js
@@ -76,7 +76,13 @@ SC.mapDisplayNames = function(obj, level, path, seenHash, seenArray) {
if (key === 'selectionStart' || key === 'selectionEnd') continue;
}
- val = obj[key];
+ try{
+ val = obj[key];
+ }catch(e){
+ //This object might be special this get called when an app
+ // using webView adds an static C object to JS.
+ continue;
+ }
if (key === "SproutCore") key = "SC";
t = SC.typeOf(val);
if (t === SC.T_FUNCTION) {
View
2  frameworks/desktop/english.lproj/alert.css
@@ -22,7 +22,7 @@
top: 14px;
}
-.sc-alert .info h1 {
+.sc-alert .info .header {
background-color: transparent;
color: black;
margin: 0;
View
2  frameworks/desktop/english.lproj/menu_item_view.css
@@ -3,7 +3,7 @@
border: none;
}
-.sc-button-view.sc-menu-item.sc-small-size a span {
+.sc-button-view.sc-menu-item.sc-small-size a {
line-height: 11px;
font-size: 11px;
}
View
2  frameworks/desktop/english.lproj/progress.css
@@ -19,6 +19,8 @@
bottom: 0px;
background: #555555;
border-right: 1px solid #555555;
+ -webkit-transition: all 0.01s linear;
+ -webkit-transform: translate3d(0,0,0);
}
.sc-progress-view.sc-indeterminate .sc-inner {
View
2  frameworks/desktop/english.lproj/slider.css
@@ -49,6 +49,8 @@
background: black;
border-radius:6px;
-moz-border-radius:6px;
+ -webkit-transform: translate3d(0,0,0);
+ -webkit-transition: left 0.01s ease-in-out;
}
.focus .sc-slider-view .sc-handle {
View
681 frameworks/desktop/mixins/collection_fast_path.js
@@ -0,0 +1,681 @@
+/**
+ An experimental CollectionView mixin that makes it extremely fast under
+ certain circumstances, including for mobile devices.
+*/
+SC.CollectionFastPath = {
+ //
+ // ITEM VIEW CLASS/INSTANCE MANAGEMENT
+ //
+ initMixin: function() {
+ this._indexMap = {};
+ },
+
+ /**
+ Returns the pool for a given example view.
+
+ The pool is calculated based on the guid for the example view class.
+ */
+ poolForExampleView: function(exampleView) {
+ var poolKey = "_pool_" + SC.guidFor(exampleView);
+ if (!this[poolKey]) this[poolKey] = [];
+ return this[poolKey];
+ },
+
+ /**
+ Creates an item view from a given example view, configuring it with basic settings
+ and the supplied attributes.
+ */
+ createItemViewFromExampleView: function(exampleView, attrs) {
+ // create the example view
+ var ret = exampleView.create(attrs);
+
+ // for our pooling, if it is poolable, mark the view as poolable and
+ // give it a reference to its pool.
+ if (ret.isPoolable) {
+ ret.owningPool = this.poolForExampleView(exampleView);
+ }
+
+ // we will sometimes need to know what example view created the item view
+ ret.createdFromExampleView = exampleView;
+
+ // and now, return (duh)
+ return ret;
+ },
+
+ configureItemView: function(itemView, attrs) {
+ // set settings. Self explanatory.
+ itemView.beginPropertyChanges();
+ itemView.setIfChanged('content', attrs.content);
+ itemView.setIfChanged('contentIndex', attrs.contentIndex);
+ itemView.setIfChanged('parentView', attrs.parentView);
+ itemView.setIfChanged('layerId', attrs.layerId);
+ itemView.setIfChanged('isEnabled', attrs.isEnabled);
+ itemView.setIfChanged('isSelected', attrs.isSelected);
+ itemView.setIfChanged('outlineLevel', attrs.outlineLevel);
+ itemView.setIfChanged('layout', attrs.layout);
+ itemView.setIfChanged('disclosureState', attrs.disclosureState);
+ itemView.setIfChanged('isVisibleInWindow', attrs.isVisibleInWindow);
+ itemView.setIfChanged('isGroupView', attrs.isGroupView);
+ itemView.setIfChanged('page', this.page);
+ itemView.endPropertyChanges();
+ },
+
+ /**
+ Configures a pooled view, calling .awakeFromPool if it is defined.
+ */
+ wakePooledView: function(itemView, attrs) {
+ // configure
+ this.configureItemView(itemView, attrs);
+
+ // awake from the pool, etc.
+ if (itemView.awakeFromPool) itemView.awakeFromPool(itemView.owningPool, this);
+ },
+
+ /**
+ Gets an item view from an example view, from a pool if possible, and otherwise
+ by generating it.
+ */
+ allocateItemView: function(exampleView, attrs) {
+ // we will try to get it from a pool. This will fill ret. If ret is not
+ // filled, then we'll know to generate one.
+ var ret;
+
+ // if it is poolable, we just grab from the pool.
+ if (exampleView.prototype.isPoolable) {
+ var pool = this.poolForExampleView(exampleView);
+ if (pool.length > 0) {
+ ret = pool.pop();
+ this.wakePooledView(ret, attrs);
+ }
+ }
+
+ if (!ret) {
+ ret = this.createItemViewFromExampleView(exampleView, attrs);
+ }
+
+ return ret;
+ },
+
+ /**
+ Releases an item view. If the item view is pooled, it puts it into the pool;
+ otherwise, this calls .destroy().
+
+ This is called for one of two purposes: to release a view that is no longer displaying,
+ or to release an older cached version of a view that needed to be replaced because the
+ example view changed.
+ */
+ releaseItemView: function(itemView) {
+ // if it is not poolable, there is not much we can do.
+ if (!itemView.isPoolable) {
+ itemView.destroy();
+ return;
+ }
+
+ // otherwise, we need to return to view
+ var pool = itemView.owningPool;
+ pool.push(itemView);
+ if (itemView.hibernateInPool) itemView.hibernateInPool(pool, this);
+ },
+
+ /**
+ Returns YES if the item at the index is a group.
+
+ @private
+ */
+ contentIndexIsGroup: function(index, contentObject) {
+ var contentDelegate = this.get("contentDelegate");
+
+ // setup our properties
+ var groupIndexes = this.get('_contentGroupIndexes'), isGroupView = NO;
+
+ // and do our checking
+ isGroupView = groupIndexes && groupIndexes.contains(index);
+ if (isGroupView) isGroupView = contentDelegate.contentIndexIsGroup(this, this.get("content"), index);
+
+ // and return
+ return isGroupView;
+ },
+
+ /**
+ @private
+ Determines the example view for a content index. There are two optional parameters that will
+ speed things up: contentObject and isGroupView. If you don't supply them, they must be computed.
+ */
+ exampleViewForItem: function(item, index) {
+ var del = this.get('contentDelegate'),
+ groupIndexes = this.get('_contentGroupIndexes'),
+ key, ExampleView,
+ isGroupView = this.contentIndexIsGroup(index, item);
+
+ if (isGroupView) {
+ // so, if it is indeed a group view, we go that route to get the example view
+ key = this.get('contentGroupExampleViewKey');
+ if (key && item) ExampleView = item.get(key);
+ if (!ExampleView) ExampleView = this.get('groupExampleView') || this.get('exampleView');
+ } else {
+ // otherwise, we go through the normal example view
+ key = this.get('contentExampleViewKey');
+ if (key && item) ExampleView = item.get(key);
+ if (!ExampleView) ExampleView = this.get('exampleView');
+ }
+
+ return ExampleView;
+ },
+
+ /**
+ This may seem somewhat awkward, but it is for memory performance: this fills in a hash
+ YOU provide with the properties for the given content index.
+
+ Properties include both the attributes given to the view and some CollectionView tracking
+ properties, most importantly the exampleView.
+
+
+ @private
+ */
+ setAttributesForItem: function(item, index, attrs) {
+ var del = this.get('contentDelegate'),
+ isGroupView = this.contentIndexIsGroup(index),
+ ExampleView = this.exampleViewForItem(item, index),
+ content = this.get("content");
+
+ //
+ // FIGURE OUT "NORMAL" ATTRIBUTES
+ //
+ attrs.createdFromExampleView = ExampleView;
+ attrs.parentView = this.get('containerView') || this;
+ attrs.contentIndex = index;
+ attrs.owner = attrs.displayDelegate = this;
+ attrs.content = item;
+ attrs.page = this.page;
+ attrs.layerId = this.layerIdFor(index);
+ attrs.isEnabled = del.contentIndexIsEnabled(this, content, index);
+ attrs.isSelected = del.contentIndexIsSelected(this, content, index);
+ attrs.outlineLevel = del.contentIndexOutlineLevel(this, content, index);
+ attrs.disclosureState = del.contentIndexDisclosureState(this, content, index);
+ attrs.isVisibleInWindow = this.get('isVisibleInWindow');
+ attrs.isGroupView = isGroupView;
+ attrs.layout = this.layoutForContentIndex(index);
+ if (!attrs.layout) attrs.layout = ExampleView.prototype.layout;
+ },
+
+
+
+
+ //
+ // ITEM LOADING/DOM MANAGEMENT
+ //
+
+ /**
+ @private
+ Returns mapped item views for the supplied item.
+ */
+ mappedViewsForItem: function(item, map) {
+ if (!map) map = this._viewMap;
+ return map[SC.guidFor(item)];
+ },
+
+ /**
+ @private
+ Returns the mapped view for an item at the specified index.
+ */
+ mappedViewForItem: function(item, idx, map) {
+ if (!map) map = this._viewMap;
+ var m = map[SC.guidFor(item)];
+ if (!m) return undefined;
+ return m[idx];
+ },
+
+ /**
+ @private
+ Maps a view to an item/index combination.
+ */
+ mapView: function(item, index, view, map) {
+ // get the default view map if a map was not supplied
+ if (!map) map = this._viewMap;
+
+ // get the item map
+ var g = SC.guidFor(item),
+ imap = map[g];
+ if (!imap) imap = map[g] = {_length: 0};
+
+ // fill in the index
+ imap[index] = view;
+ imap._length++;
+ },
+
+ /**
+ Unmaps a view from an item/index combination.
+ */
+ unmapView: function(item, index, map) {
+ if (!map) map = this._viewMap;
+ var g = SC.guidFor(item),
+ imap = map[g];
+
+ // return if there is nothing to do
+ if (!imap) return;
+
+ // remove
+ if (imap[index]) {
+ var v = imap[index];
+ delete imap[index];
+
+ imap._length--;
+ if (imap._length <= 0) delete map[g];
+ }
+ },
+
+ /**
+ Returns the item view for the given content index.
+ NOTE: THIS WILL ADD THE VIEW TO DOM TEMPORARILY (it will be cleaned if
+ it is not used). As such, use sparingly.
+ */
+ itemViewForContentIndex: function(index) {
+ var view = this._indexMap[index];
+ if (!view) {
+ var content = this.get("content"), item;
+ item = content.objectAt(index);
+ if (!item) return null;
+
+ // get example view and create item view
+ var exampleView = this.exampleViewForItem(item, index);
+ view = this.addItemView(exampleView, item, index);
+ }
+ return view;
+ },
+
+ /**
+ @private
+ Returns the nearest item view index to the supplied index mapped to the item.
+ */
+ nearestMappedViewIndexForItem: function(item, index, map) {
+ var m = this.mappedViewsForItem(item, map);
+ if (!m) return null;
+
+ // keep track of nearest and the nearest distance
+ var nearest = null, ndist = -1, dist = 0;
+
+ // loop through
+ for (var idx in m) {
+ idx = parseInt(idx, 10);
+ if (isNaN(idx)) continue;
+ // get distance
+ dist = Math.abs(index - idx);
+
+ // compare to nearest distance
+ if (ndist < 0 || dist < ndist) {
+ ndist = dist;
+ nearest = idx;
+ }
+ }
+
+ return nearest;
+ },
+
+ /**
+ @private
+ Remaps the now showing views to their new indexes (if they have moved).
+ */
+ remapItemViews: function(nowShowing) {
+ // reset the view map, but keep the old for removing
+ var oldMap = this._viewMap || {},
+ newMap = (this._viewMap = {}),
+ indexMap = (this._indexMap = {}),
+ mayExist = [],
+ content = this.get("content"), item;
+
+ if (!content) return;
+ var itemsToAdd = this._itemsToAdd;
+
+ // first, find items which we can (that already exist, etc.)
+ nowShowing.forEach(function(idx) {
+ item = content.objectAt(idx);
+
+ // determine if we have view(s) in the old map for the item
+ var possibleExistingViews = this.mappedViewsForItem(item, oldMap);
+ if (possibleExistingViews) {
+
+ // if it is the same index, we just take it. End of story.
+ if (possibleExistingViews[idx]) {
+ var v = possibleExistingViews[idx];
+ this.unmapView(item, idx, oldMap);
+ this.mapView(item, idx, v, newMap);
+ indexMap[idx] = v;
+ } else {
+ // otherwise, we must investigate later
+ mayExist.push(idx);
+ }
+ } else {
+ // if it is in now showing but we didn't find a view, it needs to be created.
+ itemsToAdd.push(idx);
+ }
+ }, this);
+
+ // now there are also some items which _could_ exist (but might not!)
+ for (var idx = 0, len = mayExist.length; idx < len; idx++) {
+ var newIdx = mayExist[idx];
+ item = content.objectAt(newIdx);
+ var nearestOldIndex = this.nearestMappedViewIndexForItem(item, newIdx, oldMap),
+ nearestView;
+
+ if (!SC.none(nearestOldIndex)) {
+ nearestView = this.mappedViewForItem(item, nearestOldIndex, oldMap);
+ var newExampleView = this.exampleViewForItem(item, newIdx);
+ if (newExampleView === nearestView.createdFromExampleView) {
+ // if there is a near one, use it, and remove it from the map
+ this.unmapView(item, nearestOldIndex, oldMap);
+ this.mapView(item, newIdx, nearestView, newMap);
+ indexMap[newIdx] = nearestView;
+ } else {
+ itemsToAdd.push(newIdx);
+ }
+ } else {
+ // otherwise, we need to create it.
+ itemsToAdd.push(newIdx);
+ }
+ }
+
+ return oldMap;
+ },
+
+ /**
+ Reloads.
+ */
+ reloadIfNeeded: function(nowShowing, scrollOnly) {
+ var content = this.get("content"), invalid;
+
+ // we use the nowShowing to determine what should and should not be showing.
+ if (!nowShowing || !nowShowing.isIndexSet) nowShowing = this.get('nowShowing');
+
+ // we only update if this is a non-scrolling update.
+ // don't worry: we'll actually update after the fact, and the invalid indexes should
+ // be queued up nicely.
+ if (!scrollOnly) {
+ invalid = this._invalidIndexes;
+ if (!invalid || !this.get('isVisibleInWindow')) return this;
+ this._invalidIndexes = NO;
+
+ // tell others we will be reloading
+ if (invalid.isIndexSet && invalid.contains(nowShowing)) invalid = YES ;
+ if (this.willReload) this.willReload(invalid === YES ? null : invalid);
+ }
+
+ // get arrays of items to add/remove
+ var itemsToAdd = this._itemsToAdd || (this._itemsToAdd = []);
+
+ // remap
+ var oldMap = this.remapItemViews(nowShowing);
+
+ // The oldMap has the items to remove, so supply it to processRemovals
+ this.processRemovals(oldMap);
+
+ // handle the invalid set (if it is present)
+ if (invalid) {
+ this.processUpdates(invalid === YES ? nowShowing : invalid);
+ }
+
+ // process items to add
+ this.processAdds();
+
+ // only clear the DOM pools if this is not during scrolling. Adding/removing is a
+ // bad idea while scrolling :)
+ if (!scrollOnly) this.clearDOMPools();
+
+ // clear the lists
+ itemsToAdd.length = 0;
+
+ // and if this is a full reload, we need to adjust layout
+ if (!scrollOnly) {
+ var layout = this.computeLayout();
+ if (layout) this.adjust(layout);
+ if (this.didReload) this.didReload(invalid === YES ? null : invalid);
+ }
+
+ return this;
+ },
+
+ /**
+ Loops through remove queue and removes.
+ */
+ processRemovals: function(oldMap) {
+ var content = this.get("content");
+ for (var guid in oldMap) {
+ var imap = oldMap[guid];
+ for (var itemIdx in imap) {
+ itemIdx = parseInt(itemIdx, 10);
+ if (isNaN(itemIdx)) continue;
+
+ var view = imap[itemIdx];
+
+ if (this._indexMap[itemIdx] === view) delete this._indexMap[itemIdx];
+
+ view._isInCollection = NO;
+ this.removeItemView(view);
+ }
+ }
+ },
+
+ /**
+ @private
+ Loops through update queue and... updates.
+ */
+ processUpdates: function(invalid) {
+ var u = this._itemsToUpdate, content = this.get("content"), item, view;
+ invalid.forEach(function(idx) {
+ item = content.objectAt(idx);
+ if (view = this.mappedViewForItem(item, idx)) {
+ if (!view._isInCollection) return;
+ var ex = this.exampleViewForItem(item, idx);
+ this.updateItemView(view, ex, item, idx);
+ }
+ }, this);
+ },
+
+ /**
+ @private
+ Loops through add queue and, well, adds.
+ */
+ processAdds: function() {
+ var content = this.get("content");
+
+ var add = this._itemsToAdd, idx, len = add.length, itemIdx, item;
+ for (idx = 0; idx < len; idx++) {
+ itemIdx = add[idx]; item = content.objectAt(itemIdx);
+
+ // get example view and create item view
+ var exampleView = this.exampleViewForItem(item, itemIdx);
+ var view = this.addItemView(exampleView, item, itemIdx);
+ }
+ },
+
+ /**
+ @private
+ Clear all DOM pools.
+ */
+ clearDOMPools: function() {
+ var pools = this._domPools || (this._domPools = {});
+ for (var p in pools) {
+ this.clearDOMPool(pools[p]);
+ }
+ },
+
+ domPoolSize: 10,
+
+ /**
+ @private
+ Clears a specific DOM pool.
+ */
+ clearDOMPool: function(pool) {
+ var idx, len = pool.length, item;
+
+ // we skip one because there is a buffer area of one while scrolling
+ for (idx = this.domPoolSize; idx < len; idx++) {
+ item = pool[idx];
+
+ // remove from DOM
+ this.removeChild(item);
+
+ // release the item
+ this.releaseItemView(item);
+ }
+
+ // pool is cleared.
+ pool.length = Math.min(pool.length, this.domPoolSize);
+ },
+
+ /**
+ @private
+ Returns the DOM pool for the given exampleView.
+ */
+ domPoolForExampleView: function(exampleView) {
+ var pools = this._domPools || (this._domPools = {}), guid = SC.guidFor(exampleView);
+ var pool = pools[guid];
+ if (!pool) pool = pools[guid] = [];
+ return pool;
+ },
+
+ /**
+ @private
+ Tries to find an item for the given example view in a dom pool.
+ If one could not be found, returns null.
+ */
+ itemFromDOMPool: function(exampleView) {
+ var pool = this.domPoolForExampleView(exampleView);
+ if (pool.length < 1) return null;
+ var view = pool.shift();
+ if (view.wakeFromDOMPool) view.wakeFromDOMPool();
+ return view;
+ },
+
+ /**
+ @private
+ Sends a view to a DOM pool.
+ */
+ sendToDOMPool: function(view) {
+ var pool = this.domPoolForExampleView(view.createdFromExampleView);
+ pool.push(view);
+ var f = view.get("frame");
+ view.adjust({ top: -f.height });
+ view.set("layerId", SC.guidFor(view));
+ if (view.sleepInDOMPool) view.sleepInDOMPool();
+ },
+
+ /**
+ @private
+ Adds an item view (grabbing the actual item from one of the pools if possible).
+ */
+ addItemView: function(exampleView, object, index) {
+ var view, attrs = this._TMP_ATTRS || (this._TMP_ATTRS = {});
+
+ // in any case, we need attributes
+ this.setAttributesForItem(object, index, attrs);
+
+ // try to get from DOM pool first
+ if (view = this.itemFromDOMPool(exampleView)) {
+ // set attributes
+ this.configureItemView(view, attrs);
+
+ // set that it is in the collection
+ view._isInCollection = YES;
+
+ // add to view map (if not used, it will be removed)
+ this.mapView(object, index, view);
+ this._indexMap[index] = view;
+
+ // and that should have repositioned too
+ return view;
+ }
+
+ // otherwise, just allocate a view
+ view = this.allocateItemView(exampleView, attrs);
+
+ // and then, add it
+ this.appendChild(view);
+
+ // set that it is in the collection.
+ view._isInCollection = YES;
+
+ // add to view map (if not used, it will be removed)
+ this.mapView(object, index, view);
+ this._indexMap[index] = view;
+
+ return view;
+ },
+
+ /**
+ @private
+ Removes an item view.
+ */
+ removeItemView: function(current) {
+ if (current.get("layerIsCacheable")) {
+ this.sendToDOMPool(current);
+ } else {
+ this.removeChild(current);
+ }
+ current._isInCollection = NO;
+ },
+
+ /**
+ Updates the specified item view. If the view is not "layer cacheable" or the
+ example view has changed, it will be redrawn.
+
+ Otherwise, nothing will happen.
+ */
+ updateItemView: function(current, exampleView, object, index) {
+ if (!current.get("layerIsCacheable") || current.createdFromExampleView !== exampleView) {
+ console.error("BAD UPDATE");
+ // unmap old and remove
+ this.unmapView(current, index);
+ delete this._indexMap[index];
+ this.removeItemView(current, object, index);
+
+ // add new and map
+ var newView = this.addItemView(exampleView, object, index);
+ } else {
+ var attrs = this._TMP_ATTRS || (this._TMP_ATTRS = {});
+
+ this.setAttributesForItem(object, index, attrs);
+ this.configureItemView(current, attrs);
+ }
+ },
+
+
+ /**
+ Tells ScrollView that this should receive live updates during touch scrolling.
+ We are so fast, aren't we?
+ */
+ _lastTopUpdate: 0,
+ _lastLeftUpdate: 0,
+ _tolerance: 100,
+
+ /**
+ The fast-path that computes a special
+ */
+ touchScrollDidChange: function(left, top) {
+ var clippingFrame = this.get('clippingFrame');
+
+ var cf = this._inScrollClippingFrame || (this._inScrollClippingFrame = {x: 0, y: 0, width: 0, height: 0});
+ cf.x = clippingFrame.x; cf.y = clippingFrame.y; cf.width = clippingFrame.width; cf.height = clippingFrame.height;
+
+ // update
+ cf.x = left;
+ cf.y = top;
+
+ var r = this.contentIndexesInRect(cf);
+ if (!r) return; // no rect, do nothing.
+
+ var len = this.get('length'),
+ max = r.get('max'), min = r.get('min');
+
+ if (max > len || min < 0) {
+ r = r.copy();
+ r.remove(len, max-len).remove(min, 0-min).freeze();
+ }
+
+ if (this._lastNowShowing) {
+ if (r.contains(this._lastNowShowing) && this._lastNowShowing.contains(r)) return;
+ }
+ this._lastNowShowing = r;
+ this.reloadIfNeeded(r, YES);
+ }
+
+};
View
6 frameworks/desktop/mixins/scrollable.js
@@ -20,6 +20,12 @@
*/
SC.Scrollable = {
+//@if(debug)
+ initMixin: function() {
+ console.warn("SC.Scrollable is deprecated and will be removed in a future version of SproutCore. Consider pulling the mixin into your own app if you want to keep using it.");
+ },
+//@endif
+
/** Informs the view system that the receiver is scrollable.
Must always be true.
View
2  frameworks/desktop/panes/alert.js
@@ -219,7 +219,7 @@ SC.AlertPane = SC.PanelPane.extend({
var blank = SC.BLANK_IMAGE_URL ;
if(pane.get('icon') == 'blank') context.addClass('plain');
context.push('<img src="'+blank+'" class="icon '+pane.get('icon')+'" />');
- context.begin('h1').text(pane.get('message') || '').end();
+ context.begin('h1').attr('class', 'header').text(pane.get('message') || '').end();
context.push(pane.get('displayDescription') || '');
context.push(pane.get('displayCaption') || '');
context.push('<div class="separator"></div>');
View
20 frameworks/desktop/panes/menu.js
@@ -243,17 +243,15 @@ SC.MenuPane = SC.PickerPane.extend(
*/
popup: function(anchorViewOrElement, preferMatrix) {
var anchor;
-
+ this.beginPropertyChanges();
if (anchorViewOrElement) {
anchor = anchorViewOrElement.isView ? anchorViewOrElement.get('layer') : anchorViewOrElement;
}
- this.beginPropertyChanges();
this.set('anchorElement',anchor) ;
this.set('anchor',anchorViewOrElement);
if (preferMatrix) this.set('preferMatrix',preferMatrix) ;
- this.endPropertyChanges();
this.adjust('height', this.get('menuHeight'));
this.positionPane();
@@ -261,6 +259,7 @@ SC.MenuPane = SC.PickerPane.extend(
// pane's defaultResponder to itself. This way key events can be
// interpreted in keyUp.
this.set('defaultResponder', this);
+ this.endPropertyChanges();
// IE7 has a bug where, intermittently, appending a menu pane will cause
// the other panes to blank out, until the user interacts with the window.
@@ -1006,12 +1005,26 @@ SC.MenuPane = SC.PickerPane.extend(
},
performKeyEquivalent: function(keyEquivalent) {
+ // Look for menu item that has this key equivalent
var menuItem = this._keyEquivalents[keyEquivalent];
+ // If found, have it perform its action
if (menuItem) {
menuItem.performAction(YES);
return YES;
}
+
+ // If escape key was pressed and no menu item handled it,
+ // close the menu pane.
+ if (keyEquivalent === 'escape') {
+ this.remove();
+ return YES;
+ }
+ //If a menu is visible and you hit enter
+ // it shouldn't go down to other responders.
+ if (keyEquivalent === 'return') {
+ return YES;
+ }
return NO;
},
@@ -1058,7 +1071,6 @@ SC.MenuPane = SC.PickerPane.extend(
@private
*/
modalPaneDidClick: function(evt) {
- this.closeOpenMenusFor(this.get('previousMenuItem'));
this.remove();
return YES;
View
116 frameworks/desktop/panes/picker.js
@@ -244,11 +244,38 @@ SC.PickerPane = SC.PalettePane.extend({
But since our anchor can be element, we use this solution for now.
*/
computeAnchorRect: function(anchor) {
- var ret = SC.viewportOffset(anchor); // get x & y
- var cq = SC.$(anchor);
- var wsize = SC.RootResponder.responder.computeWindowSize() ;
- ret.width = cq.outerWidth();
- ret.height = (wsize.height-ret.y) < cq.outerHeight() ? (wsize.height-ret.y) : cq.outerHeight();
+ var bounding, ret, cq,
+ wsize = SC.RootResponder.responder.computeWindowSize();
+
+ // Some browsers natively implement getBoundingClientRect, so if it's
+ // available we'll use it for speed.
+ if (anchor.getBoundingClientRect) {
+ // Webkit and Firefox 3.5 will get everything they need by
+ // calling getBoundingClientRect()
+ bounding = anchor.getBoundingClientRect();
+ ret = {
+ x: bounding.left,
+ y: bounding.top,
+ width: bounding.width,
+ height: bounding.height
+ };
+ // If width and height are undefined this means we are in IE or FF<3.5
+ // if we didnt get the frame dimensions the do the calculations
+ // based on an element
+ if(ret.width===undefined || ret.height===undefined){
+ cq = SC.$(anchor);
+ ret.width = cq.outerWidth();
+ ret.height = cq.outerHeight();
+ }
+ }
+ else {
+ // Only really old versions will have to go through this code path.
+ ret = SC.viewportOffset(anchor); // get x & y
+ cq = SC.$(anchor);
+ ret.width = cq.outerWidth();
+ ret.height = cq.outerHeight();
+ }
+ ret.height = (wsize.height-ret.y) < ret.height ? (wsize.height-ret.y) : ret.height;
return ret ;
},
@@ -257,7 +284,10 @@ SC.PickerPane = SC.PalettePane.extend({
*/
fitPositionToScreen: function(preferredPosition, picker, anchor) {
// get window rect.
+ //if(this._prefPosX && this._prefPosY)
+
var wsize = SC.RootResponder.responder.computeWindowSize() ;
+
var wret = { x: 0, y: 0, width: wsize.width, height: wsize.height } ;
picker.x = preferredPosition.x ; picker.y = preferredPosition.y ;
@@ -267,8 +297,11 @@ SC.PickerPane = SC.PalettePane.extend({
// apply menu re-position rule
picker = this.fitPositionToScreenMenu(wret, picker, this.get('isSubMenu')) ;
break;
- case SC.PICKER_POINTER:
case SC.PICKER_MENU_POINTER:
+ this.setupPointer(anchor);
+ picker = this.fitPositionToScreenMenuPointer(wret, picker, anchor);
+ break;
+ case SC.PICKER_POINTER:
// apply pointer re-position rule
this.setupPointer(anchor);
picker = this.fitPositionToScreenPointer(wret, picker, anchor) ;
@@ -379,6 +412,26 @@ SC.PickerPane = SC.PalettePane.extend({
},
/** @private
+ Reposition the pane in a way that is optimized for menus that have a
+ point element.
+
+ This simply calls fitPositionToScreenPointer, then ensures that the menu
+ does not exceed the height of the viewport.
+
+ @returns {Rect}
+ */
+ fitPositionToScreenMenuPointer: function(w, f, a) {
+ f = this.fitPositionToScreenPointer(w,f,a);
+
+ // If the height of the menu is bigger than the window height, resize it.
+ if( f.height+f.y+35 >= w.height){
+ f.height = w.height - f.y - (SC.MenuPane.VERTICAL_OFFSET*2) ;
+ }
+
+ return f;
+ },
+
+ /** @private
re-position rule for triangle pointer picker.
*/
fitPositionToScreenPointer: function(w, f, a) {
@@ -470,44 +523,49 @@ SC.PickerPane = SC.PalettePane.extend({
/** @private
This method will set up pointerOffset and preferMatrix according to type
- and size if not provided excplicitly.
+ and size if not provided explicitly.
*/
setupPointer: function(a) {
- // set up pointerOffset according to type and size if not provided excplicitly
- if(!this.pointerOffset || this.pointerOffset.length !== 4) {
- if(this.get('preferType') == SC.PICKER_MENU_POINTER) {
+ var pointerOffset = this.pointerOffset,
+ K = SC.PickerPane;
+
+ // set up pointerOffset according to type and size if not provided explicitly
+ if (!pointerOffset || pointerOffset.length !== 4) {
+ if (this.get('preferType') == SC.PICKER_MENU_POINTER) {
switch (this.get('controlSize')) {
case SC.TINY_CONTROL_SIZE:
- this.set('pointerOffset', SC.PickerPane.TINY_PICKER_MENU_POINTER_OFFSET) ;
- this.set('extraRightOffset', SC.PickerPane.TINY_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
+ this.set('pointerOffset', K.TINY_PICKER_MENU_POINTER_OFFSET) ;
+ this.set('extraRightOffset', K.TINY_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
break;
case SC.SMALL_CONTROL_SIZE:
- this.set('pointerOffset', SC.PickerPane.SMALL_PICKER_MENU_POINTER_OFFSET) ;
- this.set('extraRightOffset', SC.PickerPane.SMALL_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
+ this.set('pointerOffset', K.SMALL_PICKER_MENU_POINTER_OFFSET) ;
+ this.set('extraRightOffset', K.SMALL_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
break;
case SC.REGULAR_CONTROL_SIZE:
- this.set('pointerOffset', SC.PickerPane.REGULAR_PICKER_MENU_POINTER_OFFSET) ;
- this.set('extraRightOffset', SC.PickerPane.REGULAR_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
+ this.set('pointerOffset', K.REGULAR_PICKER_MENU_POINTER_OFFSET) ;
+ this.set('extraRightOffset', K.REGULAR_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
break;
case SC.LARGE_CONTROL_SIZE:
- this.set('pointerOffset', SC.PickerPane.LARGE_PICKER_MENU_POINTER_OFFSET) ;
- this.set('extraRightOffset', SC.PickerPane.LARGE_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
+ this.set('pointerOffset', K.LARGE_PICKER_MENU_POINTER_OFFSET) ;
+ this.set('extraRightOffset', K.LARGE_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
break;
case SC.HUGE_CONTROL_SIZE:
- this.set('pointerOffset', SC.PickerPane.HUGE_PICKER_MENU_POINTER_OFFSET) ;
- this.set('extraRightOffset', SC.PickerPane.HUGE_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
+ this.set('pointerOffset', K.HUGE_PICKER_MENU_POINTER_OFFSET) ;
+ this.set('extraRightOffset', K.HUGE_PICKER_MENU_EXTRA_RIGHT_OFFSET) ;
break;
}
- } else {
- var overlapTunningX = (a.width < 16) ? ((a.width < 4) ? 9 : 6) : 0;
- var overlapTunningY = (a.height < 16) ? ((a.height < 4) ? 9 : 6) : 0;
-
- var offset = [SC.PickerPane.PICKER_POINTER_OFFSET[0]+overlapTunningX,
- SC.PickerPane.PICKER_POINTER_OFFSET[1]-overlapTunningX,
- SC.PickerPane.PICKER_POINTER_OFFSET[2]-overlapTunningY,
- SC.PickerPane.PICKER_POINTER_OFFSET[3]+overlapTunningY];
+ }
+ else {
+ var overlapTuningX = (a.width < 16) ? ((a.width < 4) ? 9 : 6) : 0,
+ overlapTuningY = (a.height < 16) ? ((a.height < 4) ? 9 : 6) : 0,
+ offsetKey = K.PICKER_POINTER_OFFSET;
+
+ var offset = [offsetKey[0]+overlapTuningX,
+ offsetKey[1]-overlapTuningX,
+ offsetKey[2]-overlapTuningY,
+ offsetKey[3]+overlapTuningY];
this.set('pointerOffset', offset) ;
- this.set('extraRightOffset', SC.PickerPane.PICKER_EXTRA_RIGHT_OFFSET) ;
+ this.set('extraRightOffset', K.PICKER_EXTRA_RIGHT_OFFSET) ;
}
}
View
83 frameworks/desktop/panes/select_button.js
@@ -23,6 +23,8 @@ sc_require('views/button');
SC.SelectButtonView = SC.ButtonView.extend(
/** @scope SC.SelectButtonView.prototype */ {
+ escapeHTML: YES,
+
/**
An array of items that will be form the menu you want to show.
@@ -407,7 +409,9 @@ SC.SelectButtonView = SC.ButtonView.extend(
}
//Check if item is enabled
- itemEnabled = object[isEnabledKey] ;
+ itemEnabled = (isEnabledKey) ? (object.get ?
+ object.get(isEnabledKey) : object[isEnabledKey]) : object ;
+
if(NO !== itemEnabled) itemEnabled = YES ;
//Set the first item from the list as default selected item
@@ -424,12 +428,11 @@ SC.SelectButtonView = SC.ButtonView.extend(
isEnabled: itemEnabled,
checkbox: isChecked,
target: this,
- action: this.displaySelectedItem
+ action: 'displaySelectedItem'
}) ;
//Set the items in the itemList array
itemList.push(item);
-
}
idx += 1 ;
@@ -472,7 +475,7 @@ SC.SelectButtonView = SC.ButtonView.extend(
var buttonLabel, menuWidth, scrollWidth, lastMenuWidth, offsetWidth,
items, elementOffsetWidth, largestMenuWidth, item, element, idx,
value, itemList, menuControlSize, menuHeightPadding, customView,
- customMenuView, menu, itemsLength;
+ customMenuView, menu, itemsLength, dummyMenuItemView, menuItemViewEscapeHTML;
buttonLabel = this.$('.sc-button-label')[0] ;
@@ -518,13 +521,15 @@ SC.SelectButtonView = SC.ButtonView.extend(
var className = 'sc-view sc-pane sc-panel sc-palette sc-picker sc-menu select-button sc-scroll-view sc-menu-scroll-view sc-container-view menuContainer sc-button-view sc-menu-item sc-regular-size' ;
className = customViewClassName ? (className + ' ' + customViewClassName) : className ;
+ dummyMenuItemView = (this.get('customView') || SC.MenuItemView).create();
+ menuItemViewEscapeHTML = dummyMenuItemView.get('escapeHTML') ;
for (idx = 0, itemsLength = items.length; idx < itemsLength; ++idx) {
//getting the width of largest menu item
item = items.objectAt(idx) ;
element = document.createElement('div') ;
element.style.cssText = 'top:-10000px; left: -10000px; position: absolute;' ;
element.className = className ;
- element.innerHTML = item.title ;
+ element.innerHTML = menuItemViewEscapeHTML ? SC.RenderContext.escapeHTML(item.title) : item.title ;
document.body.appendChild(element) ;
elementOffsetWidth = element.offsetWidth + customViewMenuOffsetWidth;
@@ -533,16 +538,15 @@ SC.SelectButtonView = SC.ButtonView.extend(
}
document.body.removeChild(element) ;
}
-
- lastMenuWidth = (largestMenuWidth > lastMenuWidth) ?
+ largestMenuWidth = (largestMenuWidth > lastMenuWidth) ?
largestMenuWidth: lastMenuWidth ;
// Get the window size width and compare with the lastMenuWidth.
// If it is greater than windows width then reduce the maxwidth by 25px
// so that the ellipsis property is enabled by default
var maxWidth = SC.RootResponder.responder.get('currentWindowSize').width;
- if(lastMenuWidth > maxWidth) {
- lastMenuWidth = (maxWidth - 25) ;
+ if(largestMenuWidth > maxWidth) {
+ largestMenuWidth = (maxWidth - 25) ;
}
this.set('lastMenuWidth',lastMenuWidth) ;
@@ -565,7 +569,7 @@ SC.SelectButtonView = SC.ButtonView.extend(
isEnabled: YES,
preferType: SC.PICKER_MENU,
itemHeightKey: 'height',
- layout: { width: lastMenuWidth },
+ layout: { width: largestMenuWidth },
controlSize: menuControlSize,
itemWidth: lastMenuWidth
}) ;
@@ -588,11 +592,14 @@ SC.SelectButtonView = SC.ButtonView.extend(
*/
displaySelectedItem: function(menuView) {
- var currentItem = menuView.get('selectedItem');
+ var currentItem = this.getPath('menu.selectedItem');
+ if (!currentItem) return NO;
this.set('value', currentItem.get('value')) ;
this.set('title', currentItem.get('title')) ;
this.set('itemIdx', currentItem.get('contentIndex')) ;
+
+ return YES;
},
/**
@@ -652,13 +659,29 @@ SC.SelectButtonView = SC.ButtonView.extend(
if (!this.get('isEnabled')) return YES ; // handled event, but do nothing
this.set('isActive', YES);
this._isMouseDown = YES;
- this._mouseDownTimestamp = evt.timeStamp;
this.becomeFirstResponder() ;
this._action() ;
+
+ // Store the current timestamp. We register the timestamp at the end of
+ // the runloop so that the menu has been rendered, in case that operation
+ // takes more than a few hundred milliseconds.
+
+ // One mouseUp, we'll use this value to determine how long the mouse was
+ // pressed.
+ this.invokeLast(this._recordMouseDownTimestamp);
return YES ;
},
/** @private
+ Records the current timestamp. This is invoked at the end of the runloop
+ by mouseDown. We use this value to determine the delay between mouseDown
+ and mouseUp.
+ */
+ _recordMouseDownTimestamp: function() {
+ this._menuRenderedTimestamp = new Date().getTime();
+ },
+
+ /** @private
Because we responded YES to the mouseDown event, we have responsibility
for handling the corresponding mouseUp event.
@@ -675,27 +698,43 @@ SC.SelectButtonView = SC.ButtonView.extend(