mde / fleegix-js-javascript-toolkit

Fleegix.js provides an extremely lightweight, cross-browser set of JavaScript tools for building dynamic Web-app UIs.

This URL has Read+Write access

fleegix-js-javascript-toolkit / site / app.rb
100644 38 lines (33 sloc) 1.138 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'rubygems'
require 'sinatra'
 
FLEEGIX_VERSION = '0.5.0'
FLEEGIX_PATH = 'http://downloads.fleegix.org/fleegix_js/releases/fleegix-' + FLEEGIX_VERSION
FLEEGIX_REPO = 'http://github.com/mde/fleegix-js-javascript-toolkit/tree/master'
 
TITLES = {
  'download' =>'Downloads',
  'build' => 'Building',
  'contribute' => 'Contribute',
  'docs' => 'Docs',
  'ref' => 'Reference',
  'plugins' => 'Plugins',
  'plugins/date/date' => 'Plugins: timezone-enabled JavaScript Date',
  'plugins/date/util' => 'Plugins: date strftime, add, diff',
  'plugins/ejs' => 'Plugins: EJS',
  'plugins/xml' => 'Plugins: XML',
  'plugins/form/diff' => 'Plugins: form diff',
  'plugins/form/restore' => 'Plugins: form restore',
  'plugins/hash/hash' => 'Plugins: hash',
  'plugins/color/convert' => 'Plugins: color conversion',
  'plugins/popup' => 'Plugins: popups'
}
 
get '/*' do
  @environment = options.environment
  # Get the entire path
  url = params[:splat][0]
  # Default to the index page for /
  url = 'index' if url.nil? or url.length == 0
  # Strip off any trailing slash
  url = url.chomp('/')
  @title = TITLES[url] || ''
  erb url.to_sym
end