Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 67dc70bc4970eef8036ef0c9fd92a6854b684970 @danwaz committed Mar 6, 2012
Showing with 9,529 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +6 −0 Gemfile
  3. +11 −0 Guardfile
  4. +106 −0 config.rb
  5. +47 −0 readme.md
  6. +20 −0 source/app.js.coffee
  7. +2 −0 source/index.html.haml
  8. +9,266 −0 source/js/libs/jquery-1.7.1.js
  9. +11 −0 source/layouts/layout.haml
  10. +12 −0 source/manifest.json
  11. +33 −0 source/stylesheets/site.css.scss
  12. +8 −0 spotify_build.sh
@@ -0,0 +1,7 @@
+build/*
+Gemfile.lock
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
+.sass-cache/*
@@ -0,0 +1,6 @@
+source :rubygems
+
+gem "middleman", "~>2.0.14"
+gem "guard-middleman", "~> 0.1.0"
+gem "rb-fsevent"
+gem "therubyracer"
@@ -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
106 config.rb
@@ -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
@@ -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/)
@@ -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
@@ -0,0 +1,2 @@
+%h1#header
+ Whoops! Cannot access the Spotify API!
Oops, something went wrong.

0 comments on commit 67dc70b

Please sign in to comment.