-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamic "next meetup" to home page #33
base: master
Are you sure you want to change the base?
Conversation
Merge pull request techcorridorio#32 from iLtc/master
So that I can get the code back~ This reverts commit cfc403a.
index.html
Outdated
|
||
// Modify from _includes/meetup_cards.html | ||
|
||
window.onload = function(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably use $(document).ready(function ...)
(or just $(function ...)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot use $(document).ready(function ...)
here since jQuery will be imported after this code. Would you mind if I move <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
to <head>
?
index.html
Outdated
@@ -28,3 +29,53 @@ | |||
</div> | |||
</div> | |||
</div> | |||
|
|||
{% raw %} | |||
<script type="text/javascript"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to have this in a separate .js
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved most of the js code to js/meetup-events.js
but left the trigger code here.
index.html
Outdated
@@ -28,3 +29,53 @@ | |||
</div> | |||
</div> | |||
</div> | |||
|
|||
{% raw %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
index.html
Outdated
//assume Mustache is loaded | ||
//assume Meetup is loaded | ||
|
||
// Modify from _includes/meetup_cards.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor that code so it's reusable without copying and pasting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved all the js code to js/meetup-events.js
. If you want, I can refactor _includes/meetup_cards.html
and _includes/developers_cards.html
so they share the same code file.
This is exactly what I was hoping for, but we should probably clean up the code a little before merging. |
js/meetup-events.js
Outdated
}; | ||
|
||
var createEventParagraph = function (event) { | ||
var template = "Next meetup: <a href='{{event_url}}' target='_blank'>{{name}} ({{formattedShortDate}})</a>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Mixed double and single quotes.
js/meetup-events.js
Outdated
+ (date.getHours() % 12) + ':' | ||
+ (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) | ||
+ ' ' | ||
+ (date.getHours() < 12 ? 'AM' : 'PM'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '+'; readers may interpret this as an expression boundary.
js/meetup-events.js
Outdated
+ ' at ' | ||
+ (date.getHours() % 12) + ':' | ||
+ (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) | ||
+ ' ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '+'; readers may interpret this as an expression boundary.
js/meetup-events.js
Outdated
+ date.getFullYear() | ||
+ ' at ' | ||
+ (date.getHours() % 12) + ':' | ||
+ (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Misleading line break before '+'; readers may interpret this as an expression boundary.
js/meetup-events.js
Outdated
+ date.getDate() + ', ' | ||
+ date.getFullYear() | ||
+ ' at ' | ||
+ (date.getHours() % 12) + ':' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '+'; readers may interpret this as an expression boundary.
js/meetup-events.js
Outdated
var months = [ | ||
"January", "February", "March", "April", | ||
"May", "June", "July", "August", | ||
"September", "October", "November", "December" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed double and single quotes.
js/meetup-events.js
Outdated
var day = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; | ||
var months = [ | ||
"January", "February", "March", "April", | ||
"May", "June", "July", "August", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed double and single quotes.
js/meetup-events.js
Outdated
|
||
var day = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; | ||
var months = [ | ||
"January", "February", "March", "April", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed double and single quotes.
js/meetup-events.js
Outdated
return "http://maps.google.com/?q=" + encodeURI(venue.address_1) + '+' + encodeURI(venue.city); | ||
}; | ||
|
||
var day = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Mixed double and single quotes.
js/meetup-events.js
Outdated
|
||
var EventPresenter = function(event) { | ||
var formatVenueLink = function(venue) { | ||
return "http://maps.google.com/?q=" + encodeURI(venue.address_1) + '+' + encodeURI(venue.city); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Mixed double and single quotes.
Identifier 'address_1' is not in camel case.
return event; | ||
}; | ||
|
||
var createEventParagraph = function (event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'createEventParagraph' is defined but never used.
@@ -36,3 +36,50 @@ var Meetup = function(meetupURL) { | |||
}); | |||
}; | |||
}; | |||
|
|||
var EventPresenter = function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'EventPresenter' is defined but never used.
var template = 'Next meetup: <a href=\'{{event_url}}\' target=\'_blank\'>' + | ||
'{{name}} ({{formattedShortDate}})</a>'; | ||
Mustache.parse(template); // optional, speeds up future uses | ||
var rendered = Mustache.render(template, event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Mustache' is not defined.
var createEventParagraph = function (event) { | ||
var template = 'Next meetup: <a href=\'{{event_url}}\' target=\'_blank\'>' + | ||
'{{name}} ({{formattedShortDate}})</a>'; | ||
Mustache.parse(template); // optional, speeds up future uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Mustache' is not defined.
'+' + encodeURI(venue.city); | ||
}; | ||
|
||
var day = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Sorry for the delay. I hope it was not too late. It is a little bit difficult to solve all the problems raised by HoundCI. For example, Let me know what you think~ |
This pull request tries to resolve #27 .
Note: The javascript code, include the api signature, modify from _includes/meetup_cards.html .
We can also:
alt
attribute