TF-3911 Support mail keyboard shortcut actions in email detailed view on web

This commit is contained in:
dab246
2025-07-29 02:00:32 +07:00
committed by Dat H. Pham
parent 1c7778d6cc
commit b2989521d9
36 changed files with 763 additions and 270 deletions
+17 -2
View File
@@ -60,7 +60,7 @@ class HtmlInteraction {
''';
static const String scriptsHandleContentSizeChanged = '''
<script>
<script type="text/javascript">
const bodyResizeObserver = new ResizeObserver(entries => {
window.flutter_inappwebview.callHandler('$contentSizeChangedEventJSChannelName', '');
})
@@ -70,7 +70,7 @@ class HtmlInteraction {
''';
static const String scriptsHandleLazyLoadingBackgroundImage = '''
<script>
<script type="text/javascript">
const lazyImages = document.querySelectorAll('[lazy]');
const lazyImageObserver = new IntersectionObserver((entries, observer) => {
entries.forEach((entry) => {
@@ -378,4 +378,19 @@ class HtmlInteraction {
</script>
''';
static String scriptHandleIframeKeyboardListener(String viewId) => '''
<script type="text/javascript">
window.addEventListener('keydown', function (event) {
const payload = {
view: '$viewId',
type: 'toDart: iframeKeydown',
key: event.key,
code: event.code,
shift: event.shiftKey
};
window.parent.postMessage(JSON.stringify(payload), "*");
});
</script>
''';
}