archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1371486 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js: archiva/main.js archiva/search.js templates/archiva/search.html
Date Thu, 09 Aug 2012 21:12:28 GMT
Author: olamy
Date: Thu Aug  9 21:12:28 2012
New Revision: 1371486

URL: http://svn.apache.org/viewvc?rev=1371486&view=rev
Log:
history navigation when seeing artifact dependency tree

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js?rev=1371486&r1=1371485&r2=1371486&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
Thu Aug  9 21:12:28 2012
@@ -281,6 +281,28 @@ function() {
 
         });
 
+
+        this.get('#artifact-dependency-tree/:groupId/:artifactId/:version',function(context){
+
+          var repositoryId = this.params.repositoryId;
+          var groupId= this.params.groupId;
+          var artifactId= this.params.artifactId;
+          var version= this.params.version;
+          generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId,function(){$("#main-content
#artifact-details-dependency-tree-content-a").tab('show')});
+
+        });
+
+        this.get('#artifact-dependency-tree~:repositoryId/:groupId/:artifactId/:version',function(context){
+
+          var repositoryId = this.params.repositoryId;
+          var groupId= this.params.groupId;
+          var artifactId= this.params.artifactId;
+          var version= this.params.version;
+          generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId,function(){$("#main-content
#artifact-details-dependency-tree-content-a").tab('show')});
+
+        });
+
+
         this.get('#browse/:groupId',function(context){
           var groupId = this.params.groupId;
           if (groupId){

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js?rev=1371486&r1=1371485&r2=1371486&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
Thu Aug  9 21:12:28 2012
@@ -243,8 +243,43 @@ define("archiva.search",["jquery","i18n"
               ko.applyBindings(self,mainContent.find("#browse_breadcrumb" ).get(0));
               mainContent.find("#browse-autocomplete" ).hide();
               mainContent.find("#browse-autocomplete-divider" ).hide();
+
+              //calculate tree content
+              var treeContentDiv=mainContent.find("#artifact-details-dependency-tree-content"
);
+              if( $.trim(treeContentDiv.html()).length<1){
+                treeContentDiv.html(mediumSpinnerImg());
+                var treeDependencyUrl="restServices/archivaServices/browseService/treeEntries/"+encodeURIComponent(groupId);
+                treeDependencyUrl+="/"+encodeURIComponent(artifactId);
+                treeDependencyUrl+="/"+encodeURIComponent(version);
+                var selectedRepo=getSelectedBrowsingRepository();
+                if (selectedRepo){
+                  treeDependencyUrl+="?repositoryId="+encodeURIComponent(selectedRepo);
+                }
+                $.ajax(treeDependencyUrl, {
+                  type: "GET",
+                  dataType: 'json',
+                  success: function(data) {
+                    var treeEntries = mapTreeEntries(data);
+                    treeContentDiv.html($("#dependency_tree_tmpl" ).tmpl({treeEntries: treeEntries}));
+                  }
+                });
+              }
+
+
               mainContent.find("#artifact-details-tabs").on('show', function (e) {
 
+                if ($(e.target).attr("data-target")=="#artifact-details-info-content") {
+                  var location ="#artifact";
+                  if (self.repositoryId){
+                    location+="~"+self.repositoryId;
+                  }
+                  location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
+
+                  window.sammyArchivaApplication.setLocation(location);
+                  return;
+                }
+
+
                 if ($(e.target).attr("data-target")=="#artifact-details-dependencies-content")
{
                   var location ="#artifact-dependencies";
                   if (self.repositoryId){
@@ -253,28 +288,18 @@ define("archiva.search",["jquery","i18n"
                   location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
 
                   window.sammyArchivaApplication.setLocation(location);
+                  return;
                 }
 
-                if ($(e.target).attr("href")=="#artifact-details-dependency-tree-content")
{
-                  var treeContentDiv=mainContent.find("#artifact-details-dependency-tree-content"
);
-                  if( $.trim(treeContentDiv.html()).length<1){
-                    treeContentDiv.html(mediumSpinnerImg());
-                    var treeDependencyUrl="restServices/archivaServices/browseService/treeEntries/"+encodeURIComponent(groupId);
-                    treeDependencyUrl+="/"+encodeURIComponent(artifactId);
-                    treeDependencyUrl+="/"+encodeURIComponent(version);
-                    var selectedRepo=getSelectedBrowsingRepository();
-                    if (selectedRepo){
-                      treeDependencyUrl+="?repositoryId="+encodeURIComponent(selectedRepo);
-                    }
-                    $.ajax(treeDependencyUrl, {
-                      type: "GET",
-                      dataType: 'json',
-                      success: function(data) {
-                        var treeEntries = mapTreeEntries(data);
-                        treeContentDiv.html($("#dependency_tree_tmpl" ).tmpl({treeEntries:
treeEntries}));
-                      }
-                    });
+                if ($(e.target).attr("data-target")=="#artifact-details-dependency-tree-content")
{
+                  var location ="#artifact-dependency-tree";
+                  if (self.repositoryId){
+                    location+="~"+self.repositoryId;
                   }
+                  location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
+
+                  window.sammyArchivaApplication.setLocation(location);
+                  return;
                   return;
                 }
                 if ($(e.target).attr("href")=="#artifact-details-used-by-content") {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html?rev=1371486&r1=1371485&r2=1371486&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
Thu Aug  9 21:12:28 2012
@@ -426,7 +426,7 @@
 <script id="browse-artifact-detail-tmpl" type="text/html">
     <ul id="artifact-details-tabs" class="nav nav-tabs">
       <li class="active">
-        <a data-toggle="tab" href="#artifact-details-info-content">${$.i18n.prop('artifact.detail.tab.header.info')}</a>
+        <a data-toggle="tab" id="artifact-details-info-content-a" data-target="#artifact-details-info-content"
href="#artifact-details-info-content">${$.i18n.prop('artifact.detail.tab.header.info')}</a>
       </li>
       <li>
         <a data-toggle="tab" id="artifact-details-dependencies-content-a" data-target="#artifact-details-dependencies-content"
href="#artifact-details-dependencies-content">${$.i18n.prop('artifact.detail.tab.header.dependencies')}</a>



Mime
View raw message