From c21f57b77f87556e03376c7ab3fee44c7eb250fb Mon Sep 17 00:00:00 2001 From: Taylor Luk Date: Wed, 24 Nov 2010 17:08:12 +1100 Subject: [PATCH 1/3] Let's Rack it up then (Ruby support) use rackup command 7 years of PHP and now i can't even set it up on 10.6 easily anymore.. --- config.ru | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 config.ru diff --git a/config.ru b/config.ru new file mode 100644 index 00000000000..c3764688102 --- /dev/null +++ b/config.ru @@ -0,0 +1,71 @@ +require "rubygems" +require 'sinatra' + +set :public, File.dirname(__FILE__) + +get '/' do + open('index.html').read +end + +get '/js' do + redirect '/js/' +end + +get '/js/' do + content_type 'text/javascript' + [ + 'jquery.js', + 'jquery.ui.widget.js', + 'jquery.mobile.widget.js', + 'jquery.mobile.media.js', + 'jquery.mobile.support.js', + 'jquery.mobile.event.js', + 'jquery.mobile.hashchange.js', + 'jquery.mobile.core.js', + 'jquery.mobile.page.js', + 'jquery.ui.position.js', + 'jquery.mobile.fixHeaderFooter.js', + 'jquery.mobile.forms.checkboxradio.js', + 'jquery.mobile.forms.textinput.js', + 'jquery.mobile.forms.select.js', + 'jquery.mobile.buttonMarkup.js', + 'jquery.mobile.forms.button.js', + 'jquery.mobile.forms.slider.js', + 'jquery.mobile.collapsible.js', + 'jquery.mobile.controlGroup.js', + 'jquery.mobile.fieldContain.js', + 'jquery.mobile.listview.js', + 'jquery.mobile.listview.filter.js', + 'jquery.mobile.dialog.js', + 'jquery.mobile.navbar.js', + 'jquery.mobile.grid.js' + ].reduce("") {|r, f| r << "\n\n" + open("js/#{f}").read } +end + +get '/themes/default' do + redirect '/themes/default/' +end + +get '/themes/default/' do + content_type "text/css" + [ + 'jquery.mobile.theme.css', + 'jquery.mobile.core.css', + 'jquery.mobile.transitions.css', + 'jquery.mobile.grids.css', + 'jquery.mobile.headerfooter.css', + 'jquery.mobile.navbar.css', + 'jquery.mobile.button.css', + 'jquery.mobile.collapsible.css', + 'jquery.mobile.controlgroup.css', + 'jquery.mobile.dialog.css', + 'jquery.mobile.forms.checkboxradio.css', + 'jquery.mobile.forms.fieldcontain.css', + 'jquery.mobile.forms.select.css', + 'jquery.mobile.forms.textinput.css', + 'jquery.mobile.listview.css', + 'jquery.mobile.forms.slider.css' + ].reduce("") {|r, f| r << "\n\n" + open("themes/default/#{f}").read } +end + +run Sinatra::Application \ No newline at end of file From f01f56d87ceb23db7ce88b4bc7b8c093d3b13bed Mon Sep 17 00:00:00 2001 From: Taylor Luk Date: Mon, 29 Nov 2010 09:51:08 +1100 Subject: [PATCH 2/3] Update sinatra app to read js/css from a include manifest file --- config.ru | 53 ++++++------------------------------- js/includes.txt | 25 +++++++++++++++++ themes/default/includes.txt | 16 +++++++++++ 3 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 js/includes.txt create mode 100644 themes/default/includes.txt diff --git a/config.ru b/config.ru index c3764688102..ec8a1df6540 100644 --- a/config.ru +++ b/config.ru @@ -13,33 +13,10 @@ end get '/js/' do content_type 'text/javascript' - [ - 'jquery.js', - 'jquery.ui.widget.js', - 'jquery.mobile.widget.js', - 'jquery.mobile.media.js', - 'jquery.mobile.support.js', - 'jquery.mobile.event.js', - 'jquery.mobile.hashchange.js', - 'jquery.mobile.core.js', - 'jquery.mobile.page.js', - 'jquery.ui.position.js', - 'jquery.mobile.fixHeaderFooter.js', - 'jquery.mobile.forms.checkboxradio.js', - 'jquery.mobile.forms.textinput.js', - 'jquery.mobile.forms.select.js', - 'jquery.mobile.buttonMarkup.js', - 'jquery.mobile.forms.button.js', - 'jquery.mobile.forms.slider.js', - 'jquery.mobile.collapsible.js', - 'jquery.mobile.controlGroup.js', - 'jquery.mobile.fieldContain.js', - 'jquery.mobile.listview.js', - 'jquery.mobile.listview.filter.js', - 'jquery.mobile.dialog.js', - 'jquery.mobile.navbar.js', - 'jquery.mobile.grid.js' - ].reduce("") {|r, f| r << "\n\n" + open("js/#{f}").read } + + open('js/includes.txt').each_line.reduce("") do |result, f| + result << "\n\n" + open("js/#{f.strip}").read + end end get '/themes/default' do @@ -48,24 +25,10 @@ end get '/themes/default/' do content_type "text/css" - [ - 'jquery.mobile.theme.css', - 'jquery.mobile.core.css', - 'jquery.mobile.transitions.css', - 'jquery.mobile.grids.css', - 'jquery.mobile.headerfooter.css', - 'jquery.mobile.navbar.css', - 'jquery.mobile.button.css', - 'jquery.mobile.collapsible.css', - 'jquery.mobile.controlgroup.css', - 'jquery.mobile.dialog.css', - 'jquery.mobile.forms.checkboxradio.css', - 'jquery.mobile.forms.fieldcontain.css', - 'jquery.mobile.forms.select.css', - 'jquery.mobile.forms.textinput.css', - 'jquery.mobile.listview.css', - 'jquery.mobile.forms.slider.css' - ].reduce("") {|r, f| r << "\n\n" + open("themes/default/#{f}").read } + + open('themes/default/includes.txt').each_line.reduce("") do |result, f| + result << "\n\n" + open("themes/default/#{f.strip}").read + end end run Sinatra::Application \ No newline at end of file diff --git a/js/includes.txt b/js/includes.txt new file mode 100644 index 00000000000..2fd91998790 --- /dev/null +++ b/js/includes.txt @@ -0,0 +1,25 @@ +jquery.js +jquery.ui.widget.js +jquery.mobile.widget.js +jquery.mobile.media.js +jquery.mobile.support.js +jquery.mobile.event.js +jquery.mobile.hashchange.js +jquery.mobile.core.js +jquery.mobile.page.js +jquery.ui.position.js +jquery.mobile.fixHeaderFooter.js +jquery.mobile.forms.checkboxradio.js +jquery.mobile.forms.textinput.js +jquery.mobile.forms.select.js +jquery.mobile.buttonMarkup.js +jquery.mobile.forms.button.js +jquery.mobile.forms.slider.js +jquery.mobile.collapsible.js +jquery.mobile.controlGroup.js +jquery.mobile.fieldContain.js +jquery.mobile.listview.js +jquery.mobile.listview.filter.js +jquery.mobile.dialog.js +jquery.mobile.navbar.js +jquery.mobile.grid.js \ No newline at end of file diff --git a/themes/default/includes.txt b/themes/default/includes.txt new file mode 100644 index 00000000000..1be4ecc4fa4 --- /dev/null +++ b/themes/default/includes.txt @@ -0,0 +1,16 @@ +jquery.mobile.theme.css +jquery.mobile.core.css +jquery.mobile.transitions.css +jquery.mobile.grids.css +jquery.mobile.headerfooter.css +jquery.mobile.navbar.css +jquery.mobile.button.css +jquery.mobile.collapsible.css +jquery.mobile.controlgroup.css +jquery.mobile.dialog.css +jquery.mobile.forms.checkboxradio.css +jquery.mobile.forms.fieldcontain.css +jquery.mobile.forms.select.css +jquery.mobile.forms.textinput.css +jquery.mobile.listview.css +jquery.mobile.forms.slider.css \ No newline at end of file From b0e46b25e0e9909b350273857f44d4e559ba3d70 Mon Sep 17 00:00:00 2001 From: Taylor Luk Date: Thu, 2 Dec 2010 16:37:28 +1100 Subject: [PATCH 3/3] Add navigation.js to include file --- js/includes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/js/includes.txt b/js/includes.txt index 2fd91998790..47d24d637b4 100644 --- a/js/includes.txt +++ b/js/includes.txt @@ -6,6 +6,7 @@ jquery.mobile.support.js jquery.mobile.event.js jquery.mobile.hashchange.js jquery.mobile.core.js +jquery.mobile.navigation.js jquery.mobile.page.js jquery.ui.position.js jquery.mobile.fixHeaderFooter.js