require CHORA_TEMPLATES . '/annotate/header.inc';
$author = '';
-$i = $style = 0;
+$style = 0;
/* Use this counter so that we can give each tooltip object a unique
* id attribute (which we use to set the tooltip text later). */
$line = Text::htmlAllSpaces($line['line']);
include CHORA_TEMPLATES . '/annotate/line.inc';
- ++$i;
}
require $registry->get('templates', 'horde') . '/common-footer.inc';
-var Chora_Annotate={showLog:function(d){var c=d.findElement("SPAN").hide(),b=c.up("TD").down("A").readAttribute("id").slice(4,-2),a=new Element("TD",{colspan:5}).insert(Chora.loading_text);c.up("TR").insert({after:new Element("TR").insert(a)});new Ajax.Updater(a,Chora.ANNOTATE_URL+b)}};document.observe("dom:loaded",function(){$$(".logdisplay").invoke("observe","click",Chora_Annotate.showLog.bindAsEventListener(Chora_Annotate))});
\ No newline at end of file
+var Chora_Annotate={showLog:function(d){var c=d.element(),b,a;if(!c.hasClassName("logdisplay")){c=c.up("SPAN.logdisplay");if(!c){return}}d.stop();b=c.hide().up("TD").down("A").readAttribute("rev");a=new Element("TD",{colspan:5}).insert(Chora.loading_text);c.up("TR").insert({after:new Element("TR",{className:"logentry"}).insert(a)});new Ajax.Updater(a,Chora.ANNOTATE_URL+b)}};document.observe("click",Chora_Annotate.showLog.bindAsEventListener(Chora_Annotate));
\ No newline at end of file
var Chora_Annotate = {
showLog: function(e) {
- var elt = e.findElement('SPAN').hide(),
- rev = elt.up('TD').down('A').readAttribute('id').slice(4, -2),
- newelt = new Element('TD', { colspan: 5 }).insert(Chora.loading_text);
- elt.up('TR').insert({ after: new Element('TR').insert(newelt) });
+ var elt = e.element(), rev, newelt;
+ if (!elt.hasClassName('logdisplay')) {
+ elt = elt.up('SPAN.logdisplay');
+ if (!elt) {
+ return;
+ }
+ }
+
+ e.stop();
+
+ rev = elt.hide().up('TD').down('A').readAttribute('rev');
+ newelt = new Element('TD', { colspan: 5 }).insert(Chora.loading_text);
+
+ elt.up('TR').insert({ after: new Element('TR', { className: 'logentry' }).insert(newelt) });
new Ajax.Updater(newelt, Chora.ANNOTATE_URL + rev);
}
};
-document.observe('dom:loaded', function() {
- $$('.logdisplay').invoke('observe', 'click', Chora_Annotate.showLog.bindAsEventListener(Chora_Annotate));
-});
+document.observe('click', Chora_Annotate.showLog.bindAsEventListener(Chora_Annotate));
<?php echo $author ?>
</td>
<td class="rev">
- <a id="rev_<?php echo htmlspecialchars($rev) . '_' . $i ?>" href="<?php echo Chora::url('co', $where, array('r' => $rev)) ?>" title="<?php echo htmlspecialchars($rev) ?>"><?php echo htmlspecialchars($rev_ob->abbrev($rev)) ?></a>
+ <a rev="<?php echo htmlspecialchars($rev) ?>" href="<?php echo Chora::url('co', $where, array('r' => $rev)) ?>" title="<?php echo htmlspecialchars($rev) ?>"><?php echo htmlspecialchars($rev_ob->abbrev($rev)) ?></a>
<?php if ($prev): ?>
<a href="<?php echo Chora::url('diff', $where, array('r1' => $prev, 'r2' => $rev)) ?>" title="<?php echo sprintf(_("Diff to %s"), htmlspecialchars($prev)) ?>"><?php echo Horde::img('diff.png') ?></a>
<span class="logdisplay"><?php echo Horde::img('log.png') ?></span>
</td>
<td class="rev">
<?php if ($prev): ?>
- <a id="prev_<?php echo htmlspecialchars($prev) . '_' . $i ?>" href="<?php echo Chora::url('annotate', $where, array('rev' => $prev)) . '#l' . $lineno ?>" title="<?php echo htmlspecialchars($prev) ?>"><?php echo htmlspecialchars($rev_ob->abbrev($prev)) ?></a>
+ <a rev="<?php echo htmlspecialchars($prev) ?>" href="<?php echo Chora::url('annotate', $where, array('rev' => $prev)) . '#l' . $lineno ?>" title="<?php echo htmlspecialchars($prev) ?>"><?php echo htmlspecialchars($rev_ob->abbrev($prev)) ?></a>
<?php endif; ?>
</td>
<td class="item<?php echo $style ?>">
padding-right: 2px;
white-space: nowrap;
}
+table.annotate .logentry {
+ background: #cde;
+}
/* Diff styles. */
table.hrdiff {