This is my incomplete implementation, to be used from the free nodelet. It moves the radio button to the cell at the right, above the options [reply], [/msg], [d/l] and such.
<script language="Javascript">
// reparent voting radio buttons
var replies_table = document.getElementById ('replies_table');
if (replies_table) {
var divs = replies_table.getElementsByTagName ('div');
for (var i = divs.length - 1; i >= 0; i--) {
var node = divs`[i`];
var class = node.getAttribute('class');
if ('vote' != class) { continue; }
var dest = node.parentNode.nextSibling;
// remove <center> tag
node.innerHTML = node.firstChild.innerHTML;
// discard spacing between <label>s
var children = node.childNodes;
for (var j = children.length - 1; j >= 0; j--) {
var c = children`[j`];
//alert (c.tagName + ' ' + c.innerHTML);
if ('LABEL' != c.tagName) {
node.removeChild (c);
continue;
}
}
// insert <br>s between <label>s
for (var j = children.length - 1; j >= 1; j--) {
node.insertBefore (document.createElement ('br'), children
+`[j`]);
}
// add a couple of nbsp's to make the cell wider in
// order to make room for the "+=0" vote option
dest.firstChild.innerHTML += ' ';
// add the vote buttons div to the cell at the right
dest.insertBefore (node, dest.firstChild); // appendChild (no
+de);
//alert ('index (' + i + ') class (' + class + ') dest.innerHT
+ML (' + dest.innerHTML + ')');
}
}
</script>
Things to be improved:
- Only moves radio buttons in replies, not in the node displayed at the top.
The text +=0 appears on its own line, instead of being at the right of its radio button (not an issue for some users). I don't know how to fix that. (Update: if the cell includes the option [select], it gets wide enough and this problem doesn't happen). (Update, more than one year later: it just struck me that adding a couple of s to the [reply] link would be enough to widen the cell and make room for the +=0, thereby fixing the bug.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|