qifengquan 1 vuosi sitten
vanhempi
commit
ee8075160e
1 muutettua tiedostoa jossa 96 lisäystä ja 0 poistoa
  1. 96 0
      application/admin/view/document/index/add.html

+ 96 - 0
application/admin/view/document/index/add.html

@@ -69,3 +69,99 @@
         </div>
     </div>
 </form>
+<script src="../../../../../ckeditor5/packages/ckeditor5-build-classic/build/translations/zh-cn.js"></script>
+<script src="../../../../../ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js"></script>
+<script>
+    var editor
+    ClassicEditor.create( document.querySelector( 'textarea' ),{
+        ckfinder: {
+            uploadUrl: ' ../../../../../api/common/editor_upload?command=QuickUpload&type=Files&responseType=json',
+        },
+        toolbar: {
+            items: [
+                'sourceEditing',
+                '|','undo','redo',
+                '|','heading',
+                '|','findandReplace','alignment','bold','italic','underline','code',
+                'horizontalLine','removeformat','link','strikethrough','subscript','superscript','blockQuote','specialCharacters',
+                '|','FontSize','FontColor','FontBackgroundColor','FontFamily','highlight',
+                '|','numberedList','bulletedList','todoList','outdent','indent','pageBreak',
+                '|','insertImage','cKFinder','insertTable','mediaEmbed',
+
+            ]
+        },
+        //设置字体
+        fontFamily: {
+            options: [
+                'default',
+                'Blackoak Std',
+                '宋体,SimSun',
+                '新宋体,NSimSun',
+                '微软雅黑,Microsoft YaHei',
+                '楷体_GB2312,KaiTi_GB2312',
+                '隶书,LiSu',
+                '幼园,YouYuan',
+                '华文细黑,STXihei',
+            ]
+        },
+        image: {
+
+            styles: [
+                'full','alignLeft', 'alignCenter', 'alignRight'
+            ],
+            resizeOptions: [
+                {
+                    name: 'resizeImage:原尺寸',
+                    label: '原尺寸',
+                    value: null
+                },
+                {
+                    name: 'resizeImage:25',
+                    label: '25%',
+                    value: '25'
+                },
+                {
+                    name: 'resizeImage:50',
+                    label: '50%',
+                    value: '50'
+                },
+                {
+                    name: 'resizeImage:75',
+                    label: '75%',
+                    value: '75'
+                }
+            ],
+            toolbar: [
+                // 'imageStyle:full',
+                // 'imageStyle:side',
+                'imageStyle:alignLeft',
+                'imageStyle:alignCenter',
+                'imageStyle:alignRight',
+                '|',
+                'resizeImage',
+                '|',
+                'toggleImageCaption',
+                'imageTextAlternative',
+                'linkImage'
+            ],
+
+        },
+        table: {
+            contentToolbar: [
+                'tableColumn',
+                'tableRow',
+                'mergeTableCells',
+                'tableCellProperties',
+                'tableProperties'
+            ]
+        },
+        language: 'zh-cn'
+    } )
+        .then( editor => {
+            window.editor = editor;
+        } )
+        .catch( error => {
+            console.error( 'There was a problem initializing the editor.', error );
+        } );
+    // editor.setData( 123 );
+</script>