? .project
? modules/.DS_Store
? sites/all/themes/.DS_Store
? sites/default/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: modules/node/node.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.js,v
retrieving revision 1.4
diff -u -p -r1.4 node.js
--- modules/node/node.js	27 Apr 2009 20:19:37 -0000	1.4
+++ modules/node/node.js	29 Jul 2009 13:16:14 -0000
@@ -32,4 +32,54 @@ Drupal.behaviors.nodeFieldsetSummaries =
   }
 };
 
+Drupal.behaviors.bodySummary = {
+  attach: function () {
+    // If summary does not contains text or the text equals the body value (at least the beginning of it).
+    if ($('#edit-body-0-summary').val() == '') {
+      $('.body-0-summary-wrapper').hide();
+      if ($('.body-0-value-wrapper .field-edit-link').size()) {
+        $('.body-0-value-wrapper .field-edit-link').show();
+      }
+      else {
+        $('.body-0-value-wrapper label').append($('<span class="field-edit-link">(<a class="body-edit-summary" href="#">' + Drupal.t('Edit summary') + '</a>)</span>)').click(function () {
+          $('.body-0-summary-wrapper').show();
+          $('.body-0-value-wrapper .field-edit-link').hide();
+          if ($('.body-0-summary-wrapper .field-edit-link').size()) {
+            $('.body-0-summary-wrapper .field-edit-link').show();
+          }
+          else {
+            $('.body-0-summary-wrapper label').append($('<span class="field-edit-link">(<a class="body-hide-summary" href="#">' + Drupal.t('Hide summary') + '</a>)</span>').click(function () {
+              $('.body-0-value-wrapper .field-edit-link').show();
+              $('.body-0-summary-wrapper').hide();
+              return false;
+            }));
+          }
+          return false;
+        }));
+      }
+    }
+    else {
+      if ($('.body-0-summary-wrapper .field-edit-link').size()) {
+        $('.body-0-summary-wrapper .field-edit-link').show();
+      }
+      else {
+        $('.body-0-summary-wrapper label').append($('<span class="field-edit-link">(<a class="body-hide-summary field-edit-link" href="#">' + Drupal.t('Hide summary') + '</a>)</span>').click(function () {
+          if ($('.body-0-value-wrapper .field-edit-link').size()) {
+            $('.body-0-value-wrapper .field-edit-link').show();
+          }
+          else {
+            $('.body-0-value-wrapper label').append($('<span class="field-edit-link">(<a class="body-edit-summary field-edit-link" href="#">' + Drupal.t('Edit summary') + '</a>)</span>').click(function () {
+              $('.body-0-summary-wrapper').show();
+              $('.body-0-value-wrapper .field-edit-link').hide();
+            }));
+          }
+          $('.body-0-summary-wrapper').hide();
+          return false;
+        }));
+      }
+    }
+  }
+};
+
+
 })(jQuery);
