<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-jQuery Form Input Example Plugin 1.3.2
+jQuery Form Input Example Plugin 1.3.3
 ======================================
 
 This is a jQuery plugin to populate form inputs with example text that</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@
   &lt;style type=&quot;text/css&quot;&gt;html{font:small Helvetica;background:#eee;}body{margin:20px;}.example{color:#666;}.not_example{color:#c6c;}.case{margin-bottom:10px;border:1px solid #999;padding:0 10px;background:#fff;}pre{border:1px solid #996;background:#ffc;padding:5px;}h1,h3,pre,code{font-size:1em;}h1{font-size:1.5em;}input{width:200px;}&lt;/style&gt;
 &lt;/head&gt;
 &lt;body&gt;
-  &lt;h1&gt;jQuery Form Input Example Plugin 1.3.2&lt;/h1&gt;
+  &lt;h1&gt;jQuery Form Input Example Plugin 1.3.3&lt;/h1&gt;
   &lt;p&gt;This is both a test and usage guide for the &lt;a href=&quot;http://mucur.name/posts/jquery-example&quot;&gt;jQuery Form Input Example plugin&lt;/a&gt; by &lt;a href=&quot;http://mucur.name/&quot;&gt;Paul Mucur&lt;/a&gt;. Below you will find several test cases and the relevant JavaScript source code used in the test.&lt;/p&gt;
   &lt;form action=&quot;javascript:alert('Form submitted, all examples should be cleared.');&quot;&gt;
     &lt;div class=&quot;case&quot;&gt;</diff>
      <filename>index.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 /*
- * jQuery Example Plugin 1.3.2
+ * jQuery Example Plugin 1.3.3
  * Populate form inputs with example text that disappears on focus.
  *
  * e.g.
@@ -80,6 +80,28 @@
       /* Reduce method calls by saving the current jQuery object. */
       var $this = $(this);
       
+      /* Internet Explorer will cache form values even if they are cleared
+       * on unload, so this will clear any value that matches the example
+       * text and hasn't been specified in the value attribute.
+       *
+       * The trick is to see whether a value has been set that is
+       * different to the defaultValue attribute. As I do not want
+       * to recklessly clear form inputs that are not examples on
+       * document ready, only those with values that match the example
+       * text will be cleared.
+       *
+       * If a callback is used, it is not possible to predict
+       * what the example text is going to be so all non-default values
+       * are cleared. This means that caching is effectively disabled for
+       * that field.
+       *
+       * Many thanks to Klaus Hartl for this technique.
+       */
+      if ($.browser.msie &amp;&amp; !$this.attr('defaultValue') &amp;&amp;
+          (callback ? $this.val() != '' : $this.val() == text)) {
+        $this.val('');
+      }
+
       /* Initially place the example text in the field if it is empty. */
       if ($this.val() == '') {
         $this.addClass(options.class_name);</diff>
      <filename>jquery.example.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 /*
- * jQuery Example Plugin 1.3.2
+ * jQuery Example Plugin 1.3.3
  * Populate form inputs with example text that disappears on focus.
  *
  * e.g.
@@ -26,4 +26,4 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-(function(A){A.fn.example=function(D,C){var B=A.extend({},A.fn.example.defaults,C);var E=A.isFunction(D);if(!A.fn.example.bound_class_names[B.class_name]){A(window).unload(function(){A(&quot;.&quot;+B.class_name).val(&quot;&quot;)});A(&quot;form&quot;).submit(function(){A(this).find(&quot;.&quot;+B.class_name).val(&quot;&quot;)});A.fn.example.bound_class_names[B.class_name]=true}return this.each(function(){var G=A(this);if(G.val()==&quot;&quot;){G.addClass(B.class_name);G.val(E?D.call(this):D)}if(B.hide_label){var F=A(&quot;label[@for=&quot;+G.attr(&quot;id&quot;)+&quot;]&quot;);F.next(&quot;br&quot;).hide();F.hide()}G.focus(function(){if(A(this).is(&quot;.&quot;+B.class_name)){A(this).val(&quot;&quot;);A(this).removeClass(B.class_name)}});G.blur(function(){if(A(this).val()==&quot;&quot;){A(this).addClass(B.class_name);A(this).val(E?D.call(this):D)}})})};A.fn.example.defaults={class_name:&quot;example&quot;,hide_label:false};A.fn.example.bound_class_names=[]})(jQuery);
\ No newline at end of file
+(function(A){A.fn.example=function(D,C){var B=A.extend({},A.fn.example.defaults,C);var E=A.isFunction(D);if(!A.fn.example.bound_class_names[B.class_name]){A(window).unload(function(){A(&quot;.&quot;+B.class_name).val(&quot;&quot;)});A(&quot;form&quot;).submit(function(){A(this).find(&quot;.&quot;+B.class_name).val(&quot;&quot;)});A.fn.example.bound_class_names[B.class_name]=true}return this.each(function(){var G=A(this);if(A.browser.msie&amp;&amp;!G.attr(&quot;defaultValue&quot;)&amp;&amp;(E?G.val()!=&quot;&quot;:G.val()==D)){G.val(&quot;&quot;)}if(G.val()==&quot;&quot;){G.addClass(B.class_name);G.val(E?D.call(this):D)}if(B.hide_label){var F=A(&quot;label[@for=&quot;+G.attr(&quot;id&quot;)+&quot;]&quot;);F.next(&quot;br&quot;).hide();F.hide()}G.focus(function(){if(A(this).is(&quot;.&quot;+B.class_name)){A(this).val(&quot;&quot;);A(this).removeClass(B.class_name)}});G.blur(function(){if(A(this).val()==&quot;&quot;){A(this).addClass(B.class_name);A(this).val(E?D.call(this):D)}})})};A.fn.example.defaults={class_name:&quot;example&quot;,hide_label:false};A.fn.example.bound_class_names=[]})(jQuery);
\ No newline at end of file</diff>
      <filename>jquery.example.min.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cf4ef3848365e87a7e069fefd3d4c4af2ce73435</id>
    </parent>
  </parents>
  <author>
    <name>Paul Mucur</name>
    <email>mudge@mudge.name</email>
  </author>
  <url>http://github.com/mudge/jquery_example/commit/8f03a4d8ed03d6af9760473f3b3b9c2f624c2a17</url>
  <id>8f03a4d8ed03d6af9760473f3b3b9c2f624c2a17</id>
  <committed-date>2008-04-04T09:14:46-07:00</committed-date>
  <authored-date>2008-04-04T09:14:46-07:00</authored-date>
  <message>Worked around IE's overzealous caching of input values using a technique suggested by Klaus Hartl.

This fixes http://plugins.jquery.com/node/2169.</message>
  <tree>7b75d259467070803c63ee702424b6fb85cdc2fb</tree>
  <committer>
    <name>Paul Mucur</name>
    <email>mudge@mudge.name</email>
  </committer>
</commit>
