This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Pages: 1 - Last Post: 06-Aug-2017 12:08 Last Post By: jGromit Threads: [ Previous | Next ]
jGromit

Posts: 32,939
Registered: 01/31/06
Custom embed.htt
Posted: 20-Sep-2011 14:39
 
  Click to reply to this thread Reply
Just fiddling with a skin-specific embed.htt, and ran into some questions. A quick example:
<%
if(!embedURL.equals("")) albumURL = embedURL;
albumWidth = minPageWidth;
albumHeight = (int)(minPageWidth * 0.66);
%>
<iframe src="${albumURL}" frameborder="0" style="height:${albumHeight}px; width:${albumWidth}px;"></iframe>
The embedURL variable would be something the user can enter in the skin's settings - if he leaves it blank, he gets the jalbum.net address for the album.

The minPageWidth is computed by the skin upon album creation, and it inserts itself properly into the embed code. But two issues:

  • The height and width fields in the Album > Embed user interface still show the jAlbum default values. Not a big deal.
  • If the user enters his own height and width values in the Album > Embed user interface fields and hits Update, the entries are ignored. As a user, of course, that's not what I would expect to have happen.

What would the code in embed.htt need to look like to get around these issues (particularly the second)?

(BTW, it's almost spooky - my routine doesn't compute minPageWidth until init.bsh gets executed, yet the embed.htt is picking up a new value even if I haven't hit "Make Album." Very slick.)
davidekholm

Posts: 21,299
Registered: 10/18/02
Re: Custom embed.htt
Posted: 20-Sep-2011 16:27   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Cool that you're already playing with it! :-). I figure, the embed.htt support will need some polishing before it's perfect, but I felt it was cool enough for an initial release.

If you skin likes different values for albumWidth and albumHeight, just set your custom values for those values in hints.jap. You can also play with manipulating engine.setAlbumWidth() and engine.setAlbumHeight() during album building so the suggested embed size matches how the album is made.

Are user changes to albumWidth and albumHeight ignored? I can't reproduce that. It works fine here when I modify those fields and hit update.

I can explain the final magic you were stunned by: When generating the embed code, jAlbum actually does the same initial processing as when an album is made, but it forks off before starting to process index pages for folders and scaling images, so system/init.bsh and skinDir/init.bsh are processed again.
jGromit

Posts: 32,939
Registered: 01/31/06
Re: Custom embed.htt
Posted: 20-Sep-2011 17:44   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
If you skin likes different values for albumWidth and albumHeight, just set your custom values for those values in hints.jap.

Can't do that - the values depend on the options chosen in the skin settings.

You can also play with manipulating engine.setAlbumWidth() and engine.setAlbumHeight() during album building so the suggested embed size matches how the album is made.

No joy. I get the same result - the embed code actually does pick up the values (setting them in init.bsh rather than in embed.htt), but the windows in the UI still show the default values. If you call Album > Embed again, it finally shows the computed values in the UI. But when doing an Update, user-entered values are ignored (because, of course, it's processing init.bsh again, and grabbing the computed values).

Are user changes to albumWidth and albumHeight ignored? I can't reproduce that. It works fine here when I modify those fields and hit update.

If there's no custom embed.htt and/or no engine.setAlbumWidth() in the init.bsh, it works. But with my custom version, the user can't change the values.

I can explain the final magic you were stunned by: When generating the embed code, jAlbum actually does the same initial processing as when an album is made, but it forks off before starting to process index pages for folders and scaling images, so system/init.bsh and skinDir/init.bsh are processed again.

That also explains why Album > Embed doesn't come back instantly - there's a little progress spinner. With a humongous init.bsh like mine, that initial processing takes it a few seconds.
davidekholm

Posts: 21,299
Registered: 10/18/02
Re: Custom embed.htt
Posted: 20-Sep-2011 18:09   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I'll dig more into this soon, just want to explain the main reason for the spinner: jAlbum actually doesn't store the albumURL with the album project (stupid, we should change that) so it instead searches for the album online. That's what takes up the bulk of the time.
jGromit

Posts: 32,939
Registered: 01/31/06
Re: Custom embed.htt
Posted: 06-Aug-2017 12:08   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
These problems should not be fixed. Instead, the Embed album option should be eliminated.

https://jalbum.net/forum/thread.jspa?threadID=52967

That's one way to get things off my "bug list!"
Legend
Forum admins
Helpful Answer
Correct Answer

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