Permalink
Browse files

Merge conflict

  • Loading branch information...
2 parents 2c082c7 + 24f320a commit 973d197fd79f67eeaf35e89b19d596a13d2f28f0 Juan Pinzon committed May 30, 2011
Showing with 3,095 additions and 1,171 deletions.
  1. +36 −0 CHANGELOG.md
  2. +2 −2 frameworks/ajax/system/response.js
  3. +2 −1 frameworks/core_foundation/ext/handlebars/bind.js
  4. +12 −4 frameworks/core_foundation/mixins/template_helpers/text_field_support.js
  5. +25 −9 frameworks/core_foundation/panes/template.js
  6. +2 −1 frameworks/core_foundation/system/render_context.js
  7. +4 −2 frameworks/core_foundation/system/utils.js
  8. +10 −2 frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js
  9. +16 −1 frameworks/core_foundation/tests/panes/template.js
  10. +18 −2 frameworks/core_foundation/tests/views/view/didAppendToDocument.js
  11. +1 −1 frameworks/core_foundation/views/view.js
  12. +14 −8 frameworks/core_foundation/views/view/manipulation.js
  13. +12 −2 frameworks/datastore/data_sources/fixtures.js
  14. +296 −0 frameworks/datastore/mixins/relationship_support.js
  15. +1 −1 frameworks/datastore/models/child_record.js
  16. +330 −326 frameworks/datastore/models/record.js
  17. +22 −1 frameworks/datastore/models/record_attribute.js
  18. +3 −3 frameworks/datastore/system/record_array.js
  19. +607 −607 frameworks/datastore/system/store.js
  20. +14 −1 frameworks/datastore/tests/data_sources/data_source.js
  21. +3 −1 frameworks/datastore/tests/models/nested_records/nested_record.js
  22. +2 −0 frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js
  23. +2 −0 frameworks/datastore/tests/models/nested_records/nested_record_complex.js
  24. +20 −13 frameworks/datastore/tests/models/record/core_methods.js
  25. +16 −1 frameworks/datastore/tests/models/record_attribute.js
  26. +74 −53 frameworks/datastore/tests/system/record_array/core_methods.js
  27. +31 −0 frameworks/datastore/tests/system/store/connectDataSource.js
  28. +1,177 −0 frameworks/datastore/tests/system/store/pushRelationships.js
  29. +1 −1 frameworks/desktop/mixins/border.js
  30. +1 −1 frameworks/desktop/mixins/scrollable.js
  31. +6 −8 frameworks/desktop/panes/alert.js
  32. +6 −3 frameworks/desktop/panes/picker.js
  33. +3 −3 frameworks/desktop/protocols/drag_data_source.js
  34. +3 −3 frameworks/desktop/protocols/drop_target.js
  35. +33 −22 frameworks/desktop/tests/panes/alert/ui.js
  36. +1 −1 frameworks/desktop/views/collection.js
  37. +0 −1 frameworks/desktop/views/progress.js
  38. +9 −0 frameworks/desktop/views/select_button.js
  39. +2 −1 frameworks/desktop/views/select_field.js
  40. +2 −0 frameworks/experimental/Buildfile
  41. +2 −1 frameworks/experimental/frameworks/polymorphism/README.md
  42. +20 −36 frameworks/experimental/frameworks/polymorphism/models/record.js
  43. +1 −1 frameworks/experimental/frameworks/split_view/mixins/split_child.js
  44. +1 −1 frameworks/experimental/frameworks/split_view/mixins/split_thumb.js
  45. +3 −2 frameworks/experimental/frameworks/split_view/views/thumb.js
  46. +1 −1 frameworks/foundation/mixins/content_value_support.js
  47. +1 −1 frameworks/foundation/mixins/inline_editable.js
  48. +1 −1 frameworks/foundation/mixins/inline_editor.js
  49. +1 −1 frameworks/foundation/mixins/inline_editor_delegate.js
  50. +1 −1 frameworks/foundation/mixins/inner_frame.js
  51. +2 −1 frameworks/foundation/system/math.js
  52. +36 −7 frameworks/foundation/tests/views/text_field/methods.js
  53. +57 −3 frameworks/foundation/tests/views/text_field/ui.js
  54. +1 −3 frameworks/foundation/validators/validator.js
  55. +2 −2 frameworks/foundation/views/label.js
  56. +24 −13 frameworks/foundation/views/text_field.js
  57. +19 −2 frameworks/runtime/core.js
  58. +24 −0 frameworks/runtime/debug/test_suites/array/flatten.js
  59. +2 −1 frameworks/runtime/ext/array.js
  60. +19 −0 frameworks/runtime/mixins/array.js
  61. +1 −1 frameworks/runtime/system/logger.js
  62. +1 −1 frameworks/runtime/system/range_observer.js
  63. +10 −5 frameworks/runtime/tests/core/objectForPropertyPath.js
  64. +29 −0 frameworks/runtime/tests/core/requiredObjectForPropertyPath.js
  65. +17 −0 frameworks/runtime/tests/system/range_observer/create.js
View
@@ -1,6 +1,42 @@
CHANGE LOG FOR 1.6
==================
+1.6.0.rc.2
+----------
+* Fixed SC.PickerPane#modalPaneDidClick return values - Fixes #339
+* Fixed SC.Enumerable fallback for SC.RecordArray#find - Fixes #363
+* Added SC.requiredObjectForPropertyPath that throws an error when object can't be found
+* Make it possible for the handlebars helpers to generate tags other than <span>
+* Improved Observer Tests with better location (thx martoche)
+* Fixed disclosure positioning in Ace, fixes #457
+* Added backslash to prevent SASS comment interpolation warning
+* Allow for passing relative paths to #collection helper.
+* Further cleanup to TextField template multiline
+* Added isMultiline property to SC.TextField.
+* jQuery is now smart enough to take booleans for certain attributes
+* Stop using jQuery expando
+* Added unit tests for SC.ContainerView to verify it cleans up views that it instantiates.
+* SC.ContainerView will instantiate it's contentView if nowShowing is set with a string or class, however it was not cleaning up views when it was finished. Now it keeps track and cleans up when necessary.
+* Unit test for previous commit checking that the themeName got passed through to the buttons.
+* Allow you to set themeName on the AlertPane to also set the themeName on the buttons (which were previously stuck as 'capsule')
+* Unit test for previous commit adding controlSize to TabView + removed useless TabView methods test and left a warning unit test instead.
+* Whitespace + allow setting of controlSize
+* Comment typo forEachIndex is not a function in IndexSet
+* fix jQuery/SC conflict for events handeling add tryToPerform on SC.TextField
+* use prop instead of attr in SC.Checkbox replace SC.data with jQuery.data
+* remove more code : passing unit tests but fail in real app
+* upgrade to jquery 1.6 use jQuery.sub()
+* Minor adjustments for docs
+* fixed so that replace on ChildArray only notifies the part of the array that has actually changed
+* remove more code : passing unit tests but fail in real app
+* upgrade to jquery 1.6 use jQuery.sub()
+* Hacky solution to the issue where template collection views render their item views multiple times when they are nested inside another template collection view.
+* Adds support for specifying an inverse template name to template collection view.
+* Adds unit tests for using an inverse template in template collection views.
+* Fixes issue with nested template collection views causing childViews array to get messed up.
+* Adds failing unit test for childView structure of nested collection views.
+* Adds unit tests for checking the number of items rendered in nested collection views with default content.
+
1.6.0.rc.1
----------
* Added 'Show Progress' checkbox to Test Runner
@@ -184,9 +184,9 @@ SC.Response = SC.Object.extend(
/**
@private
- @deprecated
+ @deprecated Use body instead.
- Alias for body. Provides compatibility with older code.
+ Alias for body.
@type Hash|String
@see #body
@@ -51,7 +51,8 @@ sc_require('ext/handlebars');
displayTemplate: fn,
inverseTemplate: inverse,
property: property,
- previousContext: this
+ previousContext: this,
+ tagName: (options.hash.tagName || "span")
});
var observer, invoker;
@@ -77,8 +77,12 @@ SC.TextField = SC.TemplateView.extend(
var input = this.$input();
if (value !== undefined) {
- this._value = value;
- input.val(value);
+ // We don't want to unnecessarily set the value.
+ // Doing that could cause the selection to be lost.
+ if (this._value !== value || input.val() !== value) {
+ this._value = value;
+ input.val(value);
+ }
} else if (input.length) {
this._value = value = input.val();
} else {
@@ -135,8 +139,12 @@ SC.TextFieldSupport = /** @scope SC.TextFieldSupport */{
var input = this.$('input');
if (value !== undefined) {
- this._value = value;
- input.val(value);
+ // We don't want to unnecessarily set the value.
+ // Doing that could cause the selection to be lost.
+ if (this._value !== value || input.val() !== value) {
+ this._value = value;
+ input.val(value);
+ }
} else {
if (input.length > 0) {
value = this._value = input.val();
@@ -5,20 +5,31 @@
// License: Licensed under MIT license (see license.js)
// ==========================================================================
-/**
+/** @class
+
SC.TemplatePane is a helper that will create a new pane based on
a single root TemplateView.
- function main() {
- MyApp.mainPane = SC.TemplatePane.append({
- layerId: 'my-root-id',
- templateName: 'app'
- })
- }
+ function main() {
+ MyApp.mainPane = SC.TemplatePane.append({
+ layerId: 'my-root-id',
+ templateName: 'app'
+ })
+ }
+
+ @extends SC.Object
+ @since SproutCore 1.5
*/
SC.TemplatePane = SC.Object.extend({});
-SC.mixin(SC.TemplatePane, {
+SC.TemplatePane.mixin( /** @scope SC.TemplatePane */ {
+
+ /**
+ Creates a new pane with a single TemplateView.
+
+ @param {Object} attrs describes the pane to create
+ @returns {SC.MainPane} the created pane
+ */
append: function(attrs) {
var pane = SC.MainPane.extend({
childViews: ['contentView'],
@@ -38,6 +49,11 @@ SC.mixin(SC.TemplatePane, {
}
});
- return pane.create().append();
+ pane = pane.create().append();
+
+ // Normally the awake process is started in the Page, but we don't have a Page
+ pane.awake();
+
+ return pane;
}
});
@@ -50,7 +50,8 @@ SC.COMBO_STYLES = {
context.begin() <-- begins a new tag context
context.end() <-- ends the tag context...
*/
-SC.RenderContext = SC.Builder.create(/** SC.RenderContext.fn */ {
+SC.RenderContext = SC.Builder.create(
+ /** @lends SC.RenderContext */ {
SELF_CLOSING: SC.CoreSet.create().addEach(['area', 'base', 'basefront', 'br', 'hr', 'input', 'img', 'link', 'meta']),
@@ -152,8 +152,10 @@ SC.mixin( /** @scope SC */ {
return result;
},
- /** @deprecated
- Deprecated. SC.offset() is more accurate, more flexible in the value for the element parameter and
+ /**
+ @deprecated Use SC.offset instead.
+
+ SC.offset() is more accurate, more flexible in the value for the element parameter and
easier to understand.
@param el The DOM element
@@ -38,6 +38,10 @@
equals(textFieldView.$('input').val(), "afterlife", "sets value of DOM to value property");
});
+ // Not really sure how to test this without doing something like adding a selection then checking
+ // to see if it's still there after setting value
+ test("only update DOM if value changed");
+
test("value binding works properly for inputs that haven't been created", function() {
var view = SC.TemplateView.create(SC.TextFieldSupport, {
template: SC.Handlebars.compile('<input type="text">'),
@@ -74,7 +78,7 @@
equals(focusCalled, 1, "focus called after field receives focus");
textFieldView.$('input').blur();
- equals(blurCalled, 1, "blur alled after field blurs");
+ equals(blurCalled, 1, "blur called after field blurs");
});
test("calls correct method for key events", function() {
@@ -130,6 +134,10 @@
equals(textFieldView.$('input').val(), "afterlife", "sets value of DOM to value property");
});
+ // Not really sure how to test this without doing something like adding a selection then checking
+ // to see if it's still there after setting value
+ test("only update DOM if value changed");
+
test("value binding works properly for inputs that haven't been created", function() {
var view = SC.TextField.create({
valueBinding: 'TestObject.value'
@@ -165,7 +173,7 @@
equals(focusCalled, 1, "focus called after field receives focus");
textFieldView.$('input').blur();
- equals(blurCalled, 1, "blur alled after field blurs");
+ equals(blurCalled, 1, "blur called after field blurs");
});
test("calls correct method for key events", function() {
@@ -9,7 +9,6 @@ module("Template Panes");
test("Template panes append a main pane to the document body", function() {
var pane = SC.TemplatePane.append({
layerId: 'template-panes-are-so-cool',
-
template: SC.Handlebars.compile('<h1>foo bar baz</h1>')
});
@@ -18,3 +17,19 @@ test("Template panes append a main pane to the document body", function() {
pane.remove();
});
+
+test("Template panes should be awoken", function(){
+ var didAwake = false;
+
+ var originalAwake = SC.MainPane.prototype.awake; // null for now, but just in case
+ SC.MainPane.prototype.awake = function(){ didAwake = true; }
+
+ var pane = SC.TemplatePane.append({
+ layerId: 'template-panes-are-so-cool',
+ template: SC.Handlebars.compile('<h1>foo bar baz</h1>')
+ });
+
+ SC.MainPane.prototype.awake = originalAwake;
+
+ ok(didAwake, "should have awoken the pane");
+});
@@ -21,6 +21,7 @@ module("SC.View#didAppendToDocument", {
context.push('new string');
},
didAppendToDocument: function(){
+ ok(document.getElementById(this.get('layerId')), "view layer should exist");
counter++;
}
})
@@ -30,6 +31,7 @@ module("SC.View#didAppendToDocument", {
additionalView = SC.View.create({
didAppendToDocument: function(){
+ ok(document.getElementById(this.get('layerId')), "additionalView layer should exist");
counter++;
}
});
@@ -59,11 +61,12 @@ test("Check that didAppendToDocument gets called at the right moment", function(
equals(counter, 3, "");
});
+
// Test for bug: when a childView has a non-fixed layout and we request its frame before the parentView has
// a layer and the parentView uses static layout, then the frame returned will be {x: 0, y:0, width: 0, height: 0}
// and any further requests for the childView's frame will not return a new value unless the parentViewDidChange
// or parentViewDidResize. A weird case, but we prevent it from failing anyhow.
-test("Check that childView is updated if we have static layout and they don't have a fixed layout", function() {
+test("Check that childView is updated if the pane has a static layout and view doesn't have a fixed layout", function() {
var childFrame,
wrongFrame = {x:0, y:0, width: 0, height: 0},
correctFrame;
@@ -80,4 +83,17 @@ test("Check that childView is updated if we have static layout and they don't ha
correctFrame = pane.get('frame');
same(childFrame, correctFrame, 'getting frame after layer exists on non-fixed layout childView should return actual frame');
-});
+});
+
+
+test("Check that childView is updated if it has a static layout", function() {
+ var childFrame,
+ wrongFrame = {x:0, y:0, width: 0, height: 0},
+ correctFrame;
+
+ view.set('useStaticLayout', YES);
+
+ equals(counter, 0, "precond - has not been called yet");
+ pane.append(); // make sure there is a layer...
+ equals(counter, 1, "didAppendToDocument was called once");
+});
@@ -1241,7 +1241,7 @@ SC.CoreView.reopen(
});
-SC.CoreView.mixin(/** @scope SC.View.prototype */ {
+SC.CoreView.mixin(/** @scope SC.CoreView.prototype */ {
/** @private walk like a duck -- used by SC.Page */
isViewClass: YES,
@@ -126,16 +126,22 @@ SC.View.reopen(
if(view.parentViewDidChange) view.parentViewDidChange();
if(view.layoutDidChange) view.layoutDidChange();
- var pane = view.get('pane');
- if(pane && pane.get('isPaneAttached')) {
- view._notifyDidAppendToDocument();
- }
+ view.endPropertyChanges();
- // notify views
- if (this.didAddChild) { this.didAddChild(view, beforeView) ; }
- if (view.didAddToParent) { view.didAddToParent(this, beforeView) ; }
+ // Make sure all notifications are delayed since the appending
+ // doesn't complete until the end of the RunLoop
+ // There may be better ways to do this than with invokeLast,
+ // but it's the best I can do for now - PDW
+ this.invokeLast(function(){
+ var pane = view.get('pane');
+ if(pane && pane.get('isPaneAttached')) {
+ view._notifyDidAppendToDocument();
+ }
- view.endPropertyChanges();
+ // notify views
+ if (this.didAddChild) { this.didAddChild(view, beforeView) ; }
+ if (view.didAddToParent) { view.didAddToParent(this, beforeView) ; }
+ });
return this ;
},
@@ -236,7 +236,7 @@ SC.FixturesDataSource = SC.DataSource.extend(
@param {SC.Store} store the store to load into
@param {SC.Record} recordType the record type to load
@param {SC.Array} ret is passed, array to add loaded storeKeys to.
- @returns {SC.Fixture} receiver
+ @returns {SC.FixturesDataSource} receiver
*/
loadFixturesFor: function(store, recordType, ret) {
var hashes = [],
@@ -344,7 +344,17 @@ SC.FixturesDataSource = SC.DataSource.extend(
var ret = [], fixtures = this._fixtures[SC.guidFor(recordType)];
return fixtures ? YES: NO;
},
-
+
+ /**
+ Resets the fixtures to their original values.
+
+ @returns {SC.FixturesDataSource} receiver
+ */
+ reset: function(){
+ this._fixtures = null;
+ return this;
+ },
+
/**
Returns YES or SC.MIXED_STATE if one or more of the storeKeys can be
handled by the fixture data source.
Oops, something went wrong.

0 comments on commit 973d197

Please sign in to comment.