summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-02-13 15:58:24 +0000
committerOlivier Lamy <olamy@apache.org>2012-02-13 15:58:24 +0000
commit18315817e611b0abc76e1d886c518d6d4c08df32 (patch)
tree0033946c0e328dd0a67d689c9bb2898a7c07b8d4 /archiva-modules
parentdc5d74bd12506fd432f91f3f41a78923cb295fab (diff)
downloadarchiva-18315817e611b0abc76e1d886c518d6d4c08df32.tar.gz
archiva-18315817e611b0abc76e1d886c518d6d4c08df32.zip
add proxy connector settings popover in order edit tab
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243571 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/proxy-connectors.js42
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html7
2 files changed, 37 insertions, 12 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
index 9b8b13ee2..f1a26c1c9 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
@@ -346,27 +346,33 @@ $(function() {
}
getProxyConnector=function(sourceRepoId,targetRepoId){
- var proxyConnector=$.grep(self.proxyConnectors(),
+ var proxyConnectors=$.grep(self.proxyConnectors(),
function(proxyConnector,idx){
return proxyConnector.sourceRepoId()==sourceRepoId
- && proxyConnector.targetRepoId==targetRepoId;
+ && proxyConnector.targetRepoId()==targetRepoId;
}
);
- var res = ($.isArray(proxyConnector) && proxyConnector.length>0) ? proxyConnector[0]:new ProxyConnector();
+ var res = ($.isArray(proxyConnectors) && proxyConnectors.length>0) ? proxyConnectors[0]:new ProxyConnector();
return res;
}
- showSettings=function(proxyConnector,targetContentStartId, targetImgStartId){
- //proxyConnector=getProxyConnector(proxyConnector.sourceRepoId(),proxyConnector.targetRepoId());
- var targetContent = $( (targetContentStartId?targetContentStartId:"#proxy-connectors-grid-remoterepo-settings-content-")
- +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId());
+ showSettings=function(proxyConnector,targetContentStartId, targetImgStartId,theProxyConnectorsViewModel){
+ $.log("proxyConnector:"+proxyConnector.sourceRepoId()+":"+proxyConnector.targetRepoId());
+ var id = (targetContentStartId?targetContentStartId:"#proxy-connectors-grid-remoterepo-settings-content-")
+ +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId();
+
+ var targetContent = $(id);
targetContent.html("");
- targetContent.append($("#proxy-connectors-remote-settings-popover-tmpl")
- .tmpl({
- proxyConnectorsViewModel: self,
- proxyConnector:ko.toJS(proxyConnector)
- }));
+ var tmplHtml = $("#proxy-connectors-remote-settings-popover-tmpl")
+ .tmpl({
+ proxyConnectorsViewModel: self,
+ proxyConnector:ko.toJS(proxyConnector)
+ } ).html();
+
+ $.log("tmpl:"+tmplHtml);
+ targetContent.append(tmplHtml);
+ $.log("showSettings#targetContent:"+id+","+targetContent.length+","+targetContent.attr("id")+",html:"+targetContent.html());
var targetImg = $((targetImgStartId?targetImgStartId:"#proxy-connectors-grid-remoterepo-settings-edit-")
+proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId());
targetImg.attr("data-content",targetContent.html());
@@ -381,6 +387,11 @@ $(function() {
}
+ this.displaySettings=function(sourceRepoId,targetRepoId,targetContentStartId, targetImgStartId){
+ var proxyConnector=getProxyConnector(sourceRepoId,targetRepoId);
+ showSettings(proxyConnector,targetContentStartId,targetImgStartId);
+ }
+
this.findPolicyInformationName=function(id){
for(i=0;i<self.policyInformations().length;i++){
if (id==self.policyInformations()[i].id()){
@@ -484,6 +495,13 @@ $(function() {
self.proxyConnectorsViewModel.updateModifiedProxyConnectors();
}
+ displaySettings=function(sourceRepoId,targetRepoId){
+ $.log("ProxyConnectorEditOrderViewModel#showSettings:"+sourceRepoId+"-"+targetRepoId);
+ self.proxyConnectorsViewModel.displaySettings(sourceRepoId,targetRepoId,
+ "#proxy-connectors-order-remoterepo-settings-content-",
+ "#proxy-connectors-order-remoterepo-settings-edit-");
+ }
+
}
displayProxyConnectors=function(){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
index db7a441ac..089490485 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
@@ -254,6 +254,13 @@
<div class="row-fluid">
<div class="span1">
<img src="images/system-software-update-32-32.png"/>
+ <br/>
+ <img src="images/utilities-system-monitor-22-22.png"
+ id="proxy-connectors-order-remoterepo-settings-edit-${sourceRepoId()}-${targetRepoId()}"
+ data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
+ data-bind="event: { mouseover: function(){ displaySettings(sourceRepoId(),targetRepoId())},}">
+ <div id="proxy-connectors-order-remoterepo-settings-content-${sourceRepoId()}-${targetRepoId()}"
+ style="display:none"></div>
</div>
<div class="span6 pull-left">
<blockquote>