https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    01/29/2023, 9:31 PM
    .. its explicit, maybe for js?
  • f

    full-journalist-82607

    01/29/2023, 9:32 PM
    Yeah, I don't think you can check the file path for normal (not node) js, so it should be an error in this case. But for other targets, it isn't the case
  • f

    full-journalist-82607

    01/29/2023, 9:39 PM
    The path for the save dialog is very recent, maybe this month ? So it was kind of coherent at the time. ( BTW totally forgot suddently about Value Exceptions and try //catch lol , I would have know why it made this error)
  • b

    bright-gpu-74537

    01/29/2023, 9:47 PM
    _fr.save(data, fileName);
  • b

    bright-gpu-74537

    01/29/2023, 9:47 PM
    if data is null the dialog doesnt show in openfl
  • b

    bright-gpu-74537

    01/29/2023, 9:48 PM
    maybe "browse" is the better function to call looking at the docs
  • b

    bright-gpu-74537

    01/29/2023, 9:49 PM
    browse works... but its an open file dialog, not save file dialog
  • r

    refined-laptop-39041

    01/29/2023, 9:53 PM
    How are you validating emails? Email is really hard to check for
  • b

    bright-gpu-74537

    01/29/2023, 9:53 PM
    regexp - but you can kinda do anything - this is all very initial stuff
  • f

    full-journalist-82607

    01/29/2023, 9:53 PM
    oh that's kind sad. I would have thought that I'm not the only one planning to use it like this.
  • a

    ambitious-knife-25690

    01/29/2023, 9:54 PM
    i usually do regexp, and if i really want to prevent issues i'll check the domain given as well
  • b

    bright-gpu-74537

    01/29/2023, 9:55 PM
    Copy code
    haxe
    class EmailValidator extends PatternValidator {
        public function new() {
            super();
            invalidMessage = "Invalid email address";
            pattern = ~/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
        }
    }
  • a

    ambitious-knife-25690

    01/29/2023, 9:55 PM
    i copy the really complicated regex from a SO 🤣
  • b

    bright-gpu-74537

    01/29/2023, 9:56 PM
    yeah, i grabbed that regexp from somewhere... prolly SO
  • f

    full-journalist-82607

    01/29/2023, 9:56 PM
    But it seems easy to change that in hxwidgets which was my original target
  • r

    refined-laptop-39041

    01/29/2023, 9:57 PM
    One of my favorite "fun facts" is that email addresses can have comments! ``logo@logomail.com(hello)`` and ``logo@(hello)logomail.com`` is the same as ``logo@logomail.com``
  • r

    refined-laptop-39041

    01/29/2023, 9:57 PM
    (not a real address)
  • f

    full-journalist-82607

    01/29/2023, 9:57 PM
    Doesn't seem correct extension can have more than 3 letters
  • b

    bright-gpu-74537

    01/29/2023, 9:58 PM
    sure, i have made zero checks at this point... i dont even need an email validator tbh... i just need something to test against
  • r

    refined-laptop-39041

    01/29/2023, 9:59 PM
    Ah k, just don't upstream it
  • f

    full-journalist-82607

    01/29/2023, 10:00 PM
    lol I understand, but it's warning so that nobody copies it 😉
  • b

    bright-gpu-74537

    01/29/2023, 10:00 PM
    well, it will almost certainly end up in there... maybe with some changes... or a totally new pattern... but im not really interested (currently) in the voracity of the check, just that it can be true / false really
  • b

    bright-gpu-74537

    01/29/2023, 10:01 PM
    alright, savefiledialog should be fixed now for hxwidgets... i think that throw was a copy paste from the openfl version...
  • r

    refined-laptop-39041

    01/29/2023, 10:02 PM
    I think the one perl uses is the best, but I don't think they actually use regex
  • r

    refined-laptop-39041

    01/29/2023, 10:02 PM
    There is a regex port somewhere though
  • r

    refined-laptop-39041

    01/29/2023, 10:02 PM
    https://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
  • r

    refined-laptop-39041

    01/29/2023, 10:02 PM
    This piece of art
  • b

    bright-gpu-74537

    01/29/2023, 10:02 PM
    right, ill make a mental not to check... it doesnt have to be regexp, or it can be regexp and "other things"...
  • b

    bright-gpu-74537

    01/29/2023, 10:02 PM
    jfc
  • f

    full-journalist-82607

    01/29/2023, 10:03 PM
    it seems to be ascii art
1...144414451446...1687Latest