Guides/JHS/Help

From J Wiki
< Guides‎ | JHS
Jump to: navigation, search

shortcuts

ctrl+shift+↑/↓ to recall previous lines (macOS ctrl+shift+</>)

ctrl+\ - close page

menu items note shortcuts (Esc or Ctrl)

esc key escapes next key to be a shortcut

esc 1 sets focus on menu
esc 2 sets focus to page default
esc f (on jijx page) links to jfile page
mobile device may not have an esc key
touch: s and slide to ß
wireless: hold down option and press s

ctrl shortcuts are supported for ,./<>? (comma,dot,slash,less,larger,query)

jijx ctrl shortcuts

ctrl+. lab/spx advance
ctrl+, load project (see sphelp)
ctrl+' debug step
ctrl+" debug stepin

custom jijx shortcut handler for ctrl+?

  ev_query_ctrl_jijx_=: 3 : 'i.5'

pop-up

Pop-ups can be a plague when browsing ill-behaved sites. However, they can be very useful in an app like JHS that tries to combine the best of the browser interface with some features of classic desktop applications. JHS IDE and facilities like jd3 (plots), jtable (spreadsheet), and demos work best if they can create pop-ups.

If your browser is set to block pop-ups, then you will get an alert message when JHS tries to create a pop-up. You can adjust the browser settings to allow the pop-ups.

You may not want to enable all pop-ups, and instead only allow JHS pop-ups. More recent versions of most browsers (Firefox/Chrome/Edge/IE) allow you to configure pop-up blocking to allow pop-ups based on the site address. In this case you want to enable pop-ups from localhost:65001/jijx. Safari does not allow this kind of configuration and you may want to simply allow all pop-ups.

If you don't want to enable pop-ups, you can get by with the NOPOPUP option. With this option, instead of a pop-up, a link is created in your jijx page. Click the link to see the page. This work-around is not supported in all cases.

  NOPOPUP_jhs_=: 1

Default target is _blank so new pages appear in new tabs. Change this if you want new pages to replace the current page.

  TARGET_jhs_=: '_self'

close

The preferred way to close a JHS page is to press ctrl+\ or click the red button in the upper left corner. This lets JHS manage the close and save data and free up resources as appropriate.

Only pages opened by other pages can be closed this way. For example, crtl+\ on a jijx page opened by a bookmark is ignored.

The browser accesses the web and it can be wild out there. Badly behaved sites try to usurp your control with pages that won't close gracefully. The browser is in an ongoing battle to keep you in control. When you click a tab close button, the browser assumes you mean it. There are mechanisms to give the application some control but they are badly flawed.

IDE

jijx - run J sentences

jfile - browse files for editing, etc. Adequate for simple IDE use and for a remote server. For more complicated requirements use host facilities such as Windows Explorer or macOS Finder.

jfiles - recent file list - click to open.

jijs - script editor

jfif - find in files

jal - addons package manager (pacman) - download/install software packages

libraries

JHS includes several javascript libraries.

CodeMirror
jQuery
Handesontable
D3

console

The JHS jconsole window diplays useful information. It can be used (ctrl+c) to signal break to the J task and it can kill the J task in the event of problems.

JHS (J HTTP Server) background

JHS is a browser interface to J and is an alternative to a more traditional desktop application front end. JHS gives you interactive access to J, an IDE, and a framework for developing and delivering web applications.

JHS is the J engine running as a console task configured with scripts to run as an HTTP server. A browser gets pages from JHS.

In default configuration, JHS is similar to a desktop application. It runs on your desktop and services local requests from your browser. It can be configured to provide services to browsers across a local area network or across the web.

JHS is a departure from previous desktop application front ends and is somewhat experimental. One issue that arises is whether the JHS IDE should be as much like a desktop frontend as possible or whether it should be as much like a browser app as possible.

JHS leans strongly towards being a browser app. You may miss some desktop features and it may take a while to be comfortable with the browser approach. With a bit a patience and the adoption of powerful browser paradigms the result might please. One advantage of this is that developing new browser apps from a browser app helps focus the mind.

JHS reinvents the wheel in the sense that it doesn't make use of any of the excellent javascript toolkits for browser applications. This was partly for the fun of it and partly because it seemed possible to do so in a lean and effective way. The JHS javascript library is tiny compared to kits like jquery.js and ext.js. Hopefully this makes it easier to learn and use for those who aren't proficient javascript programmers. There was also a feeling that these toolkits have largely been developed to deal with complex issues of browser incompatibilies in older browsers. By insisting on modern browsers JHS avoids many of these issues. And looking a bit forward to html5 much of the nice packaging of services in these toolkits will come for free. And if appropriate, it is easy to include any additional toolkit with the JHS framework and have the best of all worlds in developing your browser app.

technical

Pop-up windows are used.

Window ids used to avoid opening duplicate tabs. For example, opening a script from a file or files page reopens in a tab if it is already open.

New style of app use locales for state information and use ctrl+\ or red button in upper left corner for managed close.