File: compose.js

package info (click to toggle)
basilix 1.0.3b-1.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 828 kB
  • ctags: 206
  • sloc: php: 2,681; sql: 45; makefile: 40; sh: 7
file content (70 lines) | stat: -rw-r--r-- 1,876 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// compose
var attwin = null;
var abwin = null;
var attwin_width = screen.width * 3 / 7;
var attwin_height = screen.height * 3 / 7;
var abwin_width = screen.width * 1 / 3;
var abwin_height = screen.height * 3 / 5;

function attachWin(url) {
	cmps = document.composeMail;
	surl = url;
  
	f0 = cmps.elements["cmps_f0"].value; surl = surl + "&cmps_f0="+f0;
	s0 = cmps.elements["cmps_s0"].value; surl = surl + "&cmps_s0="+s0;
	c0 = cmps.elements["cmps_c0"].value; surl = surl + "&cmps_c0="+c0;
	f1 = cmps.elements["cmps_f1"].value; surl = surl + "&cmps_f1="+f1;
	s1 = cmps.elements["cmps_s1"].value; surl = surl + "&cmps_s1="+s1;
	c1 = cmps.elements["cmps_c1"].value; surl = surl + "&cmps_c1="+c1;
	f2 = cmps.elements["cmps_f2"].value; surl = surl + "&cmps_f2="+f2;
	s2 = cmps.elements["cmps_s2"].value; surl = surl + "&cmps_s2="+s2;
	c2 = cmps.elements["cmps_c2"].value; surl = surl + "&cmps_c2="+c2;

	attwin = popWin('atchwin', surl, attwin_width, attwin_height, 1);
	attwin.focus();
}

function abookWin(url) {
	abwin = popWin('abookwin', url, abwin_width, abwin_height, 1);
	abwin.focus();
}

function noFocus(l, msg) {
	document.composeMail.elements["cmps_atchlist"].blur();
	var oldbg = l.style.backgroundColor;
	l.style.backgroundColor = "#ffff00"
	window.alert(msg);
	l.style.backgroundColor = oldbg;
	return false;
}

function closeWins() {
	if(attwin != null) attwin.close();
	if(abwin != null) abwin.close();
}

function cmpsValidate() {
	cmps = document.composeMail;
	to = cmps.elements["cmps_to"].value;
	cc = cmps.elements["cmps_cc"].value;
	bcc = cmps.elements["cmps_bcc"].value;
	body = cmps.elements["cmps_body"].value;
	
	// check rcpts
	if(to == "" && cc == "" && bcc == "") {
		alert(no_rcpt);
		cmps.cmps_to.focus();
		return false;
	}

	// and check body
	if(body == "") {
		alert(no_body);
		cmps.cmps_body.focus();
		return false;
	}

	return true;
}