Changeset 132

Show
Ignore:
Timestamp:
10/05/05 08:53:40 (3 years ago)
Author:
ogawa
Message:

Now add the incrementing/decrementing buttons for the score weight.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • DuplicatedTBPingLookup/trunk/DuplicatedTBPingLookup.pl

    r131 r132  
    1717$VERSION = '1.02'; 
    1818 
     19use MT; 
    1920use MT::JunkFilter qw(ABSTAIN); 
    2021 
     
    6263 
    6364sub template { 
    64     return <<'EOT'; 
     65    my $tmpl = <<'EOT'; 
     66<script type="text/javascript"> 
     67<!-- 
     68function dtlScoreNudge(amount, id) { 
     69    var fld = getByID(id); 
     70    score = fld.value; 
     71    score.replace(/\+/, ''); 
     72    score = parseFloat(score) + amount; 
     73    if (isNaN(score)) score = amount; 
     74    if (score > 10) score = 10; 
     75    if (score < 0) score = 0; 
     76    fld.value = score; 
     77    return false; 
     78
     79//--> 
     80</script> 
     81 
    6582<p>This plugin allows you to look up duplicated trackback ping from the same source and mark it as a 'junk'.</p> 
    6683</p> 
     
    6885<div class="label"><label>Score Weight:</label></div> 
    6986<div class="field"> 
    70 <p><input type="text" size="2" name="dtl_score_weight" value="<TMPL_VAR NAME=DTL_SCORE_WEIGHT>" /> (1-5)</p> 
     87<a href="#" class="spinner" onclick="return dtlScoreNudge(-1, 'dtl_score_weight')"><img src="<TMPL_VAR NAME=STATIC_URI>images/decrease.gif" alt="<MT_TRANS phrase="Decrease">" width="12" height="8" /></a> 
     88<input type="text" size="3" name="dtl_score_weight" id="dtl_score_weight" value="<TMPL_VAR NAME=DTL_SCORE_WEIGHT ESCAPE=HTML>" /> 
     89<a href="#" class="spinner" onclick="return dtlScoreNudge(1, 'dtl_score_weight')"><img src="<TMPL_VAR NAME=STATIC_URI>images/increase.gif" alt="<MT_TRANS phrase="Increase">" width="12" height="8" /></a> 
    7190</div> 
    7291</div> 
    7392EOT 
     93    my $static_uri = MT->instance->static_path; 
     94    $tmpl =~ s!<TMPL_VAR NAME=STATIC_URI>!$static_uri!g; 
     95    $tmpl; 
    7496} 
    7597