norfolkjs / norfolkjs.github.io

Website code for Norfolk.js
http://www.norfolkjs.org
12 stars 19 forks source link

adding jquery and starting work on meetup api js #46

Closed qwo closed 10 years ago

qwo commented 10 years ago

Not Working yet,

adding for meetup sponsor logo and events.

metaskills commented 10 years ago

The 757rb site uses API Key Signatures. Please feel free to check out the two files that use different API's.

https://github.com/757rb/757rb.org-jekyll/blob/master/_assets/javascripts/home/meetup_event.js.coffee https://github.com/757rb/757rb.org-jekyll/blob/master/_assets/javascripts/home/meetup_players.js.coffee

tjwebb commented 10 years ago

Can you use cdnjs to load jquery? There's no reason to keep it in the repo

qwo commented 10 years ago

sure no problem.

tjwebb commented 10 years ago

Can we please use $('<li>').attr( ... instead of html string concatenation? I don't think our need for this is so pressing that we should to introduce such hackery. Going through jQuery will also ensure cross-browser happiness.

jalbertbowden commented 10 years ago

pre v2 is crossbrowser happiness. v2 was gutted of most

On Sat, Jun 14, 2014 at 10:05 PM, Travis Webb notifications@github.com wrote:

Can we please use $(' ').attr( ... instead of string concatenation? I don't think our need for this is so pressing that we should to introduce hackery. Going through jQuery will also ensure cross-browser happiness.

— Reply to this email directly or view it on GitHub https://github.com/norfolkjs/norfolkjs.github.io/pull/46#issuecomment-46104732 .

J. Albert Bowden II

jalbertbowden@gmail.com

http://bowdenweb.com/

metaskills commented 10 years ago

Can we please use $('<li>').attr( ... instead

Bike shed time! You could totally do this too: $('<img>', {src: 'foo.png'}) which passes all attributes as an object/hash.

qwo commented 10 years ago

ah cool @metaskills you mean something like

var foo =$('<a>', {
       href: '/images/ninjacat_150.png',
       img:{ 
            src:'/images/ninjacat_150.png'
      }})
metaskills commented 10 years ago

Sure, but that nested img would need to be a jQuery object too. For example, as seen on https://coderwall.com/p/evmqoa

var item = {href: 'http://metaskills.net', title: 'MetaSkills.net'};
$('<li>', {
  html: $('<a>', {
    href: item.href,
    text: item.title
  })
});
<li>​
  <a href=​"http:​/​/​metaskills.net">​MetaSkills.net​</a>​
</li>​
qwo commented 10 years ago

thanks @metaskills this did the trick

  $.each( json.results[0].sponsors, function( key, val ) {
    //items.push( "<li id='" + key + "'>" + val + "</li>" );
    if(!val.hasOwnProperty("redeem")){
         var element = $('<a>', {
                href: val.url,
              html: $('<img>', {
                src: val.image_url
              })
          });
         $("#sponsors").append(element);
      }
   });
tjwebb commented 10 years ago

Bike shed time! You could totally do this too: $('', {src: 'foo.png'}) which passes all attributes as an object/hash.

+1

@stanzheng You desperately need to install a linting program. Please do not submit any more code that is not tabbed and spaced consistently.

lynnaloo commented 10 years ago

@stanzheng This isn't from Atom, right? Just pasted in from some online editor?

qwo commented 10 years ago

my atom linting setting must be pretty light, i'm going to find a tigher jslintrc setting add it to the gitignore.

:) you have a favorite one?

lynnaloo commented 10 years ago

https://github.com/Joezo/atom-jshint

In settings, you can set soft tabs and the default tabs (2)

tjwebb commented 10 years ago

Not sure, I use the default jshint settings. I'm not sure how not tabbing your code correctly in the first place saves you any time or energy.

jalbertbowden commented 10 years ago

what is tabbing correctly? is that defined somewhere for reference?

On Saturday, June 14, 2014, Travis Webb notifications@github.com wrote:

I just use the default jshint settings. I'm not sure how not just tabbing your code correctly in the first place saves you any time or energy.

— Reply to this email directly or view it on GitHub https://github.com/norfolkjs/norfolkjs.github.io/pull/46#issuecomment-46106175 .

J. Albert Bowden II

jalbertbowden@gmail.com

http://bowdenweb.com/

lynnaloo commented 10 years ago

The tabs in the code weren't actually lining up consistently. Looks like a @stanzheng copy/ paste job error, but the Atom Hint plugin should catch that. I can show you my settings on Tuesday.

jalbertbowden commented 10 years ago

whats tuesday

On Sunday, June 15, 2014, Linda Nichols notifications@github.com wrote:

The tabs in the code weren't actually lining up consistently. Looks like a @stanzheng https://github.com/stanzheng copy/ paste job error, but the Atom Hint plugin should catch that. I can show you my settings on Tuesday.

— Reply to this email directly or view it on GitHub https://github.com/norfolkjs/norfolkjs.github.io/pull/46#issuecomment-46113335 .

J. Albert Bowden II

jalbertbowden@gmail.com

http://bowdenweb.com/

lynnaloo commented 10 years ago

When I'll see Stanley at work next. I guess I need to stop commenting to Stanley publicly like he's my intern :)

tjwebb commented 10 years ago

@jalbertbowden http://en.wikipedia.org/wiki/Indent_style#Styles

K+R and 1TBS are used for the C language family, of which Javascript is a member. In general, any of these styles would be preferable over what was previously in this PR.

jalbertbowden commented 10 years ago

cool, just curious which you (and group) prescribed to. thanks.

On Sun, Jun 15, 2014 at 12:47 PM, Travis Webb notifications@github.com wrote:

@jalbertbowden https://github.com/jalbertbowden http://en.wikipedia.org/wiki/Indent_style#Styles

K+R and 1TBS are used for the C language family, of which Javascript is a member. In general, any of these styles would be preferable over what was previously in this PR.

— Reply to this email directly or view it on GitHub https://github.com/norfolkjs/norfolkjs.github.io/pull/46#issuecomment-46120811 .

J. Albert Bowden II

jalbertbowden@gmail.com

http://bowdenweb.com/

tjwebb commented 10 years ago

Yea, I'm not going to reject any consistent style unless it's obscure or hard to read. I will always reject haphazard nonsense.