bootstrap-ui-inner.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
  5. <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  6. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
  7. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
  8. </head>
  9. <body>
  10. <!-- The outermost cotainer of the editor. -->
  11. <div class="ck-editor">
  12. <!-- The toolbar of the editor. -->
  13. <div class="btn-toolbar" role="toolbar" aria-label="Editor toolbar">
  14. <!-- The headings dropdown. -->
  15. <div class="btn-group mr-2" role="group" aria-label="Headings">
  16. <div class="dropdown" id="heading">
  17. <button class="btn btn-primary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Headings</span></button>
  18. <div class="dropdown-menu" aria-labelledby="heading-button"></div>
  19. </div>
  20. </div>
  21. <!-- Basic styles buttons. -->
  22. <div class="btn-group mr-2" role="group" aria-label="Basic styles">
  23. <button type="button" class="btn btn-primary btn-sm" id="bold">B</button>
  24. <button type="button" class="btn btn-primary btn-sm" id="italic">I</button>
  25. <button type="button" class="btn btn-primary btn-sm" id="underline">U</button>
  26. </div>
  27. <!-- Undo and redo buttons. -->
  28. <div class="btn-group mr-2" role="group" aria-label="Undo">
  29. <button type="button" class="btn btn-primary btn-sm" id="undo">&#x2190;</button>
  30. <button type="button" class="btn btn-primary btn-sm" id="redo">&#x2192;</button>
  31. </div>
  32. </div>
  33. <!-- The container containing data of the editor. -->
  34. <div id="editor">
  35. <h2>Custom UI</h2>
  36. <p>
  37. This editor uses <b>Bootstrap</b> components to build the user interface.
  38. </p>
  39. </div>
  40. </div>
  41. <button type="button" id="toggle-readonly">Toggle editor read&#x2013;only</button>
  42. <style>
  43. body {
  44. padding: 0 .2em;
  45. }
  46. /* Let's give the editor some space and limits using a border. */
  47. .ck-editor {
  48. margin: 0 0 1em;
  49. border: 1px solid hsla(0, 0%, 0%, 0.1);
  50. border-radius: 4px;
  51. }
  52. /* Adding internal spacing, border and background to the toolbar. */
  53. .ck-editor .btn-toolbar {
  54. padding: .5rem;
  55. background: #f7f7f9;
  56. border-bottom: 1px solid hsla(0, 0%, 0%, 0.1);
  57. }
  58. /* Tweaking the editable area for better readability. */
  59. .ck-editor .ck-editor__editable {
  60. padding: 2em 2em 1em;
  61. overflow: auto;
  62. height: 300px;
  63. }
  64. /* When in read–only mode, the editable should fade out. */
  65. .ck-editor .ck-editor__editable.ck-read-only {
  66. background: #fafafa;
  67. color: hsl(0, 0%, 47%);
  68. }
  69. /* Make sure the headings dropdown button does not change its size
  70. as different headings are selected */
  71. .ck-editor .dropdown-toggle span {
  72. display: inline-block;
  73. width: 100px;
  74. text-align: left;
  75. overflow: hidden;
  76. text-overflow: ellipsis;
  77. vertical-align: bottom;
  78. }
  79. /* Make the headings dropdown items visually distinctive. */
  80. .ck-editor .heading-item_heading1 { font-size: 1.5em; }
  81. .ck-editor .heading-item_heading2 { font-size: 1.3em; }
  82. .ck-editor .heading-item_heading3 { font-size: 1.1em; }
  83. .ck-editor [class*="heading-item_"] {
  84. line-height: 22px;
  85. padding: 10px;
  86. }
  87. .ck-editor [class*="heading-item_heading"] {
  88. font-weight: bold;
  89. }
  90. /* Give the basic styles buttons some icon–like shape */
  91. .ck-editor #bold { font-weight: bold; }
  92. .ck-editor #italic { font-style: italic; }
  93. .ck-editor #underline { text-decoration: underline; }
  94. /* https://github.com/ckeditor/ckeditor5/issues/903 */
  95. .ck-editor .ck-content > :first-child {
  96. margin-top: 0;
  97. }
  98. </style>
  99. </body>
  100. </html>