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
0 parents
commit 67dc70b
Showing
12 changed files
with
9,529 additions
and
0 deletions.
There are no files selected for viewing
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,7 @@ | ||
build/* | ||
Gemfile.lock | ||
.DS_Store* | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
.sass-cache/* |
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,6 @@ | ||
source :rubygems | ||
|
||
gem "middleman", "~>2.0.14" | ||
gem "guard-middleman", "~> 0.1.0" | ||
gem "rb-fsevent" | ||
gem "therubyracer" |
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,11 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
guard 'middleman' do | ||
watch(%r{^config.rb}) | ||
watch(%r{^data/.*}) | ||
watch(%r{^source/.*}) | ||
|
||
watch(%r{^views/.*}) | ||
watch(%r{^public/.*}) | ||
end |
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,106 @@ | ||
### | ||
# Compass | ||
### | ||
|
||
# Susy grids in Compass | ||
# First: gem install compass-susy-plugin | ||
# require 'susy' | ||
|
||
# Change Compass configuration | ||
# compass_config do |config| | ||
# config.output_style = :compact | ||
# end | ||
|
||
### | ||
# Haml | ||
### | ||
|
||
# CodeRay syntax highlighting in Haml | ||
# First: gem install haml-coderay | ||
# require 'haml-coderay' | ||
|
||
# CoffeeScript filters in Haml | ||
# First: gem install coffee-filter | ||
# require 'coffee-filter' | ||
|
||
# Automatic image dimensions on image_tag helper | ||
# activate :automatic_image_sizes | ||
|
||
### | ||
# Page command | ||
### | ||
|
||
# Per-page layout changes: | ||
# | ||
# With no layout | ||
# page "/path/to/file.html", :layout => false | ||
# | ||
# With alternative layout | ||
# page "/path/to/file.html", :layout => :otherlayout | ||
# | ||
# A path which all have the same layout | ||
# with_layout :admin do | ||
# page "/admin/*" | ||
# end | ||
|
||
# Proxy (fake) files | ||
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do | ||
# @which_fake_page = "Rendering a fake page with a variable" | ||
# end | ||
|
||
### | ||
# Helpers | ||
### | ||
|
||
# Methods defined in the helpers block are available in templates | ||
# helpers do | ||
# def some_helper | ||
# "Helping" | ||
# end | ||
# end | ||
|
||
# Change the CSS directory | ||
# set :css_dir, "alternative_css_directory" | ||
|
||
# Change the JS directory | ||
# set :js_dir, "alternative_js_directory" | ||
|
||
# Change the images directorymanifest.json | ||
# set :images_dir, "alternative_image_directory" | ||
|
||
# Build-specific configuration | ||
configure :build do | ||
# For example, change the Compass output style for deployment | ||
# activate :minify_css | ||
|
||
# Minify Javascript on build | ||
# activate :minify_javascript | ||
|
||
# Enable cache buster | ||
# activate :cache_buster | ||
|
||
# Use relative URLs | ||
# activate :relative_assets | ||
|
||
# Compress PNGs after build | ||
# First: gem install middleman-smusher | ||
# require "middleman-smusher" | ||
# activate :smusher | ||
|
||
# Or use a different image path | ||
# set :http_path, "/Content/images/" | ||
end | ||
|
||
#spotify build | ||
module Middleman::Features::SpotifyBuild | ||
class << self | ||
def registered(app) | ||
app.after_build do | ||
`./spotify_build.sh` | ||
end | ||
end | ||
alias :included :registered | ||
end | ||
end | ||
|
||
activate :spotify_build |
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,47 @@ | ||
Spotify Middleman Bootstrap | ||
=========================== | ||
Spotify Middleman Bootstrap is a [Middleman](http://middlemanapp.com/) template for creating Spotify Apps in Haml, Sass, and Coffeescript! | ||
|
||
Requirements | ||
------------ | ||
|
||
* Middleman `gem install middleman` | ||
* Bundler `gem install bundler` | ||
* Ruby 1.9.x recommended | ||
* [Spotify Dev Account](http://developer.spotify.com/en/spotify-apps-api/developer-signup/) | ||
|
||
Install | ||
------------ | ||
|
||
Clone project into `~/.middleman` folder. | ||
|
||
Usage | ||
----- | ||
|
||
Create a new Middleman project. | ||
|
||
middleman init MySpotifyApp --template=spotify-middleman-bootstrap | ||
|
||
Run bundler in `/MyStotifyApp` folder. | ||
|
||
bundle install | ||
|
||
Configure | ||
--------- | ||
|
||
Open `spotify_build.sh` and modify the `appDirectory` variable. This is the folder your app is saved to and the name used to access your app in the Spotify client. | ||
|
||
Open `source/manifest.json` to modify your app information. | ||
|
||
Automatic Build | ||
--------------- | ||
|
||
Run `guard` in `/MyStotifyApp` folder. | ||
|
||
After each save, your project will be built and copied to the `~/Spotify` directory. | ||
|
||
Resources | ||
--------- | ||
|
||
* [Spotify Developer](http://developer.spotify.com/en/spotify-apps-api/resources/) | ||
* [Middleman](http://middlemanapp.com/) |
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,20 @@ | ||
require "js/libs/jquery-1.7.1" | ||
|
||
init = -> | ||
updatePageWithTrackDetails() | ||
player.observe models.EVENT.CHANGE, (e) -> | ||
updatePageWithTrackDetails() if e.data.curtrack is true | ||
|
||
updatePageWithTrackDetails = -> | ||
header = "#header" | ||
playerTrackInfo = player.track | ||
unless playerTrackInfo? | ||
$(header).html "Nothing playing!" | ||
else | ||
track = playerTrackInfo.data | ||
$(header).html track.name + " <br /> " + track.album.name + "<br />By: " + track.album.artist.name | ||
|
||
sp = getSpotifyApi(1) | ||
models = sp.require("sp://import/scripts/api/models") | ||
player = models.player | ||
exports.init = init |
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,2 @@ | ||
%h1#header | ||
Whoops! Cannot access the Spotify API! |
Oops, something went wrong.