« first day (535 days earlier)      last day (4411 days later) » 

12:51 AM
0
Q: Navigation arrows on image hover for previous/next post?

PatI'm writing a custom photoblog using the Thesis Framework. So far I'm doing pretty well, but I want to make it a little easier for users to navigate through the site. Is there something I could use to incorporate little arrows that popup when you hover over an image to go to previous post and/or ...

Proposal by @hixie to unify register*Handler and Web Intents into single spec, all using <intent> element + common API http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-April/035301.html
 
1:12 AM
RT @beverloo: Color input, the Network Information API and Chromium 20 http://goo.gl/KNvwg #WebKit #Chromium
 
 
2 hours later…
GGG
3:20 AM
dejquerify
there is no other way
 
quick css question
is there such a thing as a parent-sibling selector?
given this dom structure
elem
  child
sib
 
GGG
nope
 
can I select the sibling knowing the unique id of the child without javascript?
ok, wanted to verify, I didn't think so
stupid reddit
 
GGG
oh you want the child?
you can go down but not up
 
Aye
I wnat to go up
altho I may have found where they put that in the site, so never mind ...
 
GGG
3:29 AM
i need something that compiles jquery into normal javascript
i should have asked about it yesterday
i think i'm going to take a shot at it
 
wait, what?
jQuery is two things:
an abstraction layer
 
GGG
i am half joking
 
a compatibility layer (IE functionality vs the other browsers, etc)
 
GGG
and 2/3 serious
it needs to convert code like this:
$(this).attr('id')
into code like this:
this.id
and it needs to strip unnecessary $ characters from the beginning of variable names
 
won't the second one break?
 
GGG
3:32 AM
and declare undeclared variables
 
seems like jQuery does some sanity wrappers for you on that
I think it's better to goto this['id']
 
GGG
@_@
 
the second one, I believe, won't break if it's undefined
 
GGG
well i'm gonna get to work
 
the first one will in some browsers
 
GGG
3:33 AM
if this is an element, this.id will work everywhere
 
declaring undeclared variables sounds like "I need to review my codebase"
 
GGG
DOM 0
 
@GGG but only on ID right? and only if they HAVE an ID
meaning
there are some attributes (url?) that you can't trust will work on every element
 
GGG
no on almost every attribute except ones that don't belong there
you're thinking of rel probably
 
possibly
 
GGG
3:36 AM
rel is weird
 
 
4 hours later…
GGG
7:46 AM
$idname = $target.attr('id');
$lastChar = $idname.substr($idname.length - 1);

$target.find('.jp-jplayer').attr('id', "jquery_jplayer_" + $lastChar);
$target.find('.jp-audio').attr('id', "jp_container_" + $lastChar);

$jplayerID = $target.find('.jp-jplayer').attr('id');
$jcontainerID = $target.find('.jp-audio').attr('id');
someone shoot me
 
8:06 AM
beautiful, beautiful code
or let's just say, i stumbled over something way worse yesterday :/
$('#hot3XDiv').find('input').keyup(function() {
updateInteractiveImgPOI($('#interactiveImg-1 #hot3').eq(0),parseInt($('#hot3XDiv').find('input').val())/2,parseInt($('#hot3YDiv').find('input').val())/2,$('#hot3TitleDiv').find('input').val(),$('#hot3TextDiv').find('textarea').val(), $('#hot3LinkTextDiv input').val(), "#", $('#hot3PositionDiv select option:selected').text());
$('.interactiveImageContainer').interactiveImg();
});
$('#hot3YDiv').find('input').keyup(function() {
updateInteractiveImgPOI($('#interactiveImg-1 #hot3').eq(0),parseInt($('#hot3XDiv').find('input').val())/2,parseInt($('#
dammit, i'm not gonna rewrite this
 
just reindent it, it will be way cleaner
 
this kind of code cannot be clean at all
i don't know what substances someone takes, to write something like this
 
8:23 AM
yeah...
 
8:34 AM
someone having a github-link for me to a great repo where i can learn something about modules and general code organisation?
want to start organising my code better
is AMD a good way to go?
 
@GNi33: you mean something like this? github.com/Ralt/jswebapp/tree/master/modules
 
kind of, yes
but i'm pretty much already doing it like this.
but i never fully used the capabilities of AMD
i guess i'll have to get into that more, or is there a "better" or "more preferred" way in here?
 
light on dark vs dark on light text for programming. is there a thread for that? can¨t find it
 
8:56 AM
@kornfridge what?
 
GGG
@GNi33 i'm not either... i don't know what to do with it yet
yeah can't tell if yours is bad or just bad indentation...
wtf is a hot 3x div
 
@GGG believe me, it's bad.
there are basically 5 tabs with some inputs and selects
and the guy is binding a listener to every single one of them
calling the exact same function
 
GGG
oh hang on
you haven't seen anything lol
oh man
i don't want to paste it here
 
this is nothing but.... idiotic
 
GGG
it's not pretty
 
9:03 AM
maintainability? yeaaah...
 
@GGG: create a jsfiddle :p
 
GGG
lol
hang on
 
OT: how can i get pasted code formatted in the chat?
 
GGG
i'm posting little excerpts
ctrl+k
 
console.log("test");
thanks :)
 
@GNi33: or four spaces indentation :)
 
GGG
these are just tiny things inside of... like.. the whole thing is basically just a bunch of loops and spaghetti
 
hahaha
@GGG: hoisting luvs u!
$state = $(this).parents('.list_item').attr('data-state');
really?
 
haha
 
GGG
this shit is just...
 
9:08 AM
wut
get(0) :-)
 
just awesome. iterate over each child just to go back to the parent inside the loop
 
GGG
hang on
 
@GNi33: the chat is markdown powered, you can use italic, bold, inline code, etc
 
@FlorianMargaine is there a list of the markdown somewhere?
 
GGG
here's the big one
there's also a smaller one
 
@FlorianMargaine great, thank you :)
 
GGG
i guess it's not that bad
i mean as far as LOC
the code is terrible
 
holy crap :D
 
GGG
for real.
 
@GGG: is there any organization in this code?
 
GGG
9:12 AM
nope
none
this is after i've worked on it a tiny bit, just to get rid of some stupid console errors
 
the html-insertion is just wrong...
 
GGG
and i think i added some var keywords @_@
 
inline styles, inline javascript....
 
GGG
the whole thing is like... unreal
 
jQuery.fn.remove_ppt = function(){$(".pp_pic_holder").remove(); $(".pp_overlay").remove(); $(".ppt").remove();}
/o/
 
9:14 AM
you guys know uglyjs.net, right?
 
you usually use jquery to reduce code :(
 
they got some classics too
like this:

<script type="text/javascript">
    function handleError() {
        return true;
    }
    window.onerror = handleError;
</script>
love it
 
GGG
lol no these are good
 
hey, that's some good use of with
function makePressed(el)
{
  with (el.style)
  {
    borderLeft = "1px solid #555533";
    borderRight = "1px solid #ffffff";
    borderTop = "1px solid #555533";
    borderBottom = "1px solid #ffffff";
    paddingTop = "2px";
    paddingLeft = "2px";
    paddingBottom = "0px";
    paddingRight = "0px";
  }
}
:D
 
GGG
awesome
 
9:16 AM
L.O.L.
 
GGG
<div id="checkbox_unchecked_s" style="background: url('/./images/stories/checkbox/unchecked.png');display:none;width:31px;height:31px;" onclick="this.style.display = 'none';
    	document.getElementById('checkbox_checked_s').style.display = 'inline-block';
        document.getElementById('checkbox_unchecked_m').style.display = 'inline-block';
        document.getElementById('checkbox_checked_m').style.display = 'none';
        document.getElementById('checkbox_unchecked_l').style.display = 'inline-block';
 
Working on a recent project I kept coming across anchor tags like this:
<a href="#" onclick="visit_url(<?php echo $url; ?>)">
I was really curious as to what visit_url() would do, eventually I found it:
function visit_url(url) {
    window.location = url;
}
 
GGG
hey at least they know how to write a function
 
yup, some of those are absolutely awesome
 
GGG
i just noticed this is all over the place in this lovely new code i inherited:
                                    //alert('FOO');
 
9:18 AM
huhu
 
GGG
it just cracked me up for some reason
 
should really change it to

alert('FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU');
 
GGG
ROFL
 
it just speaks for itself
 
GGG
9:20 AM
they should
@FlorianMargaine that is a great summary of what i've got here
no actually this is way worse
no var keywords
all variables start with $
and are global, because no var keywords
unless i added them
 
starting variables with $ is common practice to recognize jquery objects tho
 
GGG
every variable
 
GGG
like, counters, strings, everything
 
LOL
 
9:24 AM
They thought js was php maybe :x
 
GGG
except some of the jQuery objects don't have $
who knows, it's a mystery
 
@FlorianMargaine maybe, or he thougt that this would be the way to define a jquery-variable :P
 
GGG
$newurl = $mapAddress_before + "240x150" + $mapAddress_after;
 
well, you guys enjoy your ugly code, I'll enjoy my old ugly code :D
way better than yours it seems, tho
 
GGG
heheh i hope so
 
PING PONG
 
@FlorianMargaine make a jsfiddle reproducing it
 
yeah I guess that's the best way to debug :/
@Raynos: fiddle added
 
var openTickets = 0,
      workToDo = 0;
:(
 
9:49 AM
@FlorianMargaine fiddle doesnt work because IE8 sucks :P
 
Yeah. Unfortunately, my customers use IE8.
 
scripts are blocked due to mime type
 
I mean fiddle cant reproduce
 
>_<
I should try to download the scripts on my server?
and load them locally?
 
9:51 AM
no not that
its an issue on my end with IE9
for the fiddle to work you have to inline the code
 
ok
the thing is, I have the exact same issue on my site
I'll try to inline the code
you have a minified version or I'm doing it?
 
@Raynos just a short question, would you recommend using AMD?
 
@GNi33 depends :D
I prefer builders like browserify/webmake
 
on what? :D
never heard of browserify, will have a look into it, thanks :)
so, i can split my code up in modules and browserify will compile and minify the stuff?
 
kind of what nCore does
 
9:59 AM
@FlorianMargaine jsfiddle.net/YhG7H/4
change the order of es5 shim and dom shim and problem solved
 
you mean es5 shim first?
 
yes of course
dom shim expects to be in an es5 environment
 
add this to your requirements then :p
> The Dom-shim-ie8.js works on IE8 and is tested on IE8.
 
@FlorianMargaine psh :p
 
hmmm
es5-shim throws an exception on IE8 -_-
hm, nope
 
10:16 AM
do you guys know about some simple svg-card - flip example somewhere? i can't seem to get the matrix-transformation working correctly :/
 
@Raynos: do you think it's safe to use --harmony-weakmaps in a production environment? I think the spec is somewhat settled now.
 
what would you use weakmaps for? I don't get their use :/
 
I'm thinking of mapping two socket objects together for emulated peer to peer messages
of course, I could do it without the weakmap, but I kind of want an excuse to use them :-p
@FlorianMargaine: I wrote a post on WeakMaps a while back — whattheheadsaid.com/2011/10/es6-a-quick-look-at-weak-maps
man, I've really neglected my blog lately... just so busy.
 
o/
Oy!
My Google account has been compromised. :/
 
10:34 AM
?
 
Someone from Mexico accessed it.
Turned on 2-step verification now.
 
10:50 AM
Mine Google account was also accessed by someone 4 months before. I changed my password so issue solved.
 
@All Hi
 
Can any one tell me which is good jquery framework for building responsive Ux along with HTML5?
@ThinkDifferent
Hello
 
11:41 AM
good morning
 
i don't like svg :/

http://jsfiddle.net/XfYWY/1/
 
11:58 AM
@GNi33 Do you know ? , you can do the same trick with css 3 ?
 
not on ie
 
true that :<
 
supposed to be a fallback for ie9 mobile
 
but ie10 ?
ouch ie9 mobile :<
try canvas then
 
yup, was thinking about that too
but that wouldn't change that much i guess
 
11:59 AM
svg (hmm)
Actually using canvas will change stuff
as in the same thing will then run on android
and will be raster so wont hog up resources
 
android 3 browsers handle css transforms very good, no need for canvas there
 
Init :-)
actually from 2.3.4 they are pretty decent with transforms
 
canvas performance is terrible on the native android 3 browser
 
Never tested on android 3
you already know how much CSS i use :<
 
well, the whole browser isn't very good
 
12:02 PM
i like it
its atleast better then the one in my avatar
 
ever tried to do something with css-animations?
they actually work quite well, and animation-fill-mode is supported
 
@GNi33 say what ?
I spend most of my time making css 3 crazyness
 
but if you change anything in the dom after a finished animation, it jumps back to the initial status
 
it's crazy
 
12:03 PM
actually there is an animation-state:paused
which could be used
using some nasty js
 
that's nice
i know you're doing a lot with css3 - i just wanted to say that you should try them on the android 3 native browser (i'm talking about the one on the galaxy tab 8.9)
it was driving me crazy :D
 
hmm
time to get a device :<
 
but, i didn't try animation-state: paused
 
wait
 
problem is, the thing seems to make a complete redraw and throws away animation-properties when you alter the dom
 
12:07 PM
its animation-play-state:
let me test something :-)
-webkit-animation-fill-mode: forwards;
this works on iOS and chrome
test on android
 
yes it works
until you touch the DOM :D
 
yeah sadly :<
the ugliest way is using javascript
to add animation-play-state to
the div
so that it just pauses it at the end
or perhaps
you can use
a class which has same properties at end - state getting assigned to your animating object when the end event occurs
 
12:22 PM
tried that
 
function Load(DOM){
        var DOM = DOM;
 
but there's still a jump
 
??
i'm actually mostly offended that you're passing in a jQuery 'node list' (object tree?) and calling it DOM
:P
but it's a cool effect
@OctavianDamiean really? I bricked my phone last night and had some hard-to-do recovery this morning.
 
3
Q: Object class comes twice in prototype chain of DOMWindow?

PraveenWhy do we have 2 class Object and again Object in prototype chain of window? window --> DOMWindow --->Object --->Object ---> null Can anyone please give me some point about this design? Follwing is the output on chrome.

nice one
 
sighs
 
12:40 PM
here is another gem from that account stackoverflow.com/questions/9979172/…
 
oh, the prototype-chain, mystery mystery ;)
 
guys
anyone know a mini framework in nodejs that creates a restful webservice based on models you provide? I can't remember its name...
 
jQuery?
 
12:48 PM
lol
 
I think it used express
but it was something a little further than just express, you provide it some mongoose model (IIRC), and it creates the resources and everything for your webservice... I think it was made by a guy from the node team, but I can't remember :/
 
39
Q: Node.js REST framework?

GeuisJust got node.js running on an ubuntu server instance. Got a couple of simple server apps running. Does anyone know of any REST frameworks that have been built or are in development?

Restify looks like it might be what you're looking for
 
restify!
thanks
exactly :)
 
The gods of Google are good to me
 
12:51 PM
the google-fu is strong with this one
 
5
Q: Feature detection for position: fixed

pau.morenoI am trying to find a script that detects if a device places position: fixed elements relative to the viewport and not to the entire document. Currently, standard desktop browsers and Mobile Safari (for iOS 5) do so, whereas Android devices place the fixed elements relative to the entire documen...

that would actually be interesting
 
@Abhishek: what would you advise for a nodejs webapp?
 
advice as in ?
 
framework/app
express is the best?
 
12:56 PM
well express is awesome
you might need to mess with it a bit to support subdomains though
, by the way
whats ur app about ?
 
e-commerce
and/or biding
 
use express
with socket.io [if your want to go really really realtime]
or comet would do great with express
 
yep planning this already
socket.io doesn't use comet as fallback?
 

« first day (535 days earlier)      last day (4411 days later) »