aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-10 14:39:00 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-10 14:39:00 +0000
commite7381a56b1683385702a517dda31d9247ee995c3 (patch)
tree781eba8e62328297dadf4bc311687ef9e6944793 /archiva-modules
parentfc2b1e3cc068a69c901b281c2febe3e04f212fed (diff)
downloadarchiva-e7381a56b1683385702a517dda31d9247ee995c3.tar.gz
archiva-e7381a56b1683385702a517dda31d9247ee995c3.zip
use a popover to explain why delete is not possible
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1382889 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js21
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js4
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html4
3 files changed, 23 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
index eddc9867c..ed4b5dfe4 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
@@ -86,13 +86,25 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
}
deleteGroupId=function(groupId){
- var previousHash=getUrlHash();
- $.log("previousHash:"+previousHash);
+
var repoId=getSelectedBrowsingRepository();
if(!repoId){
- displayErrorMessage($.i18n.prop('groupId.delete.missing.repoId'));
+ var escapedGroupId=escapeDot(groupId );
+ var selected = $("#main-content" ).find("#delete-"+escapedGroupId );
+ selected.attr("data-content",$.i18n.prop('groupId.delete.missing.repoId'))
+ selected.popover({
+ html:true,
+ template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',
+ placement:'top',
+ trigger:'manual'});
+ selected.popover('show');
+ selected.mouseover(function(){
+ selected.popover("destroy");
+ });
return;
}
+ var previousHash=getUrlHash();
+ $.log("previousHash:"+previousHash);
openDialogConfirm(function(){
$.ajax({
url:"restServices/archivaServices/repositoriesService/deleteGroupId?groupId="+groupId+"&repositoryId="+repoId,
@@ -232,7 +244,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
location+="~"+self.repositoryId;
}
location+="/"+groupId;
- window.sammyArchivaApplication.setLocation(location); }
+ window.sammyArchivaApplication.setLocation(location);
+ }
displayParent=function(){
var selectedRepo=getSelectedBrowsingRepository();
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
index cfb60c885..3eab02a92 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
@@ -436,6 +436,10 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
return this.substring(idx);
}
+ escapeDot=function(str){
+ return str.replace(/\./g,"\\\.");
+ }
+
//-----------------------------------------
// extends jquery tmpl to support var def
//-----------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
index 7dd83709e..00658588e 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
@@ -52,7 +52,7 @@
{{if browseResultEntry.project}}
{{if deleteKarma}}
<li class="browse-list-project">
- <img src="images/trash.png" data-bind="click:function(){deleteGroupId(browseResultEntry.name)}"/>
+ <img id="delete-${browseResultEntry.name}" src="images/trash.png" data-bind="click:function(){deleteGroupId(browseResultEntry.name)}"/>
<a href="#" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
</li>
{{else}}
@@ -63,7 +63,7 @@
{{else}}
{{if deleteKarma}}
<li class="browse-list">
- <img src="images/trash.png" data-bind="click:function(){deleteGroupId(browseResultEntry.name)}"/>
+ <img id="delete-${browseResultEntry.name}" src="images/trash.png" data-bind="click:function(){deleteGroupId(browseResultEntry.name)}"/>
<a data-bind="click:function(){displayGroupId(browseResultEntry.name)}" href="#" title="folder ${displayEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
</li>
{{else}}