Ignore:
Timestamp:
02/08/07 13:09:56 (13 years ago)
Author:
ray
Message:
  • PasteText? general update
  • Ticket #943 Paste Plain Text bad syntax when pasting in p or inline element
  • added checkbox to let the user select if the text is to be wrapped in paragraphs
  • added config to select whether the checkbox is to be displayed
  • added config to set initial state of checkbox
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/PasteText/popups/paste_text.html

    r677 r718  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    2 <html> 
     1<!DOCTYPE html 
     2     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    35<head> 
    46  <title>Paste Text</title> 
    57  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" /> 
    68  <script type="text/javascript" src="../../../popups/popup.js"></script> 
    7 <script language="javascript"> 
     9<script type="text/javascript"> 
    810 
    9 function _CloseOnEsc(event) { 
    10   if ( event.keyCode == 27 ) { 
    11     window.close(); 
    12     return; 
    13   } 
    14 } 
     11function init() { 
    1512 
    16 function Init() { 
    1713  __dlg_translate("PasteText"); 
    18   __dlg_init(); 
    19   window.resizeTo(600, 450); 
     14  __dlg_init(null,{width:600,height:480}); 
     15 
    2016  var param = window.dialogArguments; 
    21   document.getElementById("SCREEN").focus(); 
     17  document.getElementById("paragraphOption").style.display = (param.showParagraphOption) ? '' : 'none'; 
     18   document.getElementById("insertParagraphs").checked = param.newParagraphDefault; 
     19  document.getElementById("inputArea").focus(); 
    2220} 
    2321 
     
    2826 
    2927function onOK() { 
    30   var ret = document.getElementById("SCREEN").value; 
     28  var ret = {}; 
     29  ret.text = document.getElementById("inputArea").value; 
     30  ret.insertParagraphs = document.getElementById("insertParagraphs").checked; 
    3131  __dlg_close( ret ); 
    3232} 
     33window.onload = init; 
    3334</script> 
    3435</head> 
    3536 
    36 <body class="dialog" onload="Init();"> 
     37<body class="dialog"> 
    3738<div class="title">Paste as Plain Text</div> 
    38 <textarea name="SCREEN" id="SCREEN" cols=22 rows=5 style="width: 100%; height: 315px; margin-top: 8px; margin-bottom: 4px; font-family: monospace; font-size: 11px;"></textarea> 
     39<textarea name="inputArea" id="inputArea" cols=22 rows=5 style="width: 100%; height: 315px; margin-top: 8px; margin-bottom: 4px; font-family: monospace; font-size: 11px;"></textarea> 
    3940<div id="buttons"> 
    40     <button type="submit" name="ok" onclick="return onOK();">OK</button> 
     41<label for="insertParagraphs" style="float:left;display:none" id="paragraphOption"> 
     42<input type="checkbox" id="insertParagraphs" /> Insert text in new paragraph  
     43</label> 
     44    <button type="button" name="ok" onclick="return onOK();">OK</button> 
    4145    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> 
    4246</div> 
Note: See TracChangeset for help on using the changeset viewer.