« first day (565 days earlier)      last day (4399 days later) » 

5:00 PM
indeed :D
I lol'd
 
Already exists, it's called "coffeescript"
 
fou
when I write this code the fuction rout don't know the parameter "cur_lat" var cur_lat=36.76790; element.setAttribute("type","submit");
element.setAttribute("value", "itinéraire");"
element.setAttribute("onClick", "rout(cur_lat)";
and when I changed with element.setAttribute("type","submit");
element.setAttribute("value", "itinéraire");"
element.setAttribute("onClick", "rout(36.76790)" it work
 
@fou because you're doing it wrong.
 
element.onclick
 
element.addEventListener('click', function() { rout(cur_lat); }, false); // i'm not IE friendly.
 
5:02 PM
@Esailija def is a horrible library
oh never mind
it's a different def
 
yeah or the hip addEventListener way :P
I havent drank that koolaid yet
 
@Loktar el.onclick failed on me today
 
@Loktar it's tastey
 
I used two of them on the same element, so the second overrode the first :(
 
fou
@rlemon how can I pass the parameter in the function
 
5:02 PM
@rlemon last argument defaults to false
 
I need to look up the benefits
 
so just addEventListener(type, handler)
 
:3562924
1 min ago, by rlemon
element.addEventListener('click', function() { rout(cur_lat); }, false); // i'm not IE friendly.
 
fou
ah ok
I tried
 
cur_lat is probably not defined in the scope?
setAttribute() sets the attribute... are you sure you're not just trying to set the properties?
 
5:04 PM
what is the benefit of using .addEventListener rather than just doing element.onclick ?
 
when you want to add more than one listener.
 
user1385191
multiples
 
user1385191
capture phase
 
user1385191
that's about it
 
onclick === overwrites the onclick...
addEventListener === adds a listener to the onclick.
 
user1385191
5:04 PM
they're also much more difficult to remove
 
ah ok, cool didnt realize they wouldnt overwrite
 
user1385191
it's both a blessing and a curse
 
heh yeah I can imagine
 
fou
@rlemon it worked thanks
 
5:06 PM
@MattMcDonald removing them is not as simple as el.onclick = null?
 
user1385191
you have to keep track of them or else they easily become lost
 
user1385191
they're not explicitly tracked anywhere
 
with addEventListener, they are?
 
user1385191
undefined or function () {} is preferable for removing a DOM handler
 
I don't get what's different, they're both on the element
 
user1385191
5:07 PM
nope
 
fou
I used this element.addEventListener('click', function() { rout(cur_lat); }, false);
 
@Loktar using the non-bubble phase
@Loktar adding multiple listeners
 
user1385191
aEL listeners are tracked at the C++ level
 
user1385191
but nothing above the surface
 
user1385191
5:08 PM
I had this problem in as3 too
 
@rlemon nice thanks
 
@MattMcDonald why undefined instead of null ?
 
and el.onclick aren't tracked anywhere? I really don't get what's hard
 
undefined means i don't exist... null means I exist... as null.... iirc
 
user1385191
undefined is just a safer value to me
 
user1385191
5:11 PM
function () {} is also preferred in IE
 
user1385191
(where errors can and have been thrown for null)
 
user1385191
@FlorianMargaine DOM 0 handlers are right there in the document tree for traversing; DOM 3 handlers can only be referenced by the instance of the observer, the event name and the handler
 
user1385191
any of those three can be used multiple times
 
user1385191
so you can see where the problem lies
 
yeah I see
thanks
 
user1385191
5:14 PM
so foo.addEventListener("click", bar, false); called twice means two handlers that do the same thing
 
@MattMcDonald why?
I would avoid manually setting values to undefined and favour null
 
user1385191
> However, setting onreadystate = null in the context of abort() gives a very weird error in Explorer. The error reads something like "Types don't match"; I'm translating from Dutch here. Therefore in the end I decided to assign an empty function to the event handler…
 
user1385191
I've run into that error as well
 
user1385191
but without abort
 
5:17 PM
hello all, don't suppose now is a right time to ask for some javascript advice?
 
user1385191
perfect time
 
excellent :D
I am trying to get my head around multidimensional arrays
 
it shouldnt take long, depending on the size of the head
 
var multi = [
    ['apples', 'oranges', 'pears'],
    ['eggs', 'meat', 'sausage']
];
 
I have managed to create a said array and am wondering for example how I can .clear() one of the "buried" arrays, would SomeArray[88][0].clear() empty the array held in the SomeArray
 
5:20 PM
someArray[88] = [];
 
delete multi[1]; // i remove ['eggs', 'meat', 'sausage'] from the array
 
just assign it an empty array
arr[0][0] = [];
 
**sidenote delete on arrays is not recommendable due to IE bugs
 
user1385191
don't refer to it explicitly by hard-coded index
 
user1385191
that's a recipe for disaster
 
user1385191
5:21 PM
just like node.parentNode.parentNode.parentNode
 
@MattMcDonald what do you mean called twice
 
user1385191
that handler will be called twice upon the event being dispatched
 
if you do
foo.addEventListener("click", bar, false);
foo.addEventListener("click", bar, false);
foo.addEventListener("click", bar, false);
then only one will fire
 
@jAndy IE bugs? didn't know about it, I do know delete just replaces the value with undefined tho
 
not three
 
5:22 PM
anytime someone talks abnout ie bugs, im out of here
 
Also I have been told that the following var BuriedArray = SomeArray[88][0]; would be a "reference" would that mean any changes I make to the BuriedArray such as BuriedArray[i] = "hello"; would make immediate changes to the SomeArray?
 
user1385191
I just ran some test code in Opera and it was called twice as predicted
 
@MattMcDonald node.lastChild.parentNode; // nodeception.
 
user1385191
FF as well
 
^ chrome, it only calls it once
 
5:24 PM
it's only called once in opera as well
 
@FlorianMargaine: Hmmm I think I remember some IE 6-8 throws an error when you try to delete array elements with delete
 
but I get second thoughts, maybe I just meant that delete not really removes the element and leave the .length untouched
 
yep, that it does
 
stupid IE
 
5:25 PM
var arr = [ 1, 2, 3 ];
delete arr[ 1 ];
console.log( arr ); // [ 1, undefined, 3 ]
 
once in FF as well
 
var arr = [ 1, 2, 3 ];
delete arr[ 1 ];
console.log( arr ); // [ 1, 3 ] // chrome 18 :S
 
the spec is also very explicit of multiple handlers discarded
 
user1385191
try alert instead of console
 
If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.
so you're full of shit or running some weird configuration
 
5:27 PM
never trust the console
 
:P
 
user1385191
oh it's the function inlining
 
user1385191
of course
 
user1385191
they're not the same object
 
I still trust it
 
5:28 PM
it has other leaks and failures
 
no
 
console is broken
 
user1385191
delete's not really a good idea in most instances
 
user1385191
especially with host objects
 
to delete an object property, it actually is ;o)
 
user1385191
that's one case where it's a terrible idea
 
arrays have splice
 
Well, it won't work for host objects but other than that what else would you propose to delete an object's property?
 
not talking about host objects of course
 
otherwise delete is fine, it's the only way to really get rid of the property
 
user1385191
5:30 PM
I only really use delete for hash tables
 
setting to undefined is different
 
@Esailija yup, splice is the way to go for arrays
 
it will still say key in object is true
 
var obj = { foo: 42 }; obj.foo = undefined; 'foo' in obj === true;
 
why 42?
 
5:31 PM
lol
 
!!!!
 
hello all
i need 1 help
 
only one, then.
 
I really hate the word hash table in js context
it's a low level implementation of something that is already in js out of the box
 
5:33 PM
es6 will bring the hashtables :p
 
yah its about jquery
 
@Milap just ask seriously
 
ok..
 
@jAndy es6 will bring the feary world... to our grandchildren
 
doombringer
 
5:34 PM
I don't expect it so soon ._.
it's like duke nukem forever
 
function fade_in(image_class, start_image, finish_image) {
    jQuery(document).ready(function () {
        jQuery("." + image_class).hover(function () {
           // jQuery(this).attr('src', start_image);
            $(this).animate({
                opacity: "1"
            }, 'slow');
        }, function () {
            jQuery(this).attr('src', finish_image);
            $(this).animate({
                opacity: "0.8"
            }, 'slow');
        });
    });
}
 
(even though it's not true anymore)
 
heh might be some guys from apology in the committee
 
i have create this function
 
@Milap We require users to need at least three help to ask questions in here.
One won't suffice.
 
5:35 PM
:(
 
I don't get the jQuery(document).ready there, but why not
so?
 
Yea, I didn't make that up. Sorry bro. :(
Nah, I totally did. :D
 
@Milap: whats the actual problem ?
 
i have passed id of the image element at hover
i am facing problem in popup
 
wow, how unrelated is that
afk smoking
 
5:37 PM
one close button is there in popup
 
@FlorianMargaine nooo
 
i mean image
 
@FlorianMargaine GOOD IDEA!
 
I want to smoke too so bad :(
 
smokers gonna die
 
5:38 PM
I got back on the quitting wagon
 
non-smokers too..
:p
 
when i hover on that close button image , i am not getting id of the image
 
also ... having just finally fixed my less.... i feel i deserve to treat myself.
 
@jAndy smokers are jokers
 
@Milap probably because you're not selecting any id's
4 mins ago, by Milap
function fade_in(image_class, start_image, finish_image) {
    jQuery(document).ready(function () {
        jQuery("." + image_class).hover(function () {
           // jQuery(this).attr('src', start_image);
            $(this).animate({
                opacity: "1"
            }, 'slow');
        }, function () {
            jQuery(this).attr('src', finish_image);
            $(this).animate({
                opacity: "0.8"
            }, 'slow');
        });
    });
}
 
5:39 PM
sorry
its #
not .
 
so that solved your question already ?
 
i still not getting id in popup hover
 
You shouldn't have document ready in there
 
function fade_in(image_id, start_image, finish_image) {
    jQuery("#" + image_id).hover(function() {
        // jQuery(this).attr('src', start_image);
        $(this).animate({
            opacity: "1"
        }, 'slow');
    }, function() {
        jQuery(this).attr('src', finish_image);
        $(this).animate({
            opacity: "0.8"
        }, 'slow');
    });
}​
 
doesn't effect the "problem" anyway
 
5:40 PM
@Milap but this code is completely unrelated.... so how can we help
"Guys my car is broken... here is a picture of my fridge, how do I fix my car!"
2
 
:)
 
I just love such help requests, especially when the user needs only one help.
 
it shows the op is just c and p a buncha crap together...
 
how do you know the problem is not related to that code?
 
"i think this is the problematic code... but not knowing what in dafuq i'm doing... i'll just dump this out because it's pretty"
 
5:42 PM
It occured to me that the function can be done entirely in css
 
@jAndy that neither sets not gets any id's other than selecting the element for hover.
 
with ie not having animated opacity but fuck that
 
@Esailija IE doesn't deserve animations.
 
it's not a crucial animation anyway
so transitions are fine
 
@rlemon: op stated that it was a typo, replacing . by #
 
5:43 PM
all tables in IE should have uncollapsed borders.
 
pretty selfish so far
the line "car blah fridge blah"
 
IE deserves a Cyanide pill.
 
@jAndy jAndy... pleas please please tell me how that code can alter the ID or effect the retrieval of an ID in another function.
 
:(
 
@Milap dude i am trying to help. now i'm just battling off the jTroll
 
5:44 PM
@rlemon: you may not have noticed, but english seems to be the ops first language, MAYBE its just a lingusitic problem
I just figured you prematurely blame the guy
 
@jAndy no you're just being dumb. I am asking for the proper code so I can help.
 
@rlemon: you're ignorant
 
user1385191
:/
 
Oy vey.
 
@jAndy you're dumb. and now ignored for you're idiocy.
 
5:46 PM
@rlemon: fuck the hell off
 
@Milap if you want some help you can try posting some more code.. all the code there does is toggle the animation on hover. I can't see how it is effecting your popup selecting any id's.
 
.cool-images {
	-webkit-transition: opacity 0.6s linear;
	opacity: 0.8;
	background-image: src('original_src');
}

.cool-images:hover {
	opacity: 1;
	background-image: src('different_src');
}
 
@MattMcDonald >_<
 
@Esailija ITS BECAUSE OF YOU THERE WAS A FLAMEWAR AROUND WEBKIT PREFIXES
I knew it!
 
5:47 PM
hey man i'm not gonna take chat space with the prefixes
everyone knows to duplicate them
 
nah, people copy paste
 
I also didn't include filter: opacity
 
Hey guys, do you know any useful tool for mongodb database prototyping? I'd like something that turn maybe, maybe some YML to JSON converter would do the trick?
 
@TomShreds ...
 
@Raynos what happened with matt :P
 
5:48 PM
hey @rlemon i want to change opacity on hover on images
i am getting id in normal pages
 
@Milap yup... so that code does that correct? what is the popup business you're talking about?
 
@Esailija I think it was a "these people. :(. /quit"
 
@Raynos for life? :/
 
let me show you my code @rlemon
 
@Milap that is all i asked :P
 
5:50 PM
I only want something that would turn something like

Articles:
	has_many Comments
	has_one Category

Comments:
	has_one Author

Author:
	Name

Category:
	Name

To a dummy and usable JSON structure.
 
@Esailija dont nknow
@TomShreds that's a waste of time.
 
@TomShreds write a parser? shouldn't be too hard?
 
@rlemon I think that's what I'll do
@Raynos typing JSON is a waste of time IMO
 
But you need to type JSON
 
I know, but this is for prototyping, I don't care about that JSON yet, when I'll be done with it, I'll type it
 
5:51 PM
every time I interact with mongoDB I send objects
 
@TomShreds the notion that YML takes significantly less time to type then JSON is madness
 
this is my function
 
There's lots of YAML parsers available.
 
lol this is a classic
 
5:52 PM
@Milap yes... so what does this have to do with the popup?
 
fade_in('launch_cls', '../images/icons/Launch_mouse_over.png', '../images/icons/Launch.png');
 
For Python, Node.js, you name it.
 
is the image in a popup?
 
@Raynos I don't really care if it's YML or anything else, I just want to throw structure on the table and debate which one would be the best. It's not even for coding purposes
 
yah
@rlemon
 
5:52 PM
You can type normal javascript objects, paste them into console and json stringify
that saves a ton of "s
 
ok.. so what is happening? are you getting any errors?
 
I guess it would be totally easy to convert YAML to JSON with Node.js.
 
@FlorianMargaine thx I'll look into it
 
nop
 
no error
but image is in popup
so i am not able to get id
 
The main goal would be to rapidly prototype, Like saying

Articles:
    has_many: Comments

So it would output a good JSON structure to throw inside MongoDB
 
popup is just a HTML element
 
nice thx
 
5:54 PM
or are you in a fancybox (iframe)
 
better than tv
 
@Milap it is extreamly difficult to see where the issue is with that limited amount of code? can you not show any more?\
 
I hate every god damn database diagram designer that exists, except when I make them with OmniGraffle. I don't need all that complex stuff, it's just for simple prototypes for f sakes
 
@Milap Throw everything you have into a jsfiddle and link us to it.
 
People does not seem able to program good "arrows" inside these apps, I always end up with spagetthi ERRRYWHERE
 
5:56 PM
ok
i am using this
 
@TomShreds Yea, they tend to program arrows into knees.
 
I didn't even saw it comin'
 
C'mon, admit you lold a bit. :D
 
Reminds me I should play some Skyrim tonight, I perfectly know that I'll end up working instead but eh I love to think about fun stuff
Yeah I actually lol'd a lot hehe :P
I'll never get tired of it
 
@Milap ok... how? can you show me the code that calls that 'popup' as well as the code in the popup?
 
5:58 PM
<script type="text/javascript">
		    jQuery(document).ready(function($) {
		      $('a[rel*=facebox]').facebox({
		        loadingImage : '../../facebox/src/loading.gif',
		        closeImage   : '../images/icons/close_button.png',
		        opacity: 0.5
		      });
		    });
 	 	</script>
when i click on anchor tag with id=facebook
 
wow
 
it popups
 

« first day (565 days earlier)      last day (4399 days later) »