« first day (117 days earlier)      last day (4838 days later) » 

user1385191
9:00 PM
coded around 700 lines of it
 
user1385191
bad memories
 
@MattMcDonald thats just you doing bad code
 
You don't have worse memories of trying to write cross-browser compatible javascript?
 
user1385191
definitely not
 
user1385191
I wrote a pong game in js a few months ago that was much easier
 
9:02 PM
hm
 
user1385191
I was really new to JS back then admittedly
 
user1385191
I've worked a ton with it lately
 
@Nyuszika7H Hi back ;)
 
Let's see how well this flagging feature works.
 
9:05 PM
@MylesGray Hi! :) I have to go after 2 mins :( I played around in MSO Sandbox.
 
@MattMcDonald really, cross-browser dom manipulation without a library? your crazy. Do you support IE6 ? Where's that pong game. I'll load it up in IE5 for mac and complain it doesnt work :)
 
user1385191
yep
 
I've got a version of opera 6 lying around aswell as NN8
 
user1385191
ha
 
user1385191
9:09 PM
I made it as a class project in a week
 
Heh
Suprisingly enough it crashed :p
I dont expect it to work in opera 6 though
Admittedly I am running opera 6 through WINE in linux so god knows where the bug orginated from :D
 
user1385191
it runs weird in chrome because apparently chrome has a bug (or did at one point) with setInterval
 
user1385191
and this was done before I knew about or used recursive setTimeouts
 
seemed okay in Chrome when I played it
 
setINtervals get buffered
which makes things weird
 
9:14 PM
@MattMcDonald Well props, I never had the patience to test in every browser.
I completely gave up on any kind of client side scripting for about 6 years.
 
user1385191
I just stick to coding flash apps for work and playing with js in my spare time.
 
Does anyone know of IE6-IE8 prefixes for WINE?
I have tried doing it on the mac here to run IE6 but no luck so far, It just takes ages on "starting application"
 
Ab
@Raynos any update
 
@Ab I finished, where do you want your code dumped?
@MylesGray dont test IE on mac/linux
 
Ab
yes
can i have ur gmail id
or email it to me
 
9:24 PM
I've seen a friend use a firefox tool to modify html/javascript of any page being viewed... can someone help me with the name of that tool?
 
firebug
 
thanks
 
Test failed. Where is the bug! Debugs code... Debugs code some more... Reads tests again. Test is wrong -.-
 
ha ha
 
user1385191
the worst bugs are the real edge cases that take an hour to come up
 
user1385191
9:30 PM
I had to fight one of those yesterday
 
I had to fix my code so that the isSubset(any set, emptySet) didn't always return true :D
 
Ab
@Raynos great help
 
@Ab it's not much but its a bit.
 
Ab
@Raynos a bit is big byte for me. sometimes all we need is a little ... to keep afloat
 
God I love having a local Yum repository mirror
 
9:35 PM
why?
 
I just did a net install of CentOS onto a new VM and it took 4 minutes :-D
 
Neo
hello everyone nice to finally see some crowd here
 
@Neo hey there
 
@Neo: there's usually a crowd in here...
 
Ab
@Raynos very good feedback in there. enjoying reading those..
now that u have seen the code, the parts that need to be unit tested is still a issue
 
9:37 PM
@Ab it's all the //* comments incase you didn't notice :p
 
Neo
@Raynos Hi dear Raynos.... No ones was here the last few days whe I came. Maybe it has to do with GMT -3.00
 
@Neo nah today you got lucky
@Ab it's hard to unit test it when it has 3 functions. Split it up into many smaller functions
 
Ab
ur right
 
Split up your data into small objects
 
Neo
whats pure javascript for jQuery('#foo').mouseup() ?
 
9:38 PM
I'm sure you could group all the images data into a image object
 
user1385191
document.getElementById("foo").onmouseup = foobar;
 
@Neo: document.getElementById('foo').onmouseup = function() {}
 
var el = document.getElementById("foo");
if (el.attachEvent) {
    el.attachEvent("onmouseup", fn);
} else if (el.addEventListener) {
    el.addEventListener("mouseup", fn, false);
}
 
Neo
@ircmaxell no I know that, I want to trigger the ouseup event
 
Oh
 
9:40 PM
this and the c++ room are the only rooms that ever have people...
 
Neo
Im hacking a facebook game that you have to click so many times on a button and the most clicks is your score
I jquerified it with firebug and did javascript:function x={$jq('#app136364463041439_btn').mouseup();void(0);};setInterval('x',1/1000);
 
document.getElementById('foo').onmouseup()?
 
Neo
but I wanna do it even faster with Chromes js parse
so I need to write it with pure javascript since there is no firebug
 
user1385191
inline js then?
 
user1385191
I'm thinking event dispatching, but I'm unclear of how effective that is in js
 
9:43 PM
it isn't easy to do cross browser
 
@Neo: var f = function(q) { return function() { q.mouseup(); void(0);} }($jq('#app...')); setInterval(f, 1/1000);
Still uses jQuery, but caches the object lookup
and avoids eval
 
What's wrong with W3Schools?
 
Neo
@ircmaxell we're making progress...
 
or, even smaller (but functionally the same): setInterval(function(q) { return function() { q.mouseup(); void(0);} }($jq('#app...')), 1/1000);
 
there must be somoething wrong if the question has 2 stars...
 
Ab
9:45 PM
@Raynos u mentioned "make the options object look the same as the properties object and call $.extend on it"
$.extend?
 
@invisiblebob PHP is busy from time to time
 
Neo
@ircmaxell .onmouseup() doesnt work like that its more like $('#foo').mouseup(function(){//bar})
 
Sec
 
@Ab sorry its a jquery method. it basically extends object a with object b. it merges two objects. It's a useful method. You can either rip it out of jquery or make it work with a shallow extend
 
with jsfiddle, is there a way to have multiple js files? or do you just have to put them all in the same box?
 
Ab
9:49 PM
so should i use prototype.MyNewMethod notation?
 
@Ab if you want or this.MyNewMethod name in the constructor. your choice
 
Neo
@ircmaxell you were 1 void(0); short on the last exampple
 
@invisiblebob are you serious? stop trolling
 
lol. i think i worded that wrong...
 
var o = document.getElementById('foo'); var e = document.createEvent('MouseEvents); e.initMouseEvent( 'mouseup', true, true, window, 1, 12, 12, 12, 12, false, false, true, false, 0, null); setInterval(function(e, o) { return function() { o.dispatchEvent(e); void(0); } }(e, o), 1/1000); <-- There you go, try that (not guaranteed to work, just MIGHT work)...
 
Neo
9:55 PM
@ircmaxell nice...
 
user1385191
how well do custom events work in js?
 
No JQuery, and caching as much as possible...
 
i'm just talking about readability and multiple js boxs, but i guess you cant
 
I'm struggling with this, I'm more of an actionscript person. stackoverflow.com/questions/4963203/…
 
9:56 PM
Won't work in IE... But should work in other browsers
 
0
Q: Accept Cookies from One Website only : PHP

DerrickHello, I was wondering if there was a way in PHP to accept cookies from only the original website. For Example: I set a cook when a visitor come to my website www.example.com, now when they come from a website like Microsoft Translator to view my website that cookie is set with the web address...

 
does anyone know a resource to turn a .mht file into a html file?
 
Cookies only work on the original domain anyway don't they?
 
Neo
whats special in ie? set interval has to be an int?
 
Ab
9:57 PM
@Raynos when u say refactor some chunk of code within constructor to this.MethodChunk... how would be the syntax?? this.NewChunk = function () {};
 
no. Dom2 events don't work
 
@Ab just do Gauge.prototype.someMethod = function() { ... }
 
Neo
@ircmaxell it doesn't work but Im trying to debug it
 
how do i post the question to chat and get it to show up like @Myles Gray's did? perhaps just paste the link w/o any other text?
 
Neo
@Sketchbook yup
 
10:00 PM
0
Q: horizontally center, and don't offset other content vertically.

SketchBookGamesi have a flash based site. i would like to position an ad on top of it with javascript (centered horizontally like the site). <script type="text/javascript"> var pw_d=document; pw_d.projectwonderful_adbox_id = "00000"; pw_d.projectwonderful_adbox_type = "0"; </script> the flash sit...

thanks
 
For IE, that would be: var f = document.createEvent ? function() {var o = document.getElementById('foo'); var e = document.createEvent('MouseEvents); e.initEvent( 'mouseup', true, true); setInterval(function(e, o) { return function() { o.dispatchEvent(e); void(0); } }(e, o), 1/1000);} : function() { var o = document.getElementById('foo'); setInterval(function(o) { return function() { o.fireEvent('onmouseup'); void(0); } }(o), 1/1000);}; f(); <-- that monster
(note that's IE only, not other browsers)
 
user1385191
are you just trying to place a div/image over top of flash?
 
@Matt yeah i think thats basically it
 
user1385191
you just need css really
 
user1385191
set the <object> or <embed> that's embedding flash to have a z-index of 1 along with position:relative;
 
10:02 PM
@Matt i'm not familiar with css, does that need to be a seperate document, or can it be written inline with the html, like the javascript is.
 
user1385191
I'll mock it up on jsfiddle real quick
 
Neo
@ircmaxell I see... I hate IE I'm actually playing games right now cause I gave up on making my ajax application work in IE
 
Ab
@Raynos the error handling was demanded by client ..they wanted error to be thrown and mentioned that these would be caught by the client code
 
@Matt thanks, center horizontally too please, i wans't getting any success with firebug and the stuff i found around the web to try.
 
@invisiblebob can't you open the .mht file in IE and "save as" ?
 
Ab
10:04 PM
@Raynos must say very nicely commented feedback. makes me laugh... (@myself)
 
Yeah...
 
@Ab I see. i find it gringe >_<. It's ok, no problem
If anyone else wants (maybe constructive) comments in their source code telling them what there doing wrong, feel free to ask.
 
Ill keep that in mind @Raynos
 
has to resist constantly criticizing Raynos's there/their/they're and your/you're usage
 
Neo
@ircmaxell when I use firefox when I make it intense even the timer will slow down, but the google with its chrome V8 or whatever doesnt effect the timer
 
10:09 PM
:-D
 
user1385191
SketchBook: jsfiddle.net/fV3Ga
 
user1385191
Want me to post it as an answer?
 
@Nathan dont be a grammar nazi
 
@Raynos OK I wont
 
@Matt the green box is below the flash, anyway to put it on top?
 
user1385191
10:12 PM
uhh in my browser it's on top
 
user1385191
look, I have to get going
 
user1385191
send my an email via my site's contact form (view profile) if you still have questions
 
ok thanks.
 
on the top on mine as well
 
@Raynos I can't find any code to send you for critiquing... it's all too bad.
 
Neo
10:15 PM
time is an illusion
 
seems like chrome doesn't want to put an image overlapping flash.
 
@Nathan write some.
 
@SketchBookGames wmode fixed it
 
@Nathan i only have linux
 
do i have to wrap CSS in some sort of tag to write it in an html file?
 
Neo
10:26 PM
is there something I can manipulate ajax get params before they are snet?
sent!*
like a plugin
or something
:D
 
i'm bored today. and rather tired.
i've been working on a pong game, and i would like some people to test it. will anyone?
 
@invisiblebob sure. Can I mock your code?
 
mock? make fun of? sure.
the password is pong
i'm also uninventive today.
 
:( firefox doesn't like wmode = "transparent" but chrome needs it.
 
10:52 PM
solved it with detecting chrome via javascript!, (chrome is the only one that needed transparent it would seem)
i don't see a "contact" button on @Matt McDonald's profile. maybe my reputation isn't high enough
 
@SketchBookGames go to his website
@invisiblebob ew inheritsfrom
 
?
@raynos it merges the prototypes
 
11:13 PM
@invisiblebob thats just >_<. Polluting the prototype chain with unneccesary look ups
 
It creates another clink in the chain everytime its called
you want to _.extend(subclass.prototype, class.prototype)
 
woop first rep-cap hit :-D
 
what is the difference?
 
/offtopic
 
11:15 PM
let me read that source
 
the inheritsFrom?
Function.prototype.inheritsFrom=function(a){if(a.constructor==Function){this.prototype=new a;this.prototype.constructor=this;this.prototype.parent=a.prototype}else{this.prototype=a;this.prototype.constructor=this;this.prototype.parent=a}return this};
i minified it since i knew it worked
 
did you even read the source?
it adds new a to the prototype chain
calling the constructor with 0 arguments
 
OK @Raynos your feedback would be welcome. jsfiddle.net/NZCZS
note, this runs inside IE6 inside a vednor's proprietary Windows app. The XMLCclRequest() is overridden by some horrible JS they inject in the top of each page. Those are a few functions I wrote recently to make it a little better.
 
@Nathan When i press jslint it cries
 
11:20 PM
@david boohoo
you're right there are some horribly dumb things right off the bat
 
(\.\d+)?(Z| why 1+ integers rather then just three?
 
can I get jsfiddle to show me line numbers?
@Raynos In googling I saw some variations on number of digits used for milliseconds
 
var extracted = s.replace(/\/Date(([^)]+))\//, '$1'); Rather then using + set a range of characters
(...){n, m} matches (...) n to m times.
 
? In that case I just want what's inside Date(wantedhoweverlong)
is + bad for some reason?
 
line_html += '<a href="javascript:MPAGES_EVENT(\'POWERFORM\',\'' + personId + '|' + encntrId + '|57748761|' + latest_form_activity_id + '|1\')">Latest IV Insertion form</a>';
@Nathan no. I would just set limits since you control the input
don't use javascript in a href
remove console.x calls in prodcution since its IE6
 
11:28 PM
jsLint dislikes for (var i in a) { and I think I understand why. Should I just use for (i=0; i<a.length(); i++) ?
 
@Nathen why does it dislike it?
 
@invisiblebob lack of hasOwnProperty
 
@invisiblebob "Problem at line 126 character 3: The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype."
 
@Nathan if ordered loop forward in order
 
11:29 PM
if un-ordered just for in it
 
arrays can have extra properties which for will also loop through
 
If you can garantuee the native Array.prototype is clean
then dont bother checking
 
but isn't that why you don't modify object and array prototypes?
yeah.
 
well the previous line is a vanilla Array: var a = [1,2,3,4,5,6,10,11];
 
@Nathan you care about 3rd party code doing stupid things like Array.prototype.indexOf = function() { /* hack for ie */ }
Or co workers
or incompetant fellow employees
 
11:32 PM
@Raynos so instead of javascript in href, use like <a href="#"> and attach a mouseover event with e.g. $("#id").hover() ?
 
@Nathan something like that. use $.delegate if you want
Try not to have any inline javascript in html properties
If anyone wants they can look at some of my javascript code.
@Nathan btw the rest of your code was clean. It looked a bit too procedural, lack of functional of OO approach but that's ok I guess
 
@Raynos I wouldn't put it past them to extend Array.prototype... included in the JS the app injects into the <head> is this priceless gem of Enterprise JavaScript:
function evaluate(x)
{
	return eval(x);
}
 
user1385191
nothing better than elongating a built-in function
 
looks up $.delegate
@MattMcDonald it makes eval() way awesomer
 
@Nathan I meant $.fn.delegate
 
user1385191
11:40 PM
the possibilities are endless coding like that
 
well apparently spell-check is causing deaths now: heraldsun.com.au/news/…
 
@Raynos Thanks-- I am still thinking largely procedurally and linearly but trying to get over it. I think more OO-style in other languages but I'm just starting to get the hang of JS being "good"
 
user1385191
yeah js compared to as3 is really weird in terms of OOP
 
*auto-correct
 
Expected a github to inline nicely.
Little bit of code i've been messing with lately.
Playing around with multi-file javascript. So used to 1000 lines of js code per file
 
user1385191
11:44 PM
I've wanted to play around with an import function in js that would import js files and append them to the body
 
user1385191
to make code more modular
 
@MattMcDonald its difficult due to async nature of loading files. Or mainly that importing synchronously would cause the browser to freeze because its single threaded
 
user1385191
no what I mean is just creating a script tag
 
user1385191
then setting its src to be the script file
 
user1385191
then appending it
 
11:45 PM
That works but how would you use it? Wait for document ready?
 
user1385191
hmm not sure
 
I want an package = import("package.js");
I.e. import returns an object
 
@MattMcDonald people were talking about requirejs.org the other day for that sort of problem I think.
 
Yes but that isnt synchronous :P
 
user1385191
nice link
 
11:48 PM
Ideally you get it to preload all your code.
I dont like the require("url", callback); way of calling code
It conflicts my node..js require syntax
 

« first day (117 days earlier)      last day (4838 days later) »