sproutcore 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +2 -0
- data/config/requirements.rb +1 -1
- data/frameworks/sproutcore/drag/drag.js +24 -10
- data/frameworks/sproutcore/views/button/button.js +6 -8
- data/frameworks/sproutcore/views/collection/collection.js +102 -66
- data/frameworks/sproutcore/views/collection/source_list.js +1 -1
- data/lib/sproutcore/bundle.rb +19 -15
- data/lib/sproutcore/library.rb +7 -6
- data/lib/sproutcore/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/config/requirements.rb
CHANGED
@@ -438,7 +438,7 @@ SC.Drag = SC.Object.extend(
|
|
438
438
|
//
|
439
439
|
// This means that if you change the view hierarchy of your drop targets
|
440
440
|
// during a drag, it will probably be wrong.
|
441
|
-
|
441
|
+
_getOrderedDropTargets: function() {
|
442
442
|
if (this._cachedDropTargets) return this._cachedDropTargets ;
|
443
443
|
var ret = [];
|
444
444
|
|
@@ -448,15 +448,29 @@ SC.Drag = SC.Object.extend(
|
|
448
448
|
if (!dt.hasOwnProperty(key)) continue ;
|
449
449
|
ret.push(dt[key]) ;
|
450
450
|
}
|
451
|
-
|
452
|
-
//
|
453
|
-
//
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
451
|
+
|
452
|
+
// views must be sorted so that drop targets with the deepest nesting
|
453
|
+
// levels appear first in the array. The getDepthFor().
|
454
|
+
var depth = {} ;
|
455
|
+
var getDepthFor = function(x) {
|
456
|
+
if (!x) return 0 ;
|
457
|
+
var guid = SC.guidFor(x);
|
458
|
+
var ret = depth[guid];
|
459
|
+
if (!ret) {
|
460
|
+
ret = 1 ;
|
461
|
+
while((x = x.parentNode) && (x !== SC.window)) {
|
462
|
+
if (dt[SC.guidFor(x)] !== undefined) ret++ ;
|
463
|
+
}
|
464
|
+
depth[guid] = ret ;
|
458
465
|
}
|
459
|
-
return
|
466
|
+
return ret ;
|
467
|
+
} ;
|
468
|
+
|
469
|
+
ret.sort(function(a,b) {
|
470
|
+
if (a===b) return 0;
|
471
|
+
a = getDepthFor(a) ;
|
472
|
+
b = getDepthFor(b) ;
|
473
|
+
return (a > b) ? -1 : 1 ;
|
460
474
|
}) ;
|
461
475
|
|
462
476
|
this._cachedDropTargets = ret ;
|
@@ -467,7 +481,7 @@ SC.Drag = SC.Object.extend(
|
|
467
481
|
// This will search through the drop targets, looking for one in the
|
468
482
|
// target area.
|
469
483
|
_findDropTarget: function(evt) {
|
470
|
-
var dt = this.
|
484
|
+
var dt = this._getOrderedDropTargets() ;
|
471
485
|
var loc = Event.pointerLocation(evt) ;
|
472
486
|
|
473
487
|
var ret = null ;
|
@@ -223,12 +223,11 @@ SC.ButtonView = SC.View.extend(SC.Control,
|
|
223
223
|
keyEquivalent: null,
|
224
224
|
|
225
225
|
/** @private {String} used to store a previously defined key equiv */
|
226
|
-
|
226
|
+
_defaultKeyEquivalent: null,
|
227
227
|
|
228
228
|
performKeyEquivalent: function( keystring, evt )
|
229
229
|
{
|
230
230
|
if (!this.get('isEnabled')) return false;
|
231
|
-
|
232
231
|
var keyEquivalent = this.get('keyEquivalent');
|
233
232
|
if (keyEquivalent && (keyEquivalent == keystring))
|
234
233
|
{
|
@@ -266,6 +265,8 @@ SC.ButtonView = SC.View.extend(SC.Control,
|
|
266
265
|
init: function() {
|
267
266
|
arguments.callee.base.call(this) ;
|
268
267
|
|
268
|
+
//cache the key equivalent
|
269
|
+
if(this.get("keyEquivalent")) this._defaultKeyEquivalent = this.get("keyEquivalent");
|
269
270
|
// setup initial CSS clases
|
270
271
|
this._isDefaultOrCancelObserver() ;
|
271
272
|
|
@@ -332,23 +333,20 @@ SC.ButtonView = SC.View.extend(SC.Control,
|
|
332
333
|
_isDefaultOrCancelObserver: function() {
|
333
334
|
var isDef = !!this.get('isDefault') ;
|
334
335
|
var isCancel = !isDef && this.get('isCancel') ;
|
336
|
+
|
335
337
|
if(this.didChangeFor('defaultCancelChanged','isDefault','isCancel')) {
|
336
338
|
this.setClassName('def', isDef) ;
|
337
|
-
var key = this.get('keyEquivalent') ;
|
338
339
|
if (isDef) {
|
339
|
-
//cache the previously defined key equivalent
|
340
|
-
this._lastKeyEquivalent = key;
|
341
340
|
this.setIfChanged('keyEquivalent', 'return');
|
342
341
|
}
|
343
342
|
else if (isCancel)
|
344
343
|
{
|
345
|
-
//cache the previously defined key equivalent
|
346
|
-
this._lastKeyEquivalent = key;
|
347
344
|
this.setIfChanged('keyEquivalent', 'escape') ;
|
348
345
|
}
|
349
346
|
else
|
350
347
|
{
|
351
|
-
|
348
|
+
//restore the default key equivalent
|
349
|
+
this.set("keyEquivalent",this._defaultKeyEquivalent);
|
352
350
|
}
|
353
351
|
}
|
354
352
|
|
@@ -1701,7 +1701,7 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1701
1701
|
// Make sure that saved mouseDown state is always reset in case we do
|
1702
1702
|
// not get a paired mouseUp. (Only happens if subclass does not call us
|
1703
1703
|
// like it should)
|
1704
|
-
this._mouseDownAt = this._shouldDeselect =
|
1704
|
+
this._mouseDownAt = this._shouldSelect = this._shouldDeselect =
|
1705
1705
|
this._shouldReselect = this._refreshSelection = false;
|
1706
1706
|
|
1707
1707
|
// find the actual view the mouse was pressed down on. This will call
|
@@ -1724,18 +1724,18 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1724
1724
|
// collection some basic setup info
|
1725
1725
|
var selection = this.get('selection') || [];
|
1726
1726
|
var isSelected = selection.include(mouseDownContent);
|
1727
|
-
var modifierKeyPressed = ev.ctrlKey || ev.
|
1727
|
+
var modifierKeyPressed = ev.ctrlKey || ev.metaKey ;
|
1728
1728
|
if (mouseDownView.checkboxView && (Event.element(ev) == el.checkboxView.rootElement)) {
|
1729
1729
|
modifierKeyPressed = true ;
|
1730
|
-
}
|
1730
|
+
}
|
1731
|
+
this._modifierKeyPressed = modifierKeyPressed ;
|
1731
1732
|
|
1732
1733
|
this._mouseDownAt = Date.now();
|
1733
1734
|
|
1734
|
-
// holding down a modifier key while clicking a selected item should
|
1735
|
-
// deselect and bail.
|
1735
|
+
// holding down a modifier key while clicking a selected item should
|
1736
|
+
// deselect that item...deselect and bail.
|
1736
1737
|
if (modifierKeyPressed && isSelected) {
|
1737
1738
|
this._shouldDeselect = mouseDownContent;
|
1738
|
-
|
1739
1739
|
// if the shiftKey was pressed, then we want to extend the selection
|
1740
1740
|
// from the last selected item
|
1741
1741
|
} else if (ev.shiftKey && selection.get('length') > 0) {
|
@@ -1747,20 +1747,17 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1747
1747
|
} else if (!modifierKeyPressed && isSelected) {
|
1748
1748
|
this._shouldReselect = mouseDownContent;
|
1749
1749
|
|
1750
|
-
// Otherwise, if selecting on mouse down, simply select the clicked on
|
1751
|
-
// adding it to the current
|
1752
|
-
// selection if a modifier key was pressed.
|
1750
|
+
// Otherwise, if selecting on mouse down, simply select the clicked on
|
1751
|
+
// item, adding it to the current selection if a modifier key was pressed.
|
1753
1752
|
} else {
|
1754
|
-
|
1753
|
+
if (this.get("selectOnMouseDown")){
|
1755
1754
|
this.selectItems(mouseDownContent, modifierKeyPressed);
|
1756
|
-
}
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1755
|
+
} else this._shouldSelect = mouseDownContent ;
|
1760
1756
|
}
|
1761
|
-
|
1757
|
+
|
1762
1758
|
// saved for extend by shift ops.
|
1763
1759
|
this._previousMouseDownContent = mouseDownContent;
|
1760
|
+
|
1764
1761
|
return true;
|
1765
1762
|
},
|
1766
1763
|
|
@@ -1782,11 +1779,19 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1782
1779
|
|
1783
1780
|
} else {
|
1784
1781
|
var content = (view) ? view.get('content') : null ;
|
1785
|
-
|
1782
|
+
|
1783
|
+
// this will be set if the user simply clicked on an unselected item and
|
1784
|
+
// selectOnMouseDown was NO.
|
1785
|
+
if (this._shouldSelect) this.selectItems(this._shouldSelect, this._modifierKeyPressed);
|
1786
|
+
|
1787
|
+
// This is true if the user clicked on a selected item with a modifier
|
1788
|
+
// key pressed.
|
1786
1789
|
if (this._shouldDeselect) this.deselectItems(this._shouldDeselect);
|
1787
1790
|
|
1788
|
-
//
|
1789
|
-
//
|
1791
|
+
// This is true if the user clicked on a selected item without a
|
1792
|
+
// modifier-key pressed. When this happens we try to begin editing
|
1793
|
+
// on the content. If that is not allowed, then simply clear the
|
1794
|
+
// selection and reselect the clicked on item.
|
1790
1795
|
if (this._shouldReselect) {
|
1791
1796
|
|
1792
1797
|
// - contentValueIsEditable is true
|
@@ -1821,7 +1826,7 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1821
1826
|
},
|
1822
1827
|
|
1823
1828
|
_cleanupMouseDown: function() {
|
1824
|
-
this._mouseDownAt = this._shouldDeselect = this._shouldReselect = this._refreshSelection = false;
|
1829
|
+
this._mouseDownAt = this._shouldDeselect = this._shouldReselect = this._refreshSelection = this._shouldSelect = false;
|
1825
1830
|
this._mouseDownEvent = this._mouseDownContent = this._mouseDownView = null ;
|
1826
1831
|
},
|
1827
1832
|
|
@@ -1851,33 +1856,39 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1851
1856
|
},
|
1852
1857
|
|
1853
1858
|
_findSelectionExtendedByShift: function(selection, mouseDownContent) {
|
1854
|
-
var
|
1859
|
+
var content = this.get('content');
|
1855
1860
|
|
1856
1861
|
// bounds of the collection...
|
1857
|
-
var
|
1858
|
-
var
|
1862
|
+
var contentLowerBounds = 0;
|
1863
|
+
var contentUpperBounds = (content.get('length') - 1);
|
1859
1864
|
|
1860
|
-
var selectionBeginIndex =
|
1861
|
-
var selectionEndIndex =
|
1865
|
+
var selectionBeginIndex = content.indexOf(selection.first());
|
1866
|
+
var selectionEndIndex = content.indexOf(selection.last());
|
1862
1867
|
|
1863
|
-
var previousMouseDownIndex =
|
1868
|
+
var previousMouseDownIndex = content.indexOf(this._previousMouseDownContent);
|
1864
1869
|
// _previousMouseDownContent couldn't be found... either it hasn't been set yet or the record has been deleted by the user
|
1865
1870
|
// fall back to the first selected item.
|
1866
1871
|
if (previousMouseDownIndex == -1) previousMouseDownIndex = selectionBeginIndex;
|
1867
1872
|
|
1868
1873
|
|
1869
|
-
var currentMouseDownIndex =
|
1874
|
+
var currentMouseDownIndex = content.indexOf(mouseDownContent);
|
1870
1875
|
// sanity check...
|
1871
|
-
if (currentMouseDownIndex == -1) throw "Unable to extend selection to an item that's not in the
|
1876
|
+
if (currentMouseDownIndex == -1) throw "Unable to extend selection to an item that's not in the content array!";
|
1872
1877
|
|
1873
1878
|
// clicked before the current selection set... extend it's beginning...
|
1874
|
-
if (currentMouseDownIndex < selectionBeginIndex)
|
1879
|
+
if (currentMouseDownIndex < selectionBeginIndex) {
|
1880
|
+
selectionBeginIndex = currentMouseDownIndex;
|
1881
|
+
}
|
1882
|
+
|
1875
1883
|
// clicked after the current selection set... extend it's ending...
|
1876
|
-
if (currentMouseDownIndex > selectionEndIndex)
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1884
|
+
if (currentMouseDownIndex > selectionEndIndex) {
|
1885
|
+
selectionEndIndex = currentMouseDownIndex;
|
1886
|
+
}
|
1887
|
+
|
1888
|
+
// clicked inside the selection set... need to determine where the last
|
1889
|
+
// selection was and use that as an anchor.
|
1890
|
+
if ((currentMouseDownIndex > selectionBeginIndex) && (currentMouseDownIndex < selectionEndIndex)) {
|
1891
|
+
if (currentMouseDownIndex === previousMouseDownIndex) {
|
1881
1892
|
selectionBeginIndex = currentMouseDownIndex;
|
1882
1893
|
selectionEndIndex = currentMouseDownIndex;
|
1883
1894
|
} else if (currentMouseDownIndex > previousMouseDownIndex) {
|
@@ -1888,12 +1899,14 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1888
1899
|
selectionEndIndex = previousMouseDownIndex;
|
1889
1900
|
}
|
1890
1901
|
}
|
1902
|
+
|
1891
1903
|
// slice doesn't include the last index passed... silly..
|
1892
1904
|
selectionEndIndex++;
|
1893
1905
|
|
1894
|
-
// shouldn't need to sanity check that the selection is in bounds due to
|
1895
|
-
// I'll have faith that indexOf hasn't lied to
|
1896
|
-
|
1906
|
+
// shouldn't need to sanity check that the selection is in bounds due to
|
1907
|
+
// the indexOf checks above...I'll have faith that indexOf hasn't lied to
|
1908
|
+
// me...
|
1909
|
+
return content.slice(selectionBeginIndex, selectionEndIndex);
|
1897
1910
|
},
|
1898
1911
|
|
1899
1912
|
|
@@ -1940,11 +1953,24 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
1940
1953
|
// DRAG AND DROP SUPPORT
|
1941
1954
|
//
|
1942
1955
|
|
1943
|
-
|
1956
|
+
/**
|
1957
|
+
When reordering its content, the collection view will store its reorder
|
1958
|
+
data using this special data type. The data type is unique to each
|
1959
|
+
collection view instance. You can use this data type to detect reorders
|
1960
|
+
if necessary.
|
1961
|
+
|
1962
|
+
@field
|
1963
|
+
@type {String}
|
1964
|
+
*/
|
1965
|
+
reorderDataType: function() {
|
1944
1966
|
if (!this._reorderDataTypeKey) {
|
1945
1967
|
this._reorderDataTypeKey = "SC.CollectionView.Reorder.%@".fmt(SC.guidFor(this)) ;
|
1946
1968
|
}
|
1947
1969
|
return this._reorderDataTypeKey ;
|
1970
|
+
}.property(),
|
1971
|
+
|
1972
|
+
_reorderDataType: function() {
|
1973
|
+
return this.get('reorderDataType') ;
|
1948
1974
|
},
|
1949
1975
|
|
1950
1976
|
/**
|
@@ -2007,8 +2033,12 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2007
2033
|
// Set this to the dragContent property.
|
2008
2034
|
var content = this.get('content') || [] ;
|
2009
2035
|
var dragContent;
|
2010
|
-
|
2011
|
-
|
2036
|
+
|
2037
|
+
// if we don't select on mouse down, then the selection has not been
|
2038
|
+
// updated to whatever the user clicked. Instead use
|
2039
|
+
// mouse down content.
|
2040
|
+
if (!this.get("selectOnMouseDown")) {
|
2041
|
+
dragContent = [this._mouseDownContent];
|
2012
2042
|
} else {
|
2013
2043
|
dragContent = this.get('selection').sort(function(a,b) {
|
2014
2044
|
a = content.indexOf(a) ;
|
@@ -2072,7 +2102,7 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2072
2102
|
if (canReorderContent) {
|
2073
2103
|
ret = (ret) ? ret.slice() : [] ;
|
2074
2104
|
|
2075
|
-
var key = this.
|
2105
|
+
var key = this.get('reorderDataType') ;
|
2076
2106
|
if (ret.indexOf(key) < 0) ret.push(key) ;
|
2077
2107
|
}
|
2078
2108
|
return ret ;
|
@@ -2090,7 +2120,7 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2090
2120
|
|
2091
2121
|
// if this is a reorder, then return drag content.
|
2092
2122
|
if (this.get('canReorderContent')) {
|
2093
|
-
if (dataType === this.
|
2123
|
+
if (dataType === this.get('reorderDataType')) return this.get('dragContent') ;
|
2094
2124
|
}
|
2095
2125
|
|
2096
2126
|
// otherwise, just pass along to the delegate.
|
@@ -2103,17 +2133,21 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2103
2133
|
*/
|
2104
2134
|
dragEntered: function(drag, evt) {
|
2105
2135
|
|
2106
|
-
// the proposed drag operation is
|
2136
|
+
// the proposed drag operation is DRAG_REORDER only if we can reorder
|
2107
2137
|
// content and the drag contains reorder content.
|
2108
2138
|
var op = SC.DRAG_NONE ;
|
2109
2139
|
if (this.get('canReorderContent')) {
|
2110
2140
|
var types = drag.get('dataTypes') ;
|
2111
|
-
if (types.indexOf(this.
|
2141
|
+
if (types.indexOf(this.get('reorderDataType')) >= 0) {
|
2142
|
+
op = SC.DRAG_REORDER ;
|
2143
|
+
}
|
2112
2144
|
}
|
2113
2145
|
|
2114
2146
|
// Now pass this onto the delegate.
|
2115
2147
|
op = this.invokeDelegateMethod(this.delegate, 'collectionViewValidateDrop', this, drag, SC.DROP_ANY, -1, op) ;
|
2116
2148
|
|
2149
|
+
if (op === SC.DRAG_REORDER) op = SC.DRAG_MOVE ;
|
2150
|
+
|
2117
2151
|
// return
|
2118
2152
|
return op ;
|
2119
2153
|
},
|
@@ -2180,30 +2214,32 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2180
2214
|
// is DROP_BEFORE. DROP_ON is not handled by reordering content.
|
2181
2215
|
if ((idx >= 0) && this.get('canReorderContent') && (dropOp === SC.DROP_BEFORE)) {
|
2182
2216
|
|
2183
|
-
var objects = drag.dataForType(this.
|
2184
|
-
|
2217
|
+
var objects = drag.dataForType(this.get('reorderDataType')) ;
|
2218
|
+
if (objects) {
|
2219
|
+
var content = this.get('content') || [] ;
|
2185
2220
|
|
2186
|
-
|
2187
|
-
|
2188
|
-
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2221
|
+
// if the insertion index is in between two items in the drag itself,
|
2222
|
+
// then this is not allowed. Either use the last insertion index or
|
2223
|
+
// find the first index that is not in between selections. Stop when
|
2224
|
+
// we get to the beginning.
|
2225
|
+
var previousContent = (idx > 0) ? content.objectAt(idx-1) : null ;
|
2226
|
+
var nextContent = (idx < content.get('length')) ? content.objectAt(idx) : null;
|
2227
|
+
|
2228
|
+
var isPreviousInDrag = (previousContent) ? objects.indexOf(previousContent)>=0 : NO;
|
2229
|
+
var isNextInDrag = (nextContent) ? objects.indexOf(nextContent)>=0 : NO;
|
2230
|
+
|
2231
|
+
if (isPreviousInDrag && isNextInDrag) {
|
2232
|
+
if (this._lastInsertionIndex == null) {
|
2233
|
+
while((idx >= 0) && (objects.indexOf(content.objectAt(idx)) >= 0)) {
|
2234
|
+
idx-- ;
|
2235
|
+
}
|
2236
|
+
} else idx = this._lastInsertionIndex ;
|
2237
|
+
}
|
2203
2238
|
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2239
|
+
// If we found a valid insertion point to reorder at, then set the op
|
2240
|
+
// to custom DRAG_REORDER.
|
2241
|
+
if (idx >= 0) dragOp = SC.DRAG_REORDER ;
|
2242
|
+
}
|
2207
2243
|
}
|
2208
2244
|
|
2209
2245
|
// Now save the insertion index and the dropOp. This may be changed by
|
@@ -2303,7 +2339,7 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
|
2303
2339
|
// If the delegate did not handle the drag (i.e. returned SC.DRAG_NONE),
|
2304
2340
|
// and the op type is REORDER, then do the reorder here.
|
2305
2341
|
if ((performed === SC.DRAG_NONE) && (op === SC.DRAG_REORDER)) {
|
2306
|
-
var objects = drag.dataForType(this.
|
2342
|
+
var objects = drag.dataForType(this.get('reorderDataType')) ;
|
2307
2343
|
if (!objects) return SC.DRAG_NONE ;
|
2308
2344
|
|
2309
2345
|
var content = this.get('content') ;
|
data/lib/sproutcore/bundle.rb
CHANGED
@@ -68,12 +68,12 @@ module SproutCore
|
|
68
68
|
#
|
69
69
|
class Bundle
|
70
70
|
|
71
|
-
LONG_LANGUAGE_MAP = { :english => :en, :french => :fr, :german => :de, :japanese => :
|
72
|
-
SHORT_LANGUAGE_MAP = { :en => :english, :fr => :french, :de => :german, :
|
71
|
+
LONG_LANGUAGE_MAP = { :english => :en, :french => :fr, :german => :de, :japanese => :ja, :spanish => :es, :italian => :it }
|
72
|
+
SHORT_LANGUAGE_MAP = { :en => :english, :fr => :french, :de => :german, :ja => :japanese, :es => :spanish, :it => :italian }
|
73
73
|
|
74
|
-
# The default build mode for bundles. This should be set once before you
|
75
|
-
# bundles. You can override this when you create a specific
|
76
|
-
# be the typical behavior
|
74
|
+
# The default build mode for bundles. This should be set once before you
|
75
|
+
# start using bundles. You can override this when you create a specific
|
76
|
+
# bundle, but that should not be the typical behavior
|
77
77
|
def self.build_mode; @build_mode || :development; end
|
78
78
|
|
79
79
|
def self.build_mode=(new_mode); @build_mode = new_mode; end
|
@@ -90,8 +90,8 @@ module SproutCore
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# ==== Returns
|
93
|
-
# All bundles required directly or indirectly by this bundles. These are
|
94
|
-
# their proper load order.
|
93
|
+
# All bundles required directly or indirectly by this bundles. These are
|
94
|
+
# returned in their proper load order.
|
95
95
|
#
|
96
96
|
def all_required_bundles(seen=nil)
|
97
97
|
seen ||= Set.new
|
@@ -143,19 +143,21 @@ module SproutCore
|
|
143
143
|
def initialize(bundle_name, opts ={})
|
144
144
|
|
145
145
|
# You must provide the following properties to every build:
|
146
|
-
# bundle_name:: A name used to identify the client for required
|
146
|
+
# bundle_name:: A name used to identify the client for required
|
147
|
+
# URLs, etc.
|
147
148
|
@bundle_name = bundle_name.to_sym
|
148
149
|
|
149
|
-
# The following are not required by the build system, but they can be
|
150
|
-
# automatically construct the key paths listed below. Often
|
151
|
-
# do the right thing
|
150
|
+
# The following are not required by the build system, but they can be
|
151
|
+
# used to automatically construct the key paths listed below. Often
|
152
|
+
# times defaults will do the right thing
|
152
153
|
#
|
153
154
|
# library:: The root URL of the library holding the client
|
154
155
|
@library = opts[:library]
|
155
156
|
@library_root = opts[:library_root]
|
156
157
|
raise "Bundles must belong to a library or have a library_root" if library_root.nil?
|
157
158
|
|
158
|
-
# The following properties are also required, but have defaults you can
|
159
|
+
# The following properties are also required, but have defaults you can
|
160
|
+
# rely use:
|
159
161
|
# bundle_type:: :framework|:client (default :client)
|
160
162
|
@bundle_type = (opts[:bundle_type] || opts[:type] || :client).to_sym
|
161
163
|
|
@@ -223,10 +225,12 @@ module SproutCore
|
|
223
225
|
BuildTools::JavaScriptResourceBuilder.sort_entries_by_load_order(entries, opts[:language], self)
|
224
226
|
end
|
225
227
|
|
226
|
-
# This method returns the manifest entries for resources of the specified
|
228
|
+
# This method returns the manifest entries for resources of the specified
|
229
|
+
# type.
|
227
230
|
#
|
228
231
|
# ==== Params
|
229
|
-
# type:: must be one of :javascript, :stylesheet, :resource, :html,
|
232
|
+
# type:: must be one of :javascript, :stylesheet, :resource, :html, 3
|
233
|
+
# :fixture, :test
|
230
234
|
#
|
231
235
|
# ==== Options
|
232
236
|
# language:: The language to use. Defaults to preferred language.
|
@@ -250,7 +254,7 @@ module SproutCore
|
|
250
254
|
return ret
|
251
255
|
end
|
252
256
|
|
253
|
-
#
|
257
|
+
# Returns the manifest entry for a resource with the specified name.
|
254
258
|
#
|
255
259
|
# ==== Params
|
256
260
|
# name: The name of the entry.
|
data/lib/sproutcore/library.rb
CHANGED
@@ -2,13 +2,14 @@ require 'yaml'
|
|
2
2
|
|
3
3
|
module SproutCore
|
4
4
|
|
5
|
-
# Describes a single library that can contain one or more clients and
|
6
|
-
# This class is used to automatically locate all installed
|
7
|
-
# clients within them.
|
5
|
+
# Describes a single library that can contain one or more clients and
|
6
|
+
# frameworks. This class is used to automatically locate all installed
|
7
|
+
# libraries and to register the clients within them.
|
8
8
|
#
|
9
|
-
# Libraries are chained, with the child library replacing the parent
|
10
|
-
# In general, the root library is always the current app
|
11
|
-
# those found in the load path or explicitly
|
9
|
+
# Libraries are chained, with the child library replacing the parent
|
10
|
+
# library's settings. In general, the root library is always the current app
|
11
|
+
# while its parent libraries are those found in the load path or explicitly
|
12
|
+
# stated in the configs.
|
12
13
|
class Library
|
13
14
|
|
14
15
|
# Creates a chained set of libraries from the passed location and the load path
|
data/lib/sproutcore/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sproutcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Jolley
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-06-
|
12
|
+
date: 2008-06-05 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|