Changeset View
Changeset View
Standalone View
Standalone View
messageviewer/src/viewer/webengine/mailwebenginescript.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 59 | { | |||
---|---|---|---|---|---|
65 | } else { | 65 | } else { | ||
66 | source += QString::fromLatin1("qt.jQuery('#kmailshowattachment').hide();" | 66 | source += QString::fromLatin1("qt.jQuery('#kmailshowattachment').hide();" | ||
67 | "qt.jQuery(\"#kmailhideattachment\").show();" | 67 | "qt.jQuery(\"#kmailhideattachment\").show();" | ||
68 | "if (!qt.jQuery(\"#attachmentlist\")) { console.warn('attachmentlist not found'); } else { qt.jQuery(\"#attachmentlist\").hide(); }"); | 68 | "if (!qt.jQuery(\"#attachmentlist\")) { console.warn('attachmentlist not found'); } else { qt.jQuery(\"#attachmentlist\").hide(); }"); | ||
69 | } | 69 | } | ||
70 | return source; | 70 | return source; | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | QString MailWebEngineScript::manageShowHideEncryptionDetails(bool hide) | ||||
74 | { | ||||
75 | QString source = checkJQuery("manageShowHideEncryptionDetails"); | ||||
76 | if (hide) { | ||||
77 | source += QString::fromLatin1("qt.jQuery(\".enc-details\").hide();" | ||||
78 | "qt.jQuery(\".enc-simple\").show();"); | ||||
79 | } else { | ||||
80 | source += QString::fromLatin1("qt.jQuery('.enc-simple').hide();" | ||||
81 | "qt.jQuery(\".enc-details\").show();"); | ||||
82 | } | ||||
83 | return source; | ||||
84 | } | ||||
85 | | ||||
73 | QString MailWebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr) | 86 | QString MailWebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr) | ||
74 | { | 87 | { | ||
75 | const QString source = checkJQuery("injectAttachments") + QString::fromLatin1( | 88 | const QString source = checkJQuery("injectAttachments") + QString::fromLatin1( | ||
76 | "if (!document.getElementById('%1')) { console.warn('NOT FOUND: %1'); };\n" | 89 | "if (!document.getElementById('%1')) { console.warn('NOT FOUND: %1'); };\n" | ||
77 | "qt.jQuery('#%1').append('%2')").arg(elementStr, delayedHtml); | 90 | "qt.jQuery('#%1').append('%2')").arg(elementStr, delayedHtml); | ||
78 | return source; | 91 | return source; | ||
79 | } | 92 | } | ||
80 | 93 | | |||
81 | QString MailWebEngineScript::replaceInnerHtml(const QString &field, const QString &html) | 94 | QString MailWebEngineScript::replaceInnerHtml(const QString &field, const QString &html) | ||
82 | { | 95 | { | ||
83 | const QString replaceInnerHtmlStr = QLatin1String("iconFull") + field + QLatin1String( | 96 | const QString replaceInnerHtmlStr = QLatin1String("iconFull") + field + QLatin1String( | ||
84 | "AddressList"); | 97 | "AddressList"); | ||
85 | const QString source = checkJQuery("replaceInnerHtml") + QString::fromLatin1( | 98 | const QString source = checkJQuery("replaceInnerHtml") + QString::fromLatin1( | ||
86 | "qt.jQuery('#%1').append('%2')").arg(replaceInnerHtmlStr, html); | 99 | "qt.jQuery('#%1').append('%2')").arg(replaceInnerHtmlStr, html); | ||
87 | return source; | 100 | return source; | ||
88 | } | 101 | } |