Re: [elm-discuss] How to do Context in 0.17 (passing in multiple Addesses to a view)

2016-07-27 Thread Peter Damoc
I like the Context record pattern. It's simple and can be extended. You can start with a context record and, if the view gets more general purpose you can slowly move to a signature similar to those found in Html components where you would make its fields optional. type alias Context msg = {

Re: [elm-discuss] How to do Context in 0.17 (passing in multiple Addesses to a view)

2016-07-27 Thread Noah Hall
This is what our accordion looks like in 0.17: https://gist.github.com/eeue56/d0a2f901dc2fe36ab4562940b7fd28e4 it was a +7 -11 diff :) Otherwise, you want `Html.App.map`. Make a component that has it's own "update" function, with it's own messages. Map them and pass the messages down from the

[elm-discuss] Re: Modifying the DOM with external JS libraries

2016-07-27 Thread Ian Mackenzie
In this particular case, if you're just using highlight.js to highlight a block of code, you might also be able to use evancz/elm-markdown (http://package.elm-lang.org/packages/evancz/elm-markdown/3.0.0/). You'll still need to load a version of highlight.js in your HTML as described by the

[elm-discuss] How to do Context in 0.17 (passing in multiple Addesses to a view)

2016-07-27 Thread Sean Clark Hess
For the app I'm working on, I would like to create some views that have no update function or message. In 0.16, you could pass in extra addresses to a view. The example in the elm architecture lumped them together in a Context parameter. I found this useful in 0.16 when creating very general

Re: [elm-discuss] Touch module in Elm 0.17

2016-07-27 Thread art yerkes
A proper expression of touch includes multiple touches that can come and go independently, along with extra parameters for each (pressure is one but velocity is another too). Neither was relevant to the things I was writing but it'd be awesome to see a touch API that exposes touch fully in a way

Re: [elm-discuss] Has elm reactor 0.17 dropped support for HTML files?

2016-07-27 Thread Steve Jones
Is there an issue to follow for this? On Tuesday, June 28, 2016 at 3:23:49 PM UTC-4, Evan wrote: > > Try the 0.17.1 beta > > On Tuesday, June 28, 2016, Stuart Axon > wrote: > >> Hi, >>I just started with elm and this is a bit confusing. - I guess I >> need a separate

Re: [elm-discuss] Touch module in Elm 0.17

2016-07-27 Thread OvermindDL1
As long as you have multiple pointer objects. Linux supports multiple simultaneous mice (no clue if browsers do) so there is precedent there. And touch's are basically multiple mice (although some interfaces expose a 'strength' or 'pressure' or so too to say how hard the person is touching).

Re: [elm-discuss] Parsing JSON — one more victim

2016-07-27 Thread Eduardo Cuducos
@Rex: I join this chant: nice trick this one on debugging — once more, thanks, Peter! (and, yes, this community os awesome!) @Peter: I've seem things that belong to the “public/common” such as a decentralized Twitter or Chicago transit timetable

Re: [elm-discuss] Touch module in Elm 0.17

2016-07-27 Thread Rex van der Spuy
On Tuesday, July 26, 2016 at 1:35:07 PM UTC-4, Janis Voigtländer wrote: > > I guess because it’s much less clear for it than for the other three > mentioned modules what the “final” API will look like. > Would it make sense to combine both mouse and touch into a single `pointer` object? --

Re: [elm-discuss] Parsing JSON — one more victim

2016-07-27 Thread Rex van der Spuy
On Tuesday, July 26, 2016 at 7:27:25 AM UTC-4, Eduardo Cuducos wrote: > > You could be very mean due to my typo. > This is the Elm Community, we don't do mean here :) I had a similar, infuriating JSON decoding bug due to a simple typo that took me hours to find ... argh! :) Peter, I didn't

[elm-discuss] Requests for comment: Chrome extensions can cause runtime exceptions

2016-07-27 Thread Gage Peterson
I've found the Elm.Main.fullscreen(). Can cause run time exceptions if a chrome extension decides to add a div to the body. We've been talking about various solutions such as either removing fullscreen altogether or possibly making it put a div inside of body instead of directly modifying it.

Re: [elm-discuss] Re: port module for JS interop.. without main/view ?

2016-07-27 Thread Jörg Winter
Do you think a correlating by Id is necessary ? If it is the simple case of having only 1 inbound and 1 outbound port in Elm and doing nothing async in Elm ... isn't a send/receive in JS basically synchronous ? A promise could still make sense but that Id would not be necessary. Some explanation

Re: [elm-discuss] Re: mounting and switching css stylesheets

2016-07-27 Thread Peter Damoc
I haven't bothered to check in Firefox and now I feel a little silly. Thank you kind stranger! On Wed, Jul 27, 2016 at 5:57 PM, OvermindDL1 wrote: > Yeah Chrome will reset CSS to the system default when style is changed. > I've not tried but maybe try to add the new one

[elm-discuss] Re: Modifying the DOM with external JS libraries

2016-07-27 Thread victor . noel
I think one of the main problem will be that Elm uses the virtualdom and so even if you modify the DOM, it could be reverted by the virtualdom on refresh (or something like that, I'm not an expert ^^). There exists alternatives to virtualdom (such as morphdom:

[elm-discuss] Form with union type

2016-07-27 Thread Simone Vittori
I'm building a language selector and I'd like to map the options to a union type. Here's what I tried: import Json.Decode exposing (Decoder, customDecoder, string) {-| Currently supported languages. -} type Language = English | Japanese {-| A JSON decoder of Language. -}

[elm-discuss] Re: Modifying the DOM with external JS libraries

2016-07-27 Thread OvermindDL1
The call cycle seems to be: 0. main 1. init 2. subscribe 3. view (subscribe and view might be the other way, does not matter) 4. loop when receive msg 1. receive msg -> update 2. subscribe 3. view So instead of calling on init instead make a new Msg specifically for sending the command to

[elm-discuss] Modifying the DOM with external JS libraries

2016-07-27 Thread Marco Perone
Hello everybody, I am building an application in Elm and I need to call an external JS library that interacts directly with the DOM (in my case, highlights a section). I built a port to communicate from Elm to Javascript and, on the Javascript side, I'd like to call my external library as

Re: [elm-discuss] textarea selection

2016-07-27 Thread OvermindDL1
Correction, does not seem to work, I cannot find a way to access the textarea element from the button callback... On Wednesday, July 27, 2016 at 8:37:05 AM UTC-6, OvermindDL1 wrote: > > I already use custom 'on' things to override default propagation (more > interaction with the legacy

[elm-discuss] Re: mounting and switching css stylesheets

2016-07-27 Thread OvermindDL1
Yeah Chrome will reset CSS to the system default when style is changed. I've not tried but maybe try to add the new one after the old, then remove the old only after it is added (and you wait like 50ms after too to let the page re-process the new styles)? On Wednesday, July 27, 2016 at

[elm-discuss] mounting and switching css stylesheets

2016-07-27 Thread Peter Damoc
Context: - a single page app with multiple virtual pages. - each page contributes a list of styles that is added to a list of common styles and is compiled into a stylesheet that is mounted in a Html.node "style". Main problem: - I'm seeing flickering when the style node changes. Secondary

Re: [elm-discuss] textarea selection

2016-07-27 Thread OvermindDL1
I already use custom 'on' things to override default propagation (more interaction with the legacy javascript that I am stopping in this case), but you just gave me a fantastic idea... I might be able to get rid of my `surroundSelectionWith` javascript port... On Wednesday, July 27, 2016 at

[elm-discuss] Incosistent Port subscription

2016-07-27 Thread Zeljko Nesic
Hi, I have run to weird issue regarding sending data to port. *Background* I am working on Angular app, that I want piece by piece replace with Elm. During the transition, ports are really important, so I can communicate data back and fourth. Now I have some Angular directive [basically a

[elm-discuss] Re: iframe performance

2016-07-27 Thread Nils Eriksson
It's pretty laggy -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit

Re: [elm-discuss] Re: Trying to understand the community overlap between Elm and Elixir

2016-07-27 Thread John Orford
> Elm on the backend is ultimately the way to go. A little tangential - have you seen this? http://noisycode.com/blog/2016/06/27/introducing-mlfe/ On Mon, 18 Jul 2016 at 18:15 Rex van der Spuy wrote: > > >> Can someone help clarify why Elixir is appealing to Elm

Re: [elm-discuss] textarea selection

2016-07-27 Thread Atamert Ölçgen
Have you tried this: http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Events#on On Tue, Jul 26, 2016 at 11:02 PM, OvermindDL1 wrote: > When a user clicks a button I am needing to take the text that is > currently *selected* in a textarea and surround it with