/* JavaScript for SOGo Mailer */
/*
- window.open('url to open','window name','attribute1,attribute2')
- window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow',
- 'width=400,height=200')
-
- width,height
- resizable=yes or no
- scrollbars=yes or no
- toolbar=yes or no
- location=yes or no
- directories=yes or no
- status=yes or no
- menubar=yes or no
- copyhistory=yes or no
+ Window Properties:
+ width, height
+ bool: resizable, scrollbars, toolbar, location, directories, status,
+ menubar, copyhistory
*/
function clickedUid(sender, msguid) {
urlstr = msguid + "/view?markread=1";
window.open(urlstr, "SOGo_msg_" + msguid,
- "width=680,height=480,resizable=1,scrollbars=1,toolbar=0," +
+ "width=640,height=480,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0")
return true;
}
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
return false; /* stop following the link */
}
+
+
+/* mail editor */
+
+function validateEditorInput(sender) {
+ var errortext = "";
+ var field;
+
+ field = document.pageform.subject;
+ if (field.value == "")
+ errortext = errortext + "Missing Subject\n";
+
+ if (errortext.length > 0) {
+ alert("validation failed:\n" + errortext);
+ return false;
+ }
+ return true;
+}
+
+function clickedEditorSend(sender) {
+ if (!validateEditorInput(sender))
+ return false;
+
+ alert("SEND");
+ // if everything is ok, close the window
+}
+
+function clickedEditorAttach(sender) {
+ alert("ATTACH");
+}
+
+function clickedEditorSave(sender) {
+ alert("SAVE");
+}
SOGoDraftObject = {
slots = {
- toolbar = { /* need the 'send' toolbar here */
+ toolbar = {
protectedBy = "View";
value = ( /* the toolbar groups */
( /* first group */
- { link = "send";
- cssClass = "tbicon_send";
- label = "Send"; },
+ { link = "#";
+ onclick = "clickedEditorSend(this);return false;";
+ cssClass = "tbicon_send"; label = "Send"; },
{ link = "contacts"; target = "addressbook";
cssClass = "tbicon_addressbook"; label = "Contacts"; },
- { link = "attach";
+ { link = "#";
+ onclick = "clickedEditorAttach(this);return false;";
cssClass = "tbicon_attach"; label = "Attach"; },
- { link = "save";
+ { link = "#";
+ onclick = "clickedEditorSave(this);return false;";
cssClass = "tbicon_save"; label = "Save"; },
)
);