article.html
12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<include file="public/layout" />
<script type="text/javascript">
window.UEDITOR_Admin_URL = "__ROOT__/public/plugins/Ueditor/";
var URL_upload = "{$URL_upload}";
var URL_fileUp = "{$URL_fileUp}";
var URL_scrawlUp = "{$URL_scrawlUp}";
var URL_getRemoteImage = "{$URL_getRemoteImage}";
var URL_imageManager = "{$URL_imageManager}";
var URL_imageUp = "{$URL_imageUp}";
var URL_getMovie = "{$URL_getMovie}";
var URL_home = "{$URL_home}";
</script>
<load href="__ROOT__/public/plugins/Ueditor/ueditor.config.js"/>
<load href="__ROOT__/public/plugins/Ueditor/ueditor.all.js"/>
<script type="text/javascript" src="__PUBLIC__/static/js/layer/laydate/laydate.js"></script>
<style type="text/css">
html, body {
overflow: visible;
}
</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="fixed-bar">
<div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
<div class="subject">
<h3>平台公告 - 新增公告 </h3>
<h5></h5>
</div>
</div>
</div>
<form class="form-horizontal" action="{:U('Article/aticleHandle')}" id="add_post" method="post">
<input type="hidden" name="oldurl" value="{$oldurl}">
<div class="ncap-form-default">
<dl class="row">
<dt class="tit">
<label><em>*</em>标题</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.title}" maxlength="60"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
name="title" class="input-txt">
<span class="err cr"></span>
<p class="notic">最大80个字</p>
</dd>
</dl>
<dl class="row" style="display: none;">
<dt class="tit">
<label for="articleForm">seo关键字</label>
</dt>
<dd class="opt">
<input type="text" name="keywords" value="{$info.keywords}" maxlength="120"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
class="input-txt">
<span class="err"></span>
<p class="notic">用于seo 搜索引擎友好,最多120个字</p>
</dd>
</dl>
<dl class="row" style="display: none;">
<dt class="tit">
<label for="articleForm">链接</label>
</dt>
<dd class="opt">
<input id="a_link" type="text" name="link" value="{$info.link}" maxlength="140"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
class="input-txt">
<span class="err cr"></span>
<p class="notic">当填写"链接"后点击文章标题将直接跳转至链接地址,不显示文章内容。链接格式请以http://开头</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="articleForm">弹窗有效期</label>
</dt>
<dd class="opt">
<input type="text" class="" id="publish_time"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
name="publish_time" value="{$info.publish_time|date="Y-m-d H:i:s",###}" >
至 <input type="text" class="" id="publish_etime"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
name="publish_etime" value="{$info.publish_etime|date="Y-m-d H:i:s",###}" >
<span class="err"></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label>显示</label>
</dt>
<dd class="opt">
<div class="onoff">
<label for="article_show1" class="cb-enable <if condition="$info[is_open] eq 1">selected</if>">是</label>
<label for="article_show0" class="cb-disable <if condition="$info[is_open] eq 0">selected</if>">否</label>
<input id="article_show1" name="is_open"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="1" type="radio" <if condition="$info[is_open] eq 1"> checked="checked"</if>>
<input id="article_show0" name="is_open"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="0" type="radio" <if condition="$info[is_open] eq 0"> checked="checked"</if>>
</div>
<p class="notic"></p>
</dd>
</dl>
<dl class="row">
<dt class="tit">摘要内容</dt>
<dd class="opt">
<textarea id="post_description" name="description" rows="6" class="tarea"
title="">{$info.description}</textarea>
<span class="err"></span>
<p class="notic"></p>
</dd>
</dl>
<dl class="row dn">
<dt class="tit">
<label>图片上传</label>
</dt>
<dd class="opt">
<div class="ncsc-goods-default-pic">
<div class="goodspic-uplaod">
<div style="">
<img id="original_img2" src="{:getImg($info.thumb,'/public/images/default_goods_image_240.gif')}" style="width:160px;border:#eee solid 1px" onmouseover="layer.tips('<img src={:getImg($info.thumb,'/public/images/default_goods_image_240.gif')}>',this, {tips: [1, '#fff']});" onmouseout="layer.closeAll();">
</div>
<input type="hidden" id="thumb" name="thumb"
onkeydown="strkeydown(event, this, 'submitbtn')"
value="{$info.thumb}" class="type-file-text">
<p class="hint">请上传图片格式文件,<Font color="red">大小建议为:240*240像素。</Font> </p>
<div class="handle">
<div class="ncsc-upload-btn">
<a onClick="GetUploadify_new(1,'thumb','article','{$erpid}','article','article_id','thumb','{$info.article_id}','img_call_back')" >
<p><i class="icon-upload-alt"></i>图片上传</p>
</a>
</div>
</div>
</div>
</div>
<!--<div class="input-file-show">-->
<!--<span class="show">-->
<!--<a id="img_a" class="nyroModal" rel="gal" href="{$info.thumb}">-->
<!--<i id="img_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src={$info.thumb}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>-->
<!--</a>-->
<!--</span>-->
<!--<span class="type-file-box">-->
<!--<input type="text" id="thumb"-->
<!--onkeydown="strkeydown(event, this, 'sumbitbtn')"-->
<!--name="thumb" value="{$info.thumb}" class="type-file-text">-->
<!--<input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">-->
<!--<input class="type-file-file" onClick="GetUploadify_new(1,'thumb','article','{$erpid}','article','article_id','thumb','{$info.article_id}','img_call_back')" size="30" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">-->
<!--</span>-->
<!--</div>-->
<!--<span class="err"></span>-->
<!--<p class="notic">请上传图片格式文件</p>-->
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label>详细内容</label>
</dt>
<dd class="opt">
<textarea class="span12 ckeditor"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
id="post_content" name="content" title="">{$info.content}</textarea>
<span id="fcont" class="err cr"></span>
<p class="notic"></p>
</dd>
</dl>
<div class="bot"><a id="sumbitbtn" href="JavaScript:void(0);" onClick="checkForm()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
</div>
<input type="hidden" name="act" value="{$act}">
<input type="hidden" name="article_id" value="{$info.article_id}"></label>
<input type="hidden" name="editorimg" id="editorimg" value="{$info.editorimg}">
</form>
<input type="hidden" id="qclurl" value="{$qclurl}" name="qclurl">
</div>
<script type="text/javascript">
var url="{:url('Ueditor/index',array('savepath'=>'article','savepath1'=>'news'))}";
var editor;
$(function () {
//具体参数配置在 editor_config.js 中
var options = {
zIndex: 999,
initialFrameWidth: "70%", //初化宽度
initialFrameHeight: 300, //初化高度
focus: false, //初始化时,是否让编辑器获得焦点true或false
maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
autoHeightEnabled: true
/* autotypeset: {
mergeEmptyline: true, //合并空行
removeClass: true, //去掉冗余的class
removeEmptyline: false, //去掉空行
textAlign: "left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
pasteFilter: false, //根据规则过滤没事粘贴进来的内容
clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号
clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体
removeEmptyNode: false, //去掉空节点
//可以去掉的标签
removeTagNames: {"font": 1},
indent: false, // 行首缩进
indentValue: '0em' //行首缩进的大小
}*/
,serverUrl:url
};
editor = new UE.ui.Editor(options);
editor.render("post_content");
$('#publish_time').layDate();
$('#publish_etime').layDate();
$(window).scroll(function () {
if($(".edui-editor-toolbarbox").css('position')=="fixed"){
$(".edui-editor-toolbarbox").css('top','58px');
}
});
});
function checkForm(){
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
if($('input[name="title"]').val() == ''){
layer.msg("请填写文章标题!",{icon:2,time:1000});
$('input[name="title"]').focus();
$('input[name="title"]').parent().find("span").text("请选择文章标题!");
return false;
}
var geteditor=editor.getContent();
//
//geteditor=geteditor.match(/<img src=(?:.|\s)*?>/g);
// alert(geteditor);
// return;
$('#add_post').submit();
}
function img_call_back(fileurl_tmp)
{
//alert(fileurl_tmp);
var getqclurl=$("#qclurl").val();
//alert(getqclurl);
$("#thumb").val(fileurl_tmp);
$("#original_img2").attr('src', getqclurl+fileurl_tmp);
$("#original_img2").attr('onmouseover', "layer.tips('<img src="+getqclurl+fileurl_tmp+">',this,{tips: [1, '#fff']});");
}
/*正则是不是链接*/
function IsMyURL(str) {
var RegUrl = new RegExp();
RegUrl.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
if (!RegUrl.test(str)) {
return false;
}
return true;
}
</script>
</body>
</html>