Skip to content

Commit 8029850

Browse files
committed
Renamed "Evol.UI" to "Evol.DOM".
1 parent 7afe0be commit 8029850

File tree

19 files changed

+143
-583
lines changed

19 files changed

+143
-583
lines changed

Gruntfile.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ module.exports = function (grunt) {
8080

8181
'js/dico/def.js',
8282
'js/dico/format.js',
83-
'js/dico/ui.js',
84-
'js/dico/ui-*.js',
83+
'js/dico/dom.js',
84+
'js/dico/dom-*.js',
8585
'js/dico/dico.js',
8686
'js/dico/d3-*.js',
8787

@@ -123,7 +123,7 @@ module.exports = function (grunt) {
123123
// COPY
124124
// *************************************************************************************
125125
copy: {
126-
main: {
126+
dependencies: {
127127
files: [
128128
{
129129
expand: true,
@@ -159,7 +159,7 @@ module.exports = function (grunt) {
159159
'bower.json',
160160

161161
// --- dist ---
162-
'js/ui*.js',
162+
'js/dom*.js',
163163
'js/i18n/EN.js',
164164

165165
'js/many*.js',
@@ -317,5 +317,4 @@ module.exports = function (grunt) {
317317
'copy',
318318
'uglify:dependencies'
319319
]);
320-
321320
};

js/dico/d3-bubbles.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var Evol=Evol||{};
55

66
Evol.Bubbles = function(){
77

8+
var fts = Evol.Def.fieldTypes;
9+
810
var Bubbles = function(opts){
911
_.extend(this, opts);
1012
this.fieldsH={};
@@ -71,19 +73,37 @@ Bubbles.prototype.setData = function(data){
7173

7274
this.nodes.enter().append("circle")
7375
.attr("class", "node")
76+
.attr('data-mid', function (d) { return d.id;})
7477
.attr("cx", function (d) {
7578
return d.x;
7679
})
77-
.attr('data-mid', function (d) { return d.id;})
78-
.attr("cy", function (d) { return d.y; })
79-
.attr("r", function (d) { return d.radius; })
80-
.style("fill", function (d) { return that.fill(d[that.colorFieldId]); })
80+
.attr("cy", function (d) {
81+
return d.y;
82+
})
83+
.attr("r", function (d) {
84+
return d.radius;
85+
})
86+
.style("fill", function (d) {
87+
return that.fill(d[that.colorFieldId]);
88+
})
8189
.on("mouseenter", showPopover)
8290
.on("mouseleave", removePopovers)
8391
.on("click", removePopovers);
8492

8593
this.nodes
86-
.attr('data-mid', function (d) { return d.id;});
94+
.attr('data-mid', function (d) { return d.id;})
95+
.attr("cx", function (d) {
96+
return d.x;
97+
})
98+
.attr("cy", function (d) {
99+
return d.y;
100+
})
101+
.attr("r", function (d) {
102+
return d.radius;
103+
})
104+
.style("fill", function (d) {
105+
return that.fill(d[that.colorFieldId]);
106+
});
87107

88108

89109
this.nodes.exit().remove();

js/dico/dico.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var Evol = Evol || {};
1414
// not a "virtual DOM" but an "abstract DOM"
1515
Evol.Dico = function(){
1616

17-
var eUI = Evol.UI,
18-
uiInput = eUI.input,
17+
var dom = Evol.DOM,
18+
uiInput = dom.input,
1919
i18n = Evol.i18n,
2020
fts = Evol.Def.fieldTypes;
2121

@@ -155,7 +155,7 @@ return {
155155
switch(f.type){
156156
case fts.bool:
157157
if (v==='true' || v=='1') {
158-
return eUI.icon('ok', f.css);
158+
return dom.icon('ok', f.css);
159159
}
160160
break;
161161
case fts.lov:
@@ -197,9 +197,9 @@ return {
197197
}
198198
break;
199199
case fts.email:
200-
return eUI.linkEmail(wId?f.id:null, v);
200+
return dom.linkEmail(wId?f.id:null, v);
201201
case fts.url:
202-
return eUI.link(f.id, v, v, f.id);
202+
return dom.link(f.id, v, v, f.id);
203203
//case fts.color:
204204
// return uiInput.colorBox(f.id, v, v);
205205
default:
@@ -211,10 +211,10 @@ return {
211211
HTMLFieldLabel: function (fld, mode) {
212212
var h='<div class="evol-field-label" id="'+fld.id+'-lbl"><label class="control-label '+(fld.cssLabel?fld.cssLabel:'')+'" for="'+fld.id+'">'+fld.label;
213213
if (mode != 'browse' && fld.required){
214-
h+=eUI.html.required;
214+
h+=dom.html.required;
215215
}
216216
if (fld.help && fld.help!==''){
217-
h+=eUI.icon('question-sign', '');
217+
h+=dom.icon('question-sign', '');
218218
}
219219
h+='</label></div>';
220220
return h;
@@ -335,7 +335,7 @@ return {
335335
}
336336
//$el.closest('.evol-fld').after($elDesModal);
337337
$('body').append($elDesModal);
338-
var $elDesModal=$(eUI.modal.HTMLModal('m'+id, 'Edit '+type+' '+ f.label, '<div class="'+css+'"></div>')),
338+
var $elDesModal=$(dom.modal.HTMLModal('m'+id, 'Edit '+type+' '+ f.label, '<div class="'+css+'"></div>')),
339339
$elDes=$elDesModal.find('.'+css);
340340
var vw = new Evol.ViewOne.Edit({
341341
uiModel: uiModel,

js/dico/toolbar.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(toastr){
4141
// toolbar widget which also acts as a controller for all views "one" and "many" as well as actions
4242
Evol.Toolbar = function() {
4343

44-
var eUI = Evol.UI,
44+
var dom = Evol.DOM,
4545
i18n = Evol.i18n,
4646
i18nTool = i18n.tools;
4747

@@ -134,13 +134,13 @@ return Backbone.View.extend({
134134
var h,
135135
isReadOnly=this.readonly!==false,
136136
that=this,
137-
eUIm=eUI.menu,
137+
domm=dom.menu,
138138
tb=this.buttons,
139139
menuDivider='<li class="divider" data-cardi="x"></li>',
140140
menuDividerH='<li class="divider-h"></li>';
141141

142142
function menuItem (m, noLabel){
143-
return eUIm.hItem(m.id, noLabel?'':m.label, m.icon, m.n);
143+
return domm.hItem(m.id, noLabel?'':m.label, m.icon, m.n);
144144
}
145145
function menuItems (ms, noLabel){
146146
return _.map(ms, function(m){
@@ -155,15 +155,15 @@ return Backbone.View.extend({
155155
menuItems(tb.always)+menuDividerH;
156156
h+=menuItems(tb.actions);
157157
if(tb.moreActions && tb.moreActions.length){
158-
h+=Evol.UI.menu.hBegin('more','li','menu-hamburger', '', 'n');
158+
h+=domm.hBegin('more','li','menu-hamburger', '', 'n');
159159
_.each(tb.moreActions, function(m){
160160
if(m.id==='-'){
161161
h+=menuDivider;
162162
}else{
163163
h+=menuItem(m);
164164
}
165165
});
166-
h+=Evol.UI.menu.hEnd('li');
166+
h+=domm.hEnd('li');
167167
}
168168
if(tb.search){
169169
h+=menuDivider;
@@ -177,10 +177,10 @@ return Backbone.View.extend({
177177
h+='</ul><ul class="nav nav-pills pull-right" data-id="views">';
178178
h+='<li class="evo-tb-status" data-cardi="n"></li>';
179179
h+=menuItems(tb.prevNext);
180-
//h+=eUIm.hBegin('views','li','eye-open');
180+
//h+=domm.hBegin('views','li','eye-open');
181181
h+=menuDividerH+
182182
menuItems(tb.views, true);
183-
//h+=eUIm.hItem('customize','','wrench', 'x', 'Customize');
183+
//h+=domm.hItem('customize','','wrench', 'x', 'Customize');
184184
/*
185185
if(this.buttons.customize){
186186
h+=beginMenu('cust','wrench');
@@ -192,7 +192,7 @@ return Backbone.View.extend({
192192
} */
193193

194194
}
195-
h+='</ul>'+eUI.html.clearer+'</div>';
195+
h+='</ul>'+dom.html.clearer+'</div>';
196196
return h;
197197
},
198198

@@ -404,7 +404,7 @@ return Backbone.View.extend({
404404
if(cbCancel){
405405
cbs.cancel = cbCancel;
406406
}
407-
eUI.modal.confirm(
407+
dom.modal.confirm(
408408
'isDirty',
409409
i18n.unSavedTitle,
410410
msg,
@@ -450,7 +450,7 @@ return Backbone.View.extend({
450450
},
451451

452452
setIcons: function(mode){
453-
var showOrHide = eUI.showOrHide,
453+
var showOrHide = dom.showOrHide,
454454
importExport = mode==='export' || mode==='import';
455455

456456
function oneMany(mode, showOne, showMany){
@@ -509,7 +509,7 @@ return Backbone.View.extend({
509509
if(!this._filters){
510510
if(orCreate){
511511
var that=this,
512-
$ff=$(eUI.panelEmpty('filters', 'evo-filters', 'info'));
512+
$ff=$(dom.panelEmpty('filters', 'evo-filters', 'info'));
513513
this.$('.evo-toolbar').after($ff);
514514
this._filters = new Evol.ViewAction.Filter({
515515
el: $ff,
@@ -538,7 +538,7 @@ return Backbone.View.extend({
538538
},
539539

540540
_flagFilterIcon: function(fOn){
541-
eUI.addRemClass(this.$('a[data-id="filter"]'), fOn, 'evo-filter-on');
541+
dom.addRemClass(this.$('a[data-id="filter"]'), fOn, 'evo-filter-on');
542542
},
543543

544544
toggleFilter: function(){
@@ -575,7 +575,7 @@ return Backbone.View.extend({
575575
that.setView(that.defaultViewOne);
576576
}
577577
that.curView.setModel(m);
578-
eUI.scroll2Top();
578+
dom.scroll2Top();
579579
}
580580
},
581581
fnError = function(){
@@ -788,7 +788,7 @@ return Backbone.View.extend({
788788
if(skipConfirmation){
789789
fnSuccess();
790790
}else{
791-
eUI.modal.confirm(
791+
dom.modal.confirm(
792792
'delete',
793793
i18n.getLabel('deleteX', entityName),
794794
i18n.getLabel('delete1', entityName, _.escape(entityValue)),
@@ -935,8 +935,8 @@ return Backbone.View.extend({
935935
pIdx=this.pageIndex||0,
936936
$item=this.$('[data-id="prev"]');
937937

938-
eUI.addRemClass($item, pIdx===0, cssDisabled);
939-
eUI.addRemClass($item.next(), (pIdx+1)*this.pageSize>cl, cssDisabled);
938+
dom.addRemClass($item, pIdx===0, cssDisabled);
939+
dom.addRemClass($item.next(), (pIdx+1)*this.pageSize>cl, cssDisabled);
940940
},
941941

942942
_enableNav: function(){

js/dico/ui-charts.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)