Changeset 433 for trunk


Ignore:
Timestamp:
12/09/05 13:43:04 (14 years ago)
Author:
gocher
Message:

Changes to CharCounter? Plugin
and updates of extended example to check it

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/Extended.html

    r324 r433  
    1616}; 
    1717 
    18 function comboSelectValue(c, val) { 
    19         var ops = c.getElementsByTagName("option"); 
    20         for (var i = ops.length; --i >= 0;) { 
    21                 var op = ops[i]; 
    22                 op.selected = (op.value == val); 
    23         } 
    24         c.value = val; 
    25 }; 
     18function getSelectedValue(el) { 
     19  if(!el) 
     20    return ""; 
     21  return el[el.selectedIndex].value; 
     22} 
     23 
     24function setSelectedValue(el, val) { 
     25  if(!el) 
     26    return ""; 
     27  var ops = el.getElementsByTagName("option"); 
     28  for (var i = ops.length; --i >= 0;) { 
     29    var op = ops[i]; 
     30    op.selected = (op.value == val); 
     31  } 
     32  el.value = val; 
     33} 
     34 
     35function getCheckedValue(el) { 
     36  if(!el) 
     37    return ""; 
     38  var radioLength = el.length; 
     39  if(radioLength == undefined) 
     40    if(el.checked) 
     41      return el.value; 
     42    else 
     43      return "false"; 
     44  for(var i = 0; i < radioLength; i++) { 
     45    if(el[i].checked) { 
     46      return el[i].value; 
     47    } 
     48  } 
     49  return ""; 
     50} 
     51 
     52function setCheckedValue(el, val) { 
     53  if(!el) 
     54    return; 
     55  var radioLength = el.length; 
     56  if(radioLength == undefined) { 
     57    el.checked = (el.value == val.toString()); 
     58    return; 
     59  } 
     60  for(var i = 0; i < radioLength; i++) { 
     61    el[i].checked = false; 
     62    if(el[i].value == val.toString()) { 
     63      el[i].checked = true; 
     64    } 
     65  } 
     66} 
    2667 
    2768function __dlg_onclose() { 
     
    85126}; 
    86127 
     128function placeFocus() { 
     129var bFound = false; 
     130  // for each form 
     131  for (f=0; f < document.forms.length; f++) { 
     132    // for each element in each form 
     133    for(i=0; i < document.forms[f].length; i++) { 
     134      // if it's not a hidden element 
     135      if (document.forms[f][i].type != "hidden") { 
     136        // and it's not disabled 
     137        if (document.forms[f][i].disabled != true) { 
     138            // set the focus to it 
     139            document.forms[f][i].focus(); 
     140            var bFound = true; 
     141        } 
     142      } 
     143      // if found in this element, stop looking 
     144      if (bFound == true) 
     145        break; 
     146    } 
     147    // if found in this form, stop looking 
     148    if (bFound == true) 
     149      break; 
     150  } 
     151} 
     152 
    87153function Init() { 
    88154  __dlg_init(); 
    89155  var param = window.dialogArguments; 
    90   if (param) { 
    91     document.getElementById("width").value = param["width"]; 
    92     document.getElementById("height").value = param["height"]; 
    93     document.getElementById("sizeIncludesBars").checked = (param["sizeIncludesBars"] == 'true'); 
    94     document.getElementById("statusBar").checked = (param["statusBar"] == 'true'); 
    95     document.getElementById("mozParaHandler").value = param["mozParaHandler"]; 
    96     document.getElementById("undoSteps").value = param["undoSteps"]; 
    97     document.getElementById("baseHref").value = param["baseHref"]; 
    98     document.getElementById("stripBaseHref").checked = (param["stripBaseHref"] == 'true'); 
    99     document.getElementById("stripSelfNamedAnchors").checked = (param["stripSelfNamedAnchors"] == 'true'); 
    100     document.getElementById("only7BitPrintablesInURLs").checked = (param["only7BitPrintablesInURLs"] == 'true'); 
    101     document.getElementById("sevenBitClean").checked = (param["sevenBitClean"] == 'true'); 
    102     document.getElementById("killWordOnPaste").checked = (param["killWordOnPaste"] == 'true'); 
    103                 document.getElementById("flowToolbars").checked = (param["flowToolbars"] == 'true'); 
    104                 document.getElementById("CharacterMapMode").value = param["CharacterMapMode"]; 
    105     document.getElementById("ListTypeMode").value = param["ListTypeMode"]; 
    106      
    107   } 
    108   document.getElementById("width").focus(); 
    109         window.resizeTo(420, 500); 
    110 }; 
    111  
     156  if(param) { 
     157    var el; 
     158    for (var field in param) { 
     159      //alert(field + '="' + param[field] + '"'); 
     160      el = document.getElementById(field); 
     161      if (el.tagName.toLowerCase()=="input"){ 
     162        if ((el.type.toLowerCase()=="radio") || (el.type.toLowerCase()=="checkbox")){ 
     163          setCheckedValue(el, param[field]); 
     164        } else { 
     165          el.value = param[field]; 
     166        } 
     167      } else if (el.tagName.toLowerCase()=="select"){ 
     168        setSelectedValue(el, param[field]); 
     169      } else if (el.tagName.toLowerCase()=="textarea"){ 
     170        el.value = param[field]; 
     171      } 
     172    } 
     173  } 
     174  placeFocus(); 
     175}; 
     176 
     177// pass data back to the calling window 
    112178function onOK() { 
    113   // pass data back to the calling window 
    114   var param = { width: document.getElementById("width").value, 
    115                 height: document.getElementById("height").value, 
    116                 sizeIncludesBars: (document.getElementById("sizeIncludesBars").checked?true:""), 
    117                 statusBar: (document.getElementById("statusBar").checked?true:""), 
    118                 mozParaHandler: document.getElementById("mozParaHandler").value, 
    119                 undoSteps: document.getElementById("undoSteps").value, 
    120                 baseHref: document.getElementById("baseHref").value, 
    121                 stripBaseHref: (document.getElementById("stripBaseHref").checked?true:""), 
    122                 stripSelfNamedAnchors: (document.getElementById("stripSelfNamedAnchors").checked?true:""), 
    123                 only7BitPrintablesInURLs: (document.getElementById("only7BitPrintablesInURLs").checked?true:""), 
    124                 sevenBitClean: (document.getElementById("sevenBitClean").checked?true:""), 
    125                 killWordOnPaste: (document.getElementById("killWordOnPaste").checked?true:""), 
    126                 flowToolbars: (document.getElementById("flowToolbars").checked?true:""), 
    127                             CharacterMapMode: document.getElementById("CharacterMapMode").value, 
    128                 ListTypeOptions: document.getElementById("ListTypeMode").value 
    129                           }; 
    130         __dlg_close(param); 
     179  var param = new Object(); 
     180  var el = document.getElementsByTagName('input'); 
     181  for (var i=0; i<el.length;i++){ 
     182    if ((el[i].type.toLowerCase()=="radio") || (el[i].type.toLowerCase()=="checkbox")){ 
     183      if (getCheckedValue(el[i])!=''){ 
     184        param[el[i].id] = getCheckedValue(el[i]); 
     185      } 
     186    } else { 
     187      param[el[i].id] = el[i].value; 
     188    } 
     189  } 
     190  el = document.getElementsByTagName('select'); 
     191  for (var i=0; i<el.length;i++){ 
     192    param[el[i].id] = getSelectedValue(el[i]); 
     193  } 
     194  el = document.getElementsByTagName('textarea'); 
     195  for (var i=0; i<el.length;i++){ 
     196    param[el[i].id] = el[i].value; 
     197  } 
     198  __dlg_close(param); 
    131199  return false; 
    132200}; 
     
    145213</head> 
    146214 
    147 <body class="dialog" onload="Init()"> 
     215<body class="dialog" onload="Init(); window.resizeTo(360, 590);"> 
    148216<div class="title">Settings</div> 
    149217  <form action="" method="get"> 
     
    155223    <p /> 
    156224    <div class="fr">Size includes bars</div> 
    157       <input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" /> 
     225      <input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" value="true" /> 
    158226    <p /> 
    159227    <div class="fr">Status Bar</div> 
    160       <input type="checkbox" name="statusBar" id="statusBar" /> 
     228      <input type="checkbox" name="statusBar" id="statusBar" value="true" /> 
    161229    <p /> 
    162230    <div class="fr">Mozilla Parameter Handler:</div> 
     
    174242    <p /> 
    175243    <div class="fr">Strip base href</div> 
    176       <input type="checkbox" name="stripBaseHref" id="stripBaseHref" /> 
     244      <input type="checkbox" name="stripBaseHref" id="stripBaseHref" value="true" /> 
    177245    <p /> 
    178246    <div class="fr">Strip self named anchors</div> 
    179       <input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" /> 
     247      <input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" value="true" /> 
    180248    <p /> 
    181249    <div class="fr">only 7bit printables in URLs</div> 
    182       <input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" /> 
     250      <input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" value="true" /> 
    183251    <p /> 
    184252    <div class="fr">7bit Clean</div> 
    185       <input type="checkbox" name="sevenBitClean" id="sevenBitClean" /> 
     253      <input type="checkbox" name="sevenBitClean" id="sevenBitClean" value="true" /> 
    186254    <p /> 
    187255    <div class="fr">kill Word on paste</div> 
    188       <input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" /> 
     256      <input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" value="true" /> 
    189257    <p /> 
    190258    <div class="fr">flow toolbars</div> 
    191       <input type="checkbox" name="flowToolbars" id="flowToolbars" /> 
     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" /> 
    192263    <p /> 
    193264 
    194265    <div id="CharacterMapOptions" class="options"> 
    195266    <hr size="0.5"> 
    196                 <div class="fr">CharacterMap mode :</div> 
    197                   <select id="CharacterMapMode" name="CharacterMapMode"> 
     267    <div class="fr">CharacterMap mode :</div> 
     268      <select id="CharacterMapMode" name="CharacterMapMode"> 
    198269        <option value="popup">popup</option> 
    199270        <option value="panel">panel</option> 
    200271      </select> 
    201           </div> 
     272    </div> 
    202273    <p /> 
    203274 
    204275    <div id="ListTypeOptions" class="options"> 
    205                 <hr size="0.5"> 
     276    <hr size="0.5"> 
    206277    <div class="fr">ListType mode :</div> 
    207                   <select id="ListTypeMode" name="ListTypeMode"> 
     278      <select id="ListTypeMode" name="ListTypeMode"> 
    208279        <option value="toolbar">toolbar</option> 
    209280        <option value="panel">panel</option> 
    210281      </select> 
    211282    </div> 
    212                 <p /> 
    213        
     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 /> 
     292 
    214293  <div id="buttons"> 
    215294    <button type="submit" name="ok" onclick="return onOK();">OK</button> 
  • trunk/examples/ext_example-body.html

    r385 r433  
    2121      return false; 
    2222    } 
    23     window.onerror = showError; 
    24     document.onerror = showError; 
    25  
    26     var f = window.parent.menu.document.forms[0]; 
     23    var f = top.frames["menu"].document.forms["fsettings"]; 
    2724    // You must set _editor_url to the URL (including trailing slash) where 
    2825    // where xinha is installed, it's highly recommended to use an absolute URL 
     
    3229    // in this example we do a little regular expression to find the absolute path. 
    3330    _editor_url  = document.location.href.replace(/examples\/ext_example-body\.html.*/, '') 
    34     _editor_lang = f.lang.value; // And the language we need to use in the editor. 
    35     _editor_skin = f.skin.value; // the skin we use in the editor 
     31    _editor_lang = f.lang[f.lang.selectedIndex].value; // the language we need to use in the editor. 
     32    _editor_skin = f.skin[f.skin.selectedIndex].value; // the skin we use in the editor 
    3633  </script> 
    3734 
     
    4643     
    4744    xinha_init = xinha_init ? xinha_init : function() { 
    48       var f = window.parent.menu.document.forms[0]; 
     45      window.onerror = showError; 
     46      document.onerror = showError; 
     47 
     48      var f = top.frames["menu"].document.forms["fsettings"]; 
    4949// What are the plugins you will be using in the editors on this page. 
    5050// List all the plugins you will need, even if not all the editors will use all the plugins. 
     
    8787 
    8888// Create a default configuration to be used by all the editors. 
     89      settings = top.frames["menu"].settings; 
    8990      xinha_config = new HTMLArea.Config(); 
    90       if (f.width) xinha_config.width = f.width.value; 
    91       if (f.height) xinha_config.height = f.height.value; 
    92       if (f.sizeIncludesBars) xinha_config.sizeIncludesBars = f.sizeIncludesBars.value; 
    93       if (f.statusBar) xinha_config.statusBar = f.statusBar.value; 
    94       if (f.mozParaHandler) xinha_config.mozParaHandler = f.mozParaHandler.value; 
    95       if (f.undoSteps) xinha_config.undoSteps = f.undoSteps.value; 
    96       if (f.baseHref) xinha_config.baseHref = f.baseHref.value; 
    97       if (f.stripBaseHref) xinha_config.stripBaseHref = f.stripBaseHref.value; 
    98       if (f.stripSelfNamedAnchors) xinha_config.stripSelfNamedAnchors = f.stripSelfNamedAnchors.value; 
    99       if (f.only7BitPrintablesInURLs) xinha_config.only7BitPrintablesInURLs = f.only7BitPrintablesInURLs.value; 
    100       if (f.sevenBitClean) xinha_config.sevenBitClean = f.sevenBitClean.value; 
    101       if (f.killWordOnPaste) xinha_config.killWordOnPaste = f.killWordOnPaste.value; 
    102       if (f.flowToolbars) xinha_config.flowToolbars = f.flowToolbars.value; 
    103       if ((typeof CharacterMap != 'undefined') && (f.CharacterMapMode)) xinha_config.CharacterMap.mode = f.CharacterMapMode.value; 
    104       if ((typeof ListType != 'undefined') && (f.ListTypeMode)) xinha_config.ListType.mode = f.ListTypeMode.value; 
     91      xinha_config.width = settings.width; 
     92      xinha_config.height = settings.height; 
     93      xinha_config.sizeIncludesBars = settings.sizeIncludesBars; 
     94      xinha_config.statusBar = settings.statusBar; 
     95      xinha_config.mozParaHandler = settings.mozParaHandler; 
     96      xinha_config.undoSteps = settings.undoSteps; 
     97      xinha_config.baseHref = settings.baseHref; 
     98      xinha_config.stripBaseHref = settings.stripBaseHref; 
     99      xinha_config.stripSelfNamedAnchors = settings.stripSelfNamedAnchors; 
     100      xinha_config.only7BitPrintablesInURLs = settings.only7BitPrintablesInURLs; 
     101      xinha_config.sevenBitClean = settings.sevenBitClean; 
     102      xinha_config.killWordOnPaste = settings.killWordOnPaste; 
     103      xinha_config.flowToolbars = settings.flowToolbars; 
     104      xinha_config.showLoading = settings.showLoading; 
     105 
     106      if (typeof CharCounter != 'undefined') { 
     107        xinha_config.CharCounter.showChar = settings.showChar; 
     108        xinha_config.CharCounter.showWord = settings.showWord; 
     109        xinha_config.CharCounter.showHtml = settings.showHtml; 
     110      } 
     111 
     112      if (typeof CharacterMap != 'undefined') xinha_config.CharacterMap.mode = settings.CharacterMapMode; 
     113      if (typeof ListType != 'undefined') xinha_config.ListType.mode = settings.ListTypeMode; 
    105114 
    106115      if(typeof CSS != 'undefined') { 
     
    148157        InsertPicture.PicturePath = '/schmal/pictures/'; 
    149158      } 
    150                          
     159 
    151160      if(typeof Filter != 'undefined') { 
    152161        xinha_config.Filters = ["Word", "Paragraph"]; 
     
    173182    } 
    174183 
     184// javascript submit handler 
     185// this shows how to create a javascript submit button that works with the htmleditor. 
     186    submitHandler = function(formname) { 
     187      var form = document.getElementById(formname); 
     188      // in order for the submit to work both of these methods have to be called. 
     189      form.onsubmit(); 
     190      window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value; 
     191      form.submit(); 
     192      return true; 
     193    } 
     194 
    175195    window.onload = xinha_init; 
     196//    window.onunload = HTMLArea.collectGarbageForIE; 
    176197  </script> 
    177198</head> 
    178199 
    179200<body> 
    180   <form id="to_submit" method="post" action="ext_example-dest.php"> 
    181   <div id="editors_here"></div> 
    182   <button type="submit">Submit</button> 
    183   <textarea id="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;"> --> 
     201  <form id="to_submit" name="to_submit" method="post" action="ext_example-dest.php"> 
     202  <div id="editors_here" name="editors_here"></div> 
     203  <button type="button" onclick="submitHandler('to_submit');">Submit</button> 
     204  <textarea id="errors" name="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;" --> 
    184205  </form> 
    185 <script type="text/javascript"> 
    186     var _oldSubmitHandler = null; 
    187     if (document.forms[0].onsubmit != null) { 
    188       _oldSubmitHandler = document.forms[0].onsubmit; 
    189     } 
    190     function frame_onSubmit(){ 
    191       document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value.replace(/^[\r\n]+|\s+$/, '') 
    192       window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value; 
    193       if (_oldSubmitHandler != null) { 
    194         _oldSubmitHandler(); 
    195       } 
    196     } 
    197     document.forms[0].onsubmit = frame_onSubmit; 
    198 </script> 
    199206</body> 
    200207</html> 
  • trunk/examples/ext_example-menu.php

    r336 r433  
    22  $LocalPluginPath = dirname(dirname(__FILE__)).'\plugins'; 
    33  $LocalSkinPath = dirname(dirname(__File__)).'\skins'; 
    4 ?>   
     4?> 
    55<html> 
    66<head> 
     
    2626  </style> 
    2727  <script language="JavaScript" type="text/javascript"> 
    28    
     28  var settings = null; 
     29  settings = { 
     30    width: "auto", 
     31    height: "auto", 
     32    sizeIncludesBars: true, 
     33    statusBar: true, 
     34    mozParaHandler: "best", 
     35    undoSteps: 20, 
     36    baseHref: null, 
     37    stripBaseHref: true, 
     38    stripSelfNamedAnchors: true, 
     39    only7BitPrintablesInURLs: true, 
     40    sevenBitClean: false, 
     41    killWordOnPaste: true, 
     42    flowToolbars: true, 
     43    CharacterMapMode: "popup", 
     44    ListTypeMode: "toolbar", 
     45    showLoading: false, 
     46    showChar: true, 
     47    showWord: true, 
     48    showHtml: true 
     49  }; 
     50 
     51 
    2952    function getCookieVal (offset) { 
    3053      var endstr = document.cookie.indexOf (";", offset); 
     
    4467          return getCookieVal (j); 
    4568        i = document.cookie.indexOf(" ", i) + 1; 
    46         if (i == 0) break;  
     69        if (i == 0) break; 
    4770      } 
    4871      return null; 
     
    7295    } else { 
    7396      sHeight = 30 
    74     }   
     97    } 
    7598    var div = document.getElementById("div_plugins"); 
    7699    div.style.height = sHeight + "px"; 
    77100  } 
    78    
     101 
    79102function Dialog(url, action, init) { 
    80103        if (typeof init == "undefined") { 
     
    144167 
    145168  function fExtended () { 
    146         var outparam = { width: document.getElementById("width").value, 
    147                      height: document.getElementById("height").value, 
    148                      sizeIncludesBars: document.getElementById("sizeIncludesBars").value, 
    149                      statusBar: document.getElementById("statusBar").value, 
    150                      mozParaHandler: document.getElementById("mozParaHandler").value, 
    151                      undoSteps: document.getElementById("undoSteps").value, 
    152                      baseHref: document.getElementById("baseHref").value, 
    153                      stripBaseHref: document.getElementById("stripBaseHref").value, 
    154                      stripSelfNamedAnchors: document.getElementById("stripSelfNamedAnchors").value, 
    155                      only7BitPrintablesInURLs: document.getElementById("only7BitPrintablesInURLs").value, 
    156                      sevenBitClean: document.getElementById("sevenBitClean").value, 
    157                      killWordOnPaste: document.getElementById("killWordOnPaste").value, 
    158                      flowToolbars: document.getElementById("flowToolbars").value, 
    159                      CharacterMapMode: document.getElementById("CharacterMapMode").value, 
    160                      ListTypeMode: document.getElementById("ListTypeMode").value 
    161                    }; 
    162           Dialog("Extended.html", function(param) { 
     169    Dialog("Extended.html", function(param) { 
    163170      if(param) { 
    164                     document.getElementById("width").value = param["width"]; 
    165                     document.getElementById("height").value = param["height"]; 
    166         document.getElementById("sizeIncludesBars").value = param["sizeIncludesBars"]; 
    167         document.getElementById("statusBar").value = param["statusBar"]; 
    168         document.getElementById("mozParaHandler").value = param["mozParaHandler"]; 
    169         document.getElementById("undoSteps").value = param["undoSteps"]; 
    170         document.getElementById("baseHref").value = param["baseHref"]; 
    171         document.getElementById("stripBaseHref").value = param["stripBaseHref"]; 
    172         document.getElementById("stripSelfNamedAnchors").value = param["stripSelfNamedAnchors"]; 
    173         document.getElementById("only7BitPrintablesInURLs").value = param["only7BitPrintablesInURLs"]; 
    174         document.getElementById("sevenBitClean").value = param["sevenBitClean"]; 
    175         document.getElementById("killWordOnPaste").value = param["killWordOnPaste"]; 
    176         document.getElementById("flowToolbars").value = param["flowToolbars"]; 
    177                 document.getElementById("CharacterMapMode").value = param["CharacterMapMode"]; 
    178         document.getElementById("ListTypeMode").value = param["ListTypeMode"]; 
    179                   } 
    180                 }, outparam ); 
     171        settings.width = param["width"]; 
     172        settings.height = param["height"]; 
     173        settings.sizeIncludesBars = (param["sizeIncludesBars"]=="true"); 
     174        settings.statusBar = (param["statusBar"]=="true"); 
     175        settings.mozParaHandler = param["mozParaHandler"]; 
     176        settings.undoSteps = param["undoSteps"]; 
     177        settings.baseHref = param["baseHref"]; 
     178        settings.stripBaseHref = (param["stripBaseHref"]=="true"); 
     179        settings.stripSelfNamedAnchors = (param["stripSelfNamedAnchors"]=="true"); 
     180        settings.only7BitPrintablesInURLs = (param["only7BitPrintablesInURLs"]=="true"); 
     181        settings.sevenBitClean = (param["sevenBitClean"]=="true"); 
     182        settings.killWordOnPaste = (param["killWordOnPaste"]=="true"); 
     183        settings.flowToolbars = (param["flowToolbars"]=="true"); 
     184        settings.CharacterMapMode = param["CharacterMapMode"]; 
     185        settings.ListTypeMode = param["ListTypeMode"]; 
     186        settings.showLoading = (param["showLoading"]=="true"); 
     187        settings.showChar = (param["showChar"]=="true"); 
     188        settings.showWord = (param["showWord"]=="true"); 
     189        settings.showHtml = (param["showHtml"]=="true"); 
     190      } 
     191    }, settings ); 
    181192  } 
    182193 
     
    198209        } 
    199210      } 
    200     }   
     211    } 
    201212    _onResize(); 
    202213  }; 
    203    
     214 
    204215  window.onresize = _onResize; 
    205216  window.onload = init; 
     
    208219 
    209220<body> 
    210   <form action="ext_example-body.html" target="body"> 
     221  <form action="ext_example-body.html" target="body" name="fsettings" id="fsettings"> 
    211222  <h1>Xinha Example</h1> 
    212223    <fieldset> 
     
    234245        while (false !== ($entry = $d->read()))  //not a dot file or directory 
    235246        {       if(substr($entry,0,1) != '.') 
    236                 { echo '<option value="' . $entry . '"> ' . $entry . '</option>'; 
     247                { echo '<option value="' . $entry . '"> ' . $entry . '</option>'."\n"; 
    237248                } 
    238249        } 
     
    241252          </select> 
    242253        </label> 
    243         <input type="hidden" id="width" name="width" value="auto" /> 
    244         <input type="hidden" id="height" name="height" value="auto" /> 
    245         <input type="hidden" id="sizeIncludesBars" name="sizeIncludeBars" value="true" /> 
    246         <input type="hidden" id="statusBar" name="statusBar" value="true" /> 
    247         <input type="hidden" id="mozParaHandler" name="mozParaHandler" value="best" /> 
    248         <input type="hidden" id="undoSteps" name="undoSteps" value="20" /> 
    249         <input type="hidden" id="baseHref" name="baseHref" value="null" /> 
    250         <input type="hidden" id="stripBaseHref" name="stripBaseHref" value="true" /> 
    251         <input type="hidden" id="stripSelfNamedAnchors" name="stripSelfNamedAnchors" value="true" /> 
    252         <input type="hidden" id="only7BitPrintablesInURLs" name="only7BitPrintablesInURLs" value="true" /> 
    253         <input type="hidden" id="sevenBitClean" name="sevenBitClean" value="false" /> 
    254         <input type="hidden" id="killWordOnPaste" name="killWordOnPaste" value="true" /> 
    255         <input type="hidden" id="flowToolbars" name="flowToolbars" value="true" /> 
    256         <input type="hidden" id="CharacterMapMode" name="CharacterMapMode" value="popup" /> 
    257         <input type="hidden" id="ListTypeMode" name="ListTypeMode" value="toolbar" /> 
    258254        <center><input type="button" value="extended Settings" onClick="fExtended();" /></center> 
    259255 
     
    266262        while (false !== ($entry = $d->read()))  //not a dot file or directory 
    267263        {       if(substr($entry,0,1) != '.') 
    268                 { echo '<label><input type="checkbox" name="plugins" value="' . $entry . '"> ' . $entry . '</label>'; 
     264                { echo '<label><input type="checkbox" name="plugins" id="plugins" value="' . $entry . '"> ' . $entry . '</label>'."\n"; 
    269265                } 
    270266        } 
     
    274270    </fieldset> 
    275271    <center><button type="submit">reload editor</button></center> 
    276      
     272 
    277273        <textarea id="myTextarea0" style="display:none"> 
    278274          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
     
    293289          </ul> 
    294290        </textarea> 
    295          
     291 
    296292  </form> 
    297293  <script type="text/javascript"> 
     
    309305      var s_value=''; 
    310306      for(var x = 0; x < document.forms[0].plugins.length; x++) { 
    311         if(document.forms[0].plugins[x].checked)  
     307        if(document.forms[0].plugins[x].checked) 
    312308          s_value += document.forms[0].plugins[x].value + '/'; 
    313309      } 
  • trunk/examples/ext_example.html

    r324 r433  
    1111 
    1212  <frameset cols="240,*"> 
    13     <frame src="ext_example-menu.php" name="menu"> 
    14     <frame src="about:blank" name="body"> 
     13    <frame src="ext_example-menu.php" name="menu" id="menu"> 
     14    <frame src="about:blank" name="body" id="body"> 
    1515  </frameset> 
    1616</html> 
  • trunk/plugins/CharCounter/char-counter.js

    r432 r433  
    1717 
    1818CharCounter._pluginInfo = { 
    19     name : "CharCounter", 
    20     version : "1.1", 
    21     developer : "Udo Schmal", 
     19    name          : "CharCounter", 
     20    version       : "1.1", 
     21    developer     : "Udo Schmal", 
    2222    developer_url : "http://www.schaffrath-neuemedien.de", 
    2323    sponsor       : "L.N.Schaffrath NeueMedien", 
    2424    sponsor_url   : "http://www.schaffrath-neuemedien.de", 
    25     c_owner : "Udo Schmal & L.N.Schaffrath NeueMedien", 
    26     license : "htmlArea" 
     25    c_owner       : "Udo Schmal & L.N.Schaffrath NeueMedien", 
     26    license       : "htmlArea" 
    2727}; 
    2828 
     
    8888    string[string.length] = this._lc("HTML") + ": " + contents.length; 
    8989  } 
    90         if (cfg.CharCounter.showWord) { 
     90  if (cfg.CharCounter.showWord || cfg.CharCounter.showChar) { 
    9191    contents = contents.replace(/<\/?\s*!--[^-->]*-->/gi, "" ); 
    9292    contents = contents.replace(/<(.+?)>/g, '');//Don't count HTML tags 
     
    9696    contents = contents.replace(/&(.*);/g, ' ');//Count htmlentities as one keystroke 
    9797    contents = contents.replace(/^\s*|\s*$/g, '');//trim 
     98  } 
     99  if (cfg.CharCounter.showWord) { 
    98100    var words=0; 
    99     for (var x=0;x<contents.length;x++) 
     101    for (var x=0;x<contents.length;x++)  
    100102    { 
    101103      if (contents.charAt(x) == " " ) {words++;} 
    102104    } 
    103   if (words>=1) { words = words+1; } 
     105    if (words>=1) { words++; } 
    104106    string[string.length] = this._lc("Words") + ": " + words; 
    105107  } 
Note: See TracChangeset for help on using the changeset viewer.