« first day (321 days earlier)      last day (4625 days later) » 
01:00 - 22:0022:00 - 00:00

1:33 AM
Heads up folks: the Hotel Room Block at the jQuery Conference Venue is almost gone! Better get in now... http://t.co/sWF88Ma
 
2:21 AM
RT @paul_irish: Tiered, Adaptive Front-end Experiences & delivering greatness across all browsers http://t.co/WTknNal
 
 
4 hours later…
6:23 AM
hi
anyone there
 
0
Q: Convert Ctrl-space to non-break-space (for FL&U)

BenjolThis is a mini-script to convert Ctrl+Space to a non-break-space (0x160, not  ). You can copy-paste the code below (if you want to change the includes, for example), or check out the gist here: Click HERE to install the user script. Click HERE to preview the code. // ==UserScript== /...

 
7:21 AM
RT @ryah: #nodejs passes jquery in number of github watchers http://t.co/C6BiEgx
RT @maboa: \o/ jPlayer 2.1 is out, lots of changes, fullscreen mode, new skins, better compatibility across devices + bug-fixes! http:// ...
RT @assaf: Introducing Sideline, a CoffeeScript shell for your server http://t.co/EJOnfZB
RT @ChromiumDev: Passing Typed Arrays to Web Workers: http://t.co/tukGPgH ^eb
 
7:33 AM
RT @johnallsopp: My latest article (no tool this time) on the Selectors API - possibly the best new DOM feature ever! http://t.co/mlRXvcD
RT @tmpvar: jsdom 0.2.4 released, changelog: http://t.co/amddR6y -- better error handling, inline event handlers, and some element.style ...
 
8:03 AM
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$('#buttonId').click(function(){
// Validating input
$.ajax({
type: 'POST',
url: 'http://xxx.ru/Service1.asmx',
data: {'_message':'hello world','_name':'john smith','_email':'gglebati@gmail.com' },
dataType: 'json',
contentType: 'application/json; charset=utf-8',
success: function(r){},
error: function(e){}
});
});
</script>
And i have a error: Cannot call method 'click' of null
What the problem?
 
 
1 hour later…
9:17 AM
@GLeBaTi It means that the element #buttonId does not exist. Also, use the fixed font button to format your code here
 
 
1 hour later…
10:22 AM
Just read the good parts (in an hour). there is a lot of good stuff in there
I recommend everyone reads it.
 
10:53 AM
Morning
I also highly recommend Crocky's book.
 
 
1 hour later…
12:19 PM
RT @stevefaulkner: useful testing by @iheni WAI ARIA support on iOS http://t.co/GyhKL68
 
1:06 PM
I assumed most here had read it
 
1:18 PM
hi! Where can I read how to implement a simple object in javascript with functions and variables?
 
@duality_ google
:-D
 
AMH
1:34 PM
0
Q: call webservice functon using javascript and HTML5

AMHI have a web service that contain function return array of bits I want to use javascript and html5 to draw this array of bits in imagebox for example , the array of bits form image <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="D...

@duality
@Neal @Loktar
 
eh Im not really sure @AMH Im not too great when it comes to asp.net
Im a js/canvas guy mostly :P
 
AMH
@Loktar no problem, thanks a lot
 
how do you do strike-out text in chat?
 
1:55 PM
Can I provide a redirect link for twitter share popup window?
 
@LesterTheMolester what does that, I don't even?
 
Hey, anyone used javascript to add drag and drop functionality before?
 
@Greg I create a javascript application using facebook and twitter api... I want a redirection from the twitter popup window after the user submits a tweet. With the facebook you can provide a redirect_uri parameter where you can put an url where you want to redirect. Is there anyting like that in twitter?
 
@Wezly yeah. Don't like native HTML5 drag-drop, but have found jQuery-ui the most simple and extensible way of doing most things.
@LesterTheMolester yes.
 
@Greg I need to drag element1 on to another element.. and pass element1's id to a function. is this easily done in javascript?..
 
2:09 PM
@Wezly jqueryui.com/demos/draggable is a good starting point
 
thanks
I think what i need to do is simpler, because I don't need the element to remain where it is dragged i just need to pass the ID around
 
lol .. your name really is @LesterTheMolester.. I thought @Greg was just making things up.
 
@Wezly you can customize it, take a look at the right side of the page I linked
 
@LesterTheMolester Looks pretty sweet, I thought I would be able to do it without Jquery :S
 
Anything done with jQuery can be done without it. Just depends how much of a time investment you want to make.
 
2:15 PM
@Wezly jQuery is just JavaScript ... nothing magic. If you don't want to use jQuery, you could look at the source code (how jQuery UI does it) and make your own.
 
@Greg fair play
 
@Wezly yes you can, but if you want it your own way, you must make the things that the jquery is alredy done.
 
@LesterTheMolester ...
 
Thanks will have a look.
 
@Wezly I mean an interface over html5 and old browser implementation...
 
2:18 PM
ok, one other thing, anyone know a good resource/class for character/symbol escaping.. ?
 
@Wezly What kind of escapeing? for url escape use encodeURIComponent(), for other types use simple RegExp s
 
@LesterTheMolester I'm not really sure what I need. its just for peoples names. they won't need to enter symbols but i tested it with a few and it broke my script..
 
@Wezly what was the error message?
 
@LesterTheMolester hang on i'll try it again.. I think it was to do with the fact there was a '\' in there which escaped the rest of the function..
@LesterTheMolester Uncaught SyntaxError: Unexpected token ILLEGAL
 
stackoverflow.com/questions/7284739/… why is live getting upvoted yet delegate is not?
I thought you should always try to use delegate over live
 
2:26 PM
@Wezly do you use any sintax higlighting editor?
 
Yeah
TextWrangler
 
@Wezly ahha, the problem is that, sometimes on osx editors some extra chars are injected...
@Wezly I'm am often have the same problem, the solution is jsLint... jslint.com
@Wezly it show the concrete position where are the invisible chars
 
@LesterTheMolester You've lost me slightly, I'm just trying to escape User Entered symbols.. my code works
maybe not escape, possibly just replace them with html replacement..
 
@Wezly user enters text symbols into an input field? Symbols like @ * á? Or emotion symbols :-)?
 
@LesterTheMolester User enters text in to input field.. IF they enter symbols I want to replace them with safe characters that don't effect the script..
for example entering name BOB\ the backslash escapes the rest of my script..
 
@Neal Thats the monkey.
 
@Wezly whats a monkey?
 
about.com is worse than w3schools.com!
 
@Wezly why r u sending me back a link i posted?
 
2:44 PM
@Neal Because you asked me what I said a monkey was.
 
idk wf that means...
 
I meant.. "thats what I am looking for"
 
ahhh haaa...
why ddnt u just say that? :-P
 
because monkeys are so much more fun..
 
ahh ha....
 
2:48 PM
Clarity and simplicity - elegance. In all things. Including communication.
 
@RyanKinal :-D
 
:-D
 
@Neal :D
 
And now back into hiding so AMH doesn't realize I'm here.
 
Stack Finishing School..
 
2:49 PM
@Xavier ahhh where have u been hiding? lol
 
@Neal buddy i've been on stack consecutive for like 22 days ! i've been working :D
 
@Xavier ahhh haaaaa
ddnt see u there lol
u havent been here
 
@Neal whilst i have you here, javascript setTimeout reset ? i need to reset a timer on an animation so i was thinking setTimeout(timer) invoke the timer += 1
@Neal ya i havn't been in the chat ;)
 
@Xavier lol clearTimeout(timer)
 
win win
brb then lol
it's a very interesting project im working on, ill fill you in on it somepoint later
 
2:54 PM
lol @RyanKinal you cant hide forever!
 
@RyanKinal AMH?
 
@Loktar Shhhh!
@Neal A n00b I helped out a couple days ago.
 
ahhh haaa
 
@Neal that clears it to 0?! i want to reset the timer on an animation invoked i.e. wait 5 seconds then play, but if the animation runs again whilst the original 5 seconds are not over then wait another 5 seconds !
 
@Xavier huh?
make a fiddle..
 
3:00 PM
ok gimme a sec
 
@Xavier I think the problem is that you'll want to clearTimeout and then setTimeout.
 
Reckon i could fake a drag and drop using onMouseDown and onMouseUp?
 
@Wezly That's the general solution ;-)
 
@RyanKinal Sweeeeet, that i can do..
 
3:11 PM
/*** skeleton of drag & drop ***/

var down = false,
	drag = false,
	dragged,
	dropped;

elem.onmousedown = function(e)
{
	down = true;
	dragged = e.target
}

document.onmousemove = function()
{
	if (down)
	{
		drag = true;

		// do "on drag" stuff
	}
}

document.onmouseup = function(e)
{
	if (down & drag)
	{
		dropped = e.target;

		// Do "on drop" stuff
	}

	down = false;
	drag = false;
}
(not at all modularized or extensible, lol)
 
@RyanKinal thanks for your advice, could you check the fiddle and see where im going wrong ? jsfiddle.net/kq5aS
 
@Xavier Remove the perentheses on timer() here: var xtime = setTimeout(timer(), 5000);
 
@Xavier whats the issue again?
 
With the perens, you're immediately calling the function timer, which puts the div back into place.
 
3:26 PM
OmniAuth - Great idea, but I wish it wasn't in Ruby
@Xavier jsfiddle.net/vRNZf/1 (added an if to check for animation)
 
@RyanKinal thanks, i've actually got it working now, i use a variable and increment it with the value i want to increase the time by
 
@Xavier Good solution :-)
 
it's what i asked Neal about first but i dont think he understood what i wanted to do
:D
 
That'll happen
So, I'm apparently getting an Acer netbook with Ubuntu installed... completely free. I'm excited to have a linux platform to work with again.
This means I'll finally try Node :-D
 
@RyanKinal Another question about the drag and drop cheat... the element that i click on to drag has text in it, and as i drag i select the rest of the page.. I would like the text to be selectable in the element but i don't want it to select the rest of the page.. any idea how to disable the 'selectabillity' of the page?
 
3:37 PM
@RyanKinal howd u do that? i want a free computer! :-P
 
@Neal A friend of mine bought one a while back, and doesn't want to "learn to use it" (i.e. Ubuntu)
 
108
Q: css rule to disable text selection highlighting

For anchors that act like buttons (for example the Question, Tags, User, etc at the top of the SO page) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? I realize this could be done with javascript and a little googling yielded th...

 
rofl
 
@RyanKinal lol just install a different os :-P
 
@Neal Psh. I'm not gonna tell him that. I'm getting a free netbook (250gb hard drive!)
 
3:39 PM
@RyanKinal :-P
1 min ago, by Neal
108
Q: css rule to disable text selection highlighting

For anchors that act like buttons (for example the Question, Tags, User, etc at the top of the SO page) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? I realize this could be done with javascript and a little googling yielded th...

 
@Neal I like it!
In terms of drag and drop, I'd probably add a class to <body> when the drag starts, and remove it when the drop happens.
Anyway... lunch time. back in a bit.
 
cool thanks
 
user1385191
flash has features like "mouseEnabled" and "mouseChildren"
 
user1385191
the former disables mouse interaction, and the latter disables the mouse for children of the element
 
3:43 PM
Biggest thing I hate: lyrics sites and other places that try and prevent you from selecting text. So much rage. It's not like I can't get the text anyway...
and don't fuck around with my right-click unless you've got some seriously good reason to do so.
 
@Incognito I'm disabling selection for the benefit of the user as they drag elements.. I would like them to be able to select the rest of the time.
@MattMcDonald Not in the flash chat room atm but thanks.
 
user1385191
it's something I'd like to emulate in the DOM or have implemented
 
@Wezly Oh no I wasn't raging on you. I just hate what the most popular use of such techniques are.
@Wezly Flash is JavaScript.
 
user1385191
close, anyways
 
@Incognito no worries dude!... Flash is Actionscript...
 
3:46 PM
@MattMcDonald Sorry, LiveScript/MocaScript/JScript/JavaScript/ECMAScript/ES3/ES5/???????????????????
Duh, I forgot as3.
 
user1385191
as1 was essentially JS
 
user1385191
as2 was bonkers, and as3 is essentially java + js
 
@Incognito fair enough.. But can i use mouseEnabled and mouseChildren in JS?..
 
user1385191
no
 
That's the implementation of ECMA, not the language it's self.
 
4:12 PM
0
Q: Search input area autogrow - how?

japanwormI've tried for many hours to style my searchform. I managed to get it all done after some research. I even managed to get the text highlighted when on focus using javascript (no idea if there's a non-javascript solution as well). anyways, I've been googling around and trying out all sorts of thin...

 
4:42 PM
@Incognito Re: lyrics sites: The ones I really hate are the ones that encode the lyrics as HTML entities, so you can't even copy/paste the source -_-
 
@RyanKinal Yeah, but then even still, you CAN get the stuff. like wtf?
 
@Incognito Indeed. It's pretty lame.
 
Actually, I think webkit inspector will decode on-the-fly for you.
 
Oh yeah, it will.
 
4:59 PM
So I'm working on a widget, and I'm wondering about how to deal with the config options for it
basically, I think I'll just make it a JSON object, but structuring it in a way that makes sense is what I'm after.
 
@Incognito Sounds like good things to be thinking about
 
Sorry, I got distracted. I'm looking for some general advice becuase it gets complicated.
Right now, you have layers (which are data sets projected onto a google map), and display.
Display configures style, nav bar position/size, and width-height of the whole thing
layers breaks into groups, and individual data sets.
For instance...
"layers" : [
            { "Water"     : [
                { "Beach"        : 1 },
                { "Outdoor Pool" : 1 }
            ]},
Now, there could be quite a large number of layers in total.
 
user1385191
wow
 
The individual data set needs to be either on/off by default, which needs to be easy to configure.
 
user1385191
drag + drop in JS is hard
 
5:08 PM
@MattMcDonald Steal the stuff from the jqueryui base.
 
user1385191
I'm almost done
 
user1385191
just need a mousemove fix and it'll work
 
@MattMcDonald How much time did this that take you? 6 hours?
Drag n drop isn't native at all.
I hope you made it something you can re-use :P
 
... jQueryUI's drag and drop sortable isn't hard.
 
jQueryUI! Drink!
 
5:11 PM
@Nathan Matt's a vanilla JS kinda guy.
 
glug glug glug
@Incognito I know...
 
Once 3:30 rolls around, I might actually play the SO Chat/jQuery drinking game. We'll see how long it takes me to finish my beer.
 
I'm new here. There's a drinking game for jQuery?
 
@RyanKinal Drink every time someone says jQuery?
 
@Incognito That's the plan
@WarriorBob I kind of made it up a couple weeks ago
 
5:13 PM
I gotta hang around here more often then.
 
Hope you've got a good liver.
 
Somebody suggested playing it with the SO front page. I don't think I have that good of tolerance ;-)
 
I do my best technical work after a drink and a half, so if I show up during the quiet times maybe I can get some productivity out of it :)
 
@WarriorBob Ballmer Peak huh?
 
Pretty much!
 
5:15 PM
I've been planning on working on a pet project this weekend. It might involve Absinthe.
 
user1385191
done
 
user1385191
it took me about an hour
 
@MattMcDonald Looks good
Robust
 
user1385191
the key is comparing the old x+y to the "new" x+y
 
user1385191
5:23 PM
hence the closure
 
user1385191
you have to calculate how much the clientX+Y have "changed" and translate the element by that distance
 
user1385191
 
I suggest you name the project Naked Cops.
 
@Incognito lol. I'll keep that in mind.
 
Hello, I have a problem with jQuery, this is not working:
$('#playlist:not(#vlist)').toggle...
It continues to toggle even though I click the #playlist a
 
5:31 PM
@askingDude Try to jiggle the Flux(capacitor).
 
wha?
 
user1385191
wait...
 
user1385191
you're running a pseudo-selector against an id?
 
Ok
then?
 
Okay okay. Put yourself in our position. Does it look like we know what your problem is? You haven't even tried to make it easy for us to help you, you posted less than one line of code.
 
user1385191
5:33 PM
an id is supposed to be one element
 
Maybe matt's a wizard, I don't know.
 
@MattMcDonald might be a wizard. I wouldn't put it past him.
 
I am sorry@Incognito I didn't mean to be like that, I just hopped that it's a simple thing to solve..(maybe a spelling mistake).
 
Mostly because he might be a wizard, and he might turn me into a toad or something.
 
user1385191
what is this selector trying to accomplish?
 
5:34 PM
I know that an id is supposed to be only one in a document, but it is..
 
user1385191
and what are you trying to fetch?
 
Ok, when I click at #playlist it animates down & ajaxs a call to get the playlist from a db, then when I click on an anchor in the #playlist that was generated it should ajax another thing but it also animates the #playlist up again...
 
user1385191
what elements are you trying to grab?
 
(I used the .delegate() method to accomplish the click event after the ajax call, on the anchor element)
 
user1385191
5:37 PM
@askingDude you'd make a fine politician since you dance around every single question I ask you
 
@Incognito lol
 
@MattMcDonald The real politicians give empty answers. Ask not what you can do for your country, but ask what glass envelope you can synergize for your country.
 
@Incognito I have updated the document.
 
possssst the link
here
so we can see it
 
5:39 PM
Ah, event bubbling issue
 
user1385191
what is this: $('#playlist:not(#vlist)').?
 
@MattMcDonald He's trying to get the click to happen when #playlist is clicked, but not #vlist (which is a child of #playlist)
 
It is the event trigger when I click on the #playlist, I want it to animate down/up and ajax a call to get the playlist
Thanks @RyanKinal
 
user1385191
log the event target
 
user1385191
if it's what you don't want, ignore it
 
5:40 PM
@askingDude Your HTML is wrong fyi.
<section id="playlist">
    <h3>Playlist<br/>----<br /></h3>
    <section id="vlist"></section>

</div>
^ Spot the problem?
 
fyi=?
 
for your information
 
</div
</div>
is it?
 
user1385191
br tags inside headings = no-no
 
user1385191
margins/padding, please
 
5:41 PM
closing tags close something that's been opened. Where are you opening that div in the first place?
 
I didn't want to enter all my css. :P
It doesn't work yet. :(
 
@MattMcDonald Perhaps elaborate on what you mean by "log the event target" - I get the feeling @askingDude doesn't quite understand.
 
Did I spot the problem(closing div instead of closing section), is it that? (@Incognito)
@RyanKinal I don't...
 
user1385191
my knowledge of jQ events is minimal, but that's an option to avoid stopPropagation
 
So what should I do? (In simple English please)
 
user1385191
5:45 PM
if(evt.target !== badNode) //do something
 
@askingDude If you open something, you close it. Apply that logic to your question.
 
@MattMcDonald this?: e.target!== $(#vlist))
 
user1385191
you likely know jQuery events better than me
 
user1385191
I just know that there's enough magic behind the scenes to conjure up the dead
 
5:50 PM
@MattMcDonald You are a wizard!
 
@Incognito my bad.
 
@MattMcDonald You're a wizard, harry.
 
Here (not working though):
http://jsfiddle.net/TDSGW/3/
 
Why do you hate whitespace so much?
 
I just wanted to have emphasis on the new code, and ask for the solution. I wanted to make your life easier.
 
5:57 PM
The HTML is code.
 
ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
 
Make your life easier while your at it, don't treat whitespace like it's leprous.
 
If we had the time... we could replace the US guys code with 5% of new code
 
Did anyone find the problem, I guess it's a js problem because all of my site is acting with no js.
 
On a short note: DO NOT use jQuery for any REAL application.
 
5:59 PM
Here for you @Incognito jsfiddle.net/TDSGW/4
 
user1385191
@IvoWetzel what was the epiphany?
 
/ragequits
 
@MattMcDonald Kinda, they hard coded in like... a trilliong $ selectors
guess what... our API's have changed to be DOM indepenent :D
So of course, they expect things to magically work even without the DOM now :)
 
user1385191
all canvas?
 
Ok thanks anyways guys, I'll try to fix it myself. (Thanks @MattMcDonald)
 
6:02 PM
@MattMcDonald Well., independent :O Can't go into details
 
Our own @davemethvin lays out some rules of the road for using jQuery's .data() APIs: http://t.co/yZBpeT5
 
user1385191
ha, I'm sure it's interesting
 
Ok I found it, quick ugly fix:
$('#vlist').show(); when 1st toggle
$('#vlist').hide(); on 2nd toggle
Thanks anyways
 
user1385191
you should look into closures for toggling
 
and , IIRC there was $.toggle() function
 
6:10 PM
0
Q: dyn.js is the new Rhino?

SteveDoes anyone know anything about the dyn.js project? Apparently it's a new implementation of JavaScript on the JVM, aka Rhino. I've only found this: http://jsconf.eu/2011/dynjs_-_100_invokedynamic_java.html Anyone know anything else? I'm wondering if its just a hobby project or if its going t...

 
user1385191
var toggleNum = (function()
{
  var num = 1;
  return function()
  {
    if(num === 0)
    {
      num = 1;
    }else if(num === 1)
    {
      num = 0;
    }
    return num;
  };
}());
 
@RyanKinal i know this doesnt belong here but I have no idea who else to ask, I have fixed my images getting screwy by putting them in a table for the website but the issue that im totally stumped on is that zooming in and out screws up the view...What am i suppose to do with that...The div sizes get bigger or smaller but the tables/images stay the same size...
safari is screwing me up big time
people have different zooms set for their browsers so its screwing it up
i really dont know what to do
 
var toggleNum = (function() {
	var num = 1;
	return function()
	{
		num = 1 - num;
            return num;
	}
}());
 
user1385191
probably could have used a xor
 
@JeffHodge I don't know what to tell you, sorry
 
6:14 PM
im now using JS to disable zoom
 
user1385191
var toggleNum = (function()
{
  var num = 1;
  return function()
  {
    num ^= 1;
    return num;
  };
}());
 
+!num?
 
^= should be faster
that's just a toint() > xor > float
the latter one is a Number(valueOf() )
 
8 mins ago, by Jeff Hodge
im now using JS to disable zoom
O_O
First, I don't even know if that's possible. Second, DON'T.
Accessibility. Nightmare.
 
i tried using tables but the divs are messing up..
 
6:40 PM
...
@JeffHodge you sound like you are writing spaghetti
Seriously stop it
Hire someone who can do web development instead
 
Sounds a lot like a WYSIWYG.
Make sure you tell the css each item is !important.
=/
ohhhhhhh opeth, why you so nice on the le programming.
 
in other news
we replace US guys preloader that was basically $.getScript(.... function(){...get next script...) with something written by us
loading time went from 3 minutes to like 8 seconds
 
 
7:20 PM
yay for moving fb stuff onto SO
more use for close votes
 
user1385191
7:37 PM
how accurate would a js preloader be? is there a real way to measure both the total bytes to load, and the bytes loaded?
 
Anyone tried backbone.js ?
looks overly complex
 
@Interstellar_Coder I think @Raynos is a fan
But I haven't seen him around today
 
user1385191
he'll come
 
@MattMcDonald Wait, we haven't said the magic word
ahem
Node.js
:waits:
 
10...
9...
 
7:47 PM
@InterstellarCoder what are you considering backbone.js for?
 
gnah, this counting down is repetitive, needs to be an API
$.countdown(10)! WHERE IS IT RESIG!?!
 
That's part of my problem, i don't know what to consider it for :-/
 
brb pizza!!!
 
8:45 PM
@MattMcDonald Google Maps API for Flash is being shut down./
 
user1385191
eh, that sucks
 
user1385191
I haven't used an external API like that for flash
 
user1385191
we just do small-time application work
 
I figure'd you might have. I'm actually just starting off stuff with maps api.
 
user1385191
flash is getting pushed to a niche market
 
user1385191
8:50 PM
something I think is probably a good thing
 
I've never been fond of it all.
Granted, I made stupid flash videos and games as a kid.
 
user1385191
as my drag/drop example showed, rich UI is very difficult in JS
 
user1385191
in as3, dragp/drop is about 15-30 lines
 
Doesn't some framework out there deal with rich UI in js?
Or do you mean it's naively simple?
 
user1385191
something.addEventListener(MouseEvent.MOUSE_DOWN, setDrag, false, 0, true);
private function setDrag(evt:MouseEvent):void
{
	something.removeEventListener(MouseEvent.MOUSE_DOWN, setDrag);
	something.addEventListener(MouseEvent.MOUSE_MOVE, beginDrag, false, 0, true);
	stage.addEventListener(MouseEvent.MOUSE_UP, endDrag, false, 0, true);
}

private function beginDrag(evt:MouseEvent):void
{
	something.removeEventListener(MouseEvent.MOUSE_MOVE, beginDrag);
	something.startDrag();
}

private function endDrag(evt:MouseEvent):void
 
user1385191
8:57 PM
that's it
 
Ugh just seeing a.s. gives me a headache.
 
user1385191
strip out the types and constants and that's very familiar
 
Oh it's not the language constructs so much, just bad memories of way too many keyframes and crappy vector graphics I made when first learning ;]
 
user1385191
I build most of my applications with a blank stage and zero keyframes
 
user1385191
anyways, in js:
 
user1385191
9:05 PM
something.addEventListener("mousedown", setDrag, false);
function setDrag(evt)
{
	something.removeEventListener("mousedown", setDrag);
	document.addEventListener("mousemove", beginDrag, false);
	document.addEventListener("mouseup", endDrag, false);
}

function beginDrag(evt)
{
	document.removeEventListener("mousemove", beginDrag);
	//stupidly complex drag code here
}

function endDrag(evt)
{
	document.removeEventListener("mouseup", endDrag);
	//terminate drag here
	something.addEventListener("mousedown", setDrag, false);
 
oh god...
I've created a monster
 
user1385191
I've just discovered vim's replace mode
 
user1385191
lovely
 
9:21 PM
function shield(obj, type, error) {

    var proto = type.prototype,
        store = {};

    function validCaller(f) {

        if (f === type) {
            return true;
        }

        for(var i in proto) {
            if (proto.hasOwnProperty(i) && proto[i] === f) {
                return true;
            }
        }

        return false;

    }

    function protectRead(i) {

        obj.__defineGetter__(i, function f() {

            if (!validCaller(f.caller)) {
                console.warn('Invalid read of property "' + i + '" of ', obj, 'by ', f.caller || window);
this is the craziest thing I've written so far
checking runtime access rights xD
will become really useful though
does not check functions yet
but that is the easy part..
 
01:00 - 22:0022:00 - 00:00

« first day (321 days earlier)      last day (4625 days later) »