[Phpfreechat-svn] SF.net SVN: phpfreechat: [447] trunk/misc
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-04-17 19:45:24
|
Revision: 447 Author: kerphi Date: 2006-04-17 12:45:09 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=447&view=rev Log Message: ----------- Highlight the tab icon when a something occurs in hidden tabs in order to catch the attention Modified Paths: -------------- trunk/misc/tabs.svg trunk/themes/default/images/ch.gif trunk/themes/default/images/pv.gif trunk/themes/default/templates/pfcclient.js.tpl.php trunk/themes/default/templates/pfcgui.js.tpl.php Added Paths: ----------- trunk/themes/default/images/ch-active.gif trunk/themes/default/images/pv-active.gif Modified: trunk/misc/tabs.svg =================================================================== --- trunk/misc/tabs.svg 2006-04-17 19:14:41 UTC (rev 446) +++ trunk/misc/tabs.svg 2006-04-17 19:45:09 UTC (rev 447) @@ -14,7 +14,7 @@ id="svg2" sodipodi:version="0.32" inkscape:version="0.43" - sodipodi:docbase="/home/kerphi/public_html/pfc-1.0/trunk/misc" + sodipodi:docbase="/home/kerphi/public_html/pfc-1.x/misc" sodipodi:docname="tabs.svg"> <defs id="defs4"> @@ -131,6 +131,36 @@ y1="390.89087" x2="487.51208" y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient1351" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,759.9246,165.0014)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient2229" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.707107,0.707107,-0.707107,0.707107,776.8066,-126.4271)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2207" + id="linearGradient2232" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.433136,0.433136,-0.433136,0.433136,659.6914,109.3019)" + x1="218.34671" + y1="390.89087" + x2="487.51208" + y2="390.89087" /> </defs> <sodipodi:namedview id="base" @@ -179,7 +209,7 @@ inkscape:export-ydpi="5.3417435" /> <g id="g3964" - inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/ch.png" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/ch.png" inkscape:export-xdpi="5.1439257" inkscape:export-ydpi="5.1439257"> <path @@ -215,22 +245,71 @@ style="fill:url(#linearGradient3962);fill-opacity:1;fill-rule:nonzero;stroke:#2b752b;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" d="M 333.03813,569.31539 C 252.79573,570.33301 188.31938,603.23164 188.31938,643.59664 C 188.31937,682.269 247.50785,714.04025 323.03812,717.53415 C 325.0606,722.16887 327.24474,726.963 329.60063,731.87789 C 353.08832,780.87834 435.81419,788.34127 396.25687,775.72164 C 378.83553,770.16386 364.5783,744.44366 354.10062,717.37789 C 428.01584,713.10933 485.44438,681.69247 485.44437,643.59664 C 485.44437,602.59093 418.8933,569.31538 336.88187,569.31539 C 335.60044,569.31539 334.31181,569.29924 333.03813,569.31539 z " id="path4042" - inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv.png" inkscape:export-xdpi="5.3160944" inkscape:export-ydpi="5.3160944" /> <path style="fill:#40b340;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="path4044" d="M 220.54545,609.46419 C 224.97582,597.64358 233.41072,597.60795 244.57002,598.19856 C 258.8771,605.02931 271.71997,614.19723 286.93645,618.39683 C 300.41176,597.84009 294.8373,597.8761 326.79986,618.95141 C 341.11483,631.92803 312.84247,628.80461 327.85125,599.54552 C 339.6388,587.71009 398.04287,635.16256 351.76816,605.4233 C 375.60159,600.02611 365.52412,594.35026 398.29546,615.57074 C 371.05197,600.06673 387.97162,612.37197 412.5449,606.01422 C 415.93502,602.20389 420.52981,601.90384 424.94008,600.42516 L 446.29866,616.94146 C 442.39697,618.08408 437.81007,617.1715 434.80656,621.20448 C 410.39952,628.94913 395.10512,621.91375 373.50297,604.97187 C 378.71832,607.99313 403.40507,617.57766 372.23081,622.76431 C 318.38943,590.19406 349.79437,603.39512 350.45021,613.47771 C 336.70836,640.3188 321.89868,628.39132 302.1721,607.85539 C 317.66779,617.24672 325.97335,616.69573 308.213,634.85318 C 292.38309,631.97465 279.27996,623.23925 265.18576,615.11295 C 255.57748,613.71595 248.14611,612.30201 244.85482,622.82838 L 220.54545,609.46419 z " - inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv.png" inkscape:export-xdpi="5.3160944" inkscape:export-ydpi="5.3160944" /> <path style="fill:#40b340;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="path4046" d="M 249.11688,658.03562 C 258.45103,634.3361 253.86072,633.45585 284.21407,652.4544 C 315.78397,688.73726 243.65728,634.69895 302.15277,671.34075 C 308.24601,675.15757 290.02652,663.61178 283.9634,659.74729 C 295.43114,664.62802 301.21132,659.1372 309.37754,651.67843 C 329.33843,659.63829 368.65221,695.18803 333.52088,670.06393 C 347.53882,667.73922 351.38378,652.44825 356.95858,641.02909 C 368.77724,642.55334 427.61292,688.14183 380.88221,657.84586 C 394.07882,662.17942 400.39133,655.85602 408.14719,646.26556 C 462.74164,680.59735 422.76281,653.5135 422.48065,653.30731 L 443.40962,670.11795 C 428.86132,662.47436 381.54411,634.92256 430.4992,662.20451 C 422.47769,670.73458 414.91495,678.24405 401.52336,675.17231 C 381.08355,662.83381 341.9547,633.47163 379.61876,656.05623 C 373.03882,667.58625 368.78091,682.8011 354.65762,686.81032 C 343.235,680.65281 280.91663,638.41295 331.76144,667.1771 C 323.27896,674.54399 316.47957,680.93522 304.41898,677.14935 C 276.55472,660.21726 287.83097,678.24527 259.11746,641.60637 C 287.50805,659.11706 279.14581,648.28391 273.42625,671.39981 L 249.11688,658.03562 z " - inkscape:export-filename="/home/kerphi/public_html/pfc-1.0/trunk/themes/default/images/pv.png" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv.png" inkscape:export-xdpi="5.3160944" inkscape:export-ydpi="5.3160944" /> + <path + style="fill:url(#linearGradient2232);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.60999441;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M 634.63132,379.71502 C 585.47905,380.33836 545.98425,400.49033 545.98425,425.2158 C 545.98424,448.90444 582.23998,468.36583 628.50583,470.50601 C 629.7447,473.34499 631.08259,476.28163 632.52569,479.29222 C 646.91301,509.30731 697.58651,513.87872 673.35578,506.14859 C 662.68439,502.74419 653.95116,486.98936 647.53309,470.41029 C 692.80965,467.7956 727.98734,448.55129 727.98734,425.2158 C 727.98734,400.09786 687.22166,379.71502 636.98578,379.71502 C 636.20085,379.71502 635.4115,379.70513 634.63132,379.71502 z " + id="path1333" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/ch-active.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <path + style="fill:url(#linearGradient2229);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M 735.89531,315.02966 C 655.65291,316.04728 591.17656,348.94591 591.17656,389.31091 C 591.17655,427.98327 650.36503,459.75452 725.8953,463.24842 C 727.91778,467.88314 730.10192,472.67727 732.45781,477.59216 C 755.9455,526.59261 838.67137,534.05554 799.11405,521.43591 C 781.69271,515.87813 767.43548,490.15793 756.9578,463.09216 C 830.87302,458.8236 888.30156,427.40674 888.30155,389.31091 C 888.30155,348.3052 821.75048,315.02965 739.73905,315.02966 C 738.45762,315.02966 737.16899,315.01351 735.89531,315.02966 z " + id="path1335" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/ch-active.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path1337" + d="M 623.40263,355.17846 C 627.833,343.35785 636.2679,343.32222 647.4272,343.91283 C 661.73428,350.74358 674.57715,359.9115 689.79363,364.1111 C 703.26894,343.55436 697.69448,343.59037 729.65704,364.66568 C 743.97201,377.6423 715.69965,374.51888 730.70843,345.25979 C 742.49598,333.42436 800.90005,380.87683 754.62534,351.13757 C 778.45877,345.74038 768.3813,340.06453 801.15264,361.28501 C 773.90915,345.781 790.8288,358.08624 815.40208,351.72849 C 818.7922,347.91816 823.38699,347.61811 827.79726,346.13943 L 849.15584,362.65573 C 845.25415,363.79835 840.66725,362.88577 837.66374,366.91875 C 813.2567,374.6634 797.9623,367.62802 776.36015,350.68614 C 781.5755,353.7074 806.26225,363.29193 775.08799,368.47858 C 721.24661,335.90833 752.65155,349.10939 753.30739,359.19198 C 739.56554,386.03307 724.75586,374.10559 705.02928,353.56966 C 720.52497,362.96099 728.83053,362.41 711.07018,380.56745 C 695.24027,377.68892 682.13714,368.95352 668.04294,360.82722 C 658.43466,359.43022 651.00329,358.01628 647.712,368.54265 L 623.40263,355.17846 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/ch-active.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path1339" + d="M 651.97406,403.74989 C 661.30821,380.05037 656.7179,379.17012 687.07125,398.16867 C 718.64115,434.45153 646.51446,380.41322 705.00995,417.05502 C 711.10319,420.87184 692.8837,409.32605 686.82058,405.46156 C 698.28832,410.34229 704.0685,404.85147 712.23472,397.3927 C 732.19561,405.35256 771.50939,440.9023 736.37806,415.7782 C 750.396,413.45349 754.24096,398.16252 759.81576,386.74336 C 771.63442,388.26761 830.4701,433.8561 783.73939,403.56013 C 796.936,407.89369 803.24851,401.57029 811.00437,391.97983 C 865.59882,426.31162 825.61999,399.22777 825.33783,399.02158 L 846.2668,415.83222 C 831.7185,408.18863 784.40129,380.63683 833.35638,407.91878 C 825.33487,416.44885 817.77213,423.95832 804.38054,420.88658 C 783.94073,408.54808 744.81188,379.1859 782.47594,401.7705 C 775.896,413.30052 771.63809,428.51537 757.5148,432.52459 C 746.09218,426.36708 683.77381,384.12722 734.61862,412.89137 C 726.13614,420.25826 719.33675,426.64949 707.27616,422.86362 C 679.4119,405.93153 690.68815,423.95954 661.97464,387.32064 C 690.36523,404.83133 682.00299,393.99818 676.28343,417.11408 L 651.97406,403.74989 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/ch-active.png" + inkscape:export-xdpi="5.1439257" + inkscape:export-ydpi="5.1439257" /> + <path + style="fill:url(#linearGradient1351);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.61000013;stroke-linejoin:miter;stroke-miterlimit:2.5;stroke-dasharray:none;stroke-opacity:1" + d="M 719.01339,606.45822 C 638.771,607.47584 574.29464,640.37447 574.29464,680.73947 C 574.29463,719.41183 633.48311,751.18308 709.01338,754.67698 C 711.03586,759.3117 713.22,764.10583 715.57589,769.02072 C 739.06359,818.02117 821.78946,825.4841 782.23213,812.86447 C 764.8108,807.30669 750.55356,781.58649 740.07588,754.52072 C 813.9911,750.25216 871.41964,718.8353 871.41963,680.73947 C 871.41963,639.73376 804.86856,606.45821 722.85713,606.45822 C 721.5757,606.45822 720.28707,606.44207 719.01339,606.45822 z " + id="path1345" + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv-active.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path1347" + d="M 606.52071,646.60702 C 610.95108,634.78641 619.38598,634.75078 630.54528,635.34139 C 644.85236,642.17214 657.69523,651.34006 672.91171,655.53966 C 686.38702,634.98292 680.81256,635.01893 712.77513,656.09424 C 727.09009,669.07086 698.81774,665.94744 713.82651,636.68835 C 725.61406,624.85292 784.01813,672.30539 737.74343,642.56613 C 761.57685,637.16894 751.49939,631.49309 784.27073,652.71357 C 757.02723,637.20956 773.94688,649.5148 798.52016,643.15705 C 801.91028,639.34672 806.50507,639.04667 810.91535,637.56799 L 832.27392,654.08429 C 828.37223,655.22691 823.78533,654.31433 820.78182,658.34731 C 796.37478,666.09196 781.08038,659.05658 759.47823,642.1147 C 764.69358,645.13596 789.38033,654.72049 758.20607,659.90714 C 704.36469,627.33689 735.76964,640.53795 736.42547,650.62054 C 722.68363,677.46163 707.87394,665.53415 688.14736,644.99822 C 703.64305,654.38955 711.94861,653.83856 694.18826,671.99601 C 678.35836,669.11748 665.25523,660.38208 651.16103,652.25578 C 641.55275,650.85878 634.12137,649.44484 630.83008,659.97121 L 606.52071,646.60702 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv-active.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> + <path + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path1349" + d="M 635.09215,695.17845 C 644.42629,671.47893 639.83598,670.59868 670.18933,689.59723 C 701.75923,725.88009 629.63254,671.84178 688.12803,708.48358 C 694.22128,712.3004 676.00178,700.75461 669.93866,696.89012 C 681.4064,701.77085 687.18658,696.28003 695.3528,688.82126 C 715.31369,696.78112 754.62747,732.33086 719.49614,707.20676 C 733.51408,704.88205 737.35904,689.59108 742.93384,678.17192 C 754.7525,679.69617 813.58818,725.28466 766.85747,694.98869 C 780.05408,699.32225 786.36659,692.99885 794.12245,683.40839 C 848.7169,717.74018 808.73807,690.65633 808.45591,690.45014 L 829.38488,707.26078 C 814.83658,699.61719 767.51938,672.06539 816.47446,699.34734 C 808.45295,707.87741 800.89021,715.38688 787.49862,712.31514 C 767.05882,699.97664 727.92996,670.61446 765.59403,693.19906 C 759.01408,704.72908 754.75617,719.94393 740.63288,723.95315 C 729.21026,717.79564 666.89189,675.55578 717.7367,704.31993 C 709.25422,711.68682 702.45483,718.07805 690.39424,714.29218 C 662.52998,697.36009 673.80623,715.3881 645.09272,678.7492 C 673.48331,696.25989 665.12107,685.42674 659.40151,708.54264 L 635.09215,695.17845 z " + inkscape:export-filename="/home/kerphi/public_html/pfc-1.x/themes/default/images/pv-active.png" + inkscape:export-xdpi="5.3160944" + inkscape:export-ydpi="5.3160944" /> </g> </svg> Added: trunk/themes/default/images/ch-active.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/ch-active.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/images/ch.gif =================================================================== (Binary files differ) Added: trunk/themes/default/images/pv-active.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/pv-active.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/images/pv.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-17 19:14:41 UTC (rev 446) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-04-17 19:45:09 UTC (rev 447) @@ -19,7 +19,6 @@ this.privmsgs = Array(); this.privmsgids = Array(); - this.timeout = null; this.refresh_delay = <?php echo $refresh_delay; ?>; /* unique client id for each windows used to identify a open window @@ -516,7 +515,6 @@ handleComingRequest: function( cmds ) { var msg_html = $H(); - var msg_ids = $H(); // alert(cmds.inspect()); @@ -575,11 +573,6 @@ msg_html[recipientid] = line; else msg_html[recipientid] += line; - - if (msg_ids[recipientid] == null) - msg_ids[recipientid] = Array(id); - else - msg_ids[recipientid].push(id); } // loop on all recipients and post messages @@ -589,6 +582,9 @@ var recipientid = keys[i]; var tabid = recipientid; + if (this.gui.getTabId() != tabid) + this.gui.notifyTab(tabid); + // create the tab if it doesn't exists yet var recipientdiv = this.gui.getChatContentFromTabId(tabid); @@ -694,12 +690,6 @@ nickdiv.appendChild(ul,fc); this.colorizeNicks(tabid,nickdiv); }, - - test: function(evt) - { - alert(evt); - return false; - }, /** * clear the nickname list Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-04-17 19:14:41 UTC (rev 446) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-04-17 19:45:09 UTC (rev 447) @@ -14,6 +14,7 @@ this.current_tab_id = ''; this.tabs = Array(); this.tabids = Array(); + this.tabtypes = Array(); this.chatcontent = $H(); this.onlinecontent = $H(); this.smileycontent = $H(); @@ -72,6 +73,8 @@ // restore the scroll pos var content = this.getChatContentFromTabId(tabid); content.scrollTop = this.scrollpos[tabid]; + + this.unnotifyTab(tabid); }, getTabId: function() @@ -157,6 +160,7 @@ var name = this.tabs[tabpos]; this.tabids = this.tabids.without(this.tabids[tabpos]); this.tabs = this.tabs.without(this.tabs[tabpos]); + this.tabtypes = this.tabtypes.without(this.tabtypes[tabpos]); // this.tabprefixs = this.tabprefixs.without(this.tabprefixs[tabpos]); tabpos--; if (tabpos<0) tabpos = 0; this.setTabById(this.tabids[tabpos]); @@ -188,6 +192,7 @@ //alert(name+'='+tabid); this.tabs.push(name); this.tabids.push(tabid); + this.tabtypes.push(type); // this.tabprefixs.push(prefix); var li_title = document.createElement('li'); @@ -197,6 +202,7 @@ li_title.appendChild(li_div); var img = document.createElement('img'); + img.setAttribute('id', '<?php echo $prefix; ?>tabimg'+tabid); if (type == 'ch') img.setAttribute('src', '<?php echo $c->getFileUrlFromTheme('images/ch.gif'); ?>'); if (type == 'pv') @@ -235,9 +241,48 @@ $('<?php echo $prefix; ?>channels_list').appendChild(li_title); $('<?php echo $prefix; ?>channels_content').appendChild(div_content); + + return tabid; + }, + /** + * This function change the tab icon in order to catch the attention + */ + notifyTab: function(tabid) + { + var tabpos = this.tabids.indexOf(tabid); + var tabtype = this.tabtypes[tabpos]; + var img = $('<?php echo $prefix; ?>tabimg'+tabid); + if (img) + { + var src = ''; + if (tabtype == 'ch') + src = '<?php echo $c->getFileUrlFromTheme('images/ch-active.gif'); ?>'; + if (tabtype == 'pv') + src = '<?php echo $c->getFileUrlFromTheme('images/pv-active.gif'); ?>'; + preloadImages(src); + img.src = src; + } + }, - return tabid; + /** + * This function restore the tab icon to its default value + */ + unnotifyTab: function(tabid) + { + var tabpos = this.tabids.indexOf(tabid); + var tabtype = this.tabtypes[tabpos]; + var img = $('<?php echo $prefix; ?>tabimg'+tabid); + if (img) + { + var src = ''; + if (tabtype == 'ch') + src = '<?php echo $c->getFileUrlFromTheme('images/ch.gif'); ?>'; + if (tabtype == 'pv') + src = '<?php echo $c->getFileUrlFromTheme('images/pv.gif'); ?>'; + preloadImages(src); + img.src = src; + } } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |