Permalink
Browse files

Complete rewrite with jQuery, Backbone, Underscore, and Coffeescript

- Added a color palette with transparent, white, black, and random.
- Background color is adjustable (click color to reveal)
- Simplified input behaviors
- Doesn't populate url history
- Favors 3 character hex color notation
1 parent 08d7e94 commit 9a21c60ecfb47d60c35d1771ea58df0185bbabdd @imathis committed Nov 11, 2012
View
@@ -1,3 +0,0 @@
----
-BUNDLE_PATH: vendor
-BUNDLE_DISABLE_SHARED_GEMS: "1"
View
@@ -1 +1,2 @@
-vendor/ruby
+.DS_Store
+.sass-cache
View
@@ -1,6 +1,18 @@
-source :rubygems
+source "https://rubygems.org"
-gem "compass", "0.11.beta.2"
-gem 'rb-fsevent'
-gem 'guard-shell'
-gem 'guard-livereload'
+group :assets do
+ gem "compass"
+end
+
+group :development do
+ gem 'stitch-rb'
+ gem 'uglifier'
+ gem 'guard'
+ gem 'guard-shell'
+ gem 'guard-compass'
+ gem 'guard-coffeescript'
+ gem 'guard-coffeescript'
+ gem 'rb-inotify', :require => false
+ gem 'rb-fsevent', :require => false
+ gem 'rb-fchange', :require => false
+end
View
@@ -1,41 +1,65 @@
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- addressable (2.2.4)
- chunky_png (0.12.0)
- compass (0.11.beta.2)
- chunky_png (~> 0.12.0)
- sass (>= 3.1.0.alpha.218)
- configuration (1.2.0)
- em-websocket (0.2.0)
- addressable (>= 2.1.1)
- eventmachine (>= 0.12.9)
- eventmachine (0.12.10)
- guard (0.3.0)
- open_gem (~> 1.4.2)
- thor (~> 0.14.6)
- guard-livereload (0.1.7)
- em-websocket (~> 0.2.0)
- guard (>= 0.2.2)
- json (~> 1.4.6)
- guard-shell (0.1.1)
- guard (>= 0.2.0)
- json (1.4.6)
- launchy (0.3.7)
- configuration (>= 0.0.5)
- rake (>= 0.8.1)
- open_gem (1.4.2)
- launchy (~> 0.3.5)
- rake (0.8.7)
- rb-fsevent (0.3.10)
- sass (3.1.0.alpha.221)
- thor (0.14.6)
+ chunky_png (1.2.6)
+ coderay (1.0.8)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.4.0)
+ compass (0.12.2)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ ffi (1.1.5)
+ fssm (0.2.9)
+ guard (1.5.3)
+ listen (>= 0.4.2)
+ lumberjack (>= 1.0.2)
+ pry (>= 0.9.10)
+ thor (>= 0.14.6)
+ guard-coffeescript (1.2.1)
+ coffee-script (>= 2.2.0)
+ guard (>= 1.1.0)
+ guard-compass (0.0.6)
+ compass (>= 0.10.5)
+ guard (>= 0.2.1)
+ guard-shell (0.5.1)
+ guard (>= 1.1.0)
+ listen (0.5.3)
+ lumberjack (1.0.2)
+ method_source (0.8.1)
+ multi_json (1.3.7)
+ pry (0.9.10)
+ coderay (~> 1.0.5)
+ method_source (~> 0.8)
+ slop (~> 3.3.1)
+ rb-fchange (0.0.6)
+ ffi
+ rb-fsevent (0.9.1)
+ rb-inotify (0.8.8)
+ ffi (>= 0.5.0)
+ sass (3.2.2)
+ slop (3.3.3)
+ stitch-rb (0.0.8)
+ thor (0.16.0)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
PLATFORMS
ruby
DEPENDENCIES
- compass (= 0.11.beta.2)
- guard-livereload
+ compass
+ guard
+ guard-coffeescript
+ guard-compass
guard-shell
+ rb-fchange
rb-fsevent
+ rb-inotify
+ stitch-rb
+ uglifier
View
@@ -1,7 +1,36 @@
-guard 'shell' do
- watch(/^sass\/(.*)\.scss/){|m| `compass compile` }
+require 'stitch-rb'
+require 'uglifier'
+require 'coffee-script'
+
+guard 'coffeescript', :input => 'coffeescripts', :output => 'javascripts'
+
+guard :compass do
+ watch(%r{^assets/stylesheets/(.*)\.s[ac]ss$})
end
-guard 'livereload', :api_version => '1.5' do
- watch(/.+\.(css|js|html|png|jpg|gif)$/)
+guard :shell do
+ watch /^assets\/javascripts\/.+\.(js|coffee)/ do |change|
+ file = "javascripts/hslpicker.js"
+ env = 'production'
+
+ lib = ['underscore.js', 'backbone.js', 'dragdealer.js'].collect {|item| Dir.glob("assets/javascripts/lib/#{item}") }.flatten.uniq
+ modules = ['assets/javascripts/modules/hslpicker.coffee']
+ fingerprint = Digest::MD5.hexdigest((lib|modules).map! { |path| "#{File.mtime(path).to_i}" }.join+env)
+
+ if File.exists?(file) and File.open(file) {|f| f.readline} =~ /#{fingerprint}/
+ false
+ else
+ js = Stitch::Package.new(:paths => 'assets/javascripts/modules', :dependencies => lib).compile
+ js = Uglifier.new.compile(js) if env == 'production'
+ js = "/* fingerprint: #{fingerprint} */\n" + js
+
+ begin
+ File.open(file, 'w') { |f| f.write js }
+ rescue => e
+ puts e.message, e.backtrace
+ exit(-1)
+ end
+ puts "Generated #{file}"
+ end
+ end
end
Oops, something went wrong.

0 comments on commit 9a21c60

Please sign in to comment.