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

thumb.htm 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. #thumb_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 class="" method="post" id="handlepost" action="{:url('System/thumb')}">
  53. <div class="ncap-form-default">
  54. <dl class="row">
  55. <dt class="tit">缩略图功能</dt>
  56. <dd class="opt" style="width: auto;">
  57. <label class="curpoin"><input id="thumb_open1" name="thumb_open" onclick="setthumb(this);" value="1" {if condition="isset($config.thumb_open) && $config.thumb_open eq 1"}checked{/if} type="radio">开启</label>
  58. &nbsp;
  59. <label class="curpoin"><input id="thumb_open0" name="thumb_open" onclick="setthumb(this);" value="0" {if condition="!isset($config.thumb_open) || $config.thumb_open eq 0"}checked{/if} type="radio">关闭</label>
  60. <p class="notic">全站图片进行缩略图处理</p>
  61. </dd>
  62. </dl>
  63. <dl class="row">
  64. <dt class="tit">
  65. <label>生成方式</label>
  66. </dt>
  67. <dd class="opt" style="width: auto;">
  68. <label><input type="radio" name="thumb_mode" value="1" {if condition="isset($config.thumb_mode) AND $config.thumb_mode eq 1"}checked="checked"{/if}>拉伸</label>&nbsp;
  69. <br/>
  70. <label><input type="radio" name="thumb_mode" value="2" {if condition="!isset($config.thumb_mode) OR $config.thumb_mode eq 2"}checked="checked"{/if}>留白</label>&nbsp;
  71. <br/>
  72. <label><input type="radio" name="thumb_mode" value="3" {if condition="isset($config.thumb_mode) AND $config.thumb_mode eq 3"}checked="checked"{/if}>截减</label>&nbsp;
  73. <span class="err"></span>
  74. <p class="notic"></p>
  75. </dd>
  76. </dl>
  77. <dl class="row thumb_mode_2" style="display:none;">
  78. <dt class="tit">
  79. <label for="thumb_color">填充颜色</label>
  80. </dt>
  81. <dd class="opt" style="width: auto;">
  82. <input type="text" name="thumb_color" value="{$config.thumb_color|default='#FFFFFF'}" id="thumb_color" style="border-color: {$config.thumb_color|default='#FFFFFF'};" />
  83. <p class="notic"></p>
  84. </dd>
  85. </dl>
  86. <dl class="row">
  87. <dt class="tit">
  88. <label for="title">缩略图大小</label>
  89. </dt>
  90. <dd class="opt" style="width: auto;">
  91. <input name="thumb_width" id="thumb_width" value="{$config.thumb_width}" type="text" style="width: 50px;" /> X <input name="thumb_height" id="thumb_height" value="{$config.thumb_height}" type="text" style="width: 50px;" /> (宽 X 高) (像素)
  92. <p class="notic"></p>
  93. </dd>
  94. </dl>
  95. <div class="bot">
  96. <input type="hidden" name="tabase" value="{$Request.param.tabase}">
  97. <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="adsubmit();">确认提交</a>
  98. &nbsp;&nbsp;<a href="javascript:void(0);" onclick="tag_call('thumb_open');">缩略图标签高级调用?</a>
  99. </div>
  100. </div>
  101. </form>
  102. </div>
  103. </div>
  104. <script type="text/javascript">
  105. $(document).ready(function(){
  106. // 点击刷新数据
  107. $('.fa-refresh').click(function(){
  108. location.href = location.href;
  109. });
  110. setthumb('auto'); // 关闭状态下禁用表单录入
  111. // 颜色选择
  112. $('#thumb_color').colpick({
  113. flat:false,
  114. layout:'rgbhex',
  115. submit:0,
  116. colorScheme:'light',
  117. color:$('#thumb_color').val(),
  118. onChange:function(hsb,hex,rgb,el,bySetColor) {
  119. $(el).css('border-color','#'+hex);
  120. // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
  121. if(!bySetColor) $(el).val('#'+hex);
  122. }
  123. }).keyup(function(){
  124. $(this).colpickSetColor('#'+this.value);
  125. });
  126. });
  127. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  128. function adsubmit(){
  129. layer_loading('正在处理');
  130. $.ajax({
  131. type : 'post',
  132. url : "{:url('System/thumb', ['_ajax'=>1])}",
  133. data : $('#handlepost').serialize(),
  134. dataType : 'json',
  135. success : function(res){
  136. layer.closeAll();
  137. if(res.code == 1){
  138. var _parent = parent;
  139. _parent.layer.close(parentObj);
  140. _parent.layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  141. // _parent.window.location.reload();
  142. });
  143. }else{
  144. showErrorMsg(res.msg);
  145. }
  146. },
  147. error: function(e){
  148. layer.closeAll();
  149. layer.alert(e.responseText, {icon: 5, title:false});
  150. }
  151. });
  152. }
  153. function setthumb(obj){
  154. if ('auto' == obj) {
  155. $('input[name="thumb_mode"]').attr('disabled', true);
  156. $('input[name="thumb_width"]').attr('disabled', true);
  157. $('input[name="thumb_height"]').attr('disabled', true);
  158. $('input[name="thumb_color"]').attr('disabled', true);
  159. var thumb_open = $('input[name="thumb_open"]:checked').val();
  160. if (1 == thumb_open) {
  161. $('input[name="thumb_mode"]').attr('disabled', false);
  162. $('input[name="thumb_width"]').attr('disabled', false);
  163. $('input[name="thumb_height"]').attr('disabled', false);
  164. $('input[name="thumb_color"]').attr('disabled', false);
  165. }
  166. } else {
  167. var thumb_open = $(obj).val();
  168. if (1 == thumb_open) {
  169. $('input[name="thumb_mode"]').attr('disabled', false);
  170. $('input[name="thumb_width"]').attr('disabled', false);
  171. $('input[name="thumb_height"]').attr('disabled', false);
  172. $('input[name="thumb_color"]').attr('disabled', false);
  173. } else {
  174. $('input[name="thumb_mode"]').attr('disabled', true);
  175. $('input[name="thumb_width"]').attr('disabled', true);
  176. $('input[name="thumb_height"]').attr('disabled', true);
  177. $('input[name="thumb_color"]').attr('disabled', true);
  178. }
  179. }
  180. }
  181. function tag_call(name)
  182. {
  183. $.ajax({
  184. type: "POST",
  185. url: "{:url('System/ajax_tag_call')}",
  186. data: {name:name,_ajax:1},
  187. dataType: 'json',
  188. success: function (res) {
  189. if(res.code == 1){
  190. //询问框
  191. var confirm = layer.confirm(res.data.msg, {
  192. shade: layer_shade,
  193. title: false,
  194. title: '缩略图标签',
  195. closeBtn: 3,
  196. area: ['800px','520px'],
  197. btn: ['关闭'] ,//按钮
  198. }, function(){
  199. layer.close(confirm);
  200. }
  201. );
  202. }else{
  203. layer.alert(res.msg, {icon: 2, title:false});
  204. }
  205. },
  206. error:function(e){
  207. layer.alert(e.responseText, {icon: 2, title:false});
  208. }
  209. });
  210. }
  211. </script>
  212. {include file="public/footer" /}