]> BookStack Code Mirror - bookstack/blob - resources/views/pages/form.blade.php
Vastly improved design and cleaned text input
[bookstack] / resources / views / pages / form.blade.php
1
2
3
4 <div class="page-style editor">
5
6     {{ csrf_field() }}
7     <div class="title-input page-title clearfix">
8         <div class="input">
9             @include('form/text', ['name' => 'name', 'placeholder' => 'Enter Page Title'])
10         </div>
11     </div>
12     <div class="edit-area">
13         @include('form/textarea', ['name' => 'html'])
14     </div>
15     <div class="margin-top large">
16         <button type="submit" class="button pos">Save Page</button>
17     </div>
18 </div>
19
20
21
22
23
24 <script>
25     $(function() {
26         //ImageManager.show('#image-manager');
27
28         tinymce.init({
29             selector: '.edit-area textarea',
30             content_css: '/css/app.css',
31             body_class: 'page-content',
32             relative_urls: false,
33             statusbar: false,
34             height: 600,
35             plugins: "image table textcolor paste link imagetools",
36             toolbar: "undo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image link | fontsizeselect full",
37             content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important; margin-left:auto!important;margin-right:auto!important;}",
38             file_browser_callback: function(field_name, url, type, win) {
39                 ImageManager.show('#image-manager', function(image) {
40                     win.document.getElementById(field_name).value = image.url;
41                     if ("createEvent" in document) {
42                         var evt = document.createEvent("HTMLEvents");
43                         evt.initEvent("change", false, true);
44                         win.document.getElementById(field_name).dispatchEvent(evt);
45                     } else {
46                         win.document.getElementById(field_name).fireEvent("onchange");
47                     }
48                 });
49             },
50             setup: function(editor) {
51                 editor.addButton('full', {
52                     title: 'Expand Editor',
53                     icon: 'fullscreen',
54                     onclick: function() {
55                         var container = $(editor.getContainer()).toggleClass('fullscreen');
56                         var isFull = container.hasClass('fullscreen');
57                         var iframe = container.find('iframe').first();
58                         var height = isFull ? $(window).height()-110 : 600;
59                         iframe.css('height', height + 'px');
60                     }
61                 });
62             }
63         });
64
65
66
67     });
68 </script>