*/
$(function() {
+ //-----------------------------------------
+ // browse part
+ //-----------------------------------------
+
BrowseViewModel=function(browseResultEntries,parentGroupdId){
+ var self=this;
this.browseResultEntries=browseResultEntries;
this.parentGroupdId=parentGroupdId;
displayGroupId=function(groupId){
- displayGroupDetail(groupId,"..");
+ displayGroupDetail(groupId,self.parentGroupdId);
}
}
+ displayGroupDetail=function(groupId,parentGroupdId){
+ var mainContent = $("#main-content");
+ var browseResult=mainContent.find("#browse_result");
+ var browseBreadCrumb=mainContent.find("#browse_breadcrumb");
+ mainContent.find("#main_browse_result_content").hide( "slide", {}, 300,
+ function(){
+ browseResult.html(mediumSpinnerImg());
+ browseBreadCrumb.html(smallSpinnerImg());
+ mainContent.find("#main_browse_result_content" ).show();
+ var url = "restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
+ $.ajax(url, {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ var browseResultEntries = mapbrowseResultEntries(data);
+ var browseViewModel = new BrowseViewModel(browseResultEntries,parentGroupdId);
+
+ ko.applyBindings(browseViewModel,mainContent.get(0));
+ }
+ });
+ }
+ );
+
+ }
+
+ /**
+ * call from menu entry to display root level
+ */
displayBrowse=function(){
clearUserMessages();
var mainContent = $("#main-content");
success: function(data) {
var browseResultEntries = mapbrowseResultEntries(data);
$.log("size:"+browseResultEntries.length);
- var browseViewModel = new BrowseViewModel(browseResultEntries);
-
+ var browseViewModel = new BrowseViewModel(browseResultEntries,"..");
ko.applyBindings(browseViewModel,mainContent.get(0));
}
});
}
- displayGroupDetail=function(groupId,parentGroupdId){
- var mainContent = $("#main-content");
- var browseResult=mainContent.find("#browse_result");
- browseResult.hide( "slide", {}, 500,
- function(){
- browseResult.html(mediumSpinnerImg());
- browseResult.show();
- var url = "restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
- $.ajax(url, {
- type: "GET",
- dataType: 'json',
- success: function(data) {
- var browseResultEntries = mapbrowseResultEntries(data);
- var browseViewModel = new BrowseViewModel(browseResultEntries,parentGroupdId);
-
- ko.applyBindings(browseViewModel,mainContent.get(0));
- }
- });
- }
- );
-
- }
-
- displaySearch=function(){
- $("#main-content" ).html("coming soon :-)");
- }
-
mapbrowseResultEntries=function(data){
if (data.browseResult && data.browseResult.browseResultEntries) {
return $.isArray(data.browseResult.browseResultEntries) ?
this.name=name;
this.project=project;
}
+
+ //-----------------------------------------
+ // search part
+ //-----------------------------------------
+
+ displaySearch=function(){
+ $("#main-content" ).html("coming soon :-)");
+ }
+
});
\ No newline at end of file
<h2>${$.i18n.prop('browse.repository')}</h2>
</div>
</div>
- <div id="browse_breadcrumb">
- <ul class="breadcrumb">
- <li><a href="#"><i class="icon-home"/> </a> <span class="divider">/</span></li>
- <li><a href="#">org</a> <span class="divider">/</span></li>
- </ul>
- </div>
- <div id="browse_result" class="well" data-bind='template:{name:"browse-groups-tmpl"}'>
-
+ <div id="main_browse_result">
+ <div id="main_browse_result_content" class="well">
+ <div id="browse_breadcrumb" data-bind='template:{name:"browse-breadcrumb-tmpl"}'></div>
+ <div id="browse_result" class="well" data-bind='template:{name:"browse-groups-tmpl"}'></div>
+ </div>
</div>
</script>
{{/each}}
</ul>
</div>
+</script>
+
+<script id="browse-breadcrumb-tmpl" type="text/html">
+ <ul class="breadcrumb">
+ <li><a href="#"><i class="icon-home"/> </a> <span class="divider">/</span></li>
+ <li><a href="#">org</a> <span class="divider">/</span></li>
+ </ul>
</script>
\ No newline at end of file