« first day (1185 days earlier)      last day (3777 days later) » 

9:00 AM
classical inheritance: prototypes of class prototypes are superclass prototypes
here, it will create an element whose prototype is a new specific instance of a "superclass".
 
@JanDvorak these concepts are difficult for me... I need to study this...
Would you have an example with textarea + myownparameter ?
 
@swapna I might buy it if it were 90% off. Depends on what the going rate for door stops are nowadays.
 
var textarea = document.createElement(textarea);
var wrapper = Object.create(textarea);
wrapper.param = 126; // then this will work
wrapper.style.background = ...; //still does
wrapper.innerHTML = ...; // won't behave as expected
// you can do this:
Object.getPrototypeOf(wrapper).innerHTML = ...;
// but it's better to do this:
wrapper.element = textarea;
// then you can use:
wrapper.element.innerHTML = ...;
@Basj better yet, use a plain object that stores both the elment and the data.
 
@connorspiracist emberjs.jsbin.com/AVOGEMA/1/edit .. created but its not showing up the form
 
ok so a wrapper is something that can contain something else ?
 
9:11 AM
@Basj In a general sense, yes, that's all it is
 
as a conclusion @JanDvorak , is this really bad :
var tb = document.createElement(textarea);
tb.myparameter = 126

?
 
@dystroy cool :)
 
@BenjaminGruenbaum Ah :D
 
Though it is often used to simplify an interface or serve as a facade
 
@BenjaminGruenbaum You don't see any problem ? Is this pattern "common" ?
 
9:12 AM
@Basj yeah... because properties set directly then go to the wrapper, not to the element, even if the element has these.
 
@JanDvorak but if I only use these 2 lines
var textarea = document.createElement(textarea);
tb.myparam = 126

no wrapper is created ?
 
@Basj correct
 
so is there a problem to use these 2 lines ?
 
but then 1) myparam might become significant in future versions of the DOM API and 2) IE<8 (or so) will simply drop the assignment.
 
Ok thank you
@JanDvorak I wanted that if we use $(function(){$('body').on('mousedown', 'textarea', function(event){if(event.which==3){$(this).remove()}})}); (somebody helped me yesterday about this) , the whole object (including wrapper) is deleted as well
 
9:17 AM
@Basj wait, you've got jQuery at hand?
!!tell basj jquery data
 
yes
 
@JanDvorak oh okay ! So I can associate a float to any textarea with this ?
 
better use your own data structures, however
otherwise you run the risk of naming conflicts
 
what do i do
do they call fake functions doop?
lol
 
9:40 AM
@JanDvorak can I do this :
 
@connorspiracist Found the error. I wasnot creating the object that I had initialized in auth_manager.js file. I had to do that. But Now the issue that i am having is store.find('user', id) says Uncaught TypeError: Cannot call method 'find' of undefined . Store is not initialized or something like that i guess
 
document.body.onclick = function(e)
{
  var tb = document.createElement('textarea');
  tb.data( "foo", 52 );
  document.body.appendChild(tb);
};
in order to store jquery data ?
 
@Basj $(tb).data(...
 
ok @dystroy
 
But why don't you simply do this ?

    var $tb = $('<textarea>').data("foo", 52).appendTo(document.body);
 
9:42 AM
^
 
hey people... im stuck :( jsfiddle.net/rusticblonde/T9Gw7/19
any ideas why that animation wouldnt work :S im lost! :(
 
thanks @dystroy!
 
opacity should be given as a number, not as a string
 
@dystroy , then with your code, I cannot do $tb.style.border = 0 for example, why ?
 
@Basj You should have a look at the whole jQuery API documentation, it's not that big
 
9:48 AM
@KirstyHarris you have a syntax error; the first curly brace is unmatched
 
here you would do $tb.css('border',0)
 
the first two, to be exact
and their respective parentheses
 
argh.. can u tell me what line jan?
it isnt showing up for me :(
 
@KirstyHarris run jshint
and TidyUp, too
 
is that on the fiddle?
 
9:51 AM
@dystroy can I ask you some help on a last thing ?
 
@Basj No. But you can ask the whole room
 
Ok :)
 
@KirstyHarris yep. Check the top bar
 
Do you know if @font-face works with .ttf in IE11?
 
ok.. its amazing how this works where i found it :s
 
9:54 AM
@KirstyHarris did you get it fixed?
 
@dystroy : I would like that when I CLICK+ DRAG on background (jsbin.com/uDUdUWa/1) then the whole displayed area moves
 
nope lol trying to go thru i now connor
 
that's the good framework for that in your opinion ?
I was about to code : 0/ Detect CLICK+DRAG 1/ Do a loop on all textboxes 2/ Reposition each textbox
 
Why don't you simply scroll the container ?
What you do is wrong
 
@dystroy because I want an infinite container
 
9:56 AM
argh... i give up haha h... laters x
 
such that you can always scroll left or right
 
@Basj Early typewriters lacked keys for parentheses, so people had to use forward slashes with an overstrike (which was later dropped), but why do you use forward slashes to denote list items?
 
I get it. I did similar things with the background made by a canvas and zoomable. But you'll have to experiment, especially on the performance side, the simple fact you move native textareas might be (or not) a problem on some browsers.
 
@JanDvorak : where forward slashes ?
@dystroy : oh you did a similar experiment ?
 
@Basj in the sentence you linked to; also, I you accidentally a verb.
 
9:59 AM
@JanDvorak oh sorry yes :)
 
@KirstyHarris jsfiddle.net/T9Gw7/23 you didn't have the toggle out function in the right place
 
@Basj Not an experiment : a commercial project (in a private network) where the map of a plant is dynamic and interactive, and zoomable.
I also have a few similar things in extensions I made but they're for french games (in French) so it might be hard to dive into them. This ones are open-source
 
@dystroy : great! Is a part of this opensource? I want an infinite blackboard, zoomable... That's why I cannot use a standard container which has a top left corner => text cannot be written on the left on this !
@dystroy I'm french
 
@KirstyHarris oh, i didn't update it jsfiddle.net/T9Gw7/24
 
Do you know braldahim or Mounty-Hall ? You might want to create an account on braldahim...
 
10:04 AM
 
@Basj You might be interested by this old thing : canop.org/braldop/groupes/canop/map.html
 
@dystroy oh yes !
what did you use ? HTML5 <canvas> ? something like Fabric.js ?
 
canvas
And there's some info on canop.org/braldop
 
is document actually classed as an element?
 
@connorspiracist document.documentElement
 
10:10 AM
@JanDvorak so, document isn't right?
 
@dystroy it will be difficult for a JS noob like me to dive into dizaines de fichiers sources ;)
and to know where is the important part for scrolling ;)
 
It will just be difficult to keep being a noob after your understood them
 
no, it's a document node
 
that's true :)
more or less, you used <canvas> things ?
 
10:12 AM
in order to scroll / position objects ?
 
yes, the whole is a big canvas, and some html element (menus mainly) are displayed over it when necessary
The algorithms I made for scroll and zoom can be easily taken from my code
 
@dystroy it is very similar to the one I did here github.com/basjo/bigpicture/blob/master/bigpicture5.py (I already did my infinite blackboard zoomable tool in Python)
funny
@dystroy : I'm reading and trying to understand, when you need to redraw(), do you loop on all objects and reposition them ?
 
@Basj I think so but they're Javascript objects, not dom elements, so it's fast. There's also a trick which avoid drawing when the map is zoomed out (the map is encoded in a png with carefully chosen colors).
 
Sj objects ?
 
typo. edited
 
10:20 AM
@dystroy You mean you set dom elements using absolute positioning? In that sense?
 
sorry. What do you call JS objects and not DOM ?
 
DD.
oie... @AbhishekHingnikar
 
@dystroy in my Python implementation I used 2 coordinates systems.
Each item has a x,y (which can be a float!!)
Then the display area can be (0.0,0.0) top left to (0.5, 0.5) bottom right
and then for each element I compute the true displayed x,y (integer here)
 
I rarely move or create dom elements (textarea, images, divs) and so : I mostly draw on the canvas using canvas functions, that's much much faster
@Basj well, me too.
 
@dystroy funny we did the same way!
 
10:23 AM
except that in this specific application it's not [0,1]
 
If you can draw it on canvas, would definitely be faster
 
yes BUT I neet editable textboxes
 
@Basj there aren't many ways to do that
 
@dystroy yes...
and editable TEXTBOXES on a canvas is a bit difficult
 
@Basj When you need an editable textbox, yes, use a DOM element
 
10:24 AM
you mean temporary and then delete it ?
 
but the more you do in canvas, the best it will be.
@Basj It depends on your application...
 
infinite blackboard where you can put some text
so there are many ways for trying to do this...
What would you do @dystroy in order to add scrolling to http://jsbin.com/uDUdUWa/1/ ?
 
don't keep in memory hundreds of textareas, just create them when needed and drop them when not visible
 
so you woulnd't use <canvas> but DOM textboxes ?
 
I would use a canvas if I had other things to draw. Not if there are only textboxes.
Note : I must work, can't give you more time now...
 
10:29 AM
Ok
 
@connorspiracist you are a god! thankyou!! xxx
 
Four consecutive cats... What are the odds ?
(and why is the octocat apart?)
 
I'm sure there are many libraries for emulating textboxes on canvas
 
@Neil Emulating completely a text field is a PITA
(I know that, I made textareas in C)
 
@dystroy I thought a PITA was a sandwich
 
10:36 AM
@Neil no, a pita is a sandwich
 
I wouldn't try to emulate one myself though
Lots of ways that could go wrong
 
10:52 AM
Is there a JS or jQuery syntax for :
for ALL textarea in body  as tb
do :
    tb.xposition =
(pseudo code)
 
!!tell basj jquery css
 
thanks !
thanks @JanDvorak : I have now something very close to working ! jsbin.com/oZijEZa/1
 
scrolling is nearly working... do you have an idea for setting textarea 's position relative to the latest position ?
 
11:04 AM
@KirstyHarris no probs :)
 
@JanDvorak how to add +10 px to the current x,y position of a textbox ?
$(this).css('left',$(this).css('left') + 10)
is there a cleaner way ?
 
$(this).css("left", "+10px")
 
@JanDvorak if instead of +10 (string) , the value is in an integer "xoffset" ?
 
@dystroy sorry had to go afk
I wonder if there is a better way to do db.off
 
@Basj You mean $(this).css("left", "+" + xoffset + "px")?
 
11:14 AM
@dystroy there has to be a better way than to always do db.on and db.off explicitly
Like like C# using or Java try(..) or Python with
 
@Neil I tried here but it always restarts on top left, can you try to click (add a textbox) and then CLICK + DRAG
 
@dystroy also, you can work on objects directly no need to pass through arrays with spread.
 
@BenjaminGruenbaum db.on automatically, and append db.off on a timeout?
 
@JanDvorak no, that wouldn't work.
I want something like:
Promise.using(db.on).then(/* in this promise chain, I have access to the DB, when it is collectable (the promise, it calls off */);
 
or db.with(function(con) {})
which is more like C#'s using
 
11:17 AM
Yeah, I want the promise library to do it though.
 
without the promise library, it's more like C# :P
 
The promise has knowledge of collection - when the promise can be collected
 
it seems that this positions on left's corner + 10px
it doesn't add +10px to the current position
 
So it can be implemented on the promise level.
 
@Basj is the current position specified via position:absolute?
 
11:19 AM
@JanDvorak yes
 
@BenjaminGruenbaum dunno about that
 
@Basj fiddle pls
 
 
@Basj Yeah, it seems to be working
You just can't see it as it's moving
You might want to do a check to see if you're in the same position you were last time it was called
 
@Neil no it always restarts on top left
 
11:21 AM
otherwise, repeated calls might make it flicker
@Basj When I release mouse click, it shows up where I release mouse
that is what you wanted isn't it?
Except you want it to move when you move mouse also
 
@JanDvorak @Neil I want to move the whole display area, and when I click+DRAG, the textbox always restarts from top left, instead of restarting from last position
 
otherwise, repeated calls might make it flicker
 
It works for me just fine
 
I'm using chrome
@JanDvorak What are you using?
 
Chrome
 
11:24 AM
@Basj Or more importantly, what are you using?
 
Firefox, but I just tried with Chrome, and the same : when i click + drag on background, the textbox always restarts on top left of the window
here is the latest jsbin.com/oZijEZa/6
with Chrome and Firefox, the same : textbox always restarts on top left when CLICK + DRAG on background
 
@JanDvorak No : the connection has to be released immediately so that other requests can use it.
 
@BenjaminGruenbaum how?
 
That's a good question :)
 
db.with() would be simpler to implement :P
 
11:27 AM
@BenjaminGruenbaum I don't get what you mean here
 
@dystroy basically he wants the db.off to be automatically fired
 
@FlorianMargaine only the user code knows when the connection can be released. That's the same problem than with the callback spagetti, only is it cleaner and easier to check when using finally
 
@Basj jQuery should account for any incompatibilities between browsers, so it's strange that it doesn't work for you
What it does for me is, I click and drag, and while I don't see textarea, when I release, it is exactly where I released
 
@Neil : on your side, a textbox doesn't restart on top left ?
ok
 
@dystroy you should write a using(resource,fn) which does Promise.try(resource.on).then(fn).finally(resource.off)
 
11:30 AM
@Basj Actually, I never see a textbox at the top left
Not sure why that is
 
Maybe I'm doing it wrong :
Imagine left = 100.
I would like :
$(this).css('left') + 10 => 110
but instead I get
'100px10'
because there was a string concatenation instead of integer addition...
 
(Promise.try is the same as Promise.cast().then in case you're wondering)
 
@Basj I would try to use absolute positioning
 
@BenjaminGruenbaum That doesn't bind the connection/resource, does it ?
 
Leave whatever style it initially has, but the first time you click down, it must have absolute positioning and you specify the left and top absolute values according to mouse coordinates
Adding x or y offsets to existing coordinates sounds counter intuitive, though you may get it to work that way too. If you have no reason to do it that way, I would suggest just using absolute coordinates
 
11:35 AM
@dystroy adding a .bind(resource) at the end should
 
@Neil I use absolute now
but how to get $(this).css('left') + 10 => 110 instead of concatenation '100px10' ?
 
What aren't clear for me are 1) the advantages 2) how you would end with something as clear and concise as with this
I use this API every few lines, the goal was to avoid repeating things and let the use of the API be obvious and not cluttered by how the API works
 
        using(db, function() {
            return Promise.spread(db.deletePings)
            .then(function(){
                    return this.fetchUserPingRooms(publicUser.id, lastPingTime);
            }).then(ack);
        });
the point would be to have something like this
this way you don't have to care about closing the connection, it's automatically done
you just ask for the resource, and it's automatically disposed of
 
Hum... this is interesting
It involves one more indentation level and looks a little more like where I come from (callbacks) though, and it's not clearer. I'll think about it, automatic call of db.off is a good point.
 
@FlorianMargaine what if you stash away the promise outside the using scope?
 
11:54 AM
@dystroy if you forget .finally you're fucked.
I mean something like:
    using(db,function(instance){
        return instance.on([room.id, publicUser.id])
            .spread(db.deletePings)
            .then(function(){
                    return this.fetchUserPingRooms(publicUser.id, lastPingTime);
            }).then(ack);
 });
 
@BenjaminGruenbaum Yes. It's hard to forget it as it is but I agree that not having to put it would be better.
 
Then, you can't forget finally clauses.
 
That's what Florian showed
I'm not sure I prefer to reintroduce one level of callbacks, I like the fact the steps appear sequential in my code
But I'll probably think more about it
 
Hi everyone. Yesterday Miszy helped me but until now I cannot understand how to integrate the code with my code.. any help pls? stackoverflow.com/questions/19875801/…
 
@BenjaminGruenbaum how does Perception Infinity sounds ?
// asking since your knowledge of English is fairly superior to mine.
 
12:09 PM
@JanDvorak : I want to add something like :
var tb = document.createElement('textarea');
tb.onblur = function(e) // when loses focus
{ if ($this).text == '' { $(this).remove() } }

Can you help for real JS code ;) translation ?
ie if a textbox looses focus with empty text, destroy it
 
@Basj Do your jquery turorials, you mix vanilla dom manipulation functions and jquery ones where jquery ones are much concise and obvious once you know them
 
@dystroy, ok I think I need this (jquery doc and tuto).... Can you help on this last thing?
 
Okay guys ... how does the name Perception Infinity sounds ?
 
@AbhishekHingnikar not bad, for a music club
 
@AbhishekHingnikar What does it mean ? What is it the name of ?
Might be a little awkward if you give this name to your son, though
 
12:18 PM
@AbhishekHingnikar :P
 
@dystroy great it works now thanks to tutorial
 
not a huge fan
 
jsbin.com/oZijEZa/9 just to be sure : does it still work in your browser ?
now it works here !
Thanks again for all, I have to go now :)
see you!
 
@Basj see you later
 
o/ Guys.
 
12:33 PM
@AbhishekHingnikar Sounds like you're trying too hard to find a good name to me :p
 
Testicular Sound Express.
How's that name?
 
Lovely.
 
@rlemon for a guy or a girl ?
 
@user2971827 given you're using textspeak, do you think we want to help you?
 
12:36 PM
maybe?
 
@dystroy unisex
 
OK... for starters var new = is always going to be invalid syntax, no matter what happens further.
And this is definitely invalid syntax :-)
(what should I write here since there is no id?)
!!tell user format
 
@user Format your code - hit Ctrl+K before sending and see the faq
 
sorry if I'm new to this.
 
12:40 PM
> but I don't know how to integrate it with my code.. help pls?
LOL no
 
LOL ok
it's not so easy
 
the point is to reproduce it, I mean
 
for starters, what do you mean by "integration"? It's kinda unclear what you're asking now.
 
@Jan I'm navigating on dbpedia. I want to catch the default namespace of the link that a user click
 
still no idea what kind of integration you have in mind
 
12:42 PM
@JanDvorak Good to know
 
so I'm taking all the link of the current web pages and I have to take also the default namespace
 
Programmers who try to do things like that are asking for trouble. Figure my boss named a database column "KEY" once
I wanted to shoot him
He might as well have created a column named "DROP DATABASE"
 
@user2971827 do you have trouble obtaining an XML document from an AJAX response?
 
@Jan.. no the problem is retrieving the xmlns:rdf
 
also, why do you want the default namespace?
@user2971827 I thought you had already solved that?
 
12:45 PM
because sometimes the rel attribute is rdf:type and has no sense to have it
yes with that methods it's ok but it's difficult to put it into my method
 
let an XML parser handle that
 
ok
thanks
sorry foor my noobies
have a nice day everyone
 

« first day (1185 days earlier)      last day (3777 days later) »