Ignore:
Timestamp:
06/03/07 12:11:44 (12 years ago)
Author:
gocher
Message:
  • integrate new config settings in the example:

sizeIncludesPanels, htmlareaPaste, getHtmlMethod, undoTimeout, changeJustifyWithDirection, fullPage, pageStyle, expandRelativeUrl, maikeLinkShowsTarget, stripScripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/Extended.html

    r677 r845  
    1 <html> 
     1<html> 
    22 
    33<head> 
     
    77 
    88function getAbsolutePos(el) { 
    9         var r = { x: el.offsetLeft, y: el.offsetTop }; 
    10         if (el.offsetParent) { 
    11                 var tmp = getAbsolutePos(el.offsetParent); 
    12                 r.x += tmp.x; 
    13                 r.y += tmp.y; 
    14         } 
    15         return r; 
     9  var r = { x: el.offsetLeft, y: el.offsetTop }; 
     10  if (el.offsetParent) { 
     11    var tmp = getAbsolutePos(el.offsetParent); 
     12    r.x += tmp.x; 
     13    r.y += tmp.y; 
     14  } 
     15  return r; 
    1616}; 
    1717 
     
    6767 
    6868function __dlg_onclose() { 
    69         opener.Dialog._return(null); 
     69  opener.Dialog._return(null); 
    7070}; 
    7171 
    7272// closes the dialog and passes the return info upper. 
    7373function __dlg_close(val) { 
    74         opener.Dialog._return(val); 
    75         window.close(); 
     74  opener.Dialog._return(val); 
     75  window.close(); 
    7676}; 
    7777 
    7878function __dlg_close_on_esc(ev) { 
    79         ev || (ev = window.event); 
    80         if (ev.keyCode == 27) { 
    81                 window.close(); 
    82                 return false; 
    83         } 
    84         return true; 
     79  ev || (ev = window.event); 
     80  if (ev.keyCode == 27) { 
     81    window.close(); 
     82    return false; 
     83  } 
     84  return true; 
    8585}; 
    8686 
    8787function __dlg_init(bottom) { 
    8888  var body = document.body; 
    89         var body_height = 0; 
    90         if (typeof bottom == "undefined") { 
    91                 var div = document.createElement("div"); 
    92                 body.appendChild(div); 
    93                 var pos = getAbsolutePos(div); 
    94                 body_height = pos.y; 
    95         } else { 
    96                 var pos = getAbsolutePos(bottom); 
    97                 body_height = pos.y + bottom.offsetHeight; 
    98         } 
    99         window.dialogArguments = opener.Dialog._arguments; 
    100         if (!document.all) { 
    101                 window.sizeToContent(); 
    102                 window.sizeToContent(); // for reasons beyond understanding, 
    103                                         // only if we call it twice we get the 
    104                                         // correct size. 
    105                 window.addEventListener("unload", __dlg_onclose, true); 
    106                 window.innerWidth = body.offsetWidth + 5; 
    107                 window.innerHeight = body_height + 2; 
    108                 // center on parent 
    109                 var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; 
    110                 var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; 
    111                 window.moveTo(x, y); 
    112         } else { 
    113                 // window.dialogHeight = body.offsetHeight + 50 + "px"; 
    114                 // window.dialogWidth = body.offsetWidth + "px"; 
    115                 window.resizeTo(body.offsetWidth, body_height); 
    116                 var ch = body.clientHeight; 
    117                 var cw = body.clientWidth; 
    118                 window.resizeBy(body.offsetWidth - cw, body_height - ch); 
    119                 var W = body.offsetWidth; 
    120                 var H = 2 * body_height - ch; 
    121                 var x = (screen.availWidth - W) / 2; 
    122                 var y = (screen.availHeight - H) / 2; 
    123                 window.moveTo(x, y); 
    124         } 
    125         document.body.onkeypress = __dlg_close_on_esc; 
     89  var body_height = 0; 
     90  if (typeof bottom == "undefined") { 
     91    var div = document.createElement("div"); 
     92    body.appendChild(div); 
     93    var pos = getAbsolutePos(div); 
     94    body_height = pos.y; 
     95  } else { 
     96    var pos = getAbsolutePos(bottom); 
     97    body_height = pos.y + bottom.offsetHeight; 
     98  } 
     99  window.dialogArguments = opener.Dialog._arguments; 
     100  if (!document.all) { 
     101    window.sizeToContent(); 
     102    window.sizeToContent();  // for reasons beyond understanding, 
     103          // only if we call it twice we get the 
     104          // correct size. 
     105    window.addEventListener("unload", __dlg_onclose, true); 
     106    window.innerWidth = body.offsetWidth + 5; 
     107    window.innerHeight = body_height + 2; 
     108    // center on parent 
     109    var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; 
     110    var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; 
     111    window.moveTo(x, y); 
     112  } else { 
     113    // window.dialogHeight = body.offsetHeight + 50 + "px"; 
     114    // window.dialogWidth = body.offsetWidth + "px"; 
     115    window.resizeTo(body.offsetWidth, body_height); 
     116    var ch = body.clientHeight; 
     117    var cw = body.clientWidth; 
     118    window.resizeBy(body.offsetWidth - cw, body_height - ch); 
     119    var W = body.offsetWidth; 
     120    var H = 2 * body_height - ch; 
     121    var x = (screen.availWidth - W) / 2; 
     122    var y = (screen.availHeight - H) / 2; 
     123    window.moveTo(x, y); 
     124  } 
     125  document.body.onkeypress = __dlg_close_on_esc; 
    126126}; 
    127127 
     
    208208 
    209209<style type="text/css"> 
    210         .fr { width: 16em; float: left; padding: 2px 5px; text-align: right; } 
     210  label { width: 16em; float: left; padding: 2px 5px; text-align: right; } 
     211  br { clear: both; } 
    211212</style> 
    212213 
    213214</head> 
    214215 
    215 <body class="dialog" onload="Init(); window.resizeTo(360, 590);"> 
     216<body class="dialog" onload="Init(); window.resizeTo(420, 820);"> 
    216217<div class="title">Settings</div> 
    217218  <form action="" method="get"> 
    218     <div class="fr">Editor width:</div> 
    219       <input type="text" name="width" id="width" title="" /> 
    220     <p /> 
    221     <div class="fr">Editor height:</div> 
    222       <input type="text" name="height" id="height" title="" /> 
    223     <p /> 
    224     <div class="fr">Size includes bars</div> 
    225       <input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" value="true" /> 
    226     <p /> 
    227     <div class="fr">Status Bar</div> 
    228       <input type="checkbox" name="statusBar" id="statusBar" value="true" /> 
    229     <p /> 
    230     <div class="fr">Mozilla Parameter Handler:</div> 
    231     <select name="mozParaHandler" id="mozParaHandler"> 
    232       <option value="built-in">built-in</option> 
    233       <option value="dirty">dirty</option> 
    234       <option value="best">best</option> 
     219  <fieldset> 
     220    <legend>Xinha options</legend> 
     221    <label for="width">Editor width:</label> 
     222    <input type="text" name="width" id="width" title="Allowed values are 'auto', 'toolbar' or a numeric value followed by 'px'." /><br /> 
     223    <label for="height">Editor height:</label> 
     224    <input type="text" name="height" id="height" title="Allowed values are 'auto' or a numeric value followed by 'px'." /><br /> 
     225    <label for="sizeIncludesBars">Size includes bars</label> 
     226    <input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" value="true" title="Specifies whether the toolbar should be included in the size, or are extra to it." /><br /> 
     227    <label for="sizeIncludesPanels">Size includes panels</label> 
     228    <input type="checkbox" name="sizeIncludesPanels" id="sizeIncludesPanels" value="true" title="Specifies whether the panels should be included in the size, or are extra to it." /><br /> 
     229    <label for="statusBar">Status Bar</label> 
     230    <input type="checkbox" name="statusBar" id="statusBar" value="true" title="Enable creation of the status bar?" /><br /> 
     231    <label for="htmlareaPaste">Htmlarea Paste</label> 
     232    <input type="checkbox" name="htmlareaPaste" id="htmlareaPaste" value="true" title="Intercept ^V and use the Xinha paste command" /><br /> 
     233    <label for="mozParaHandler">Mozilla Parameter Handler:</label> 
     234    <select name="mozParaHandler" id="mozParaHandler" title="Gecko only: Let the built-in routine for handling the return key decide if to enter br or p tags or use a custom implementation."> 
     235    <option value="built-in">built-in</option> 
     236    <option value="dirty">dirty</option> 
     237    <option value="best">best</option> 
     238    </select><br /> 
     239    <label for="getHtmlMethod">GetHtml Method:</label> 
     240    <select name="getHtmlMethod" id="getHtmlMethod" title="This determines the method how the HTML output is generated."> 
     241    <option value="DOMwalk">DOMwalk</option> 
     242    <option value="TransformInnerHTML">TransformInnerHTML</option> 
     243    </select><br /> 
     244    <label for="undoSteps">Undo steps:</label> 
     245    <input type="text" name="undoSteps" id="undoSteps" title="Maximum size of the undo queue."  /><br /> 
     246    <label for="undoTimeout">Undo Timeout:</label> 
     247    <input type="text" name="undoTimeout" id="undoTimeout" title="The time interval at which undo samples are taken, default: 500 (1/2 sec)."  /><br /> 
     248    <label for="changeJustifyWithDirection">change justify with direction</label> 
     249    <input type="checkbox" name="changeJustifyWithDirection" id="changeJustifyWithDirection" value="true" title="Set this to true if you want to explicitly right-justify when setting the text direction to right-to-left" /><br /> 
     250    <label for="fullPage">full Page</label> 
     251    <input type="checkbox" name="fullPage" id="fullPage" value="true" title="If true then Xinha will retrieve the full HTML, starting with the HTML-tag." /><br /> 
     252    <label for="pageStyle">Page style:</label> 
     253    <textarea name="pageStyle" id="pageStyle" title="Raw style definitions included in the edited document"></textarea> 
     254<!--    pageStyleSheets --> 
     255    <label for="baseHref">Base href:</label> 
     256    <input type="text" name="baseHref" id="baseHref" title="specify a base href for relative links" /><br /> 
     257    <label for="expandRelativeUrl">expand relative Url</label> 
     258    <input type="checkbox" name="expandRelativeUrl" id="expandRelativeUrl" value="true" title="If true, relative URLs (../) will be made absolute"/><br /> 
     259    <label for="stripBaseHref">Strip base href</label> 
     260    <input type="checkbox" name="stripBaseHref" id="stripBaseHref" value="true" title="We can strip the server part out of URL to make/leave them semi-absolute" /><br /> 
     261    <label for="stripSelfNamedAnchors">Strip self named anchors</label> 
     262    <input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" value="true" title="We can strip the url of the editor page from named links" /><br /> 
     263    <label for="only7BitPrintablesInURLs">only 7bit printables in URLs</label> 
     264    <input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" value="true" title="In URLs all characters above ASCII value 127 have to be encoded using % codes" /><br /> 
     265    <label for="sevenBitClean">7bit Clean</label> 
     266    <input type="checkbox" name="sevenBitClean" id="sevenBitClean" value="true" title="If you are putting the HTML written in Xinha into an email you might want it to be 7-bit characters only." /><br /> 
     267    <label for="killWordOnPaste">kill Word on paste</label> 
     268    <input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" value="true" title="Set to true if you want Word code to be cleaned upon Paste." /><br /> 
     269    <label for="makeLinkShowsTarget">make Link Shows Target</label> 
     270    <input type="checkbox" name="makeLinkShowsTarget" id="makeLinkShowsTarget" value="true" title="Enable the 'Target' field in the Make Link dialog." /><br /> 
     271    <label for="flowToolbars">flow toolbars</label> 
     272    <input type="checkbox" name="flowToolbars" id="flowToolbars" value="true" /><br /> 
     273    <label for="stripScripts">strip Scripts</label> 
     274    <input type="checkbox" name="stripScripts" id="stripScripts" value="true" title="Set to false if you want to allow JavaScript in the content" /><br /> 
     275    <label for="showLoading">show loading</label> 
     276    <input type="checkbox" name="showLoading" id="showLoading" value="true" /><br /> 
     277  </fieldset> 
     278 
     279  <fieldset id="CharacterMapOptions" class="options"> 
     280    <legend>CharacterMap options</legend> 
     281    <label for="CharacterMapMode">Mode :</label> 
     282    <select id="CharacterMapMode" name="CharacterMapMode"> 
     283    <option value="popup">popup</option> 
     284    <option value="panel">panel</option> 
    235285    </select> 
    236     <div class="space"></div> 
    237     <div class="fr">Undo steps:</div> 
    238       <input type="text" name="undoSteps" id="undoSteps" title="" /> 
    239     <p /> 
    240     <div class="fr">Base href:</div> 
    241       <input type="text" name="baseHref" id="baseHref" title="" /> 
    242     <p /> 
    243     <div class="fr">Strip base href</div> 
    244       <input type="checkbox" name="stripBaseHref" id="stripBaseHref" value="true" /> 
    245     <p /> 
    246     <div class="fr">Strip self named anchors</div> 
    247       <input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" value="true" /> 
    248     <p /> 
    249     <div class="fr">only 7bit printables in URLs</div> 
    250       <input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" value="true" /> 
    251     <p /> 
    252     <div class="fr">7bit Clean</div> 
    253       <input type="checkbox" name="sevenBitClean" id="sevenBitClean" value="true" /> 
    254     <p /> 
    255     <div class="fr">kill Word on paste</div> 
    256       <input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" value="true" /> 
    257     <p /> 
    258     <div class="fr">flow toolbars</div> 
    259       <input type="checkbox" name="flowToolbars" id="flowToolbars" value="true" /> 
    260     <p /> 
    261     <div class="fr">show loading</div> 
    262       <input type="checkbox" name="showLoading" id="showLoading" value="true" /> 
    263     <p /> 
    264  
    265     <div id="CharacterMapOptions" class="options"> 
    266     <hr size="0.5"> 
    267     <div class="fr">CharacterMap mode :</div> 
    268       <select id="CharacterMapMode" name="CharacterMapMode"> 
    269         <option value="popup">popup</option> 
    270         <option value="panel">panel</option> 
    271       </select> 
    272     </div> 
    273     <p /> 
    274  
    275     <div id="ListTypeOptions" class="options"> 
    276     <hr size="0.5"> 
    277     <div class="fr">ListType mode :</div> 
    278       <select id="ListTypeMode" name="ListTypeMode"> 
    279         <option value="toolbar">toolbar</option> 
    280         <option value="panel">panel</option> 
    281       </select> 
    282     </div> 
    283     <p /> 
    284  
    285     <div id="CharCounterOptions" class="options"> 
    286     <hr size="0.5"> 
    287     <div class="fr">CharCounter (showChar) :</div><input type="checkbox" name="showChar" id="showChar" value="true" /><br /> 
    288     <div class="fr">CharCounter (showWord) :</div><input type="checkbox" name="showWord" id="showWord" value="true" /><br /> 
    289     <div class="fr">CharCounter (showHtml) :</div><input type="checkbox" name="showHtml" id="showHtml" value="true" /> 
    290     </div> 
    291     <p /> 
     286  </fieldset> 
     287 
     288  <fieldset id="ListTypeOptions" class="options"> 
     289    <legend>ListType options</legend> 
     290    <label class="ListTypeMode">Mode :</label> 
     291    <select id="ListTypeMode" name="ListTypeMode"> 
     292    <option value="toolbar">toolbar</option> 
     293    <option value="panel">panel</option> 
     294    </select> 
     295  </fieldset> 
     296 
     297  <fieldset id="CharCounterOptions" class="options"> 
     298    <legend>CharCounter options</legend> 
     299    <label for="showChar">show Char :</label> 
     300    <input type="checkbox" name="showChar" id="showChar" value="true" /><br /> 
     301    <label for="showWord">show Word :</label> 
     302    <input type="checkbox" name="showWord" id="showWord" value="true" /><br /> 
     303    <label for="showHtml">show Html :</label> 
     304    <input type="checkbox" name="showHtml" id="showHtml" value="true" /><br /> 
     305  </fieldset> 
     306  <br /> 
    292307 
    293308  <div id="buttons"> 
Note: See TracChangeset for help on using the changeset viewer.