sproutcore 1.0.1009 → 1.0.1024
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/DISTRIBUTION.yml +14 -0
- data/Rakefile +150 -23
- data/VERSION.yml +4 -2
- data/frameworks/sproutcore/Buildfile +1 -1
- data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +1 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +66 -5
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +14 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +28 -3
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +22 -2
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +5 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/well.css +72 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +33 -7
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +24 -23
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +130 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +9 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +4 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +18 -9
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +7 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/views/well/ui.js +54 -0
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +21 -9
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +4 -3
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +23 -14
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +1 -2
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/well.js +80 -0
- data/frameworks/sproutcore/frameworks/foundation/fixtures/malformed.json +11 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +5 -1
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +11 -10
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +16 -15
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +3 -3
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +6 -5
- data/frameworks/sproutcore/frameworks/foundation/system/response.js +26 -8
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/system/timer.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +122 -13
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +2 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +9 -9
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +3 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +27 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/rect.js +99 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +3 -1
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/cookie.js +160 -0
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/cookie.js +163 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +12 -2
- data/lib/sproutcore/rack/proxy.rb +4 -2
- data/sproutcore-abbot.gemspec +23 -9
- metadata +32 -5
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
@@ -166,7 +166,7 @@ SC.ListItemView = SC.View.extend(
|
|
166
166
|
*/
|
167
167
|
contentIsEditable: function() {
|
168
168
|
var content = this.get('content');
|
169
|
-
return content && (content.get('isEditable')!==NO);
|
169
|
+
return content && (content.get ? content.get('isEditable')!==NO : NO);
|
170
170
|
}.property('content').cacheable(),
|
171
171
|
|
172
172
|
/**
|
@@ -192,7 +192,7 @@ SC.ListItemView = SC.View.extend(
|
|
192
192
|
// outline level wrapper
|
193
193
|
working = context.begin("div").addClass("sc-outline");
|
194
194
|
if (level>=0 && indent>0) working.addStyle("left", indent*(level+1));
|
195
|
-
|
195
|
+
|
196
196
|
// handle disclosure triangle
|
197
197
|
value = this.get('disclosureState');
|
198
198
|
if (value !== SC.LEAF_NODE) {
|
@@ -266,7 +266,7 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
266
266
|
className = '' ;
|
267
267
|
} else {
|
268
268
|
className = image ;
|
269
|
-
url =
|
269
|
+
url = SC.BLANK_IMAGE_URL;
|
270
270
|
}
|
271
271
|
// generate the img element...
|
272
272
|
context.begin('img').addClass('image').addClass(className).attr('src', url).end() ;
|
@@ -282,7 +282,7 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
282
282
|
*/
|
283
283
|
|
284
284
|
renderLabel: function(context, label) {
|
285
|
-
context.push("<span class='value'>"+label+"</span>") ;
|
285
|
+
context.push("<span class='value ellipsis'>"+label+"</span>") ;
|
286
286
|
},
|
287
287
|
|
288
288
|
/**
|
@@ -297,7 +297,7 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
297
297
|
renderBranch: function(context, hasBranch) {
|
298
298
|
|
299
299
|
var a = '>' ;
|
300
|
-
var url =
|
300
|
+
var url = SC.BLANK_IMAGE_URL;
|
301
301
|
context.push('<span class= "hasBranch">'+a+'</span>') ;
|
302
302
|
},
|
303
303
|
|
@@ -212,7 +212,7 @@ SC.RadioView = SC.FieldView.extend(
|
|
212
212
|
// get the icon from the item, if one exists...
|
213
213
|
icon = item[3];
|
214
214
|
if (icon) {
|
215
|
-
url = (icon.indexOf('/')>=0) ? icon :
|
215
|
+
url = (icon.indexOf('/')>=0) ? icon : SC.BLANK_IMAGE_URL;
|
216
216
|
className = (url === icon) ? '' : icon ;
|
217
217
|
icon = '<img src="%@" class="icon %@" alt="" />'.fmt(url, className);
|
218
218
|
} else icon = '';
|
@@ -221,7 +221,6 @@ SC.RadioView = SC.FieldView.extend(
|
|
221
221
|
disabled = (!item[2]) || (!this.get('isEnabled')) ? 'disabled="disabled" ' : '';
|
222
222
|
|
223
223
|
labelText = this.escapeHTML ? SC.RenderContext.escapeHTML(item[0]) : item[0];
|
224
|
-
var blankImage = static_url('blank');
|
225
224
|
|
226
225
|
context.push('<label class="sc-radio-button ', selectionStateClassNames, '">');
|
227
226
|
context.push('<input type="radio" value="', idx, '" name="', name, '" ', disabled, '/>');
|
@@ -526,7 +526,7 @@ SC.ScrollView = SC.View.extend(SC.Border, {
|
|
526
526
|
this._scroll_wheelDeltaX += evt.wheelDeltaX;
|
527
527
|
this._scroll_wheelDeltaY += evt.wheelDeltaY;
|
528
528
|
this.invokeLater(this._scroll_mouseWheel, 10) ;
|
529
|
-
return
|
529
|
+
return this.get('canScrollHorizontal') || this.get('canScrollVertical') ;
|
530
530
|
},
|
531
531
|
|
532
532
|
/** @private */
|
@@ -346,7 +346,7 @@ SC.SegmentedView = SC.View.extend(SC.Control,
|
|
346
346
|
}
|
347
347
|
|
348
348
|
if (icon) {
|
349
|
-
url = (icon.indexOf('/')>=0) ? icon :
|
349
|
+
url = (icon.indexOf('/')>=0) ? icon : SC.BLANK_IMAGE_URL;
|
350
350
|
className = (url === icon) ? '' : icon ;
|
351
351
|
icon = '<img src="'+url+'" alt="" class="icon '+className+'" />';
|
352
352
|
} else {
|
@@ -103,7 +103,7 @@ SC.SliderView = SC.View.extend(SC.Control,
|
|
103
103
|
value = Math.floor((value - min) / (max - min) * 100);
|
104
104
|
|
105
105
|
if(firstTime) {
|
106
|
-
var blankImage =
|
106
|
+
var blankImage = SC.BLANK_IMAGE_URL;
|
107
107
|
context.push('<span class="sc-inner">');
|
108
108
|
context.push('<span class="sc-leftcap"></span>');
|
109
109
|
context.push('<span class="sc-rightcap"></span>');
|
@@ -74,7 +74,7 @@ SC.SourceListGroupView = SC.View.extend(SC.Control, SC.CollectionGroup,
|
|
74
74
|
|
75
75
|
render: function(context, firstTime) {
|
76
76
|
context.push('<a href="javascript:;" class="sc-source-list-label sc-disclosure-view sc-button-view button disclosure no-disclosure">') ;
|
77
|
-
context.push('<img src="%@" class="button" />'.fmt(
|
77
|
+
context.push('<img src="%@" class="button" />'.fmt(SC.BLANK_IMAGE_URL)) ;
|
78
78
|
context.push('<span class="label"></span></a>') ;
|
79
79
|
},
|
80
80
|
|
@@ -0,0 +1,80 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
/** @class
|
9
|
+
|
10
|
+
A WellView is a ContainerView with a border. It's useful when you want to
|
11
|
+
group a set of views. It allows you to easily switch its contents too.
|
12
|
+
|
13
|
+
It has a default contentLayout that will replace the layout of the contentView.
|
14
|
+
|
15
|
+
@extends SC.ContainerView
|
16
|
+
@since SproutCore 1.0
|
17
|
+
@test in progress
|
18
|
+
*/
|
19
|
+
SC.WellView = SC.ContainerView.extend(
|
20
|
+
/** @scope SC.WellView.prototype */ {
|
21
|
+
|
22
|
+
classNames: 'sc-well-view',
|
23
|
+
|
24
|
+
/**
|
25
|
+
Layout for the content of the container view.
|
26
|
+
@property {Object}
|
27
|
+
*/
|
28
|
+
contentLayout: {top:10, bottom:10, left:10, right:10},
|
29
|
+
|
30
|
+
|
31
|
+
/**
|
32
|
+
Overrides createChildViews and replaces the layout of the contentView
|
33
|
+
with the one in contentLayout.
|
34
|
+
*/
|
35
|
+
|
36
|
+
createChildViews: function() {
|
37
|
+
// if contentView is defined, then create the content
|
38
|
+
var view = this.get('contentView') ;
|
39
|
+
if (view) {
|
40
|
+
view = this.contentView = this.createChildView(view) ;
|
41
|
+
view.set('layout', this.contentLayout);
|
42
|
+
this.childViews = [view] ;
|
43
|
+
}
|
44
|
+
},
|
45
|
+
|
46
|
+
/**
|
47
|
+
The render method for the WellView simply add the html necessary for
|
48
|
+
the border.
|
49
|
+
|
50
|
+
*/
|
51
|
+
|
52
|
+
render: function(context, firstTime) {
|
53
|
+
sc_super();
|
54
|
+
if(firstTime){
|
55
|
+
context.push("<div class='top-left-edge'></div>",
|
56
|
+
"<div class='top-edge'></div>",
|
57
|
+
"<div class='top-right-edge'></div>",
|
58
|
+
"<div class='right-edge'></div>",
|
59
|
+
"<div class='bottom-right-edge'></div>",
|
60
|
+
"<div class='bottom-edge'></div>",
|
61
|
+
"<div class='bottom-left-edge'></div>",
|
62
|
+
"<div class='left-edge'></div>",
|
63
|
+
"<div class='content-background'></div>");
|
64
|
+
}
|
65
|
+
},
|
66
|
+
|
67
|
+
/**
|
68
|
+
Invoked whenever the content property changes. This method will simply
|
69
|
+
call replaceContent and set the contentLayout in the new contentView.
|
70
|
+
|
71
|
+
Override replaceContent to change how the view is
|
72
|
+
swapped out.
|
73
|
+
*/
|
74
|
+
contentViewDidChange: function() {
|
75
|
+
var view = this.get('contentView');
|
76
|
+
view.set('layout', this.contentLayout);
|
77
|
+
this.replaceContent(view);
|
78
|
+
}.observes('contentView')
|
79
|
+
|
80
|
+
}) ;
|
@@ -169,7 +169,7 @@ SC.Button = {
|
|
169
169
|
// if there is no image element yet, create it and insert it just before
|
170
170
|
// title.
|
171
171
|
if (icon) {
|
172
|
-
var blank =
|
172
|
+
var blank = SC.BLANK_IMAGE_URL;
|
173
173
|
|
174
174
|
image = '<img src="%@1" alt="" class="%@2" />' ;
|
175
175
|
if (icon.indexOf('/') >= 0) {
|
@@ -143,13 +143,17 @@ SC.InlineTextFieldView = SC.TextFieldView.extend(SC.DelegateSupport,
|
|
143
143
|
paneElem = pane.$()[0];
|
144
144
|
if(this._optIsCollection && delLayout.left){
|
145
145
|
layout.left=this._optframe.x-delLayout.left-paneElem.offsetLeft-1;
|
146
|
+
if(SC.browser.msie==7) layout.left--;
|
146
147
|
}else{
|
147
148
|
layout.left=this._optframe.x-paneElem.offsetLeft-1;
|
149
|
+
if(SC.browser.msie==7) layout.left--;
|
148
150
|
}
|
149
151
|
if(this._optIsCollection && delLayout.top){
|
150
152
|
layout.top=this._optframe.y-delLayout.top-paneElem.offsetTop;
|
153
|
+
if(SC.browser.msie==7) layout.top=layout.top-2;
|
151
154
|
}else{
|
152
|
-
layout.top=this._optframe.y-paneElem.offsetTop;
|
155
|
+
layout.top=this._optframe.y-paneElem.offsetTop;
|
156
|
+
if(SC.browser.msie==7) layout.top=layout.top-2;
|
153
157
|
}
|
154
158
|
|
155
159
|
this.set('layout', layout);
|
@@ -470,7 +470,7 @@ SC.Pane = SC.View.extend( /** @scope SC.Pane.prototype */ {
|
|
470
470
|
rootResponder.panes.remove(this) ;
|
471
471
|
this.rootResponder = null ;
|
472
472
|
|
473
|
-
// clean up some of my own properties
|
473
|
+
// clean up some of my own properties
|
474
474
|
this.set('isPaneAttached', NO) ;
|
475
475
|
this.parentViewDidChange() ;
|
476
476
|
return this ;
|
@@ -49,8 +49,8 @@ SC.Cursor = SC.Object.extend(
|
|
49
49
|
sc_super() ;
|
50
50
|
|
51
51
|
// create a unique style rule and add it to the shared cursor style sheet
|
52
|
-
var cursorStyle = this.get('cursorStyle') || SC.DEFAULT_CURSOR
|
53
|
-
|
52
|
+
var cursorStyle = this.get('cursorStyle') || SC.DEFAULT_CURSOR ,
|
53
|
+
ss = this.constructor.sharedStyleSheet() ;
|
54
54
|
|
55
55
|
if (ss.insertRule) { // WC3
|
56
56
|
ss.insertRule(
|
@@ -83,20 +83,21 @@ SC.Cursor = SC.Object.extend(
|
|
83
83
|
|
84
84
|
/** @private */
|
85
85
|
cursorStyleDidChange: function() {
|
86
|
-
var cursorStyle
|
87
|
-
|
86
|
+
var cursorStyle, rule, selector, ss, rules, idx, len;
|
87
|
+
cursorStyle = this.get('cursorStyle') || SC.DEFAULT_CURSOR;
|
88
|
+
rule = this._rule;
|
88
89
|
if (rule) {
|
89
90
|
rule.style.cursor = cursorStyle ; // fast path
|
90
91
|
return ;
|
91
92
|
}
|
92
93
|
|
93
94
|
// slow path, taken only once
|
94
|
-
|
95
|
-
|
96
|
-
|
95
|
+
selector = '.'+this.get('className') ;
|
96
|
+
ss = this.constructor.sharedStyleSheet() ;
|
97
|
+
rules = (ss.cssRules ? ss.cssRules : ss.rules) || [] ;
|
97
98
|
|
98
99
|
// find our rule, cache it, and update the cursor style property
|
99
|
-
for (
|
100
|
+
for (idx=0, len = rules.length; idx<len; ++idx) {
|
100
101
|
rule = rules[idx] ;
|
101
102
|
if (rule.selectorText === selector) {
|
102
103
|
this._rule = rule ; // cache for next time
|
@@ -112,12 +113,12 @@ SC.Cursor = SC.Object.extend(
|
|
112
113
|
|
113
114
|
/** @private */
|
114
115
|
SC.Cursor.sharedStyleSheet = function() {
|
115
|
-
var ss = this._styleSheet ;
|
116
|
+
var head, ss = this._styleSheet ;
|
116
117
|
if (!ss) {
|
117
118
|
// create the stylesheet object the hard way (works everywhere)
|
118
119
|
ss = document.createElement('style') ;
|
119
120
|
ss.type = 'text/css' ;
|
120
|
-
|
121
|
+
head = document.getElementsByTagName('head')[0] ;
|
121
122
|
if (!head) head = document.documentElement ; // fix for Opera
|
122
123
|
head.appendChild(ss) ;
|
123
124
|
|
@@ -32,9 +32,9 @@ SC.Event = function(originalEvent) {
|
|
32
32
|
// copy properties from original event, if passed in.
|
33
33
|
if (originalEvent) {
|
34
34
|
this.originalEvent = originalEvent ;
|
35
|
-
var props = SC.Event._props, len = props.length, idx = len ;
|
35
|
+
var props = SC.Event._props, len = props.length, idx = len , key;
|
36
36
|
while(--idx >= 0) {
|
37
|
-
|
37
|
+
key = props[idx] ;
|
38
38
|
this[key] = originalEvent[key] ;
|
39
39
|
}
|
40
40
|
}
|
@@ -207,8 +207,8 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
207
207
|
// Get the handlers queue for this element/eventType. If the queue does
|
208
208
|
// not exist yet, create it and also setup the shared listener for this
|
209
209
|
// eventType.
|
210
|
-
var events = SC.data(elem, "events") || SC.data(elem, "events", {})
|
211
|
-
|
210
|
+
var events = SC.data(elem, "events") || SC.data(elem, "events", {}) ,
|
211
|
+
handlers = events[eventType];
|
212
212
|
if (!handlers) {
|
213
213
|
handlers = events[eventType] = {} ;
|
214
214
|
this._addEventListener(elem, eventType) ;
|
@@ -293,7 +293,7 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
293
293
|
method = target[method] ;
|
294
294
|
}
|
295
295
|
|
296
|
-
delete
|
296
|
+
delete handlers[SC.guidFor(method)] ;
|
297
297
|
|
298
298
|
// check to see if there are handlers left on this event/eventType.
|
299
299
|
// if not, then cleanup the handlers.
|
@@ -399,10 +399,11 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
399
399
|
// Normalize to an array
|
400
400
|
args = SC.A(args) ;
|
401
401
|
|
402
|
-
var ret, fn = SC.typeOf(elem[eventType] || null) === SC.T_FUNCTION
|
402
|
+
var ret, fn = SC.typeOf(elem[eventType] || null) === SC.T_FUNCTION ,
|
403
|
+
event, current, onfoo;
|
403
404
|
|
404
405
|
// Get the event to pass, creating a fake one if necessary
|
405
|
-
|
406
|
+
event = args[0];
|
406
407
|
if (!event || !event.preventDefault) {
|
407
408
|
event = this.simulateEvent(elem, eventType) ;
|
408
409
|
args.unshift(event) ;
|
@@ -411,7 +412,7 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
411
412
|
event.type = eventType ;
|
412
413
|
|
413
414
|
// Trigger the event - bubble if enabled
|
414
|
-
|
415
|
+
current = elem;
|
415
416
|
do {
|
416
417
|
ret = SC.Event.handle.apply(current, args);
|
417
418
|
current = (current===document) ? null : (current.parentNode || document);
|
@@ -419,8 +420,8 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
419
420
|
current = null ;
|
420
421
|
|
421
422
|
// Handle triggering native .onfoo handlers
|
422
|
-
|
423
|
-
|
423
|
+
onfoo = elem["on" + eventType] ;
|
424
|
+
isClick = SC.CoreQuery.nodeName(elem, 'a') && eventType === 'click';
|
424
425
|
if ((!fn || isClick) && onfoo && onfoo.apply(elem, args) === NO) ret = NO;
|
425
426
|
|
426
427
|
// Trigger the native events (except for clicks on links)
|
@@ -459,7 +460,7 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
459
460
|
if ((typeof SC === "undefined") || SC.Event.triggered) return YES ;
|
460
461
|
|
461
462
|
// returned undefined or NO
|
462
|
-
var val, ret, namespace, all, handlers, args;
|
463
|
+
var val, ret, namespace, all, handlers, args, key, handler, method, target;
|
463
464
|
|
464
465
|
// normalize event across browsers. The new event will actually wrap the
|
465
466
|
// real event with a normalized API.
|
@@ -471,16 +472,16 @@ SC.mixin(SC.Event, /** @scope SC.Event */ {
|
|
471
472
|
if (!handlers) return NO ; // nothing to do
|
472
473
|
|
473
474
|
// invoke all handlers
|
474
|
-
for (
|
475
|
-
|
476
|
-
|
475
|
+
for (key in handlers ) {
|
476
|
+
handler = handlers[key];
|
477
|
+
method = handler[1] ;
|
477
478
|
|
478
479
|
// Pass in a reference to the handler function itself
|
479
480
|
// So that we can later remove it
|
480
481
|
event.handler = method;
|
481
482
|
event.data = event.context = handler[2];
|
482
483
|
|
483
|
-
|
484
|
+
target = handler[0] || this ;
|
484
485
|
ret = method.apply( target, args );
|
485
486
|
|
486
487
|
if (val !== NO) val = ret;
|
@@ -553,7 +553,7 @@ SC.RenderContext = SC.Builder.create(/** SC.RenderContext.fn */ {
|
|
553
553
|
classNames: function(classNames, cloneOnModify) {
|
554
554
|
if (classNames === undefined) {
|
555
555
|
if (!this._classNames && this._elem) {
|
556
|
-
this._classNames = (this._elem.
|
556
|
+
this._classNames = (SC.$(this._elem).attr('class')||'').split(' ');
|
557
557
|
}
|
558
558
|
|
559
559
|
if (this._cloneClassNames) {
|
@@ -611,7 +611,7 @@ SC.RenderContext = SC.Builder.create(/** SC.RenderContext.fn */ {
|
|
611
611
|
var classNames = this._classNames, idx;
|
612
612
|
if (!classNames && this._elem) {
|
613
613
|
classNames = this._classNames =
|
614
|
-
(this._elem.
|
614
|
+
(SC.$(this._elem).attr('class')||'').split(' ');
|
615
615
|
}
|
616
616
|
|
617
617
|
if (classNames && (idx=classNames.indexOf(className))>=0) {
|
@@ -666,7 +666,7 @@ SC.RenderContext = SC.Builder.create(/** SC.RenderContext.fn */ {
|
|
666
666
|
classNames = this._classNames ;
|
667
667
|
if (!classNames && this._elem) {
|
668
668
|
classNames = this._classNames =
|
669
|
-
(this._elem.
|
669
|
+
(SC.$(this._elem).attr('class')||'').split(' ');
|
670
670
|
}
|
671
671
|
if (!classNames) classNames = this._classNames = [];
|
672
672
|
|
@@ -334,12 +334,13 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
|
|
334
334
|
Your notification callback should expect to receive the Response object
|
335
335
|
as the first parameter plus any additional parameters that you pass.
|
336
336
|
|
337
|
+
@param {Number} status
|
337
338
|
@param {Object} target
|
338
339
|
@param {String|function} action
|
339
340
|
@param {Hash} params
|
340
341
|
@returns {SC.Request} receiver
|
341
342
|
*/
|
342
|
-
notify: function(status, target, action) {
|
343
|
+
notify: function(status, target, action, params) {
|
343
344
|
|
344
345
|
// normalize status
|
345
346
|
var hasStatus = YES, params ;
|
@@ -369,7 +370,7 @@ SC.Request.mixin(/** @scope SC.Request */ {
|
|
369
370
|
@returns {SC.Request} receiver
|
370
371
|
*/
|
371
372
|
getUrl: function(address) {
|
372
|
-
return
|
373
|
+
return this.create().set('address', address).set('type', 'GET');
|
373
374
|
},
|
374
375
|
|
375
376
|
/**
|
@@ -380,7 +381,7 @@ SC.Request.mixin(/** @scope SC.Request */ {
|
|
380
381
|
@returns {SC.Request} receiver
|
381
382
|
*/
|
382
383
|
postUrl: function(address, body) {
|
383
|
-
var req =
|
384
|
+
var req = this.create().set('address', address).set('type', 'POST');
|
384
385
|
if(body) req.set('body', body) ;
|
385
386
|
return req ;
|
386
387
|
},
|
@@ -392,7 +393,7 @@ SC.Request.mixin(/** @scope SC.Request */ {
|
|
392
393
|
@returns {SC.Request} receiver
|
393
394
|
*/
|
394
395
|
deleteUrl: function(address) {
|
395
|
-
return
|
396
|
+
return this.create().set('address', address).set('type', 'DELETE');
|
396
397
|
},
|
397
398
|
|
398
399
|
/**
|
@@ -403,7 +404,7 @@ SC.Request.mixin(/** @scope SC.Request */ {
|
|
403
404
|
@returns {SC.Request} receiver
|
404
405
|
*/
|
405
406
|
putUrl: function(address, body) {
|
406
|
-
var req =
|
407
|
+
var req = this.create().set('address', address).set('type', 'PUT');
|
407
408
|
if(body) req.set('body', body) ;
|
408
409
|
return req ;
|
409
410
|
}
|