Açıklama Yok
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.

add.htm 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  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('Special/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>专题文档</span></a></li>
  26. <li><a href="javascript:void(0);" data-index='3' class="tab"><span>SEO优化</span></a></li>
  27. <li><a href="javascript:void(0);" data-index='4' class="tab"><span>更多设置</span></a></li>
  28. <!-- #weapp_demontrate_li# -->
  29. <!-- #weapp_li# -->
  30. </ul>
  31. </div>
  32. </div>
  33. <form class="form-horizontal" id="post_form" action="{:url('Special/add')}" method="post">
  34. <!-- 常规信息 -->
  35. <div class="ncap-form-default tab_div_1">
  36. <dl class="row">
  37. <dt class="tit">
  38. <label for="title"><em>*</em>文档标题</label>
  39. </dt>
  40. <dd class="opt">
  41. <input type="text" name="title" value="" id="title" class="input-txt" maxlength="200" {eq name="$channelRow.is_repeat_title" value="0"} oninput="check_title_repeat(this,0);" {/eq}>
  42. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  43. 副标题:<input type="text" name="subtitle" value="" id="subtitle" class="w200">
  44. <span class="err"></span>
  45. <p class="notic"></p>
  46. </dd>
  47. </dl>
  48. <dl class="row">
  49. <dt class="tit">
  50. <label for="title"><em>*</em>栏目分类</label>
  51. </dt>
  52. <dd class="opt">
  53. <select name="typeid" id="typeid">
  54. <option value="0">请选择栏目…</option>
  55. {$arctype_html}
  56. </select>
  57. <span class="err"></span>
  58. <p class="notic">谨慎切换,自定义字段的内容会随着栏目切换而清空,在保存之前不受影响!</p>
  59. </dd>
  60. </dl>
  61. {notempty name='$global.web_stypeid_open'}
  62. <dl class="row">
  63. <dt class="tit">
  64. <label for="stypeid">副栏目分类</label>
  65. </dt>
  66. <dd class="opt">
  67. <input type="hidden" name="stypeid" id="stypeid" value="" class="input-txt" onkeyup="this.value=this.value.replace(/[^\d\,]/g,'');" onpaste="this.value=this.value.replace(/[^\d\,]/g,'');">
  68. &nbsp;<a href="javascript:void(0);" data-channel="{$channeltype}" onclick="select_stypeid(this);" class="ncap-btn ncap-btn-green">选择副栏目</a>
  69. <span class="err"></span>
  70. <p class="notic">支持同频道模型的栏目ID</p>
  71. <div id="stypeid_txt" class="pt5"></div>
  72. </dd>
  73. </dl>
  74. {/notempty}
  75. <dl class="row">
  76. <dt class="tit">
  77. <label>文档属性</label>
  78. </dt>
  79. <dd class="opt">
  80. {volist name="archives_flags" id="vo"}
  81. <label><input type="checkbox" name="{$vo.flag_fieldname}" value="1">{$vo.flag_name}<!-- [{$vo.flag_attr}] --></label>&nbsp;
  82. {/volist}
  83. <span class="err"></span>
  84. <p class="notic">如需管理,请点击右上角设置与帮助按钮</p>
  85. </dd>
  86. </dl>
  87. <dl class="row none dl_jump">
  88. <dt class="tit">
  89. <label>跳转网址</label>
  90. </dt>
  91. <dd class="opt">
  92. <input type="text" value="" name="jumplinks" id="jumplinks" class="input-txt" placeholder="http://">
  93. <span class="err"></span>
  94. <p class="notic">请输入完整的URL网址(包含http或https),设置后访问该条信息将直接跳转到设置的网址</p>
  95. </dd>
  96. </dl>
  97. <dl class="row" style="z-index:2;">
  98. <dt class="tit">
  99. <label>文档标签</label>
  100. </dt>
  101. <dd class="opt">
  102. <input type="text" value="" 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;
  103. <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;" />
  104. <div class="often_tags" id="often_tags" data-opt="add" style="display: none;"></div>
  105. <div class="often_tags" id="often_tags_input" style="display: none;"></div>
  106. <input type="hidden" id="tags_click_count">
  107. </dd>
  108. </dl>
  109. <dl class="row {empty name="$global.web_citysite_open"} none {/empty} ">
  110. <dt class="tit">
  111. <label for="title">所属区域</label>
  112. </dt>
  113. <dd class="opt">
  114. <select name="province_id" id="province_id" onchange="set_city_list(0);">
  115. <option value="0">全国</option>
  116. {volist name=':get_site_province_list()' id='vo'}
  117. <option value="{$vo.id}" {eq name="$Request.param.province_id" value="$vo.id" } selected="true" {/eq}>{$vo.name}</option>
  118. {/volist}
  119. </select>
  120. <select name="city_id" id="city_id" class="none ml5" onchange="set_area_list(0);">
  121. <option value="">--请选择--</option>
  122. </select>
  123. <select name="area_id" id="area_id" class="none ml5">
  124. <option value="">--请选择--</option>
  125. </select>
  126. <span class="err"></span>
  127. <p class="notic"></p>
  128. </dd>
  129. </dl>
  130. <dl class="row">
  131. <dt class="tit">
  132. <label>封面图片</label>
  133. </dt>
  134. <dd class="opt">
  135. <div class="input-file-show div_litpic_local">
  136. <span class="show">
  137. <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="javascript:void(0);">
  138. <i id="img_i" class="fa fa-picture-o" onmouseover="" onmouseout="layer.close(layer_tips);"></i>
  139. </a>
  140. </span>
  141. <span class="type-file-box">
  142. <input type="text" id="litpic_local" name="litpic_local" value="" class="type-file-text" autocomplete="off">
  143. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  144. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
  145. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  146. </span>
  147. </div>
  148. <input type="text" id="litpic_remote" name="litpic_remote" value="" placeholder="http://" class="input-txt" onKeyup="keyupRemote(this, 'litpic');" style="display: none;">
  149. &nbsp;
  150. <label><input type="checkbox" name="is_remote" id="is_remote" value="1" onClick="clickRemote(this, 'litpic');">远程图片</label>
  151. <span class="err"></span>
  152. <p class="notic">当没有手动上传图片时候,会自动提取正文的第一张图片作为缩略图</p>
  153. </dd>
  154. </dl>
  155. {include file="archives/get_field_addonextitem" /}
  156. </div>
  157. <!-- 常规信息 -->
  158. <!-- 专题节点 -->
  159. <div class="ncap-form-default tab_div_2" style="display: none;">
  160. <div class="special-add" onclick="specialNodeAdd();">
  161. <span><i class="layui-icon layui-icon-addition"></i>新增节点</span>
  162. </div>
  163. <div class="sort-list-special">
  164. <div class="special-items specialNodeItems" id="specialNode_1_item">
  165. <input type="hidden" name="specialNode[itemid][]" value="1">
  166. <div class="special-del" onclick="specialNodeDel(this);"><i class="fa fa-times" aria-hidden="true"></i>删除</div>
  167. <div class="special-items-row">
  168. <div class="special-item">
  169. <div class="special-item-l"><em>*</em>节点名称</div>
  170. <div class="special-item-r">
  171. <input type="text" name="specialNode[title][]" value="节点1" class="input-text" onkeyup="keyupNodeTitleUnique(this);">
  172. <span class="err"></span>
  173. </div>
  174. </div>
  175. <div class="special-item">
  176. <div class="special-item-l"><em>*</em>节点标识</div>
  177. <div class="special-item-r">
  178. <input type="text" name="specialNode[code][]" value="default1" class="input-text" onkeyup="keyupNodeCodeUnique(this);" onkeyup="this.value=this.value.replace(/[^\w\-\_]/g,'');" onpaste="this.value=this.value.replace(/[^\w\-\_]/g,'')">
  179. <span class="err"></span>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="special-items-row">
  184. <div class="special-item">
  185. <div class="special-item-l">文档来源</div>
  186. <div class="special-item-r">
  187. <span class="option-item">
  188. <label class="ml5"><input type="radio" name="specialNode[isauto][1]" value="0" checked="checked" onclick="setNodeIsauto(this, 'specialNode_1_item');">&nbsp;节点文档列表</label>
  189. </span>
  190. <span class="option-item">
  191. <label class="ml5"><input type="radio" name="specialNode[isauto][1]" value="1" onclick="setNodeIsauto(this, 'specialNode_1_item');">&nbsp;自动获取文档</label>
  192. </span>
  193. </div>
  194. </div>
  195. </div>
  196. <div class="dl_specialNode_1_item_isauto_1" style="display: none;">
  197. <div class="special-items-row">
  198. <div class="special-item-l">关键字</div>
  199. <div class="special-item-r">
  200. <input type="text" name="specialNode[keywords][]" class="input-text">(以 , 逗号分开)
  201. </div>
  202. </div>
  203. <div class="special-items-row">
  204. <div class="special-item-l">所属栏目</div>
  205. <div class="special-item-r">
  206. <select name="specialNode[typeid][]">
  207. <option value="0">请选择栏目…</option>
  208. {$node_select_html}
  209. </select>
  210. </div>
  211. </div>
  212. <div class="special-items-row">
  213. <div class="special-item-l">文档数</div>
  214. <div class="special-item-r">
  215. <input type="text" name="specialNode[row][]" value="10" class="input-text" style="width: 50px;">
  216. </div>
  217. </div>
  218. </div>
  219. <div class="dl_specialNode_1_item_isauto_0">
  220. <div class="special-items-row">
  221. <div class="special-item-l">节点文档列表</div>
  222. <div class="special-item-r">
  223. <a href="javascript:void(0);" onclick="selectNodeArchives(this, 'specialNode_1_item');" class="ncap-btn ncap-btn-green">选择文档</a>
  224. </div>
  225. </div>
  226. <div class="special-items-row" style="display: none;">
  227. <div class="special-item-l">&nbsp;</div>
  228. <div class="special-item-r">
  229. <div class="ment-comment-table pd0">
  230. <div class="ment-table-wrapper">
  231. <div class="ment-table ment-table-default" style="max-height: 307px;padding: 0 10px;overflow-y: auto;">
  232. <div class="ment-table-header">
  233. <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
  234. <colgroup> <col width=""> <col width="60"> </colgroup>
  235. <thead>
  236. <tr>
  237. <th> <div class="ment-table-cell"><span>文档标题</span> </div> </th>
  238. <th> <div class="ment-table-cell"><span>操作</span> </div> </th>
  239. </tr>
  240. </thead>
  241. </table>
  242. </div>
  243. <div class="ment-table-body">
  244. <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
  245. <colgroup> <col width=""> <col width="60"> </colgroup>
  246. <input type="hidden" name="specialNode[aidlist][]" value="">
  247. <input type="hidden" name="specialNode[htmllist][]" value="">
  248. <tbody class="ment-table-tbody archivesTbody"></tbody>
  249. </table>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. <!-- 专题节点 -->
  261. <!-- SEO参数 -->
  262. <div class="ncap-form-default tab_div_3" style="display: none;">
  263. <dl class="row">
  264. <dt class="tit">
  265. <label for="seo_title">SEO标题</label>
  266. </dt>
  267. <dd class="opt">
  268. <input type="text" value="" name="seo_title" id="seo_title" class="input-txt">
  269. <span class="err"></span>
  270. <p class="notic">一般不超过80个字符,为空时系统自动构成,可以到 <a href="{:url('Seo/index', array('inc_type'=>'seo'))}">SEO设置 - SEO基础</a> 中设置构成规则。</p>
  271. </dd>
  272. </dl>
  273. <dl class="row">
  274. <dt class="tit">
  275. <label>SEO关键词</label>
  276. </dt>
  277. <dd class="opt">
  278. <textarea rows="5" cols="60" id="seo_keywords" name="seo_keywords" style="height:20px;"></textarea>
  279. <span class="err"></span>
  280. <p class="notic">一般不超过100个字符,多个关键词请用英文逗号(,)隔开,建议3到5个关键词。</p>
  281. </dd>
  282. </dl>
  283. <dl class="row">
  284. <dt class="tit">
  285. <label>SEO描述</label>
  286. </dt>
  287. <dd class="opt">
  288. <textarea rows="5" cols="60" id="seo_description" name="seo_description" style="height:54px;" class="keywordsTextarea" onkeyup="monitorInputStr();" onkeypress="monitorInputStr();"></textarea>
  289. <span class="err"></span>
  290. <p class="notic">一般不超过100个字符,不填写时系统自动提取正文的前100个字符</p>
  291. <p class="notic2 none" id="beenWritten">你已输入<span id="beenWrittenStr">0</span>个字符</p>
  292. </dd>
  293. </dl>
  294. </div>
  295. <!-- SEO参数 -->
  296. <!-- 其他参数 -->
  297. <div class="ncap-form-default tab_div_4" style="display: none;">
  298. <dl class="row">
  299. <dt class="tit">
  300. <label for="author">作者</label>
  301. </dt>
  302. <dd class="opt">
  303. <input type="text" value="{$Think.session.admin_info.pen_name|default='小编'}" name="author" id="author" class="input-txt">
  304. <span class="err"></span>
  305. <p class="notic">设置作者默认名称(将同步至管理员笔名)</p>
  306. </dd>
  307. </dl>
  308. <dl class="row dl_origin">
  309. <dt class="tit">
  310. <label>来源</label>
  311. </dt>
  312. <dd class="opt origin-hot">
  313. <input type="text" value="{$system_originlist_0}" name="origin" id="origin" class="input-txt" onclick="searchOrigin(this);" autocomplete="off">
  314. <div class="origin-hot-list" style="display: none;" id="search_keywords_list_origin"></div>
  315. <textarea id="system_originlist_str" style="display: none;">{$system_originlist_str}</textarea>
  316. <span class="setting" onclick="set_originlist();">设置</span>
  317. <span class="err"></span>
  318. <p class="notic">为空时默认“网络”</p>
  319. </dd>
  320. </dl>
  321. <dl class="row">
  322. <dt class="tit">
  323. <label>点击数</label>
  324. </dt>
  325. <dd class="opt">
  326. <input type="text" value="{$rand_arcclick}" name="click" id="click" class="input-txt">
  327. <span class="err"></span>
  328. <p class="notic"></p>
  329. </dd>
  330. </dl>
  331. <dl class="row">
  332. <dt class="tit">
  333. <label>阅读权限</label>
  334. </dt>
  335. <dd class="opt">
  336. <select name="arcrank" id="arcrank" {if $admin_info.role_id>0&&$auth_role_info.check_oneself<1} disabled="disabled" {/if}>
  337. {volist name="arcrank_list" id="vo"}
  338. <option value="{$vo.rank}" {if $admin_info.role_id>0&&$auth_role_info.check_oneself<1&&$vo.rank==-1} selected="selected" {/if}>{$vo.name}</option>
  339. {/volist}
  340. </select>
  341. <span class="err"></span>
  342. <p class="notic"></p>
  343. </dd>
  344. </dl>
  345. <!-- #weapp_UsersGroup_content_users_id={$field.users_id}#--><!-- #weapp_UsersGroup_content# -->
  346. <dl class="row">
  347. <dt class="tit">
  348. <label for="articleForm">发布时间</label>
  349. </dt>
  350. <dd class="opt">
  351. <input type="text" class="input-txt" id="add_time" name="add_time" value="{php}echo date('Y-m-d H:i:s'){/php}" autocomplete="off">
  352. <span class="add-on input-group-addon">
  353. <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
  354. </span>
  355. <span class="err"></span>
  356. </dd>
  357. </dl>
  358. <dl class="row">
  359. <dt class="tit">
  360. <label for="tempview">文档模板</label>
  361. </dt>
  362. <dd class="opt">
  363. <select name="tempview" id="tempview">
  364. {volist name='$templateList' id='vo'}
  365. <option value="{$vo}" {eq name='$vo' value='$tempview'}selected{/eq}>{$vo}</option>
  366. {/volist}
  367. </select>
  368. <input type="hidden" name="type_tempview" value="{$tempview}" />
  369. <span class="err"></span>
  370. <p class="notic">模板命名规则:<br/>view_special.htm<br/>view_special_自定义.htm</p>
  371. <!-- &nbsp;<a href="javascript:void(0);" onclick="newtpl();" class="ncap-btn ncap-btn-green">新建模板</a> -->
  372. </dd>
  373. </dl>
  374. <dl class="row {notin name='$seo_pseudo' value='2,3'}no-grey{/notin}" >
  375. <dt class="tit">
  376. <label>自定义文件名</label>
  377. </dt>
  378. <dd class="opt">
  379. <input type="text" {notin name='$seo_pseudo' value='2,3'}readonly="readonly" title="动态模式下不支持自定义文档url"{/notin} value="" 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
  380. <span class="err"></span>
  381. <p class="notic">自定义文件名可由字母、数字、下划线(_)、连接符(-)等符号组成,除此之外其他字符将自动转为连接符(-)</p>
  382. </dd>
  383. </dl>
  384. </div>
  385. <!-- 其他参数 -->
  386. <!-- #weapp_demontrate_div# -->
  387. <!-- #weapp_div# -->
  388. <div class="ncap-form-default">
  389. <div class="bot2">
  390. <input type="hidden" name="gourl" value="{$gourl|default=''}">
  391. <input type="hidden" name="editor_addonFieldExt" id="editor_addonFieldExt" value="">
  392. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  393. {include file="public/callback_page_2" /}<!-- 返回按钮 -->
  394. </div>
  395. </div>
  396. </form>
  397. </div>
  398. <script type="text/javascript">
  399. layui.use('laydate', function() {
  400. var laydate = layui.laydate;
  401. laydate.render({
  402. elem: '#add_time', type: 'datetime'
  403. });
  404. });
  405. $(function () {
  406. try {
  407. var web_citysite_open = {$global['web_citysite_open']|default=0};
  408. var site_province_id = {$site_province_id|default=0};
  409. var site_city_id = {$site_city_id|default=0};
  410. var site_area_id = {$site_area_id|default=0};
  411. if (web_citysite_open > 0 && site_province_id > 0) {
  412. $('select[name=province_id]').val(site_province_id);
  413. set_city_list(site_city_id);
  414. set_area_list(site_area_id);
  415. }
  416. }catch(e){}
  417. //选项卡切换列表
  418. $('.tab-base').find('.tab').click(function(){
  419. $('.tab-base').find('.tab').each(function(){
  420. $(this).removeClass('current');
  421. });
  422. $(this).addClass('current');
  423. var tab_index = $(this).data('index');
  424. $(".tab_div_1, .tab_div_2, .tab_div_3, .tab_div_4").hide();
  425. $(".tab_div_"+tab_index).show();
  426. layer.closeAll();
  427. });
  428. $('input[name=is_jump]').click(function(){
  429. if ($(this).is(':checked')) {
  430. $('.dl_jump').show();
  431. } else {
  432. $('.dl_jump').hide();
  433. }
  434. });
  435. var dftypeid = {$typeid|default='0'};
  436. $('#typeid').change(function(){
  437. var current_channel = $(this).find('option:selected').data('current_channel');
  438. if (0 < $(this).val() && {$channeltype} != current_channel) {
  439. showErrorMsg('请选择对应模型的栏目!');
  440. $(this).val(dftypeid);
  441. } else if ({$channeltype} == current_channel) {
  442. layer.closeAll();
  443. }
  444. GetAddonextitem(1, $(this).val(), {$channeltype}, 0, true);
  445. });
  446. $(document).click(function(){
  447. $('#often_tags').hide();
  448. $('#often_tags_input').hide();
  449. event.stopPropagation();
  450. });
  451. $('#often_tags').click(function(){
  452. $('#often_tags').show();
  453. event.stopPropagation();
  454. });
  455. $('input[name=tags]').keyup(function(){
  456. var tags = $.trim($(this).val());
  457. $('#seo_keywords').val(tags);
  458. });
  459. });
  460. // 判断输入框是否为空
  461. function check_submit(){
  462. if($.trim($('input[name=title]').val()) == ''){
  463. $($('.tab-base').find('.tab')[0]).trigger('click');
  464. showErrorMsg('标题不能为空!');
  465. $('input[name=title]').focus();
  466. return false;
  467. }
  468. if ($('#typeid').val() == 0) {
  469. $($('.tab-base').find('.tab')[0]).trigger('click');
  470. showErrorMsg('请选择栏目…!');
  471. $('#typeid').focus();
  472. return false;
  473. }
  474. if (!checkNode()) {
  475. return false;
  476. }
  477. var htmlfilename = $.trim($('input[name=htmlfilename]').val());
  478. if (htmlfilename != '') {
  479. var exp = /^\d{1,}$/;
  480. if (exp.test(htmlfilename)) {
  481. showErrorAlert('自定义文件名不能纯数字,会与文档ID冲突!');
  482. $('input[name=htmlfilename]').focus();
  483. return false;
  484. }
  485. }
  486. layer_loading('正在处理');
  487. if(!ajax_check_htmlfilename())
  488. {
  489. layer.closeAll();
  490. showErrorMsg('同栏目下,自定义文件名已存在!');
  491. $('input[name=htmlfilename]').focus();
  492. return false;
  493. }
  494. setTimeout(function (){
  495. editor_auto_210607();
  496. $('#post_form').submit();
  497. }, 1);
  498. }
  499. function img_call_back(fileurl_tmp) {
  500. $("#litpic_local").val(fileurl_tmp);
  501. $("#img_a").attr('href', fileurl_tmp);
  502. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  503. $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
  504. }
  505. function setNodeIsauto(obj, nodeid) {
  506. var isauto = $(obj).val();
  507. if (isauto == 0) {
  508. $('.dl_'+nodeid+'_isauto_0').show();
  509. $('.dl_'+nodeid+'_isauto_1').hide();
  510. } else {
  511. $('.dl_'+nodeid+'_isauto_0').hide();
  512. $('.dl_'+nodeid+'_isauto_1').show();
  513. }
  514. }
  515. // 点击选择节点文章
  516. var tbodyTr;
  517. var nodeTagID;
  518. var lists_node;
  519. var lists_html;
  520. // 节点文章预定义变量
  521. var nodeAidArr = [];
  522. var nodeAidStr = '';
  523. var nodeAidList = [];
  524. function selectNodeArchives(obj, nodeid) {
  525. nodeTagID = nodeid;
  526. tbodyTr = $('#' + nodeTagID + ' .archivesTbody');
  527. lists_node = $('#' + nodeTagID).find("input[name='specialNode[aidlist][]']");
  528. lists_html = $('#' + nodeTagID).find("input[name='specialNode[htmllist][]']");
  529. nodeAidArr = lists_node.val() ? lists_node.val().split(',') : [];
  530. nodeAidList = lists_html.val() ? $.parseJSON(lists_html.val()) : [];
  531. var aidlist = '';//lists_node.val();
  532. var url = eyou_basefile + '?m=admin&c=Special&a=ajax_node_archives_list&aids='+aidlist+'&lang='+__lang__;
  533. //iframe窗
  534. var iframes = layer.open({
  535. type: 2,
  536. title: '选择节点文档',
  537. fixed: true, //不固定
  538. shadeClose: false,
  539. shade: layer_shade,
  540. area: ['80%', '80%'],
  541. content: url
  542. });
  543. }
  544. // 选择节点文章时加载
  545. function nodeAidSelectLoad(aidArr, addList) {
  546. nodeAidArr = aidArr;
  547. nodeAidList = addList;
  548. nodeAidStr = nodeAidArr.join(',');
  549. }
  550. // 选择关联文章返回
  551. function selectArticleBack() {
  552. var html = '';
  553. for (var i = 0; i < nodeAidList.length; i++) {
  554. // 文档列表处理
  555. html +=
  556. '<tr draggable="false" class="ment-table-row">'+
  557. '<td class="">'+
  558. '<div class="ment-table-cell ellipsis">' + nodeAidList[i]['title'] + '</div>'+
  559. '</td>'+
  560. '<td class="">'+
  561. '<div class="ment-table-cell">'+
  562. '<a class="curpoin" href="javaScript:void(0);" data-aid="' + nodeAidList[i]['aid'] + '" data-id="' + nodeTagID + '" onclick="delNodeArchives(this);">删除</a>'+
  563. '</div>'+
  564. '</td>'+
  565. '</tr>';
  566. }
  567. // 加载文档标题显示
  568. tbodyTr.empty().html(html);
  569. $('.dl_'+nodeTagID+'_isauto_0 .special-items-row').show();
  570. // 加载文档aid隐藏域
  571. lists_node.val(nodeAidStr);
  572. // 加载文档标题隐藏域
  573. lists_html.val(JSON.stringify(nodeAidList));
  574. }
  575. // 删除节点文档列表中指定的文档
  576. function delNodeArchives(obj) {
  577. // 获取单个节点文档aid列表
  578. var singleNodeList = $('#' + $(obj).attr('data-id')).find("input[name='specialNode[aidlist][]']");
  579. var singleNodeAids = singleNodeList.val().split(',');
  580. // 处理删除单个节点指定的文档aid
  581. var aid = $(obj).attr('data-aid');
  582. for (var i = 0; i < singleNodeAids.length; i++) {
  583. if (parseInt(aid) === parseInt(singleNodeAids[i])) singleNodeAids.splice(i, 1);
  584. }
  585. // 将处理后的节点aid列表回存
  586. singleNodeList.val(singleNodeAids.join(','));
  587. // 获取单个节点文档html列表
  588. var singleNodeObj = $('#' + $(obj).attr('data-id')).find("input[name='specialNode[htmllist][]']");
  589. var singleNodeHtml = $.parseJSON(singleNodeObj.val());
  590. // 处理删除单个节点指定的文档html
  591. for (var i = 0; i < singleNodeHtml.length; i++) {
  592. if (parseInt(aid) === parseInt(singleNodeHtml[i].aid)) singleNodeHtml.splice(i, 1);
  593. }
  594. // 将处理后的节点html列表回存
  595. singleNodeObj.val(JSON.stringify(singleNodeHtml));
  596. // 删除节点文档html
  597. $(obj).parent().parent().parent().remove();
  598. }
  599. /**
  600. * 删除节点
  601. * @return {[type]} [description]
  602. */
  603. function specialNodeDel(obj) {
  604. var num = $('.specialNodeItems').length;
  605. if (num <= 1) {
  606. layer.msg('至少保留一个!', {icon: 2});
  607. return false;
  608. }
  609. $(obj).parent().remove();
  610. }
  611. /**
  612. * 新增节点
  613. * @return {[type]} [description]
  614. */
  615. var node_itemid = $('.tab_div_2 .specialNodeItems').length;
  616. function specialNodeAdd() {
  617. var len = $('.specialNodeItems').length;
  618. var itemObj = $($('.specialNodeItems')[len - 1]);
  619. var nodehtml = itemObj.html();
  620. var itemid = itemObj.find("input[name='specialNode[itemid][]']").val();
  621. node_itemid++;
  622. nodehtml = '<div class="special-items specialNodeItems" id="specialNode_'+itemid+'_item">'+nodehtml+'</div>';
  623. nodehtml = nodehtml.replace(new RegExp('specialNode_'+itemid+'_item', "g"), 'specialNode_'+node_itemid+'_item'); //第一个参数是正则表达式。
  624. nodehtml = nodehtml.replace(new RegExp('specialNode\\[isauto\\]\\['+itemid+'\\]', "g"), 'specialNode[isauto]['+node_itemid+']'); //第一个参数是正则表达式。
  625. $($('.specialNodeItems')[0]).before(nodehtml);
  626. // 重置数据
  627. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[title][]']").val('节点'+node_itemid);
  628. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[code][]']").val('default'+node_itemid);
  629. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[isauto]["+node_itemid+"]'][value='0']").prop("checked",true);
  630. // $('#specialNode_'+node_itemid+'_item').find("textarea[name='specialNode[aidlist][]']").val('');
  631. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[keywords][]']").val('');
  632. $('#specialNode_'+node_itemid+'_item').find("select[name='specialNode[typeid][]']").val('0');
  633. $('#specialNode_'+node_itemid+'_item').find("select[name='specialNode[row][]']").val('10');
  634. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[itemid][]']").val(node_itemid);
  635. // 清理节点文档列表
  636. $('#specialNode_'+node_itemid+'_item .archivesTbody').html('');
  637. $('#specialNode_'+node_itemid+'_item .dl_specialNode_'+node_itemid+'_item_isauto_0').show();
  638. $('#specialNode_'+node_itemid+'_item .dl_specialNode_'+node_itemid+'_item_isauto_1').hide();
  639. $('#specialNode_'+node_itemid+'_item .dl_specialNode_'+node_itemid+'_item_isauto_0 .special-items-row').eq(1).hide();
  640. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[aidlist][]']").val('');
  641. $('#specialNode_'+node_itemid+'_item').find("input[name='specialNode[htmllist][]']").val('');
  642. }
  643. function checkNode() {
  644. var returnVal = true;
  645. var titleObj = $("input[name='specialNode[title][]']");
  646. $.each(titleObj, function (index, item) {
  647. if ($.trim($(item).val()) == '') {
  648. showErrorMsg('节点名称不能为空!');
  649. $(item).focus();
  650. returnVal = false;
  651. return false;
  652. }
  653. });
  654. if (true == returnVal) {
  655. returnVal = nodeTitleUnique(0);
  656. }
  657. if (true == returnVal) {
  658. var codeObj = $("input[name='specialNode[code][]']");
  659. $.each(codeObj, function (index, item) {
  660. if ($.trim($(item).val()) == '') {
  661. showErrorMsg('节点标识不能为空!');
  662. $(item).focus();
  663. returnVal = false;
  664. return false;
  665. }
  666. });
  667. }
  668. if (true == returnVal) {
  669. returnVal = nodeCodeUnique(0);
  670. }
  671. return returnVal;
  672. }
  673. function keyupNodeTitleUnique(obj) {
  674. var returnVal = true;
  675. $(obj).parent().find('span.err').html('').hide();
  676. returnVal = nodeTitleUnique(1);
  677. if (!returnVal) {
  678. $(obj).parent().find('span.err').html('<font color="red">已存在,请更改!</font>').show();
  679. }
  680. }
  681. function keyupNodeCodeUnique(obj) {
  682. var returnVal = true;
  683. $(obj).parent().find('span.err').html('').hide();
  684. returnVal = nodeCodeUnique(1);
  685. if (!returnVal) {
  686. $(obj).parent().find('span.err').html('<font color="red">已存在,请更改!</font>').show();
  687. }
  688. }
  689. /**
  690. * 检测节点名称的唯一性
  691. * @return {[type]} [description]
  692. */
  693. function nodeTitleUnique(isMsg) {
  694. var returnVal = true;
  695. var titleObj = $("input[name='specialNode[title][]']");
  696. $.each(titleObj, function (index, item) {
  697. var bnum = 0;
  698. $.each(titleObj, function (index2, item2) {
  699. if ($.trim($(item).val()) == $.trim($(item2).val())) {
  700. bnum += 1;
  701. }
  702. })
  703. if (bnum > 1) {
  704. if (0 == isMsg) {
  705. showErrorMsg('节点名称已存在,请更改!');
  706. $(item).focus();
  707. }
  708. returnVal = false;
  709. return false;
  710. }
  711. });
  712. return returnVal;
  713. }
  714. /**
  715. * 检测节点标识的唯一性
  716. * @return {[type]} [description]
  717. */
  718. function nodeCodeUnique(isMsg) {
  719. var returnVal = true;
  720. var codeObj = $("input[name='specialNode[code][]']");
  721. $.each(codeObj, function (index, item) {
  722. var bnum = 0;
  723. $.each(codeObj, function (index2, item2) {
  724. if ($.trim($(item).val()) == $.trim($(item2).val())) {
  725. bnum += 1;
  726. }
  727. })
  728. if (bnum > 1) {
  729. if (0 == isMsg) {
  730. showErrorMsg('节点标识已存在,请更改!');
  731. $(item).focus();
  732. }
  733. returnVal = false;
  734. return false;
  735. }
  736. });
  737. return returnVal;
  738. }
  739. /** 以下 专题节点的拖动排序相关 js*/
  740. // $( ".sort-list-special" ).sortable({
  741. // start: function( event, ui) {
  742. // }
  743. // ,stop: function( event, ui ) {
  744. // }
  745. // });
  746. //因为他们要拖动,所以尽量设置他们的文字不能选择。
  747. // $( ".sort-list-special" ).disableSelection();
  748. function newtpl()
  749. {
  750. var url = "{:url('Archives/ajax_newtpl', ['type'=>'view', 'nid'=>'special'])}";
  751. //iframe窗
  752. layer.open({
  753. type: 2,
  754. title: '新建文档模板',
  755. fixed: true, //不固定
  756. shadeClose: false,
  757. shade: layer_shade,
  758. maxmin: true, //开启最大化最小化按钮
  759. area: ['90%', '90%'],
  760. content: url
  761. });
  762. }
  763. </script>
  764. <script>
  765. try{
  766. var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
  767. if (mt20_1649209614 == 1){
  768. $("#geduan_div").removeClass("h10");
  769. }else{
  770. $("#geduan_div").addClass("h10");
  771. }
  772. }catch(e){}
  773. </script>
  774. {include file="public/footer" /}