Permalink
Browse files

View source code

  • Loading branch information...
bogdan committed Feb 8, 2012
1 parent aa5f42c commit 19d3a8af54332185b1737a37fe16a1d1f88f97b2
View
@@ -1,7 +1,7 @@
source 'http://rubygems.org'
gem 'rails', '3.0.9'
-gem 'mysql2', '0.2.11'
+gem 'pg'
# Deploy with Capistrano
# gem 'capistrano'
View
@@ -48,11 +48,11 @@ GEM
mime-types (1.16)
multi_json (1.0.3)
multipart-post (1.1.3)
- mysql2 (0.2.11)
oauth (0.4.5)
oauth2 (0.4.1)
faraday (~> 0.6.1)
multi_json (>= 0.0.5)
+ pg (0.12.2)
polyglot (0.3.2)
rack (1.2.4)
rack-mount (0.6.14)
@@ -105,7 +105,7 @@ PLATFORMS
ruby
DEPENDENCIES
- mysql2 (= 0.2.11)
+ pg
rails (= 3.0.9)
rspec (~> 2.5.0)
rspec-rails (~> 2.5.0)
@@ -4,7 +4,11 @@
<title>Collaboration</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" %>
+ <%= javascript_include_tag "shjs" %>
+ <%= javascript_include_tag "sh_html" %>
+ <%= javascript_include_tag "sh_javascript" %>
<%= javascript_include_tag "ajaxsubmit" %>
+ <%= javascript_include_tag "support" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
@@ -27,4 +27,4 @@
<div class="actions">
<%= f.submit %>
</div>
-<% end %>
+<% end %>
@@ -0,0 +1,8 @@
+<div class="left">
+ <h2>Source:</h2>
+ <h3>HTML:</h3>
+ <pre class="sh_html"><code><%= form.to_str.gsub(/<div style=.*<\/div>/, "") %></code></pre>
+ <h3>JavaScript:</h3>
+ <pre class="sh_javascript"><code><%= File.read(Rails.root.join("public/javascripts/application.js")) %></code></pre>
+</div>
+<div class="clear"></div>
@@ -1,13 +1,20 @@
-<%= form_tag user_sessions_path, :method => :post, :class => "ajax-form" do %>
- <div class="field" validate="email">
- <%= label_tag :email %><br />
- <%= text_field_tag :email %>
- </div>
- <div class="field" validate="password">
- <%= label_tag :password %><br />
- <%= password_field_tag :password %>
- </div>
- <div class="actions">
- <%= submit_tag "Login" %>
- </div>
-<% end %>
+<div class="left spaced">
+ <%= form = form_tag user_sessions_path, :method => :post, :class => "ajax-form" do %>
+ <div class="field" validate="email base">
+ <%= label_tag :email %><br />
+ <%= text_field_tag :email %>
+ </div>
+ <div class="field" validate="password">
+ <%= label_tag :password %><br />
+ <%= password_field_tag :password %>
+ </div>
+ <div class="actions">
+ <%= submit_tag "Login" %>
+ </div>
+ <% end %>
+</div>
+
+<div class="left">
+ <%= render :partial => "shared/source", :locals => {:form => form} %>
+</div>
+<div class="clear"></div>
@@ -1,19 +1,24 @@
-<%= form_for(@user, :html => {:class => "ajax-form"}) do |f| %>
+<div class="left spaced">
+ <%= form = form_for(@user, :html => {:class => "ajax-form"}) do |f| %>
+
+ <div class="field" validate="email">
+ <%= f.label :email %><br />
+ <%= f.text_field :email, :size => nil %>
+ </div>
+ <div class="field" validate="password">
+ <%= f.label :password %><br />
+ <%= f.password_field :password, :size => nil%>
+ </div>
+ <div class="field" validate="password_confirmation">
+ <%= f.label :password_confirmation %><br />
+ <%= f.password_field :password_confirmation, :size => nil%>
+ </div>
+ <div class="actions">
+ <%= f.submit :id => nil %>
+ </div>
+ <% end %>
+</div>
+
+<%= render :partial => 'shared/source', :locals => {:form => form} %>
- <div class="field" validate="email">
- <%= f.label :email %><br />
- <%= f.text_field :email %>
- </div>
- <div class="field" validate="password">
- <%= f.label :password %><br />
- <%= f.password_field :password %>
- </div>
- <div class="field" validate="password_confirmation">
- <%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation %>
- </div>
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
View
@@ -6,34 +6,23 @@
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
- adapter: mysql2
- encoding: utf8
- reconnect: false
- database: collaboration_development
+ adapter: postgresql
+ database: ajaxsubmit_development
+ username: postgres
pool: 5
- username: root
- password:
- host: localhost
+ timeout: 5000
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
test:
- adapter: mysql2
- encoding: utf8
- reconnect: false
- database: collaboration_test
+ adapter: postgresql
+ database: ajaxsubmit_test
+ username: postgres
pool: 5
- username: root
- password:
- host: localhost
+ timeout: 5000
production:
- adapter: mysql2
- encoding: utf8
- reconnect: false
- database: collaboration_production
+ adapter: postgresql
+ database: ajaxsubmit_production
+ username: postgres
pool: 5
- username: root
- password:
- host: localhost
+ timeout: 5000
+
@@ -1,5 +1,7 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
$(function () {
$('.ajax-form').ajaxForm();
});
+
+
+
+
@@ -0,0 +1,127 @@
+if (! this.sh_languages) {
+ this.sh_languages = {};
+}
+sh_languages['html'] = [
+ [
+ [
+ /<\?xml/g,
+ 'sh_preproc',
+ 1,
+ 1
+ ],
+ [
+ /<!DOCTYPE/g,
+ 'sh_preproc',
+ 3,
+ 1
+ ],
+ [
+ /<!--/g,
+ 'sh_comment',
+ 4
+ ],
+ [
+ /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
+ 'sh_keyword',
+ -1
+ ],
+ [
+ /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
+ 'sh_keyword',
+ 5,
+ 1
+ ],
+ [
+ /&(?:[A-Za-z0-9]+);/g,
+ 'sh_preproc',
+ -1
+ ],
+ [
+ /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
+ 'sh_keyword',
+ -1
+ ],
+ [
+ /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
+ 'sh_keyword',
+ 5,
+ 1
+ ]
+ ],
+ [
+ [
+ /\?>/g,
+ 'sh_preproc',
+ -2
+ ],
+ [
+ /([^=" \t>]+)([ \t]*)(=?)/g,
+ ['sh_type', 'sh_normal', 'sh_symbol'],
+ -1
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ 2
+ ]
+ ],
+ [
+ [
+ /\\(?:\\|")/g,
+ null,
+ -1
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ -2
+ ]
+ ],
+ [
+ [
+ />/g,
+ 'sh_preproc',
+ -2
+ ],
+ [
+ /([^=" \t>]+)([ \t]*)(=?)/g,
+ ['sh_type', 'sh_normal', 'sh_symbol'],
+ -1
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ 2
+ ]
+ ],
+ [
+ [
+ /-->/g,
+ 'sh_comment',
+ -2
+ ],
+ [
+ /<!--/g,
+ 'sh_comment',
+ 4
+ ]
+ ],
+ [
+ [
+ /(?:\/)?>/g,
+ 'sh_keyword',
+ -2
+ ],
+ [
+ /([^=" \t>]+)([ \t]*)(=?)/g,
+ ['sh_type', 'sh_normal', 'sh_symbol'],
+ -1
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ 2
+ ]
+ ]
+];
+
Oops, something went wrong.

0 comments on commit 19d3a8a

Please sign in to comment.