Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
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.

56 lines
1.3 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. <h1>$title</h1>
  2. <p id="cropimage-desc">
  3. $desc
  4. </p>
  5. <div id="cropimage-wrapper">
  6. <img src="$image_url" id="croppa" class="imgCrop" alt="$title" />
  7. </div>
  8. <div id="cropimage-preview-wrapper" >
  9. <div id="previewWrap" ></div>
  10. </div>
  11. <script type="text/javascript" language="javascript">
  12. function onEndCrop( coords, dimensions ) {
  13. $( 'x1' ).value = coords.x1;
  14. $( 'y1' ).value = coords.y1;
  15. $( 'x2' ).value = coords.x2;
  16. $( 'y2' ).value = coords.y2;
  17. $( 'width' ).value = dimensions.width;
  18. $( 'height' ).value = dimensions.height;
  19. }
  20. Event.observe( window, 'load', function() {
  21. new Cropper.ImgWithPreview(
  22. 'croppa',
  23. {
  24. previewWrap: 'previewWrap',
  25. minWidth: 175,
  26. minHeight: 175,
  27. maxWidth: 640,
  28. maxHeight: 640,
  29. ratioDim: { x: 100, y:100 },
  30. displayOnInit: true,
  31. onEndCrop: onEndCrop
  32. }
  33. );
  34. }
  35. );
  36. </script>
  37. <form action="profile_photo/$resource" id="crop-image-form" method="post" />
  38. <input type="hidden" name="cropfinal" value="1" />
  39. <input type="hidden" name="xstart" id="x1" />
  40. <input type="hidden" name="ystart" id="y1" />
  41. <input type="hidden" name="xfinal" id="x2" />
  42. <input type="hidden" name="yfinal" id="y2" />
  43. <input type="hidden" name="height" id="height" />
  44. <input type="hidden" name="width" id="width" />
  45. <div id="crop-image-submit-wrapper" >
  46. <input type="submit" name="submit" value="$done" />
  47. </div>
  48. </form>