Skip to content

Commit e81e853

Browse files
committed
Move button to the beggining of editor form for easier styling
Fixes #185
1 parent 14bd46c commit e81e853

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

action/editor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ public function addDataAndToggleButton(Doku_Event $event, $param)
8989
$form = $event->data;
9090

9191
if(is_a($form, \dokuwiki\Form\Form::class)) {
92-
$form->addElement($this->buildToggleButton());
92+
$form->addElement($this->buildToggleButton(), 0);
9393
$form->setHiddenField('prosemirror_json',$prosemirrorJSON);
9494
$form->addHTML('<div class="prosemirror_wrapper" id="prosemirror__editor"></div>', 1);
9595
} else {
9696
// todo remove when old stable is no longer supported
97-
$form->addElement($this->buildOldToggleButton());
97+
$form->insertElement(0, $this->buildOldToggleButton());
9898
$form->addHidden('prosemirror_json',$prosemirrorJSON);
9999
$form->insertElement(1, '<div class="prosemirror_wrapper" id="prosemirror__editor"></div>');
100100
}
@@ -106,7 +106,7 @@ public function addDataAndToggleButton(Doku_Event $event, $param)
106106
* Creates it as hidden if forcing WYSIWYG
107107
*
108108
* @deprecated use buildToggleButton instead
109-
* @return array the pseudo-tag expected by \Doku_Form::addElement
109+
* @return array the pseudo-tag expected by \Doku_Form::insertElement
110110
*/
111111
protected function buildOldToggleButton()
112112
{

lang/de/lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
// custom language strings for the plugin
9-
$lang['switch_editors'] = 'Schalte WYSIWYG-Editor um';
9+
$lang['switch_editors'] = 'Syntax &#11020; Visueller Editor umschalten';
1010

1111
$lang['link target'] = 'Linkziel';
1212
$lang['type:wiki page'] = 'Eine Seite in diesem Wiki';

lang/en/lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
// custom language strings for the plugin
9-
$lang['switch_editors'] = 'Toggle WYSIWYG editor';
9+
$lang['switch_editors'] = 'Toggle syntax &#11020; visual editor';
1010

1111
$lang['link target'] = 'Link target';
1212
$lang['type:wiki page'] = 'A page in this wiki';

style.less

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@
9595

9696
.dokuwiki {
9797
.plugin_prosemirror_useWYSIWYG {
98-
position: absolute;
99-
top: 2.9em;
100-
right: 2em;
101-
padding: 3px 8px;
102-
color: #444;
103-
background-color: white;
98+
margin-bottom: 0.75rem;
99+
display: flex;
104100
}
105101

106102
.footnote-tooltip {

0 commit comments

Comments
 (0)