-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add explanation for 'your email' and move JS to separate script file
- Loading branch information
1 parent
b06685e
commit 06a548b
Showing
2 changed files
with
58 additions
and
36 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
esp/templates/program/modules/commmodule/commpanel_step2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
function showEmailExplanation() { | ||
document.getElementById("from-help").style.display = ''; | ||
} | ||
|
||
function hideEmailExplanation() { | ||
document.getElementById("from-help").style.display = 'none'; | ||
document.getElementById("from").focus(); | ||
} | ||
|
||
|
||
function validateMsgLang() { | ||
var msgTypes = document.getElementsByName("msglang"); | ||
var containsTag = /<(\/?((.)|(br ?\/?)))>|(<img)/i.test( | ||
document.getElementById("emailbody").value); | ||
var containsHTag = /<\/?html>/i.test( | ||
document.getElementById("emailbody").value); | ||
|
||
if(containsHTag) { | ||
return confirm("Didn't we say not to include <html> tags?!? " | ||
+ "If you're sure you know what you're doing, " | ||
+ "click 'OK' to continue."); | ||
} else if(msgTypes[1].checked && !containsTag) { | ||
return confirm('You selected "HTML" but included no HTML tags. ' | ||
+ 'Continuing might squash your formatting. ' | ||
+ 'Would you still like to proceed?'); | ||
} else if(msgTypes[0].checked && containsTag) { | ||
return confirm('You selected "Plain Text" but have HTML tags ' | ||
+ '(such as <p>) in your message. ' | ||
+ 'Continuing will leave your tags in your message ' | ||
+ '(so you might see "<b>hello</b>" instead of ' | ||
+ 'a bold "hello"). ' | ||
+ 'Would you still like to proceed?'); | ||
} | ||
else { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters