Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F223660
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugins/attachment_reminder/attachment_reminder.js b/plugins/attachment_reminder/attachment_reminder.js
index 01f2b4993..a4f3e6325 100755
--- a/plugins/attachment_reminder/attachment_reminder.js
+++ b/plugins/attachment_reminder/attachment_reminder.js
@@ -1,54 +1,51 @@
/* Attachment Reminder plugin script */
function rcmail_get_compose_message()
{
var msg;
if (window.tinyMCE && (ed = tinyMCE.get(rcmail.env.composebody))) {
msg = ed.getContent();
msg = msg.replace(/<blockquote[^>]*>(.|[\r\n])*<\/blockquote>/gmi, '');
}
else {
msg = $('#' + rcmail.env.composebody).val();
msg = msg.replace(/^>.*$/gmi, '');
}
return msg;
}
function rcmail_check_message(msg)
{
- var i, rg, keywords = rcmail.gettext('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]);
+ var i, rx, keywords = rcmail.gettext('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]);
- for (i=0; i<keywords.length; i++) {
- rg = new RegExp(keywords[i],'i');
- if (msg.search(rg) != -1)
- return true;
- }
+ $.each(keywords, function(n) { return RegExp.escape(n); });
+ rx = new RegExp('(' + keywords.join('|') + ')', 'i');
- return false;
+ return msg.search(rx) != -1;
}
function rcmail_have_attachments()
{
return rcmail.env.attachments && $('li', rcmail.gui_objects.attachmentlist).length;
}
if (window.rcmail) {
rcmail.addEventListener('beforesend', function(evt) {
var msg = rcmail_get_compose_message(),
subject = $('#compose-subject').val();
if (!rcmail_have_attachments() && (rcmail_check_message(msg) || rcmail_check_message(subject))) {
if (confirm(rcmail.gettext('forgotattachment', 'attachment_reminder'))) {
if (window.UI && UI.show_uploadform) // Larry skin
UI.show_uploadform();
else if (window.rcmail_ui && rcmail_ui.show_popup) // classic skin
rcmail_ui.show_popup('uploadmenu', true);
return false;
}
}
});
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Mar 1, 4:49 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
165892
Default Alt Text
(1 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment