Multiple editors not working properly

Last post 09-07-2012, 11:21 AM by cosmonaut. 7 replies.
Sort Posts: Previous Next
  •  08-01-2012, 12:19 PM 74332

    Multiple editors not working properly

    I am trying to get multiple editors to show on one page, but this is not working correctly in Firefox (version 14). Even the live demo is having issues:
    http://phphtmledit.com/Multiple.php (top IE9, bottom FF14)
     
     
     
     
  •  08-01-2012, 2:25 PM 74333 in reply to 74332

    Re: Multiple editors not working properly

    Hi GalaGalaxia,
     
    I can reproduce it on the demo too. Please try the example page below, does it work on your end?
     
    1. <?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>  
    2. <html>  
    3.   <head>  
    4.       <title>example</title>  
    5.   </head>  
    6.   <body>  
    7.     <form name="theForm">  
    8.       
    9.       <?php  
    10.               $editor=new CuteEditor();  
    11.               $editor->ID="Editor1";  
    12.               $editor->ThemeType="Office2003";  
    13.               $editor->Draw();  
    14.               $editor=null;  
    15.                 
    16.               echo "<br /><br />";                  
    17.                 
    18.               $editor=new CuteEditor();  
    19.               $editor->ID="Editor2";  
    20.               $editor->AutoConfigure="Simple";  
    21.               $editor->Draw();  
    22.               $editor=null;  
    23.           ?>  
    24.           </form>  
    25.   </body>  
    26. </html>  
    Regards,
     
    Ken 
  •  08-01-2012, 2:39 PM 74334 in reply to 74333

    Re: Multiple editors not working properly

    Yes, that works.
  •  08-01-2012, 2:53 PM 74335 in reply to 74334

    Re: Multiple editors not working properly

    Any idea why there might be an issue? Right now, I'm using JavaScript to "fix" the editors after they have rendered.
  •  08-02-2012, 8:47 AM 74339 in reply to 74335

    Re: Multiple editors not working properly

    Hi GalaGalaxia,
     
    I think is the editor OnInitialized method work not correct on firefox, we will improve it in next version. Sorry for your inconvenience.
     
    Regards,
     
    Ken 
  •  08-02-2012, 12:48 PM 74341 in reply to 74339

    Re: Multiple editors not working properly

    Alright. Was just curious if there was anything I could do to address this on my end. I'll leave the JavaScript fix in place.
     
    Essentially, I have to reset the cursor, manually set the width of the class/font/size/style dropdown boxes, and then set the height of the editor table and editor iframe ...
     
    Minor annoyance, but it works fine otherwise.
  •  08-07-2012, 10:23 AM 74360 in reply to 74341

    Re: Multiple editors not working properly

    It seems multiple editors per page is broken. The second instance on the page seems to work properly, however the first does not behave correctly. For an example, see:
     
    <!DOCTYPE html>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta charset="utf-8">
    <title>wysihtml5 - multiple editors</title>
    <style>
      body {
        font-family: Verdana;
        font-size: 11px;
      }
      
      h2 {
        margin-bottom: 0;
      }
      
      small {
        display: block;
        margin-top: 40px;
        font-size: 9px;
      }
      
      small,
      small a {
        color: #666;
      }
      
      a {
        color: #000;
        text-decoration: underline;
        cursor: pointer;
      }
      
      #toolbar [data-wysihtml5-action] {
        float: right;
        margin-right: 10px;
      }
      
      #toolbar_two [data-wysihtml5-action] {
        float: right;
        margin-right: 10px;
      }
      #toolbar, textarea {
        width: 600px;
        padding: 5px;
      }
      
      #toolbar_two, textarea {
        width: 600px;
        padding: 5px;
      }
      textarea {
        height: 280px;
        border: 2px solid green;
        box-sizing: boder-box;
        -webkit-box-sizing: border-box;
        -ms-box-sizing: border-box;
        -moz-box-sizing: border-box;
        font-family: Verdana;
        font-size: 11px;
      }
      
      textarea:focus {
        color: black;
        border: 2px solid black;
      }
      
      .wysihtml5-command-active {
        font-weight: bold;
      }
    </style>
    <h1>wysihtml5 - Multiple Editors Example</h1>
    <p>Multiple editor instances on a page
    </p>
    <form>
      <div id="toolbar" style="display: none;">
        <a data-wysihtml5-command="bold" title="CTRL+B">bold</a> |
        <a data-wysihtml5-command="italic" title="CTRL+I">italic</a>
        <a data-wysihtml5-action="change_view">switch to html view</a>
      </div>
      <textarea id="textarea" placeholder="Enter text ..."></textarea>
      <hr>
      <div id="toolbar_two" style="display: none;">
        <a data-wysihtml5-command="bold" title="CTRL+B">bold</a> |
        <a data-wysihtml5-command="italic" title="CTRL+I">italic</a>
        <a data-wysihtml5-action="change_view">switch to html view</a>
      </div>
      <textarea id="textarea_two" placeholder="Enter text ..."></textarea>
    </form>
    <h2>Events:</h2>
    <div id="log"></div>
    <small>powered by <a href="https://github.com/xing/wysihtml5" target="_blank">wysihtml5</a>.</small>
    <script src="../parser_rules/simple.js"></script>
    <script src="../dist/wysihtml5-0.3.0_rc1.js"></script>
    <script>
      var editor = new wysihtml5.Editor("textarea", {
        toolbar: "toolbar",
        parserRules: wysihtml5ParserRules
      });
      
      var log = document.getElementById("log");
      
      editor
        .on("load", function() {
          log.innerHTML += "<div>load</div>";
        })
        .on("focus", function() {
          log.innerHTML += "<div>focus</div>";
        })
        .on("blur", function() {
          log.innerHTML += "<div>blur</div>";
        })
        .on("change", function() {
          log.innerHTML += "<div>change</div>";
        })
        .on("paste", function() {
          log.innerHTML += "<div>paste</div>";
        })
        .on("newword:composer", function() {
          log.innerHTML += "<div>newword:composer</div>";
        })
        .on("undo:composer", function() {
          log.innerHTML += "<div>undo:composer</div>";
        })
        .on("redo:composer", function() {
          log.innerHTML += "<div>redo:composer</div>";
        });
        var editor_two = new wysihtml5.Editor("textarea_two", {
          toolbar: "toolbar_two",
          parserRules: wysihtml5ParserRules
        });
    </script>
    Is this a known limitation, or is there much standing in the way of it working?
    Is this a known limitation, or is there much standing in the way of it working?
     


    Best Regards,
    Navin Patel-Affiliate Manager
    Minisuit Affiliate Program
    Minisuit DOT com
  •  09-07-2012, 11:21 AM 74598 in reply to 74335

    Re: Multiple editors not working properly

    any estimated timeframe for a fix?

     

    i think i am having a similar error... multiple editors fail in firefox.

     

    firebug also throws the error: 

    TypeError: Ox259 is null

View as RSS news feed in XML