Permlink Replies: 25 - Pages: 2 [ 1 2 | Next ] - Last Post: 18 Aug 16, 01:29 Last Post By: drmikey Threads: [ Previous | Next ]
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Web based skin user user interfaces
Posted: 12 Aug 16, 15:51
  Click to reply to this thread Reply
Attachment MinimalWeb.jaskin (330.9 KB)
Hi everyone,

For jAlbum 13.4 we will support web based skin settings user interfaces!

Advantages:

  • No need for Java/BeanShell knowledge in order to develop skins. Developers can rely on html+css+javascript knowledge only
  • Better debugging environment. No unreadable BeanShell error messages. Skins can be tested in your ordinary web browser and debugger

For this to work, you only need to fit your skin with a "ui.html" file. (No "onload.bsh" or "onload.js" files). jAlbum will present the skins's UI in an embedded web browser. Named input elements embedded in a <form> element will have their data passed back and forth as jAlbum variables automatically.

We do support JavaScript's "alert", "confirm" and "prompt" functions (also works in the embedded web browser for previews). Debug prints passed to console.log ends up in jAlbum's system console. Links to external sites should have a target="_blank" attribute and are then opened in separate browser windows.

Eager to try? Ensure you run jAlbum 13.3, then patch your lib/jalbum-core.jar with this one . Finally install and play with the attached MinimalWeb.jaskin file. This somewhat older version of Minimal uses the jQuery and jQueryUI libraries to simplify styling and disabling of input elements.

Current limitations:
  • No support for multilingual skins yet
  • Color picker not working yet. Will work when Java 8 u112 is released in October. Testers can run jAlbum on an early version of u112 already, available via http://java.oracle.com

Hints: You can now use CTRL/CMD+R to reload the skin quickly. You can also right click the skin's UI and select "Reload" from the popup menu in order to reload the page only (setting it to default state)

It is my hope that this change will ten-fold the potential developer base for jAlbum skins as you "only" need to be proficient in html, css and JavaScript.

What do you think?

Screenshot:
RobM

Posts: 3,979
Registered: 4-Aug-2006
Re: Web based skin user user interfaces
Posted: 12 Aug 16, 20:38   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
How much of jQuery do you need to know, can you avoid it altogether?
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 12 Aug 16, 22:14   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Yes, you can skip jQuery altogether. It helps styling components so they (in my opinion) look better. It also makes the components behave better. The spinner control doesn't for instance have up/down buttons in the embedded browser, but with jQuery it gets them.
AndreWolff

Posts: 1,116
Registered: 14-Dec-2007
Re: Web based skin user user interfaces
Posted: 12 Aug 16, 23:27   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Do I understand you well that this effects only the contents of onload.bsh?
The contents of index,htt is unchanged?

Will it also be possible to make a custom panel for an image in the explorer?

Is there a JavaScript version of your StateMonitor?

I look forward to get finally rid of the stupid error reports in case l make mistakes in the onload.bsh code, but of course I still get these understandable error reports if I make mistakes in init.htt

But I can only start using it if there is a color selector available.
JeffTucker

Posts: 8,170
Registered: 31-Jan-2006
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 00:04   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Intriguing. It certainly makes some things considerably simpler, while also providing more flexibility than RiverLayout (getting boxes to line up, for example, often requires multiply-nested layers of ControlPanel()'s - a lot simpler with HTML/CSS).

Do we need to learn Spanish to use tabs.css? ;)

From what I'm seeing, I gather that default values are all set within the form layout, so there's no SkinModel.java, correct?

I'm loathe to wade into unreleased Java, but will the color selector support include the kinds of things we have now, like multiple chooser methods (HSV, HSL, RGB, etc.), and semi-transparency? And how about the current linked "color box and hex code" entries?

Lots of unanswered questions, of course, like how to handle custom UI's - not just the simple "tab in Edit mode," like Gromit, but also the "entire popup tabbed window" like Matrix.

Context-sensitive help?

Any idea what loading speed might be like? I was driven into a compiled UI in Matrix (thankfully - it's been much easier to manage than an interpreted onload.bsh) because the loading time was hitting the 30-second mark. It was painful. I'd hate to go backwards on that aspect of things.
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 09:35   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
AndreWolff wrote:
Do I understand you well that this effects only the contents of onload.bsh?
The contents of index,htt is unchanged?

Yes, but if you use an init.js instead of init.bsh or set scriptLanguage=JavaScript as a skin property of your skin, then any <% scriptlets %> can be written in JavaScript too. If you on top of this rely on the JSON data produced by the JSONMaker object, the you don't need any album-build-time script processing at all.

Will it also be possible to make a custom panel for an image in the explorer?

Sorry, didn't understand what you're after. Do you mean a html based image specific ui for the Edit view? It could be implemented, but those panels tend to be much simpler anyway.

Is there a JavaScript version of your StateMonitor?

I assume someone must have made something similar. I'm not a web tech guy, but there are millions out there. Let's find a good, pretty standardized solution and recommend to others.

I look forward to get finally rid of the stupid error reports in case l make mistakes in the onload.bsh code, but of course I still get these understandable error reports if I make mistakes in init.htt

You mean init.bsh. Replace that one with init.js and you'll be able to write the whole init file in JavaScript instead. See the "init.js" of the MinimaWeb skin for example of how to access jAlbum's Java objects via JavaScript.

But I can only start using it if there is a color selector available.

I know. It's already implemented for Java 8 u112, to be released in October. I've tested it. It IS possible to use some JavaScript library that produces hand-rolled color selectors in the meantime.
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:00   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
jGromit wrote:
Intriguing. It certainly makes some things considerably simpler, while also providing more flexibility than RiverLayout (getting boxes to line up, for example, often requires multiply-nested layers of ControlPanel()'s - a lot simpler with HTML/CSS).

Yes, hoping so too.

Do we need to learn Spanish to use tabs.css? ;)
They does look a bit odd in the html code as there is no inherent support for tabs in html, but peek at the sample code for a while and I think you get the hang of it. There is probably a lot of "magic" happening inside jQueryUI. Perhaps similar can be achieved with a clever us of style sheets only? There is no lack of web based frameworks and techniques out there. Please investigate and share your best solutions so we can point skin developers in good ways forward.

From what I'm seeing, I gather that default values are all set within the form layout, so there's no SkinModel.java, correct?

You can still use a SkinModel if you like typed (not just all strings) defaults when running in a command line mode.

I'm loathe to wade into unreleased Java, but will the color selector support include the kinds of things we have now, like multiple chooser methods (HSV, HSL, RGB, etc.), and semi-transparency? And how about the current linked "color box and hex code" entries?

The color selector looks really fine. It has both HSV, HSL and RGB, but is actually missing semi transparency. This looks like a W3C standards limitation. Presenting hex values next to the selectors would also require some jQuery or JavaScript magic I take it. This is the downside with web technology: You get a default set of standardized components. If you want to extend that, they have to be rolled using JavaScript. With plain Java UIs (or JavaFX) UIs, both the standard and extended components are all Java objects.

Lots of unanswered questions, of course, like how to handle custom UI's - not just the simple "tab in Edit mode," like Gromit, but also the "entire popup tabbed window" like Matrix.

Bring them on :-)

Context-sensitive help?

Needs to be implemented with some JavaScript I guess. I hope we can work out our point developers to suitable JavaScript libraries for such things soon. Let's all work together on that.

Any idea what loading speed might be like? I was driven into a compiled UI in Matrix (thankfully - it's been much easier to manage than an interpreted onload.bsh) because the loading time was hitting the 30-second mark. It was painful. I'd hate to go backwards on that aspect of things.

Very relevant question. I assume loading speed will be really good actually. Although few things beats the performance of a Java UI, it's mostly up to how you code the JavaScript of a web based UI. JavaScript in itself, especially the dead fast "Nashorn" JavaScript engine Java 8 uses is orders of magnitudes faster than BeanShell. The WebView browser is based on WebKit and should have decent performance: http://stackoverflow.com/questions/10762979/performance-of-webview-in-javafx
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:03   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Let me know if there is any interaction with jAlbum you need in your web based skin's UIs. It's possible to add a bridge to the Java world for web based skin UIs too.
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:10   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Correction: I suspect Oracle is still using the JavaScript engine that comes with WebKit for the browser. At least according to http://sjhannah.com/blog/?p=404
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:22   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
It's good if you can do some performance testing. I've seen earlier (2014) reports on performance problems with the WebKit based browser used by Java's WebView browser but hoping/expecting that to have been addressed now
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:25   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
An advice. If you're happily coding your skin's UI using compiled Java+Swing, continue doing so. This move is mainly made to lower the entry barrier to skin development for those who don't know Java.
JeffTucker

Posts: 8,170
Registered: 31-Jan-2006
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 10:35   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
I would say that a skin like Minimal should be switched to this newer method (we can tinker with how to do it - when I see HTML tables being used for layout, I cringe a bit).

For those still using an interpreted onload.bsh, I think it's time to make a choice - if the skin settings panels are fairly simple, switch to ui.html, but if they're dense and complicated, bite the bullet and get the UI into compiled Java. Ultimately, probably no one should be using an interpreted onload.bsh - it's slow and miserable to debug.
AndreWolff

Posts: 1,116
Registered: 14-Dec-2007
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 11:51   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
AndreWolff wrote:
Will it also be possible to make a custom panel for an image in the explorer?

Sorry, didn't understand what you're after. Do you mean a html based image specific ui for the Edit view? It could be implemented, but those panels tend to be much simpler anyway.

I mean this link panel in the Slide Show 4 skin.
Can this be made as well?

Edited by: AndreWolff on 14-Aug-2016 08:45
RobM

Posts: 3,979
Registered: 4-Aug-2006
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 12:54   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
Let me know if there is any interaction with jAlbum you need in your web based skin's UIs. It's possible to add a bridge to the Java world for web based skin UIs too.
Getting and setting the user interface values, like rows, cols, page linking etc.
davidekholm

Posts: 3,764
Registered: 18-Oct-2002
Re: Web based skin user user interfaces
Posted: 13 Aug 16, 23:54   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
RobM wrote:
davidekholm wrote:
Let me know if there is any interaction with jAlbum you need in your web based skin's UIs. It's possible to add a bridge to the Java world for web based skin UIs too.
Getting and setting the user interface values, like rows, cols, page linking etc.

You can read those within init.js, do you need access to stuff like page linking, rows and cols in the skin's UI too? (suitable defaults can be set using hints.jap)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums