Changeset 284 for trunk/contactcenter/js/ccMain.js
- Timestamp:
- 05/21/08 16:56:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/ccMain.js
r119 r284 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 10 10 } 11 11 12 12 var Main_pre_load = document.body.onload; 13 13 var ccSearch, ccTree; 14 var Main_load = function () 15 { 14 var Main_load = function () 15 { 16 16 Connector.setProgressBox(Element('cc_loading'), true); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 18 18 /* Associate the Quick Add Button with the Plugin */ 19 19 20 20 21 21 /* Create the Search Object */ … … 37 37 ccSearch.DOMresult.style.visibility = 'hidden'; 38 38 ccSearch.onSearchFinish = ccSearchUpdate; 39 39 40 40 Connector.setProgressBox(Element('cc_loading'), true); 41 41 Connector.setProgressHolder(Element('cc_loading_inner')); 42 42 43 43 /* Create the Tree Object */ 44 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 44 //ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 45 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 45 46 46 47 ccTree.Connector = Connector; … … 64 65 var _timeout = ''; 65 66 var menu = function () { 66 67 67 68 if(! this.menuStarted) 68 69 this.menuStarted = true; 69 70 70 71 submenu = []; 71 72 textmenu = []; 72 73 73 74 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_group"] 74 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 75 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 75 76 function show(){ 76 77 clearTimeout(_timeout); 77 78 button = document.getElementById("cc_button_new"); 78 79 this.style.top = 19 + findPosY(button) + "px"; 80 this.style.visibility='visible'; 79 80 this.style.top = 19 + findPosY(button) + "px"; 81 this.style.visibility='visible'; 81 82 } 82 83 function hide(){ _timeout = setTimeout("menu.style.visibility='hidden';",200); }; 83 84 84 85 if(document.getElementById) { 85 86 menu = document.getElementById("Layer1"); 86 87 87 88 for (i=0; i< textmenu[0].length; i++) { 88 89 textmenu[0][i] = "<span onclick= 'menu.onmouseout();'>" + document.getElementById(textmenu[0][i]).value + "</span><br>"; 89 submenu[i] = document.createElement("DIV"); 90 submenu[i] = document.createElement("DIV"); 90 91 submenu[i].innerHTML = textmenu[0][i]; 91 92 submenu[i].id = textmenu[1][i]; 92 93 submenu[i].onmouseover = function () {this.style.backgroundColor = 'LIGHTYELLOW';this.style.color = 'DARKBLUE';}; 93 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 94 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 94 95 submenu[i].setAttribute("className", "special"); 95 96 submenu[i].setAttribute("class", "special"); 96 submenu[i].style.padding = "5px"; 97 submenu[i].style.padding = "5px"; 97 98 menu.appendChild(submenu[i]); 98 } 99 99 } 100 100 101 menu.onmouseover = show; 101 102 menu.onmouseout = hide; 102 103 } 103 104 104 105 ccQuickAdd.associateAsButton(Element('cc_quick_add')); 105 106 ccAddGroup.associateAsButton(Element('cc_add_group')); 106 107 document.getElementById("cc_full_add").onclick= newContact; 107 108 108 109 109 110 ccQuickAdd.afterSave = function () 110 111 { 111 112 updateCards(); 112 } 113 114 ccAddGroup.load = function () 115 { 116 editGroup(); 117 } 118 113 } 114 115 ccAddGroup.load = function () 116 { 117 editGroup(); 118 } 119 119 120 ccAddGroup.afterSave = function () 120 121 { 121 122 updateCards(); 122 123 } 123 124 124 125 return true; 125 126 } … … 127 128 if (is_ie) 128 129 { 129 130 130 131 document.body.onload = function (e) 131 { 132 Main_pre_load(); 133 Main_load(); 134 132 { 133 Main_pre_load(); 134 Main_load(); 135 135 136 } 136 137 } 137 138 else 138 { 139 Main_load(); 140 141 } 139 { 140 Main_load(); 141 142 } 142 143 143 144 // BEGIN: FUNCTION RESIZE WINDOW … … 156 157 showBar = __showBar; 157 158 hideBar = __hideBar; 158 159 159 160 var _onResize = window.onresize; 160 161 window.onresize = resizeWindow; 161 162 var defaultHeight = 0; 162 163 function setDefaultHeight(){ 163 164 164 165 var bar = Element("toolbar"); 165 166 var offset = 0; 166 if(bar.style.visibility != 'hidden') 167 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 167 if(bar.style.visibility != 'hidden') 168 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 168 169 169 170 var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight; 170 defaultHeight = screenHeight - offset; 171 Element("cc_tree").style.height = defaultHeight - 68; 172 Element("cc_left_main").style.height = defaultHeight - 68; 171 defaultHeight = screenHeight - offset; 172 Element("cc_tree").style.height = defaultHeight - 68; 173 Element("cc_left_main").style.height = defaultHeight - 68; 173 174 } 174 175 … … 176 177 setDefaultHeight(); 177 178 if(Element("divScrollMain")) 178 Element("divScrollMain").style.height = defaultHeight - 108; 179 Element("divScrollMain").style.height = defaultHeight - 108; 179 180 if (!is_ie) 180 181 Element('tableDivAppbox').width = '100%'; … … 184 185 setDefaultHeight(); 185 186 Element('cc_main').style.height = defaultHeight; 186 var lang_warn_firefox = Element('cc_msg_warn_firefox');187 var lang_firefox_msg1 = Element('cc_msg_firefox_half1');188 var lang_firefox_msg2 = Element('cc_msg_firefox_half2');189 var lang_install_now = Element('cc_msg_install_now');190 var lang_install_new_firefox = Element('cc_msg_install_new_firefox');191 var lang_close = Element('cc_msg_close');192 187 function buildWarningMsg(_version) { 193 188 var screenWidth = document.body.clientWidth ? document.body.clientWidth: document.body.offsetWidth; … … 196 191 "border:1px solid black;left:"+(screenWidth - 330)+";top:10px;width:300px;padding:10px;"+ 197 192 (document.body.clientWidth ? "-moz-border-radius: 9px 9px 9px 9px;'>" : "")+ 198 "<font color='RED' size='2'>"+lang_warn_firefox + "("+_version+")</font><BR>"+ 199 "<font color='black' size='2'><p style='text-align:justify'> "+lang_firefox_msg1+ 200 lang_firefox_msg2 + ".</p></font><div style='width:100%' align='center'>"+ 201 "<a title='"+lang_install_now+"' href='http://br.mozdev.org/firefox/download.html' target='_blank'>"+lang_install_new_firefox+ "</a>"+ 193 "<font color='RED' size='2'>Aviso: Versão muito antiga do Firefox ("+_version+")</font><BR>"+ 194 "<font color='black' size='2'><p style='text-align:justify'> Para que essa aplicação funcione <u>corretamente</u> "+ 195 "é necessário atualizar o seu navegador Firefox para uma versão mais nova (versão > 1.5). "+ 196 "Instale agora clicando no link abaixo ou caso queira atualizar mais tarde (não recomendável), clique em Fechar.</p></font><div style='width:100%' align='center'>"+ 197 "<a title='Instalar agora' href='http://br.mozdev.org/firefox/download.html' target='_blank'>Instalar nova versão do Firefox</a>"+ 202 198 " "+ 203 "<a title='"+lang_close+"' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>"+lang_close+"</a></div>"+ 204 199 "<a title='Fechar' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>Fechar</a></div>"+ 205 200 "</DIV>"; 206 201 … … 208 203 209 204 myOpacity = new fx.Opacity('warning_msg', {duration: 600}); 210 document.getElementById("warning_msg").style.visibility = 'hidden'; 205 document.getElementById("warning_msg").style.visibility = 'hidden'; 211 206 myOpacity.now = 0; 212 207 setTimeout("myOpacity.toggle()",3000);
Note: See TracChangeset
for help on using the changeset viewer.