« first day (1466 days earlier)      last day (3468 days later) » 

9:00 PM
!!afk home, no gym today, my knees hurt :/
 
I guess not many people know that if you have bulk data and a few outliers, they could fuck up your chart scale so it's better using a logarithmic chart
whatever
... boring stuff
 
@rlemon was leg day yesterday, hurting today. Today is back day.
wtf humans
 
anybody know of a example online for , i got a form and when a user enter a value in a field i want it to show in red if they enter a invalid value , like a letter instead of integer?
 
@jfishbow Welcome to the JavaScript chat! Please review the room pseudo-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.
 
not sure what key words to google for
 
9:02 PM
@jfishbow that's called validation. jQuery has a nice plugin for that, but I do custom validation specifically
 
look for java script form validation
 
i would think i could use onblur?
 
onkeypress would be the one
The element blurs when you focus/unfocus on it
(tab over, mouse out, etc)
 
onkeypress would work before clicking submit?
 
@jfishbow You're in luck, we recently got validation baked into html! developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/…
 
9:05 PM
@Zirak I didn't know HTML got baked
 
We also got cool stuff like <input type='number' />, tons of inputs, as many as you can think, and then 7 more.
 
@SterlingArcher - HTML didn't, Validation did.. Validation isn't the most reliable, especially not when its the client
 
@TravisJ of course; client side validation is all show. The real validation happens on the server
 
It was never meant to be, it's entirely a ux thing (which is, frankly, what the client side is about)
 
!!learn ^5 "<>http://i.imgur.com/UuQbJ.gif"
 
9:09 PM
@SterlingArcher Command ^5 learned
 
Holy shit it works
 
user2620028
where is the command that makes it unbox itself after 5 loops lol
 
0
Q: Unit test $formatters in Angular directive

SomeKittensI have a simple validator that checks an input against a regex: .directive('test', function () { return { restrict: 'A', require: 'ngModel', link: function ($scope, element, attrs, ctrl) { ctrl.$setValidity('namePattern', true); function checkValid(name) { ...

 
9:11 PM
hello any one active in here ?
hello
 
> FOR REDWALLLLLLL!
 
@Nick Dugger I don't understand what you're saying I declared tmp in a local scope.
 
@Joseph Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@Nick Dugger can you explain what your answer was doing since when I used it I got a reference error.
 
user457812
Hey guys! Answer my super long call-x-on-undefined-error question. (nb: question does not exist nor will it ever.)
 
9:15 PM
the first script shows the real dimentions the other shows 0 for both why ?
i has nothing to do with document ready
i am to emulate the getimagesize function in javascript
trying *
 
Glorious booty just walked past my desk
!!afk booty
 
TEST
615 410
first script gives 615 rr 410
second one 0 0
No one ? :/
 
1 message moved to recycle bin
 
anyone worked with handlebarsjs ?
 
@Joseph please format code, and refrain from huge snippets like that
make a test case on a site like jsfiddle.net
 
9:23 PM
@Loktar i will
 
I'm having a json with htmls in it.. i'm trying to render it on the browser, it works perfect if i'm trying to use vanillajs innerHTML or jquery .html(), however in this case i'm using handlebars and i'm wondering if there's any method for handling that.. here's an example..
 
@JoeSaad you're breaking seperation of view logic
why are you getting html from the server or a json response?
sounds like a maintenance nightmare
 
Loktar be on the kryptonite right now
#smackdown
 
@Loktar I agree with you.. i'm doing frontend for a team who just gave me this json, they need HTML in it to highlight parts of that html
 
if you use jquery's .html() it will execute script if it is in the json
 
9:27 PM
@JoeSaad why so sad?
 
@Shmiddty why so sad? .. i didn't get that
I don't have control over the json sent to me
 
for example, if run in this chat rooms url
javascript:$("#message-19543450").html('Name: <script>alert("xss")</script>');
will alert xss
 
@Loktar here's a link jsfiddle.net/9tk8emv1
 
@JoeSaad send them back more JSON
 
@JoeSaad ah damn that sucks :?
 
9:30 PM
return JSON.parse({message:"Your JSON sucks bro"});
 
sorry misping
 
that fiddle hurts me @Joseph
you have script tags in the JS :?
/me heads home for the day
 
Oh god that fiddle. @Joseph read up on how to use jsfiddle. It will come in handy one day
Specific tags are not required
 
@JoeSaad Just making a pun about your name. <3
 
9:34 PM
@Shmiddty lmao I just got it
I thought it was a Joker joke
 
@Loktar chill i have fixed it , apologies.
 
@SterlingArcher Like the disappearing pencil?
 
A wee bit less deadly but yes
 
@Shmiddty ha ha .. it's double As which ironically in arabic language means happy
 
9:36 PM
GOD DAMMIT
!!afk ragequit
 
@Loktar but never mind my fiddle, thing is it works in fiddle but if you take the code i have posted above and put it in a file.php and run it you'd get what i mean
 
@JoeSaad Sa'ad sounds closer to "meal" to me than "happy"
But my Arabic is pretty broken.
Tirbahu wa-tas'adu
 
@SecondRikudo a meal? i never knew of any meal sounding like it.. but if there's any would like to try
@SecondRikudo ha ha ha.. that means "you earn and become happy"
 
@JoeSaad Huh
 
@SecondRikudo it does
 
9:40 PM
In Hebrew, Sa'ad is a fancy way of saying "Ate"
 
@JoeSaad Is that conveying the concept of attaining happiness through achievement? or is it a different concept?
 
And also, strangely, "helped"
 
@SecondRikudo dude you think you can give my question some attention ?
 
@TravisJ Luckily my internet connection was slow enough for me to close the tab while buffering
Screw you all and your Google Fibers!
 
lol :)
 
9:41 PM
@SterlingArcher not sure what I did but I appear to have over exerted myself and fucked up my right knee
 
@rlemon SterlingArcher is afk: ragequit
 
@Joseph I've never used Handlebars, so not sure how much of a help I can be
 
going to take a day off, then go strong again tomorrow and see if it feels better
 
@SecondRikudo sounds like a right meaning in Hebrew. I'm always happy when i eat :)
 
@rlemon Get well, or get to the doctor!
 
9:42 PM
for a sore knee after workout out hard for 5 days straight?
I don't think I'm in need of a doctor
 
@Shmiddty not really achievement, it's just earning... some ppl earn without achieving.. you know...
 
@rlemon That's why there's also the Get well option :)
 
btw, i used JSON.parse() and it didn't work
 
@JoeSaad Amen to that.
 
"It didn't work" is one of the least descriptive comments possible.
 
9:44 PM
@rlemon I have to be very careful with my legs. I destroyed my right knee when I was a teenager, so I can't even parallel squat the bar
I have to do box squats, and I can only do like.. 105lbs comfortably
 
if anyone know of a method in handlebarsJS where i can my html in json won't be displayed but rather interpreted in the browser
 
@Shmiddty Tirbahu implies earning a lot of money and living a comfortable life
 
@Sterling I have bad knees as well, so at the first sign of over exertion I back off.
 
@JoeSaad Why do you want to have your html in JSON?
 
And Tasadu implies being happy, @JoeSaad got that one right and I was wrong. Just looked it up :D
 
9:45 PM
Never ever ever hyperextend that knee with weight on it
I did that on the leg press, and thought I rebroke that motherfucker
 
I can dislocate all of my joints brah
Didn't you know?
 
I can pull my fingers out of their sockets =x
 
Do lemons even have joints?
 
This all helps to prove the point that language is terrible at conveying ideas. People can't agree on the meaning of words. Especially ones that relate to emotions.
 
@Sterling I can pull everything out.
Its a cool party trick but sucks in a fuckwad of ways
 
9:46 PM
@Shmiddty Yeah, the perspective gun is a much more elegant alternative.
 
!!s/language is/humans are/
 
@Retsam This all helps to prove the point that humans are terrible at conveying ideas. People can't agree on the meaning of words. Especially ones that relate to emotions. (source)
 
@Retsam i don't have control on that json, i'm receiving it from backend developers where they need some tags to highlight parts of the text in it
 
@SecondRikudo I think telepathy through technology is absolutely possible. It's just a matter of figuring out how to do it.
 
@Shmiddty I'm not sure I want telepathy TBH
 
9:48 PM
@JoeSaad Use {{{ }}} instead of {{ }} then.
 
It sounds all nice and dandy, but imagine what the business would do to it.
Telepathic ads. No thanks
 
lmao
fuck that
 
I found that in about 30 seconds of reading the handlebars documentation, btw
 
You'd end up not being sure if a thought that pops into your head is your own or some corporation's
 
@JoeSaad Specifically: handlebarsjs.com/#html-escaping
 
9:50 PM
@Retsam i tested it and it worked
 
take this code save it in file.php and run it please someone
 
!!s/i /somebody /
 
@CSᵠ @Retsam somebody tested it and it worked (source)
 
you rock.. i could only find methods Handlebars.registerHelper('list', function(context, options) {
return "<ul>" + context.map(function(item) {
return "<li>" + options.fn(item) + "</li>";
}).join("\n") + "</ul>";
});
 
nice feature /goes to sandbox
 
9:52 PM
@CapricaSix do u have apache running on your pc ?
 
@Retsam i completely missed that.. i kept looking down the document.. thanks for your 30 second help ;) you rock!!
 
I'm not sure telepathic technology is necessarily feasible. It depends on how "consistently wired" our brains are.
@JoeSaad No problem.
 
@Retsam do u have apache running on your pc ?
 
@Joseph 1) No, 2) CapricaSix is a bot, 3) Please don't ping random people in the room to ask your question.
4) This is the Javascript room, so asking "Please run this PHP code" isn't likely to get results.
 
and I have it on good authority Caprica is a nginx girl
 
9:56 PM
@Retsam its not a php code , the php part is just for comparison , i am trying to emulate the php function getimagesize in php, but when i do execute my code one of the javascripts in behaving weirdly . I am asking for help to try to understand why .
 
create a JSFiddle
 
@Joseph Copy out the relevant javascript bits into a jsfiddle and post that.
 
1 message moved to recycle bin
 
inb4 asking size before image is loaded
 
already asked once for you not to post large unformatted code snippets @Joseph
not trying to be a dick but I dont want to look at unformatted shitty php between awesome images and conversations.
 
9:58 PM
@Retsam i can do a jsfiddle , but it HAS to run on apache
 
@Joseph If it's a Javascript problem, then it doesn't need apache.
 
a tale of two properties.
  - by rlemon

var img = new Image();
img.src = 'foo.png';
img.height; // ohh no, I haven't downloaded yet!
img.width; // wtf? no width?
// should have waited for onload :/
4
 
@rlemon I liked the movie version better.
 
@rlemon that was beautiful
 
9:59 PM
!!s/(.{30})/$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1/
 
Server error (status 500) occured (message probably too long)
 
/
 
thankyou, thankyou, no pictures, no pictures
 
... :click: :flash:
HA HA GOT UR NUDES
Where is 4Chan when you need him >=(
 
Thanks iCloud!
 
10:01 PM
@rlemon why would the second script give me the dimensions then ?
 
@Joseph that question doesn't make sense in the context of my short story
in short, I assume you do something like above, and don't wait for the image to finish downloading by the browser before you ask for dimensions. might work sometimes (cache, or script execution) but it isn't guaranteed unless you wait for it and check dimensions then
 
datcache
 
@rlemon a tale of two properties .
- by rlemon

var img = new Image();
img.src = 'foo.png';
img.height; // ohh no, I haven't downloaded yet!
img.width; // wtf? no width?
// should have waited for onload :/

var img1 = new Image();
img1.src = 'foo.png';
img1.height; // ohh no, I haven't downloaded yet!
img1.width; // wtf? no width?
// why would this work if i shouuld have waited for the onload ?
 
it doesn't work, not always
 
@rlemon i my case it does :/
 
10:06 PM
Can some one explain why this click event listener does not respond for wheel mouse or right click : jsfiddle.net/8p9bzg30
 
read what I wrote.
once it is downloaded or cached you'll get positive results.
var img = new Image();
img.onload = function() {
  console.log(img.height, img.width);
};
img.src = 'foo.png';
you want this.
 
@rlemon bro, would you consider letting Caprica in the RegEx room also
 
!!summon 25767
done
 
@Dave - You didn't register those events, click is not right click nor mouse wheel
 
ossm ! thanks
 
10:09 PM
for example, here is right click: jsfiddle.net/8p9bzg30/1
 
@rlemon i did read what you have written. It's just weird that one of the scripts give a result the other don't KNOWING that i empty my cash every time i reload the page ctrl + F5
 
when did this come to be @TravisJ because last year i had a canvas using click and it worked =/
this a recent change =/
 
oncontextmenu and onscrollwheel have existed for a while
 
i see. first time i've heard of right click being assigned to oncontextmenu
 
@Dave you had right clicking working on a canvas with just using a standard click event listener?
 
10:11 PM
!!mdn oncontextmenu
 
I think you might be misremembering
 
let me check my old script
ah mousedown
 
ah yea
that makes sense
 
I feel like it's a sin to INNER JOIN 4 tables
But it worked
!!s/^os/pos/
 
10:13 PM
@SterlingArcher possm ! thanks (source)
 
@SterlingArcher If they're sufficiently small tables it's not a problem.
DB Engines iirc are really good at optimizing and only getting the data they need to
 
m59
@SomeKittens I'm back
 
2
Q: Unit test $formatters in Angular directive

SomeKittensI have a simple validator that checks an input against a regex: .directive('test', function () { return { restrict: 'A', require: 'ngModel', link: function ($scope, element, attrs, ctrl) { ctrl.$setValidity('namePattern', true); function checkValid(name) { ...

Ended up asking a question
 
@Loktar you got netflix?
Video Games: The Movie got added
 
10:22 PM
How can I scrollTo slowly without jQuery
 
!!tell how to
!!help you ok @CapricaSix ?
 
do I have to write a timeout function?
 
@ziGi - I think vanilla.js can do that
 
!!live
 
did she die?
 
10:24 PM
i'm sorry
 
sonofa..
 
:)))))))
 
2
A: scrollTop animation without jquery

RobSomething like this should do the trick. <script type="text/javascript"> function scrollToTop(element, to, duration) { if (duration < 0) return; var difference = to - element.scrollTop; var perTick = difference / duration * 10; setTimeout(function () { ...

nvm found the answer
 
Morning regs
 
!!s/\s/ d/
 
10:26 PM
heh, dupehammer material there
 
m59
@SomeKittens your test directive isn't in your markup.
 
@rlemon vulnerable to catastrophic regexes! would like to see the death log though
 
!!s/regs/wood/
 
sorry again
guess this is a good thing?
 
@m59 yeah, that's a typo in the question
fixed
 
10:42 PM
Youhou!!! I can finally write in the chat!!
 
welcome
 
Thanks! I'm excited to get more involved with the community
 
Can someone point me to good documentation on how to write async tests for node? I'm trying to write tests for an app that uses node-postgres, and my tap knowledge is proving inadequate, and most blog posts are sorely lacking in relevant details--they tend to just preach the wonders of the author's favorite testing platform or Promises library. I would gladly pay for a book (might even prefer that).
 
buh. Failing pretty hard at JQuery mobile
 
@Flimzy What testing suite are you using? Mocha?
 
m59
10:58 PM
@SomeKittens I got it working
dunno what I did different
 
YES
codez plz
 
m59
The trick is to NOT USE 4 SPACES
kidding ;D just a sec
 
@SomeKittens so far tap, but I'll use whatever gets the job done best.
 
m59
@SomeKittens uh, wait... it runs but the test fails?? I'm confused
 
11:02 PM
Yeah, it runs but the test fails because checkValid never was called with the new value
 
m59
jsbin won't save, just a sec
I think it fails because of your if statement jsfiddle.net/84j087Lr
yup
Why pristine?
 
don't ask me
also, I'm console.logging before said if statement
and the log is only running once with an empty string
oh wait, you are too
..... how!>?!>
 
m59
how what?
@SomeKittens I can't figure out why in the world there's no setDirty though.
form.instanceName.$pristine = false; kinda hacky
 
@m59 Me neither. There's set/unsetTouched, but that's 1.3
Alright, they work now
 
m59
I swore it was around then, but I guess not?
I mean, it's literally not on the object, so...
Update Angular ;D
 
11:17 PM
That will break SO MUCH.
 
m59
So, what I pretty much started all over
I didn't catch what I did different yet
 
So it looks like it won't call $formatters if the element is $pristine.
 
m59
Ohhhh nm or ... stuff
 
GitHub can't find $pristine in Angular's source.
I am suspicious.
 
m59
I don't see a problem with what I did ^
 
11:23 PM
I don't either
 
m59
Hey, so does that syntax you used for beforeEach work for you?
 
what, initState?
yeah, that works
 
m59
what am I doing wrong?
 
m59
in that jsbin, it doesn't work
oh... the rest of the code has to be inside of inject for some reason
no idea why that is
nm dang I'm tired and confused
@SomeKittens sigh. I don't know how you make that work
 
11:39 PM
wat
 
hai
 
m59
You're using Mocha?
Seems to be a jasmine thing.
 
Yeah, we're using Mocha.
 
11:56 PM
is there such a thing as a "list" field type?
 

« first day (1466 days earlier)      last day (3468 days later) »