Skip to content

Commit 342e27c

Browse files
committed
Releasing 1.0.22
2 parents 10ef597 + 1a096c1 commit 342e27c

File tree

3 files changed

+67
-18
lines changed

3 files changed

+67
-18
lines changed

css/cropper/cropper-ui.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.cropper-actions {
22
margin-top: 0.5em;
3-
margin-left: 20px;
43
}
54

65
.cropper-actions label {
@@ -18,6 +17,7 @@
1817
overflow-x: auto;
1918
white-space: nowrap;
2019
scrollbar-width: thin;
20+
margin-bottom: 10px;
2121
}
2222

2323
.cropper-nav-link {
@@ -47,3 +47,11 @@
4747
.cropper-nav-link-hover span {
4848
padding: 2px;
4949
}
50+
51+
.cropper-editor {
52+
width: 100%;
53+
}
54+
55+
.cropper-image {
56+
background-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC\');
57+
}

src/WebApp/BootstrapTheme/NewImageUploadRenderer.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace WebApp\BootstrapTheme;
44

5+
use TgI18n\I18N;
56
use WebApp\Utils;
67

78
class NewImageUploadRenderer extends \WebApp\DefaultTheme\DivRenderer {
@@ -46,8 +47,8 @@ public function renderEditor() {
4647
}
4748
$width = $this->component->getWidth();
4849
$height = $this->component->getHeight();
49-
$rc = '<div class="cropper-editor" style="max-width: '.$width.'px; max-height: '.$height.'px; margin: 20px;">'.
50-
'<img data-imgid="'.$did.'" class="cropper-image" style="background-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC\'); width: '.$width.'px; height: '.$height.'px;" src="'.$src.'">'.
50+
$rc = '<div class="cropper-editor">'.
51+
'<img data-imgid="'.$did.'" class="cropper-image img-fluid" src="'.$src.'">'.
5152
//$this->renderDocToggles().
5253
'</div>'.
5354
$this->renderActions();
@@ -63,45 +64,45 @@ public function renderActions() {
6364
// '</div>'.
6465
// Mouse Mode
6566
'<div class="btn-group">'.
66-
$this->renderActionButton('cropperUI.setDragMode(this,\'move\');', 'Move', 'Move Help', 'fa fa-arrows-alt').
67-
$this->renderActionButton('cropperUI.setDragMode(this,\'crop\');', 'Crop', 'Crop Help', 'fa fa-crop-alt').
67+
$this->renderActionButton('cropperUI.setDragMode(this,\'move\');', 'move', 'fa fa-arrows-alt').
68+
$this->renderActionButton('cropperUI.setDragMode(this,\'crop\');', 'crop', 'fa fa-crop-alt').
6869
'</div>'.
6970
// No move into directions (yet)!
7071
// Rotate
7172
'<div class="btn-group">'.
72-
$this->renderActionButton('cropperUI.rotate(this,-90);', 'Rotate Left', 'Rotate Help', 'fa fa-undo-alt').
73-
$this->renderActionButton('cropperUI.rotate(this,90);', 'Rotate Right', 'Rotate Help', 'fa fa-redo-alt').
73+
$this->renderActionButton('cropperUI.rotate(this,-90);', 'rotate_left', 'fa fa-undo-alt').
74+
$this->renderActionButton('cropperUI.rotate(this,90);', 'rotate_right', 'fa fa-redo-alt').
7475
'</div>'.
7576
// Flip
7677
'<div class="btn-group">'.
77-
$this->renderActionButton('cropperUI.scaleX(this,-1);', 'Flip Horizontally', 'Flip Help', 'fa fa-arrows-alt-h').
78-
$this->renderActionButton('cropperUI.scaleY(this,-1);', 'Flip Vertically', 'Flip Help', 'fa fa-arrows-alt-v').
78+
$this->renderActionButton('cropperUI.scaleX(this,-1);', 'flip_horizontally', 'fa fa-arrows-alt-h').
79+
$this->renderActionButton('cropperUI.scaleY(this,-1);', 'flip_vertically', 'fa fa-arrows-alt-v').
7980
'</div>'.
8081
// Finish / Cancel
8182
'<div class="btn-group">'.
82-
'<label class="btn btn-primary btn-upload" for="inputImage" title="Upload image file">'.
83+
'<label class="btn btn-primary btn-upload" for="inputImage" title="'.htmlentities(I18N::_('upload_import_help')).'">'.
8384
'<input type="file" class="sr-only" id="inputImage" name="file" accept="image/*">'.
84-
'<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="Import image">'.
85+
'<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="'.htmlentities(I18N::_('upload_import_help')).'">'.
8586
'<span class="fa fa-upload"></span>'.
8687
'</span>'.
8788
'</label>'.
88-
$this->renderActionButton('cropperUI.reset(this);', 'Reset Changes', 'Reset Help', 'fa fa-trash-restore-alt').
89+
$this->renderActionButton('cropperUI.reset(this);', 'reset', 'fa fa-trash-restore-alt').
8990
'</div>'.
9091
// Delete
9192
'<div class="btn-group">'.
92-
$this->renderActionButton('cropperUI.delete(this);', 'Delete', 'Delete Help', 'fa fa-trash-alt', 'danger').
93+
$this->renderActionButton('cropperUI.delete(this);', 'delete', 'fa fa-trash-alt', 'danger').
9394
'</div>'.
9495
'<div class="btn-group">'.
95-
// $this->renderActionButton('cropperUI.info(this);', 'Info', 'Info Help', 'fa fa-info', 'secondary').
96-
$this->renderActionButton('cropperUI.save(this);', 'Save', 'Save Help', 'fa fa-save', 'success').
96+
// $this->renderActionButton('cropperUI.info(this);', 'Info', 'fa fa-info', 'secondary').
97+
$this->renderActionButton('cropperUI.save(this);', 'save', 'fa fa-save', 'success').
9798
'</div>'.
9899
'</div>';
99100
return $rc;
100101
}
101102

102-
public function renderActionButton($click, $title, $help, $icon, $type = 'primary') {
103-
$rc = '<button type="button" class="btn btn-'.$type.'" onClick="'.$click.'" title="'.htmlentities($title).'">'.
104-
'<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="'.htmlentities($help).'">'.
103+
public function renderActionButton($click, $title, $icon, $type = 'primary') {
104+
$rc = '<button type="button" class="btn btn-'.$type.'" onClick="'.$click.'" title="'.htmlentities(I18N::_('upload_'.$title.'_help')).'">'.
105+
'<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="'.htmlentities(I18N::_('upload_'.$title.'_help')).'">'.
105106
'<span class="'.$icon.'"></span>'.
106107
'</span>'.
107108
'</button>';

src/i18n.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,46 @@
494494
'de' => 'Bitte benutze eine aktuelle Version von Chrome, Edge, Firefox oder Safari.',
495495
'en' => 'Please use a current version of Chrome, Edge, Firefox or Safari.',
496496
),
497+
'upload_move_help' => array(
498+
'de' => 'Zum Verschieben-Modus wechseln',
499+
'en' => 'Switch to Drag Mode',
500+
),
501+
'upload_crop_help' => array(
502+
'de' => 'Zum Ausschneiden-Modus wechseln',
503+
'en' => 'Switch to Crop Mode',
504+
),
505+
'upload_rotate_left_help' => array(
506+
'de' => 'Bild 90 Grad nach links drehen',
507+
'en' => 'Rotate image left by 90 degrees',
508+
),
509+
'upload_rotate_right_help' => array(
510+
'de' => 'Bild 90 Grad nach rechts drehen',
511+
'en' => 'Rotate image right by 90 degrees',
512+
),
513+
'upload_flip_horizontally_help' => array(
514+
'de' => 'Bild horizontal spiegeln',
515+
'en' => 'Flip image horizontally',
516+
),
517+
'upload_flip_vertically_help' => array(
518+
'de' => 'Bild vertikal spiegeln',
519+
'en' => 'Flip image vertically',
520+
),
521+
'upload_import_help' => array(
522+
'de' => 'Bild von der Festplatte öffnen',
523+
'en' => 'Load image from disk',
524+
),
525+
'upload_reset_help' => array(
526+
'de' => 'Änderungen rückgängig machen',
527+
'en' => 'Reset all changes',
528+
),
529+
'upload_delete_help' => array(
530+
'de' => 'Dieses Bild vom Server löschen',
531+
'en' => 'Delete this image from server',
532+
),
533+
'upload_save_help' => array(
534+
'de' => 'Dieses Bild auf dem Server speichern',
535+
'en' => 'Save this image to the server',
536+
),
497537
/* Copy these 4 lines
498538
'' => array(
499539
'de' => '',

0 commit comments

Comments
 (0)