Changeset 972

Show
Ignore:
Timestamp:
08/20/08 06:29:48 (3 months ago)
Author:
bsmith
Message:

Adding entry_id to rating to give each rating count a unique html id

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Dug/Template_Snippets.txt

    r867 r972  
    11Add the following template snippet to entry's metadata section to show the number of votes and clickable link. 
    22 
    3 <a href="javascript:void(0)" onclick="dug('<$MTEntryID$>');">((<span id="dug_count"><$MTDugCount$></span>))</a> 
     3<a href="javascript:void(0)" onclick="dug('<$MTEntryID$>');">((<span id="dug_count_<$MTEntryID$>"><$MTDugCount$></span>))</a> 
    44 
    55Also add the following template snippet to the <head> section of Entry archive template. 
     
    2222    xh.send(null); 
    2323} 
    24 function dug_response(count) { 
    25     var el = document.getElementById('dug_count'); 
     24function dug_response(count,entry_id) { 
     25    var el = document.getElementById('dug_count_' + entry_id); 
    2626    if (el) el.innerHTML = count; 
    2727} 
  • trunk/Dug/plugins/Dug/lib/Dug/App.pm

    r867 r972  
    2828    $app->{no_print_body} = 1; 
    2929    require JSON; 
    30     $app->print("dug_response($count);"); 
     30    $app->print("dug_response($count,$entry_id);"); 
    3131    return undef; 
    3232}