Permalink
Browse files

Merge changes

  • Loading branch information...
2 parents b970a75 + a6b9736 commit 182833a1859cab3165d32715bed9a3e5b498ecee @Sutto Sutto committed Nov 28, 2010
View
1 Rakefile
@@ -24,6 +24,5 @@ task :compile_scripts do
Dir["coffeescripts/**/*.coffee"].each do |cs|
output = File.dirname(cs).gsub("coffeescripts", "javascripts")
system "coffee", "-c", "--no-wrap", '-o', output, cs
- end
end
View
4 coffeescripts/youth_tree.coffee
@@ -1,4 +1,2 @@
Shuriken.as 'YouthTree'
-
-# Export it in the global scope.
-@YT: YouthTree
+@YT = YouthTree
View
24 coffeescripts/youth_tree/gallery.coffee
@@ -3,35 +3,35 @@ YouthTree.withNS 'Gallery', (ns) ->
class InnerGallery
constructor: (selector) ->
- @selector: selector
- @items: $ @selector
- @urls: @items.map(-> @href).toArray()
+ @selector = selector
+ @items = $ @selector
+ @urls = @items.map(-> @href).toArray()
@bindEvents()
bindEvents: ->
- self: @
+ self = @
@items.click (e) ->
e.preventDefault()
self.showFor @
false
showFor: (element) ->
- href: element.href
- index: @urls.indexOf href
+ href = element.href
+ index = @urls.indexOf href
if index >= 0
@showImages @urls.slice(index).concat(@urls.slice(0, index))
showImages: (images) ->
- $.facybox {images: images}
+ $.facybox images: images
- ns.galleries: {}
+ ns.galleries = {}
- ns.create: (name, selector) ->
- gallery: new InnerGallery selector
- ns.galleries[name]: gallery
+ ns.create = (name, selector) ->
+ gallery = new InnerGallery selector
+ ns.galleries[name] = gallery
gallery
- ns.get: (name) ->
+ ns.get = (name) ->
ns.galleries[name]
View
6 javascripts/youth_tree/gallery.js
@@ -29,16 +29,14 @@ YouthTree.withNS('Gallery', function(ns) {
images: images
});
};
-
ns.galleries = {};
ns.create = function(name, selector) {
var gallery;
gallery = new InnerGallery(selector);
ns.galleries[name] = gallery;
return gallery;
};
- ns.get = function(name) {
+ return (ns.get = function(name) {
return ns.galleries[name];
- };
- return ns.get;
+ });
});
View
11 lib/youthtree-js.rb
@@ -1,10 +1,15 @@
class YouthTreeJS
- VERSION = "0.1.1".freeze
+ VERSION = "0.3.0.pre".freeze
+
+ def self.coffeescripts_root
+ File.expand_path('../coffeescripts', File.dirname(__FILE__))
+ end
def self.register_framework!
- Barista::Framework.register 'youthtree', File.expand_path('../coffeescripts', File.dirname(__FILE__))
+ Barista::Framework.register :name => 'youthtree',
+ :root => coffeescripts_root
end
register_framework! if defined? Barista::Framework
-end
+end
View
4 youthtree-js.gemspec
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{youthtree-js}
- s.version = "0.1.1"
+ s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Darcy Laycock"]
- s.date = %q{2010-08-16}
+ s.date = %q{2010-08-21}
s.description = %q{Shared Javascript tools across YouthTree apps.}
s.email = %q{sutto@sutto.net}
s.extra_rdoc_files = [

0 comments on commit 182833a

Please sign in to comment.