dhxmvp
Version:
A complete boilerplate for building online, offline and syncable MVP Single Page Applications using DHTMLX.
1 lines • 3.07 kB
JavaScript
function eXcell_moment_calendar(e){e&&(this.cell=e,this.grid=this.cell.parentNode.grid,eXcell_ed.call(this)),this.setValue=function(e){var t=moment(new Date(e)).isValid()?moment(new Date(e)).calendar():e;null!==e&&"null"!=e?this.setCValue("<span>"+t+"</span> <noscript>"+e+"</noscript>",e):this.setCValue("<span>Not defined yet</span> <noscript></noscript>",null)},this.getValue=function(){return this.cell.childNodes[2].innerHTML}}function eXcell_moment_to(e){e&&(this.cell=e,this.grid=this.cell.parentNode.grid,eXcell_ed.call(this)),this.setValue=function(e){var t=moment(new Date(e)).isValid()?moment().to(new Date(e)):e;null!==e&&"null"!=e?this.setCValue("<span>"+t+"</span> <noscript>"+e+"</noscript>",$dhx.isDate(e)?new Date(e).getTime():e):this.setCValue("<span>Not defined yet</span> <noscript></noscript>",null)},this.getValue=function(){return this.cell.childNodes[2].innerHTML}}function eXcell_moment_from(e){e&&(this.cell=e,this.grid=this.cell.parentNode.grid,eXcell_ed.call(this)),this.setValue=function(e){var t=moment(new Date(e)).isValid()?moment(new Date(e)).from():e;null!==e&&"null"!=e?this.setCValue("<span>"+t+"</span> <noscript>"+e+"</noscript>",e):this.setCValue("<span>Not defined yet</span> <noscript></noscript>",null)},this.getValue=function(){return this.cell.childNodes[2].innerHTML}}function eXcell_moment_fromNow(e){e&&(this.cell=e,this.grid=this.cell.parentNode.grid,eXcell_ed.call(this)),this.setValue=function(e){var t=moment(new Date(e)).isValid()?moment(new Date(e)).fromNow():e;null!==e&&"null"!=e?this.setCValue("<span>"+t+"</span> <noscript>"+e+"</noscript>",$dhx.isDate(e)?new Date(e).getTime():e):this.setCValue("<span>Not defined yet</span> <noscript></noscript>",null)},this.getValue=function(){return this.cell.childNodes[2].innerHTML}}function eXcell_myprice(e){e&&(this.cell=e,this.grid=this.cell.parentNode.grid,eXcell_ed.call(this)),this.setValue=function(e){this.setCValue("<span>"+(+e).formatMoney(2,"US$ ",",",".")+"</span><noscript>"+e+"</noscript>",e)},this.getValue=function(){return this.cell.childNodes[1].innerHTML}}eXcell_moment_calendar.prototype=new eXcell,eXcell_moment_to.prototype=new eXcell,eXcell_moment_from.prototype=new eXcell,eXcell_moment_fromNow.prototype=new eXcell,eXcell_myprice.prototype=new eXcell;var simple_text=function(e,t){return"<div>"+t+"</div>"},simple_italic=function(e,t){return"<div style='color:#A6ACB2;'>"+t+"</div>"},moment_to=function(e,t){return null===t||"null"==t?"":"<div>"+t.split(".")[0].toString().replace(/T/gi," ")+" - "+moment().to(new Date(t))+"</div>"},moment_fromNow=function(e,t){return null===t||"null"==t?"":"<div>"+t.split(".")[0].toString().replace(/T/gi," ")+" - "+moment(new Date(t)).fromNow()+"</div>"},myprice=function(e,t){return"<div>"+(+t).formatMoney(2,"US$ ",",",".")+"</div>"},bold_text=function(e,t){return"<div class='simple_bold'>"+t+"</div>"},format_b=function(e,t){return"<div class='simple_link'>"+t+"</div>"},featureList=function(e){return'<div class="skill_set">'+e.map(function(e){return'<div class="form_skill">'+e+"</div>"}).join("")+"</div>"};