« first day (2983 days earlier)      last day (2189 days later) » 

00:00
yes
well you can do that without execCommand
no no i mean inside the RT editor
like the bold command, just instead of strong tags, code tags
O
that makes more sense
i'm not that much of a noob
i can't find anything in the api but you can just put the code tags around it yourself and insert it as html
seems simple enough
00:07
yeah, I was thinking i'd do something like that, but how can I take all factors into consideration like cursor position and the actual content of the code
you going to have to use a marker. like ''' ticks
to surround the code it's how other sites do it
so use a regular expression or you can use startWith or some other built it
then you can just replace it with the surrounding HTML code tags. There might be an easier way to do this, but this is the only way I can think of doing it right now.
Okay
thanks
 
2 hours later…
01:59
Hi, Can anyboddy tell why 'google amazon'.match(/(?:^|\s)(?:amazon|google)(?:\s|$)/g) is not returning amazon because it is just trying to look for whole words that are either amazon or google and while removing (?:\s|$) works
nvm word boundary \b worked. Thanks
02:15
Is it true that google plans to entirely do away with firebase?
you know considering it still uses node 8 and defaults to node 6
03:14
Evidence enough they're not going anywhere
03:39
FUCKING CHROME SLIDE BACK FEATURE
03:56
@JacobSchneider I was joking out of irritation for being forced to use the old version lol
I could tell it was a joke, I was joking along.
oh lol, well you got me
I mean I wouldn't be surprised if google discontinued something because it's google, but I didn't catch that lol
But firebase? that's a huge source of income on their behalf, I would be suprised if they dropped it.
03:59
yeah, I doubt they would, but clearly they don't care about supporting new technology on it...
Well to be fair, node 8 isn't that old
electron only uses chrome 62, which is annoying
yeah I was also just being picky because they used forEach in a really confusing and stupid way, and they make you edit the config file to use node 8 (it's node 6 by default). We all have those moments when using a tool where it just pisses you off lol
I needed to vent a little lol, not proud of it but better than actually getting angry
haha, we all have moments like that, I do it all the time, tbhj
04:17
@JacobSchneider yeah I used to be pretty bad when I was first learning (it was Java, so...) but I'm really working on it.
That won't help haha
I don't really get angry often now unless I feel misled (like with that out of place forEach) but still I know that it's pointless to get angry
a forEarch implementation on an object in a nodejs library mind you
how would you use it on an object?
you don't, and I found out it was an object that had it's own forEach method when I tried to use map
I assumed that it was an array that acted like an array, not an object that acted like an array
like big idiot I guess lol
04:20
ha, ikr
 
3 hours later…
07:30
Hey, I have a function that makes use of the execCommand function from the document
this is my code so far
    constructor() {
		[...document.querySelectorAll(`#view_${this.id}`)].forEach(e => this.addBindings());

		document.querySelector(".bold").addEventListener("click", e => this.bold());
		document.querySelector(".italic").addEventListener("click", e => this.italic());
		document.querySelector(".strikethrough").addEventListener("click", e => this.strikethrough());
		document.querySelector(".underline").addEventListener("click", e => this.underline());
	}

	addBindings() {
		this.bindings.push(new Binding("ctrl+b", e => this.bold()));
the .bold, .italic, .strikethrough and .underline elements make visible changes, however the key combos don't do anything, the console prints out what it needs to, but no change is made to the HTML
why???
 
1 hour later…
08:50
o/
How is everyone doing?
Happy weekend
 
1 hour later…
10:02
I'm not crammed in a hat with another human, so I got that going for me :)
Hye
how can I call a function when the carat inside a contenteditable div moves? may it be triggered by a click, arrow keys, keypress or programatically?
11:03
hello?
11:54
Would VueJS run on a hosting server without NodeJS?
seeing that it's written in node, I'd say not
According to this you can
12:06
How?
I thought vue.js was a web framework!!! wtf
12:45
Hello
Anyone there?
Hello Jacob.
How are you?
Hi fine thanks
and yourself?
I am fine too.
Thanks.
I am wondering how can i make inline links without neads of id's
sure
nothin a bit of CSS can't do
well
a {
  display: inline;
}
12:47
Something like: <a href='javascript:window.location=document.getElementsByTagName('123')[0]'>123</‌​a>
oh
so you want to update the link's destination without needing to use an ID?
instead of <a href="#some_id">123</a>
Yes
Okay
well, the document.querySelectorAll method may help you
it returns an array like structure that you can use to get specific elements
document.querySelectorAll('a') -> NodeList[a, a, a]
but otherwise you could use an event listener instead of actually making the link go somewhere
@JacobSchneider https://www.w3schools.com/graphics/tryit.asp?filename=trysvg_linear
without id's
do you know where each link goes?
12:52
well yes.
For example the first linearGradient child of <svg>
I mean are they retrieved from a database or are they static
I would like to make a svg editor.
So i suppose to be static.
Why do you asking this?
I think it doesn't matter.
Sorry, I'm just trying understand what your issue is
12:55
ok :)
the question could be how do you know which url to put where, you see?
which uri
but you are right.
this is why I ask
The question is: How can i fill the ellipse with the above lineargradient?
aaah I see
so you need to get the gradient from #grad?
Yes
It's a little bit strange what i want to do.
we've all been there, don't worry :D
since it's HTML and it's got an ID, can't you use a querySelector?
13:21
document.getElementsByTagName("ellipse")[0].setAttribute("fill","url:(#"+documen‌​t.querySelectorAll('linearGradient')[0]+")");
Doesn΄t work
writes: url:(#[object SVGLinearGradientElement])
use it's outerHTML, not the object itself
how?
JS is trying to represent the object in text form so it prints out [Object SVGLinearGradientElement], use obj.outerHTML
oh hang on
sorry
btw
document.querySelectorAll(...)[0] can be replaced with document.querySelector(...)
also the querySelector returns the actual HTML element, not a reference to it
do document.querySelector(...).getAttribute('name')
it doesn't have a name attribute associated with it.
please
13:31
So, we have to put the gradient colours.
I don't know the formula.
I believe there's a way of nesting a gradient tag in the path and applying the fill that way
13:47
document.getElementsByTagName("ellipse")[0].setAttribute("fill","url('data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><linearGradient><stop offset='0%' stop-color='%23ff00cc'/><stop offset='100%' stop-color='%23333399'/></linearGradient></svg>)");

Doesn't work
that's because it's an attribute. they won't work
you need to nest the elements
document.getElementsByTagName("ellipse")[0].setAttribute("fill","url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><linearGradient id='grad'><stop offset='0%' stop-color='%23ff00cc'/><stop offset='100%' stop-color='%23333399'/></linearGradient></svg>#grad\")");


that's works only in firefox
but it has id's
any idea? :)
Maybe if i use css gradients would help.
https://www.w3schools.com/css/css3_gradients.asp
I am honestly stumped.
Take a break.
Yeah, good idea
hey I don't suppose you know how to get rid of the white center in inkscape do you?
14:06
i don't use inkspace.
Maybe i will (in the future).
Okay thanks
hey batman, do you know?
14:27
Need some help with FileReader() and async in general.
I have some pseudo code as follows:
@sweg_yolo_69 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.
1 message moved to Trash can
@sweg_yolo_69 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 gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
1 hour later…
user8729657
15:58
Does stripe take money from prepaid visa and master cards?
16:56
they should
their website should say
 
6 hours later…
Knu
Knu
22:59
fetch(…).then(foo)
.then(qux)
.catch(bar);

ctrl.abort(); // could this be run between foo and qux?
in short is abort a task ? The microtasks should all be consecutive and hence nothing could be inserted in between foo and qux, correct?
Knu
Knu
23:17
found the answer, it depends on the state of the promises, if it's pending it will wait for the next round of the event loop
@Knu You shouldn't be concerning yourself with any of that.
Knu
Knu
if the abort can be called in between then promises, yeah I should
Promises (.then() and .catch()) as well as await give you a complete set of flow-control tools that make it so that you don't need to be aware of microtasks to know what order things are executed.
Knu
Knu
because I won't be able, for example, to consume the response
The entire point of .abort() is that you can call it whatever and not care about the state of the promise.
Knu
Knu
23:19
e.g. using .json()
If you've already consumed the Promise, it's already consumed. If it's not, it'll reject, and you'll get to handle that.
Knu
Knu
nop you didn't get what I was saying
the promise is not consumed, but the request was aborted
in that case if you call .json on the response it would throw
with an AbortError :)
since the microtasks have a priority over the macrotasks, I am fine once I leave the function
even if the promises are pending the next round will call the microtasks first
23:34
How Can I get the equivalent of 'php://input' with express server?
I'm completely at a dead end at how I can get the raw post data without remaking my entire api
I tried just turning the json back into a string, but that isn't working
Knu
Knu
@MadaraUchiha Iv just tested and indeed abort may run in between foo and qux on Chrome.
so basically I tried taking the object that express gave me, turning it back into a string, but the hash isn't matching
Knu
Knu
which means I will not end up in the a final catch (if fetch is in progress that's what will happen in my case) because fetch has completed.
Knu
Knu
23:53
The crux of the problem is that the abortion prevents the consumption (for json at least) of the response. That's not something you would have using XHR.
abort after the request has completed, is completely ignored.
when using fetch it fires the handler and prevents the consumption of the response
it's logical but idiotic

« first day (2983 days earlier)      last day (2189 days later) »