Skip to content

Commit 5417467

Browse files
committed
Cleanups.
1 parent f47b3cf commit 5417467

7 files changed

Lines changed: 68 additions & 43 deletions

File tree

dist/css/demo.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
.evo-head-links2 > li > a.sel {
8686
color: white;
8787
}
88+
.evo-link2 li li {
89+
margin-left: -12px;
90+
}
8891
@media only screen and (max-width: 900px) {
8992
.evo-link2 {
9093
order: 100;
@@ -199,8 +202,12 @@
199202
-moz-box-shadow: 4px 4px 2px rgba(0, 0, 0, 0.25);
200203
-webkit-box-shadow: 4px 4px 2px rgba(0, 0, 0, 0.25);
201204
}
202-
.pixEvoView {
203-
margin: 20px 0;
205+
.pixEvoView,
206+
.pixEvoPos {
207+
margin: 10px 0 10px 20px;
208+
}
209+
.pixEvoPos img {
210+
width: 250px;
204211
}
205212
.evo-content3 > p > img {
206213
width: 500px;

dist/evolutility.js

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ Evol.Dico = function(){
744744
formula:'formula', // soon to be a field attribute rather than a field type
745745
email: 'email',
746746
pix: 'image',
747+
//geoloc: 'geolocation',
747748
//doc:'document',
748749
url: 'url',
749750
color: 'color',
@@ -861,7 +862,6 @@ return {
861862
h+='<div id="'+fid+'" class="form-control evol-ellipsis">'+fld.formula()+'</div>';
862863
break;
863864
case fts.color: // TODO is the color switch necessary?
864-
//h+=uiInput.colorBox(fid, fv)+fv;
865865
h+='<div id="'+fid+'" class="form-control">'+uiInput.colorBox(fid, fv)+'</div>';
866866
break;
867867
default:
@@ -1721,7 +1721,7 @@ return Backbone.View.extend({
17211721
},
17221722

17231723
_render: function (models) {
1724-
alert('_render must be overwritten');
1724+
alert('_render must be overridden');
17251725
},
17261726

17271727
_HTMLField: function (f, v) {
@@ -2168,6 +2168,10 @@ Evol.ViewMany.Cards = Evol.ViewMany.extend({
21682168

21692169
viewName: 'cards',
21702170

2171+
fieldsetFilter: function (f) {
2172+
return f.inMany || f.inCards;
2173+
},
2174+
21712175
_render: function (models) {
21722176
var pSize = this.pageSize || 50,
21732177
pSummary = this.pageSummary(0, pSize, models.length);
@@ -2208,7 +2212,7 @@ Evol.ViewMany.Cards = Evol.ViewMany.extend({
22082212
if (idx === 0) {
22092213
h.push('<div data-mid="'+model.id+'">');
22102214
// Item badge
2211-
var bf=that.uiModel.badge;
2215+
var bf=that.uiModel.fnBadge;
22122216
if(bf){
22132217
h.push('<span class="badge pull-right">');
22142218
if(_.isFunction(bf)){
@@ -2261,14 +2265,20 @@ Evol.ViewMany.Cards = Evol.ViewMany.extend({
22612265
// Quick and easy implementation w/ the old version of google charts
22622266
// must be re-written to use D3.js or other cool stuff
22632267

2264-
Evol.ViewMany.Charts = Evol.ViewMany.extend({
2268+
Evol.ViewMany.Charts = function() {
2269+
2270+
var EvoUI = Evol.UI,
2271+
EvoDico = Evol.Dico,
2272+
i18n = Evol.i18n;
2273+
2274+
return Evol.ViewMany.extend({
22652275

22662276
viewName: 'charts',
22672277

22682278
options: {
22692279
//sizes: '600x300',
22702280
style: 'panel-info',
2271-
fieldsetFilter: Evol.Dico.fieldInCharts,
2281+
fieldsetFilter: EvoDico.fieldInCharts,
22722282
autoUpdate: false
22732283
},
22742284

@@ -2278,22 +2288,19 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
22782288
},
22792289

22802290
render: function () {
2281-
this.entityName=Evol.UI.capitalize(this.uiModel.namePlural);
2291+
this.entityName=EvoUI.capitalize(this.uiModel.namePlural);
22822292
if(this.collection && this.collection.length>0){
22832293
this.$el.html('<div class="evol-many-'+this.viewName+'">'+
22842294
this._HTMLcharts(this.style || 'panel-info', this.sizes)+
22852295
'</div>');
22862296
}else{
2287-
this.$el.html(Evol.UI.HTMLMsg(Evol.i18n.nodata, '', 'info'));
2297+
this.$el.html(EvoUI.HTMLMsg(i18n.nodata, '', 'info'));
22882298
}
22892299
return this.setTitle();
22902300
},
22912301

22922302
_HTMLcharts: function (style, sizes) {
22932303
var h='',
2294-
EvoUI = Evol.UI,
2295-
EvoDico = Evol.Dico,
2296-
i18n = Evol.i18n,
22972304
fTypes = EvoDico.fieldTypes,
22982305
uiModel = this.uiModel,
22992306
models = this.collection.models,
@@ -2381,11 +2388,10 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
23812388
},
23822389

23832390
changeChartType: function(evt){
2384-
var i18n = Evol.i18n,
2385-
el=$(evt.currentTarget),
2391+
var el=$(evt.currentTarget),
23862392
id=el.data('id'),
23872393
ctype=el.data('ctype'),
2388-
chart=Evol.UI.Charts,
2394+
chart=EvoUI.Charts,
23892395
oldData=this._cData[id],
23902396
f=oldData.field,
23912397
holder=el.parent().find('.chart-holder');
@@ -2399,6 +2405,8 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
23992405
}
24002406

24012407
});
2408+
2409+
}();
24022410
;
24032411
/*! ***************************************************************************
24042412
*
@@ -2450,7 +2458,7 @@ Evol.ViewMany.List = Evol.ViewMany.extend({
24502458
HTMLItem: function(h, fields, model, icon, selectable, route){
24512459
var that = this,
24522460
v,
2453-
bf = that.uiModel.badge,
2461+
bf = that.uiModel.fnBadge,
24542462
link = (this.links!==false),
24552463
ft = Evol.Dico.fieldTypes;
24562464

@@ -3173,8 +3181,7 @@ return Backbone.View.extend({
31733181
_.each(vs, function(row, idx){
31743182
h.push('<tr data-idx="'+idx+'">');
31753183
if(editable){
3176-
that._TDsFieldsEdit(h, uiPnl.elements, row);
3177-
h.push(TDbPM);
3184+
h.push(that._TDsFieldsEdit(uiPnl.elements, row)+TDbPM);
31783185
}else{
31793186
_.each(fs, function (f) {
31803187
h.push('<td>');
@@ -3206,18 +3213,18 @@ return Backbone.View.extend({
32063213
'</td></tr>';
32073214
},
32083215

3209-
_TDsFieldsEdit: function(h, fs, m){
3210-
var fv,
3216+
_TDsFieldsEdit: function(fs, m){
3217+
var h='',
3218+
fv,
32113219
iconPath=this.iconPath;
32123220
_.each(fs, function (f) {
32133221
fv=m[f.id];
32143222
if(_.isUndefined(fv)){
32153223
fv='';
32163224
}
3217-
h.push('<td>'+
3218-
eDico.fieldHTML(f, f.id, fv, 'edit-details', iconPath, true)+
3219-
'</td>');
3225+
h+='<td>'+eDico.fieldHTML(f, f.id, fv, 'edit-details', iconPath, true)+'</td>';
32203226
});
3227+
return h;
32213228
},
32223229

32233230
renderField: function (h, f, mode, iconsPath, skipLabel) {
@@ -3644,16 +3651,16 @@ return Backbone.View.extend({
36443651
evt.stopImmediatePropagation();
36453652
if(bId==='bPlus'){
36463653
// - Add row to details
3647-
var h=[],
3654+
var h='',
36483655
subCollecs=this.getSubCollecs(),
36493656
mid=tr.closest('table').data('mid'),
36503657
elems=(subCollecs[mid])?subCollecs[mid].elements:null;
3651-
h.push('<tr>');
3652-
this._TDsFieldsEdit(h, elems, {});
3653-
h.push('<td class="evo-td-plusminus">'+
3658+
h+='<tr>'+
3659+
this._TDsFieldsEdit(elems, {})+
3660+
'<td class="evo-td-plusminus">'+
36543661
eUI.buttonsPlusMinus()+
3655-
'</td></tr>');
3656-
$(h.join('')).insertAfter(tr);
3662+
'</td></tr>';
3663+
$(h).insertAfter(tr);
36573664
if(tr.data('id')==='nodata'){
36583665
tr.remove();
36593666
}
@@ -6129,7 +6136,7 @@ return Backbone.View.extend({
61296136
searchString=$('.evo-search>input').val().toLowerCase(),
61306137
searchFunction = function(sString){
61316138
return function(model){
6132-
return that.uiModel.searchfn(model, sString);
6139+
return that.uiModel.fnSearch(model, sString);
61336140
};
61346141
},
61356142
collec;

dist/evolutility.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/many-cards.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Evol.ViewMany.Cards = Evol.ViewMany.extend({
1313

1414
viewName: 'cards',
1515

16+
fieldsetFilter: function (f) {
17+
return f.inMany || f.inCards;
18+
},
19+
1620
_render: function (models) {
1721
var pSize = this.pageSize || 50,
1822
pSummary = this.pageSummary(0, pSize, models.length);

js/many-charts.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212
// Quick and easy implementation w/ the old version of google charts
1313
// must be re-written to use D3.js or other cool stuff
1414

15-
Evol.ViewMany.Charts = Evol.ViewMany.extend({
15+
Evol.ViewMany.Charts = function() {
16+
17+
var EvoUI = Evol.UI,
18+
EvoDico = Evol.Dico,
19+
i18n = Evol.i18n;
20+
21+
return Evol.ViewMany.extend({
1622

1723
viewName: 'charts',
1824

1925
options: {
2026
//sizes: '600x300',
2127
style: 'panel-info',
22-
fieldsetFilter: Evol.Dico.fieldInCharts,
28+
fieldsetFilter: EvoDico.fieldInCharts,
2329
autoUpdate: false
2430
},
2531

@@ -29,22 +35,19 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
2935
},
3036

3137
render: function () {
32-
this.entityName=Evol.UI.capitalize(this.uiModel.namePlural);
38+
this.entityName=EvoUI.capitalize(this.uiModel.namePlural);
3339
if(this.collection && this.collection.length>0){
3440
this.$el.html('<div class="evol-many-'+this.viewName+'">'+
3541
this._HTMLcharts(this.style || 'panel-info', this.sizes)+
3642
'</div>');
3743
}else{
38-
this.$el.html(Evol.UI.HTMLMsg(Evol.i18n.nodata, '', 'info'));
44+
this.$el.html(EvoUI.HTMLMsg(i18n.nodata, '', 'info'));
3945
}
4046
return this.setTitle();
4147
},
4248

4349
_HTMLcharts: function (style, sizes) {
4450
var h='',
45-
EvoUI = Evol.UI,
46-
EvoDico = Evol.Dico,
47-
i18n = Evol.i18n,
4851
fTypes = EvoDico.fieldTypes,
4952
uiModel = this.uiModel,
5053
models = this.collection.models,
@@ -132,11 +135,10 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
132135
},
133136

134137
changeChartType: function(evt){
135-
var i18n = Evol.i18n,
136-
el=$(evt.currentTarget),
138+
var el=$(evt.currentTarget),
137139
id=el.data('id'),
138140
ctype=el.data('ctype'),
139-
chart=Evol.UI.Charts,
141+
chart=EvoUI.Charts,
140142
oldData=this._cData[id],
141143
f=oldData.field,
142144
holder=el.parent().find('.chart-holder');
@@ -150,3 +152,5 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
150152
}
151153

152154
});
155+
156+
}();

js/ui-models/apps/contacts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ uiModels.contact = {
327327
elements: [
328328
{
329329
type: 'text', id: 'lastname', label: 'Lastname', maxLength: 50,
330-
required: true, width: '62', inMany: true
330+
required: true, width: 62, inMany: true
331331
},
332332
{
333333
type: 'text', id: 'firstname', label: 'Firstname', maxLength: 50,

less/header.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
}
103103
}
104104
.evo-link2{
105+
li li{
106+
margin-left:-12px;
107+
}
105108
@media only screen and (max-width: @screen2) {
106109
order: 100;
107110
width:100%;

0 commit comments

Comments
 (0)