JRS: In article <
[email protected]>, dated Thu, 7 Apr 2005
22:12:52, seen in Lasse Reichstein Nielsen
That worked.
Now I'm trying to improve the Pop-Up code display. It now puts a <pre>
rather than a <textarea> in the new window, and allows the window to
scroll. I also propose to incorporate auto-calculation of the "rows"
parameter, as in the Code Display section a little higher up the page.
It can be seen in the section Btn & PopCode which is just above
<URL:
http://www.merlyn.demon.co.uk/js-nclds.htm#Inc3>.
Questions :
(A) In PopCode, the window height and width are somewhat pragmatical :-
var Wndw = window.open("", "X"+new Date().getTime(), // /scr-bar?
"height=" + (17*btn.btnargs[1]+28) + ",width=" + (8*BoxX+20) +
",resizable,scrollbars")
where btnargs[1] is the number of lines I want to show, BoxX the number
of characters per line I want to show, 20 and 28 give the right and
bottom margins matching the top and left ones, all empirical for my
present browser setup.
Without undue effort, can the initial height and width be set in due
proportion to the actual font size?
(B) In Btn, should document.close() be there (Btn is for execution
in-line during page display)? It's there as a result of possibly-
misinterpreted advice.
(C) Can SafeHTML be coded so that it is shown properly both in the page
proper and in the pop-up, and if so how? Its real code is
function SafeHTML(S) { // may be displayed incorrectly
return S.replace(/&/g, "&").
replace(/</g, "<").replace(/>/g, ">") }
(D) Anything else?