diff --git a/wysiwyg.css b/wysiwyg.css index 97feb56..d4357d4 100644 --- a/wysiwyg.css +++ b/wysiwyg.css @@ -1,11 +1,3 @@ -body { - margin: 0; - height: 100vh; - display: flex; - justify-content: center; - align-items: center; - font-family: 'Helvetica Neue', 'Helvetica', arial, sans-serif; -} .wysiwyg { width: 40rem; min-height: 18rem; diff --git a/wysiwyg.js b/wysiwyg.js index 015bd65..b9f7581 100644 --- a/wysiwyg.js +++ b/wysiwyg.js @@ -1,4 +1,99 @@ -const editor = document.getElementsByClassName('editor')[0]; +function initWYSIWYG() { + $('.wysiwyg').html('
'+ + '
'+ + ' '+ + '
'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
'+ + ' '+ + '
'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
'+ + '
'+ + ' '+ + ' '+ + ' '+ + '
'+ + ' '+ + '
'+ + '
'+ + ' '+ + '
'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
'+ + ' '+ + '
'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
'+ + '
'+ + ' '+ + ' '+ + ' '+ + '
'+ + ' '+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'); +} + +initWYSIWYG(); + +const editor = document.getElementsByClassName('wysiwyg')[0]; +console.log(editor); const toolbar = editor.getElementsByClassName('toolbar')[0]; const buttons = toolbar.querySelectorAll('.btn:not(.has-submenu)'); for(let i = 0; i < buttons.length; i++) { @@ -42,98 +137,4 @@ function execLinkAction() { } function execDefaultAction(action) { document.execCommand(action, false); -} - -function initWYSIWYG() { - $('wysiwyg').html('
-
- -
- - - - - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- -
- - - - - - -
- -
- - - - - - -
-
- - - -
- -
-
-
-
-
- -
'); -} - -initWYSIWYG(); \ No newline at end of file +} \ No newline at end of file