Ich ärger mich mit dem Instant Messenger v 1.0 herum.
Ich würde gerne, dass das Chatfenster etwas weiter nach links positioniert wird, da durch meinen TS3 Slider der rest der Trasparenten Grafik des Sliders drüber hängt und somit kann ich den Chat nicht schließen, denn dann öffnet der Slider. <---- Hoffe ihr kommt mit ^^
Auf Deutsch -> Hat jeamnd ne Ahnung wo ich die Positionierung finde? Hab Die messenger.js durch gesehen, aber JS iss nich mein ding ^^. die CSS vermute ich nicht, bin mir aber nicht sicher.
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | /* Copyright (c) 2009 Anant Garg (anantgarg.com | inscripts.com) Modified 2009 Florian Koerner (ilch.de | Flomavali) This script may be used for non-commercial purposes only. For any commercial purposes, please contact the author at anant.garg@inscripts.com THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var windowFocus = true ; var username; var chatHeartbeatCount = 0; var minChatHeartbeat = 1000; var maxChatHeartbeat = 33000; var chatHeartbeatTime = minChatHeartbeat; var originalTitle; var blinkOrder = 0; var chatboxFocus = new Array(); var newMessages = new Array(); var newMessagesWin = new Array(); var chatBoxes = new Array(); $(document).ready( function (){ originalTitle = document.title; startChatSession(); $([window, document]).blur( function (){ windowFocus = false ; }).focus( function (){ windowFocus = true ; document.title = originalTitle; }); }); function restructureChatBoxes() { align = 0; for (x in chatBoxes) { chatboxuid = chatBoxes[x]; if ($( "#chatbox_" +chatboxuid).css( 'display' ) != 'none' ) { if (align == 0) { $( "#chatbox_" +chatboxuid).css( 'right' , '20px' ); } else { width = (align)*(225+7)+20; $( "#chatbox_" +chatboxuid).css( 'right' , width+ 'px' ); } align++; } } } function chatWith(chatuserid,chatuser) { createChatBox(chatuserid,chatuser); $( "#chatbox_" +chatuserid+ " .chatboxtextarea" ).focus(); } function createChatBox(chatboxuid,chatboxtitle,minimizeChatBox) { if ($( "#chatbox_" +chatboxtitle).length > 0) { if ($( "#chatbox_" +chatboxuid).css( 'display' ) == 'none' ) { $( "#chatbox_" +chatboxuid).css( 'display' , 'block' ); restructureChatBoxes(); } $( "#chatbox_" +chatboxuid+ " .chatboxtextarea" ).focus(); return ; } $( " <div />" ).attr( "id" , "chatbox_" +chatboxuid) .addClass( "chatbox" ) .html( '<div style="marginRight:200px;" class="chatboxhead"><div class="chatboxtitle">' +chatboxtitle+ '</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\'' +chatboxuid+ '\')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\'' +chatboxuid+ '\')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\'' +chatboxuid+ '\');"></textarea></div>' ) .appendTo($( "body" )); $( "#chatbox_" +chatboxuid).css( 'bottom' , '0px' ); chatBoxeslength = 0; for (x in chatBoxes) { if ($( "#chatbox_" +chatBoxes[x]).css( 'display' ) != 'none' ) { chatBoxeslength++; } } if (chatBoxeslength == 0) { $( "#chatbox_" +chatboxuid).css( 'right' , '20px' ); } else { width = (chatBoxeslength)*(225+7)+20; $( "#chatbox_" +chatboxuid).css( 'right' , width+ 'px' ); } chatBoxes.push(chatboxuid); if (minimizeChatBox == 1) { minimizedChatBoxes = new Array(); if ($.cookie( 'chatbox_minimized' )) { minimizedChatBoxes = $.cookie( 'chatbox_minimized' ).split(/\|/); } minimize = 0; for (j=0;j<minimizedChatBoxes.length;j++) { if (minimizedChatBoxes[j] == chatboxuid) { minimize = 1; } } if (minimize == 1) { $( '#chatbox_' +chatboxuid+ ' .chatboxcontent' ).css( 'display' , 'none' ); $( '#chatbox_' +chatboxuid+ ' .chatboxinput' ).css( 'display' , 'none' ); } } chatboxFocus[chatboxuid] = false ; $( "#chatbox_" +chatboxuid+ " .chatboxtextarea" ).blur( function (){ chatboxFocus[chatboxuid] = false ; $( "#chatbox_" +chatboxuid+ " .chatboxtextarea" ).removeClass( 'chatboxtextareaselected' ); }).focus( function (){ chatboxFocus[chatboxuid] = true ; newMessages[chatboxuid] = false ; $( '#chatbox_' +chatboxuid+ ' .chatboxhead' ).removeClass( 'chatboxblink' ); $( "#chatbox_" +chatboxuid+ " .chatboxtextarea" ).addClass( 'chatboxtextareaselected' ); }); $( "#chatbox_" +chatboxuid).click( function () { if ($( '#chatbox_' +chatboxuid+ ' .chatboxcontent' ).css( 'display' ) != 'none' ) { $( "#chatbox_" +chatboxuid+ " .chatboxtextarea" ).focus(); } }); $( "#chatbox_" +chatboxuid).show(); } function chatHeartbeat(){ var itemsfound = 0; if (windowFocus == false ) { var blinkNumber = 0; var titleChanged = 0; for (x in newMessagesWin) { if (newMessagesWin[x] == true ) { ++blinkNumber; if (blinkNumber >= blinkOrder) { document.title = x+ ' says...' ; titleChanged = 1; break ; } } } if (titleChanged == 0) { document.title = originalTitle; blinkOrder = 0; } else { ++blinkOrder; } } else { for (x in newMessagesWin) { newMessagesWin[x] = false ; } } for (x in newMessages) { if (newMessages[x] == true ) { if (chatboxFocus[x] == false ) { //FIXME: add toggle all or none policy, otherwise it looks funny $( '#chatbox_' +x+ ' .chatboxhead' ).toggleClass( 'chatboxblink' ); sound.play(); } } } $.ajax({ url: "index.php?messenger=chatheartbeat" , cache: false , dataType: "json" , success: function (data) { $.each(data.items, function (i,item){ if (item) { // fix strange ie bug chatboxtitle = item.f; chatboxuid = item.i; if ($( "#chatbox_" +chatboxuid).length <= 0) { createChatBox(chatboxuid,chatboxtitle); } if ($( "#chatbox_" +chatboxuid).css( 'display' ) == 'none' ) { $( "#chatbox_" +chatboxuid).css( 'display' , 'block' ); restructureChatBoxes(); } if (item.s == 1) { item.f = username; } if (item.s == 2) { $( "#chatbox_" +chatboxuid+ " .chatboxcontent" ).append( '<div class="chatboxmessage"><span class="chatboxinfo">' +item.m+ '</span></div>' ); } else { newMessages[chatboxuid] = true ; newMessagesWin[chatboxuid] = true ; $( "#chatbox_" +chatboxuid+ " .chatboxcontent" ).append( '<div class="chatboxmessage"><span class="chatboxmessagefrom">' +item.f+ ': </span><span class="chatboxmessagecontent">' +item.m+ '</span></div>' ); } $( "#chatbox_" +chatboxuid+ " .chatboxcontent" ).scrollTop($( "#chatbox_" +chatboxuid+ " .chatboxcontent" )[0].scrollHeight); itemsfound += 1; } }); chatHeartbeatCount++; if (itemsfound > 0) { chatHeartbeatTime = minChatHeartbeat; chatHeartbeatCount = 1; } else if (chatHeartbeatCount >= 10) { chatHeartbeatTime *= 2; chatHeartbeatCount = 1; if (chatHeartbeatTime > maxChatHeartbeat) { chatHeartbeatTime = maxChatHeartbeat; } } setTimeout( 'chatHeartbeat();' ,chatHeartbeatTime); }}); } function closeChatBox(chatboxuid) { $( '#chatbox_' +chatboxuid).css( 'display' , 'none' ); restructureChatBoxes(); $.post( "index.php?messenger=closechat" , { chatbox: chatboxuid} , function (data){ }); } function toggleChatBoxGrowth(chatboxuid) { if ($( '#chatbox_' +chatboxuid+ ' .chatboxcontent' ).css( 'display' ) == 'none' ) { var minimizedChatBoxes = new Array(); if ($.cookie( 'chatbox_minimized' )) { minimizedChatBoxes = $.cookie( 'chatbox_minimized' ).split(/\|/); } var newCookie = '' ; for (i=0;i<minimizedChatBoxes.length;i++) { if (minimizedChatBoxes[i] != chatboxuid) { newCookie += chatboxuid+ '|' ; } } newCookie = newCookie.slice(0, -1) $.cookie( 'chatbox_minimized' , newCookie); $( '#chatbox_' +chatboxuid+ ' .chatboxcontent' ).css( 'display' , 'block' ); $( '#chatbox_' +chatboxuid+ ' .chatboxinput' ).css( 'display' , 'block' ); $( "#chatbox_" +chatboxuid+ " .chatboxcontent" ).scrollTop($( "#chatbox_" +chatboxuid+ " .chatboxcontent" )[0].scrollHeight); } else { var newCookie = chatboxuid; if ($.cookie( 'chatbox_minimized' )) { newCookie += '|' +$.cookie( 'chatbox_minimized' ); } $.cookie( 'chatbox_minimized' ,newCookie); $( '#chatbox_' +chatboxuid+ ' .chatboxcontent' ).css( 'display' , 'none' ); $( '#chatbox_' +chatboxuid+ ' .chatboxinput' ).css( 'display' , 'none' ); } } function checkChatBoxInputKey(event,chatboxtextarea,chatboxuid) { if (event.keyCode == 13 && event.shiftKey == 0) { message = $(chatboxtextarea).val(); message = message.replace(/^\s+|\s+$/g, "" ); $(chatboxtextarea).val( '' ); $(chatboxtextarea).focus(); $(chatboxtextarea).css( 'height' , '44px' ); if (message != '' ) { $.post( "index.php?messenger=sendchat" , {eid: chatboxuid, txt: message} , function (data){ message = message.replace(/</g, "<" ).replace(/>/g, ">" ).replace(/\ "/g," " "); $(" #chatbox_"+chatboxuid+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+username+': </span><span class="chatboxmessagecontent">'+message+'</span></div>'); $(" #chatbox_"+chatboxuid+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxuid+" .chatboxcontent")[0].scrollHeight); }); } chatHeartbeatTime = minChatHeartbeat; chatHeartbeatCount = 1; return false ; } var adjustedHeight = chatboxtextarea.clientHeight; var maxHeight = 94; if (maxHeight > adjustedHeight) { adjustedHeight = Math.max(chatboxtextarea.scrollHeight, adjustedHeight); if (maxHeight) adjustedHeight = Math.min(maxHeight, adjustedHeight); if (adjustedHeight > chatboxtextarea.clientHeight) $(chatboxtextarea).css( 'height' ,adjustedHeight+8 + 'px' ); } else { $(chatboxtextarea).css( 'overflow' , 'auto' ); } } function startChatSession(){ $.ajax({ url: "index.php?messenger=startchatsession ", cache: false, dataType: " json ", success: function(data) { username = data.username; $.each(data.items, function(i,item){ if (item) { // fix strange ie bug chatboxtitle = item.f; chatboxuid = item.i; if ($(" #chatbox_"+chatboxuid).length <= 0) { createChatBox(chatboxuid,chatboxtitle,1); } if (item.s == 1) { item.f = username; } if (item.s == 2) { $(" #chatbox_"+chatboxuid+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>'); } else { $(" #chatbox_"+chatboxuid+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+': </span><span class="chatboxmessagecontent">'+item.m+'</span></div>'); } } }); for (i=0;i<chatBoxes.length;i++) { chatboxuid = chatBoxes[i]; $(" #chatbox_"+chatboxuid+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxuid+" .chatboxcontent")[0].scrollHeight); setTimeout( '$("#chatbox_"+chatboxuid+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxuid+" .chatboxcontent")[0].scrollHeight);' , 100); // yet another strange ie bug } setTimeout( 'chatHeartbeat();' ,chatHeartbeatTime); }}); } /** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * */ jQuery.cookie = function (name, value, options) { if ( typeof value != 'undefined' ) { // name and value given, set cookie options = options || {}; if (value === null ) { value = '' ; options.expires = -1; } var expires = '' ; if (options.expires && ( typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if ( typeof options.expires == 'number' ) { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } // CAUTION: Needed to parenthesize options.path and options.domain // in the following expressions, otherwise they evaluate to undefined // in the packed version for some reason... var path = options.path ? '; path=' + (options.path) : '' ; var domain = options.domain ? '; domain=' + (options.domain) : '' ; var secure = options.secure ? '; secure' : '' ; document.cookie = [name, '=' , encodeURIComponent(value), expires, path, domain, secure].join( '' ); } else { // only name given, get cookie var cookieValue = null ; if (document.cookie && document.cookie != '' ) { var cookies = document.cookie.split( ';' ); for ( var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=' )) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break ; } } } return cookieValue; } }; |
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | .chatbox { position : fixed ; position :expression( "absolute" ); width : 225px ; display : none ; } .chatboxhead { background-color : #5A5A5A ; padding : 7px ; color : #ffffff ; border-right : 1px solid #5A5A5A ; border-left : 1px solid #5A5A5A ; } .chatboxblink { background-color : #176689 ; border-right : 1px solid #176689 ; border-left : 1px solid #176689 ; } .chatboxcontent { font-family : arial , sans-serif ; font-size : 13px ; color : #333333 ; height : 200px ; width : 209px ; overflow-y: auto ; overflow-x: auto ; padding : 7px ; border-left : 1px solid #cccccc ; border-right : 1px solid #cccccc ; border-bottom : 1px solid #eeeeee ; background-color : #ffffff ; line-height : 1.3em ; text-align : left ; } .chatboxinput { padding : 5px ; background-color : #ffffff ; border-left : 1px solid #cccccc ; border-right : 1px solid #cccccc ; border-bottom : 1px solid #cccccc ; } .chatboxtextarea { width : 206px ; height : 44px ; padding : 3px 0pt 3px 3px ; border : 1px solid #eeeeee ; margin : 1px ; overflow : hidden ; } .chatboxtextareaselected { border : 2px solid #5A5A5A ; margin : 0 ; } .chatboxmessage { margin-left : 1em ; } .chatboxinfo { margin-left : -1em ; color : #666666 ; } .chatboxmessagefrom { margin-left : -1em ; font-weight : bold ; } .chatboxmessagecontent { } .chatboxoptions { float : right ; } .chatboxoptions a { text-decoration : none ; color : white ; font-weight : bold ; font-family : Verdana , Arial , "Bitstream Vera Sans" , sans-serif ; } .chatboxtitle { float : left ; } |
Poste mal nen Screen:

THX erstmal
verwendete ilch Version: 1.1 P