]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1620] add a tab to browse artifact content in artifact detail view. Prettyprint...
authorOlivier Lamy <olamy@apache.org>
Mon, 21 May 2012 22:07:12 +0000 (22:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 21 May 2012 22:07:12 +0000 (22:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1341225 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html

index 4626fb1a127d00216606c07fce921aed25cd464b..0b437d7208fcf821353fe9621cf9b33aef1a7dec 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+  <link rel="stylesheet" href="css/prettify.css"/>
   <link rel="stylesheet" href="css/jquery.fileupload-ui.css"/>
   <link rel="stylesheet" href="css/jqueryFileTree.css"/>
   <link rel="stylesheet" href="css/chosen-0.9.7.css"/>
                         "jquery.fileupload.ip":"jquery.fileupload-ip-1.0.6",
                         "jquery.fileupload.ui":"jquery.fileupload-ui-6.6.3",
                         "tmpl": "tmpl.min",
+                        "prettify": "prettify",
                         "jqueryFileTree": "jqueryFileTree-1.0.1",
                         "redback": "redback/redback",
                         "redback.roles": "redback/roles",
index c2c3ec4d2f391a8c6fbefd85a92ea777620c2e69..23273fbe404df0633e1c2fdf8bd65c00b9349107 100644 (file)
@@ -16,9 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knockout.simpleGrid","jqueryFileTree"], function() {
-
-
+define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knockout.simpleGrid","jqueryFileTree","prettify"]
+, function() {
 
   //-----------------------------------------
   // browse part
@@ -299,6 +298,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
                             var text = data.replace(/</g,'&lt;');
                             text=text.replace(/>/g,"&gt;");
                             mainContent.find("#artifact-content-text" ).html(text);
+                            prettyPrint();
                             goToAnchor("artifact-content-text-header");
                           }
                         });
@@ -335,6 +335,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
                              text=text.replace(/>/g,"&gt;");
                              mainContent.find("#artifact-content-text" ).html(smallSpinnerImg());
                              mainContent.find("#artifact-content-text" ).html(text);
+                             prettyPrint();
                              goToAnchor("artifact-content-text-header");
                            }
                           });
index a44be1ca8184a309674eeb45fbc18dc6607a1d45..1d540a039d510fedbfe42f139fb2b5e35684aab4 100644 (file)
         </div>
       </div>
       <h4 id="artifact-content-text-header">Content</h4>
-      <div>
-         <pre><code id="artifact-content-text"></code></pre>
+      <div class="source">
+         <pre class="prettyprint linenums" id="artifact-content-text"></pre>
       </div>
 </script>
\ No newline at end of file