X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-mailer-debug.js;h=6b172f916bd42a05f5c55d3111430388c97b102c;hp=cec8343fb40caf4d6805442d1af531ae08578ca9;hb=c47e24f9bde6e0a7a5994c0024daa13e7e4df117;hpb=b10bb1b6744885bf5f871c6c0d97fbd99a4c39cf diff --git a/roojs-mailer-debug.js b/roojs-mailer-debug.js index cec8343fb4..6b172f916b 100644 --- a/roojs-mailer-debug.js +++ b/roojs-mailer-debug.js @@ -2,12 +2,10 @@ * - LGPL * * element - * - - -
+ */ +Roo.mailer = Roo.mailer || {}; /** * @class Roo.mailer.BodyContainer @@ -20,20 +18,32 @@ * @param {Object} config The config object */ + + Roo.mailer.Body = function(config){ Roo.mailer.Body.superclass.constructor.call(this, config); //this.el = Roo.get(document.body); - - Roo.get(document.body).attr({ + var body = Roo.get(document.body); + body.attr({ leftmargin : 0, marginwidth : 0, topmargin : 0, marginheight : 0, offset : 0 }); + Roo.mailer.Body._calls++; + if (Roo.mailer.Body._calls > 1) { + return; + throw "test"; + } + + this.onRender(body); + this.onRender = function() { }; }; +Roo.mailer.Body._calls = 0; + Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component, { @@ -79,9 +89,12 @@ Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component, { // add a child... return this.el.select('.roo-m-body-cell').first(); + }, + addxtype : function (tree, cntr) + { + return this.addxtypeChild(tree,cntr); } - - + @@ -106,7 +119,7 @@ Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component, { * Bootstrap Element class * @cfg {String} cls class of the element * @cfg {String} html content of header (not used for columns) - * @cfg {String} blocktype (header|preheader|footer|column-container) + * @cfg {String} blocktype (header|preheader|footer|body|row) * * @constructor * Create a new Element @@ -129,9 +142,9 @@ Roo.extend(Roo.mailer.Block, Roo.bootstrap.Component, { var tr = { tag : 'tr', cls : 'roo-m-block-tr' - } - if (this.blocktype != 'column-container') { - tr.cn = [ + }; + if (this.blocktype != 'row') { + tr.cn = [ { tag : 'td', align : 'center', @@ -139,7 +152,7 @@ Roo.extend(Roo.mailer.Block, Roo.bootstrap.Component, { cls : 'roo-m-' + this.blocktype + '-content', html : this.html } - ] + ]; } var cfg = { @@ -158,19 +171,19 @@ Roo.extend(Roo.mailer.Block, Roo.bootstrap.Component, { return cfg; }, - getChildContainer : function() + getChildContainer : function(build_call) { // add a child... - if (this.blogtype == 'column-container') { - var par = this.select( - 'roo-m-block-tr',true + if (this.blocktype == 'row' && build_call) { + var par = this.el.select( + '.roo-m-block-tr',true ).first(); return par.createChild( { tag: 'td', align : 'center', valign : 'top', style : 'padding-top : 20px;', - cls : 'roo-m-column-container' + cls : 'roo-m-column' } ); @@ -226,8 +239,10 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component, { border : 0, cellpadding : 0, cellspacing : 0, - cls: 'roo-m-template-container ' + this.cls - + cls: 'roo-m-body-container ' + this.cls, + cn : [ + { tag : 'tbody' } + ] }; @@ -237,7 +252,7 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component, { getChildContainer : function() { // add a child... - var tr = this.el.createChild({ + var tr = this.el.select('tbody',true).first().createChild({ tag : 'tr', cn : [ { @@ -279,6 +294,7 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component, { * @cfg {String} html content of body * @cfg {String} src image url * @cfg {String} column (left|right) + * @cfg {String width (100%|200|340|260) * * @constructor * Create a new Element @@ -296,13 +312,14 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component, { html : '', src : '', column : 'left', + width : '100%', getAutoCreate : function(){ var tr = { tag : 'tr', cn : [ ] - } + }; @@ -311,12 +328,21 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component, { border : 0, cellpadding :20, cellspacing : 0, - width : '100%', - + width : this.width, cn : [] }; if (this.src != '') { + var img = { + tag : 'img', + src : this.src, + cls : 'roo-m-column-image', + + style : 'max-width: ' + (this.width== '100%' ? '260' : this.width ) +'px;' + }; + if (this.width != '100%' ) { + img.width = this.width; + } cfg.cn.push({ tag : 'tr', cn : [ @@ -324,15 +350,9 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component, { tag : 'td', align : 'center', valight : 'top', - cls : 'roo-m-column-left-content', - cn : [ - { - tag : 'img', - src : this.src, - cls : 'roo-m-column-image', - style : 'max-width: 260px;' - } - ] + cls : 'roo-m-column-'+ this.column + '-content', + cn : [ img ] + } ] }); @@ -345,7 +365,7 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component, { tag : 'td', align : 'center', valight : 'top', - cls : 'roo-m-column-left-content roo-m-column-body', + cls : 'roo-m-column-'+ this.column + '-content roo-m-column-body', html : this.html } ]