Skip to content

Commit

Permalink
Adding basics of js file aggregation to admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuckabee committed Jan 26, 2010
1 parent a98d67f commit f863390
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 17 deletions.
15 changes: 12 additions & 3 deletions lib/trinity/admin.rb
Expand Up @@ -6,14 +6,23 @@ class Admin < Trinity::Plugin
NS = RDF::Vocabulary.new("#{URI}#")

def self.initialize!(application)
application.map('/trinity.css') { run CSS.new(application) }
application.map('/trinity.js') { run JS.new(application) }
application.map('/trinity.css', CSS)
application.map('/trinity.js', JS)
end

##
class JS < Trinity::Handler
def call(env)
[200, {}, ['/* TODO */']]
js_dir = File.expand_path(File.join(File.dirname(__FILE__), 'admin', 'js'))

response = []

# Include jquery
File.open(File.join(js_dir, 'jquery-1.4.1.min.js'), 'r').each_line do |line|
response << line
end

[200, {}, response]
end
end

Expand Down
Empty file added lib/trinity/admin/js/admin.js
Empty file.
Empty file.

0 comments on commit f863390

Please sign in to comment.