This part adds an "Import as Event" button to the meeting request
window when the selected calendar claims it can add only meetings
organized by the calendar owner, which will remove the organizer
and all the attendees before the import.
Related to https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/295
While calculating image size for the preview width, the images which are
being loaded report their width as 0px, which can be preserved due to it
can fix the preview width constraint, even though the image is 0px because
it's not loaded yet. The image does not enlarge to its expected size after
it's loaded due to this, effectively making the image invisible.
This is cleaner than having the code in the C and recompile the project
for any simple change. There is also added a call to
window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0);
at the end, which caused trouble when being in the C code (there had been
issued an "Unsupported return type" error).
This allows to save JavaScript plugins, files with .js extension,
into `$PREFIX/share/evolution/webkit/preview-plugins/` or into
`~/.local/share/evolution/preview-plugins/` for the message preview
and into `$PREFIX/share/evolution/webkit/webkit-editor-plugins/` or
into `~/.local/share/evolution/webkit-editor-plugins/` for
the WebKit composer.
The plugin is an object, which contains two members:
* `name` - a string with a name of the plugin
* `setup(doc)` - a setup function
The argument of the `setup` function is a `document`, which can
be either the main document or an iframe document. The function
can be called multiple times for the same document.
The preview plugin registers itself by calling `Evo.RegisterPlugin(plugin_instance)`.
The WebKit editor plugin registers itself by calling `EvoEditor.RegisterPlugin(plugin_instance)`.
This is to workaround runtime warning:
(evolution:769567): evolution-util-WARNING **: 12:21:17.882: Failed to
call 'Evo.EnsureMainDocumentInitialized();' function: WebKitJavascriptError:699:
resource:///e-web-view.js:587:32: TypeError: null is not an object
(evaluating 'elems[ii].contentDocument.body')
Mentioned in https://gitlab.gnome.org/GNOME/evolution/-/issues/1041
It used to be a dialog, which was unnecessary. Let it be shown inline,
in the message preview instead. As a side effect, it's easier to copy
information out of it.
All the previews (in Mail, Contacts, Memos and Tasks) stop using
deprecated WebKitGTK+ DOM API through a WebExtension (and its D-Bus
API) and start using the JavaScriptCore API (and JavaScript as such).
This allows to lightweight the WebExtension for the EWebView
significantly, including drop of the D-Bus API of it, fully relying
on the Inter-Process-Communication of WebKitGTK+ itself.