这个判断的}后面增加
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if (get_setting('advanced_editor_enable') == 'ueditor')</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">import_ueditor_static_files();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
4//static/css/default/common.css//增加ueditor的样式
1051行,增加
.ueditor{height:440px;padding:0px;}
5//static/js/app.jsueditor编辑器的初始化
14行
//编辑器初始化
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if (typeof Markdown != 'undefined' && $('#wmd-input').length)</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">var converter1 = new Markdown.Converter();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">var editor1 = new Markdown.Editor(converter1, $('.wmd-panel'), $('#wmd-preview'));</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">editor1.run();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">AWS.Editor.set_editor_preview();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
在判断的}后面增加
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if (typeof UE != 'undefined' && $('#wmd-input').length)</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">var ue = UE.getEditor('wmd-input');</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">$('#wmd-input').removeClass('autosize');</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">$('#wmd-input').addClass('ueditor');</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
6//app/question/main.php//更改切换ueditor后调用ueditor
377行
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if (get_setting('advanced_editor_enable') == 'Y')</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">import_editor_static_files();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
这个判断的}后面增加
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if (get_setting('advanced_editor_enable') == 'ueditor')</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">import_ueditor_static_files();</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
7//system/class/cls_format.inc.php//更改ueditor语法的解析
83行
- return load_class('Services_Markdown')->transform($text);
复制代码
改成
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">if(preg_match("/^<p>/",$text,$match))</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">return htmlspecialchars_decode($text);</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}else{</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">return load_class('Services_Markdown')->transform($text);</span>
- <span style="color: rgb(102, 102, 102); font-family: 'Helvetica Neue', STHeiti, 微软雅黑, 'Microsoft YaHei', Helvetica, Arial, sans-serif; line-height: 25.2000007629395px;">}</span>
复制代码
|