« first day (2551 days earlier)      last day (2390 days later) » 

9:01 AM
@ShrekOverflow Didn't I do that here? var button = document.getElementById('playButton2').src = 'https://i.imgur.com/KOlHFBD.png';
var button = document.getElementById('playButton2').src = 'https://i.imgur.com/KOlHFBD.png';

Create Variable button
- Execute Document.getElementByID('playButton2')
- Of that value access .src
- Assign 'https://i.imgur.com/KOlHFBD.png' to .src
- Assign 'https://i.imgur.com/KOlHFBD.png' to button.
playButton2.style.background = 'linear-gradient( to right,transparent 83px,#e77d19 83px, #e77d19 86px, transparent 86px, transparent 174px, #e77d19 174px, #e77d19 177px, transparent 177px ), url(\'http://via.placeholder.com/266x266\')';
 
last chance
 
        var button = document.getElementById('playButton2').src = 'http://via.placeholder.com/266x266';
I assigned them to both, src and the button.
 
@svgcoding why are you doing this?
 
Unless I'm doing it wrong. So when you click on it it doesn't flicker.
@GNi33 preloading the image.
 
should work, but it's just confusing
and button will just be a string containing the image url
 
Ace
9:09 AM
he shoulda googled: "how to change image onClick for button"
woulda got better code he can just copy/paste
and not his 'onClick' code
 
It doesn't do the same thing as what this does: var button = document.getElementById('playButton2').src = 'http://via.placeholder.com/266x266';
 
I can't do this today
 
anyone good in puzzle/problem solving?
 
Ace
< me
@GNi33 lol
 
im kind of wondering what a good approach is for this problem: paste.ofcode.org/394KYnrBS2pk2vXQKQq9Cav
initially, when I heard it, I was just like "ow, I just make 2 models and map all the values and output the xml"
 
Ace
9:17 AM
a lot of logic
 
but more values will be added to the json object over time
and we dont want to change the code every time
 
@Wietlol I don't even see the problem
 
Ace
exactly, a lot of logic
 
That is just work to implement it. No thinking involved
 
@OliverSalzburg uhm... we need like a configuration that can be read out that provides simple tasks
such as "/foo/$1/val -> /root/values/value$1"
 
9:19 AM
So?
 
or w/e
 
@ShrekOverflow Are you still there?
 
@OliverSalzburg keep in mind that the example json and xml are only an example of one way of mapping the values
most values will be copied while retaining the tree structure
but its the ones that require some additional logic that are difficult
 
@ShrekOverflow If I knew what I was doing.
 
44
A: XSLT equivalent for JSON

Milo STry JOLT. It is a JSON to JSON transformation library written in Java. It was created specifically because we did not want to play the "JSON -> XML -> XSLT -> XML -> JSON" game, and using a template for any sufficiently complex transform is unmaintainable.

I like that last sentence
 
9:22 AM
@ShrekOverflow
fix'd
ugh ogh export colors fucked up
 
@OliverSalzburg i guess that would work
 
Ace
im tired..
my code is shit today
 
s/today//
 
@ShrekOverflow
 
@Wietlol Configuration based schema transformation in XML is classicaly done through XSLT
And it's a fucking pain from what I heard
 
9:25 AM
 Having issue with Android devices.
lobby-screen:99 Uncaught (in promise) DOMException: play() can only be initiated by a user gesture.

    $("body").on('click', '#notification', function(e) {
    			console.log(e.target);
    			e.target.play();
    		});

            window.Echo
                .channel(`client-claimed-${xsf.content}`)
    			.listen('.ClientHasbeenClaimed', (e) => {
    				$("#notification").click();
    				$("#client-lobby").addClass('hidden');
    				$("#txp-claimed").removeClass('hidden');
 
Luckily, I was spared so far in my life
@BasheerAhmedKharoti What's the relevance of the second paragraph?
 
@ShrekOverflow - Assign 'https://via.placeholder.com/266x266' to .src

That's this:
var button = document.getElementById('playButton2').src = 'https://via.placeholder.com/266x266';

- Assign 'https://via.placeholder.com/266x266' to button.

And that's this:
    playButton2.style.background = 'linear-gradient( to right,transparent 83px,#e77d19 83px, #e77d19 86px, transparent 86px, transparent 174px, #e77d19 174px, #e77d19 177px, transparent 177px ), url(\'https://via.placeholder.com/266x266\')';
 
@BasheerAhmedKharoti try to bind the click handler directly onto #notification
mobile browsers don't care about delegation in this case, they only see that the event is fired on body and block the play - event
 
@OliverSalzburg afaik, a pain is better than nothing
 
1 message moved to Trash can
@BasheerAhmedKharoti Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
9:29 AM
@GNi33 ah lemme try that
:39529722 Doesn't work either way

        lobby-screen:99 Uncaught (in promise) DOMException: play() can only be initiated by a user gesture.

    $('#notification').on('click', function(e) {
    			console.log(e.target);
    			e.target.play();
    		});
 
oh, know i see
$("#notification").click();
yeah, that won't work
otherwise this whole restriction would be bullshit, wouldn't it?
 
But there must be a work around for everything..!
 
for autoplaying videos?
maybe, probably not. I'll definitely not help you with it
 
Since I need notification sound to be played when socket receives any event..
 
@Wietlol Interesting thought :D
 
9:33 AM
ah, okay
hm, let me think. I think that is pretty restrictive in browsers
for a good reason
what we did the last time I used that stuff to make a "loading screen" with button. on the ontouch of that button we would show the UI and also preload the sounds (with play() and followed by a immediate pause)
afair I was able to play sounds afterwards. not sure
 
I've tried with hover over the body or with touch start but issue remains as is..
 
otherwise, I would just not have a notification sound
mobile browsers are designed to only let you play multimedia on direct user interaction
and, tbh, you don't really need a notification sound on a mobile website
it would probably only be executed when you have the tab open and the phone unlocked, so what good would it do?
 
@GNi33 yeah I agree but It's client requirement to be there...
 
haha, I knew that was coming
tell the client it's not possible and doesn't make sense
 
Well, When I play it once manually then It's just fine..!
 
9:38 AM
yeah, do that then
 
10:02 AM
how can I stop the propagation from onChange to onClick ?
I mean, different events
since event.stopPropagation only works for events of same type
 
@Neoares So use a second handler for the other type
 
I don't get it
 
@OliverSalzburg Hello, would you be able to help me with 1 part of my code?
 
hey he's helping me dude xD
J/K
 
@Neoares In your onChange handler, set a flag to discard the next click event. Then, in the onClick handler, discard the event
Or stop propagation or whatever
@svgcoding I don't see any code
 
10:07 AM
@svgcoding for future, Please ask your question without pinging random people. There is a notification sound and its quite .. annoying
 
what is annoying is that someone randomly pings you
not the sound itself
 
I need help with this part of the code specifically:             var button = document.getElementById('playButton2').src = 'https://via.placeholder.com/266x266';
 
@OliverSalzburg here you go
solve the code
 
@KamilSolecki ok, thank you for letting me know that.
 
@Neoares yeh, but the sound as Well :P
 
10:09 AM
@KamilSolecki well it is, but I have it muted
 
Ace
ima go to sleep
fts
 
@KamilSolecki You can turn that off
 
onclick="
            var button = document.getElementById('playButton2').src = 'https://via.placeholder.com/266x266';
    var button = document.getElementById('playButton2');
    var player = document.getElementById('player2');
      document.querySelector('#playButton2 .initial').style.display='none';
      document.querySelector('#playButton2 .pause').style.display='none';
      document.querySelector('#playButton2 .play').style.display='none';
    player.volume=1.0; if (player.paused) {
    playButton2.style.background = 'linear-gradient( to right,transparent 83px,#e77d19 83px, #e77d19 
 
@BenFortune Yeh i know, but there is people who have it on and random pings are never fun
 
10:10 AM
@OliverSalzburg yeah I thought about using a flag but... I don't really like it
I mean, I'd do it as a last resource
 
@Neoares Well, if you think about it. Internally, it would have to be implemented the same way
 
@svgcoding Why are you using inline JS for that?
That's fucking horrific
 
You want to discard an event that hasn't happened yet. So you have to remember to do that
Even if it was provided through a nice API
@svgcoding I don't see why that wouldn't work
Except that it's fucking insane
 
How would I get this part to work? var button = document.getElementById('playButton2').src = 'https://via.placeholder.com/266x266';
 
@svgcoding Starting with proper syntax would be a good start ;)
You are aware that you have two assignments in that line, right?
 
10:13 AM
@svgcoding Buttons don't have src
 
Do you want to store the result of assigning the src into button? Sounds weird
 
Not good weird, bad weird
 
@OliverSalzburg ok, but what if for some reason, in some browser, when I click the checkbox (the one that triggers onChange) it doesn't fire the onClick from the container div
I'll have a flag that will prevent the next container click
 
@MadaraUchiha They don't?
 
10:18 AM
@svgcoding Have you ever seen a <button src="something">
 
@svgcoding An img is not a button
 
@svgcoding it's gonna be stupid, isn't
 
@svgcoding that is still an image
 
10:22 AM
How can I get the "Email" word which is the value of the last <th> ? jsfiddle.net/0vzuoh20/1
 
How would I convert it to a button code so I can use it?
 
@Neoares Maybe you can do something with Rx
 
Reactive is super nice
 
Pipe both events into one stream, then throttle accordingly and only handle 1 event
So, include a huge lib for 1 use case to avoid using a flag
 
Can you show me how to do that?
 
10:24 AM
@KamilSolecki I agree, it's an excellent way to create autocomplete components.
 
You're speaking in code.
I don't know that whole language.
 
@MadaraUchiha yup, that has been my main use for it. Havent tried it in JS, but i guess its not much different
 
@Neoares What's the problem again?
 
It's like speaking a different language to me.
 
checkbox.addEventListener('click', e => e.stopPropagation());
checkbox.addEventListsner('change', e => { e.stopPropagation(); doStuff(); });
Or am I missing something
@svgcoding There are many ways to do it. I suggest you read up a bit on how the DOM works and how HTML elements work
MDN has some excellent articles on the matter.
 
10:28 AM
@OliverSalzburg Can you show me how to do this?
 
Dear god, he hasnt answered you twice, so Please get the hint.
 
But I don't understand what he's saying.
 
2 mins ago, by Madara Uchiha
@svgcoding There are many ways to do it. I suggest you read up a bit on how the DOM works and how HTML elements work
 
And I don't understand any of them: google.com/…
 
10:32 AM
I want to understand this way: Pipe both events into one stream, then throttle accordingly and only handle 1 event
So, include a huge lib for 1 use case to avoid using a flag
 
this is as basic and straight forward as this will get
 
I was looking at that before.
 
@svgcoding that wasnt meant for you, but for neoares
 
oh.
 
@svgcoding and have you actually read it?
 
10:34 AM
yea kindaa, but i don't think it'll work with my setup.
my code is different.
 
you want to preload an image, right?
of course it's different
coding is about underlying principles, paradigms, techniques and so on
 
So, I need one tailored for mine.
 
it definitely helps if you actually understand a technique you want to use
 
This one: Pipe both events into one stream, then throttle accordingly and only handle 1 event
So, include a huge lib for 1 use case to avoid using a flag
I want to try it and see if it works.
 
this has nothing to do with your problem
you have been told that 2 minutes ago
i can't dumb your "problem" down any more than this article does, so go read and understand that one
 
10:37 AM
oh, I thought he was saying that to me. my bad.
 
@MadaraUchiha stopPropagation stops the propagation of same event
AFAIK
so you can't stop an onClick event from the onChange handler
 
@Neoares why would you need to?
as you said, they're not the same event
 
> Prevents further propagation of the current event in the capturing and bubbling phases.
 
@Neoares That's why I bound 'click' as well
 
oh yeah
I've tried that
 
10:38 AM
Which way would work for my code? Any idea?
 
but didn't work, for some reason
 
Oh this is nice, cc @rlemon @ssube
 
@svgcoding you are not preloading the image
 
I'm not, then what am I doing?
 
so your problem is, that the image gets swapped, but you have a flicker, right?
 
@Neoares wat, fiddle?
 
@GNi33 I was told, an image change over.
 
read this and figure out what you are not doing in your script
 
yeah, click it again, I fucked up the link syntax
 
10:44 AM
@MadaraUchiha well, I made it
 
I thought I wasn't preloading?
 
exactly
 
I just moved the onClick={(e) => {e.stopPropagation()}} to the parent element
a small div wrapping the checkbox
 
But it specifically states, Preloading.
 
I guess it's because it is where you really click
idk xD it works
 
10:46 AM
Which is it?
 
var my_image = new Image();
my_image.src = 'someimage.jpg';
are you doing something like this anywhere in your code?
 
And these use src in them which you say don't work in button codes.
no.
 
so?
 
var button = new Image();
my_image.src = 'https://via.placeholder.com/266x266';
 
and what does this do now?
 
10:49 AM
I don't change anything else?
 
read.the.article
sorry guys, I'm not having the best of days. I can't do this today
 
This doesn't work the way it is:
var button = new Image();my_image.src = 'via.placeholder.com/266x266';
Can you confirm that it works in here? jsfiddle.net/mjnaaLk5
If you can do that, that would be great.
 
Is there any possible way I can put that inside the code itself?
 
10:57 AM
Can it be put in through the DOM attributes?
 
@ssube Pipeline operator is stage 2, it might outshadow the bind operator
sorry stage 1
 
hm
from "why would I want this" to "the chaining example does look nice"
 
Because I already knew that way, I wanted a different way.
i was told by a developer that it could be done.
 
Developers don't know shit
 
Would this work? someImageArray[0] = new Image();
someImageArray[0].src = "http://placehold.it/700x200/";
 
11:04 AM
@svgcoding you knew which way?
@svgcoding of course
 
@svgcoding why not
 
well , kinda
 
@Zirak wtf
 
I don't understand, am I doing something wrong? I'm working with a json object. I'm passing the "tags" field (an array) into a method and somewhere on the way, it's becoming undefined?
 
Who the fuck comes up with this shit? An operator for chained calls?
 
11:05 AM
pastebin.com/jdQjGaP2 (console log at the bottom)
 
@OliverSalzburg yeah
 
@OliverSalzburg it's more readable
 
Into the javascript part. new Image().src="'https://i.imgur.com/KOlHFBD.png\"
 
@Neoares How is introducing a new operator more readable?
 
@OliverSalzburg the usage of the operator makes the code more readable
the introduction of a new operator doesn't have nothing to do with readability
 
11:06 AM
@GNi33 Not the way you showed me.
 
@OliverSalzburg I don't know, I do like the example they give
 
and you're not force to use it
it's like the =>
 
@OliverSalzburg Have you read the entire readme?
 
@Neoares Well, I got that :P My point being, if you introduce a new concept into an existing system, it becomes less usable for everyone until they caught up. Until then, it's overcomplicating things that are already solved
 
I don't agree
 
11:07 AM
So nothing new should ever be introduced
 
@OliverSalzburg as I said, it's like the =>
 
Everything needs to stay the same
 
That's good. Who needs javascript when you have cobol?
 
@copy cool!
 
11:09 AM
Could someone help me with something? I'm passing an array into a function and when it's passed into the function, it's becoming undefined and idk why.
 
@HaniiPuppy who needs cobol when you have CPU instructions?
 
Firejail was worth a mention there, it's also a powerful tool
 
@Zirak That's an oversimplification. Of course new things can be introduced. But changing aspects of a language should really be worth it. I mean, people get pissed of when others write "u" instead of "you", but in your programming language, the same concept is suddenly the shit?
 
@OliverSalzburg Let's agree that I stop oversimplifying if you do
For instance, introducing a new calling semantic the same as shortening "you" to "u"
 
11:12 AM
People like chaining, but the problem with chaining right now is that you can't mix and match between libraries
So you're forced to monkeypatch or write wrappers
Among other things, this kind of operator creates a universal way of chaining otherwise unrelated functions.
 
@OliverSalzburg Can you copy the picture one for me?
The one in Google Books
I think that one might work
var picture = document.createElement("img");
picture.id= "xmark";
picture.src= "https://placehold.it/250x250";
picture.style.position = 'absolute';
picture.style.bottom = 100 + 'px';
picture.style.left = 100 + 'px';

document.getElementById("divmax").appendChild(picture);
yes / no?
 
@HaniiPuppy You aren't indexing data when you pass the tags into frequencyMeetsRequirement
 
@insert_name_here Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
What does dom stand for?
 
google it
stop vamping like crazy
 
11:26 AM
@svgcoding is that a quote from abbreviations.com ?
 
document object model
 
Document Object Model
 
Dirty Old Man
 
thanks.
 
np
 
11:27 AM
I've never looked that up before, lol
I had no idea
 
@MadaraUchiha If you use a popular cdn, it's probably already cached.
So..
 
> Daily Oral Math
yea... sure
 
When I run NPM install, it goes "npm ERR! enoent ENOENT: no such file or directory, rename 'E:\workspace_vscode_dev\node_modules\nyc\node_modules\amdefine' -> 'E:\workspace_vscode_dev\node_modules\nyc\node_modules\.amdefine.DELETE'
npm ERR! enoent This is related to npm not being able to find a file."
 
Daily Oral Meth
 
11:28 AM
how can I fix that?
and I checked, that amdefine folder is not there
I'm using npm v 5.4.2, node v6.11.4
 
cd project-root && rm -r ./node_modules && npm install
 
I'm on Windows. Is it equally valid to just delete the folder in my Vscode workspace and then run npm install?
 
yes
 
11:43 AM
> I'm on Windows.
little_pootis.exe has stopped running
 
@GNi33 Can you tell to me what I'm trying to do so I know how to properly explain it?
 
> I'm having problem with X. It would be helpful if you could tell me what my X problem is. Can you tell people what the problem I'm trying to solve is?
 
They're putting Carrie Fisher in the new Star Wars :(
 
@KendallFrey wut
the body?
 
CGI I would assume
 
11:51 AM
damn people from the afterlife, stealing our jobs
 
I got a bit of a chicken/egg issue with grunt and npm. Short version: our product runs build scripts in a separate folder. Is there a way I can have grunt-npm-install work in a folder without an npm installation so I don't have to first run npm install??
 
> Can you tell to me what I'm trying to do
wietlol.exe has stopped running
 
They'd probably be willing to give the role to someone who looks as dead as he
It's your chance to shine
 
Wouldn't be the first time they put a dead guy in a star wars movie
 
@Nzall put some salt on both, and they'll taste good
 
11:55 AM
Peter Willhuff or whatever the name is of the actor who played Grand Moff Tarkin
 
#Christopher
 
make sure to eat the oven up in case it's the chicken
and wash it with cold water! From the anus!
if it's the egg, start by heating the oil up in a pan
 
i'm not sure eating the oven is a good idea
 
@towc those cooking allegories are stupid as hell. I regret using the terms chicken/egg
 
@littlepootis you're not my supervisor!
 
11:56 AM
I want to run grunt-npm-install as the first part of my grunt script, but grunt doesn't seem to work if npm isn't initialized first. How do I get around that?
 
@Nzall I don't recommend it, but pepper's on the table
 
@towc I respect that reference
 
> uildGrunt:
[exec] grunt-cli: The grunt command line interface (v1.2.0)
[exec]
[exec] Fatal error: Unable to find local grunt.
[exec]
[exec] If you're seeing this message, grunt hasn't been installed locally to
[exec] your project. For more information about installing and configuring grunt,
[exec] please see the Getting Started guide:
[exec]
[exec] http://gruntjs.com/getting-started
[exec] Result: 99
That's the output of my ant command which starts grunt
 
I think the food should taste good without stuff added just to make it taste good. Ditch it otherwise
@Zirak she's lovely
 
Can you please give a straight answer to my problem instead of talking in vague and ambiguous cooking metaphors?
 
11:58 AM
@Nzall I don't use grunt, sorry
 
@Nzall have you read it?
 
I was genuinely talking about chickens and eggs
 
Google the error message
 
@Nzall The error message is pretty clear IMHO
 
or just read the error message
 
11:59 AM
there's a link and everything
 
@Zirak I know what the problem is. I'm trying to run Grunt in a folder that doesn't have NPM initialized
 
Sounds like something which can be fixed
 
I'm more wondering if there's a workaround which doesn't involve first running npm install in the folder
 

« first day (2551 days earlier)      last day (2390 days later) »