rasputin 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rasputin/handlebars/handlebars.js +75 -24
- data/lib/rasputin/handlebars/template.rb +1 -1
- data/lib/rasputin/version.rb +1 -1
- data/rasputin.gemspec +1 -2
- data/vendor/assets/javascripts/sproutcore-datastore.js +54 -1187
- data/vendor/assets/javascripts/sproutcore-datetime.js +1177 -0
- data/vendor/assets/javascripts/sproutcore.js +106 -102
- metadata +20 -8
@@ -9537,6 +9537,43 @@ SC.Comparable = SC.Mixin.create( /** @scope SC.Comparable.prototype */{
|
|
9537
9537
|
})({});
|
9538
9538
|
|
9539
9539
|
|
9540
|
+
(function(exports) {
|
9541
|
+
var get = SC.get, set = SC.set;
|
9542
|
+
|
9543
|
+
SC.TargetActionSupport = SC.Mixin.create({
|
9544
|
+
target: null,
|
9545
|
+
action: null,
|
9546
|
+
|
9547
|
+
targetObject: function() {
|
9548
|
+
var target = get(this, 'target');
|
9549
|
+
|
9550
|
+
if (SC.typeOf(target) === "string") {
|
9551
|
+
return SC.getPath(this, target);
|
9552
|
+
} else {
|
9553
|
+
return target;
|
9554
|
+
}
|
9555
|
+
}.property('target').cacheable(),
|
9556
|
+
|
9557
|
+
triggerAction: function() {
|
9558
|
+
var action = get(this, 'action'),
|
9559
|
+
target = get(this, 'targetObject');
|
9560
|
+
|
9561
|
+
if (target && action) {
|
9562
|
+
if (typeof target.send === 'function') {
|
9563
|
+
target.send(action, this);
|
9564
|
+
} else {
|
9565
|
+
if (typeof action === 'string') {
|
9566
|
+
action = target[action];
|
9567
|
+
}
|
9568
|
+
action.call(target, this);
|
9569
|
+
}
|
9570
|
+
}
|
9571
|
+
}
|
9572
|
+
});
|
9573
|
+
|
9574
|
+
})({});
|
9575
|
+
|
9576
|
+
|
9540
9577
|
(function(exports) {
|
9541
9578
|
// ==========================================================================
|
9542
9579
|
// Project: SproutCore Runtime
|
@@ -11064,11 +11101,11 @@ SC.View = SC.Object.extend(
|
|
11064
11101
|
|
11065
11102
|
type = typeof attributeValue;
|
11066
11103
|
|
11067
|
-
if ((type === 'string' || type === 'number') && attributeValue !== currentValue) {
|
11104
|
+
if ((type === 'string' || (type === 'number' && !isNaN(attributeValue))) && attributeValue !== currentValue) {
|
11068
11105
|
elem.attr(attribute, attributeValue);
|
11069
11106
|
} else if (attributeValue && type === 'boolean') {
|
11070
11107
|
elem.attr(attribute, attribute);
|
11071
|
-
} else if (attributeValue
|
11108
|
+
} else if (!attributeValue) {
|
11072
11109
|
elem.removeAttr(attribute);
|
11073
11110
|
}
|
11074
11111
|
};
|
@@ -11948,7 +11985,7 @@ SC.View.reopen({
|
|
11948
11985
|
// License: Licensed under MIT license (see license.js)
|
11949
11986
|
// ==========================================================================
|
11950
11987
|
SC.View.states.preRender = {
|
11951
|
-
parentState: SC.View.states
|
11988
|
+
parentState: SC.View.states['default'],
|
11952
11989
|
|
11953
11990
|
// a view leaves the preRender state once its element has been
|
11954
11991
|
// created (createElement).
|
@@ -11992,7 +12029,7 @@ SC.View.states.preRender = {
|
|
11992
12029
|
var get = SC.get, set = SC.set, meta = SC.meta;
|
11993
12030
|
|
11994
12031
|
SC.View.states.inBuffer = {
|
11995
|
-
parentState: SC.View.states
|
12032
|
+
parentState: SC.View.states['default'],
|
11996
12033
|
|
11997
12034
|
$: function(view, sel) {
|
11998
12035
|
// if we don't have an element yet, someone calling this.$() is
|
@@ -12069,7 +12106,7 @@ SC.View.states.inBuffer = {
|
|
12069
12106
|
var get = SC.get, set = SC.set, meta = SC.meta;
|
12070
12107
|
|
12071
12108
|
SC.View.states.hasElement = {
|
12072
|
-
parentState: SC.View.states
|
12109
|
+
parentState: SC.View.states['default'],
|
12073
12110
|
|
12074
12111
|
$: function(view, sel) {
|
12075
12112
|
var elem = get(view, 'element');
|
@@ -12137,7 +12174,7 @@ SC.View.states.inDOM = {
|
|
12137
12174
|
var destroyedError = "You can't call %@ on a destroyed view", fmt = SC.String.fmt;
|
12138
12175
|
|
12139
12176
|
SC.View.states.destroyed = {
|
12140
|
-
parentState: SC.View.states
|
12177
|
+
parentState: SC.View.states['default'],
|
12141
12178
|
|
12142
12179
|
appendChild: function() {
|
12143
12180
|
throw fmt(destroyedError, ['appendChild']);
|
@@ -12452,7 +12489,7 @@ SC.CollectionView = SC.ContainerView.extend(
|
|
12452
12489
|
var content = get(this, 'content');
|
12453
12490
|
|
12454
12491
|
if (content) {
|
12455
|
-
sc_assert(fmt("an
|
12492
|
+
sc_assert(fmt("an SC.CollectionView's content must implement SC.Array. You passed %@", [content]), content.addArrayObserver != null);
|
12456
12493
|
content.addArrayObserver(this);
|
12457
12494
|
}
|
12458
12495
|
|
@@ -13102,21 +13139,17 @@ SC.Checkbox = SC.View.extend({
|
|
13102
13139
|
|
13103
13140
|
var get = SC.get, set = SC.set;
|
13104
13141
|
|
13105
|
-
SC.
|
13106
|
-
/** @scope SC.TextField.prototype */ {
|
13142
|
+
SC.TextSupport = SC.Mixin.create({
|
13107
13143
|
|
13108
|
-
classNames: ['sc-text-field'],
|
13109
|
-
|
13110
|
-
insertNewline: SC.K,
|
13111
|
-
cancel: SC.K,
|
13112
|
-
|
13113
|
-
tagName: "input",
|
13114
|
-
attributeBindings: ['type', 'placeholder', 'value', 'disabled'],
|
13115
|
-
type: "text",
|
13116
13144
|
value: "",
|
13145
|
+
|
13146
|
+
attributeBindings: ['placeholder', 'disabled'],
|
13117
13147
|
placeholder: null,
|
13118
13148
|
disabled: false,
|
13119
13149
|
|
13150
|
+
insertNewline: SC.K,
|
13151
|
+
cancel: SC.K,
|
13152
|
+
|
13120
13153
|
focusOut: function(event) {
|
13121
13154
|
this._elementValueDidChange();
|
13122
13155
|
return false;
|
@@ -13136,28 +13169,24 @@ SC.TextField = SC.View.extend(
|
|
13136
13169
|
@private
|
13137
13170
|
*/
|
13138
13171
|
interpretKeyEvents: function(event) {
|
13139
|
-
var map = SC.
|
13172
|
+
var map = SC.TextSupport.KEY_EVENTS;
|
13140
13173
|
var method = map[event.keyCode];
|
13141
13174
|
|
13175
|
+
this._elementValueDidChange();
|
13142
13176
|
if (method) { return this[method](event); }
|
13143
|
-
else { this._elementValueDidChange(); }
|
13144
13177
|
},
|
13145
13178
|
|
13146
13179
|
_elementValueDidChange: function() {
|
13147
|
-
set(this, 'value', this.$().val());
|
13148
|
-
},
|
13149
|
-
|
13150
|
-
_updateElementValue: function() {
|
13151
|
-
this.$().val(get(this, 'value'));
|
13180
|
+
set(this, 'value', this.$().val() || null);
|
13152
13181
|
}
|
13182
|
+
|
13153
13183
|
});
|
13154
13184
|
|
13155
|
-
SC.
|
13185
|
+
SC.TextSupport.KEY_EVENTS = {
|
13156
13186
|
13: 'insertNewline',
|
13157
13187
|
27: 'cancel'
|
13158
13188
|
};
|
13159
13189
|
|
13160
|
-
|
13161
13190
|
})({});
|
13162
13191
|
|
13163
13192
|
|
@@ -13167,10 +13196,40 @@ SC.TextField.KEY_EVENTS = {
|
|
13167
13196
|
// Copyright: ©2011 Strobe Inc. and contributors.
|
13168
13197
|
// License: Licensed under MIT license (see license.js)
|
13169
13198
|
// ==========================================================================
|
13199
|
+
/** @class */
|
13200
|
+
|
13201
|
+
var get = SC.get, set = SC.set;
|
13202
|
+
|
13203
|
+
SC.TextField = SC.View.extend(SC.TextSupport,
|
13204
|
+
/** @scope SC.TextField.prototype */ {
|
13205
|
+
|
13206
|
+
classNames: ['sc-text-field'],
|
13207
|
+
|
13208
|
+
tagName: "input",
|
13209
|
+
attributeBindings: ['type', 'value'],
|
13210
|
+
type: "text",
|
13211
|
+
|
13212
|
+
/**
|
13213
|
+
@private
|
13214
|
+
*/
|
13215
|
+
_updateElementValue: function() {
|
13216
|
+
this.$().val(get(this, 'value'));
|
13217
|
+
}
|
13218
|
+
|
13219
|
+
});
|
13220
|
+
|
13221
|
+
})({});
|
13222
|
+
|
13170
13223
|
|
13224
|
+
(function(exports) {
|
13225
|
+
// ==========================================================================
|
13226
|
+
// Project: SproutCore Handlebar Views
|
13227
|
+
// Copyright: ©2011 Strobe Inc. and contributors.
|
13228
|
+
// License: Licensed under MIT license (see license.js)
|
13229
|
+
// ==========================================================================
|
13171
13230
|
var get = SC.get, set = SC.set;
|
13172
13231
|
|
13173
|
-
SC.Button = SC.View.extend({
|
13232
|
+
SC.Button = SC.View.extend(SC.TargetActionSupport, {
|
13174
13233
|
classNames: ['sc-button'],
|
13175
13234
|
classNameBindings: ['isActive'],
|
13176
13235
|
|
@@ -13179,15 +13238,6 @@ SC.Button = SC.View.extend({
|
|
13179
13238
|
type: 'button',
|
13180
13239
|
disabled: false,
|
13181
13240
|
|
13182
|
-
targetObject: function() {
|
13183
|
-
var target = get(this, 'target');
|
13184
|
-
|
13185
|
-
if (SC.typeOf(target) === "string") {
|
13186
|
-
return SC.getPath(this, target);
|
13187
|
-
} else {
|
13188
|
-
return target;
|
13189
|
-
}
|
13190
|
-
}.property('target').cacheable(),
|
13191
13241
|
|
13192
13242
|
mouseDown: function() {
|
13193
13243
|
set(this, 'isActive', true);
|
@@ -13211,16 +13261,10 @@ SC.Button = SC.View.extend({
|
|
13211
13261
|
|
13212
13262
|
mouseUp: function(event) {
|
13213
13263
|
if (get(this, 'isActive')) {
|
13214
|
-
var action = get(this, 'action'),
|
13215
|
-
target = get(this, 'targetObject');
|
13216
|
-
|
13217
|
-
if (target && action) {
|
13218
|
-
if (typeof action === 'string') {
|
13219
|
-
action = target[action];
|
13220
|
-
}
|
13221
|
-
action.call(target, this);
|
13222
|
-
}
|
13223
13264
|
|
13265
|
+
// Actually invoke the button's target and action.
|
13266
|
+
// This method comes from the SC.TargetActionSupport mixin.
|
13267
|
+
this.triggerAction();
|
13224
13268
|
set(this, 'isActive', false);
|
13225
13269
|
}
|
13226
13270
|
|
@@ -13254,33 +13298,11 @@ SC.Button = SC.View.extend({
|
|
13254
13298
|
|
13255
13299
|
var get = SC.get, set = SC.set;
|
13256
13300
|
|
13257
|
-
SC.TextArea = SC.View.extend({
|
13301
|
+
SC.TextArea = SC.View.extend(SC.TextSupport, {
|
13258
13302
|
|
13259
13303
|
classNames: ['sc-text-area'],
|
13260
13304
|
|
13261
13305
|
tagName: "textarea",
|
13262
|
-
value: "",
|
13263
|
-
attributeBindings: ['placeholder', 'disabled'],
|
13264
|
-
placeholder: null,
|
13265
|
-
disabled: false,
|
13266
|
-
|
13267
|
-
insertNewline: SC.K,
|
13268
|
-
cancel: SC.K,
|
13269
|
-
|
13270
|
-
focusOut: function(event) {
|
13271
|
-
this._elementValueDidChange();
|
13272
|
-
return false;
|
13273
|
-
},
|
13274
|
-
|
13275
|
-
change: function(event) {
|
13276
|
-
this._elementValueDidChange();
|
13277
|
-
return false;
|
13278
|
-
},
|
13279
|
-
|
13280
|
-
keyUp: function(event) {
|
13281
|
-
this.interpretKeyEvents(event);
|
13282
|
-
return false;
|
13283
|
-
},
|
13284
13306
|
|
13285
13307
|
/**
|
13286
13308
|
@private
|
@@ -13289,27 +13311,11 @@ SC.TextArea = SC.View.extend({
|
|
13289
13311
|
this._updateElementValue();
|
13290
13312
|
},
|
13291
13313
|
|
13292
|
-
interpretKeyEvents: function(event) {
|
13293
|
-
var map = SC.TextArea.KEY_EVENTS;
|
13294
|
-
var method = map[event.keyCode];
|
13295
|
-
|
13296
|
-
this._elementValueDidChange();
|
13297
|
-
if (method) { return this[method](event); }
|
13298
|
-
},
|
13299
|
-
|
13300
|
-
_elementValueDidChange: function() {
|
13301
|
-
set(this, 'value', this.$().val() || null);
|
13302
|
-
},
|
13303
|
-
|
13304
13314
|
_updateElementValue: function() {
|
13305
13315
|
this.$().val(get(this, 'value'));
|
13306
13316
|
}.observes('value')
|
13307
|
-
});
|
13308
13317
|
|
13309
|
-
|
13310
|
-
13: 'insertNewline',
|
13311
|
-
27: 'cancel'
|
13312
|
-
};
|
13318
|
+
});
|
13313
13319
|
|
13314
13320
|
})({});
|
13315
13321
|
|
@@ -13389,6 +13395,7 @@ SC.Metamorph = SC.Mixin.create({
|
|
13389
13395
|
var buffer = view.renderToBuffer();
|
13390
13396
|
|
13391
13397
|
SC.run.schedule('render', this, function() {
|
13398
|
+
if (get(view, 'isDestroyed')) { return; }
|
13392
13399
|
view._notifyWillInsertElement();
|
13393
13400
|
morph.replaceWith(buffer.string());
|
13394
13401
|
view.transitionTo('inDOM');
|
@@ -13557,13 +13564,6 @@ SC._BindableSpanView = SC.View.extend(SC.Metamorph,
|
|
13557
13564
|
}
|
13558
13565
|
|
13559
13566
|
return this._super(buffer);
|
13560
|
-
},
|
13561
|
-
|
13562
|
-
destroy: function() {
|
13563
|
-
var removeObserver = get(this, 'removeObserver');
|
13564
|
-
removeObserver();
|
13565
|
-
|
13566
|
-
this._super();
|
13567
13567
|
}
|
13568
13568
|
});
|
13569
13569
|
|
@@ -13606,23 +13606,27 @@ var get = SC.get, getPath = SC.getPath, set = SC.set, fmt = SC.String.fmt;
|
|
13606
13606
|
|
13607
13607
|
view.appendChild(bindView);
|
13608
13608
|
|
13609
|
-
var observer
|
13610
|
-
|
13611
|
-
|
13612
|
-
|
13613
|
-
|
13609
|
+
var observer, invoker;
|
13610
|
+
|
13611
|
+
observer = function(){
|
13612
|
+
// Double check since sometimes the view gets destroyed after this observer is already queued
|
13613
|
+
if (!get(bindView, 'isDestroyed')) { bindView.rerender(); }
|
13614
13614
|
};
|
13615
13615
|
|
13616
|
-
|
13617
|
-
SC.
|
13618
|
-
}
|
13616
|
+
invoker = function() {
|
13617
|
+
SC.run.once(observer);
|
13618
|
+
};
|
13619
13619
|
|
13620
13620
|
// Observes the given property on the context and
|
13621
13621
|
// tells the SC._BindableSpan to re-render. If property
|
13622
13622
|
// is an empty string, we are printing the current context
|
13623
13623
|
// object ({{this}}) so updating it is not our responsibility.
|
13624
13624
|
if (property !== '') {
|
13625
|
-
|
13625
|
+
set(bindView, 'removeObserver', function() {
|
13626
|
+
SC.removeObserver(ctx, property, invoker);
|
13627
|
+
});
|
13628
|
+
|
13629
|
+
SC.addObserver(ctx, property, invoker);
|
13626
13630
|
}
|
13627
13631
|
} else {
|
13628
13632
|
// The object is not observable, so just render it out and
|
@@ -13756,7 +13760,7 @@ SC.Handlebars.registerHelper('bindAttr', function(options) {
|
|
13756
13760
|
// Generate a unique id for this element. This will be added as a
|
13757
13761
|
// data attribute to the element so it can be looked up when
|
13758
13762
|
// the bound property changes.
|
13759
|
-
var dataId = jQuery.uuid
|
13763
|
+
var dataId = ++jQuery.uuid;
|
13760
13764
|
|
13761
13765
|
// Handle classes differently, as we can bind multiple classes
|
13762
13766
|
var classBindings = attrs['class'];
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasputin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70095015952600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70095015952600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: actionpack
|
27
|
-
requirement: &
|
27
|
+
requirement: &70095015950600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.1.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70095015950600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sprockets
|
38
|
-
requirement: &
|
38
|
+
requirement: &70095015949940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,18 @@ dependencies:
|
|
43
43
|
version: 2.0.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70095015949940
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jquery-rails
|
49
|
+
requirement: &70095015965180 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70095015965180
|
47
58
|
description: SproutCore 2.0 for the Rails asset pipeline.
|
48
59
|
email:
|
49
60
|
- paul@chavard.net
|
@@ -66,6 +77,7 @@ files:
|
|
66
77
|
- vendor/assets/javascripts/TransformJS.js
|
67
78
|
- vendor/assets/javascripts/modernizr.js
|
68
79
|
- vendor/assets/javascripts/sproutcore-datastore.js
|
80
|
+
- vendor/assets/javascripts/sproutcore-datetime.js
|
69
81
|
- vendor/assets/javascripts/sproutcore-i18n.js
|
70
82
|
- vendor/assets/javascripts/sproutcore-routing.js
|
71
83
|
- vendor/assets/javascripts/sproutcore-statechart.js
|