暫無描述
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.

water.htm 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <style>
  5. .span_1 {
  6. float: left;
  7. margin-left: 0px;
  8. height: 130px;
  9. line-height: 130px;
  10. }
  11. .span_1 ul {
  12. list-style: none;
  13. padding: 0px;
  14. }
  15. .span_1 ul li {
  16. border: 1px solid #CCC;
  17. height: 40px;
  18. padding: 0px 10px;
  19. margin-left: -1px;
  20. margin-top: -1px;
  21. line-height: 40px;
  22. }
  23. #mark_txt_color {
  24. /*margin:0;*/
  25. /*padding:0;*/
  26. border:solid 1px #ccc;
  27. width:70px;
  28. height:20px;
  29. border-right:40px solid green;
  30. /*line-height:20px;*/
  31. }
  32. </style>
  33. <script type="text/javascript" src="__PUBLIC__/plugins/colpick/js/colpick.js"></script>
  34. <link href="__PUBLIC__/plugins/colpick/css/colpick.css" rel="stylesheet" type="text/css"/>
  35. <div id="append_parent"></div>
  36. <div id="ajaxwaitid"></div>
  37. <div class="page min-hg-c-10">
  38. <div class="fixed-bar">
  39. <div class="item-title">
  40. {eq name='$Request.param.source' value='archives'}
  41. <a class="back_xin" href="javascript:history.back();" title="返回"><i class="iconfont e-fanhui"></i></a>
  42. {else /}
  43. <a class="back_xin" href="{:url('Index/switch_map')}" title="返回"><i class="iconfont e-fanhui"></i></a>
  44. {/eq}
  45. <div class="subject">
  46. <h3>图片水印</h3>
  47. <h5></h5>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="flexigrid">
  52. <form method="post" id="handlepost" action="{:url('System/water')}">
  53. <div class="ncap-form-default">
  54. <dl class="row">
  55. <dt class="tit">水印功能</dt>
  56. <dd class="opt">
  57. <label class="curpoin"><input id="is_mark1" name="is_mark" value="1" {if condition="isset($config.is_mark) && $config.is_mark eq 1"}checked{/if} type="radio">开启</label>
  58. &nbsp;
  59. <label class="curpoin"><input id="is_mark0" name="is_mark" value="0" {if condition="!isset($config.is_mark) || $config.is_mark eq 0"}checked{/if} type="radio">关闭</label>
  60. <p class="notic">全站图片添加水印</p>
  61. </dd>
  62. </dl>
  63. <dl class="row none">
  64. <dt class="tit">缩略图水印</dt>
  65. <dd class="opt">
  66. <label class="curpoin"><input id="is_thumb_mark1" name="is_thumb_mark" value="1" {if condition="isset($config.is_thumb_mark) && $config.is_thumb_mark eq 1"}checked{/if} type="radio">开启</label>
  67. &nbsp;
  68. <label class="curpoin"><input id="is_thumb_mark0" name="is_thumb_mark" value="0" {if condition="!isset($config.is_thumb_mark) || $config.is_thumb_mark eq 0"}checked{/if} type="radio">关闭</label>
  69. <p class="notic">开启之后,满足水印条件的缩略图会自动打上水印</p>
  70. </dd>
  71. </dl>
  72. <dl class="row">
  73. <dt class="tit">水印类型</dt>
  74. <dd class="opt">
  75. <label class="curpoin"><input id="mark_type1" onclick="setwarter('text')" name="mark_type" value="text" {if condition="isset($config.mark_type) && $config.mark_type eq 'text'"}checked{/if} type="radio">文字</label>
  76. &nbsp;
  77. <label class="curpoin"><input id="mark_type0" onclick="setwarter('img')" name="mark_type" value="img" {if condition="isset($config.mark_type) && $config.mark_type eq 'img'"}checked{/if} type="radio">图片</label>
  78. <p class="notic"></p>
  79. </dd>
  80. </dl>
  81. <dl class="row">
  82. <dt class="tit">水印条件</dt>
  83. <dd class="opt">
  84. <ul class="nofloat">
  85. <li>
  86. <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" value="{$config.mark_width|default=''}" name="mark_width" id="mark_width" checked="checked" type="text">
  87. <span class="err">只能输入整数</span>
  88. <label for="mark_width">图片宽度 单位像素(px)</label>
  89. </li>
  90. <li>
  91. <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" value="{$config.mark_height|default=''}" name="mark_height" id="mark_height" checked="checked" type="text">
  92. <label for="mark_height">图片高度 单位像素(px)</label>
  93. </li>
  94. </ul>
  95. <p class="">提示:图片宽度和高度至少要达到以上像素才能添加水印</p>
  96. </dd>
  97. </dl>
  98. <dl class="row texttr" style="display:none;">
  99. <dt class="tit">
  100. <label for="mark_txt">水印文字</label>
  101. </dt>
  102. <dd class="opt">
  103. <input name="mark_txt" id="mark_txt" value="{$config.mark_txt|default=''}" class="input-txt" type="text" />
  104. <p class="notic"></p>
  105. </dd>
  106. </dl>
  107. <dl class="row imgtr">
  108. <dt class="tit">
  109. <label for="mark_img">水印图片</label>
  110. </dt>
  111. <dd class="opt">
  112. <div class="input-file-show div_mark_img_local">
  113. <span class="show">
  114. <a id="img_a" class="nyroModal" rel="gal" href="{$config.mark_img|default='javascript:void(0);'}" target="_blank">
  115. <i id="img_i" class="fa fa-picture-o" {notempty name="$config.mark_img"}onmouseover="layer_tips=layer.tips('<img src={$config.mark_img|default=''}>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  116. </a>
  117. </span>
  118. <span class="type-file-box">
  119. <input type="text" name="mark_img" id="mark_img" value="{$config.mark_img|default=''}" class="type-file-text" autocomplete="off">
  120. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  121. <input class="type-file-file" onClick="GetUploadimgnew(1,'','allimg','call_back','water');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  122. </span>
  123. </div>
  124. <span class="err"></span>
  125. <p class="notic">最佳显示尺寸为240*60像素</p>
  126. </dd>
  127. </dl>
  128. <dl class="row texttr" style="display:none;">
  129. <dt class="tit">
  130. <label for="mark_txt_size">字体大小</label>
  131. </dt>
  132. <dd class="opt">
  133. <input name="mark_txt_size" id="mark_txt_size" value="{$config.mark_txt_size|default=30}" class="input-txt" type="text" />
  134. <p class="notic"></p>
  135. </dd>
  136. </dl>
  137. <dl class="row texttr" style="display:none;">
  138. <dt class="tit">
  139. <label for="mark_txt_color">文字颜色</label>
  140. </dt>
  141. <dd class="opt">
  142. <input type="text" name="mark_txt_color" value="{$config.mark_txt_color|default='#000000'}" id="mark_txt_color" style="border-color: {$config.mark_txt_color|default='#000000'};" />
  143. <p class="notic"></p>
  144. </dd>
  145. </dl>
  146. <dl class="row">
  147. <dt class="tit">
  148. <label for="mark_degree">水印透明度</label>
  149. </dt>
  150. <dd class="opt">
  151. <input pattern="^\d{1,}$" onblur="$('#mark_degree2').empty().html(this.value);" name="mark_degree" id="mark_degree" value="{$config.mark_degree|default=''}" class="input-txt" type="range" min="0" step="2" max="100">
  152. <span class="err" id="mark_degree2">{$config.mark_degree|default=''}</span>
  153. <p class="notic">0代表完全透明,100代表不透明</p>
  154. </dd>
  155. </dl>
  156. <dl class="row imgtr">
  157. <dt class="tit">
  158. <label for="mark_degree">JPEG 水印质量</label>
  159. </dt>
  160. <dd class="opt">
  161. <input pattern="^\d{1,}$" onblur="$('#mark_quality2').empty().html(this.value);" name="mark_quality" id="mark_quality" value="{$config.mark_quality|default=''}" class="input-txt" type="range" min="0" step="2" max="100">
  162. <span class="err" id="mark_quality2">{$config.mark_quality|default=''}</span>
  163. <p class="notic">水印质量请设置为0-100之间的数字,决定 jpg 格式图片的质量</p>
  164. </dd>
  165. </dl>
  166. <dl class="row">
  167. <dt class="tit">
  168. <label for="mark_degree">水印位置</label>
  169. </dt>
  170. <dd class="opt">
  171. <div style="height:124px; background:#fff">
  172. <span class="span_1">
  173. <ul>
  174. <li><input type="radio" name="mark_sel" value="1"
  175. {if condition="isset($config.mark_sel) && $config.mark_sel eq '1'"}checked{/if}
  176. >&nbsp;顶部居左
  177. </li>
  178. <li><input type="radio" name="mark_sel" value="4"
  179. {if condition="isset($config.mark_sel) && $config.mark_sel eq '4'"}checked{/if}
  180. >&nbsp;中部居左
  181. </li>
  182. <li><input type="radio" name="mark_sel" value="7"
  183. {if condition="isset($config.mark_sel) && $config.mark_sel eq '7'"}checked{/if}
  184. >&nbsp;底部居左
  185. </li>
  186. </ul>
  187. </span>
  188. <span class="span_1">
  189. <ul>
  190. <li><input type="radio" name="mark_sel" value="2"
  191. {if condition="isset($config.mark_sel) && $config.mark_sel eq '2'"}checked{/if}
  192. >&nbsp;顶部居中
  193. </li>
  194. <li><input type="radio" name="mark_sel" value="5"
  195. {if condition="isset($config.mark_sel) && $config.mark_sel eq '5'"}checked{/if}
  196. >&nbsp;中部居中
  197. </li>
  198. <li><input type="radio" name="mark_sel" value="8"
  199. {if condition="isset($config.mark_sel) && $config.mark_sel eq '8'"}checked{/if}
  200. >&nbsp;底部居中
  201. </li>
  202. </ul>
  203. </span>
  204. <span class="span_1">
  205. <ul>
  206. <li><input type="radio" name="mark_sel" value="3"
  207. {if condition="isset($config.mark_sel) && $config.mark_sel eq '3'"}checked{/if}
  208. >&nbsp;顶部居右
  209. </li>
  210. <li><input type="radio" name="mark_sel" value="6"
  211. {if condition="isset($config.mark_sel) && $config.mark_sel eq '6'"}checked{/if}
  212. >&nbsp;中部居右
  213. </li>
  214. <li><input type="radio" name="mark_sel" value="9"
  215. {if condition="isset($config.mark_sel) && $config.mark_sel eq '9'"}checked{/if}
  216. >&nbsp;底部居右
  217. </li>
  218. </ul>
  219. </span>
  220. <div style="clear:both;"></div>
  221. </div>
  222. </dd>
  223. </dl>
  224. <div class="bot">
  225. <input type="hidden" name="tabase" value="{$Request.param.tabase}">
  226. <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="adsubmit();">确认提交</a>
  227. </div>
  228. </div>
  229. </form>
  230. </div>
  231. </div>
  232. <script type="text/javascript">
  233. $(document).ready(function(){
  234. // 点击刷新数据
  235. $('.fa-refresh').click(function(){
  236. location.href = location.href;
  237. });
  238. var marktype = "{$config.mark_type|default=''}";
  239. setwarter(marktype);
  240. // 颜色选择
  241. $('#mark_txt_color').colpick({
  242. flat:false,
  243. layout:'rgbhex',
  244. submit:0,
  245. colorScheme:'light',
  246. color:$('#mark_txt_color').val(),
  247. onChange:function(hsb,hex,rgb,el,bySetColor) {
  248. $(el).css('border-color','#'+hex);
  249. // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
  250. if(!bySetColor) $(el).val('#'+hex);
  251. }
  252. }).keyup(function(){
  253. $(this).colpickSetColor('#'+this.value);
  254. });
  255. });
  256. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  257. function adsubmit(){
  258. layer_loading('正在处理');
  259. $.ajax({
  260. type : 'post',
  261. url : "{:url('System/water', ['_ajax'=>1])}",
  262. data : $('#handlepost').serialize(),
  263. dataType : 'json',
  264. success : function(res){
  265. layer.closeAll();
  266. if(res.code == 1){
  267. var _parent = parent;
  268. _parent.layer.close(parentObj);
  269. _parent.layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  270. // _parent.window.location.reload();
  271. });
  272. }else{
  273. showErrorMsg(res.msg);
  274. }
  275. },
  276. error: function(e){
  277. layer.closeAll();
  278. layer.alert(e.responseText, {icon: 5, title:false});
  279. }
  280. });
  281. }
  282. // 上传水印图片成功回调函数
  283. function call_back(fileurl_tmp){
  284. $("#mark_img").val(fileurl_tmp);
  285. $("#img_a").attr('href', fileurl_tmp);
  286. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
  287. }
  288. function setwarter(marktype){
  289. if(marktype == 'text'){
  290. $('.texttr').show();
  291. $('.imgtr').hide();
  292. }else{
  293. $('.texttr').hide();
  294. $('.imgtr').show();
  295. }
  296. }
  297. </script>
  298. {include file="public/footer" /}