Ticket #170: 20060612 - unified unread count (incomplete).diff
| File 20060612 - unified unread count (incomplete).diff, 4.5 kB (added by mdodoo, 2 years ago) |
|---|
-
ajax.php
479 479 _ces(id); 480 480 } 481 481 482 function _es(id, state) {482 function _es(id, cid, state) { 483 483 if (document.prevState[id] != null) { 484 484 // if we click the edit icon while editing cancel the edit 485 485 _ces(id); … … 500 500 onCancel = '<?php echo rss_plugin_hook("rss.plugins.ajax.admindlg.oncancel",""); ?>'.replace(/_ID_/g,id); 501 501 extraCode = '<?php echo rss_plugin_hook("rss.plugins.ajax.admindlg",""); ?>'.replace(/_ID_/g,id); 502 502 503 onOk += '_ses('+id+' ); return false;';503 onOk += '_ses('+id+','+cid+'); return false;'; 504 504 if (!onCancel) { 505 505 onCancel = '_ces('+id+'); return false;'; 506 506 } … … 549 549 550 550 } 551 551 552 function _ses(id ) {552 function _ses(id,cid) { 553 553 s = 0; 554 554 if ((sfu = document.getElementById('sf'+id+'u')) && sfu.checked) { 555 555 s += <?php echo RSS_MODE_UNREAD_STATE ?>; … … 570 570 if ((s & <?php echo RSS_MODE_UNREAD_STATE ?>) != (p & <?php echo RSS_MODE_UNREAD_STATE ?>)) { 571 571 if (s & <?php echo RSS_MODE_UNREAD_STATE ?>) { 572 572 setItemClass(id,'item unread'); 573 c=unreadCnt(1 );573 c=unreadCnt(1,cid); 574 574 } else { 575 c = unreadCnt(-1 );575 c = unreadCnt(-1,cid); 576 576 if ((sel = document.getElementById('<?php echo SHOW_WHAT ?>')) && 577 577 sel.options[sel.selectedIndex].value == <?php echo SHOW_UNREAD_ONLY ?>) { 578 578 setItemHide(id, (c==0)); … … 593 593 } 594 594 } 595 595 596 function unreadCnt(d) { 597 if (span = document.getElementById('ucnt')) { 598 if (c = span.innerHTML.replace(/[^0-9]+/g,"")) { 599 c = d+eval(c); 600 span.innerHTML = span.innerHTML.replace(/[0-9]+/g,c); 601 } 602 return c; 603 } 604 return null; 596 function unreadCnt(d,channel) { 597 e = null; 598 channels = document.getElementsByTagName("strong"); 599 for(i=0;i<channels.length;i++){ 600 if((channels[i].id == 'cid'+channel) || (channels[i].id == 'ucnt')){ 601 if (e = channels[i].innerHTML.replace(/[^0-9]+/g,"")) { 602 e = d+eval(e); 603 channels[i].innerHTML = channels[i].innerHTML.replace(/[0-9]+/g,e); 604 changed = 1; 605 } 606 } 607 } 608 return e; 605 609 } 606 610 607 611 function _rt(id,rt) { -
cls/wrappers/item.php
86 86 return $GLOBALS['rss'] -> currentItem -> id; 87 87 } 88 88 89 function rss_item_cid() { 90 return $GLOBALS['rss'] -> currentItem -> parent -> cid; 91 } 92 89 93 function rss_item_flags() { 90 94 91 95 return $GLOBALS['rss'] -> currentItem -> flags; -
themes/default/web/item.php
5 5 </a> 6 6 <?php } ?> 7 7 <?php if(!hidePrivate()) { ?> 8 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_ flags(); ?>); return false;">8 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 9 9 <img src="<?php echo getExternalThemeFile('media/edit.gif'); ?>" alt="edit" /> 10 10 </a> 11 11 <?php } ?> -
themes/lilina/web/item.php
28 28 </a> 29 29 <?php } ?> 30 30 <?php if(!hidePrivate()) { ?> 31 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_ flags(); ?>); return false;">31 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 32 32 <img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" /> 33 33 </a> 34 34 <?php } ?> … … 73 73 </a> 74 74 <?php } ?> 75 75 <?php if(!hidePrivate()) { ?> 76 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_ flags(); ?>); return false;">76 <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 77 77 <img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" /> 78 78 </a> 79 79 <?php } ?>
