| demos\outlook\notes\notes.js |
1 var notes_viewer_table;
2 var note_target_num=1;
3 var notes_config;
4
5 function onChange_notes_navigator() {
6 if(notes_viewer_table==null) {
7 notes_viewer_init(widget);
8 }
9 }
10
11
12
13
14 function notes_init() {
15 var v,data
16 v=window.getViewer("content_stack").getViewer("notes");
17 notes_viewer_table=v.getWidget();
18 if(notes_viewer_table.getRowCount()==0) {
19 data=widget.getURLText("gumbo.txt",null);
20 if(data==null) {
21 data="Test\nThis is a test note";
22 }
23 var title=sage.getLines(data,1);
24 var s=sage.getLines(data,3);
25 if(s==data) {
26 s+="<end>";
27 }
28 notes_table_addRow("resource:pim.icon.notes",title,window.now(),"",data,s)
29 data=widget.getURLText("knee.txt",null);
30 if(data!=null) {
31 title=sage.getLines(data,1);
32 s=sage.getLines(data,3);
33 if(s==data) {
34 s+="<end>";
35
36 }
37 notes_table_addRow("resource:pim.icon.notes",title,window.now(),"",data,s)
38 }
39 data=widget.getURLText("dip.txt",null);
40 if(data!=null) {
41 title=sage.getLines(data,1);
42 s=sage.getLines(data,3);
43 if(s==data) {
44 s+="<end>";
45 }
46 notes_table_addRow("resource:pim.icon.notes",title,window.now(),"",data,s)
47 }
48 }
49 }
50
51
52
53
54
55
56
57
58 function notes_table_addRow(icon,subject,created,categories,content,preview) {
59 var row=notes_viewer_table.createRow(4,false);
60 row.add(notes_viewer_table.createItem("","note_"+(note_target_num++),icon));
61 row.add(notes_viewer_table.createItem(subject,content,null));
62 row.add(notes_viewer_table.createItem(created));
63 row.add(notes_viewer_table.createItem(categories));
64 row.setValue(preview);
65 notes_viewer_table.add(row);
66
67 }
68
69
70
71
72
73 function notes_table_onAction() {
74 window.showWaitCursor();
75 try {
76 var target=widget.getSelectionDataAsString(0);
77 var t=window.getTarget(target);
78 if(t!=null) {
79 t.activate();
80 return;
81 }
82 var title=widget.getSelectionAsString(1);
83 var text=widget.getSelectionDataAsString(1);
84 var created=widget.getSelectionAsString(2);
85 if(notes_config==null) {
86 notes_create_config();
87 }
88 notes_config.dataURL.value=text;
89 window.open(notes_config,'target='+target+',windowType=popup_orphan,translucency=.1,width=600,height=700,border=line,resizable=true,title="'+title+'",icon="resource:pim.icon.notes",bgcolor="#FFFFFF",status="Created on '+created+'"');
90 }
91 finally {
92 window.hideWaitCursor();
93 }
94 }
95
96
97
98
99
100 function notes_create_config() {
101 notes_config=window.createConfigurationObject("DocumentPane");
102 notes_config.setBorder(BORDER_NONE);
103 notes_config.bgColor.value=",#FFFFFF";
104 notes_config.dataURL.spot_setAttribute("inline","true");
105 notes_config.dataURL.spot_setAttribute("mimeType","text/plain");
106 }
107
108