Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/03/2009, 20:04
cara_luna
 
Fecha de Ingreso: marzo-2009
Mensajes: 74
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: Programar editor de texto

Código javascript:
Ver original
  1. <body>
  2.  
  3. <P><STRONG><FONT size=3>Online Content Editor</FONT></STRONG></P>
  4.  
  5. <table id="tblCoolbar" width=542 cellpadding="0" cellspacing="0">
  6. <tr valign="middle">
  7.  
  8.     <td colspan=16 width="369">
  9.         <select onchange="cmdExec('formatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
  10.             <option selected>Estilo</option>
  11.             <option value="Normal">Normal</option>
  12.             <option value="Heading 1">Heading 1</option>
  13.             <option value="Heading 2">Heading 2</option>
  14.             <option value="Heading 3">Heading 3</option>
  15.             <option value="Heading 4">Heading 4</option>
  16.             <option value="Heading 5">Heading 5</option>
  17.             <option value="Address">Address</option>
  18.             <option value="Formatted">Formatted</option>
  19.             <option value="Definition Term">Definition Term</option>
  20.         </select>
  21.         <select onchange="cmdExec('fontname',this[this.selectedIndex].value);">
  22.             <option selected>Font</option>
  23.             <option value="Arial">Arial</option>
  24.             <option value="Arial Black">Arial Black</option>
  25.             <option value="Arial Narrow">Arial Narrow</option>
  26.             <option value="Comic Sans MS">Comic Sans MS</option>
  27.             <option value="Courier New">Courier New</option>
  28.             <option value="System">System</option>
  29.             <option value="Tahoma">Tahoma</option>
  30.             <option value="Times New Roman">Times New Roman</option>
  31.             <option value="Verdana">Verdana</option>
  32.             <option value="Wingdings">Wingdings</option>
  33.         </select>
  34.         <select onchange="cmdExec('fontsize',this[this.selectedIndex].value);">
  35.             <option selected>Size</option>
  36.             <option value="1">1</option>
  37.             <option value="2">2</option>
  38.             <option value="3">3</option>
  39.             <option value="4">4</option>
  40.             <option value="5">5</option>
  41.             <option value="6">6</option>
  42.             <option value="7">7</option>
  43.             <option value="8">8</option>
  44.             <option value="10">10</option>
  45.             <option value="12">12</option>
  46.             <option value="14">14</option>
  47.         </select>
  48.        
  49.     </td>
  50.    
  51. </tr>
  52. <tr>
  53.  
  54.     <td width="20"><div class="cbtn" onClick="cmdExec('cut')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  55.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0015-bs_cut.gif" alt="Cut" width="16" height="16">
  56.     </div></td>
  57.    
  58.     <td width="20"><div class="cbtn" onClick="cmdExec('copy')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  59.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0013-bs_copy.gif" alt="Copy" width="16" height="16">
  60.     </div></td>
  61.    
  62.     <td width="20"><div class="cbtn" onClick="cmdExec('paste')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  63.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0073-bs_paste.gif" alt="Paste" width="16" height="16">
  64.     </div></td>
  65.    
  66.     <td width="20"><div class="cbtn" onClick="cmdExec('bold')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  67.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0046-bs_formatBold_en.gif" alt="Bold" width="16" height="16">
  68.     </div></td>
  69.    
  70.     <td width="20"><div class="cbtn" onClick="cmdExec('italic')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  71.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0048-bs_formatItalic_en.gif" alt="Italic" width="16" height="16">
  72.     </div></td>
  73.    
  74.     <td width="20"><div class="cbtn" onClick="cmdExec('underline')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  75.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0049-bs_formatUnderline.gif" alt="Underline" width="16" height="16">
  76.     </div></td>    
  77.        
  78.     <td width="20"><div class="cbtn" onClick="cmdExec('justifyleft')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  79.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0003-bs_alignLeft.gif" alt="Justify Left" width="16" height="16">
  80.     </div></td>
  81.    
  82.     <td width="20"><div class="cbtn" onClick="cmdExec('justifycenter')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  83.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0002-bs_alignCenter.gif" alt="Center" width="16" height="16">
  84.     </div></td>
  85.    
  86.     <td width="20"><div class="cbtn" onClick="cmdExec('justifyright')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  87.     <img hspace="1" vspace=1 align=middle src="includes/imagenes/0004-bs_alignRight.gif" alt="Justify Right" width="16" height="16">
  88.     </div></td>    
  89.    
  90.     <td width="22"><div class="cbtn" onClick="cmdExec('insertorderedlist')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  91.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0069-bs_ol.gif" alt="Ordered List" width="16" height="16">
  92.     </div></td>
  93.  
  94.     <td width="22"><div class="cbtn" onClick="cmdExec('insertunorderedlist')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  95.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0097-bs_ul.gif" alt="Unordered List" width="16" height="16">
  96.     </div></td>
  97.        
  98.     <td width="22"><div class="cbtn" onClick="cmdExec('outdent')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  99.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0072-bs_outdent.gif" alt="Decrease Indent" width="16" height="16">
  100.     </div></td>
  101.    
  102.     <td width="22"><div class="cbtn" onClick="cmdExec('indent')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  103.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0056-bs_indent.gif" alt="Increase Indent" width="16" height="16">
  104.     </div></td>        
  105.    
  106.     <td width="22"><div class="cbtn" onClick="foreColor()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  107.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0029-bs_fgColor.gif" alt="Forecolor" width="16" height="16">
  108.     </div></td>    
  109.    
  110.     <td width="22"><div class="cbtn" onClick="foreColor()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  111.     <img border="0" src="includes/imagenes/0063-bs_lineColor.gif" width="16" height="16">
  112.     </div></td>    
  113.  
  114.     <td width="27"><div class="cbtn" onClick="cmdExec('createLink')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  115.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/createlink.gif" alt="Link" width="21" height="20">
  116.     </div></td>
  117.    
  118.     <td width="22"><div class="cbtn" onClick="insertImage()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  119.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0055-bs_image.gif" alt="Image" width="16" height="16">
  120.     </div></td>    
  121.    
  122.     <td width="26">
  123.     <div class="cbtn" onClick="Save()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);" style="width: 22; height: 24">
  124.     <img  hspace="2" vspace=1 align=middle align=absmiddle src="includes/imagenes/0078-bs_save.gif" alt="Save" width="16" height="16"><font class=txtbtn>&nbsp;</font>
  125.     </div></td>
  126.    
  127.     <td width="17"><div class="cbtn" onClick="insertTable()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
  128.     <img hspace="2" vspace=1 align=middle src="includes/imagenes/0085-bs_table.gif" alt="insertable" width="16" height="16">
  129.     </div></td>
  130.        
  131.     <td width="124">&nbsp;</td>    
  132.        
  133. </tr>
  134. </table>
  135.  
  136. <iframe width="542" id="idContent" height="350"></iframe>
  137. <br>
  138. <input type="checkbox" onclick="setMode(this.checked)" value="ON"> Edit HTML
  139. </body>