Commits

larscorneliussen  committed 02a050e Merge

Added demo for 'code'-tag only, updated releasenotes and added balupton to contributors list

  • Participants
  • Parent commits 644d8ec, 2bc3ebe

Comments (0)

Files changed (4)

   <name>jQuery.beautyOfCode - jQuery Plugin for Syntax Highlighting</name>
   <groupId>jQuery.beautyOfCode</groupId>
   <artifactId>jQuery.beautyOfCode</artifactId>
-  <version>0.1.2</version>
+  <version>0.2-SNAPSHOT</version>
   <packaging>javascript</packaging>
+  
+  <licenses>
+    <license>
+      <name>Apache 2</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+      <comments>A business-friendly OSS license</comments>
+    </license>
+  </licenses>
+  
+  <developers>
+    <developer>
+      <id>lcorneliussen</id>
+      <name>Lars Corneliussen</name>
+      <email>me@lcorneliussen.de</email>
+      <url>http://lcorneliussen.de</url>
+      <roles>
+        <role>architect</role>
+        <role>developer</role>
+      </roles>
+      <timezone>-1</timezone>
+    </developer>
+  </developers>
+
+  <contributors>
+    <contributor>
+      <name>Benjamin "balupton" Lupton</name>
+    </contributor>
+  </contributors>
+
   <build>
     <outputDirectory>target</outputDirectory>
     <plugins>

File releasenotes.txt

-v0.1.3
-- #2 Missing semicolons
+v0.2
+- fixed #2: Missing semicolons
+- Merged 2bc3ebe9b123 from balupton
+  - allowing <code class="code">...</code> in addition to <pre class="code"><code>...</code></pre>
+  - plus you can use prepend the brush with 'brush-' or 'language-' now
 
 v0.1.2
  - Includes minified version
+
 v0.1.1
  - Uses SH v2.1.364

File src/main/javascript/jquery.beautyOfCode.js

         autoLoad: true,
         // the base url to alex' hosted sources
         // http://alexgorbatchev.com/wiki/SyntaxHighlighter:Hosting
-        baseUrl: 'http://alexgorbatchev.com/pub/sh/2.1.364/',
+        baseUrl: 'http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/2.1.364/',
         // the baseurl for the hosted scripts
         scripts: 'scripts/',
         // the baseurl for the hosted styles
     },
 
     beautifyAll: function() {
-        jQuery("pre.code:has(code[class])").beautifyCode();
+        jQuery("pre.code:has(code[class]),code.code").beautifyCode();
     },
     utils: {
         loadScript: function(url, complete) {
 
         // for now, only supports <pre><code>...</code></pre>
         // support for only pre, or only code could be added
-        var $code = $item.children("code");
+        var $code = $item.is('code') ? $item : $item.children("code");
         var code = $code[0];
-        var classItems = code.className.split(" ");
+        var classItems = code.className.replace(/.+?(brush:|language-)/,'$1').replace('language-','').split(" ");
 
         var brush = saveBrush ? saveBrush: classItems[0];
         var elementParams = jQuery.beautyOfCode.utils.parseParams(classItems);

File src/main/resources/demo.html

 			&lt;/pre>
 		</code>
 	</pre>
+	
+	<h2>Using 'code'-tag only</h2>
+	<code class="code language-javascript">
+		function(){ alert('hello'); }
+	</code>
+	<pre class="code">
+		<code class="html boc-collapse">
+			&lt;code class="code language-javascript">
+				function(){ alert('hello'); }
+			&lt;/code>
+		</code>
+	</pre>
 </body>
 </html>