Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove vendor/plugins/* in favor of gems

- encoder plugin is not needed - ActionView::UrlHelper#mail_to now has
an `encode` option
- headliner plugin was released as a gem, but the aliased `t` was
renamed to `pt` for setting the page title
  • Loading branch information...
commit 3dced6ac9b7286e4b7267c303dbde73a39b516ca 1 parent 7403723
@bensie bensie authored
Showing with 83 additions and 666 deletions.
  1. +1 −0  Gemfile
  2. +2 −0  Gemfile.lock
  3. +1 −1  app/views/events/edit.html.haml
  4. +1 −1  app/views/events/index.html.haml
  5. +1 −1  app/views/events/new.html.haml
  6. +1 −1  app/views/pages/about.haml
  7. +3 −3 app/views/pages/index.haml
  8. +17 −17 app/views/pages/speak.haml
  9. +2 −2 app/views/pages/sponsors.haml
  10. +6 −6 app/views/pages/thanks.haml
  11. +22 −22 app/views/pages/tshirts.haml
  12. +1 −1  app/views/photos/index.haml
  13. +3 −3 app/views/podcasts/index.haml
  14. +2 −2 app/views/podcasts/show.haml
  15. +2 −2 app/views/projects/index.html.haml
  16. +3 −3 app/views/user_sessions/new.html.haml
  17. +1 −1  app/views/users/edit.html.haml
  18. +3 −3 app/views/users/forgot_password.html.haml
  19. +1 −1  app/views/users/new.html.haml
  20. +10 −10 app/views/users/show.html.haml
  21. +0 −27 vendor/plugins/enkoder/LICENSE
  22. +0 −82 vendor/plugins/enkoder/README
  23. +0 −1  vendor/plugins/enkoder/init.rb
  24. +0 −144 vendor/plugins/enkoder/lib/enkoder.rb
  25. +0 −19 vendor/plugins/headliner/LICENSE
  26. +0 −118 vendor/plugins/headliner/README
  27. +0 −22 vendor/plugins/headliner/Rakefile
  28. +0 −1  vendor/plugins/headliner/init.rb
  29. +0 −65 vendor/plugins/headliner/lib/headliner.rb
  30. +0 −107 vendor/plugins/headliner/test/headliner_test.rb
View
1  Gemfile
@@ -8,6 +8,7 @@ gem "chronic"
gem "dynamic_form"
gem "formatize"
gem "haml-rails"
+gem "headliner"
gem "heroku_san"
gem "hpricot"
gem "jquery-rails"
View
2  Gemfile.lock
@@ -93,6 +93,7 @@ GEM
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
+ headliner (0.1.3)
heroku (2.30.3)
heroku-api (~> 0.3.4)
launchy (>= 0.3.2)
@@ -278,6 +279,7 @@ DEPENDENCIES
guard-rspec
guard-spork
haml-rails
+ headliner
heroku_san
hpricot
jquery-rails
View
2  app/views/events/edit.html.haml
@@ -1,4 +1,4 @@
-%h1=t "Editing event"
+%h1=pt "Editing event"
= error_messages_for :event
View
2  app/views/events/index.html.haml
@@ -1,4 +1,4 @@
-%h1=t "Listing events"
+%h1=pt "Listing events"
%table
%tr
View
2  app/views/events/new.html.haml
@@ -1,4 +1,4 @@
-%h1=t "New event"
+%h1=pt "New event"
= error_messages_for :event
View
2  app/views/pages/about.haml
@@ -1 +1 @@
-%h1=t "About SD Ruby"
+%h1=pt "About SD Ruby"
View
6 app/views/pages/index.haml
@@ -1,4 +1,4 @@
-- t "We are San Diego's Ruby community."
+- pt "We are San Diego's Ruby community."
#promo
@@ -32,7 +32,7 @@
We also organize hackfests twice a month, which are held at the offices of
= link_to "Monk Development", "http://www.monkdevelopment.com"
in Old Town San Diego.
-
+
%p
For more information, check out our
= link_to("SD Ruby Meetup", "http://www.meetup.com/sdruby/")
@@ -65,7 +65,7 @@
Check the archives to make sure your listing hasn't been posted by another recruiter.
%h2 Want to speak at SD Ruby?
-
+
%p
We're looking for awesome speakers. If that sounds like you, check out our
= link_to "speaker guidelines", speak_path
View
34 app/views/pages/speak.haml
@@ -2,23 +2,23 @@
= image_tag "pages/speak.jpg", :size => "850x480"
- %h1=t "Speak at SD Ruby"
+ %h1=pt "Speak at SD Ruby"
%p Here are some guidelines for speaking at SD Ruby:
-
+
%h2 Proposing Talks
-
+
%p Want to speak at a future SD Ruby meeting? We’re looking for awesome speakers who can share their expertise with a tech-saavy audience. Topics can include Ruby and Ruby on Rails, of course. But we also love talks on other web-related or computer science topics (Javascript, MySQL, Postgres, Redis, Git, etc.)
%p We welcome talks from existing SD Ruby members, as well as from developers who are visiting San Diego. You definitely don’t have to live here or a be a member of the group to talk.
-
+
%p
If that sounds like you,
= link_to "drop us", "mailto:patrick@mokolabs.com?subject=SD Ruby talk"
= (link_to "a line", "mailto:rgkaufman@gmail.com?subject=SD Ruby talk")
with your talk title and description, plus your availability.
-
+
%h2 Preparing Your Talk
%ul
@@ -29,26 +29,26 @@
%li We recommend using large type and colors with high contrast so that your content is legible on screen.
%li When using code samples, also use large type. You might want to break up samples into multiple slides if necessary.
%li Minimize any live coding. Live coding can be difficult and error prone, so it's best to avoid coding in front of the audience or, at least, reduce your live coding time to a reasonable amount that can be accomplished without major errors. GOOD: Make small changes and reload in the browser. BAD: Compiling Ruby, deploying sites, etc.
-
+
%h2 Giving Your Talk
%ul
%li Please arrive 15 minutes before the start of our meeting so that we can get you ready for your talk.
-
+
%li Internet access is provided by UCSD. We have both wireless and Ethernet. Unless you need wireless, we recommend using Ethernet because it is faster and easier to configure.
-
+
%li We will provide the correct adapter for your display. You can bring your own adapter just to be safe, but we likely won’t need to use it.
-
+
%li Before you begin speaking, please make sure that you are alone on stage and there are no distractions nearby. Once everything looks okay, WAIT FIVE SECONDS before beginning. Why five seconds? Since we record each talk at SD Ruby and release it as a podcast episode, it helps if we have a bit of pre-roll before your talk begins. If you’re moving around a bunch or speaking about something else immediately before starting your talk (i.e. "Great game last night by the Padres... so my name is Patrick and I want to talk about Heroku"), it looks unprofessional.
-
+
%li When asked a question by audience members, make sure that the question is asked using a microphone. If that’s not possible for some reason, please repeat the question so that our podcast audience can hear it.
-
+
%li Once your talk has finished and applause has ended, please WAIT FIVE SECONDS before leaving the stage... again, for the same reasons as above.
%li If this is your first time speaking, don’t be nervous. Just speak from your heart about your own experiences exactly the same way you’d relate them to a friend and you’ll do great.
-
+
%h2 After The Meeting
-
+
%ul
%li Congrats! You just spoke at SD Ruby!!! Join us at Rock Bottom for a beer?
%li
@@ -58,17 +58,17 @@
Once your slides have been published, please send a link to your slides to
= (link_to "Patrick Crowley", "mailto:patrick@mokolabs.com?subject=Slides from my SD Ruby talk") + "."
%li
- Follow us at
+ Follow us at
= link_to "@sdruby", "https://twitter.com/sdruby"
on Twitter.
When we publish your talk as a podcast episode, we’ll tweet about your episode from our account. Retweet us to help promote your episode.
-
+
%h2 Questions?
-
+
%p
Drop a line to
= link_to "Patrick Crowley", "mailto:patrick@mokolabs.com?subject=Slides from my SD Ruby talk"
or
= link_to "Rob Kaufman", "mailto:rgkaufman@gmail.com?subject=SD Ruby talk"
if you have a question about speaking.
-
+
View
4 app/views/pages/sponsors.haml
@@ -1,4 +1,4 @@
-%h1=t "Sponsors"
+%h1=pt "Sponsors"
%p Thanks to the following organizations and companies who support SD Ruby.
@@ -26,4 +26,4 @@
%p
Want to become an SD Ruby sponsor?
- = link_to "Drop us a line", "mailto:patrick@mokolabs.com?subject=SD Ruby sponsorship"
+ = link_to "Drop us a line", "mailto:patrick@mokolabs.com?subject=SD Ruby sponsorship"
View
12 app/views/pages/thanks.haml
@@ -1,17 +1,17 @@
#primary.tshirt
-
- %h1=t "SD Ruby T-Shirts"
-
+
+ %h1=pt "SD Ruby T-Shirts"
+
%p
%strong Thanks for your order!
-
+
%p
If you're going to be at RailsConf, you can grab your shirt from Patrick Crowley in Las Vegas.
%br/
Otherwise, just pick up your shirt at the May 14th SD Ruby meeting.
-
+
%p
%strong Questions?
Email <a href="mailto:patrick@mokolabs.com">patrick@mokolabs.com</a>.
-
+
View
44 app/views/pages/tshirts.haml
@@ -1,52 +1,52 @@
#primary.tshirt
-
- %h1=t "SD Ruby T-Shirts"
-
+
+ %h1=pt "SD Ruby T-Shirts"
+
%p
= image_tag "home/tshirt.gif", :size => "840x533", :alt => "SD Ruby t-shirt", :id => "tshirt"
-
+
%p
- We're reprinting our super awesome SD Ruby t-shirts (designed by
+ We're reprinting our super awesome SD Ruby t-shirts (designed by
= link_to("Luke Mysse", "http://www.lukemysse.com/") + ")."
-
+
%p#details
%strong.first :details => {<br />
- %strong :price =>
+ %strong :price =>
'&#036;15',<br />
- %strong :stock =>
+ %strong :stock =>
'American Apparel',<br />
- %strong :color =>
+ %strong :color =>
'Chocolate Brown',<br />
- %strong :sizes =>
+ %strong :sizes =>
'Available in XXS, XS, S, M, L, XL, 2XL, 3XL
= link_to "(size chart)", "http://www.americanapparel.net/garmentspecs/index.asp?garmentspecid=2001"
'<br />
%strong }
-
+
%p
You can purchase this shirt via PayPal. Please note your size when ordering. If you'd like to buy a shirt using cash, please email your name and size to <a href="mailto:patrick@mokolabs.com">patrick@mokolabs.com</a>.
-
+
%p
%strong The deadline for ordering shirts is May 1.
-
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="4899618">
<table>
<tr><td><input type="hidden" name="on0" value="Size">Select t-shirt size:</td></tr><tr><td><select name="os0">
- <option value="XXS">XXS
- <option value="XS">XS
- <option value="S">S
- <option value="M" selected="selected">M
- <option value="L">L
- <option value="XL">XL
- <option value="2XL">2XL
- <option value="3XL">3XL
+ <option value="XXS">XXS
+ <option value="XS">XS
+ <option value="S">S
+ <option value="M" selected="selected">M
+ <option value="L">L
+ <option value="XL">XL
+ <option value="2XL">2XL
+ <option value="3XL">3XL
</select> </td></tr>
</table>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
-
+
View
2  app/views/photos/index.haml
@@ -1,4 +1,4 @@
-- t "Photos"
+- pt "Photos"
- @photos.each do |photo_url|
= link_to image_tag(photo_url), photo_url
View
6 app/views/podcasts/index.haml
@@ -1,4 +1,4 @@
-- t "Podcast"
+- pt "Podcast"
= render :partial => "sponsor"
@@ -23,9 +23,9 @@
= link_to(image_tag("application/itunes.png", :size => "79x24", :alt => "Podcast feed for iTunes", :id => "itunes"), "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=168362573")
= link_to(image_tag("http://feeds.feedburner.com/~fc/sdrbpodcast?bg=FFFFFF&amp;fg=666666&amp;anim=0", :size => "88x26", :alt => "Podcast feed", :id => "feed_stats"), "http://feeds2.feedburner.com/sdrbpodcast")
-
+
%br.clear
-
+
#joyent
Bandwidth provided by
= link_to(image_tag("home/joyent.png", :size => "86x25", :alt => "New Relic"), "http://newrelic.com")
View
4 app/views/podcasts/show.haml
@@ -1,4 +1,4 @@
-- t "#{@podcast.episode_number}: #{h(@podcast.name)}"
+- pt "#{@podcast.episode_number}: #{h(@podcast.name)}"
= render :partial => "sponsor"
@@ -17,7 +17,7 @@
%a.twitter-share-button{ "data-via" => "sdruby", :href => "https://twitter.com/share" }
:javascript
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
-
+
.screenshot
= link_to(image_tag(@podcast.screenshot.url, :size => size_for(@podcast), :alt => "Episode #{@podcast.id}"), @podcast.movie_link)
View
4 app/views/projects/index.html.haml
@@ -1,4 +1,4 @@
-%h1=t "Projects"
+%h1=pt "Projects"
%p#projects_intro
SD Ruby members have created
@@ -22,4 +22,4 @@
.name
= link_to h(user.full_name), user
%ul.projects
- = show_github_projects_for(user)
+ = show_github_projects_for(user)
View
6 app/views/user_sessions/new.html.haml
@@ -1,5 +1,5 @@
-%h1=t "Login to SD Ruby"
+%h1=pt "Login to SD Ruby"
= form_for @user_session, :url => user_session_path do |f|
= f.error_messages
@@ -7,7 +7,7 @@
.flash
&bull;
= value
-
+
%p
= f.label :email
= f.text_field :email, :size => 25
@@ -22,4 +22,4 @@
= f.submit "Login"
- = link_to("Forgot Password?", password_reset_path)
+ = link_to("Forgot Password?", password_reset_path)
View
2  app/views/users/edit.html.haml
@@ -1,4 +1,4 @@
-%h1=t "Edit Profile"
+%h1=pt "Edit Profile"
= error_messages_for :user
View
6 app/views/users/forgot_password.html.haml
@@ -1,14 +1,14 @@
-%h1=t "Forgot Password?"
+%h1=pt "Forgot Password?"
= form_for :user, :url => password_reset_path do |f|
- flash.each do |key, value|
.flash
&bull;
= value
-
+
%p
%label Enter your email address and we'll send you a new password.
= f.text_field :email
-
+
%p
= f.submit "Send New Password", :class => "submit"
View
2  app/views/users/new.html.haml
@@ -1,4 +1,4 @@
-%h1=t "Signup"
+%h1=pt "Signup"
= error_messages_for :user
View
20 app/views/users/show.html.haml
@@ -6,29 +6,29 @@
%p#about
= @user.about
%br
-
+
- unless @user.links.blank?
%p
%strong= "Links"
%ul#links
= iconify_and_link @user.links, :size => 32
-
+
- unless @user.projects.empty?
%p
%strong Projects
%ul.projects
= show_github_projects_for(@user)
-
+
#basics
-
+
#avatar
= image_tag @user.avatar.url(:medium)
- %h1=t @user.full_name
+ %h1=pt @user.full_name
%ul#stats
- if @user.admin?
- %li
+ %li
%strong= link_to @user.role, team_path
- unless @user.started_using_ruby_on.blank?
@@ -44,13 +44,13 @@
Available for work
- unless not @user.show_email?
%li
- = raw enkode_mail(@user.email, 'Email me')
-
-
+ = mail_to(@user.email, 'Email me', :encode => "javascript")
+
+
- if @user == current_user or current_admin
%p
= link_to 'edit profile', edit_user_path(@user)
%p
= link_to 'delete profile', user_path(@user), :method => :delete, :confirm => "Are you sure you wish to delete your profile? Your profile will be completely removed."
-
+
%br.clear
View
27 vendor/plugins/enkoder/LICENSE
@@ -1,27 +0,0 @@
-Copyright (c) 2006, Automatic Corp.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. Neither the name of AUTOMATIC CORP. nor the names of its contributors may
- be used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
82 vendor/plugins/enkoder/README
@@ -1,82 +0,0 @@
-==Hivelogic Enkoder
-
-The Enkoder plugin provides an extension to TextHelper that can be used to
-protect email addresses (or other information) by obfuscating them using
-JavaScript code. The only way to decrypt the JavaScript is to actually run it,
-hiding the results from email-harvesting robots while revealing them to real
-people.
-
-It uses a significantly different (and some might say more secure) algorithm
-than the built-in mail_to helper.
-
-Note: There's no guarantee here -- the only way to be completely safe is to not
-publish your address at all.
-
-
-==Installation:
-
-Just drop the "enkoder" folder into the /vendor/plugins folder in your project.
-
-
-==Usage:
-
-There are two methods:
-
- enkode( html )
-
-This method accepts a block of html (or any text) and returns an enkoded JavaScript.
-
-The second method is:
-
- enkode_mail( email, link_text, title_text=nil, subject=nil )
-
-This method takes an email address, the text to show to the viewer, optional
-title text (what's seen when somebody hovers over the link), and optional
-subject for the email, and returns an enkoded email address link.
-
-
-==Examples:
-
-To enkode a single email address, one could just do:
-
- <%= enkode_mail('user@domain.com','click here') %>
-
-And the following link would be returned (enkoded as JavaScript):
-
- <a href="mailto:"user@domain.com" title="">click here</a>
-
-Adding a title and subject text would require the second two optional fields:
-
- <%= enkode_mail('user@domain.com','click here', 'email me', 'enkoder') %>
-
-And we'd get back (enkoded as JavaScript):
-
- <a href="mailto:"user@domain.com?subject=enkoder" title="email me">click here</a>
-
-Of course we can also enkode many email addresses on the fly:
-
- <% @users.each do |user| %>
- <p><%= enkode_mail(@user.email,@user.name) %></p>
- <% end %>
-
-To enkode a snippet of XHTML, we can do:
-
- <%= enkode("<p>This block will be hidden from spambots.</p>") %>
-
-We could protect a link or block of XHTML from being indexed like this:
-
- <%= enkode('Try and find <a href="secret.html">this</a>, google!') %>
-
-We could have anything we wanted in that block, XHTML, links, email addresses, etc.
-
-For more examples and to see the full functionality of the Enkoder, have a look
-its permanent page on the web:
-
- http://hivelogic.com/enkoder
-
-
-==License:
-
-Copyright (c) 2006 Automatic Corp.
-
-This plugin is released under the LGPL license. See LICENSE file for details.
View
1  vendor/plugins/enkoder/init.rb
@@ -1 +0,0 @@
-require 'enkoder'
View
144 vendor/plugins/enkoder/lib/enkoder.rb
@@ -1,144 +0,0 @@
-# Copyright (c) 2006, Automatic Corp.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# 3. Neither the name of AUTOMATIC CORP. nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-module ActionView
- module Helpers
- module TextHelper
-
- def enkode( html, max_length=1024 )
-
- rnd = 10 + (rand*90).to_i
-
- kodes = [
- {
- 'rb' => lambda do |s|
- s.reverse
- end,
- 'js' => ";kode=kode.split('').reverse().join('')"
- },
- {
- 'rb' => lambda do |s|
- result = ''
- s.each_byte { |b|
- b += 3
- b-=128 if b>127
- result += b.chr
- }
- result
- end,
- 'js' => (
- ";x='';for(i=0;i<kode.length;i++){c=kode.charCodeAt(i)-3;" +
- "if(c<0)c+=128;x+=String.fromCharCode(c)}kode=x"
- )
- },
- {
- 'rb' => lambda do |s|
- for i in (0..s.length/2-1)
- s[i*2],s[i*2+1] = s[i*2+1],s[i*2]
- end
- s
- end,
- 'js' => (
- ";x='';for(i=0;i<(kode.length-1);i+=2){" +
- "x+=kode.charAt(i+1)+kode.charAt(i)}" +
- "kode=x+(i<kode.length?kode.charAt(kode.length-1):'');"
- )
- }
- ]
-
- kode = "document.write("+ js_dbl_quote(html) +");"
-
- max_length = kode.length+1 unless max_length>kode.length
-
- result = ''
-
- while kode.length < max_length
- idx = (rand*kodes.length).to_i
- kode = kodes[idx]['rb'].call(kode)
- kode = "kode=" + js_dbl_quote(kode) + kodes[idx]['js']
- js = "var kode=\n"+js_wrap_quote(js_dbl_quote(kode),79)
- js = js+"\n;var i,c,x;while(eval(kode));"
- js = "function hivelogic_enkoder(){"+js+"}hivelogic_enkoder();"
- js = '<script type="text/javascript">'+"\n/* <![CDATA[ */\n"+js
- js = js+"\n/* ]]> */\n</script>\n"
- result = js unless result.length>max_length
- end
-
- result
-
- end
-
- def enkode_mail( email, link_text, title_text=nil, subject=nil )
- str = String.new
- str << '<a href="mailto:' + email
- str << '?subject=' + subject unless subject.nil?
- str << '" title="'
- str << title_text unless title_text.nil?
- str << '">' + link_text + '</a>'
- enkode(str)
- end
-
- private
-
- def js_dbl_quote( str )
- str.inspect
- end
-
- def js_wrap_quote( str, max_line_length )
- max_line_length -= 3
- inQ = false
- esc = 0
- lineLen = 0
- result = ''
- chunk = ''
- while str.length > 0
- if str =~ /^\\[0-7]{3}/
- chunk = str[0..3]
- str[0..3] = ''
- elsif str =~ /^\\./
- chunk = str[0..1]
- str[0..1] = ''
- else
- chunk = str[0..0]
- str[0..0] = ''
- end
- if lineLen+chunk.length >= max_line_length
- result += '"+'+"\n"+'"'
- lineLen = 1
- end
- lineLen += chunk.length
- result += chunk;
- end
- result
- end
-
- end
- end
-end
View
19 vendor/plugins/headliner/LICENSE
@@ -1,19 +0,0 @@
-Copyright (c) 2007 Patrick Crowley, the.railsi.st
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
118 vendor/plugins/headliner/README
@@ -1,118 +0,0 @@
-=========
-Headliner
-=========
-
-Headliner DRYs up your page titles.
-
-
-Background
-==========
-
-Normally, if your Rails application has lots of actions and a shared
-layout, you might find yourself setting custom page title names in your
-controllers.
-
-Here's an example:
-
-class PagesController < ApplicationController
- def about
- @title = "About us"
- end
-end
-
-Then, in your main layout, you might have something like this:
-
-<head>
-<title>My website<% if @title %>: <%= @title %><% end %></title>
-</head
-
-This works okay... but page titles don't really belong in controllers, do
-they?
-
-So, by moving these titles into your views, we can DRY things up a bit and
-reinforce the MVC design pattern that's so fundamental to Ruby on Rails.
-
-
-Usage
-=====
-
-First, add this code to your main layout:
-
-<head>
-<%= title :site => "My website" %>
-</head>
-
-Then, to set the page title, add this to each of your views:
-
-<h1><%= title "My page title" %></h1>
-
-When views are rendered, the page title will be included in the right
-spots:
-
-<head>
-<title>My website | My page title</title>
-</head>
-<body>
-<h1>My page title</h1>
-</body>
-
-
-Options
-=======
-
-Use these options to customize the title format:
-
-:prefix (text between site name and separator)
-:separator (text used to separate website name from page title)
-:suffix (text between separator and page title)
-:lowercase (when true, the page name will be lowercase)
-:reverse (when true, the page and site names will be reversed)
-
-And here are a few examples to give you ideas.
-
-<%= title :separator => "&mdash;" %>
-<%= title :prefix => false, :separator => ":" %>
-<%= title :lowercase => true %>
-<%= title :reverse => true, :prefix => false %>
-
-
-Dealing with special pages
-==========================
-
-How do you set the page title without showing it in the view?
-
-<% title "My page title" %>
-
-What if your view headline is different from your page title?
-
-<%= title "My page title", "My headline" %>
-
-
-Mr. T says, ‘Use my method, fool!’
-==================================
-
-Just like ERB's HTML safe method, you can invoke Headliner with a single
-letter alias.
-
-<h1><%=t "My page title" %></h1>
-
-
-How does it work?
-=================
-
-Ruby on Rails renders actions *before* inserting them into layouts. So, if
-you set a variable in your view, it will be accessible in your layout. But,
-at first glance, it looks like you're using a variable (in the head)
-before it's been assigned a value (in the body). Cool, huh?
-
-
-Credits
-=======
-
-Special thanks to Nick Zadrozny and Jordan Fowler for their input.
-
-
-Feedback
-========
-
-Comments, bug reports, and svn diffs welcome at http://the.railsi.st.
View
22 vendor/plugins/headliner/Rakefile
@@ -1,22 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Test the Headliner plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Generate documentation for the Headliner plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'Headliner'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
1  vendor/plugins/headliner/init.rb
@@ -1 +0,0 @@
-ActionView::Base.send :include, Headliner
View
65 vendor/plugins/headliner/lib/headliner.rb
@@ -1,65 +0,0 @@
-module Headliner
-
- def title(options, headline='')
- if options.is_a? String
- save_title(options, headline)
- else
- display_title(options)
- end
- end
-
- def save_title(title, headline)
- @title = title.gsub(/<\/?[^>]*>/, '')
- headline.blank? ? title : headline
- end
-
- def display_title(options)
- # Prefix (leading space)
- if options[:prefix]
- prefix = options[:prefix]
- elsif options[:prefix] == false
- prefix = ''
- else
- prefix = ' '
- end
-
- # Separator
- unless options[:separator].blank?
- separator = options[:separator]
- else
- separator = '|'
- end
-
- # Suffix (trailing space)
- if options[:suffix]
- suffix = options[:suffix]
- elsif options[:suffix] == false
- suffix = ''
- else
- suffix = ' '
- end
-
- # Lowercase title?
- if options[:lowercase] == true
- @title = @title.downcase unless @title.blank?
- end
-
- # Set website/page order
- unless @title.blank?
- if options[:reverse] == true
- # Reverse order => "Page : Website"
- return content_tag(:title, @title + prefix + separator + suffix + options[:site])
- else
- # Standard order => "Website : Page"
- return content_tag(:title, options[:site] + prefix + separator + suffix + @title)
- end
- end
-
- # If title is blank, return only website name
- content_tag :title, options[:site]
- end
-
- # Mr. T says, "Use my method, fool!"
- alias t title
-
-end
View
107 vendor/plugins/headliner/test/headliner_test.rb
@@ -1,107 +0,0 @@
-require 'rubygems'
-require 'test/unit'
-require File.dirname(__FILE__) + '/../lib/headliner'
-require 'action_view/helpers/tag_helper'
-
-class HeadlinerTest < Test::Unit::TestCase
-
- include ActionView::Helpers::TagHelper
- include Headliner
-
- # Make the blank? method available without loading Rails
- Object.class_eval do
- def blank?
- if respond_to?(:empty?) && respond_to?(:strip)
- empty? or strip.empty?
- elsif respond_to?(:empty?)
- empty?
- else
- !self
- end
- end
- end
-
- def test_title_is_saved
- title "Headliner", ""
- assert_equal "Headliner", @title
- end
-
- def test_title_is_saved_with_headline
- headline = save_title "Headliner", "Headliner: a plugin for setting page titles"
- assert_equal "Headliner", @title
- assert_equal "Headliner: a plugin for setting page titles", headline
- end
-
- def test_title_is_site_when_empty
- title :site => "the.railsi.st"
- assert_equal nil, @title
- end
-
- def test_title_removes_all_tags
- title 'Headliner is <strong class="underline">cool</strong>'
- assert_equal "Headliner is cool", @title
- end
-
- def test_title_removes_all_tags_but_displays_tags_in_views
- original_title = save_title 'Headliner is <strong class="underline">cool</strong>', ''
- assert_equal "Headliner is cool", @title
- assert_equal 'Headliner is <strong class="underline">cool</strong>', original_title
- end
-
- def test_title_is_lowercase
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :lowercase => true
- assert_equal "<title>the.railsi.st | headliner</title>", full_title
- end
-
- def test_title_is_reversed
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :reverse => true
- assert_equal "<title>Headliner | the.railsi.st</title>", full_title
- end
-
- def test_title_has_custom_separator
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :separator => "&mdash;"
- assert_equal "<title>the.railsi.st &mdash; Headliner</title>", full_title
- end
-
- def test_title_has_custom_prefix_and_suffix
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :prefix => " ", :suffix => " "
- assert_equal "<title>the.railsi.st | Headliner</title>", full_title
- end
-
- def test_title_has_no_prefix_and_has_custom_separator
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :prefix => false, :separator => ":"
- assert_equal "<title>the.railsi.st: Headliner</title>", full_title
- end
-
- def test_title_has_no_suffix_and_has_custom_separator
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st", :suffix => false, :separator => "~"
- assert_equal "<title>the.railsi.st ~Headliner</title>", full_title
- end
-
- def test_title_has_no_prefix_and_suffix_and_has_custom_separator
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st",
- :prefix => false,
- :suffix => false,
- :separator => "&mdash;"
- assert_equal "<title>the.railsi.st&mdash;Headliner</title>", full_title
- end
-
- def test_title_has_all_custom_options
- @title = "Headliner"
- full_title = display_title :site => "the.railsi.st",
- :prefix => " ",
- :suffix => " ",
- :separator => ".:.",
- :lowercase => true,
- :reverse => true
- assert_equal "<title>headliner .:. the.railsi.st</title>", full_title
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.