Skip to content
Browse files

markdown

  • Loading branch information...
1 parent 034c43a commit ed8748bca6407f17093749d1d36ebdcd4c66f31b @paulanthonywilson paulanthonywilson committed Mar 19, 2012
View
9 Gemfile
@@ -5,11 +5,12 @@ gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'twitter_oauth'
-gem 'will_paginate'
-gem 'aasm'
+gem 'twitter_oauth', '~> 0.4.3'
+gem 'will_paginate', '~> 3.0.3'
+gem 'aasm', '~> 3.0.3'
gem 'pg', :require => 'pg'
-gem 'execjs'
+gem 'execjs', '~> 1.3.0'
+gem 'kramdown', '~> 0.13.5'
# Gems used only for assets and not required
# in production environments by default.
View
26 Gemfile.lock
@@ -48,10 +48,10 @@ GEM
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
- factory_girl (2.3.2)
- activesupport
- factory_girl_rails (1.4.0)
- factory_girl (~> 2.3.0)
+ factory_girl (2.6.4)
+ activesupport (>= 2.3.9)
+ factory_girl_rails (1.7.0)
+ factory_girl (~> 2.6.0)
railties (>= 3.0.0)
flexmock (0.9.0)
highline (1.6.11)
@@ -62,9 +62,10 @@ GEM
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.5)
- kgio (2.7.2)
+ kgio (2.7.3)
+ kramdown (0.13.5)
libv8 (3.3.10.4)
- mail (2.4.3)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@@ -78,7 +79,7 @@ GEM
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
oauth (0.4.5)
- pg (0.12.2)
+ pg (0.13.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@@ -107,7 +108,7 @@ GEM
rdoc (3.12)
json (~> 1.4)
sass (3.1.15)
- sass-rails (3.2.4)
+ sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
@@ -147,21 +148,22 @@ PLATFORMS
ruby
DEPENDENCIES
- aasm
+ aasm (~> 3.0.3)
capistrano
coffee-rails (~> 3.2.1)
- execjs
+ execjs (~> 1.3.0)
factory_girl_rails
flexmock
jquery-rails
+ kramdown (~> 0.13.5)
pg
rails (= 3.2.0)
sass-rails (~> 3.2.3)
shoulda
sqlite3
test-unit
therubyracer
- twitter_oauth
+ twitter_oauth (~> 0.4.3)
uglifier (>= 1.0.3)
unicorn
- will_paginate
+ will_paginate (~> 3.0.3)
View
47 app/assets/javascripts/jquery.cookie.js
@@ -0,0 +1,47 @@
+/*!
+ * jQuery Cookie Plugin
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2011, Klaus Hartl
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.opensource.org/licenses/GPL-2.0
+ */
+(function($) {
+ $.cookie = function(key, value, options) {
+
+ // key and at least value given, set cookie...
+ if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
+ options = $.extend({}, options);
+
+ if (value === null || value === undefined) {
+ options.expires = -1;
+ }
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = String(value);
+
+ return (document.cookie = [
+ encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+
+ // key and possibly options given, get cookie...
+ options = value || {};
+ var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
+
+ var pairs = document.cookie.split('; ');
+ for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
+ if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
+ }
+ return null;
+ };
+})(jQuery);
View
4 app/assets/stylesheets/application.css
@@ -231,6 +231,10 @@ th{padding: 0 0 5px 5px; background-color: #f6f6f6;}
float: left;
}
+em {
+ font-weight: bolder
+}
+
/* forms */
#rating form{margin: 20px 0; border-top: 1px dotted #ccc; padding-top: 10px;}
#rating form .row{margin: 0 0 5px 0;}
View
2 app/helpers/proposals_helper.rb
@@ -19,7 +19,7 @@ def short(text, length=50)
def in_paragraphs(text)
return "" if text.blank?
- text.split(/$/).map{|line| "<p>#{h(line.strip)}</p>"}.join if text
+ Kramdown::Document.new(text).to_html.html_safe
end
def sort_proposals_by(text,param)
View
2 app/views/layouts/application.html.erb
@@ -4,7 +4,7 @@
<title>Scottish Ruby Conference - Review</title>
<%= stylesheet_link_tag 'reset-fonts-grids', 'jquery.tooltip', 'application', 'tablesort'%>
<%= stylesheet_link_tag 'application', 'print', :media => "print"%>
- <%= javascript_include_tag *%w(application jquery jquery.tooltip.min jquery-ui jquery.tablesorter.min)%>
+ <%= javascript_include_tag *%w(application jquery jquery.tooltip.min jquery-ui jquery.tablesorter.min jquery.cookie)%>
</head>
<body>
<%= content_tag("p", flash.values.first, :id=>'flash', :class=>flash.keys.first) unless flash.blank?%>

0 comments on commit ed8748b

Please sign in to comment.
Something went wrong with that request. Please try again.