cropper_functions.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. $(document).ready(function() {
  2. var placeholderImage = $('#placeHolderContainer').val();
  3. var placeholderCategory = $('#placeHolderCategory').val();
  4. var placeholderHeader = $('#placeHolderHeaderContainer').val();
  5. var placeholderImageProfile = $('#tempContainer').val();
  6. if (!placeholderImage) placeholderImage = placeholderImageProfile;
  7. $('#avatarImage').cropit({
  8. exportZoom: 1.25,
  9. type: 'image/jpeg',
  10. quality: 1,
  11. imageBackground: true,
  12. imageBackgroundBorderWidth: 20,
  13. imageState: { src: placeholderImage }
  14. });
  15. $('#categoryImage').cropit({
  16. exportZoom: 1.25,
  17. type: 'image/jpeg',
  18. quality: 1,
  19. imageBackground: true,
  20. imageBackgroundBorderWidth: 20,
  21. imageState: { src: placeholderCategory }
  22. });
  23. $('#headImage').cropit({
  24. exportZoom: 1.25,
  25. type: 'image/jpeg',
  26. quality: 1,
  27. imageBackground: true,
  28. imageBackgroundBorderWidth: 20,
  29. imageState: { src: placeholderHeader }
  30. });
  31. $('#galeryImage').cropit({
  32. exportZoom: 1.25,
  33. type: 'image/jpeg',
  34. quality: 1,
  35. imageBackground: true,
  36. imageBackgroundBorderWidth: 20
  37. });
  38. $('.image-editor').cropit({
  39. exportZoom: 1.25,
  40. type: 'image/jpeg',
  41. quality: 1,
  42. height: '250px',
  43. imageBackground: true,
  44. imageBackgroundBorderWidth: 20
  45. });
  46. });