Pman.js
[Pman.Core] / Pman.js
1 //<script type="text/javascript">
2
3 /**
4  * 
5  * >>> Pman.layout.getRegion('center').tabs.stripWrap
6  * ==> tab.???
7  * var tbh = Pman.layout.getRegion('center').tabs.stripWrap.child('div').createChild(
8  * 
9  * {tag: 'div', style: 'display:block;position:absolute;top:2;left:300;width:100%;height:25px'});
10  * 
11  * 
12  *  CHANGES
13  *  - gtranslate moved to Pman.GoogleTranslate
14  * 
15  * 
16  */
17  
18 if (typeof(_T) == 'undefined') { _T={};}
19  
20
21
22   
23
24 Pman = new Roo.Document(
25 {
26    /// appVersion: '1.7', // fixme = needs to be removed - use Global AppVersion
27     subMenuItems : [],
28     topMenuItems : [],
29     rightNames: { }, /// register right names here - so they can be translated and rendered.
30     /**
31      * @property {Roo.menu.Menu} pulldownMenu - the 'add menu pulldown, you can use it to add items..
32      *
33      */
34     pulldownMenu : false, 
35     
36     
37     buildCompleted : false, // flag to say if we are building interface..
38     events : {
39         'beforeload' : true, // fired after page ready, before module building.
40         'load' : true, // fired after module building
41         'authrefreshed' : true // fire on auth updated?? - should be on Login?!?!?
42     },
43     
44     listeners : {
45         'ready' : function()
46         {
47             // kludge to fix firebug debugger
48             if (typeof(console) == 'undefined') {
49                 console = { log : function() {  } };
50             }
51             
52             // remove loader..
53             if (Roo.get('loading')) {
54                 Roo.get('loading').remove();
55             }
56             
57             Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
58             
59             // link errors...
60             
61             if (AppLinkError.length) {
62                 Roo.MessageBox.alert("Error", AppLinkError, function() {
63                     Pman.Login.onLoad();
64                 });
65                 return;
66             }
67             
68             
69             // reset password!!!!
70             if (showNewPass.length) {
71                 Pman.PasswordChange.show(  { passwordReset : showNewPass },
72                     function(data) {
73                         // fail and success we do  a load...
74                         Pman.Login.onLoad();
75                     }
76                 );
77                 return;
78             }
79              
80             Pman.Login.onLoad();
81             
82         },
83         'load' : function()
84         {
85             if (Roo.get('loading-logo-tile')) {
86                 Roo.get('loading-logo-tile').remove();
87             }
88             if (Roo.get('loading-logo-tile-top')) {
89                 Roo.get('loading-logo-tile-top').remove();
90             }
91             if (Roo.get('loading-logo-bottom')) {
92                 Roo.get('loading-logo-bottom').remove();
93             }
94             if (Roo.get('loading-logo-center')) {
95                 Roo.get('loading-logo-center').remove();
96             }
97         }   
98         
99     },
100    
101
102     
103     layout: false,
104     
105     onload: function() {
106         //this.fireEvent('beforeload',this);
107         
108         
109         
110         if (this.layout) {
111             return; // already loaded
112         } 
113         if (Roo.get('loading')) {
114             Roo.get('loading').remove();
115         }
116         if (Roo.get('loading-mask')) {
117             Roo.get('loading-mask').show();
118         }
119         
120         
121        
122         
123         /*
124         Roo.MessageBox.show({
125            title: "Please wait...",
126            msg: "Building Interface...",
127            width:340,
128            progress:true,
129            closable:false
130           
131         });
132         */
133         //Pman.onLoadBuild();
134         //Roo.get(document.body).mask("Building Interface");
135         //Pman.onLoadBuild.defer(100, Pman);
136        //Pman.onLoadBuild();
137                     
138    // },
139     //onLoadBuild : function() {
140         
141         var _this = this;
142         this.stime = new Date();
143         this.layout = new Roo.BorderLayout(document.body, {
144             north: {
145                 split:false,
146                 initialSize: 25,
147                 titlebar: false
148             },
149          
150              
151             center: {
152                 titlebar: false,
153                 autoScroll:false,
154                 closeOnTab: true,
155                 tabPosition: 'top',
156                 //resizeTabs: true,
157                 alwaysShowTabs: true,
158                 minTabWidth: 140
159             } ,
160             south: {
161                 collapsible : true,
162                 collapsed : true,
163                 split:false,
164                 height: 120,
165                 titlebar: false 
166             }
167             
168         });
169         
170         this.fireEvent('beforeload',this);
171         
172         
173         
174         this.layout.beginUpdate();
175         this.layout.add('north', new Roo.ContentPanel('title', 'North'));
176         var au = Pman.Login.authUser;
177         if (au.id > 0 && au.company_id_background_color && au.company_id_background_color.length) {
178             Roo.get('title').dom.style.backgroundColor = '#' + au.company_id_background_color;
179             Roo.get('headerInformation').dom.style.color = this.invertColor('#' + au.company_id_background_color);
180         }
181         if (au.id > 0 && au.company_id_logo_id * 1 > 0) {
182             Roo.get('headerInformation-company-logo').dom.src =  baseURL + 
183                 '/Images/' + au.company_id_logo_id + '/' + au.company_id_logo_id_filename;
184         } else {
185             Roo.get('headerInformation-company-logo').dom.src = Roo.BLANK_IMAGE_URL;
186         }
187         
188         Roo.get('headerInformation').dom.innerHTML = String.format(
189                 "You are Logged in as <b>{0} ({1})</b>", // to {4} v{3}", // for <b>{2}</b>",
190                 au.name, au.email, au.company_id_name, 
191                 AppVersion , appNameShort
192         );
193         
194         
195         document.title = appName + ' v' + AppVersion + ' - ' + au.company_id_name;
196         Roo.QuickTips.init(); 
197         if (Roo.isGecko) {
198            Roo.useShims = true;
199         }
200        
201         //this.mainLayout.beginUpdate();
202         //var maskDom = Roo.get(document.body)._maskMsg.dom
203         this.layout.beginUpdate();
204         
205         Pman.building = true;
206         
207         this.buildModules(this, 
208             function() {
209                 
210                 _this.layout.getRegion('center').showPanel(0);
211                 _this.layout.endUpdate(); 
212                 _this.addTopToolbar();  
213                 _this.finalize();
214                 _this.fireEvent('load',this);
215                 
216                 if (!_this.layout.getRegion('south').panels.length) {
217                     _this.layout.getRegion('south').hide();
218                 }
219                 
220                 
221             }
222         );
223         
224         
225      
226     },
227     
228     addTopToolbar : function()
229     {
230           //console.log( "t6:" + ((new Date())-stime));
231         //this.mainLayout.endUpdate();
232         // make a new tab to hold administration stuff...
233         
234        
235         //console.log( "t7:" + ((new Date())-stime));
236         var se = Pman.layout.getRegion('center').tabs.stripEl;
237         var tbh = se.createChild( 
238                 { tag: 'td', style: 'width:100%;'  });
239         
240         var lotb = new Roo.Toolbar(tbh);
241         
242         if (Roo.isSafari) {
243             var tbl = se.child('table', true);
244             tbl.setAttribute('width', '100%');
245         }
246         lotb.add(
247             new Roo.Toolbar.Fill(), 
248      
249             {
250                 text: "Change Password",
251                 cls: 'x-btn-text-icon',
252                 icon: rootURL + '/Pman/templates/images/change-password.gif',
253                 handler : function(){
254                     Pman.PasswordChange.show({});
255                 }
256             }, '-'
257         );
258          
259         
260         if (this.topMenuItems.length) {
261             
262             Roo.each(this.topMenuItems, function (mi) {
263                 lotb.add(mi);
264             });
265             lotb.add('-');
266         }
267         
268         
269         
270         if (this.subMenuItems.length) {
271             
272             this.subMenuItems.sort(function (a,b) {
273                 return a.seqid > b.seqid ? 1 : -1;
274             });
275             // chop off last seperator.
276             // since we always add it.. just chop of last item
277             this.subMenuItems.pop(); 
278             
279             this.pulldownMenu = lotb.add(
280                 {
281                      
282                     text: "Add New Item",
283                     cls: 'x-btn-text-icon',
284                     icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
285                     menu : {
286                         items : this.subMenuItems
287                     }     
288                 } ,'-'
289             );
290         }
291        
292         lotb.add(
293             {
294                 text: "Logout",
295                 cls: 'x-btn-text-icon',
296                 icon: rootURL + '/Pman/templates/images/logout.gif',
297                 handler: function() {
298                     Pman.Login.logout();
299                 }
300                  
301             }
302         );
303       
304        // this.layout.endUpdate();
305     },
306     
307     
308     finalize : function() {
309         
310       
311        
312         window.onbeforeunload = function(e) { 
313             e = e || window.event;
314             var r = "Closing this window will loose changes, are you sure you want to do that?";
315
316             // For IE and Firefox
317             if (e) {
318                 e.returnValue = r;
319             }
320
321             // For Safari
322             return r;
323             
324         };
325         
326         Roo.MessageBox.hide();
327         if (Roo.get('loading-mask')) {
328            Roo.get('loading-mask').remove();
329         }
330         
331         
332         this.buildCompleted = true; // now we can force refreshes on everything..
333         
334         
335         // does the URL indicate we want to see a system..
336         if (AppTrackOnLoad * 1 > 0) {
337             this.onLoadTrack(AppTrackOnLoad,false);
338         }
339         
340         // Open system..
341         
342         var forceAdmin = function(data)
343         {
344             if (!data || !data.id) {
345                 //Roo.log("Force Admin");
346                 Pman.Dialog.PersonStaff.show( 
347                     { 
348                         id : 0, 
349                         company_id : Pman.Login.authUser.company_id_id * 1, 
350                         company_id_name : Pman.Login.authUser.company_id_name
351                     }, function(data) {
352                         forceAdmin(data);
353                     }
354                 );
355                 return;
356             }
357             Roo.state.Manager.set('Pman.Login.username', data.email),
358             window.onbeforeunload = false;
359             document.location = baseURL + '?ts=' + Math.random();
360         }
361         
362         var forceCompany = function(data) {
363             if (Pman.Login.authUser.company_id * 1 > 0) {
364                 forceAdmin();
365                 return;
366             }
367             if (!data || !data.id) {
368                 Pman.Dialog.Companies.show( { id : 0, isOwner : 1, comptype: 'OWNER' }, function(data) {
369                     forceCompany(data);
370                 });
371                 return;
372             }
373             Pman.Login.authUser.company_id_id  = data.id;
374             Pman.Login.authUser.company_id  = data.id;
375             Pman.Login.authUser.company_id_name  = data.name;
376             forceAdmin();
377         }
378         
379         if (Pman.Login.authUser.id < 0) {
380             // admin company has been created - create the user..
381             if (Pman.Login.authUser.company_id_id* 1 > 0) {
382                 forceAdmin();
383                 return;
384             }
385             
386             forceCompany();
387             /// create account..
388             
389             
390         }
391         
392
393     },
394     
395     
396     // REMOVE THESE 
397     
398      
399     onLoadTrack : function(id,cb) {
400         this.onLoadTrackCall(id, cb, 'DocumentsCirc_');
401     },
402     onLoadTrackEdit : function(id,cb) {
403         this.onLoadTrackCall(id, cb, 'Documents_');
404     },
405     
406     
407     /// ----------- FIXME -----
408     
409     
410     onLoadTrackCall : function(id,cb, cls) {
411         Roo.get(document.body).mask("Loading Document details");
412
413         Pman.request({
414             url: baseURL + '/Roo/Documents.html',  
415             params: {
416                 _id: id
417             },  
418             method: 'GET',  
419             success : function(data) {
420                 Roo.get(document.body).unmask();
421              
422                 
423                 switch(data.in_out) {
424                     case 'IN' : cls+='In';break;
425                     case 'OUT' : cls+='Out';break;
426                     case 'WIP' : cls+='Wip';break;
427                     default: 
428                         Roo.MessageBox.alert("Error", "invalid in_out");
429                         return;
430                 }
431                 Pman.Dialog[cls].show(data, cb ? cb : Pman.refreshActivePanel);
432             }, 
433             
434             failure: function() {
435                 Roo.get(document.body).unmask();
436                 //if (cb) {
437                 //    cb.call(false);
438                 //}
439                  
440            }
441         });
442           
443     },
444     
445     refreshActivePanel : function() {
446         var actpan = this.layout.getRegion('center').getActivePanel();
447         if (actpan.controller && actpan.controller.paging) {
448             actpan.controller.paging.onClick('refresh');
449             return;
450         }
451         
452         var agid = Pman.layout.getRegion('center').getActivePanel().id;
453         if (!agid) {
454             return;
455         }
456         Pman.Tab[agid].paging.onClick('refresh');
457     },
458     toCidV : function(data) {
459         return 'C' + data.in_out.substring(0,1) + data.cid;
460     },
461     
462     
463     /**
464      * eg. has Pman.hasPerm('Admin.Admin_Tab', 'S') == showlist..
465      * 
466      */
467     hasPerm: function(name, lvl) {
468         if (
469             (typeof(Pman.Login.authUser) != 'object')
470             ||
471             (typeof(Pman.Login.authUser.perms) != 'object')
472             ||
473             (typeof(Pman.Login.authUser.perms[name]) != 'string')
474             ) {
475                 return false;
476         }
477         
478         return Pman.Login.authUser.perms[name].indexOf(lvl) > -1;
479         
480     },
481     
482     
483     
484     
485     
486     
487     
488     
489     Readers : {},
490     ColModels : {},
491     Forms : {},
492     Tab : {},
493     Dialog : {},
494     
495     processResponse : function (response)
496     {
497         var res = '';
498         try {
499             res = Roo.decode(response.responseText);
500             // oops...
501             if (typeof(res) != 'object') {
502                 res = { success : false, errorMsg : res, errors : true };
503             }
504             if (typeof(res.success) == 'undefined') {
505                 res.success = false;
506             }
507             
508         } catch(e) {
509             res = { success : false,  errorMsg : response.responseText, errors : true };
510         }
511         return res;
512     },
513     genericDelete : function(tab,tbl) {
514         
515         var r = [];
516         
517             
518         var s = tab.grid.getSelectionModel().getSelections();
519         if (!s.length)  {
520             Roo.MessageBox.alert("Error", "Select at least one Row to delete" );
521             return '';
522         }
523         
524         for(var i = 0; i < s.length; i++) {
525             r.push(s[i].data.id);
526         }
527     
528         Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
529             function(btn) {
530                 if (btn != 'yes') {
531                     return;
532                 }
533                 // what about the toolbar??
534                 tab.grid.getView().mainWrap.mask("Deleting");
535                 Pman.request({
536                     url: baseURL + '/Roo/'+tbl+'.php',
537                     method: 'GET',
538                     params: {
539                         _delete : r.join(',')
540                     },
541                     success: function(response) {
542                         tab.grid.getView().mainWrap.unmask();
543                         if ( tab.paging ) {
544                             tab.paging.onClick('refresh');   
545                         } else if (tab.refresh) {
546                             tab.refresh();
547                         } else if (tab.grid.footer && tab.grid.footer.onClick) {
548                             // new xtype built grids
549                             tab.grid.footer.onClick('refresh');   
550                         } else {
551                             tab.grid.getDataSource().load();
552                         }
553                         
554                         
555                         
556                     },
557                     failure: function(act) {
558                         tab.grid.getView().mainWrap.unmask();
559                         Roo.MessageBox.alert("Error", "Error Deleting");
560                     }
561                     
562                 });
563             }
564             
565         );
566         return '';
567     },
568     
569     
570     standardActionFailed :  function(f, act, cb) {
571     
572         if (act.failureType == 'client') {
573             Roo.MessageBox.alert("Error", "Please Correct all the errors in red", cb);
574             return;
575         }
576         if (act.failureType == 'connect') {
577             Roo.MessageBox.alert("Error", "Problem Connecting to Server - please try again.", cb);
578             return;
579         }
580         
581         if (act.type == 'submit') {
582             
583             Roo.MessageBox.alert("Error", typeof(act.result.errorMsg) == 'string' ?
584                 String.format('{0}', act.result.errorMsg) : 
585                 "Saving failed = fix errors and try again", cb);
586             return;
587         }
588         
589         // what about load failing..
590         Roo.MessageBox.alert("Error", "Error loading details",cb); 
591     },
592     /**
593      * Depreciated - USE new Pman.Request
594     * 
595      * 
596      */
597     request : function(c) {
598         var r= new Roo.data.Connection({
599             timeout : typeof(c.timeout) == 'undefined' ?  30000 : c.timeout
600         });
601         r.request({
602             url: c.url,
603             method : c.method,
604             params: c.params,
605             xmlData : c.xmlData,
606             success:  function(response, opts)  {  // check successfull...
607                
608                 var res = Pman.processResponse(response);
609                 
610                 if (!res.success) { // error!
611                     if (c.failure) {
612                         if (true === c.failure.call(this,response, opts)) {
613                             return;
614                         }
615                     }
616                     Roo.MessageBox.hide();
617                     Roo.MessageBox.alert("Error", res.errorMsg ? res.errorMsg : "Error Sending");
618                     return;
619                 }
620                 
621                 c.success.call(this, res.data);
622                 
623                 return; 
624             },
625             failure :  function(response, opts)  {  // check successfull...
626                 
627                 if (c.failure) {
628                     if (true === c.failure.call(this,response, opts)) {
629                         return;
630                     }
631                 }
632                 Roo.MessageBox.hide();
633                 Roo.MessageBox.alert("Error", "Connection timed out sending");
634                 Roo.log(response);
635                 
636             },
637             scope: this
638             
639         });
640     },
641     
642     
643     // depreciated - use Pman.Download()
644     
645     download : function(c) {
646         
647         return new Pman.Download(c);
648     },
649     
650     // fixme - move to document manager...
651     downloadRevision : function(doc, rev)
652     {
653         this.download({
654             url: baseURL + '/Documents/Doc/DownloadRev/'+ doc.id + '/' + rev + '/' +
655                 doc.project_id_code + '-' + doc.cidV + '-' + rev  + '-' +  doc.filename
656         }); 
657                     
658     },
659     
660     
661     exportCSV : function(c) {
662         
663         for(var i=0;i < c.csvFormat.length;i++) {
664             c.params['csvCols['+i+']'] = c.csvFormat[i][0];
665             c.params['csvTitles['+i+']'] = c.csvFormat[i][1];
666         }
667         c.url +=  '?' + Roo.urlEncode(c.params);
668         this.download(c);
669
670     },
671     
672     
673     prettyDate : function (value) 
674     {
675         if (typeof(value) == 'string') {
676             var ds = Date.parseDate(value, 'Y-m-d H:i:s');
677             if (ds) {
678                 return this.prettyDate(ds);
679             }
680             ds = Date.parseDate(value, 'Y-m-d');
681             if (ds) {
682                 return this.prettyDate(ds);
683             }
684             return '';
685         }
686 // last 7 days...
687         if (!value) {
688             return '';
689         }
690         var td = new Date();
691         var daysSince = Math.floor(td.getElapsed(value) / (1000 * 60*60*24));
692         if (daysSince < 7) {
693             return value.dateFormat('D H:i');
694         }
695         
696         // same month
697         if (td.dateFormat('m') == value.dateFormat('m')) {
698             return value.dateFormat('dS D');
699         }
700         // same year?
701         if (td.dateFormat('Y') == value.dateFormat('Y')) {
702             return value.dateFormat('dS M');
703         }
704         return value.dateFormat('d M Y');
705     },
706     loadException : function(a,b,c,d)
707     {
708         if (d && d.authFailure) {
709             Pman.Login.show();
710             return;
711         }
712         Roo.MessageBox.alert("Problem Loading Data", a.message || c.statusText);
713     },
714     
715     
716     /**
717      * 
718      * Routine to flash alerts in the title bar..
719      * 
720      * 
721      */
722     
723     notifyActive : false,
724     
725     notifyTitle: function(msg)
726     {
727         if (this.notifyActive ) {
728             return;
729         }
730         var stop = false;
731         
732         var stopper = function() {
733             stop = true;
734              document.title = oldtitle;
735         };
736         
737         Roo.get(document.body).on('mousemove', stopper, this);
738         var oldtitle = document.title;
739         var s = 1;
740         var _this = this;
741         var ivl = window.setInterval(function() {
742             
743             if (stop) {
744                 Roo.get(document.body).un('mousemove', stopper, this);
745                 _this.notifyActive = false;
746                 document.title = oldtitle;
747                 window.clearInterval(ivl);
748                 return true;
749             }
750             s = !s;
751             document.title = s ? msg : oldtitle;
752             return false;     
753         }, 1000); // every 120 secs = 2mins..
754          document.title =   msg;
755         
756         
757         
758     },
759     
760     modules : false,
761     /**
762      * example:
763      * 
764      * Pman.register({
765           modKey : '00-admin-xxxx',
766           module : Pman.Tab.projectMgr,
767           moduleName : 'Pman.Tab.projectMgr',
768           region : 'center',
769           parent : Pman.layout
770         })
771      * 
772      */
773     register : function(obj)
774     {
775         
776         // ignore registration of objects which are disabled.
777         appDisabled = typeof(appDisabled) == 'undefined' ? [] : appDisabled;
778         
779         if ((typeof(obj.moduleName) != 'undefined')
780                 && appDisabled.indexOf(obj.moduleName) > -1)
781         {
782             return;
783         }
784         
785         if (!obj.parent) {
786             if (obj.parent === false) {
787                 //console.log('skip module (no parent)' + obj.modkey);
788                 return;
789             }
790             // this is an error condition - the parent does not exist..
791             // technically it should not happen..
792             console.log(obj);
793         }
794         if (!obj.parent.modules) {
795             obj.parent.modules = new Roo.util.MixedCollection(false, function(o) { return o.modKey });
796         }
797         
798         obj.parent.modules.add(obj);
799         
800     },
801     
802     buildModules : function(parent, onComplete) 
803     {
804         
805         var _this = this;
806         var cmp = function(a,b) {   
807             return String(a).toUpperCase() > String(b).toUpperCase() ? 1 : -1;
808             
809         };
810         if (!parent.modules) {
811             return;
812         }
813         parent.modules.keySort('ASC',  cmp );
814         var mods = [];
815         
816         
817         // add modules to their parents..
818         var addMod = function(m) {
819            // console.log(m.modKey);
820             
821             mods.push(m);
822             if (m.module.modules) {
823                 m.module.modules.keySort('ASC',  cmp );
824                 m.module.modules.each(addMod);
825             }
826             if (m.finalize) {
827                 m.finalize.name = m.name + " (clean up) ";
828                 mods.push(m.finalize);
829             }
830             
831         }
832  
833         parent.modules.each(addMod);
834         //this.allmods = mods;
835         //console.log(mods);
836         //return;
837         if (!mods.length) {
838             if (onComplete) onComplete();
839             return;
840         }
841         // flash it up as modal - so we store the mask!?
842         Roo.MessageBox.show({ title: 'loading' });
843         Roo.MessageBox.show({
844            title: "Please wait...",
845            msg: "Building Interface...",
846            width:450,
847            progress:true,
848            closable:false,
849            modal: false
850           
851         });
852         var n = 0;
853         var progressRun = function() {
854             
855             var mod = mods[n];
856             
857             
858             Roo.MessageBox.updateProgress(
859                 (n+1)/mods.length,  "Building Interface " + (n+1) + 
860                     " of " + mods.length + 
861                     (mod.name ? (' - ' + mod.name) : '')
862                     );
863             
864             
865             
866             if (typeof(mod) == 'function') {
867                 mod();
868                 
869             } else  if (mod.parent.layout && !mod.module.disabled) {
870                 // honour permname setings..
871                 if (mod.permname && mod.permname.length) {
872                     if (Pman.hasPerm(mod.permname, 'S')) {
873                         mod.module.add(mod.parent.layout, mod.region);    
874                     }
875                 } else {
876                     mod.module.add(mod.parent.layout, mod.region);    
877                 }
878                     
879                  
880             }
881             
882             
883             n++;
884             if (n >= mods.length) {
885                 onComplete();  
886                 return;
887             }
888                 
889             
890             progressRun.defer(10, Pman);    
891         }
892         progressRun.defer(1, Pman);
893      
894         
895         
896     },
897     
898     invertColor : function(c)
899     {
900         // read..
901         var ca = [];
902         for(var i = 0; i < 3; i++){
903             ca[i] = parseInt(c.charAt((i*2)+1) + c.charAt((i*2)+2), 16);
904         }
905             
906         // invert..
907         var col = '';
908         Roo.each(ca, function(hi) {
909             var h = parseInt(255-hi).toString(16);
910             if(h < 16){
911                 h = '0' + h;
912             }
913             col += h;
914         });
915         return '#' + col;
916         
917     }
918     
919     
920     
921     
922     
923     
924     
925 });
926