sproutcore 0.9.1 → 0.9.2
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/History.txt +233 -0
- data/Manifest.txt +67 -34
- data/bin/sc-build +12 -1
- data/bin/sc-gen +1 -1
- data/bin/sproutcore +14 -0
- data/clients/sc_docs/controllers/docs.js +38 -8
- data/clients/sc_docs/english.lproj/body.css +80 -127
- data/clients/sc_docs/english.lproj/body.rhtml +43 -23
- data/clients/sc_docs/english.lproj/no_docs.rhtml +2 -1
- data/clients/sc_docs/english.lproj/tabs.rhtml +16 -0
- data/clients/sc_docs/main.js +14 -9
- data/clients/sc_docs/models/doc.js +1 -1
- data/clients/sc_docs/tests/controllers/docs.rhtml +1 -2
- data/clients/sc_docs/tests/models/doc.rhtml +1 -2
- data/clients/sc_docs/tests/views/doc_frame.rhtml +1 -2
- data/clients/sc_docs/tests/views/doc_label_view.rhtml +1 -2
- data/clients/sc_docs/views/doc_frame.js +1 -1
- data/clients/sc_test_runner/controllers/runner.js +31 -8
- data/clients/sc_test_runner/english.lproj/body.css +62 -122
- data/clients/sc_test_runner/english.lproj/body.rhtml +62 -26
- data/clients/sc_test_runner/main.js +1 -6
- data/clients/sc_test_runner/models/test.js +14 -1
- data/clients/sc_test_runner/views/runner_frame.js +4 -2
- data/clients/view_builder/builders/builder.js +339 -0
- data/clients/view_builder/builders/button.js +81 -0
- data/clients/view_builder/controllers/document.js +21 -0
- data/clients/view_builder/core.js +19 -0
- data/clients/view_builder/english.lproj/body.css +77 -0
- data/clients/view_builder/english.lproj/body.rhtml +41 -0
- data/clients/{sc_docs → view_builder}/english.lproj/controls.css +0 -0
- data/clients/view_builder/english.lproj/strings.js +14 -0
- data/clients/view_builder/main.js +38 -0
- data/clients/view_builder/tests/controllers/document.rhtml +20 -0
- data/clients/view_builder/tests/views/builder.rhtml +20 -0
- data/clients/view_builder/views/builder.js +23 -0
- data/frameworks/prototype/prototype.js +1 -1
- data/frameworks/sproutcore/Core.js +32 -7
- data/frameworks/sproutcore/README +1 -1
- data/frameworks/sproutcore/animation/animation.js +411 -0
- data/frameworks/sproutcore/controllers/array.js +17 -9
- data/frameworks/sproutcore/controllers/collection.js +9 -110
- data/frameworks/sproutcore/controllers/controller.js +1 -1
- data/frameworks/sproutcore/controllers/object.js +2 -1
- data/frameworks/sproutcore/drag/drag.js +267 -56
- data/frameworks/sproutcore/drag/drag_data_source.js +24 -16
- data/frameworks/sproutcore/drag/drag_source.js +53 -42
- data/frameworks/sproutcore/drag/drop_target.js +2 -2
- data/frameworks/sproutcore/english.lproj/buttons.css +337 -236
- data/frameworks/sproutcore/english.lproj/core.css +115 -0
- data/frameworks/sproutcore/english.lproj/icons.css +227 -0
- data/{clients/sc_docs → frameworks/sproutcore}/english.lproj/images/indicator.gif +0 -0
- data/frameworks/sproutcore/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/english.lproj/images/sc-theme-ysprite.png +0 -0
- data/frameworks/sproutcore/english.lproj/images/shared-icons.png +0 -0
- data/frameworks/sproutcore/english.lproj/menu.css +1 -1
- data/frameworks/sproutcore/english.lproj/strings.js +1 -1
- data/frameworks/sproutcore/english.lproj/theme.css +405 -31
- data/frameworks/sproutcore/foundation/application.js +15 -11
- data/frameworks/sproutcore/foundation/benchmark.js +1 -1
- data/frameworks/sproutcore/foundation/binding.js +2 -2
- data/frameworks/sproutcore/foundation/date.js +1 -1
- data/frameworks/sproutcore/foundation/error.js +1 -1
- data/frameworks/sproutcore/foundation/input_manager.js +32 -21
- data/frameworks/sproutcore/foundation/mock.js +1 -1
- data/frameworks/sproutcore/foundation/node_descriptor.js +9 -6
- data/frameworks/sproutcore/foundation/object.js +249 -177
- data/frameworks/sproutcore/foundation/page.js +5 -2
- data/frameworks/sproutcore/foundation/path_module.js +11 -10
- data/frameworks/sproutcore/foundation/responder.js +5 -2
- data/frameworks/sproutcore/foundation/routes.js +17 -13
- data/frameworks/sproutcore/foundation/run_loop.js +249 -11
- data/frameworks/sproutcore/foundation/server.js +1 -1
- data/frameworks/sproutcore/foundation/set.js +3 -3
- data/frameworks/sproutcore/foundation/string.js +5 -3
- data/frameworks/sproutcore/foundation/timer.js +371 -0
- data/frameworks/sproutcore/foundation/undo_manager.js +1 -1
- data/frameworks/sproutcore/foundation/unittest.js +3 -3
- data/frameworks/sproutcore/foundation/utils.js +161 -2
- data/frameworks/sproutcore/globals/panels.js +1 -1
- data/frameworks/sproutcore/globals/popups.js +4 -3
- data/frameworks/sproutcore/globals/window.js +44 -4
- data/frameworks/sproutcore/lib/button_views.rb +328 -0
- data/frameworks/sproutcore/lib/collection_view.rb +80 -0
- data/frameworks/sproutcore/lib/core_views.rb +281 -0
- data/frameworks/sproutcore/lib/form_views.rb +253 -0
- data/frameworks/sproutcore/lib/index.rhtml +2 -0
- data/frameworks/sproutcore/lib/menu_views.rb +88 -0
- data/frameworks/sproutcore/{foundation → mixins}/array.js +60 -29
- data/frameworks/sproutcore/mixins/control.js +265 -0
- data/frameworks/sproutcore/mixins/delegate_support.js +66 -0
- data/frameworks/sproutcore/{foundation → mixins}/observable.js +176 -6
- data/frameworks/sproutcore/mixins/scrollable.js +245 -0
- data/frameworks/sproutcore/mixins/selection_support.js +148 -0
- data/frameworks/sproutcore/mixins/validatable.js +152 -0
- data/frameworks/sproutcore/models/collection.js +5 -5
- data/frameworks/sproutcore/models/record.js +1 -1
- data/frameworks/sproutcore/models/store.js +1 -1
- data/frameworks/sproutcore/panes/dialog.js +1 -1
- data/frameworks/sproutcore/panes/manager.js +1 -1
- data/frameworks/sproutcore/panes/menu.js +1 -1
- data/frameworks/sproutcore/panes/overlay.js +2 -2
- data/frameworks/sproutcore/panes/panel.js +1 -1
- data/frameworks/sproutcore/panes/picker.js +1 -1
- data/frameworks/sproutcore/tests/controllers/array.rhtml +44 -4
- data/frameworks/sproutcore/tests/foundation/timer/invalidate.rhtml +33 -0
- data/frameworks/sproutcore/tests/foundation/timer/invokeLater.rhtml +145 -0
- data/frameworks/sproutcore/tests/foundation/timer/isPaused.rhtml +70 -0
- data/frameworks/sproutcore/tests/foundation/timer/schedule.rhtml +145 -0
- data/frameworks/sproutcore/tests/views/{scroll.rhtml → checkbox.rhtml} +3 -3
- data/frameworks/sproutcore/tests/views/{collection.rhtml → collection/base.rhtml} +33 -32
- data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +260 -0
- data/frameworks/sproutcore/tests/views/image_cell.rhtml +19 -0
- data/frameworks/sproutcore/tests/views/label_item.rhtml +2 -4
- data/frameworks/sproutcore/tests/views/list.rhtml +2 -3
- data/frameworks/sproutcore/tests/views/list_item.rhtml +20 -0
- data/frameworks/sproutcore/tests/views/slider.rhtml +20 -0
- data/frameworks/sproutcore/tests/views/text_cell.rhtml +19 -0
- data/frameworks/sproutcore/tests/views/view/clippingFrame.rhtml +395 -0
- data/frameworks/sproutcore/tests/views/view/frame.rhtml +353 -0
- data/frameworks/sproutcore/tests/views/view/innerFrame.rhtml +347 -0
- data/frameworks/sproutcore/tests/views/view/isVisibleInWindow.rhtml +148 -0
- data/frameworks/sproutcore/tests/views/view/scrollFrame.rhtml +468 -0
- data/frameworks/sproutcore/validators/credit_card.js +33 -13
- data/frameworks/sproutcore/validators/date.js +26 -6
- data/frameworks/sproutcore/validators/email.js +21 -3
- data/frameworks/sproutcore/validators/not_empty.js +11 -1
- data/frameworks/sproutcore/validators/number.js +18 -4
- data/frameworks/sproutcore/validators/password.js +12 -1
- data/frameworks/sproutcore/validators/validator.js +204 -194
- data/frameworks/sproutcore/views/{button.js → button/button.js} +96 -94
- data/frameworks/sproutcore/views/button/checkbox.js +29 -0
- data/frameworks/sproutcore/views/button/disclosure.js +42 -0
- data/frameworks/sproutcore/views/button/radio.js +29 -0
- data/frameworks/sproutcore/views/{collection.js → collection/collection.js} +1373 -1024
- data/frameworks/sproutcore/views/collection/grid.js +124 -46
- data/frameworks/sproutcore/views/collection/image_cell.js +17 -46
- data/frameworks/sproutcore/views/collection/list.js +45 -35
- data/frameworks/sproutcore/views/collection/source_list.js +386 -0
- data/frameworks/sproutcore/views/collection/table.js +118 -0
- data/frameworks/sproutcore/views/container.js +7 -2
- data/frameworks/sproutcore/views/error_explanation.js +23 -10
- data/frameworks/sproutcore/views/{checkbox_field.js → field/checkbox_field.js} +16 -6
- data/frameworks/sproutcore/views/field/field.js +219 -0
- data/frameworks/sproutcore/views/{radio_field.js → field/radio_field.js} +27 -12
- data/frameworks/sproutcore/views/{select_field.js → field/select_field.js} +116 -90
- data/frameworks/sproutcore/views/{text_field.js → field/text_field.js} +57 -8
- data/frameworks/sproutcore/views/{textarea_field.js → field/textarea_field.js} +13 -3
- data/frameworks/sproutcore/views/filter_button.js +2 -2
- data/frameworks/sproutcore/views/form.js +3 -3
- data/frameworks/sproutcore/views/image.js +128 -21
- data/frameworks/sproutcore/views/inline_text_editor.js +1 -1
- data/frameworks/sproutcore/views/label.js +149 -92
- data/frameworks/sproutcore/views/list_item.js +225 -0
- data/frameworks/sproutcore/views/menu_item.js +10 -4
- data/frameworks/sproutcore/views/pagination.js +11 -4
- data/frameworks/sproutcore/views/popup_button.js +25 -21
- data/frameworks/sproutcore/views/popup_menu.js +10 -4
- data/frameworks/sproutcore/views/progress.js +29 -16
- data/frameworks/sproutcore/views/radio_group.js +1 -1
- data/frameworks/sproutcore/views/scroll.js +60 -20
- data/frameworks/sproutcore/views/segmented.js +1 -1
- data/frameworks/sproutcore/views/slider.js +132 -0
- data/frameworks/sproutcore/views/source_list_group.js +130 -0
- data/frameworks/sproutcore/views/spinner.js +1 -1
- data/frameworks/sproutcore/views/split.js +292 -0
- data/frameworks/sproutcore/views/split_divider.js +109 -0
- data/frameworks/sproutcore/views/tab.js +1 -1
- data/frameworks/sproutcore/views/toolbar.js +1 -1
- data/frameworks/sproutcore/views/view.js +1272 -591
- data/generators/client/templates/english.lproj/body.css +1 -1
- data/generators/controller/controller_generator.rb +1 -1
- data/generators/controller/templates/test.rhtml +2 -1
- data/generators/model/templates/test.rhtml +1 -1
- data/generators/test/templates/test.rhtml +1 -1
- data/generators/view/templates/test.rhtml +1 -1
- data/jsdoc/templates/sproutcore/class.tmpl +241 -338
- data/jsdoc/templates/sproutcore/default.css +105 -155
- data/jsdoc/templates/sproutcore/index.tmpl +43 -8
- data/jsdoc/templates/sproutcore/publish.js +9 -4
- data/lib/sproutcore/build_tools/html_builder.rb +29 -13
- data/lib/sproutcore/build_tools/resource_builder.rb +1 -1
- data/lib/sproutcore/bundle.rb +86 -25
- data/lib/sproutcore/jsdoc.rb +2 -0
- data/lib/sproutcore/version.rb +1 -1
- data/lib/sproutcore/view_helpers.rb +36 -3
- data/tasks/deployment.rake +1 -1
- metadata +69 -36
- data/clients/sc_docs/english.lproj/icons/small/next.png +0 -0
- data/clients/sc_docs/english.lproj/icons/small/reset.png +0 -0
- data/clients/sc_docs/english.lproj/images/gradients.png +0 -0
- data/clients/sc_docs/english.lproj/images/toolbar.png +0 -0
- data/clients/sc_docs/english.lproj/warning.rhtml +0 -6
- data/clients/sc_test_runner/english.lproj/warning.rhtml +0 -6
- data/frameworks/sproutcore/english.lproj/buttons.png +0 -0
- data/frameworks/sproutcore/english.lproj/collections.css +0 -82
- data/frameworks/sproutcore/english.lproj/images/buttons-sprite.png +0 -0
- data/frameworks/sproutcore/views/collection/collection_item.js +0 -36
- data/frameworks/sproutcore/views/collection/text_cell.js +0 -128
- data/frameworks/sproutcore/views/field.js +0 -214
- data/frameworks/sproutcore/views/workspace.js +0 -170
- data/generators/client/templates/english.lproj/controls.css +0 -0
- data/generators/framework/templates/english.lproj/body.css +0 -0
- data/generators/framework/templates/english.lproj/body.rhtml +0 -3
- data/generators/framework/templates/english.lproj/controls.css +0 -0
- data/lib/sproutcore/view_helpers/button_views.rb +0 -302
- data/lib/sproutcore/view_helpers/core_views.rb +0 -292
- data/lib/sproutcore/view_helpers/form_views.rb +0 -258
- data/lib/sproutcore/view_helpers/menu_views.rb +0 -94
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// SC.ListItemView
|
|
3
|
+
// ==========================================================================
|
|
4
|
+
|
|
5
|
+
require('Core') ;
|
|
6
|
+
require('views/view') ;
|
|
7
|
+
require('mixins/control');
|
|
8
|
+
|
|
9
|
+
SC.LIST_ITEM_ACTION_CANCEL = 'sc-list-item-cancel-action';
|
|
10
|
+
SC.LIST_ITEM_ACTION_REFRESH = 'sc-list-item-cancel-refresh';
|
|
11
|
+
SC.LIST_ITEM_ACTION_EJECT = 'sc-list-item-cancel-eject';
|
|
12
|
+
|
|
13
|
+
/** @class
|
|
14
|
+
|
|
15
|
+
Displays a list item with a label, optional icon, count, and right icon.
|
|
16
|
+
|
|
17
|
+
@extends SC.View
|
|
18
|
+
@extends SC.Control
|
|
19
|
+
@author AuthorName
|
|
20
|
+
@version 0.1
|
|
21
|
+
*/
|
|
22
|
+
SC.ListItemView = SC.View.extend(SC.Control,
|
|
23
|
+
/** @scope SC.ListItemView.prototype */ {
|
|
24
|
+
|
|
25
|
+
/** A ListItemView has an img tag, label, count, optional right button, and
|
|
26
|
+
an optional right arrow. These items are made visible/hidden based on a
|
|
27
|
+
variety of CSS classes.
|
|
28
|
+
*/
|
|
29
|
+
emptyElement: '<div class="sc-list-item-view sc-collection-item"></div>',
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
The content object the list item will display.
|
|
33
|
+
*/
|
|
34
|
+
content: null,
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
(displayDelegate) True if you want the item view to display an icon.
|
|
38
|
+
|
|
39
|
+
If false, the icon on the list item view will be hidden. Otherwise,
|
|
40
|
+
space will be left for the icon next to the list item view.
|
|
41
|
+
*/
|
|
42
|
+
hasContentIcon: NO,
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
(displayDelegate) True if you want space to be allocated for a branch
|
|
46
|
+
arrow.
|
|
47
|
+
|
|
48
|
+
If false, the space for the branch arrow will be collapsed.
|
|
49
|
+
*/
|
|
50
|
+
hasContentBranch: NO,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
(displayDelegate) Property key to use for the icon url
|
|
54
|
+
|
|
55
|
+
This property will be checked on the content object to determine the
|
|
56
|
+
icon to display. It must return either a URL or a CSS class name.
|
|
57
|
+
*/
|
|
58
|
+
contentIconKey: null,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
(displayDelegate) The name of the property used for label itself
|
|
62
|
+
|
|
63
|
+
If null, then the content object itself will be used..
|
|
64
|
+
*/
|
|
65
|
+
contentValueKey: null,
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
(displayDelegate) The name of the property used to find the count of
|
|
69
|
+
unread items.
|
|
70
|
+
|
|
71
|
+
The count will only be visible if this property is not null and the
|
|
72
|
+
returned value is not 0.
|
|
73
|
+
*/
|
|
74
|
+
contentUnreadCountKey: null,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
(displayDelegate) The name of the property used to determine if the item
|
|
78
|
+
is a branch or leaf (i.e. if the branch icon should be displayed to the
|
|
79
|
+
right edge.)
|
|
80
|
+
|
|
81
|
+
If this is null, then the branch view will be completely hidden.
|
|
82
|
+
Otherwise space will be allocated for it.
|
|
83
|
+
*/
|
|
84
|
+
contentIsBranchKey: null,
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
contentPropertyDidChange: function() {
|
|
88
|
+
this.render() ;
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
Regenerates the innerHTML for this view and updates it if necessary.
|
|
94
|
+
*/
|
|
95
|
+
render: function() {
|
|
96
|
+
var html = [] ;
|
|
97
|
+
var content = this.get('content') ;
|
|
98
|
+
var del = this.displayDelegate ;
|
|
99
|
+
|
|
100
|
+
// handle icon
|
|
101
|
+
if (this.getDelegateProperty(del, 'hasContentIcon')) {
|
|
102
|
+
var iconKey = this.getDelegateProperty(del,'contentIconKey') ;
|
|
103
|
+
var icon = (iconKey && content && content.get) ? content.get(iconKey) : null ;
|
|
104
|
+
html.push(this.renderIconHTML(icon));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// handle label
|
|
108
|
+
var labelKey = this.getDelegateProperty(del, 'contentValueKey') ;
|
|
109
|
+
var label = (labelKey && content && content.get) ? content.get(labelKey) : null ;
|
|
110
|
+
html.push(this.renderLabelHTML(label));
|
|
111
|
+
|
|
112
|
+
// handle unread count
|
|
113
|
+
var countKey = this.getDelegateProperty(del, 'contentUnreadCountKey') ;
|
|
114
|
+
var count = (countKey && content && content.get) ? content.get(countKey) : null ;
|
|
115
|
+
if ((count != null) && (count != 0)) {
|
|
116
|
+
html.push(this.renderCountHTML(count));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// handle action
|
|
120
|
+
var actionKey = this.getDelegateProperty(del, 'listItemActionProperty') ;
|
|
121
|
+
var actionClassName = (actionKey && content && content.get) ? content.get(actionKey) : null ;
|
|
122
|
+
if (actionClassName) {
|
|
123
|
+
html.push(this.renderActionHTML(actionClassName));
|
|
124
|
+
}
|
|
125
|
+
this.setClassName('sc-has-action', actionClassName) ;
|
|
126
|
+
|
|
127
|
+
// handle branch
|
|
128
|
+
if (this.getDelegateProperty(del, 'hasContentBranch')) {
|
|
129
|
+
var branchKey = this.getDelegateProperty(del, 'contentIsBranchKey');
|
|
130
|
+
var hasBranch = (branchKey && content && content.get) ? content.get(branchKey) : false ;
|
|
131
|
+
html.push(this.renderBranchHTML(hasBranch));
|
|
132
|
+
this.setClassName('sc-has-branch', true) ;
|
|
133
|
+
} else this.setClassName('sc-has-branch', false) ;
|
|
134
|
+
|
|
135
|
+
html = html.join('') ;
|
|
136
|
+
if (html != this._lastRenderedHtml) {
|
|
137
|
+
this._lastRenderedHtml = html ;
|
|
138
|
+
this.set('innerHTML', html) ;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
renderIconHTML generates the html string used to represent the icon for your
|
|
144
|
+
list item. override this to return your own custom HTML
|
|
145
|
+
@returns {String}
|
|
146
|
+
@arguments {String} the icon property based on your view's contentIconKey
|
|
147
|
+
*/
|
|
148
|
+
renderIconHTML: function(icon){
|
|
149
|
+
var html = [];
|
|
150
|
+
// get a class name and url to include if relevant
|
|
151
|
+
var url = null, className = null ;
|
|
152
|
+
if (icon && SC.ImageView.valueIsUrl(icon)) {
|
|
153
|
+
url = icon; className = '' ;
|
|
154
|
+
} else {
|
|
155
|
+
className = icon; url = static_url('blank.gif') ;
|
|
156
|
+
}
|
|
157
|
+
html.push('<img class="sc-icon ');
|
|
158
|
+
html.push(className || '');
|
|
159
|
+
html.push('" src="');
|
|
160
|
+
html.push(url || static_url('blank.gif')) ;
|
|
161
|
+
html.push('" />') ;
|
|
162
|
+
html=html.join('');
|
|
163
|
+
return html;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
renderLabelHTML generates the html string used to represent the label for your
|
|
168
|
+
list item. override this to return your own custom HTML
|
|
169
|
+
@returns {String}
|
|
170
|
+
@arguments {String} the label property based on your view's contentValueKey
|
|
171
|
+
*/
|
|
172
|
+
renderLabelHTML: function(label){
|
|
173
|
+
var html = [];
|
|
174
|
+
html.push('<span class="sc-label">') ;
|
|
175
|
+
html.push(label || '') ;
|
|
176
|
+
html.push('</span>') ;
|
|
177
|
+
return html.join('');
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
renderCountHTML generates the html string used to represent the count (like unread count)
|
|
182
|
+
for your list item. override this to return your own custom HTML
|
|
183
|
+
@returns {String}
|
|
184
|
+
@arguments {Integer} the label property based on your view's contentValueKey
|
|
185
|
+
*/
|
|
186
|
+
renderCountHTML: function(count) {
|
|
187
|
+
var html= [];
|
|
188
|
+
html.push('<span class="sc-count"><span class="inner">') ;
|
|
189
|
+
html.push(count.toString()) ;
|
|
190
|
+
html.push('</span></span>') ;
|
|
191
|
+
return html.join('');
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
renderActiontHTML generates the html string used to represent the action item
|
|
196
|
+
for your list item. override this to return your own custom HTML
|
|
197
|
+
@returns {String}
|
|
198
|
+
@arguments {String} the name of the action item.
|
|
199
|
+
*/
|
|
200
|
+
renderActionHTML: function(actionClassName){
|
|
201
|
+
var html = [];
|
|
202
|
+
html.push('<img src="') ;
|
|
203
|
+
html.push(static_url('blank.gif')) ;
|
|
204
|
+
html.push('" class="sc-action" />') ;
|
|
205
|
+
return html.join('');
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
renderBranchHTML generates the html string used to represent the branch arrow.
|
|
210
|
+
override this to return your own custom HTML
|
|
211
|
+
@returns {String}
|
|
212
|
+
@arguments {Boolean} whehter the branch is
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
renderBranchHTML: function(hasBranch) {
|
|
216
|
+
var html = [];
|
|
217
|
+
html.push('<span class="sc-branch ');
|
|
218
|
+
html.push(hasBranch ? 'sc-branch-visible' : 'sc-branch-hidden') ;
|
|
219
|
+
html.push('"> </span>');
|
|
220
|
+
return html.join('');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
}) ;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
// ========================================================================
|
|
2
2
|
// SproutCore
|
|
3
|
-
// copyright 2006-
|
|
3
|
+
// copyright 2006-2008 Sprout Systems, Inc.
|
|
4
4
|
// ========================================================================
|
|
5
5
|
|
|
6
6
|
require('views/view') ;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/** @class
|
|
9
|
+
|
|
10
|
+
This is a basic menu item for inclusion in a popup menu. This is a type
|
|
11
|
+
of button that will automatically close the popup menu when it is
|
|
12
|
+
pressed.
|
|
13
|
+
|
|
14
|
+
@extends SC.ButtonView
|
|
15
|
+
|
|
16
|
+
*/
|
|
11
17
|
SC.MenuItemView = SC.ButtonView.extend({
|
|
12
18
|
|
|
13
19
|
emptyElement: [
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
// ========================================================================
|
|
2
2
|
// SproutCore
|
|
3
|
-
// copyright 2006-
|
|
3
|
+
// copyright 2006-2008 Sprout Systems, Inc.
|
|
4
4
|
// ========================================================================
|
|
5
5
|
|
|
6
6
|
require('views/view') ;
|
|
7
7
|
require('controllers/collection') ;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
|
|
11
|
+
@class
|
|
12
|
+
|
|
13
|
+
A pagination view renders a widget for showing the total number of pages and
|
|
14
|
+
for switching between them. It includes a forward arrow, back arrow, and
|
|
15
|
+
a popup.
|
|
16
|
+
|
|
17
|
+
@extends SC.View
|
|
18
|
+
*/
|
|
12
19
|
SC.PaginationView = SC.View.extend({
|
|
13
20
|
|
|
14
21
|
// ......................................
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
require('views/button') ;
|
|
1
|
+
require('views/button/button') ;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
@class
|
|
5
|
+
|
|
6
|
+
@extends SC.ButtonView
|
|
7
|
+
@author Skip Baney
|
|
8
|
+
@copyright 2006-2008, Sprout Systems, Inc. and contributors.
|
|
9
|
+
@version 1.0
|
|
10
10
|
*/
|
|
11
11
|
SC.PopupButtonView = SC.ButtonView.extend({
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Overriding the default SC.ButtonView#performKeyEquivalent method to pass
|
|
15
|
+
it onto the menu
|
|
16
|
+
|
|
17
|
+
@param {string} keystring method name corresponding to the keys pressed
|
|
18
|
+
(i.e alt_shift_z)
|
|
19
|
+
@param {DOMMouseEvent} evt mousedown event
|
|
17
20
|
*/
|
|
18
21
|
performKeyEquivalent: function( keystring, evt )
|
|
19
22
|
{
|
|
@@ -28,14 +31,14 @@ SC.PopupButtonView = SC.ButtonView.extend({
|
|
|
28
31
|
},
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Name of the menu view to use.
|
|
35
|
+
@type {string}
|
|
33
36
|
*/
|
|
34
37
|
menuName: null,
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
PopupMenu reference. Will be lazy-loaded from the 'menuName' string.
|
|
41
|
+
@type {SC.PopupMenu}
|
|
39
42
|
*/
|
|
40
43
|
menu: function( key, value )
|
|
41
44
|
{
|
|
@@ -53,15 +56,16 @@ SC.PopupButtonView = SC.ButtonView.extend({
|
|
|
53
56
|
}
|
|
54
57
|
return this._menu;
|
|
55
58
|
}.property(),
|
|
59
|
+
|
|
56
60
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
Binds the button's selection state to the menu's visibility.
|
|
62
|
+
@private
|
|
59
63
|
*/
|
|
60
64
|
isSelectedBinding: '*_menu.isVisible',
|
|
61
65
|
|
|
62
66
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
Button action handler
|
|
68
|
+
@param {DOMMouseEvent} evt mouseup event that triggered the action
|
|
65
69
|
*/
|
|
66
70
|
action: function( evt )
|
|
67
71
|
{
|
|
@@ -70,9 +74,9 @@ SC.PopupButtonView = SC.ButtonView.extend({
|
|
|
70
74
|
if (!menu) return false;
|
|
71
75
|
|
|
72
76
|
if (!this._didFirstRun) {
|
|
73
|
-
// for some reason the menu#isVisible is true the first time we get
|
|
74
|
-
// and since this#isSelected is bound to it... we get an incorrect
|
|
75
|
-
// hacking it here to keep moving.
|
|
77
|
+
// for some reason the menu#isVisible is true the first time we get
|
|
78
|
+
// it... and since this#isSelected is bound to it... we get an incorrect
|
|
79
|
+
// conditional check. hacking it here to keep moving.
|
|
76
80
|
menu.popup(this, evt);
|
|
77
81
|
this._didFirstRun = true;
|
|
78
82
|
} else {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
// ========================================================================
|
|
2
2
|
// SproutCore
|
|
3
|
-
// copyright 2006-
|
|
3
|
+
// copyright 2006-2008 Sprout Systems, Inc.
|
|
4
4
|
// ========================================================================
|
|
5
5
|
|
|
6
6
|
require('views/view') ;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
@class
|
|
10
|
+
|
|
11
|
+
This is a basic popup menu. You can show the popup menu by calling the
|
|
12
|
+
view's popup() method. Pass in the root element and event so that is can
|
|
13
|
+
be positioned.
|
|
14
|
+
|
|
15
|
+
@extends SC.View
|
|
16
|
+
*/
|
|
11
17
|
SC.PopupMenuView = SC.View.extend({
|
|
12
18
|
emptyElement: "<ul></ul>",
|
|
13
19
|
|
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
// ========================================================================
|
|
2
2
|
// SproutCore
|
|
3
|
-
// copyright 2006-
|
|
3
|
+
// copyright 2006-2008 Sprout Systems, Inc.
|
|
4
4
|
// ========================================================================
|
|
5
5
|
|
|
6
6
|
require('views/view') ;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// following structure:
|
|
11
|
-
//
|
|
12
|
-
// <div class="outer progress"><div class="inner"></div></div>
|
|
13
|
-
//
|
|
14
|
-
// The outer can form the boundary of the bar while the inner will be adjusted
|
|
15
|
-
// to fit the percentage of the progress.
|
|
16
|
-
//
|
|
17
|
-
// Style the progress bar with the following CSS classes:
|
|
18
|
-
//
|
|
19
|
-
// .progress.indeterminate = to show an indeterminate progress. inner will hide.
|
|
20
|
-
// .progress.disabled = show as disabled.
|
|
8
|
+
/**
|
|
9
|
+
@class
|
|
21
10
|
|
|
11
|
+
ProgressView displays a progress bar. It does this mostly through CSS
|
|
12
|
+
classes so that you can style them however you want. A progress bar must
|
|
13
|
+
have the following structure:
|
|
14
|
+
|
|
15
|
+
<div class="outer progress"><div class="inner"></div></div>
|
|
16
|
+
|
|
17
|
+
The outer can form the boundary of the bar while the inner will be adjusted
|
|
18
|
+
to fit the percentage of the progress.
|
|
19
|
+
|
|
20
|
+
Style the progress bar with the following CSS classes:
|
|
21
|
+
|
|
22
|
+
.progress.indeterminate = to show an indeterminate progress. inner will
|
|
23
|
+
hide.
|
|
24
|
+
.progress.disabled = show as disabled.
|
|
25
|
+
|
|
26
|
+
@extends SC.View
|
|
27
|
+
*/
|
|
22
28
|
SC.ProgressView = SC.View.extend({
|
|
23
29
|
|
|
24
30
|
// ........................................
|
|
25
31
|
// PROPERTIES
|
|
26
32
|
//
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
/**
|
|
35
|
+
The minimum value of the progress.
|
|
36
|
+
*/
|
|
37
|
+
minimum: 0,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
The maximum value of the progress bar.
|
|
41
|
+
*/
|
|
42
|
+
maximum: 1.0,
|
|
30
43
|
|
|
31
44
|
// Bind this to the current value of the progress bar. Note that by default an
|
|
32
45
|
// empty value will disable the progress bar and a multiple value too make it
|