« first day (3036 days earlier)      last day (2137 days later) » 
00:00 - 22:0022:00 - 00:00

00:01
Any idea why the search bar is so small in width
@ex080 wish i did
@dougdimmadome Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
you can set a fixed width on it but not sure why it's so small in a desktop view
00:46
@ex080 The sandbox you posted doesnt really work so I cant tell for sure
But you probably forgot to set flex grow on the search bar's container or the width on the search bar itself
would be my guess
01:19
Ahh ok
let me try again
changing flexgrow to 1 fixed my issue
Thanks Meredith
 
2 hours later…
03:04
Agree with their decision, other browsers will probably follow. Was a failure.
 
2 hours later…
04:59
@MadaraUchiha let's say you have a billion users is it practical to maintain a websockets connection to all of them?
I know websockets are cheaper than http. And at the core of websockets is TCP which is destination ip and source ip. Is that enough for it to be scales in this fashion
05:17
Scaled*
user8444404
06:13
0
Q: Dragging one image makes other image to drag

vickey colorsWhen i drag the right part of uploaded image in mask1 , than uploaded image in mask2 is dragging, but that should't happen.... Here is video link Also if i upload image only in mask 1 and try to drag, the image will disappear , but if i upload images in both masks, than image will not disappear...

@vickeycolors Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
user8444404
Thanks @CapricaSix
07:11
When I need to shorten the length of my program, I roll dice and then pick some lines at random to remove. That usually works for me. — Neil 49 secs ago
what is with this guy?
user8444404
07:45
0
Q: Users can drag the image by dragging outside the mask image

vickey colorsRequirement : User should be able to Drag the uploaded image only by dragging inside the mask.... Its working fine.... Issue : But along with inside, user can able to drag the image by dragging outside the mask image.... Here is video link https://codepen.io/kidsdial/pen/YBEjym <div class="...

07:55
@Rick At the end of the day your IO is limited, you can add more servers, or make your servers stronger, but a billion anything is a big load.
Wax
Wax
08:15
In JS, I have several fields in my angular template where I will show a couple of texts, these text have their own respective properties in an object. obj.data.nameText for example. My templte has several of these. My question is how do I code this in a way where it won't produce errors for accessing non-existing parameters incase of having an undefined object (i.e, not able to retrieve from backend)
 
1 hour later…
user6718998
09:22
is there anyway to declare this in one line: let tmpData = [];
let tmpArr = []; ?
user6718998
For example let tmpData=tmpArr = [] wont work
09:36
let tmpData=[], tmpArr=tmpData
let tmpData = [], tmpArr = []
@Wax _.get?
howdy
10:21
Hey,
got a question about adding a key to an existing object.
I'm adding this this way: submit.attributes.keyword = x.keyword;
By console.log on submit i see my key. If i try to access it, it is undefined and Object.keys also just list the previous existing keys... can somebody help ?
I'm really confused about this behaviour and can't understand why my key is not existing even if console.log sends it to me with the correct key / value
Adding the key like: submit.keyword = x.keyword; is working fine
10:44
It's on the prototype
The prototype chain isn't symmetrical @Traxstar, probably submit.attributes is on its prototype
@BenjaminGruenbaum so what would be the right way to get the value in that place ?
I struggled with this the other day @Traxstar, here's my solution
submit['keyword'] = x.keyword;
@Maartenw i have tested this as well and it is not working
hm
What I did was map the new keys then reduce them and return the new object @Traxstar
11:49
Create a jsfiddle illustrating your issue
12:27
I got a question about a webpack setup that works not fully. And I am asking myself if this question would be too wide open for stackoverflow?
@alpham8 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
user6718998
13:05
Hi I have this object which contains a reducer: started: tmpArr.reduce((min, item) => (item.timestamp < min ? item.timestamp : min), tmpArr[0].timestamp), I want this reducer to execute only if each item of tmpArr contains author='user'. How is this achievable ?
guys, I had a weird request by my client -- I need to obfuscate the source code to be delivered -- is there way I can do this ? :o
@Thewise writing code like that, you might want to change your name to the "not so wise". you are going to want to check for the value for(let i=0;i<tempArray.length;i++){ if(tempArr[i] ==='user'){ // put your monstrosity here. } }
user6718998
@RICk
user6718998
onyl problem is cannot iterrate
user6718998
im inside another object
13:18
why not
O you don't know how to.
user6718998
yea
@Thewise so don't make it an implicit return
or .filter.map
Also I feel that your reduce is not reducing anything, a map seems more appropriate
14:00
Hey guys, would somebody be kind enough to explain me this pls =) ?
0
Q: Why is Bootstrap Js not working in my template?

BaldrániThis is a question about how does it works more than how to fix it. I realy like to understand this. So I'm working on a VueJS/Symfony project. And one of the thing I want to do is to use the bootstrap js component like collapse for exemple. I do import bootstrap within my app and check if it i...

@Baldráni why can't you use that library? too much refactoring?
In my experience, when it seems like you're swimming against the current, it's because you usually are :P
Don't do that. Try to make it work using the libraries, even if you need to refactor your code to do it
The project is way to big and this is not in my hand to decide this
Its a company big project
But what does this librry do that I can't reproduce for my specific case ?
to elaborate on Neil's point your probably missing dependencies/ not loading things in the correct order/ missing edge cases etc..
@MoshMage did you try googling?
are you sure they meant the source code?
what kind of application is it?
my guess is they meant an obfuscation on top of the source code, to be delivered
I can't imagine why a company would internally only want obfuscated code, if they weren't doing something horribly sketchy
@Rick Sinci it works If I only use <script> tags I don't see why it should not work using attribute ?
14:18
I'm only elaborating on Neil's point.
I'm not that familiar with Vue honestly, but it just seems like you're trying to go with an unconventional path
@MoshMage uglifier
14:35
Hiyya
So I'm currently using WordPress to create a website, and i'm currently using a Media Grid
Above this grid are a few buttons that should filter the grid, and while I have the logic there, I can't seem to get the images of the grid via jQuery
The grid has a class-name, and about 6 "children" down, are X amount of images, and I need the src attribute of these images to compare them to which button has been selected
@Cereal emphasis on "the source code"
What exactly do you think minified code minifies?
jQuery(".gallery img").each(function() { // code }); is what I'm using to try to find each *img* in the *gallery* , but it doesn't seem to be working at all. Any and all ideas would be appreciated!
I have also tried using jQuery(".gallery").find("img").each(function() { // code }); but to no avail
JavaScript or jQuery replies can both be accepted but I don't know much of other frameworks
dynamic content
likely.
Ah yes, that's a point. The content does load in dynamically, and I tried checking for both the .gallery and document to load but with no success either
14:41
because you need to run the code after the content is loaded into the DOM
not arbitrarily at any point.
Yep, I got that much
so where ever the content is loaded in, run your code after.
But isn't that achieved by something like jQuery(document).on("load".. ) ?
no
that's the page load
Or .on("ready")?
I see
14:42
assuming you use jQuery to load in the dynamic content, just run the other code in the success or always method
Jay
Jay
you can do what you're trying with the on() function, I was chasing this exact rabbit the other day
no
he wants to loop shit
Well, I want to check what the URL is, and if the URL contains a keyword, I want to check it against the loaded images. If the images contains the same keyword, it should load it in. Else, it should hide it.
yes I get that.
Yep, just wanted to make sure
14:44
but you need to check the code at the appropriate time
Jay
Jay
right
this explanation helped me: learn.jquery.com/events/event-delegation
That said, if i do get it running, would jQuery("gallery img") or jQuery("gallery").find("img") be better?
I'd want to say the latter but i'm not entirely sure
doesn't matter.
Okay
former does less ops
but it's moot
$.get(url, newHTMLData => {
  // here is where you want to parse the new HTML to see the image srcs. before or after you append it to the DOM doesn't make a difference for it working. just how you wanna make the UI pop
});
Jay
Jay
14:47
there's a subtle difference in the select I was using and the one they suggest in that link so that it includes anything that got added dynamically after the fact
you gotta do this in your ajax method, or after.
Problem with Wordpress, you basically know where nothing is
Compared to projects created from scratch
well, the content comes from somewhere.
It does
you should probably know where
and that's where you do this.
const srcs = $(newHTML).find('img').map( (i,{src}) => src );
Jay
Jay
14:50
I've never used Wordpress, but when I'm having trouble finding something on the page I've gotten in the habit of doing a .css("border", "thin solid red"); or something along those lines starting with the element that gets clicked and working my way outward
he can find what's initiating the network request on the network tab.
@Cereal maybe what they want is for the only code available to anyone to be the obfuscated version
How is it called when you add a 's to a name/noun to indicate belonging?
I'm trying to name the function that will do it
or for it to be manually obfuscated, so you can't run another algorithm to mostly unobfuscate it
> userName's portfolio has XYZ success rate
14:54
sasson genitive, I think
in italy, they taught it to us as "genitivo sassone"
@rlemon Just checked some things up and I'm now telling the script to load in the footer, rather than header. Didn't change anything though
@MadaraUchiha plural possessive
@rlemon That's the one, thanks
@Xariez no because you are not understanding the problem
page load !== dynamic content
Right
14:55
footer satisfies page load perceived performance.
you're loading in content after all of the initial page code has run
so do what I've said
But I still don't see how you're going to know, in jQuery, when dynamic content from PHP has loaded in
find the ajax function, and add your code to the success
Jay
Jay
@Xariez you can't select something that doesn't exist
That I know
That's pretty, you know, basic
@Xariez Javascript has to be the one taking that data and putting it on the page.
so at some point you have JS code taking that data from the server and putting it on the page. you don't know when that happens because you have to wait for the server. Which is why we have callbacks (and I guess events)
but in your case you need to find where this call is happening
and put your code in the success function, where the data is received.
dunno how else I can make this any more clear.
14:58
Alright, fair enough
At least I just found the file that connects to the database
Now to find out where that file is used in it's turn
15:42
@rlemon You don't have to do this. You could do what the "senior engineer" at my last job is and just literally echo a JSON string of data into the page the server responds with. :D
so the client sees strings of raw json output?
NOpe. The base page would be rendered by PHP, sent back to the browser, then the JS would use a variable that PHP put there.
so then it's not dynamic content.
the page is loaded with the content available.
like a mock endpoint that returns static json?
<?php echo "<script>var data=\"$data\"</script>"; ?>
It was a joke. Please don't do it.
15:45
make sure to echo GET params too
I am evaluating this today: github.com/loedeman/AutoMapper
@ansielf WTF?
It's AutoMapper from C#, ported to JavaScript.
I know what it is. Why on Earth would you do that?
I'm not sure yet, that's why I am evaluating it. Object mapping in JS is normally pretty easy, but I like the syntactic sugar of AutoMapper.
15:53
ick
Ick x2.
I can't think of a place I ever map anything other than from a DB to an object or a request to an object. In the case of the DB you definitely don't want to map the resulting type to another type...ever. In the case of the input you have to validate it first anyway and it's trivial to write a mapper.
I was thinking micro-services in nodejs. AutoMapper provides some cool ways to write conversion () => {} mappings.
16:26
hi
ew
user1596138
hi
ew
user1596138
16:47
@MadaraUchiha What do u say of this site design lbr.co.il? Been done by some css expert in my office and every body is going crazy over it's resposiveness O.o
missed the first one because I didn't understand what it was about, and 3 hard ones because I discovered left/right do stuff and right after mixed up shift and enter. Then I think I got another hard one wrong because I was wrong
user1596138
Oh nice, didn't know it gave a final score and all
user1596138
I was surprised by how utterly terrible my non-tech buddys did
user1596138
I guess they don't stare at screens all day like us tho so meh
fail
user1596138
17:00
What did you get Kevin Bacon?
not gonna do that during work
user1596138
@BenBeri There are so many transitions my computer is struggling.
user1596138
user1596138
Also ran into that transition between media queries haha. But it is a nice site
user1596138
@KevinB Yea I didn't complete it... Or I'd have seen the scoring. I did like 4
17:05
@Jhawins what's yours?
user1596138
I didn't complete it the first time I only did a few and now I know them so it wouldn't be fair
I wanna see anyway :P
did you get to the hard zone?
I didn't see that, but I assume it was something about something being hard
17:24
Great UI guys
(New Azure UI)
user1596138
Looks simple enough.
the circles are so off-center
I dunno, my issue is that for all of them the Off option is on the right except for the last one
oh lol
didn't even notice
@MadaraUchiha "radio buttons proudly made in MS Paint"
17:47
Artisan radio buttons
they're not all off by the same amount either
I'm with Kendall. That makes them "artisan"
can you ping me less?
18:05
@MadaraUchiha Joe went on holidays before finishing the page, so Larry stepped up
@KendallFrey ohh you reminded me to order some artisan fire wood
uhhh what
18:20
how come when you do browser modules, whatover you import is always a const, even if you export it as var or let?
imports are always live read-only views of the exported object.
but you can't reassign them
but you can modify them
read-only doesn't mean you can't modify it.
in JS
usually it just means you can't change the reference to the object
19:14
anyone use mocha and sinon?
user1596138
19:39
Why u guys star my jQuery
new people treat stars like upvotes
if you answered someone with that code, they starred you to thank you
user1596138
Haha I forgot about that
20:01
why
0
Q: Will using JQuery to save data to localStorage cause separate users' actions on a web app to interfere?

splindoI am making a web app to display on multiple parts of a building. I have a table displaying people in the building, but I have to separate it by sections of the building (such as a table for 1st floor, table for basement, etc.). I plan on doing a razor dropdown box of the building locations and ...

hah, someone actually took my sarcastic comment and turned it into an answer
user1596138
"took" is a huge stretch
20:35
0
Q: How to correctly setup Webpack 4 for use with Vue 2, TypeScript, SCSS, Babel, minifying and compression?

alpham8I am playing a bit around with Webpack 4, since I need an ES6 module loader and an assets compiler. However, Grunt and SystemJS seems not to do the trick for me. I already asked the project owner, but it's hard for a not in-depth frontend developer to understand it. First of all I found this tuto...

20:51
implementing a version of dhcp in javascript wasn't as easy as I initially thought lol
user1596138
Just wat
user1596138
looks --- you don't even have a vue-loader! I like single file components... then you can specify ts in the <script lang="ts"> tag and have it picked up in webpack by ts-loader probably ... how to achieve this is beyond me throwing out answers — Cody G. 23 mins ago
user1596138
This comment. Jeez
@Jhawins "You need at least n jiggawatts if you plan to use the type 77 flux capacitor at n kilonauts"
that is literally how I read that
not because I don't understand what he is talking about, but because of how he intentionally phrased it
user1596138
21:12
Hha yeah super weird
user1596138
He has a competent looking profile too
user1596138
Idk wtaf he is talking about using a script tag with lang="ts"...... To "have it picked up in webpack by ts-loader"
"i like single file components" is what the lang=ts is referring to
which... seems somewhat irrelevant to the question asked
but meh, i don't like the question anyway
Your flux capacitor has to have a jiggawatt filter to convert the ts-jiggawatts to standard jiggawatts with a standard deviation calculator powered by the capacitator module
I think someone needs to come up with a standard to communicate every day coding concepts in sci-fi lingo. If for nothing else than to see it in job descriptions.
user1596138
Are you high
21:18
no, but I just solved a really complex problem and I'm feeling pretty good right now lol
user1596138
@DavidKamer Sweetwater uses weird Star Wars refs and stuff in their listings lol. Jawwascript
user1596138
Cringe if you ask me.
yeah no thanks lol.
I mean some real generic shit that isn't dorky but just really annoying to take seriously.
Like Rick and Morty level sci-fi where you just take some really over-used shtick from b movies
Is there a router out there, that is not tightly coupled with a specific library (i.e. not react-router and the likes), that allows me to give IDs to my routes, and generate them back through that ID?
const router = new Router([
  {id: 'foo', pattern: '/foo/:param', onEnter: () => doTheThing()},
  // ...
]);

router.url('foo', {param: 'bar'}); // returns '/foo/bar'
Does that exist, or am I going to have to implement one?
How do you flat map a 2d array in typescript?
21:27
@MadaraUchiha Like this or not like this at all? github.com/krasimir/navigo
And then you have the DIY solution this guy wrote a blog about: krasimirtsonev.com/blog/article/…
@JonathanSolorzano Same way as in JS
@DavidKamer Yes, that's a good candidate, thanks for that!
@JonathanSolorzano [].flatMap() is a thing now
I'm fairly sure TS already has support for it
ts still doesn't support flatMap()
My test says forEach+push is the fastest
Your test is meaningless, and I haven't even read it.
Don't try to prematurely optimize, especially not in a self-optimizing environment like a modern JS engine.
@JonathanSolorzano You can always add the definition yourself.
21:35
when you need 50ops to succeed

and the perf says one is doing it at 8000 ops very pretty

and the other at 80000 ops and very ugly..
Really
This answer implies otherwise
@JonathanSolorzano Are you sure?
user1596138
Man Chrome popup blocker is so screwed up in this new version...
user1596138
Like half the time I hold a link too long before releasing and it gets popup blocked
user1596138
This is going to cause bugs...
user1596138
21:44
2 mins ago, by Madara Uchiha
This answer implies otherwise
user1596138
Just happened again clicking this
how long do you have to hold it?
just held down for 10 seconds and it worked just fine
@KevinB At least 7
user1596138
It's very sporadic
@Jhawins I've made a proof-of-concept move to Firefox recently, and I think I'm not going back.
user1596138
21:45
I can't ever get it to happen twice. But it's happeneed easily a dozen times today for me on real anchor tag links
user1596138
@MadaraUchiha Sorry for your loss.
I've moved back to firefox on my phone, but not yet the pc browser
screw that
user1596138
Y tho
It works, it's got all the features/extensions I want, its devtools are not half bad either
21:46
it isn't chrome
user1596138
The devtools are shit lol
@Jhawins Myself because Chrome and Chromium became too invasive for my tastes
I'm way too comfortable with chrome to use anything else day to day
user1596138
I'd be fine with FF if not for their whole BS rebrand
The recent proposed change to the content blocking extension API is going to kill adblockers if it's not amended
user1596138
21:47
They made everything look like shit and then said "We care about you" LOL
user1596138
As if
And I'm basically sick of Google's bullshit with it.
user1596138
FF just seems like a bastard child to me. I'd sooner use Opera at this point... Funny how it was THE developer's browser for a long time
user1596138
@MadaraUchiha What's a good example of such invasiveness?
@Jhawins It literally tracks and phones home everywhere you browse
A good indication is that when you open links in Google services in chrome, they aren't tracking URLs, but they are in every other browser.
user1596138
21:50
You didn't avoid that by switching tho
@Jhawins Sure I did, I switched to a browser that doesn't send Google my entire browsing history and state
user1596138
Mozilla may be giving out free koolaid about their pro-privacy stance but I don't drink koolaid
Not inside of Google services, of course, but I don't mind first-party tracking
user1596138
Also the prevalence of Google Analytics
@Jhawins uBlock Origin
The request for GA doesn't even leave the browser.
user1596138
21:51
@MadaraUchiha Just as easily done in Chrome lol
user1596138
Right..?
@Jhawins Except that a. the browser itself tracks you anyway and b. they're about to modify the content blocking extension API, which would kill uBlock Origin and the likes and only leave ABP alive
There's still a chance that b. would be averted, mind you.
The discussion on it, last I checked, was still ongoing
They also removed backspace going back, screw that i'm goin to firefox
user1596138
@MadaraUchiha There will always be an equivalent.
user1596138
No sense fear mongering over a single policy
21:54
@Jhawins No, there will not be.
user1596138
That isn't even implemented...
user1596138
Agree to disagree. Today there is.
If the browser itself doesn't let you block requests in an extension, you can't make a content-blocking extension...
You can, at best, hide stuff from the DOM, which is essentially what ABP does
user1596138
Userscripts, etc. Custom flags.
@Jhawins Userscripts can't block requests
user1596138
21:55
Maybe it's not as simple as "Install extension"... By no means would it be impossible, you should know that hah
Custom flags? maybe, if they enable it
user1596138
Chromium is open source, also. You mentioned Chromium specifically.
user1596138
But yea, good luck with FF. Let us know if the devtools become useable
I'm guessing you also frown upon opera?
because chromium?
@Jhawins Indeed, the proposed change is on the Chromium project, not on Chrome
user1596138
21:55
Fork.
You fork.
user1596138
insert-easy-button-sound-clip
user1596138
I'm just a cynic. I don't think anyone has your interests in mind when it comes to privacy and tech firms, honestly. When they start preaching about it that sets off all my gaydars
You can't seriously suggest forking, building, and distributing (I have multiple machines) my own custom version of Chromium to be a valid alternative to just switching to a browser that doesn't overtly treat its users as products to be milked
user1596138
@MadaraUchiha I adamantly disagree with the ending statement, which kind of nullifies any response I might have.
user1596138
21:58
They don't milk you because they're treading water atm lol
it's not like mozilla is controversy-free
Nothing is controversy-free
user1596138
This chat is
But Google, in recent years, became seriously evil. Old Microsoft evil.
Now, they provide services for that evilness, so I can accept some (most?) of the things they do
00:00 - 22:0022:00 - 00:00

« first day (3036 days earlier)      last day (2137 days later) »