misc_imgcropper.htm 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!--{if $_GET['op'] == 'loadcropper'}-->
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}">
  6. <!--{if $_G['config']['output']['iecompatible']}--><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE{$_G['config']['output']['iecompatible']}" /><!--{/if}-->
  7. <title><!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}--> Powered by Discuz!</title>
  8. <meta name="copyright" content="2001-2013 Comsenz Inc." />
  9. <meta name="MSSmartTagsPreventParsing" content="True" />
  10. <meta http-equiv="MSThemeCompatible" content="Yes" />
  11. <script type="text/javascript">var STYLEID = '{STYLEID}', STATICURL = '{STATICURL}', IMGDIR = '{IMGDIR}', VERHASH = '{VERHASH}', charset = '{CHARSET}', discuz_uid = '$_G[uid]', cookiepre = '{$_G[config][cookie][cookiepre]}', cookiedomain = '{$_G[config][cookie][cookiedomain]}', cookiepath = '{$_G[config][cookie][cookiepath]}', showusercard = '{$_G[setting][showusercard]}', attackevasive = '{$_G[config][security][attackevasive]}', disallowfloat = '{$_G[setting][disallowfloat]}', creditnotice = '<!--{if $_G['setting']['creditnotice']}-->$_G['setting']['creditnames']<!--{/if}-->', defaultstyle = '$_G[style][defaultextstyle]', REPORTURL = '$_G[currenturl_encode]', SITEURL = '$_G[siteurl]', JSPATH = '$_G[setting][jspath]';</script>
  12. <script type="text/javascript" src="{$_G[setting][jspath]}common.js?{VERHASH}"></script>
  13. <script type="text/javascript" src="{$_G[setting][jspath]}imgcropper.js?{VERHASH}"></script>
  14. <style type="text/css">
  15. body{margin: 0; padding: 0}
  16. #rightDown{
  17. position:absolute;
  18. background:#FFF url({IMGDIR}/r_b_resize.png) no-repeat 0 0;
  19. width: 16px;
  20. height: 16px;
  21. z-index:500;
  22. font-size:0;
  23. opacity: 0.8;
  24. filter:alpha(opacity=80);
  25. cursor:nw-resize;
  26. right:0;
  27. bottom:0;
  28. }
  29. #bgDiv{width:{$cbgboxwidth}px; height:{$cbgboxheight}px; border:1px solid #666666; position:relative;}
  30. #dragDiv{border:1px dashed #00f; width:{$cboxwidth}px; height:{$cboxheight}px; top:{$dragpt}px; left:{$dragpl}px; cursor:move; }
  31. </style>
  32. </head>
  33. <body>
  34. <div id="bgDiv" style="width:{$cbgboxwidth}px; height:{$cbgboxheight}px;">
  35. <div id="dragDiv" style="top:{$dragpt}px; left:{$dragpl}px;">
  36. </div>
  37. <div id="rightDown"></div>
  38. </div>
  39. <script type="text/javascript">
  40. var cropper = new ImgCropper("bgDiv", "dragDiv", "$_GET[img]", {
  41. width: $cbgboxwidth, height: $cbgboxheight, color: "#000", min:true, minWidth:$cboxwidth, minHeight:{$cboxheight},
  42. resize: true, rightDown: "rightDown"
  43. });
  44. </script>
  45. </body>
  46. </html>
  47. <!--{else}-->
  48. <!--{template common/header}-->
  49. <h3 class="flb">
  50. <em id="return_$_GET[handlekey]">{lang imgcropper}</em>
  51. <!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_GET[handlekey]');" class="flbc" title="{lang close}">{lang close}</a></span><!--{/if}-->
  52. </h3>
  53. <div id="__groupnameform_">
  54. <form method="post" autocomplete="off" id="groupnameform_" name="groupnameform_" action="misc.php?mod=imgcropper" {if $_G[inajax]}onsubmit="ajaxpost(this.id, 'return_$_GET[handlekey]');"{/if}>
  55. <input type="hidden" name="referer" value="{echo dreferer()}">
  56. <input type="hidden" name="imgcroppersubmit" value="true" />
  57. <!--{if $_G[inajax]}--><input type="hidden" name="handlekey" value="$_GET[handlekey]" /><!--{/if}-->
  58. <input type="hidden" name="formhash" value="{FORMHASH}" />
  59. <input type="hidden" name="cutleft" id="cutleft" value="0" />
  60. <input type="hidden" name="cuttop" id="cuttop" value="0" />
  61. <input type="hidden" name="cutwidth" id="cutwidth" value="0" />
  62. <input type="hidden" name="cutheight" id="cutheight" value="0" />
  63. <input type="hidden" name="picwidth" id="picwidth" value="0" />
  64. <input type="hidden" name="picheight" id="picheight" value="0" />
  65. <input type="hidden" name="cutimg" value="$_GET['img']" />
  66. <!--{if $_GET['ictype'] == 'block'}-->
  67. <input type="hidden" name="bid" value="$_GET[bid]" />
  68. <input type="hidden" name="picflag" value="$_GET[picflag]" />
  69. <!--{/if}-->
  70. <input type="hidden" name="ictype" value="$_GET[ictype]" />
  71. <div class="c">
  72. <iframe src="misc.php?mod=imgcropper&op=loadcropper&img={$prefix}{$_GET['img']}&width=$_GET['width']&height=$_GET['height']" id="cropperiframe" frameborder="0" scrolling="no" marginwidth="0" onload="setWinHeight(this)"></iframe>
  73. </div>
  74. <p class="o pns">
  75. <button type="submit" name="groupnamesubmit_btn" value="true" class="pn pnc"><strong>{lang imgcropper_crop}</strong></button>
  76. </p>
  77. </form>
  78. <script type="text/javascript">
  79. function setWinHeight(obj){
  80. var win = obj;
  81. if (document.getElementById) {
  82. if (win && !window.opera) {
  83. if (win.contentDocument && win.contentDocument.documentElement.scrollHeight) {
  84. win.height = win.contentDocument.documentElement.scrollHeight;
  85. win.width = win.contentDocument.documentElement.scrollWidth;
  86. } else if(win.Document && win.Document.body.scrollHeight) {
  87. win.height = win.Document.body.scrollHeight;
  88. win.width = win.Document.body.scrollWidth;
  89. }
  90. }
  91. }
  92. }
  93. function resetHeight(divObj, ipos, imgObj) {
  94. var iframeObject = $('cropperiframe');
  95. iframeObject.height = divObj.style.height;
  96. iframeObject.width = divObj.style.width;
  97. $('cutleft').value = ipos.Left;
  98. $('cuttop').value = ipos.Top;
  99. $('cutwidth').value = ipos.Width-2;
  100. $('cutheight').value = ipos.Height-2;
  101. $('picwidth').value = imgObj.width;
  102. $('picheight').value = imgObj.height;
  103. }
  104. function succeedhandle_$_GET[handlekey](url, msg, values) {
  105. <!--{if $_GET['ictype'] == 'block'}-->
  106. $('icflag').value = 1;
  107. <!--{/if}-->
  108. }
  109. </script>
  110. </div>
  111. <!--{template common/footer}-->
  112. <!--{/if}-->