6 var txt = document.createElement('textarea');
7 txt.id = 'tagedit_editor';
10 $(txt).load('ajax.php',{loadtags: 'plain', dn: DN});
14 helperClass: 'autocompleter',
15 selectClass: 'autocompleterSelect',
19 multipleSeperator: ','
22 var save = new Image();
23 save.src = 'pix/accept.png';
24 save.id = 'tagedit_save';
25 save.className = 'click';
26 $(save).click(function(){
27 $('#taglist').load('ajax.php',{settags: $('#tagedit_editor').val(), dn: DN});
28 $('#tagedit_save').remove();
29 $('#tagedit_cancel').remove();
30 $('#tagedit_start').show();
33 var canc = new Image();
34 canc.src = 'pix/cancel.png';
35 canc.id = 'tagedit_cancel';
36 canc.className = 'click';
37 $(canc).click(function(){
38 $('#taglist').load('ajax.php',{loadtags: 'html', dn: DN});
39 $('#tagedit_save').remove();
40 $('#tagedit_cancel').remove();
41 $('#tagedit_start').show();
44 $('#tagedit_start').hide();
45 $('#taglist').empty().prepend(txt);
46 $('#tagedit').append(save);
47 $('#tagedit').append(canc);
48 $('#tagedit_editor').focus();
54 function noteedit(type){
55 var txt = document.createElement('textarea');
56 txt.id = 'noteedit_editor';
57 txt.className = 'ipe';
63 }else if(type=='mail'){
65 }else if(type=='todo'){
67 }else if(type=='note'){
71 text += '//'+dt.formatDate('j. M y H:i')+' '+USER+'//: ';
74 var save = new Image();
75 save.src = 'pix/accept.png';
76 save.id = 'noteedit_save';
77 save.className = 'click';
78 $(save).click(function(){
79 $('#notes').load('ajax.php',{addnote: $('#noteedit_editor').val(), dn: DN});
80 $('#noteedit_editor').remove();
81 $('#noteedit_save').remove();
82 $('#noteedit_cancel').remove();
83 $('#noteedit .ed').show()
86 var canc = new Image();
87 canc.src = 'pix/cancel.png';
88 canc.id = 'noteedit_cancel';
89 canc.className = 'click';
90 $(canc).click(function(){
91 $('#noteedit_editor').remove();
92 $('#noteedit_save').remove();
93 $('#noteedit_cancel').remove();
94 $('#noteedit .ed').show();
97 $('#notes').prepend(txt);
98 $('#noteedit .ed').hide();
99 $('#noteedit').append(save);
100 $('#noteedit').append(canc);
101 $('#noteedit_editor').focus();
105 * Initialize everything when DOM is ready
107 $(document).ready(function() {
110 $('#taglookup').Autocomplete({
113 helperClass: 'autocompleter',
114 selectClass: 'autocompleterSelect',
118 //multipleSeperator: ','
120 $('#tageditlookup').Autocomplete({
123 helperClass: 'autocompleter',
124 selectClass: 'autocompleterSelect',
128 multipleSeperator: ','
131 $('input.ac').Autocomplete({
134 helperClass: 'autocompleter',
135 selectClass: 'autocompleterSelect',
142 loaderSRC: 'pix/imagebox/loading.gif',
143 closeHTML: '<img src="pix/imagebox/close.jpg" border="0" />'
147 if($('#tagedit').length){
148 var img = new Image();
149 img.src = 'pix/tag_blue_edit.png';
150 img.className = 'click';
151 img.id = 'tagedit_start';
152 $('#tagedit').empty().after(img);
153 $(img).click(tagedit);
157 if($('#noteedit').length){
161 img.src = 'pix/note.png';
162 img.className = 'click ed';
163 $(img).click(function(){noteedit('note');});
164 $('#noteedit').append(img);
167 img.src = 'pix/arrow_right.png';
168 img.className = 'click ed';
169 $(img).click(function(){noteedit('todo');});
170 $('#noteedit').append(img);
173 img.src = 'pix/email.png';
174 img.className = 'click ed';
175 $(img).click(function(){noteedit('mail');});
176 $('#noteedit').append(img);
179 img.src = 'pix/phone.png';
180 img.className = 'click ed';
181 $(img).click(function(){noteedit('call');});
182 $('#noteedit').append(img);
187 if($('#searchfield').length) $('#searchfield').focus();
188 if($('#firstfield').length) $('#firstfield').focus();
191 // run google maps loader
192 if($('#google_map').length){
194 $(document).unload(GUnload);