├── README.md ├── wangEditor-fullscreen-plugin.css └── wangEditor-fullscreen-plugin.js /README.md: -------------------------------------------------------------------------------- 1 | # wangEditor-fullscreen-plugin 2 | 富文本编辑器wangEditor的全屏插件,适用于V3 3 | 4 | 使用方法: 5 | 1. 依赖jquery或者zepto,须先引入jquery或zepto。有兴趣可修改为无依赖版本,代码很简单。 6 | 2. 引入wangEditor-fullscreen-plugin.css和wangEditor-fullscreen-plugin.js两个文件。 7 | 3. 在wangEditor的create方法调用后,再调用插件的初始化方法,如: 8 | 9 | var E = window.wangEditor; 10 | var editor = new E('#editor'); 11 | editor.create(); 12 | E.fullscreen.init('#editor'); 13 | 14 | 4. 完成。 15 | -------------------------------------------------------------------------------- /wangEditor-fullscreen-plugin.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | 3 | .w-e-toolbar { 4 | flex-wrap: wrap; 5 | -webkit-box-lines: multiple; 6 | } 7 | 8 | .w-e-toolbar .w-e-menu:hover{ 9 | z-index: 10002!important; 10 | } 11 | 12 | .w-e-menu a { 13 | text-decoration: none; 14 | } 15 | 16 | .fullscreen-editor { 17 | position: fixed !important; 18 | width: 100% !important; 19 | height: 100% !important; 20 | left: 0px !important; 21 | top: 0px !important; 22 | background-color: white; 23 | z-index: 9999; 24 | } 25 | 26 | .fullscreen-editor .w-e-text-container { 27 | width: 100% !important; 28 | height: 95% !important; 29 | } -------------------------------------------------------------------------------- /wangEditor-fullscreen-plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | window.wangEditor.fullscreen = { 5 | // editor create之后调用 6 | init: function(editorSelector){ 7 | $(editorSelector + " .w-e-toolbar").append('
全屏
'); 8 | }, 9 | toggleFullscreen: function(editorSelector){ 10 | $(editorSelector).toggleClass('fullscreen-editor'); 11 | if($(editorSelector + ' ._wangEditor_btn_fullscreen').text() == '全屏'){ 12 | $(editorSelector + ' ._wangEditor_btn_fullscreen').text('退出全屏'); 13 | }else{ 14 | $(editorSelector + ' ._wangEditor_btn_fullscreen').text('全屏'); 15 | } 16 | } 17 | }; --------------------------------------------------------------------------------