« first day (3344 days earlier)      last day (1598 days later) » 

4:05 PM
eh
i assume you're trying to do more than the built-in confirm() function?
 
Jay
no I'm trying to use confirm()
but I'm not seeing anything about it in the documentation
 
ah
well, confirm works just like alert
|| mdn confirm
 
it's synchronous, so you don't have to worry with any callbacks or promises
 
Jay
okay so if I do
 
4:17 PM
How do I edit a shadowDom
created using attachShadow({mode: 'open'});
Couldnt find any info on it within google
Using a class with multiple methods editing a single element
so I need to use the same shadow instance more than once
but you cant attach a shadow node more than once on the same element :L
 
|| mdn attachshadow
 
|| mdn shadowroot
 
Hmm seems most of the #Shadow Root is readonly, however, I can += InnerHTML elements
I can work with that..
 
4:23 PM
1 message moved to Trash can
@Jay Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@Jay Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
$(".linkbuttonclass").click(function () {
  if (confirm("Do you really want to delete this line?")) {
    // code here executes if they click Ok?
  }
});
 
Jay
wow, okay then
 
Ignore the bot
it can be a pain in the ass
 
that is the correct syntax
 
Jay
I clicked fixedfont and got yelled at to hit Ctrl+K
so I tried again and clicked Ctrl+K and got yelled at again
 
4:25 PM
Yeah, you have to Ctrl+k to format your code before uploading it
 
more than likely, it was already indented with 4 spaces before you did ctrl+k
and doing ctrl+k unindented it
 
Just make sure the code gets pushed forward...
like THIS
Ah thats much better
  this.query = document.querySelector(query);
  let sh;
  if (this.query.shadowRoot) {
   sh = this.query.shadowRoot;
  } else {
   sh = this.query.attachShadow({mode: 'open'});
  }
Oops
NOW it works :D
ShadowGate API is finished... Beautiful... About time I managed to take full control of shadow dom and make an api out of it codepen.io/SkylerSpark/pen/VwYjbNR
I could probably optimize it a lot though
 
4:40 PM
doesn't ndugger have a whole component api built around it
could probably take some ideas from that
 
Actually, I forgot a feature
.mode = 'closed';
I thought mode was readonly
but I guess if its open, it can be closed
Nevermind
 
@TaylorS in its current form there's no point of it being a class as there's no reason to initiate it. I would suggest creating a constructor that sets the this.element to the element passed.
 
It is readonly...
Tried that JBis
this.query was set to the element
 
and it wasnt accessable outside of the constructor
 
4:46 PM
@TaylorS Send code. You should be able to do that.
 
This stupid page says that your able to close an open shadow in the example: developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode
Bruh
Its readonly even when open
 
you can close it only when creating it
 
Uncaught TypeError: Cannot assign to read only property 'mode' of object '#<ShadowRoot>'
    at shadowGate.closeShadow (LQMExyNaPBRk:55)
    at LQMExyNaPBRk:75
Check out the example on that page user
 
it's all right there in the docs
 
On the docs:
// Another way to check whether the shadow root is open; it will return null if not
if(shadow) {
  // If it is open, close it to stop people stealing our secrets!
  shadow.mode = 'closed';
}
:L
Docs are retarded then?
thats obviously after the shadow has been created
 
4:47 PM
that example is fubar
 
.________.
Oh well, no use arguing with know-it-alls
 
Jay
haha
some of us were born knowing how to do all the things, clearly
 
Know how to create a quantum computer for us boring humans then??
:L
 
ffff
 
4:52 PM
@Asif 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.
 
test
 
If your going to test the chat, go to the sandbox room
dont spam here please
 
oh sorry
 
ignore him, you haven't caused a problem here yet
 
4:53 PM
I inquire about static site generator.
Most of them say that a modification of the content leads to a commit. I thought it was the SSG that was calling the CMS API to compile the pages.
So it would rather be the CMS that commit all the result of the API in a json file on the repository, then the SSG generates the site with this file ?
Or did I missunderstood some concept ?
 
which static site generator?
 
Nuxt.js or gatsby
 
Jay
@TaylorS I was referring to someone else in this room who obviously never had to learn things at some point
 
i don't learn things, i just look them up
Why commit things to memory that can be found in seconds?
 
Jay
not you ^_^
but I also try not to commit things to memory that can be easily looked up
 
4:59 PM
but that's one of the reasons i like JS
almost everything is documented and easily findable, down to the most miniscule detail
 
Usually it will eventually get to memory if you look it up enough
 
it's the "using" part that gets it to that point for me
i never use shadowdom, so that's something i have to look up the one or two times a year it comes up
 
5:16 PM
Hey @user400654, why'd you never get a username?
 
?
i had one
i simply chose to remove it
 
Oh, who were you if you want to say?
 
kevin b
 
Wait you're Kevin B? I'm an idiot. I wondered where he went.
 
(⌐■_■)
 
5:35 PM
Hello, so I am creating an app with Java (Spring boot using jsp pages) and Angular. For my navbar, I am using ng-include in my pages and then I have a controller that returns de navbar
I am wondering if that is a bad practice, and if I should do things differently
 
1 message moved to Trash can
@FelipeOliveira Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
HTML
<header ng-include="'navBar'">

</header>

Controller

@RequestMapping("navBar")
public ModelAndView navBar() {
ModelAndView mv = new ModelAndView();
mv.setViewName("navBar");
return mv;

}
 
seems fine to me
but i'm no angular expert
 
@user400654 Thanks!!
 
pretty sure we did the same 4-5 years ago, dunno what's normal in angular2
 
5:42 PM
it makes sense to me, I was just curious if there is any simpler way of doing it and that don't require as much interations between classes (even though this is not much tbh)
 
6:09 PM
ohh, it seems like in modern applications you angular runs in a separate server and it only consumes a rest api from the back end
so my java app shouldn't have any views, just the logic and writing json to the front
 
6:30 PM
Does someone know how to load an image from a jpeg into a DialogBox at runtime, where the name of the jpeg file is equal to a certain attribute of the data, say the 8 digit telephone number of the data.
 
6:52 PM
DialogBox?
 
Would think its something like this from Line 43 to Line 64
But I'm meeting with some syntax errors
 
7:06 PM
1 message moved to Trash can
@atulkumar Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
7:16 PM
separate the question from the code
code blocks can't be in the same message as non-blocks
 
Maybe I should add that to the message
 
Jay
okay the confirmation is prompting and the line is deleting if they click Ok, but I'm still getting Error: Unable to get property 'click' of undefined or null reference
$(".lbtnDelete").click(function () {
    if (confirm("Do you really want to delete this line?")) {
        document.getElementById("lbtnDelete").click();
    }
    else return;
});
and it still deletes the line even if they click Cancel ^_^
 
If you are using jQuery might as well use jQuery $('#lbtnDelete')
 
sounds like you have multiple event handlers
that said
why are you calling .click
 
Jay
that's where I have the method that actually deletes the line
 
7:31 PM
so, you click on the button, and you get asked to confirm
but...
 
Jay
how should I be doing it?
 
you have another click handler also on the button that actually does the deleting
 
Jay
yes
 
you should only have one handler
 
Jay
I thought that would only fire if they clicked Ok
@JBis it is jQuery but I have a class on the button
 
7:37 PM
posted on December 12, 2019 by Michael Dawson

Summary

 The Node.js project will release new versions of all supported release lines on or shortly after Tuesday December 17, 2019 UTC. The only update in these releases will be an updated version of npm addressing the vulnerability announced in https://blog.npmjs.org/post/189618601100/binary-planting-with-the-npm-cli. In the meantime, users should update to npm 6.13.4 by following the instr

 
@Jay jQuery selector uses css selectors. So id would be prefixed by "#" while a class would be prefixed by a ".". You use getElementById so i assumed it was an id.
 
id makes no sense in this case, considering it's some form of list
 
I agree. But was providing equivalent to their code:
> document.getElementById("lbtnDelete").click();
 
Does anyone know what's the equivalent of fs.readdirSync(directory); in ReactJS. I got the original code snippet from NodeJS
Gave me "TypeError: fs.readdirSync is not a function"
 
Node API's aren't accessible in a front end framework.
 
7:50 PM
fetch
 
@PrashinJeevaganth what exactly are you hoping that that function will return to you?
there's no traditional filesystem in a web app, what kind of directory are you trying to read?
 
hey forrest \o
 
afternoon jbis!
I like the hat
 
thanks :)
 
@forresthopkinsa I want to read a directory of jpeg files, so hopefully I get a list of names of jpeg files, I can iterate the list to check whether it contains a certain name before I carry out any logic after I get that boolean variable
 
7:53 PM
Do you want to read the files that are on the server or that are on the client?
 
Line 36 onwards
@JBis Hmm in my own directory, they're already preloaded inside
Not sure which is that, my networking background isn't that good
 
Ok, then you are probably going to want to create some server side code to generate a list of files in JSON. Then you request that in your client using the fetch API.
|| mdn fetch
 
Also line 44
> if (files.includes("${clinic.Tel}.jpeg")) {
You need to wrap that in backticks (`) not quotes
Is ok to leave files in the temp directory and let the OS delete them for a desktop app? Or should I really delete them on exit?
 
@JBis I don't really know what you meant by a temp directory
 
8:00 PM
Separate question. But I mean the OSes temp dir. Like /tmp
 
This is actually meant to be a webapp that will be used on mobile platforms.
I am not familiar dealing with the /tmp directory sadly
 
he wasn't referring to your situation
 
Oh
Oops
@JBis As to find the replacement of code for fs.readdirSync(directory), is it possible to use npmjs.com/package/file-system instead?
 
For purposes of this convo, NPM modules are not available on the client side.
Assuming you are using node on the server side, you can use fs.readdirSync or anything else you want. But you are going to want to make/generate a JSON file and be able to request that from the client,.
 
Jay
got it
as usual I was over-complicating
$(".lbtnDelete").click(function () {
    return confirm("Do you really want to delete this line?");
});
 
8:12 PM
@JBis I say delete them yourself. Part of using an OS tmp directory is that if your process gets SIGKILLed you won't leave unattended files hanging around in the open.
 
Jay
now it fires my click event that actually deletes the line when they click Ok, and does nothing if they click Cancel
 
@forresthopkinsa Ok. The second part is what I was concerned about. I delete on soft exit but if my app is killed there is nothing i can do.
 
Right
Solutions to that particular problem are inevitably Not Very Nice, so OS-level temp utilities are very helpful
 
8:30 PM
Your may want to elaborate your question. Common fix is to set in CSS html and body to 100% height. e.g. html, body{height: 100%;}. — lubosdz 38 secs ago
 
And it has an up vote
 
for comedic value
 
9:24 PM
spectacular
 
9:38 PM
These bugs are so bad that Visual Studio just crashed and restarted itself
 
9:55 PM
microsoft outlook's dark mode is the worst
dark blue text over dark grey headers, white text over light blue selected inbox messages,
 
10:18 PM
I just calibrated the color profile for my display and everything looks better but i'm concerned its inaccurate
 
find something that should be white and compare it to something else that should be white
 

« first day (3344 days earlier)      last day (1598 days later) »