Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b8a57e
commit 093b402
Showing
8 changed files
with
728 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ui-datepicker-div { | ||
background: red; | ||
} | ||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } | ||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } | ||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } | ||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } | ||
.ui-datepicker .ui-datepicker-prev { left:2px; } | ||
.ui-datepicker .ui-datepicker-next { right:2px; } | ||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; } | ||
.ui-datepicker .ui-datepicker-next-hover { right:1px; } | ||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } | ||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } | ||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } | ||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;} | ||
.ui-datepicker select.ui-datepicker-month, | ||
.ui-datepicker select.ui-datepicker-year { width: 49%;} | ||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } | ||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } | ||
.ui-datepicker td { border: 0; padding: 1px; } | ||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } | ||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } | ||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } | ||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
$ -> | ||
|
||
# transition_speed = 300 | ||
|
||
$('.btn.btn-danger').on('click', -> false unless confirm 'Are you sure?') | ||
|
||
$('.post').fitVids() | ||
|
||
$('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' }) | ||
|
||
dlp = strip_trailing_slash(document.location.pathname) | ||
key_last = null | ||
key_count = null | ||
$(document).on( | ||
'keydown' | ||
(e)-> | ||
# Previous post | ||
if e.which == 37 | ||
older = $('.older').find('a') | ||
if older.length > 0 | ||
window.location = older.attr('href') | ||
# Next post | ||
else if e.which == 39 | ||
newer = $('.newer').find('a') | ||
if newer.length > 0 | ||
window.location = newer.attr('href') | ||
# Multiple key press | ||
else if e.which == key_last | ||
key_count++ | ||
if key_count >= 3 && e.which == 13 | ||
# New post | ||
if dlp == '/blog' | ||
window.location = '/blog/new' | ||
# Edit post | ||
else if dlp.indexOf('/blog') >= 0 && dlp.indexOf('/edit') < 0 | ||
post_id = $('.post').attr('id').replace('post-', '') | ||
window.location = "/blog/#{post_id}/edit" | ||
else | ||
key_count = 1 | ||
key_last = e.which | ||
# console.log key_count | ||
) | ||
|
||
# size_tiles() | ||
# $(window).on('resize', size_tiles) | ||
|
||
lastfm_recent() | ||
# setInterval(lastfm_recent(), 5000) | ||
|
||
|
||
# document.getElementsByTagName('body')[0].style.backgroundColor = 'green' | ||
|
||
|
||
strip_trailing_slash = (str) -> | ||
if str.substr(-1) == '/' | ||
str.substr(0, str.length - 1) | ||
str | ||
|
||
# size_tiles = -> | ||
# # console.log $('.tile').width() | ||
# $('.tile').height($('.tile').width()); | ||
|
||
lastfm_recent = -> | ||
api_key = '3b542380a2728ae170a8b50184d9eb40' | ||
user = 'stephendavis89' | ||
format = 'json' | ||
limit = 4 | ||
# htm = '' | ||
$('.lastfm').find('.tracks').html('') | ||
data_url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=#{user}&limit=#{limit}&format=#{format}&api_key=#{api_key}" | ||
# 'http://ws.audioscrobbler.com/2.0/user/rj/recenttracks.json' | ||
console.log data_url | ||
$.getJSON( | ||
data_url | ||
(data) -> | ||
# console.log data | ||
prev_img = '' | ||
for track, i in data.recenttracks.track | ||
# console.log "Name: #{track.name} / Artist: #{track.artist['#text']} / Album: #{track.album['#text']} / Image: #{track.image[3]['#text']}" | ||
# console.log track.name | ||
# console.log i | ||
if i < limit | ||
# classes = 'track' | ||
htm = "<div class='track'><img class='track-cover" | ||
current_img = track.image[0]['#text'] | ||
if current_img == prev_img | ||
htm += " duplicate" | ||
prev_img = current_img | ||
htm += "' src='#{current_img}'><span class='name'>#{track.name}</span><small class='artist'>#{track.artist['#text']}</small>" | ||
htm += "</div>" | ||
# htm += "<li>Name: #{track.name} / Artist: #{track.artist['#text']} / Album: #{track.album['#text']} / Image: #{track.image[3]['#text']}</li>" | ||
$('.lastfm').find('.tracks').append(htm) #.hide().slideDown(1000) | ||
# ,(data, textStatus, jqXHR) -> | ||
# console.log htm | ||
# return htm | ||
# console.log 'refreshing last.fm feed' | ||
# $('.lastfm').find('.tracks').append(htm).hide().slideDown(300) | ||
) | ||
# htm |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/*global jQuery */ | ||
/*! | ||
* FitVids 1.0 | ||
* | ||
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com | ||
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ | ||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ | ||
* | ||
* Date: Thu Sept 01 18:00:00 2011 -0500 | ||
*/ | ||
|
||
(function( $ ){ | ||
|
||
$.fn.fitVids = function( options ) { | ||
var settings = { | ||
customSelector: null | ||
} | ||
|
||
var div = document.createElement('div'), | ||
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; | ||
|
||
div.className = 'fit-vids-style'; | ||
div.innerHTML = '­<style> \ | ||
.fluid-width-video-wrapper { \ | ||
width: 100%; \ | ||
position: relative; \ | ||
padding: 0; \ | ||
} \ | ||
\ | ||
.fluid-width-video-wrapper iframe, \ | ||
.fluid-width-video-wrapper object, \ | ||
.fluid-width-video-wrapper embed { \ | ||
position: absolute; \ | ||
top: 0; \ | ||
left: 0; \ | ||
width: 100%; \ | ||
height: 100%; \ | ||
} \ | ||
</style>'; | ||
|
||
ref.parentNode.insertBefore(div,ref); | ||
|
||
if ( options ) { | ||
$.extend( settings, options ); | ||
} | ||
|
||
return this.each(function(){ | ||
var selectors = [ | ||
"iframe[src*='player.vimeo.com']", | ||
"iframe[src*='www.youtube.com']", | ||
"iframe[src*='www.kickstarter.com']", | ||
"object", | ||
"embed" | ||
]; | ||
|
||
if (settings.customSelector) { | ||
selectors.push(settings.customSelector); | ||
} | ||
|
||
var $allVideos = $(this).find(selectors.join(',')); | ||
|
||
$allVideos.each(function(){ | ||
var $this = $(this); | ||
if (this.tagName.toLowerCase() == 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } | ||
var height = this.tagName.toLowerCase() == 'object' ? $this.attr('height') : $this.height(), | ||
aspectRatio = height / $this.width(); | ||
if(!$this.attr('id')){ | ||
var videoID = 'fitvid' + Math.floor(Math.random()*999999); | ||
$this.attr('id', videoID); | ||
} | ||
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); | ||
$this.removeAttr('height').removeAttr('width'); | ||
}); | ||
}); | ||
|
||
} | ||
})( jQuery ); |
Binary file not shown.