Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
huangxuan258
whatsns内容付费问答系统
提交
0cfb8e85
whatsns内容付费问答系统
项目概览
huangxuan258
/
whatsns内容付费问答系统
2021-04-29 05:05:01同步失败
通知
3
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
whatsns内容付费问答系统
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0cfb8e85
编写于
3月 26, 2020
作者:
huangxuan258
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复web端编辑器被替换成移动端编辑器问题
上级
09ee8e79
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
59 addition
and
131 deletion
+59
-131
application/views/default/editor.php
application/views/default/editor.php
+59
-131
未找到文件。
application/views/default/editor.php
浏览文件 @
0cfb8e85
{
if
$setting
[
'editor_choose'
]
==
0
}
<!--
引入wangEditor
.
css
-->
<!--
引入wangEditor
.
css
-->
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"
{
SITE_URL
}
static/js/wangeditor/pcwangeditor/css/wangEditor.min.css"
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"
{
SITE_URL
}
static/js/wangeditor/pcwangeditor/css/wangEditor.min.css"
>
<!--
引入jquery和wangEditor
.
js
-->
<!--
注意
:
javascript必须放在body最后
,
否则可能会出现问题
-->
<!--
引入jquery和wangEditor
.
js
-->
<!--
注意
:
javascript必须放在body最后
,
否则可能会出现问题
-->
<script
src=
"{SITE_URL}static/js/jquery-1.11.3.min.js"
></script>
<
script
type
=
"text/javascript"
src
=
"
{
SITE_URL
}
static/js/wangeditor/pcwangeditor/js/wangEditor.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"
{
SITE_URL
}
static/js/wangeditor/pcwangeditor/js/wangEditor.js"
></
script
>
<script>
$
.
noConflict
()
<
textarea
id
=
"editor"
name
=
"content"
style
=
"width:100%;height:200px;"
>
</script>
{
if
$this
->
uri
->
segment
(
2
)
!=
'view'
&&
$this
->
uri
->
segment
(
1
)
==
'question'
||
$this
->
uri
->
segment
(
2
)
==
'editxinzhi'
}
<style>
.editor_container
{
{
if
$navtitle
==
'编辑问题'
}
{
$question
[
'description'
]}
{
/
if
}
height
:
auto
;
background-color
:
#fff
;
text-align
:
left
;
text-shadow
:
none
;
margin
:
10px
10px
;
}
.wangEditor-drop-panel
{
left
:
0px
;
margin-left
:
0px
;
width
:
100%
;
}
</style>
<div
class=
"editor_container"
>
<textarea
id=
"editor"
name=
"content"
style=
"width:100%;height:100px;"
>
{if $this->uri->segment ( 2 )!='view'
&&
$this->uri->segment ( 1 )=='question'||$this->uri->segment ( 2 )=='editxinzhi'}
{if $navtitle=='编辑问题'} {eval echo htmlspecialchars_decode(htmlspecialchars_decode($question['description']));} {/if}
{
if
$this
->
uri
->
segment
(
1
)
!=
'question'
}
{
if
$this
->
uri
->
segment
(
1
)
!=
'question'
}
{
eval
echo
replacewords
(
$topic
[
'describtion'
]);}
{
eval
echo
replacewords
(
$topic
[
'describtion'
]);}
{
/
if
}
{
/
if
}
{if $user['groupid']==1||$user['uid']==$answer['authorid']
&&
$this->uri->segment ( 2 )=='editanswer'
&&
$this->uri->segment ( 1 )=='question'} {eval
echo htmlspecialchars_decode($answer['content']);} {/if}
{
if
$user
[
'groupid'
]
==
1
||
$user
[
'uid'
]
==
$answer
[
'authorid'
]
&&
$this
->
uri
->
segment
(
2
)
==
'editanswer'
&&
$this
->
uri
->
segment
(
1
)
==
'question'
}
{
eval
echo
htmlspecialchars_decode
(
$answer
[
'content'
]);}
{
/
if
}
{
/
if
}
{
/
if
}
</
textarea
>
</
textarea
>
<div
style=
"margin:10px auto;position:relative;"
>
<input
id=
"upvedio"
type=
"file"
onchange=
"uploadVedio(this)"
accept=
"video/*"
capture=
"camcorder"
style=
"position:absolute;width:70px;left:0px;top:3px;cursor:pointer;opacity:0;"
>
<span
style=
"color:#0084ff;font-size: 13px;"
class=
"uploadvedio"
>
本地上传视频
</span>
</div>
</div>
<
script
type
=
"text/javascript"
>
<
script
type
=
"text/javascript"
>
var
testeditor
=
'
999
'
;
var
editor
=
null
;
var
isueditor
=
0
;
// 初始化编辑器的内容
// 初始化编辑器的内容
var
editor
=
new
wangEditor
(
'editor'
);
editor
=
new
wangEditor
(
'
editor
'
);
// 自定义配置
// 自定义配置
editor
.
config
.
uploadImgUrl
=
g_site_url
+
"index.php?attach/upimg"
;
editor
.
config
.
uploadImgUrl
=
"
{url attach/upimg}
"
;
editor
.
config
.
uploadImgFileName
=
'wangEditorMobileFile'
;
editor
.
config
.
uploadImgFileName
=
'
wangEditorMobileFile
'
;
// 阻止输出log
// 阻止输出log
wangEditor
.
config
.
printLog
=
false
;
editor
.
config
.
printLog
=
true
;
// 普通的自定义菜单
editor
.
config
.
menus
=
[
editor
.
config
.
hideLinkImg
=
true
;
// 普通的自定义菜单
{
$setting
[
'editor_wtoolbars'
]}
// 普通的自定义菜单
];
editor
.
config
.
menus
=
[
// 将全屏时z-index修改为20000
// editor.config.zindex =-1;
editor
.
create
();
'
eraser
'
,
$
(
".wangEditor-container"
)
.
css
(
"z-index"
,
"1"
);
'
quote
'
,
'
emotion
'
,
</
script
>
'
|
'
,
{
else
}
'
img
'
,
<
script
type
=
"text/javascript"
src
=
"
{
SITE_URL
}
static/js/neweditor/ueditor.config.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"
{
SITE_URL
}
static/js/neweditor/ueditor.all.js"
></
script
>
<
script
type
=
"text/plain"
id
=
"editor"
name
=
"content"
style
=
"width:100%;height:200px;"
>
{
if
$this
->
uri
->
segment
(
2
)
!=
'view'
&&
$this
->
uri
->
segment
(
1
)
==
'question'
||
$this
->
uri
->
segment
(
2
)
==
'editxinzhi'
}{
if
$navtitle
==
'编辑问题'
}{
$question
[
'description'
]}
{
/
if
}{
if
$this
->
uri
->
segment
(
1
)
!=
'question'
}{
eval
echo
replacewords
(
$topic
[
'describtion'
]);}{
/
if
}{
if
$user
[
'groupid'
]
==
1
||
$user
[
'uid'
]
==
$answer
[
'authorid'
]
&&
$this
->
uri
->
segment
(
2
)
==
'editanswer'
&&
$this
->
uri
->
segment
(
1
)
==
'question'
}
{
eval
echo
htmlspecialchars_decode
(
$answer
[
'content'
]);}{
/
if
}{
/
if
}
</
script
>
'
undo
'
,
<
script
type
=
"text/javascript"
>
'
redo
'
,
var
isueditor
=
1
;
'
fullscreen
'
];
var
editor
=
UE
.
getEditor
(
'editor'
,{
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
// 将全屏时z-index修改为20000
toolbars
:
[[{
$setting
[
'editor_toolbars'
]}]],
// editor.config.zindex =-1;
initialContent
:
''
,
editor
.
create
();
$
(
"
.wangEditor-container
"
).
css
(
"
z-index
"
,
"
1
"
);
$
(
"
.wangEditor-txt
"
).
css
(
"
height
"
,
"
auto
"
);
//关闭字数统计
function
uploadVedio
(
file
){
wordCount
:
false
,
//关闭elementPath
if
(
file
.
files
&&
file
.
files
[
0
])
elementPathEnabled
:
false
,
{
//默认的编辑区域高度
initialFrameHeight
:
250
$
(
"
.uploadvedio
"
).
html
(
"
视频上传中....
"
);
//更多其他参数,请参考ueditor.config.js中的配置项
$
(
"
#upvedio
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
//更多其他参数,请参考ueditor.config.js中的配置项
var
type
=
"
file
"
;
});
var
ischeck
=
0
;
</
script
>
var
formData
=
new
FormData
();
formData
.
append
(
type
,
$
(
"
#upvedio
"
)[
0
].
files
[
0
]);
formData
.
append
(
"
addvedio
"
,
0
);
{
/
if
}
\ No newline at end of file
$
.
ajax
({
type
:
"
POST
"
,
url
:
'
{url attach/uploadvedio}
'
,
data
:
formData
,
processData
:
false
,
contentType
:
false
,
//返回数据的格式
datatype
:
"
json
"
,
//"xml", "html", "script", "json", "jsonp", "text".
beforeSend
:
function
()
{
ajaxloading
(
"
提交中...
"
);
},
success
:
function
(
data
)
{
var
data
=
eval
(
"
(
"
+
data
+
"
)
"
);
if
(
data
.
code
==
200
){
var
_strinfo
=
data
.
fileurl
;
$
(
"
.wangEditor-txt
"
).
append
(
'
<video style="max-width:100%;" controls> <source src="
'
+
_strinfo
+
'
" type="video/mp4"> </video>
'
);
}
else
{
alert
(
data
.
msg
)
}
},
complete
:
function
()
{
$
(
"
.uploadvedio
"
).
html
(
"
本地上传视频
"
);
$
(
"
#upvedio
"
).
removeAttr
(
"
disabled
"
);
removeajaxloading
();
},
//调用出错执行的函数
error
:
function
(){
removeajaxloading
();
$
(
"
#upvedio
"
).
removeAttr
(
"
disabled
"
);
//请求出错处理
alert
(
"
上传出错
"
);
}
});
}
}
</script>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录