diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-01-24 11:17:25 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-01-24 11:17:25 +0100 |
commit | 503b2225f03c5ffe663e4e0955b25daa1bd19cf4 (patch) | |
tree | 666488330ddaeeb02bff5bd674534972aabc69b4 /view | |
parent | e3a6b0012e95aae8e0572a53ea96ddc915d6eb03 (diff) | |
parent | 304085606fac6ae4fd2d3e29ed44afb4b4e1bc28 (diff) | |
download | volse-hubzilla-503b2225f03c5ffe663e4e0955b25daa1bd19cf4.tar.gz volse-hubzilla-503b2225f03c5ffe663e4e0955b25daa1bd19cf4.tar.bz2 volse-hubzilla-503b2225f03c5ffe663e4e0955b25daa1bd19cf4.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'view')
-rwxr-xr-x | view/tpl/cropbody.tpl | 43 | ||||
-rwxr-xr-x | view/tpl/cropcover.tpl | 42 | ||||
-rwxr-xr-x | view/tpl/crophead.tpl | 7 | ||||
-rw-r--r-- | view/tpl/settings_permcats.tpl | 2 |
4 files changed, 37 insertions, 57 deletions
diff --git a/view/tpl/cropbody.tpl b/view/tpl/cropbody.tpl index 01d9a24a0..d35546ec6 100755 --- a/view/tpl/cropbody.tpl +++ b/view/tpl/cropbody.tpl @@ -6,36 +6,27 @@ <img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}" /> </div> <div id="cropimage-preview-wrapper" > -<div id="previewWrap" ></div> +<div id="previewWrap" class="crop-preview" style="height: 300px; width: 300px; max-width: 300px; max-height: 300px; overflow: hidden;"></div> </div> <script type="text/javascript" language="javascript"> - function onEndCrop( coords, dimensions ) { - $( 'x1' ).value = coords.x1; - $( 'y1' ).value = coords.y1; - $( 'x2' ).value = coords.x2; - $( 'y2' ).value = coords.y2; - $( 'width' ).value = dimensions.width; - $( 'height' ).value = dimensions.height; - } - - Event.observe( window, 'load', function() { - new Cropper.ImgWithPreview( - 'croppa', - { - previewWrap: 'previewWrap', - minWidth: 300, - minHeight: 300, - maxWidth: 1024, - maxHeight: 1024, - ratioDim: { x: 100, y:100 }, - displayOnInit: true, - onEndCrop: onEndCrop - } - ); - } - ); + +var image = document.getElementById('croppa'); +var cropper = new Cropper(image, { + aspectRatio: 1 / 1, + viewMode: 1, + preview: '.crop-preview', + crop: function(e) { + $( 'x1' ).value = e.detail.x; + $( 'y1' ).value = e.detail.y; + $( 'x2' ).value = e.detail.x + e.detail.width; + $( 'y2' ).value = e.detail.y + e.detail.height; + $( 'width' ).value = e.detail.scaleX; + $( 'height' ).value = e.detail.scaleY; + + } +}); </script> diff --git a/view/tpl/cropcover.tpl b/view/tpl/cropcover.tpl index 04b96a603..8888a967a 100755 --- a/view/tpl/cropcover.tpl +++ b/view/tpl/cropcover.tpl @@ -6,36 +6,26 @@ <img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}" /> </div> <div id="cropimage-preview-wrapper" > -<div id="previewWrap" ></div> +<div id="previewWrap" class="crop-preview" style="width: 320px; height: 116px; max-width: 320px; max-height: 116px; overflow: hidden"></div> </div> <script type="text/javascript" language="javascript"> - function onEndCrop( coords, dimensions ) { - $( 'x1' ).value = coords.x1; - $( 'y1' ).value = coords.y1; - $( 'x2' ).value = coords.x2; - $( 'y2' ).value = coords.y2; - $( 'width' ).value = dimensions.width; - $( 'height' ).value = dimensions.height; - } - - Event.observe( window, 'load', function() { - new Cropper.ImgWithPreview( - 'croppa', - { - previewWrap: 'previewWrap', - minWidth: 240, - minHeight: 87, - maxWidth: 320, - maxHeight: 116, - ratioDim: { x: 100, y:36 }, - displayOnInit: true, - onEndCrop: onEndCrop - } - ); - } - ); +var image = document.getElementById('croppa'); +var cropper = new Cropper(image, { + aspectRatio: 2.75 / 1, + viewMode: 1, + preview: '.crop-preview', + crop: function(e) { + $( 'x1' ).value = e.detail.x; + $( 'y1' ).value = e.detail.y; + $( 'x2' ).value = e.detail.x + e.detail.width; + $( 'y2' ).value = e.detail.y + e.detail.height; + $( 'width' ).value = e.detail.scaleX; + $( 'height' ).value = e.detail.scaleY; + + } +}); </script> diff --git a/view/tpl/crophead.tpl b/view/tpl/crophead.tpl index 48f375426..a5a80c187 100755 --- a/view/tpl/crophead.tpl +++ b/view/tpl/crophead.tpl @@ -1,4 +1,3 @@ - <script type="text/javascript" src="library/cropper/lib/prototype.js" language="javascript"></script> - <script type="text/javascript" src="library/cropper/lib/scriptaculous.js?load=effects,builder,dragdrop" language="javascript"></script> - <script type="text/javascript" src="library/cropper/cropper.js" language="javascript"></script> - <link rel="stylesheet" href="library/cropper/cropper.css" type="text/css" /> +<script type="text/javascript" src="library/cropperjs/dist/cropper.js" language="javascript"></script> +<link rel="stylesheet" href="library/cropperjs/dist/cropper.css" type="text/css" /> + diff --git a/view/tpl/settings_permcats.tpl b/view/tpl/settings_permcats.tpl index f6bb9b036..bbbd41669 100644 --- a/view/tpl/settings_permcats.tpl +++ b/view/tpl/settings_permcats.tpl @@ -50,7 +50,7 @@ <table id="permcat-index"> {{foreach $permcats as $k => $v}} <tr class="permcat-row-{{$k}}"> - <td width="99%"><a href="settings/permcats/{{$k}}">{{$k}}</a></td> + <td width="99%"><a href="settings/permcats/{{$k}}">{{$v}}</a></td> <td width="1%"><i class="fa fa-trash-o drop-icons" onClick="dropItem('/settings/permcats/{{$k}}/drop', '.permcat-row-{{$k}}')"></i></td> </tr> {{/foreach}} |