Changeset 329


Ignore:
Timestamp:
06/24/08 17:18:54 (16 years ago)
Author:
niltonneto
Message:

Inclusão da opção do tamanho de borda, na inserção de tabela HTML, do texto rico.

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/rich_text_editor.js

    r320 r329  
    319319cRichTextEditor.prototype.insertTableHtml = function (){ 
    320320        var id = this.editor.substr(5); // border_id 
    321         var     rows = document.getElementById('rows').selectedIndex; 
    322         var     cols = document.getElementById('cols').selectedIndex; 
    323         var insertTable = '<table border="1px"><tbody>'; 
    324         for (var i = 0; i <= rows; i++){ 
     321        var     rows = document.getElementById('rows').value; 
     322        var     cols = document.getElementById('cols').value; 
     323        var border = document.getElementById('border').value; 
     324        var insertTable = '<table border="'+border+'px"><tbody>'; 
     325        for (var i = 0; i < rows; i++){ 
    325326                insertTable += "<tr>";   
    326                 for (var j = 0; j <= cols; j++) 
     327                for (var j = 0; j < cols; j++) 
    327328                        insertTable += "<td>&nbsp;</td>";        
    328329                insertTable += "</tr>"; 
     
    352353                form_table.style.top = "5px"; 
    353354                form_table.style.left = "5px"; 
    354                 form_table.style.width = "170px"; 
    355                 form_table.style.height = "120px"; 
    356                 form_table.name = get_lang("Insert Table"); 
    357                 form_table.innerHTML = get_lang('Select the table size')+':<br><br>'+ 
    358                                                                 get_lang('Rows')+':&nbsp;&nbsp;&nbsp;'+ get_lang('Cols')+':<br>'+ 
    359                                                                         '<select name="rows" id="rows"><option value="1">1</option>'+ 
    360                                                                         '<option value="2">2</option>'+ 
    361                                                                         '<option value="3">3</option>'+ 
    362                                                                         '<option value="4">4</option>'+ 
    363                                                                         '<option value="5">5</option>'+ 
    364                                                                         '<option value="6">6</option>'+ 
    365                                                                         '<option value="7">7</option>'+ 
    366                                                                         '<option value="8">8</option>'+ 
    367                                                                         '<option value="9">9</option></select>&nbsp;&nbsp;&nbsp;'+ 
    368                                                                         '<select name="cols" id="cols"><option value="1">1</option>'+ 
    369                                                                         '<option value="2">2</option>'+ 
    370                                                                         '<option value="3">3</option>'+ 
    371                                                                         '<option value="4">4</option>'+ 
    372                                                                         '<option value="5">5</option>'+ 
    373                                                                         '<option value="6">6</option>'+ 
    374                                                                         '<option value="7">7</option>'+ 
    375                                                                         '<option value="8">8</option>'+ 
    376                                                                         '<option value="9">9</option></select><br><br>'+ 
    377                                                                 '<input title="Close"  value="' + get_lang('Close') + '" type="button" onclick="win.close()">&nbsp;'+ 
    378                                                                 '<input title="Include"  value="' + get_lang('Include') + '" type="button" onclick="RichTextEditor.insertTableHtml();win.close();">'; 
     355                form_table.style.width = "190px"; 
     356                form_table.style.height = "90px"; 
     357                form_table.name = get_lang("Insert Table");              
     358                form_table.innerHTML = get_lang('Select the table size')+':<br><br><table cellspacing="0"><tbody><tr><td align="center">'+ 
     359                                                                get_lang('Rows')+':</td><td></td><td align="center">'+get_lang('Cols')+':</td><td></td><td align="center">'+get_lang('Border')+':</td></tr>'+ 
     360                                                                        '<tr><td align="right"><input type="text" readonly="true" id="rows" size="2" maxlength="2" value="1"></input></td><td align="left"><img src="templates/default/images/plus.png" onclick="javascript:RichTextEditor.incrementField(\'rows\');"></img><br><img src="templates/default/images/minus.png" onclick="javascript:RichTextEditor.decrementField(\'rows\');"></img></td>'+ 
     361                                                                        '<td align="right"><input type="text" readonly="true" id="cols" size="2" maxlength="2" value="1"></input></td><td align="left"><img src="templates/default/images/plus.png" onclick="javascript:RichTextEditor.incrementField(\'cols\');"></img><br><img src="templates/default/images/minus.png" onclick="javascript:RichTextEditor.decrementField(\'cols\');"></img></td>'+ 
     362                                                                        '<td align="right"><input type="text" readonly="true" id="border" size="2" maxlength="2" value="1"></input></td><td align="left"><img src="templates/default/images/plus.png" onclick="javascript:RichTextEditor.incrementField(\'border\');"></img><br><img src="templates/default/images/minus.png" onclick="javascript:RichTextEditor.decrementField(\'border\');"></img></td>'+ 
     363                                                                        '</tr></tbody></table>'+ 
     364                                                                        '&nbsp;&nbsp;&nbsp;<input title="Close"  value="' + get_lang('Close') + '" type="button" onclick="win.close()">&nbsp;'+ 
     365                                                                        '<input title="Include"  value="' + get_lang('Include') + '" type="button" onclick="RichTextEditor.insertTableHtml();win.close();">';    
    379366                form.appendChild(form_table); 
    380367                 
    381368                this.showWindow(form); 
    382369                } 
     370 
     371cRichTextEditor.prototype.incrementField = function(id_val){ 
     372        var field_text = document.getElementById(id_val); 
     373        field_text.value = parseInt(field_text.value)+1; 
     374} 
     375 
     376cRichTextEditor.prototype.decrementField = function(id_val){ 
     377        var field_text = document.getElementById(id_val); 
     378        if (parseInt(field_text.value) > 0) 
     379                field_text.value = parseInt(field_text.value)-1; 
     380} 
    383381 
    384382cRichTextEditor.prototype.createImage = function(){ 
Note: See TracChangeset for help on using the changeset viewer.