@@ -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;
0 commit comments