From e3af05725c827366f160624b30cd2b58d28aea5f Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Wed, 19 Oct 2011 14:15:05 +0000
Subject: [PATCH] Made the <pre class="screen"> thing a toggle, so you don't have to reload the page.

---
 opendj3/pom.xml |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/opendj3/pom.xml b/opendj3/pom.xml
index 46a4065..2a42c16 100644
--- a/opendj3/pom.xml
+++ b/opendj3/pom.xml
@@ -355,15 +355,18 @@
                   <replacevalue>
 &lt;script  src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript"&gt;
-// On click, reformat &lt;screen&gt; commands for easier copying.
-$(document).ready(function(){
-  $(".screen").click(function(event){
-    $(this).replaceWith(
-      "&lt;pre class=\"screen\"&gt;" +
-      $(this).text().replace(/\n /g," ") +
-      "&lt;/pre&gt;");
-  });
+// On click, reformat &lt;pre class="screen"&gt; for easy copying.
+$(".screen").live("click", function() {
+  $(this).replaceWith(
+    "&lt;pre class=\"flat\"&gt;" +
+    $(this).text().replace(/\n /g," ") + "\n&lt;!--" + $(this).text() + "--&gt;" +
+    "&lt;/pre&gt;");
 });
+$(".flat").live("click", function() {
+  $(this).replaceWith(
+    "&lt;pre class=\"screen\"&gt;" +
+    $(this).html().replace(/(.|\n)+&lt;!\-\-/m,"").replace(/\-\-\&gt;/,"") +
+    "&lt;/pre&gt;");
 &lt;/script&gt;
 &lt;link rel="shortcut icon" href="http://forgerock.org/favicon.ico"&gt;
 &lt;/head&gt;</replacevalue>
@@ -431,16 +434,19 @@
                   <replacevalue>
 &lt;script  src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript"&gt;
-// On click, reformat &lt;screen&gt; commands for easier copying.
-$(document).ready(function(){
-  $(".screen").click(function(event){
-    $(this).replaceWith(
-      "&lt;pre class=\"screen\"&gt;" +
-      $(this).text().replace(/\n /g," ") +
-      "&lt;/pre&gt;");
-  });
+// On click, reformat &lt;pre class="screen"&gt; for easy copying.
+$(".screen").live("click", function() {
+  $(this).replaceWith(
+    "&lt;pre class=\"flat\"&gt;" +
+    $(this).text().replace(/\n /g," ") + "\n&lt;!--" + $(this).text() + "--&gt;" +
+    "&lt;/pre&gt;");
 });
-&lt;/script&gt;
+$(".flat").live("click", function() {
+  $(this).replaceWith(
+    "&lt;pre class=\"screen\"&gt;" +
+    $(this).html().replace(/(.|\n)+&lt;!\-\-/m,"").replace(/\-\-\&gt;/,"") +
+    "&lt;/pre&gt;");
+});&lt;/script&gt;
 &lt;link rel="shortcut icon" href="http://forgerock.org/favicon.ico"&gt;
 &lt;/head&gt;</replacevalue>
                 </replace>

--
Gitblit v1.10.0