Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.htm 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. {include file="public/layout" /}
  2. {eq name="$editor.editor_select" value="1"}
  3. {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
  4. {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
  5. {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
  6. {else/}
  7. {load href="__PUBLIC__/plugins/ckeditor/ckeditor.js" /}
  8. {/eq}
  9. <body class="bodysy-w">
  10. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  11. <div id="append_parent"></div>
  12. <div id="ajaxwaitid"></div>
  13. <div id="geduan_div" class="h10"></div>
  14. <div id="page_div" class="page min-hg-c mb-20" style="min-width:auto;box-shadow:none;">
  15. <div class="fixed-bar">
  16. <div class="item-title">
  17. {include file="public/callback_page_1" /}<!-- 返回箭头 -->
  18. <a class="back_sz" href="javascript:void(0);" data-href="{:url('Article/help')}" onclick="openHelpframe(this, '设置与帮助', '500px', '100%', 'r');" title="设置与帮助"><i class="iconfont e-shezhi-tongyong"></i></a>
  19. <div class="subject">
  20. <h3>编辑文档</h3>
  21. <h5></h5>
  22. </div>
  23. <ul class="tab-base nc-row">
  24. <li><a href="javascript:void(0);" data-index='1' class="tab current"><span>基础内容</span></a></li>
  25. <li><a href="javascript:void(0);" data-index='2' class="tab"><span>SEO优化</span></a></li>
  26. <li><a href="javascript:void(0);" data-index='3' class="tab"><span>更多设置</span></a></li>
  27. <!-- #weapp_demontrate_li# -->
  28. <!-- #weapp_li# -->
  29. </ul>
  30. </div>
  31. </div>
  32. <form class="form-horizontal" id="post_form" action="{:url('Article/edit')}" method="post">
  33. <!-- 常规信息 -->
  34. <div class="ncap-form-default tab_div_1">
  35. <dl class="row">
  36. <dt class="tit">
  37. <label for="title"><em>*</em>文档标题</label>
  38. </dt>
  39. <dd class="opt">
  40. <input type="text" name="title" value="{$field.title}" id="title" class="input-txt" maxlength="200" {eq name="$channelRow.is_repeat_title" value="0"} oninput="check_title_repeat(this,'{$field.aid}');" {/eq}>
  41. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  42. 副标题:<input type="text" name="subtitle" value="{$field.subtitle}" id="subtitle" class="w200">
  43. <span class="err"></span>
  44. <p class="notic"></p>
  45. </dd>
  46. </dl>
  47. <dl class="row">
  48. <dt class="tit">
  49. <label for="typeid"><em>*</em>栏目分类</label>
  50. </dt>
  51. <dd class="opt">
  52. <input type="hidden" name="attr[typeid]" id="attr_typeid" value="{$field.typeid}">
  53. <select name="typeid" id="typeid">
  54. {$arctype_html}
  55. </select>
  56. <span class="err"></span>
  57. <p class="notic">谨慎切换,自定义字段的内容会随着栏目切换而清空,在保存之前不受影响!</p>
  58. </dd>
  59. </dl>
  60. {notempty name='$global.web_stypeid_open'}
  61. <dl class="row">
  62. <dt class="tit">
  63. <label for="stypeid">副栏目分类</label>
  64. </dt>
  65. <dd class="opt">
  66. <input type="hidden" name="stypeid" id="stypeid" value="{$field.stypeid}" class="input-txt" onkeyup="this.value=this.value.replace(/[^\d\,]/g,'');" onpaste="this.value=this.value.replace(/[^\d\,]/g,'');" placeholder="">
  67. &nbsp;<a href="javascript:void(0);" data-channel="{$channeltype}" onclick="select_stypeid(this);" class="ncap-btn ncap-btn-green">选择副栏目</a>
  68. <span class="err"></span>
  69. <p class="notic">支持同频道模型的栏目</p>
  70. <div id="stypeid_txt" class="pt5">
  71. {volist name='$stypeid_arr' id='vo'}{gt name='$key' value='0'}&nbsp;&nbsp;|&nbsp;&nbsp;{/gt}<span>{$vo.typename}</span>{/volist}
  72. </div>
  73. </dd>
  74. </dl>
  75. {/notempty}
  76. <dl class="row">
  77. <dt class="tit">
  78. <label>文档属性</label>
  79. </dt>
  80. <dd class="opt">
  81. {volist name="archives_flags" id="vo"}
  82. <input type="hidden" name="attr[{$vo.flag_fieldname}]" {if $field[$vo.flag_fieldname] == 1}value="1"{else/}value="0"{/if}>
  83. <label><input type="checkbox" name="{$vo.flag_fieldname}" value="1" {if $field[$vo.flag_fieldname] == 1}checked{/if}>{$vo.flag_name}<!-- [{$vo.flag_attr}] --></label>&nbsp;
  84. {/volist}
  85. <span class="err"></span>
  86. <p class="notic">如需管理,请点击右上角设置与帮助按钮</p>
  87. </dd>
  88. </dl>
  89. <dl class="row {if condition="$field.is_jump != 1"}none{/if} dl_jump">
  90. <dt class="tit">
  91. <label>跳转网址</label>
  92. </dt>
  93. <dd class="opt">
  94. <input type="text" value="{$field.jumplinks}" name="jumplinks" id="jumplinks" class="input-txt" placeholder="http://">
  95. <span class="err"></span>
  96. <p class="notic">请输入完整的URL网址(包含http或https),设置后访问该条信息将直接跳转到设置的网址</p>
  97. </dd>
  98. </dl>
  99. <dl class="row" style="z-index:2;">
  100. <dt class="tit">
  101. <label>文档标签</label>
  102. </dt>
  103. <dd class="opt">
  104. <input type="text" value="{$field.tags}" name="tags" id="tags" class="input-txt" placeholder="多个标签之间以逗号隔开" autocomplete="off" oninput="get_common_tagindex_input(this);" onfocus="$('#often_tags').hide();" onkeyup="this.value=this.value.replace(/[\,]/g,',');" onpaste="this.value=this.value.replace(/[\,]/g,',')">&nbsp;
  105. <a href="javascript:void(0);" onclick="get_common_tagindex(this);">显示常用标签</a>&nbsp;<img id="tag_loading" src="__STATIC__/common/images/loading.gif" style="display: none;" />
  106. <div class="often_tags" id="often_tags" data-opt="edit" style="display: none;"></div>
  107. <div class="often_tags" id="often_tags_input" style="display: none;"></div>
  108. <input type="hidden" id="tags_click_count">
  109. </dd>
  110. </dl>
  111. <dl class="row {empty name="$global.web_citysite_open"} none {/empty} ">
  112. <dt class="tit">
  113. <label for="title">所属区域</label>
  114. </dt>
  115. <dd class="opt">
  116. <select name="province_id" id="province_id" onchange="set_city_list(0);">
  117. <option value="0">全国</option>
  118. {volist name=':get_site_province_list()' id='vo'}
  119. <option value="{$vo.id}" {eq name="$field.province_id" value="$vo.id" } selected {/eq} >{$vo.name}</option>
  120. {/volist}
  121. </select>
  122. <select name="city_id" id="city_id" class="none ml5" onchange="set_area_list(0);">
  123. <option value="">--请选择--</option>
  124. </select>
  125. <select name="area_id" id="area_id" class="none ml5">
  126. <option value="">--请选择--</option>
  127. </select>
  128. <span class="err"></span>
  129. <p class="notic"></p>
  130. </dd>
  131. </dl>
  132. <dl class="row">
  133. <dt class="tit">
  134. <label>封面图片</label>
  135. </dt>
  136. <dd class="opt">
  137. <div class="input-file-show div_litpic_local" {neq name="$field.is_remote" value="0"}style="display: none;"{/neq}>
  138. <span class="show">
  139. <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="{$field.litpic_local|default='javascript:void(0);'}">
  140. <i id="img_i" class="fa fa-picture-o" {notempty name="$field.litpic_local"}onmouseover="layer_tips=layer.tips('<img src={$field.litpic_local} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  141. </a>
  142. </span>
  143. <span class="type-file-box">
  144. <input type="text" id="litpic_local" name="litpic_local" value="{$field.litpic_local|default=''}" class="type-file-text" autocomplete="off">
  145. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  146. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
  147. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  148. </span>
  149. </div>
  150. <input type="text" id="litpic_remote" name="litpic_remote" value="{$field.litpic_remote|default=''}" placeholder="http://" class="input-txt" onKeyup="keyupRemote(this, 'litpic');" {neq name="$field.is_remote" value="1"}style="display: none;"{/neq}>
  151. &nbsp;
  152. <label><input type="checkbox" name="is_remote" id="is_remote" value="1" {eq name="$field.is_remote" value="1"}checked="checked"{/eq} onClick="clickRemote(this, 'litpic');">远程图片</label>
  153. <span class="err"></span>
  154. <p class="notic">当没有手动上传图片时候,会自动提取正文的第一张图片作为缩略图</p>
  155. </dd>
  156. </dl>
  157. <div class="{if condition='empty($channelRow.data.is_article_pay)'} none {/if}">
  158. <dl class="row">
  159. <dt class="tit">
  160. <label>付费限制</label>
  161. </dt>
  162. <dd class="opt">
  163. <label class="curpoin"><input type="radio" name="restric_type" value="0" {empty name="$field.restric_type"} checked="checked" {/empty}>免费</label>&nbsp;&nbsp;
  164. <label class="curpoin"><input type="radio" name="restric_type" value="1" {eq name="$field.restric_type" value="1"} checked="checked" {/eq}>付费</label>&nbsp;&nbsp;
  165. <label class="curpoin"><input type="radio" name="restric_type" value="2" {eq name="$field.restric_type" value="2"} checked="checked" {/eq}>指定会员</label>&nbsp;&nbsp;
  166. <label class="curpoin"><input type="radio" name="restric_type" value="3" {eq name="$field.restric_type" value="3"} checked="checked" {/eq}>会员付费</label>&nbsp;&nbsp;
  167. </dd>
  168. </dl>
  169. <dl class="row {if condition='!in_array($field.restric_type, [2,3])'} none {/if}" id="dl_arc_level_id">
  170. <dt class="tit">
  171. <label><em>*</em>会员等级</label>
  172. </dt>
  173. <dd class="opt">
  174. <select name="arc_level_id" id="arc_level_id">
  175. {volist name="users_level" id="vo"}
  176. <option value="{$vo.level_id}" level_value="{$vo.level_value}" {eq name='$vo.level_id' value='$field.arc_level_id'} selected {/eq}>{$vo.level_name}</option>
  177. {/volist}
  178. </select>
  179. &nbsp;
  180. <label id="no_vip_pay_label" class="{neq name="$field.restric_type" value="2"} none {/neq}" ><input type="checkbox" name="no_vip_pay" id="no_vip_pay" value="1" {eq name="$field.no_vip_pay" value="1"}checked="checked"{/eq} onClick="clickNoVipPay(this);">开启非会员付费</label>
  181. <p class="notic">包括等于或高于指定的会员等级</p>
  182. </dd>
  183. </dl>
  184. <dl class="row {if condition='in_array($field.restric_type, [0]) || ($field.restric_type == 2 && $field.no_vip_pay == 0) '} none {/if}" id="dl_users_price">
  185. <dt class="tit">
  186. <label for="users_price"><em>*</em>购买价格</label>
  187. </dt>
  188. <dd class="opt">
  189. <input type="text" name="users_price" id="users_price" value="{$field.users_price}" class="input-txt" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d\.]/g,'');" onpaste="this.value=this.value.replace(/[^\d\.]/g,'')" style="width: 100px !important;text-align: right;">&nbsp;元
  190. <span class="err"></span>
  191. <p class="notic"></p>
  192. </dd>
  193. </dl>
  194. <div class="{if condition='empty($field.restric_type)'} none {/if}" id="div_free_html">
  195. <dl class="row" id="dl_part_free">
  196. <dt class="tit">
  197. <label for="title"><em>*</em>免费内容</label>
  198. </dt>
  199. <dd class="opt">
  200. <label class="curpoin"><input type="radio" name="part_free" value="0" {if condition="empty($field.part_free)"} checked {/if} onclick="change_part_free(this);">不预览</label>&nbsp;
  201. <label class="curpoin"><input type="radio" name="part_free" value="2" {if condition="!empty($field.part_free) and $field.part_free eq '2'"} checked {/if} onclick="change_part_free(this);">自动截取</label>&nbsp;
  202. <label class="curpoin"><input type="radio" name="part_free" value="1" {if condition="!empty($field.part_free) and $field.part_free eq '1'"} checked {/if} onclick="change_part_free(this);">手工录入{if condition="!empty($field.part_free) and $field.part_free eq '1'"}<span id="part_free_span" style="color: red;">[编辑]</span>{/if}</label>&nbsp;
  203. <span class="err"></span>
  204. <p class="notic"></p>
  205. </dd>
  206. </dl>
  207. <dl class="row {if condition="empty($field.part_free) or $field.part_free neq '2'"} none {/if}" id="dl_size">
  208. <dt class="tit">
  209. <label for="size">大小</label>
  210. </dt>
  211. <dd class="opt">
  212. <input type="text" name="size" value="{$field.size|default=1024}" id="size" class="input-txt" maxlength="100" autocomplete="off" style="width: 100px !important;text-align: right;" onkeyup="this.value=this.value.replace(/[^\d\.]/g,'');" onpaste="this.value=this.value.replace(/[^\d\.]/g,'')">&nbsp;字节(1024字节=1KB)
  213. <span class="err"></span>
  214. <p class="notic"></p>
  215. </dd>
  216. </dl>
  217. </div>
  218. </div>
  219. {include file="archives/get_field_addonextitem" /}
  220. </div>
  221. <!-- 常规信息 -->
  222. <!-- SEO参数 -->
  223. <div class="ncap-form-default tab_div_2" style="display:none;">
  224. <dl class="row">
  225. <dt class="tit">
  226. <label for="seo_title">SEO标题</label>
  227. </dt>
  228. <dd class="opt">
  229. <input type="text" value="{$field.seo_title}" name="seo_title" id="seo_title" class="input-txt">
  230. <span class="err"></span>
  231. <p class="notic">一般不超过80个字符,为空时系统自动构成,可以到 <a href="{:url('Seo/index', array('inc_type'=>'seo'))}">SEO设置 - SEO基础</a> 中设置构成规则。</p>
  232. </dd>
  233. </dl>
  234. <dl class="row">
  235. <dt class="tit">
  236. <label>SEO关键词</label>
  237. </dt>
  238. <dd class="opt">
  239. <textarea rows="5" cols="60" id="seo_keywords" name="seo_keywords" style="height:20px;">{$field.seo_keywords}</textarea>
  240. <span class="err"></span>
  241. <p class="notic">一般不超过100个字符,多个关键词请用英文逗号(,)隔开,建议3到5个关键词。</p>
  242. </dd>
  243. </dl>
  244. <dl class="row">
  245. <dt class="tit">
  246. <label>SEO描述</label>
  247. </dt>
  248. <dd class="opt">
  249. <textarea rows="5" cols="60" id="seo_description" name="seo_description" style="height:54px;" class="keywordsTextarea" onkeyup="monitorInputStr();" onkeypress="monitorInputStr();">{$field.seo_description}</textarea>
  250. <span class="err"></span>
  251. <p class="notic">一般不超过100个字符,不填写时系统自动提取正文的前100个字符</p>
  252. <p class="notic2 {empty name='$field.seo_description'}none{/empty}" id="beenWritten">你已输入<span id="beenWrittenStr">0</span>个字符</p>
  253. <p><label><input type="checkbox" name="basic_update_seo_description" value="1" {if condition="!empty($global['basic_update_seo_description'])"} checked="checked" {/if}>勾选后SEO描述将随正文内容更新</label></p>
  254. </dd>
  255. </dl>
  256. </div>
  257. <!-- SEO参数 -->
  258. <!-- 其他参数 -->
  259. <div class="ncap-form-default tab_div_3" style="display:none;">
  260. <dl class="row">
  261. <dt class="tit">
  262. <label for="author">作者</label>
  263. </dt>
  264. <dd class="opt">
  265. <input type="hidden" value="{$field.users_id}" name="users_id" class="input-txt">
  266. <input type="text" value="{$field.author}" name="author" id="author" class="input-txt">
  267. <span class="err"></span>
  268. <p class="notic">设置作者默认名称(将同步至管理员笔名)</p>
  269. </dd>
  270. </dl>
  271. <dl class="row dl_origin">
  272. <dt class="tit">
  273. <label>来源</label>
  274. </dt>
  275. <dd class="opt origin-hot">
  276. <input type="text" value="{$field.origin}" name="origin" id="origin" class="input-txt" onclick="searchOrigin(this);" autocomplete="off">
  277. <div class="origin-hot-list" style="display: none;" id="search_keywords_list_origin"></div>
  278. <textarea id="system_originlist_str" style="display: none;">{$system_originlist_str}</textarea>
  279. <span class="setting" onclick="set_originlist();">设置</span>
  280. <span class="err"></span>
  281. <p class="notic">为空时默认“网络”</p>
  282. </dd>
  283. </dl>
  284. <dl class="row">
  285. <dt class="tit">
  286. <label>点击数</label>
  287. </dt>
  288. <dd class="opt">
  289. <input type="text" value="{$field.click}" name="click" id="click" class="input-txt">
  290. <span class="err"></span>
  291. <p class="notic"></p>
  292. </dd>
  293. </dl>
  294. <dl class="row">
  295. <dt class="tit">
  296. <label>阅读权限</label>
  297. </dt>
  298. <dd class="opt">
  299. <input type="hidden" value="{$field.arcrank}" name="old_arcrank" class="input-txt">
  300. <select name="arcrank" id="arcrank" {if $field.arcrank < 0 && $admin_info.role_id > 0 && $auth_role_info.check_oneself < 1} disabled="disabled" {/if}>
  301. {volist name="arcrank_list" id="vo"}
  302. <option value="{$vo.rank}" {eq name="$vo.rank" value="$field.arcrank"}selected{/eq}>{$vo.name}</option>
  303. {/volist}
  304. </select>
  305. <span class="err"></span>
  306. <p class="notic"></p>
  307. </dd>
  308. </dl>
  309. <!-- #weapp_UsersGroup_content_users_id={$field.users_id}#--><!-- #weapp_UsersGroup_content# -->
  310. <dl class="row">
  311. <dt class="tit">
  312. <label for="articleForm">发布时间</label>
  313. </dt>
  314. <dd class="opt">
  315. <input type="text" class="input-txt" id="add_time" name="add_time" value="{$field.add_time|date='Y-m-d H:i:s',###}" autocomplete="off">
  316. <span class="add-on input-group-addon">
  317. <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
  318. </span>
  319. <span class="err"></span>
  320. </dd>
  321. </dl>
  322. <dl class="row">
  323. <dt class="tit">
  324. <label for="tempview">文档模板</label>
  325. </dt>
  326. <dd class="opt">
  327. <select name="tempview" id="tempview">
  328. {volist name='$templateList' id='vo'}
  329. <option value="{$vo}" {eq name='$vo' value='$tempview'}selected{/eq}>{$vo}</option>
  330. {/volist}
  331. </select>
  332. <input type="hidden" name="type_tempview" value="{$tempview}" />
  333. <span class="err"></span>
  334. </dd>
  335. </dl>
  336. <dl class="row {notin name='$seo_pseudo' value='2,3'}no-grey{/notin}">
  337. <dt class="tit">
  338. <label>自定义文件名</label>
  339. </dt>
  340. <dd class="opt">
  341. <input type="text" {notin name='$seo_pseudo' value='2,3'}readonly="readonly" title="动态模式下不支持自定义文档url"{/notin} value="{$field.htmlfilename}" name="htmlfilename" id="htmlfilename" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\u4E00-\u9FA5\w\-]/g,'-');" onpaste="this.value=this.value.replace(/[^\u4E00-\u9FA5\w\-]/g,'-');" class="input-txt {notin name='$seo_pseudo' value='2,3'}no-drop{/notin}">.html
  342. <span class="err"></span>
  343. <p class="notic">自定义文件名可由字母、数字、下划线(_)、连接符(-)等符号组成,除此之外其他字符将自动转为连接符(-)</p>
  344. </dd>
  345. </dl>
  346. </div>
  347. <!-- 其他参数 -->
  348. <!-- #weapp_demontrate_div# -->
  349. <!-- #weapp_div# -->
  350. <div class="ncap-form-default">
  351. <div class="bot2">
  352. <textarea name="free_content" id="free_content" style="display: none;">{notempty name="$field.free_content"}{$field.free_content}{/notempty}</textarea>
  353. <input type="hidden" name="gourl" value="{$gourl|default=''}">
  354. <input type="hidden" name="aid" value="{$field.aid|default='0'}">
  355. <input type="hidden" name="editor_addonFieldExt" id="editor_addonFieldExt" value="">
  356. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  357. {include file="public/callback_page_2" /}<!-- 返回按钮 -->
  358. </div>
  359. </div>
  360. </form>
  361. </div>
  362. <script type="text/javascript">
  363. layui.use('laydate', function() {
  364. var laydate = layui.laydate;
  365. laydate.render({
  366. elem: '#add_time'
  367. ,type: 'datetime'
  368. });
  369. })
  370. $(function () {
  371. try {
  372. var web_citysite_open = {$global['web_citysite_open']|default=0};
  373. if (web_citysite_open > 0) {
  374. var province_id = {$field.province_id|default=0};
  375. var city_id = {$field.city_id|default=0};
  376. var area_id = {$field.area_id|default=0};
  377. if (province_id > 0) {
  378. set_city_list(city_id);
  379. }
  380. if (city_id > 0) {
  381. set_area_list(area_id);
  382. }
  383. }
  384. }catch(e){}
  385. //选项卡切换列表
  386. $('.tab-base').find('.tab').click(function(){
  387. $('.tab-base').find('.tab').each(function(){
  388. $(this).removeClass('current');
  389. });
  390. $(this).addClass('current');
  391. var tab_index = $(this).data('index');
  392. $(".tab_div_1, .tab_div_2, .tab_div_3").hide();
  393. $(".tab_div_body").hide();
  394. $(".tab_div_"+tab_index).show();
  395. layer.closeAll();
  396. });
  397. $('input[name=is_jump]').click(function(){
  398. if ($(this).is(':checked')) {
  399. $('.dl_jump').show();
  400. } else {
  401. $('.dl_jump').hide();
  402. }
  403. });
  404. var dftypeid = {$field.typeid|default='0'};
  405. $('#typeid').change(function(){
  406. var current_channel = $(this).find('option:selected').data('current_channel');
  407. if (0 < $(this).val() && {$channeltype} != current_channel) {
  408. showErrorMsg('请选择对应模型的栏目!');
  409. $(this).val(dftypeid);
  410. } else if ({$channeltype} == current_channel) {
  411. layer.closeAll();
  412. }
  413. var aid = $("input[name=aid]").val();
  414. GetAddonextitem(1, $(this).val(), {$channeltype}, aid, true);
  415. });
  416. $(document).click(function(){
  417. $('#often_tags').hide();
  418. $('#often_tags_input').hide();
  419. event.stopPropagation();
  420. });
  421. $('#often_tags').click(function(){
  422. $('#often_tags').show();
  423. event.stopPropagation();
  424. });
  425. $('input[name=restric_type]').click(function(){
  426. $('#dl_arc_level_id').hide();
  427. $('#dl_users_price').hide();
  428. $('#no_vip_pay_label').hide();
  429. $('#div_free_html').hide();
  430. var restric_type = $(this).val();
  431. $('#arc_level_id').find('option:eq(0)').attr('selected',true);
  432. if (0 < restric_type) {
  433. $('#div_free_html').show();
  434. }
  435. if (-1 < $.inArray(restric_type, ['1','3'])) {
  436. $('#dl_users_price').show();
  437. }
  438. if (-1 < $.inArray(restric_type, ['2','3'])) {
  439. $('#dl_arc_level_id').show();
  440. if (2 == restric_type) {
  441. $('#no_vip_pay_label').show();
  442. if ($('#no_vip_pay').is(':checked')){
  443. $('#dl_users_price').show();
  444. }
  445. }
  446. }
  447. });
  448. });
  449. // 判断输入框是否为空
  450. function check_submit(){
  451. if($.trim($('input[name=title]').val()) == ''){
  452. $($('.tab-base').find('.tab')[0]).trigger('click');
  453. showErrorMsg('标题不能为空!');
  454. $('input[name=title]').focus();
  455. return false;
  456. }
  457. if ($('#typeid').val() == 0) {
  458. $($('.tab-base').find('.tab')[0]).trigger('click');
  459. showErrorMsg('请选择栏目…!');
  460. $('#typeid').focus();
  461. return false;
  462. }
  463. var restric_type = $('input[name=restric_type]:checked').val()
  464. if ( restric_type == 1 || restric_type == 3 || (restric_type == 2 && $('#no_vip_pay').is(':checked'))){
  465. var users_price = $('#users_price').val();
  466. if (parseFloat(users_price).toString() == "NaN") {
  467. users_price = 0;
  468. }
  469. if (0 == users_price || users_price == '') {
  470. showErrorMsg('购买价格不能为空或0');
  471. $('#users_price').focus();
  472. return false;
  473. } else {
  474. var exp = /^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
  475. if (!exp.test(users_price)) {
  476. showErrorMsg('购买价格格式不正确!');
  477. $('#users_price').focus();
  478. return false;
  479. }
  480. }
  481. }
  482. var htmlfilename = $.trim($('input[name=htmlfilename]').val());
  483. if (htmlfilename != '') {
  484. var exp = /^\d{1,}$/;
  485. if (exp.test(htmlfilename)) {
  486. showErrorAlert('自定义文件名不能纯数字,会与文档ID冲突!');
  487. $('input[name=htmlfilename]').focus();
  488. return false;
  489. }
  490. }
  491. layer_loading('正在处理');
  492. if(!ajax_check_htmlfilename())
  493. {
  494. layer.closeAll();
  495. showErrorMsg('同栏目下,自定义文件名已存在!');
  496. $('input[name=htmlfilename]').focus();
  497. return false;
  498. }
  499. setTimeout(function (){
  500. editor_auto_210607();
  501. $('#post_form').submit();
  502. }, 1);
  503. }
  504. function img_call_back(fileurl_tmp)
  505. {
  506. $("#litpic_local").val(fileurl_tmp);
  507. $("#img_a").attr('href', fileurl_tmp);
  508. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  509. $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
  510. }
  511. function change_part_free(e) {
  512. if (1 == $(e).val()){
  513. $('#dl_size').hide();
  514. $('#part_free_span').show();
  515. open_free_content();
  516. }else if (2 == $(e).val()){
  517. $('#part_free_span').hide();
  518. $('#dl_size').show();
  519. } else{
  520. $('#part_free_span').hide();
  521. $('#dl_size').hide();
  522. }
  523. }
  524. function open_free_content() {
  525. var url = "{:url('Article/free_content',['aid'=>$field.aid])}";
  526. layer.open({
  527. type: 2,
  528. title:'请输入预览内容',
  529. shade: layer_shade,
  530. area: ['90%', '90%'], //宽高
  531. content: url
  532. });
  533. }
  534. function clickNoVipPay(obj) {
  535. if ($(obj).is(':checked')) {
  536. $('#dl_users_price').show();
  537. } else {
  538. $('#dl_users_price').hide();
  539. }
  540. }
  541. </script>
  542. <script>
  543. try{
  544. var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
  545. if (mt20_1649209614 == 1){
  546. $("#geduan_div").removeClass("h10");
  547. }else{
  548. $("#geduan_div").addClass("h10");
  549. }
  550. }catch(e){}
  551. </script>
  552. {include file="public/footer" /}