<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/validation.rb</filename>
    </added>
    <added>
      <filename>public/images/logo-trans.png</filename>
    </added>
    <added>
      <filename>public/javascripts/ie7.js</filename>
    </added>
    <added>
      <filename>public/javascripts/min/common.js</filename>
    </added>
    <added>
      <filename>public/javascripts/min/components.js</filename>
    </added>
    <added>
      <filename>public/javascripts/min/jquery.ext.js</filename>
    </added>
    <added>
      <filename>public/javascripts/min/libraries.js</filename>
    </added>
    <added>
      <filename>public/stylesheets/all_cache.css</filename>
    </added>
    <added>
      <filename>script/merge_assets</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -14,8 +14,7 @@ class SearchController &lt; ApplicationController
     
     
     # hide layout for ajax requests
-    if params[:ajax] == &quot;true&quot;
-      @ajax = true
+    if request.xhr?
       render :partial =&gt; &quot;search/search_results&quot;, :layout =&gt; false
     else
       params[:q] = &quot;&quot;</diff>
      <filename>app/controllers/search_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,10 @@
 # Methods added to this helper will be available to all templates in the application.
 module ApplicationHelper
   
+  def stylesheets
+    stylesheet &quot;styles&quot;, &quot;util&quot;, &quot;application&quot;, :cache =&gt; &quot;all_cache&quot;
+  end
+  
   def feed_links
     links_html = []
     
@@ -23,6 +27,14 @@ module ApplicationHelper
     end
   end
   
+  # display a flash box
+  def flash_box(text, options = {})
+    content_tag :div, :class =&gt; &quot;flash #{options[:class]}&quot; do
+      flash[:notice] +
+      link_to(&quot;Hide Message...&quot;, &quot;#&quot;, :class =&gt; &quot;close-text&quot;)
+    end
+  end
+  
   def display_notice    
     page.insert_html :after, 'footer', :partial =&gt; 'layouts/admin_flash_boxes'
   end
@@ -45,7 +57,6 @@ module ApplicationHelper
     end
   end
   
-  
   def link_to_image(image_path, label, url, options={})
     link_to(image_tag(image_path, :class =&gt; &quot;vert-middle&quot;), url, options) +
     nbsp +</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,44 +3,35 @@ module JavascriptHelper
   # Add javascripts to page
   def javascripts(options = {})
     [
-      javascript(&quot;prototype&quot;), 
-      javascript(&quot;scriptaculous/scriptaculous&quot;),
-      
-      javascript(&quot;jquery&quot;),
-      javascript_tag(&quot;$j = jQuery.noConflict();&quot;),
-      javascript(include_javascripts(&quot;jquery.ext&quot;)),
-      javascript(include_javascripts(&quot;libraries&quot;)),
-      javascript(include_javascripts(&quot;common&quot;)),
-      javascript(include_javascripts(&quot;components&quot;)),
+      framework_js,
+
+      # recursively add javascript files from these folders 
+      javascript_folder(&quot;jquery.ext&quot;),
+      javascript_folder(&quot;libraries&quot;),
+      javascript_folder(&quot;common&quot;),
+      javascript_folder(&quot;components&quot;),
       
       page_javascripts(options),
       javascript(&quot;application&quot;),
-
+      
       ie6_js
       
     ].flatten.join(&quot;\n&quot;)
   end
   
-  # returns a list of *css file paths* for a sass directory
-  def include_javascripts(path)
-    if AppConfig.minimize
-      &quot;min/#{path}.js&quot;
-    else
-      javascript_list = Dir[&quot;#{RAILS_ROOT}/public/javascripts/#{path}/*.js&quot;]
-
-      result = []
-      javascript_list.each do |javascript|
-        result &lt;&lt; javascript.gsub(&quot;#{RAILS_ROOT}/public/javascripts/&quot;, &quot;&quot;)
-      end
-  
-      return result
-    end
-  end
+  def framework_js
+    [
+      javascript(&quot;prototype&quot;), 
+      javascript(&quot;scriptaculous/scriptaculous&quot;),
+    
+      javascript(&quot;jquery&quot;),
+      javascript_tag(&quot;$j = jQuery.noConflict();&quot;)
+    ].flatten.join(&quot;\n&quot;)
+  end  
   
   def ie6_js
-    if browser_is? :ie6
-      javascript(&quot;supersleight&quot;)
-    end
+    &quot;&lt;!--[if lt IE 7]&gt;
+      &lt;script src='/javascripts/ie7.js' type='text/javascript&gt;&lt;/script&gt;
+    &lt;![endif]--&gt;&quot;
   end
-  
 end
\ No newline at end of file</diff>
      <filename>app/helpers/javascript_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,8 @@ class Job &lt; ActiveRecord::Base
   validates_presence_of :company
   validates_presence_of :poster_email
   
+  validates_format_of :title, :company, :outside_location, :with =&gt; Validation::NO_HTML, :message =&gt; Validation::NO_HTML_MESSAGE
+  
   validates_as_email_address :poster_email
   
   before_save :format_fields
@@ -61,7 +63,7 @@ class Job &lt; ActiveRecord::Base
     
     # return location if applicable
     if self.location
-      @located_at = self.location.name
+      @located_at = self.g.name
       return @located_at
     end
     </diff>
      <filename>app/models/job.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,8 +8,9 @@ class JobApplicant &lt; ActiveRecord::Base
   
   has_attached_file :resume
   
+  attr_protected :job_id
+  
   def self.new_default(init_values = {})
     self.new(init_values)
   end
-
-end
+end
\ No newline at end of file</diff>
      <filename>app/models/job_applicant.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,10 +11,7 @@
     .applied-to-job
       = @job.job_applicants.size
       %p
-        - if @job.job_applicants.size != 1
-          applicants
-        - else
-          applicant
+        = pluralize(@job.job_applicants.size, &quot;applicant&quot;)
   
     -# show job title
     %h2</diff>
      <filename>app/views/admin/jobs/show.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 
   - if @job_hunter.errors.size &gt; 0
     .validation-failure
-      = image_tag &quot;exclamation.png&quot;, :style =&gt; &quot;vertical-align: -3px&quot;
+      = image_tag &quot;exclamation.png&quot;
       There were a few problems. Please correct the fields labeled in &lt;strong&gt;red&lt;/strong&gt;.
     = br
   </diff>
      <filename>app/views/job_requests/new.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@
 
   - unless @job.errors.empty?
     .validation-failure
-      = image_tag &quot;exclamation.png&quot;, :style =&gt; &quot;vertical-align: -3px&quot;
+      = image_tag &quot;exclamation.png&quot;
       Please revise the form...
   
   - form_for @job, :html =&gt; {:id =&gt; &quot;publish_form&quot;, :class =&gt; &quot;job-form&quot;} do |f|</diff>
      <filename>app/views/jobs/edit.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
   
   - unless @job.errors.empty?
     .validation-failure
-      = image_tag &quot;exclamation.png&quot;, :style =&gt; &quot;vertical-align: -3px&quot;
+      = image_tag &quot;exclamation.png&quot;
       Please revise the form...
   
   - form_for @job, :html =&gt; {:id =&gt; &quot;publish_form&quot;, :class =&gt; &quot;job-form&quot;} do |f|</diff>
      <filename>app/views/jobs/new.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 
   - if job_applicant.errors.size &gt; 0
     .validation-failure
-      = image_tag &quot;exclamation.png&quot;, :style =&gt; &quot;vertical-align: -3px&quot;
+      = image_tag &quot;exclamation.png&quot;
       Unfortunately, your application could not be sent. Please check the form for missing information and resubmit. 
     = br
   </diff>
      <filename>app/views/jobs/parts/_apply_form.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -27,21 +27,21 @@
     -# show job title
     %h2
       = job_type_image(job.job_type)
-      = job.title
+      =h job.title
   
     -# show job location
     %p
       %span.fading at
       - unless job.url.blank? or job.url == &quot;http://&quot;
-        = link_to job.company, job.url
+        = link_to h(job.company), job.url
       - else
-        %strong= job.company
+        %strong=h job.company
     
       - if job.located_at == &quot;Anywhere&quot;
-        %strong== (#{job.located_at})
+        %strong== (#{h(job.located_at)})
       - else
         %span.fading in
-        %strong= job.located_at
+        %strong=h job.located_at
     
     -# show job description
     .job-description</diff>
      <filename>app/views/jobs/parts/_details.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,8 @@
         %td.publish-label{:valign =&gt; &quot;top&quot;} Title:
         %td
           = f.text_field :title, :size =&gt; 50
+          = error_message_for(@job, :title)
+          
           .suggestion e.g. 'PHP Developer', 'UI designer'
     
       -# location field
@@ -29,6 +31,7 @@
           #outside_location{hide_if(@job.outside_location.blank?)}
             where ?
             = f.text_field :outside_location, :size =&gt; 50, :maxlength =&gt; 140
+            = error_message_for(@job, :outside_location)
             .suggestion
               e.g. 'London, UK'
     
@@ -37,6 +40,7 @@
         %td{:valign =&gt; &quot;top&quot;} Description:
         %td
           = f.text_area :description, :size =&gt; &quot;80x15&quot;
+          = error_message_for(@job, :description)
           .suggestion
             = link_to &quot;Format text with Textile&quot;, &quot;http://www.textism.com/tools/textile/&quot;, |
                       :target =&gt; &quot;_blank&quot;, :onclick =&gt; &quot;$j('#textile-suggestions').toggle();return false;&quot; |              
@@ -51,7 +55,8 @@
         %td.publish-label Name:
         %td
           = f.text_field :company, :size =&gt; 40
-
+          = error_message_for(@job, :company)
+          
       -# website field
       %tr
         %td{:valign =&gt; &quot;top&quot;} Website:
@@ -67,6 +72,7 @@
           %strong (not published)
         %td
           = f.text_field :poster_email
+          = error_message_for(@job, :poster_email)
           .suggestion
             Online applications will be sent to this address.
     </diff>
      <filename>app/views/jobs/parts/_fields.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,8 @@
   &lt;table&gt;
       &lt;thead&gt;
       &lt;tr class=&quot;odd&quot;&gt;
-        &lt;th&gt;{$translations.publish.syntax}&lt;/th&gt;
-        &lt;th&gt;{$translations.publish.result}&lt;/th&gt;
+        &lt;th&gt;Textile syntax&lt;/th&gt;
+        &lt;th&gt;Final result&lt;/th&gt;
       &lt;/tr&gt;
       &lt;/thead&gt;
       &lt;tbody&gt;</diff>
      <filename>app/views/jobs/parts/_textile_suggestions.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,11 @@
 - unless @flash_shown
-
+  
   -# Set flash[:notice] to display a notice panel
   - if flash[:notice]
-    .flash.notice
-      = flash[:notice]
-      = link_to &quot;Hide Message...&quot;, &quot;#&quot;, :class =&gt; &quot;close-text&quot;
+    = flash_box(flash[:notice], :class =&gt; &quot;notice&quot;)
   - elsif flash[:success]
-    .flash.success
-      = flash[:success]
-      = link_to &quot;Hide Message...&quot;, &quot;#&quot;, :class =&gt; &quot;close-text&quot;
+    = flash_box(flash[:success], :class =&gt; &quot;success&quot;)
   - elsif flash[:error]
-    .flash.error
-      = flash[:error]
-      = link_to &quot;Hide Message...&quot;, &quot;#&quot;, :class =&gt; &quot;close-text&quot;
+    = flash_box(flash[:error], :class =&gt; &quot;error&quot;)
 
 - @flash_shown = true</diff>
      <filename>app/views/layouts/_flash_boxes.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -41,5 +41,3 @@
     .footer-copyright.text-right
       Powered by 
       = link_to &quot;jobberRails&quot;, &quot;http://www.jobberrails.com&quot;
-      = br
-      == port of #{link_to &quot;jobberBase&quot;, &quot;http://www.jobberbase.com&quot;}
\ No newline at end of file</diff>
      <filename>app/views/layouts/_footer.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@
     
     = title :site =&gt; AppConfig.site_name
     = stylesheets
+    
+    -# defined in javascript_helper
     = javascripts
   
     = feed_links</diff>
      <filename>app/views/layouts/application.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,22 @@
 %h3
   Search Results for
   == &quot;#{h(@query)}&quot;
-  - if @ajax
+  - if request.xhr?
     = link_to &quot;Clear Search&quot;, &quot;#&quot;, :class =&gt; &quot;clear-search&quot;
+
 - if @jobs.empty?
   %p.empty
     No jobs found matching 
     %strong== #{h(@query)}
     - if @category
       in 
-      %strong= @category.name
+      %strong=h @category.name
       = br
       = link_to &quot;Search Entire Site&quot;, search_url(:keywords =&gt; @query, :ajax =&gt; nil)
 - else
   = partial &quot;jobs/parts/post_table&quot;, :jobs =&gt; @jobs, :show_applicants =&gt; false
   
   
-- if @ajax and !@jobs.empty?
+- if request.xhr? and !@jobs.empty?
   = br
   = link_to &quot;View Search Results...&quot;, search_url(:keywords =&gt; @query, :cat_id =&gt; params[:cat_id], :ajax =&gt; nil)</diff>
      <filename>app/views/search/_search_results.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ config.whiny_nils = true
 # Show full error reports and disable caching
 config.action_controller.consider_all_requests_local = true
 config.action_view.debug_rjs                         = true
-config.action_controller.perform_caching             = false
+config.action_controller.perform_caching             = true
 
 # Don't care if the mailer can't send
 config.action_mailer.raise_delivery_errors = false
\ No newline at end of file</diff>
      <filename>config/environments/development.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,4 @@ $j(document).ready(function() {
     $j(this).example(this.title);
   });
   
-  
-  
-  // fix pngs
-  Jobber.FixPng();
 });</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
    <modified>
      <diff>@@ -6,39 +6,6 @@
     jobber_admin_url: &quot;&quot;,
     job_id: &quot;&quot;,
     
-    FixPng: function()
-    {
-      var arVersion = navigator.appVersion.split(&quot;MSIE&quot;);
-      var version = parseFloat(arVersion[1]);
-
-      if ((version &gt;= 5.5) &amp;&amp; (document.body.filters)) 
-      {
-         for(var i=0; i&lt;document.images.length; i++)
-         {
-            var img = document.images[i];
-            var imgName = img.src.toUpperCase();
-
-            if (imgName == this.jobber_url.toUpperCase() + &quot;IMG/BT-RSS.PNG&quot;)
-            {
-               var imgID = (img.id) ? &quot;id='&quot; + img.id + &quot;' &quot; : &quot;&quot;;
-               var imgClass = (img.className) ? &quot;class='&quot; + img.className + &quot;' &quot; : &quot;&quot;;
-               var imgTitle = (img.title) ? &quot;title='&quot; + img.title + &quot;' &quot; : &quot;title='&quot; + img.alt + &quot;' &quot;;
-               var imgStyle = &quot;display:inline-block;&quot; + img.style.cssText;
-               if (img.align == &quot;left&quot;) imgStyle = &quot;float:left;&quot; + imgStyle;
-               if (img.align == &quot;right&quot;) imgStyle = &quot;float:right;&quot; + imgStyle;
-               if (img.parentElement.href) imgStyle = &quot;cursor:hand;&quot; + imgStyle;
-               var strNewHTML = &quot;&lt;span &quot; + imgID + imgClass + imgTitle;
-               strNewHTML += &quot; style=\&quot;&quot; + &quot;width:&quot; + img.width + &quot;px; height:&quot; + img.height + &quot;px;&quot; + imgStyle + &quot;;&quot;;
-               strNewHTML += &quot;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader&quot;;
-               strNewHTML += &quot;(src=\'&quot; + img.src + &quot;\', sizingMethod='scale');\&quot;&gt;&lt;/span&gt;&quot;;
-               img.outerHTML = strNewHTML;
-               i = i - 1;
-            }
-         }
-      }
-
-    },
-    
     HandleLocationOutside: function()
     {
       if($(&quot;#outside_location&quot;).is(&quot;:visible&quot;))</diff>
      <filename>public/javascripts/common/jobber.js</filename>
    </modified>
    <modified>
      <diff>@@ -76,7 +76,7 @@ div#skip { display:none;}
 div#container { width:950px; text-align:left; font-size:1.2em; min-height: 600px;  height: auto !important; height: 100%; margin: 0 auto 0em; }
 div#header { height:120px; width:950px; position:relative;}
 div#header h1#logo { width:347px; height:80px; position:absolute; top:25px; left:20px; }
-div#header h1#logo a { width:347px; height:80px; outline:0; background: url(/images/logo.png) 0 0 no-repeat; text-indent:-1000em; float:left; }
+div#header h1#logo a { width:347px; height:80px; outline:0; background: url(/images/logo-trans.png) 0 0 no-repeat; text-indent:-1000em; float:left; }
 div#header ul#top {position:absolute; top:20px; right:20px;}
 div#header ul#top li{display:inline; margin-left:2px; background-color:transparent; color:#0099CC;}
 
@@ -309,6 +309,9 @@ table/job-posts td.time-posted img, table/job-posts td.applicants img {
   background-color: #ffd0d6;
   padding: 5px;
 }
+.validation-failure img {
+  vertical-align: -3px;
+}
 .apply-status-ok {
   color: #009900; 
   background-color: #dfFFda; 
@@ -325,7 +328,6 @@ table/job-posts td.time-posted img, table/job-posts td.applicants img {
   font-size: 11px;
   float: right;
   width: 250px;
-
 }
 
 .suggestion {</diff>
      <filename>public/stylesheets/styles.css</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/helpers/stylesheet_helper.rb</filename>
    </removed>
    <removed>
      <filename>public/images/logo.png</filename>
    </removed>
    <removed>
      <filename>public/javascripts/jquery.ext/interface.js</filename>
    </removed>
    <removed>
      <filename>public/javascripts/jquery.ext/jquery.alphanumeric.js</filename>
    </removed>
    <removed>
      <filename>public/javascripts/supersleight.js</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>7890606118047259ea5386e39f8a153c5122012b</id>
    </parent>
  </parents>
  <author>
    <name>Jacques Crocker</name>
    <email>jcnetdev@gmail.com</email>
  </author>
  <url>http://github.com/rixrix/jobberrails/commit/00f85bc3bb5ba710ae5adba6a6ffd5a615a24bb2</url>
  <id>00f85bc3bb5ba710ae5adba6a6ffd5a615a24bb2</id>
  <committed-date>2008-08-08T11:03:32-07:00</committed-date>
  <authored-date>2008-08-08T11:03:32-07:00</authored-date>
  <message>Refactorings and updates</message>
  <tree>da92d7710a71fe7cc63d5f1c299757d762500749</tree>
  <committer>
    <name>Jacques Crocker</name>
    <email>jcnetdev@gmail.com</email>
  </committer>
</commit>
