Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #10190
Cross-posted to 3 groups.
Show key headers only | View raw
In comp.lang.javascript message <67023a25-650b-454f-a915-ebeae30ccf6e@f1 1g2000yql.googlegroups.com>, Tue, 10 Jan 2012 17:04:55, "Michael Haufe (TNO)" <tno@thenewobjective.com> posted: >On Jan 10, 3:40 pm, Dr J R Stockton <J.R.Stock...@physics.org> wrote: > >> Rather easy. Essentially, the HTA has a button and a textarea. The >> existing JScript for WSH is modified so that the code is just >> declarations of globals and functions, followed by a call of the main >> function :- >> >> if (typeof window == "undefined") SEAKFYLE() >> >> In CScript, that call calls, and all still works as before; in HTA, >> that call does not call, but the button does it instead. >> >> The HTA "include"s SEAKFYLE.JS, and also contains script >> >> Fawm = document.forms[0] >> >> SEAKFYLE.JS uses the value of Fawm to write to the textarea, and the >> truth of Fawm for minor code changes, such as reading the command line >> from an "<input type=text" in the HTA. >> >> <http://www.merlyn.demon.co.uk/programs/32-bit/seakfyle.htm> >> <http://www.merlyn.demon.co.uk/programs/32-bit/seakfyle.js> >> <http://www.merlyn.demon.co.uk/programs/32-bit/seek.hta> > >Note that HTML Applications can take command like arguments as well by >using windows.dialogArguments That's well worth knowing. I could use that to pre-load the input line; and I can add an option, command-line only, to auto-start after pre- load. ... Except that neither windows nor window.dialogArguments appears to exist. ... Needs <hta:application ID="oHTA" and then alert(oHTA.commandLine) shows the command line. >More info should be here: ><http://msdn.microsoft.com/en-us/library/ms536496%28v=vs.85%29.aspx> > >The WScript object is not available in an HTA. Alternative methods >must be used. I think that, in HTA mode, no path of execution should now lead to a WScript. Because of the heritage of the "design" of the code, detected errors lead to a chain of function calls used as GOTOs, since they ended up in the original Pascal with a Halt(N) call. In WSH, WScript.Quit(N) does the same. I'd like to use something similar in HTA mode; but the only way of stopping that I know is to exit all routines and fall off the end of the script, which would be tiresome to arrange. That problem is now circumvented. >> <http://www.merlyn.demon.co.uk/programs/32-bit/seek.bat> > >Why do you want/need a *.BAT file? If *.js is registered to open with >Cscript.exe or Wscript.exe, then it would be sufficient to simply type >SEAKFYLE.JS at the command prompt. I prefer to change such defaults as little as possible. I'd have to remember to do it on other machines, and other users would also need to do it. There could be other *.js files needing to run in WScript. But I've added the possibility to the description. > Passing arguments to the script can >be managed by the WScript.Arguments collection: ><http://www.devguru.com/technologies/wsh/quickref/ >wscript_arguments.html> I'm using WScript.Arguments already. >> <http://www.merlyn.demon.co.uk/programs/32-bit/seakfyle.zip> >> >> but please take copies for repeated use. >> >> Query : is there an easy way to resize the textarea vertically when >> the HTA window is resized, so that the form comes within a gnat's >> whisker (0.5 ex, or a few px) of the bottom of the window, and if so >> what is it? > >Perhaps this might help: ><https://gist.github.com/1592291> It is rather too much changed from a version that I no longer have to import, or to be easy to follow. Having seen it working, aesthetics demand that the textarea is sized to fill the rest of the form, and the form is sized to only nearly reach the bottom of the viewport. But @FrmMain margin-bottom: 5px; does that. Resizing then is nice, or will be once I've trapped the error that occurs when the bottom is dragged up too far. This does it : TA.style.height = Math.max(0, TA.parentNode.offsetHeight - 10) + "px"; The <H3> wastes height !! I'll stick with <big> or equivalent. The ROWS control seems not to work; but it has no useful function with auto-resizing. Removed. The SEEK button failed, because of its re-naming, fixed. I was somewhat surprised that Fawm = document.forms[0]; in the HEAD works when the actual form is in the body. There is at present one remaining infelicity: the heading (and other) text, when wrapped because of Zoom or narrowing the window, wraps under the following element. That's now mitigated by shortening the heading line. If IE gets Zoom Text Only, I suppose the vertical sizing will have to be redone in ex or em units. The version uploaded at about 23:40 GMT, dated 2012-01-12, includes all this. More thanks. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike 6.05 WinXP. Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
JScript - is a file of a known Type? Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-03 17:09 +0000
Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-03 21:13 -0500
Re: JScript - is a file of a known Type? Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-04 00:55 -0500
Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-04 09:18 -0500
Re: JScript - is a file of a known Type? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2012-01-04 09:40 -0500
Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-04 10:23 -0500
Re: JScript - is a file of a known Type? Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-04 20:22 -0500
Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-05 22:01 -0800
Re: JScript - is a file of a known Type? John G Harris <john@nospam.demon.co.uk> - 2012-01-06 11:04 +0000
Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-06 04:26 -0800
Re: JScript - is a file of a known Type? John G Harris <john@nospam.demon.co.uk> - 2012-01-06 14:58 +0000
Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-06 12:27 -0800
Re: JScript - is a file of a known Type? Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:54 +0000
JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-05 20:29 +0000
Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-05 22:05 -0800
Re: JScript - WScript output similar to CScript output> Bwig Zomberi <zomberiMAPSONNOSPAM@gmail.invalid> - 2012-01-06 14:31 +0530
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:14 +0000
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:10 +0000
Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-08 14:52 -0800
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-09 23:45 +0000
Re: JScript - WScript output similar to CScript output> Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-10 00:27 -0500
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <J.R.Stockton@physics.org> - 2012-01-10 13:40 -0800
Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-10 17:04 -0800
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-12 23:43 +0000
Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-12 22:36 -0800
Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-12 22:47 -0800
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <J.R.Stockton@physics.org> - 2012-01-14 12:15 -0800
Re: JScript - WScript output similar to CScript output> Bwig Zomberi <zomberiMAPSONNOSPAM@gmail.invalid> - 2012-01-06 14:43 +0530
Re: JScript - WScript output similar to CScript output> Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-06 05:20 -0500
Re: JScript - WScript output similar to CScript output> "Mayayana" <mayayana@invalid.nospam> - 2012-01-06 08:33 -0500
Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 20:11 +0000
csiph-web