Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Javascript formatting toolbar for perlmonks

by ambrus (Abbot)
on Nov 25, 2009 at 15:34 UTC ( [id://809356]=note: print w/replies, xml ) Need Help??


in reply to Javascript formatting toolbar for perlmonks

The code above had a bug which I somehow didn't notice since now. It forgot to insert the paragraph tag to put the toolbar in a separate page, so sometimes (in wide pages) the toolbar shows to the left of the textarea, which is ugly. The fix would be trivial: change

t.parentNode.insertBefore(l,t);
to
t.parentNode.insertBefore(p,t);
However, this is a bit ugly, because the paragraph tag adds some vertical space between the toolbar and the image, so I'll soon fix the code to add a br tag instead of a p tag.

The original node will contain the fixed code (it does now), so here's a backup copy of the old code.

<script type="text/javascript" defer><!-- function edittoolbar_help(){window.alert('Separate paragraphs with "<p +>", put "<c>".."<\x2fc>" around code or data (linebreaks inside it ar +e taken literally) and you\x27ll be okay. Don\x27t forget to check i +f the preview looks right.');} (function(){ var d=document,c="createElement",i="appendChild"; var t=d.getElementsByTagName("textarea")[0]; if(t){ var p=d[c]("p"),l=d[c]("a"),m=d[c]("img"); m.src="http://www.math.bme.hu/~ambrus/pu/edittoolbar"; m.border=0; l.href="javascript:edittoolbar_help()"; l[i](m);p[i](l); t.parentNode.insertBefore(l,t); } })(); //--></script>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://809356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found