romo 0.17.1 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -3
- data/assets/css/romo/_mixins.scss +190 -60
- data/assets/css/romo/_vars.scss +262 -100
- data/assets/css/romo/base.scss +0 -106
- data/assets/css/romo/buttons.scss +58 -68
- data/assets/css/romo/colors.scss +212 -0
- data/assets/css/romo/datepicker.scss +2 -2
- data/assets/css/romo/grid_table.scss +215 -70
- data/assets/css/romo/labels.scss +39 -13
- data/assets/css/romo/table.scss +151 -51
- data/assets/js/romo/ajax.js +114 -0
- data/assets/js/romo/date.js +310 -0
- data/assets/js/romo/datepicker.js +35 -194
- data/assets/js/romo/dropdown.js +6 -6
- data/assets/js/romo/inline.js +3 -3
- data/assets/js/romo/modal.js +6 -6
- data/assets/js/romo/tooltip.js +9 -9
- data/lib/romo/dassets.rb +3 -1
- data/lib/romo/version.rb +1 -1
- data/test/unit/dassets_tests.rb +3 -1
- metadata +5 -3
- data/assets/js/romo/invoke.js +0 -112
data/assets/js/romo/modal.js
CHANGED
@@ -7,8 +7,8 @@ $.fn.romoModal = function() {
|
|
7
7
|
var RomoModal = function(element) {
|
8
8
|
this.elem = $(element);
|
9
9
|
this.doInitPopup();
|
10
|
-
this.
|
11
|
-
this.
|
10
|
+
this.romoAjax = this.elem.romoAjax()[0];
|
11
|
+
this.romoAjax.doUnbindElem(); // disable auto invoke on click
|
12
12
|
|
13
13
|
if (this.elem.data('romo-modal-disable-click-invoke') !== true) {
|
14
14
|
this.elem.unbind('click');
|
@@ -17,15 +17,15 @@ var RomoModal = function(element) {
|
|
17
17
|
this.elem.on('modal:triggerToggle', $.proxy(this.onToggleClick, this));
|
18
18
|
this.elem.on('modal:triggerPopupOpen', $.proxy(this.onPopupOpen, this));
|
19
19
|
this.elem.on('modal:triggerPopupClose', $.proxy(this.onPopupClose, this));
|
20
|
-
this.elem.on('
|
20
|
+
this.elem.on('romoAjax:callStart', $.proxy(function(e, romoAjax) {
|
21
21
|
this.doLoadBodyStart();
|
22
22
|
return false;
|
23
23
|
}, this));
|
24
|
-
this.elem.on('
|
24
|
+
this.elem.on('romoAjax:callSuccess', $.proxy(function(e, data, romoAjax) {
|
25
25
|
this.doLoadBodySuccess(data);
|
26
26
|
return false;
|
27
27
|
}, this));
|
28
|
-
this.elem.on('
|
28
|
+
this.elem.on('romoAjax:callError', $.proxy(function(e, xhr, romoAjax) {
|
29
29
|
this.doLoadBodyError(xhr);
|
30
30
|
return false;
|
31
31
|
}, this));
|
@@ -173,7 +173,7 @@ RomoModal.prototype.doPopupOpen = function() {
|
|
173
173
|
if (this.elem.data('romo-modal-content-elem') !== undefined) {
|
174
174
|
this.doLoadBodySuccess($(this.elem.data('romo-modal-content-elem')).html())
|
175
175
|
} else {
|
176
|
-
this.
|
176
|
+
this.romoAjax.doInvoke();
|
177
177
|
}
|
178
178
|
|
179
179
|
this.popupElem.addClass('romo-modal-open');
|
data/assets/js/romo/tooltip.js
CHANGED
@@ -36,7 +36,7 @@ var RomoTooltip = function(element) {
|
|
36
36
|
this.doInit();
|
37
37
|
this.doInitBody();
|
38
38
|
if (this.elem.data('romo-tooltip-content') === undefined) {
|
39
|
-
this.
|
39
|
+
this.doBindAjax();
|
40
40
|
}
|
41
41
|
|
42
42
|
this.elem.trigger('tooltip:ready', [this]);
|
@@ -110,19 +110,19 @@ RomoTooltip.prototype.doResetBody = function() {
|
|
110
110
|
});
|
111
111
|
}
|
112
112
|
|
113
|
-
RomoTooltip.prototype.
|
114
|
-
this.
|
115
|
-
this.
|
113
|
+
RomoTooltip.prototype.doBindAjax = function() {
|
114
|
+
this.romoAjax = this.elem.romoAjax()[0];
|
115
|
+
this.romoAjax.doUnbindElem(); // disable auto invoke on click
|
116
116
|
|
117
|
-
this.elem.on('
|
117
|
+
this.elem.on('romoAjax:callStart', $.proxy(function(e, romoAjax) {
|
118
118
|
this.doLoadBodyStart();
|
119
119
|
return false;
|
120
120
|
}, this));
|
121
|
-
this.elem.on('
|
121
|
+
this.elem.on('romoAjax:callSuccess', $.proxy(function(e, data, romoAjax) {
|
122
122
|
this.doLoadBodySuccess(data);
|
123
123
|
return false;
|
124
124
|
}, this));
|
125
|
-
this.elem.on('
|
125
|
+
this.elem.on('romoAjax:callError', $.proxy(function(e, xhr, romoAjax) {
|
126
126
|
this.doLoadBodyError(xhr);
|
127
127
|
return false;
|
128
128
|
}, this));
|
@@ -195,8 +195,8 @@ RomoTooltip.prototype.onPopupOpen = function(e) {
|
|
195
195
|
}
|
196
196
|
|
197
197
|
RomoTooltip.prototype.doPopupOpen = function() {
|
198
|
-
if (this.
|
199
|
-
this.
|
198
|
+
if (this.romoAjax !== undefined) {
|
199
|
+
this.romoAjax.doInvoke();
|
200
200
|
} else {
|
201
201
|
this._setBodyHtml(this.elem.data('romo-tooltip-content'));
|
202
202
|
}
|
data/lib/romo/dassets.rb
CHANGED
@@ -24,6 +24,7 @@ module Romo::Dassets
|
|
24
24
|
c.combination "css/romo.css", [
|
25
25
|
'css/romo/normalize.css',
|
26
26
|
'css/romo/base.css',
|
27
|
+
'css/romo/colors.css',
|
27
28
|
'css/romo/forms.css',
|
28
29
|
'css/romo/buttons.css',
|
29
30
|
'css/romo/labels.css',
|
@@ -43,8 +44,9 @@ module Romo::Dassets
|
|
43
44
|
]
|
44
45
|
c.combination "js/romo.js", [
|
45
46
|
'js/romo/base.js',
|
47
|
+
'js/romo/date.js',
|
46
48
|
'js/romo/word_boundary_filter.js',
|
47
|
-
'js/romo/
|
49
|
+
'js/romo/ajax.js',
|
48
50
|
'js/romo/onkey.js',
|
49
51
|
'js/romo/form.js',
|
50
52
|
'js/romo/dropdown.js',
|
data/lib/romo/version.rb
CHANGED
data/test/unit/dassets_tests.rb
CHANGED
@@ -24,6 +24,7 @@ module Romo::Dassets
|
|
24
24
|
exp_css_sources = [
|
25
25
|
'css/romo/normalize.css',
|
26
26
|
'css/romo/base.css',
|
27
|
+
'css/romo/colors.css',
|
27
28
|
'css/romo/forms.css',
|
28
29
|
'css/romo/buttons.css',
|
29
30
|
'css/romo/labels.css',
|
@@ -45,8 +46,9 @@ module Romo::Dassets
|
|
45
46
|
|
46
47
|
exp_js_sources = [
|
47
48
|
'js/romo/base.js',
|
49
|
+
'js/romo/date.js',
|
48
50
|
'js/romo/word_boundary_filter.js',
|
49
|
-
'js/romo/
|
51
|
+
'js/romo/ajax.js',
|
50
52
|
'js/romo/onkey.js',
|
51
53
|
'js/romo/form.js',
|
52
54
|
'js/romo/dropdown.js',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: romo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2017-01-10 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- assets/css/romo/_vars.scss
|
62
62
|
- assets/css/romo/base.scss
|
63
63
|
- assets/css/romo/buttons.scss
|
64
|
+
- assets/css/romo/colors.scss
|
64
65
|
- assets/css/romo/datepicker.scss
|
65
66
|
- assets/css/romo/dropdown.scss
|
66
67
|
- assets/css/romo/forms.scss
|
@@ -77,7 +78,9 @@ files:
|
|
77
78
|
- assets/css/romo/tabs.scss
|
78
79
|
- assets/css/romo/tooltip.scss
|
79
80
|
- assets/css/romo/z_index.scss
|
81
|
+
- assets/js/romo/ajax.js
|
80
82
|
- assets/js/romo/base.js
|
83
|
+
- assets/js/romo/date.js
|
81
84
|
- assets/js/romo/datepicker.js
|
82
85
|
- assets/js/romo/dropdown.js
|
83
86
|
- assets/js/romo/dropdown_form.js
|
@@ -86,7 +89,6 @@ files:
|
|
86
89
|
- assets/js/romo/indicator_text_input.js
|
87
90
|
- assets/js/romo/inline.js
|
88
91
|
- assets/js/romo/inline_form.js
|
89
|
-
- assets/js/romo/invoke.js
|
90
92
|
- assets/js/romo/modal.js
|
91
93
|
- assets/js/romo/modal_form.js
|
92
94
|
- assets/js/romo/onkey.js
|
data/assets/js/romo/invoke.js
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
$.fn.romoInvoke = function() {
|
2
|
-
return $.map(this, function(element) {
|
3
|
-
return new RomoInvoke(element);
|
4
|
-
});
|
5
|
-
}
|
6
|
-
|
7
|
-
var RomoInvoke = function(element) {
|
8
|
-
this.elem = $(element);
|
9
|
-
this.targetElem = $(this.elem.data('romo-invoke-target'));
|
10
|
-
this.invokeOn = this.elem.data('romo-invoke-on') || 'click';
|
11
|
-
this.invokeAttr = this.elem.data('romo-invoke-attr') || 'href';
|
12
|
-
this.invokeMethod = this.elem.data('romo-invoke-method') || 'GET';
|
13
|
-
this.loadOnlyOnce = this.elem.data('romo-invoke-load-once') === true;
|
14
|
-
this.invokeQueued = false;
|
15
|
-
this.invokeRunning = false;
|
16
|
-
|
17
|
-
this.elem.unbind(this.invokeOn);
|
18
|
-
|
19
|
-
this.doInit();
|
20
|
-
this.doBindInvoke();
|
21
|
-
this._trigger('invoke:ready', [this]);
|
22
|
-
}
|
23
|
-
|
24
|
-
RomoInvoke.prototype.doInit = function() {
|
25
|
-
// override as needed
|
26
|
-
}
|
27
|
-
|
28
|
-
RomoInvoke.prototype.doBindInvoke = function() {
|
29
|
-
this.doUnBindInvoke();
|
30
|
-
this.elem.on(this.invokeOn, $.proxy(this.onInvoke, this));
|
31
|
-
this.elem.on('invoke:triggerInvoke', $.proxy(this.onInvoke, this));
|
32
|
-
}
|
33
|
-
|
34
|
-
RomoInvoke.prototype.doUnBindInvoke = function() {
|
35
|
-
this.elem.off(this.invokeOn, $.proxy(this.onInvoke, this));
|
36
|
-
this.elem.off('invoke:triggerInvoke', $.proxy(this.onInvoke, this));
|
37
|
-
}
|
38
|
-
|
39
|
-
RomoInvoke.prototype.onInvoke = function(e) {
|
40
|
-
if (e !== undefined) {
|
41
|
-
e.preventDefault();
|
42
|
-
}
|
43
|
-
|
44
|
-
if (this.elem.hasClass('disabled') === false) {
|
45
|
-
this.doInvoke();
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
RomoInvoke.prototype.doInvoke = function() {
|
50
|
-
this.invokeQueued = true;
|
51
|
-
if (this.invokeRunning === false) {
|
52
|
-
this._doInvoke();
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
RomoInvoke.prototype.doLoad = function(href) {
|
57
|
-
this._trigger('invoke:loadStart', [this]);
|
58
|
-
|
59
|
-
$.ajax({
|
60
|
-
type: this.invokeMethod,
|
61
|
-
url: href,
|
62
|
-
success: $.proxy(this.onLoadAjaxSuccess, this),
|
63
|
-
error: $.proxy(this.onLoadAjaxError, this)
|
64
|
-
});
|
65
|
-
}
|
66
|
-
|
67
|
-
RomoInvoke.prototype.onLoadAjaxSuccess = function(data, status, xhr) {
|
68
|
-
this._trigger('invoke:loadSuccess', [data, this]);
|
69
|
-
this._doCompleteInvoke();
|
70
|
-
}
|
71
|
-
|
72
|
-
RomoInvoke.prototype.onLoadAjaxError = function(xhr, errorType, error) {
|
73
|
-
this._trigger('invoke:loadError', [xhr, this]);
|
74
|
-
this._doCompleteInvoke();
|
75
|
-
}
|
76
|
-
|
77
|
-
// private
|
78
|
-
|
79
|
-
RomoInvoke.prototype._doCompleteInvoke = function() {
|
80
|
-
this._trigger('invoke:invoke', [this]);
|
81
|
-
if (this.invokeQueued === true) {
|
82
|
-
this._doInvoke();
|
83
|
-
} else {
|
84
|
-
this.invokeRunning = false;
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
|
-
RomoInvoke.prototype._doInvoke = function() {
|
89
|
-
this.invokeQueued = false;
|
90
|
-
this.invokeRunning = true;
|
91
|
-
var loadHref = this.elem.attr(this.invokeAttr);
|
92
|
-
if (this.loadOnlyOnce === true) {
|
93
|
-
this.elem.removeAttr(this.invokeAttr);
|
94
|
-
}
|
95
|
-
if (loadHref !== undefined) {
|
96
|
-
this.doLoad(loadHref);
|
97
|
-
} else {
|
98
|
-
this._doCompleteInvoke();
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
|
-
RomoInvoke.prototype._trigger = function(event_name, event_data) {
|
103
|
-
if (this.targetElem[0] !== undefined) {
|
104
|
-
this.targetElem.trigger(event_name, event_data);
|
105
|
-
} else {
|
106
|
-
this.elem.trigger(event_name, event_data);
|
107
|
-
}
|
108
|
-
}
|
109
|
-
|
110
|
-
Romo.onInitUI(function(e) {
|
111
|
-
Romo.initUIElems(e, '[data-romo-invoke-auto="true"]').romoInvoke();
|
112
|
-
});
|