Gistsvilla Support



Join the forum, it's quick and easy

Gistsvilla Support

Gistsvilla Support

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Welcome to Gistsvilla Support Board. This is Created to support web developments and Informative sections.


    Looking for advice on a Content Editable based Rich Text Editor.

    Gistsvilla
    Gistsvilla
    Novice
    Novice


    Posts : 26
    Points : 91821
    Reputation : 3
    Join date : 2016-06-18
    Age : 27
    Location : India

    Looking for advice on a Content Editable based Rich Text Editor. Empty Looking for advice on a Content Editable based Rich Text Editor.

    Post by Gistsvilla Tue Jun 21, 2016 3:50 am

    Hello!
    Yeah I know why do I need to do this, well

    1) Never done it before
    2) I am learning the concepts of HTML5/JS
    3) I wanna make it look good and not sloppy, as learning sloppy will make you sloppy when you have a job to do.

    What I have so far all works wonderfully except...
    How do I create a button bar that wont click out of the ediable area when i click the button for eample paste, when i go to click it, it just clicks out of the ediable area and doesnt do anything.

    Notice I did attempt to make the toolbar, but it didn't work. I am not worried about the pictures on the buttons just yet, but while I am thinking about it how do I resize them, the same as the rest? the width/height

    Thanks!

    My code:

    Code:
    <!Doctype>
    <header>
    <script type="text/javascript">
    function ShowResult()
    {
        my_window = window.open("about:blank", "mywindow1");
        my_window.document.write(x);
    }
    </script>
    <style>
    .selector
    {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
    }
    </style>
    </header>
    <body>
    <div class="selector">
     <button onclick="ShowResult()">see result!</button><button  onclick="document.execCommand('bold',false,null);">Bold</button>
    <button  onclick="document.execCommand('italic',false,null);">Italic</button> <button onclick="document.execCommand('saveas',false,null);">SaveAs</button><button onclick="document.execCommand('justifyCenter',false,null);"> Align Center</button>
    <button onclick="document.execCommand('justifyLeft',false,null);">Align Left</button>
    <button onclick="document.execCommand('justifyRight',false,null);"> Align Right</button>
    <button onclick="document.execCommand('removeFormat',false,null);">Remove Format</button>
    <button onclick="document.execCommand('cut',false,null);">Cut</button>
    <button onclick="document.execCommand('copy',false,null);">Copy</button>
    <button onclick="document.execCommand('paste',false,null);">Paste</button>
    <button onclick="document.execCommand('undo',false,null);">Undo</button>
    <button onclick="document.execCommand('redo',false,null);">Redo</button>
    <button onclick="document.execCommand('insertimage',false,null);">Insert Image</button>
    <button onclick="document.execCommand('createlink',false,null);">Link</button>
    <button onclick="document.execCommand('Heading1',false,null);">Heading</button>
    <button onclick="document.execCommand('increaseFontSize',false,null);">Increase Font Size </button>
    </div>
    <div contenteditable  style="height:400px;width:750px;overflow:auto;" onblur="x=this.value"> 
    Try editing this content... go on... select me with your cursor then write over the top of me!
    </div>
    </body>
    </html>
    Gistsvilla
    Gistsvilla
    Novice
    Novice


    Posts : 26
    Points : 91821
    Reputation : 3
    Join date : 2016-06-18
    Age : 27
    Location : India

    Looking for advice on a Content Editable based Rich Text Editor. Empty Re: Looking for advice on a Content Editable based Rich Text Editor.

    Post by Gistsvilla Tue Jun 28, 2016 12:44 pm

    Nice one bro. It helps a lot Smile

      Current date/time is Fri Nov 01, 2024 6:34 am