-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
The plugin seems to have no support for aligning the pasted image.
A simplistic implementation could use the media manager's alignment settings similar to what dw_mediamanager_item_select does in lib/scripts/media.js, e.g.:
--- script.js.orig 2018-05-03 09:07:42.000000000 +0200
+++ script.js 2022-01-05 10:34:55.594361457 +0100
@@ -37,8 +37,14 @@
// insert syntax and close dialog
success: function (data) {
+ var alignleft = '';
+ var alignright = '';
+ if (dw_mediamanager.align !== '1') {
+ alignleft = dw_mediamanager.align === '2' ? '' : ' ';
+ alignright = dw_mediamanager.align === '4' ? '' : ' ';
+ }
$box.find('.content').addClass('success').text(data.message);
- insertAtCarret('wiki__text', '{{:' + data.id + '}}');
+ insertAtCarret('wiki__text', '{{' + alignleft + ':' + data.id + alignright + '|}}');
$box.delay(500).fadeOut(500, function () {
$box.dialog('destroy').remove()
});But I think it would be cleaner to make alignment a function of dw_mediamanager with its default settings accessible in the DokuWiki configuration and additional settings for the imgpaste plugin.