form-post.html 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>A tiny, opensource, Bootstrap WYSIWYG rich text editor</title>
  8. <link href="../bower_components/google-code-prettify/src/prettify.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
  10. <link href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" />
  11. <link href="../css/style.css" rel="stylesheet" />
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>Simple HTML Editor</h1>
  16. <div class="btn-toolbar" data-role="editor-toolbar"
  17. data-target="#editor">
  18. <div class="btn-group">
  19. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Font Size"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></a>
  20. <ul class="dropdown-menu">
  21. <li><a data-edit="fontSize 5" class="fs-Five">Huge</a></li>
  22. <li><a data-edit="fontSize 3" class="fs-Three">Normal</a></li>
  23. <li><a data-edit="fontSize 1" class="fs-One">Small</a></li>
  24. </ul>
  25. </div>
  26. <div class="btn-group">
  27. <a class="btn btn-default" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
  28. <a class="btn btn-default" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
  29. <a class="btn btn-default" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
  30. <a class="btn btn-default" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
  31. </div>
  32. <div class="btn-group">
  33. <a class="btn btn-default" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
  34. <a class="btn btn-default" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
  35. <a class="btn btn-default" data-edit="outdent" title="Reduce indent (Shift+Tab)"><i class="fa fa-outdent"></i></a>
  36. <a class="btn btn-default" data-edit="indent" title="Indent (Tab)"><i class="fa fa-indent"></i></a>
  37. </div>
  38. <div class="btn-group">
  39. <a class="btn btn-default" data-edit="justifyleft" title="Align Left (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
  40. <a class="btn btn-default" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
  41. <a class="btn btn-default" data-edit="justifyright" title="Align Right (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
  42. <a class="btn btn-default" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
  43. </div>
  44. <div class="btn-group">
  45. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Hyperlink"><i class="fa fa-link"></i></a>
  46. <div class="dropdown-menu input-append">
  47. <input placeholder="URL" type="text" data-edit="createLink" />
  48. <button class="btn" type="button">Add</button>
  49. </div>
  50. </div>
  51. <div class="btn-group">
  52. <a class="btn btn-default" data-edit="unlink" title="Remove Hyperlink"><i class="fa fa-unlink"></i></a>
  53. <span class="btn btn-default" title="Insert picture (or just drag & drop)" id="pictureBtn"> <i class="fa fa-picture-o"></i>
  54. <input class="imgUpload" type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
  55. </span>
  56. </div>
  57. <div class="btn-group">
  58. <a class="btn btn-default" data-edit="undo" title="Undo (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
  59. <a class="btn btn-default" data-edit="redo" title="Redo (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
  60. <a class="btn btn-default" data-edit="html" title="Clear Formatting"><i class='glyphicon glyphicon-pencil'></i></a>
  61. </div>
  62. </div>
  63. <div id="editorPreview"></div>
  64. <form action="php/upload.php" method="post" enctype="multipart/form-data" id='submitForm'>
  65. <div id="editor" class="lead" data-placeholder="This is a basic example with a simple toolbar."></div>
  66. <a class="btn btn-large btn-default jumbo" href="#!" onClick="$('#mySubmission').val($('#editor').cleanHtml(true));$('#submitForm').submit();">Submit</a>
  67. <input type='hidden' name='formSubmission' id='mySubmission'/>
  68. </form>
  69. </div>
  70. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  71. <script src="../bower_components/jquery.hotkeys/jquery.hotkeys.js"></script>
  72. <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  73. <script src="../bower_components/google-code-prettify/src/prettify.js"></script>
  74. <script src="../src/bootstrap-wysiwyg.js"></script>
  75. <script type='text/javascript'>
  76. $('#editor').wysiwyg(
  77. {
  78. 'form':
  79. {
  80. 'text-field': 'mySubmission',
  81. 'seperate-binary': false
  82. }
  83. });
  84. $(".dropdown-menu > input").click(function (e) {
  85. e.stopPropagation();
  86. });
  87. </script>
  88. </body>
  89. </html>