Fork me on GitHub
#hoplon
<
2016-10-17
>
onetom01:10:44

if you can release the hoplon master and i would be willing to test

onetom01:10:05

when you say it works with the latest boot-hoplon u mean 3.0.0-SNAPSHOT?

onetom01:10:46

i've seen some mention of hoplon alpha17 but cant see it on https://clojars.org/hoplon. was it just a theoretical release? 🙂

jumblerg01:10:41

@onetom: i’m using with 3.0.0-SNAPSHOT

jumblerg01:10:29

hoplon/ui objects, frames, images, and videos may be either sized implicitly by the value of their content, or set via the :fit attribute to :fill, :cover, or :contain. they all accept child elems that will appear in front of their content and are laid out just like any other element. any hoplon/ui elem can now accept children.

onetom02:10:41

@jumblerg thanks! this new fitting attr looks great. the :cover option just centers the original image?

jumblerg02:10:18

the media content is always centered in this implementation

jumblerg02:10:03

the children you can align however you like

flyboarder02:10:01

@onetom: build from master

flyboarder02:10:16

To get alpha 17

jjttjj04:10:11

@jumblerg new UI stuff looks great, I'll start trying it out in the morning! Btw i think I found a small bug: a really long "word"/string with no whitespace will break layout

(elem :s (r 1 1)
       (elem :sh (r 1 4)
             :br 1 :bc :black
             (apply str (repeat 100 "test")))

       
       (elem :sh (r 3 4)))

jjttjj04:10:22

seems to be fixable with

(bind-in! e [elems/mid .-style .-wordBreak]
               "break-all")
on the element, though I'm not 100% sure the best spot to put this in the library. I could try to come up with a PR tomorrow or open an issue if you want

jumblerg04:10:58

a pr would be awesome!

jjttjj04:10:51

cool, will work on one in the morning

jumblerg04:10:27

i was originally going to suggest that you not create 400 letter words. 🙂 but i guess there’s a case here we should support, which is some sort of :word-break attribute, with :normal, :break, and :keep values, maybe add it to the font middleware.

jumblerg04:10:14

there’s also the css word-wrap attribute we should look at

jjttjj04:10:22

cool, that'll be helpful. Yeah the 400 letter words are not something i usually enjoy haha but I was just kinda "stress testing" something which displays user input.

jjttjj04:10:50

I tried word-wrap and a few other newly discovered css properties, but i think word-break was the one that worked alone? But I'll put some time into understanding the properties and browser support, etc before submitting anything

jjttjj04:10:04

of course you can just have user code impose restrictions on the string size that is displayed, but peeking around at some facebook souce code i saw they they seem leave full, big word string without breaking layout, so i thought it might be good to have the option in ui 🙂

jumblerg04:10:32

yeah, i’m sure there will be a case from time to time where someone will want to display all of pi or something.

jumblerg04:10:48

or maybe some ascii art

adamfrey16:10:18

is there a way to get the index.html file generated by hoplon from my index.cljs.hlfile to have an absolute path instead of relative path for the script tag? Right now it generates a file with this tag:

<script type="text/javascript" src="index.html.js”>
and I want this:
<script type="text/javascript" src=“/index.html.js”>

adamfrey17:10:09

I think I can just avoid using the (page) form and supply my on html file

flyboarder18:10:15

@adamfrey: what are you using to host the HTML file that the path fails?

adamfrey18:10:15

in development mode I have a ring handler that serves index.html for all "/some-page" requests

adamfrey18:10:25

I’m using html5 push state

adamfrey18:10:44

but it fails if the page the user wants is /nested/thing

flyboarder18:10:21

So do you have multiple HTML pages to serve?

adamfrey19:10:45

no just one

alandipert20:10:37

@adamfrey another alternative is a little task you could write to do the string replace on that file

adamfrey20:10:17

yeah, I thought about that. I’ll try it when I get back to this task

micha20:10:29

i find that using hash fragments is far simpler than pushState

micha20:10:48

and i haven't run into a situation where it didn't work

micha20:10:04

pushState is a filthy kluge

adamfrey20:10:38

yeah, I see that. But business requirements, y’know...

shaun-mahood20:10:29

@adamfrey: Have you looked at pushy at all? https://github.com/kibu-australia/pushy Not sure it would help here, but maybe there's some ideas in how it works that you could use. Example of it in use at https://pupeno.com/2015/08/26/no-hashes-bidirectional-routing-in-re-frame-with-bidi-and-pushy/

adamfrey20:10:23

Yes I’m already using pushy, that handles the push state stuff. Alan’s suggestion of a small boot task that runs after the hoplon task works fine for me

shaun-mahood20:10:41

Oh good, glad you found something that worked.