]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1576] rewrite proxies connector page
authorOlivier Lamy <olamy@apache.org>
Tue, 7 Feb 2012 18:24:32 +0000 (18:24 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 7 Feb 2012 18:24:32 +0000 (18:24 +0000)
remove testing stuff.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1241545 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

index 1ad691917f6a487360e0eed06b2c85d42cd2ed1e..2c05664f5b0c1ecc2cdbf25b4806f09bc85df542 100644 (file)
@@ -333,49 +333,3 @@ $(function() {
   }
 
 });
-
-(function () {
-
-
-  // Templates used for rendering
-  var templateEngine = new ko.jqueryTmplTemplateEngine();
-  TemporaryViewModel=function(currentPolicyInformation,selectedOption){
-    var self=this;
-    this.policyInformation=currentPolicyInformation;
-    this.selectedValue=selectedOption;
-    isSelectedOption=function(id){
-      return (id==self.selectedValue);
-    }
-  }
-  ko.bindingHandlers.proxyConnectorPolicies = {
-      update: function(element, valueAccessor, allBindingsAccessor, proxyConnectorViewModel) {
-        // This will be called once when the binding is first applied to an element,
-        // and again whenever the associated observable changes value.
-        // Update the DOM element based on the supplied values here.
-        var jqueryElement=$(element);
-        $.log("update:"+proxyConnectorViewModel.proxyConnectorsViewModel.managedRepositories().length);
-        // Empty the element
-        while(element.firstChild) {
-            ko.removeNode(element.firstChild);
-        }
-        var policyInformations = proxyConnectorViewModel.proxyConnectorsViewModel.policyInformations();
-        for (i=0;i<policyInformations.length;i++){
-          var currentPolicyInformation=policyInformations[i];
-          var gridContainer = element.appendChild(document.createElement("DIV"));
-          var selectedOption =
-              proxyConnectorViewModel.update ?
-                  proxyConnectorViewModel.getSelectedOptionForPolicy(currentPolicyInformation.id()):currentPolicyInformation.defaultOption();
-
-          var tmpViewModel = new TemporaryViewModel(currentPolicyInformation,selectedOption);
-          ko.renderTemplate("proxy-connector-edit-form-policies-tmpl", tmpViewModel
-                            , { templateEngine: templateEngine }, gridContainer, "replaceNode");
-          ko.utils.registerEventHandler($("#policy-"+currentPolicyInformation.id()).get(0), "change", function () {
-            $.log("change policy:"+$(this).attr('value')+" for policy " + tmpViewModel.currentPolicyInformation.id());
-          });
-          /*.change(function(event){
-            $.log("change policy:"+$(this).attr('value')+" for policy " + tmpViewModel.currentPolicyInformation.id());
-          });*/
-        }
-      }
-  };
-})();
\ No newline at end of file
index 77146d9963834e88327e0b113279a2064feb846b..022a2b692ab158b6958666b563b1b7f4be3b4b62 100644 (file)
     </fieldset>
   </form>
 </script>
-
-<script id="proxy-connector-edit-form-policies-tmpl" type='text/x-jquery-tmpl'>
-   <tr>
-     <td>${policyInformation.name()}</td>
-     <td>
-       <select id="policy-${policyInformation.id()}">
-         {{each(i, curOption) policyInformation.options()}}
-           {{if isSelectedOption(curOption)}}
-             <option selected value="${curOption}">${curOption}</option>
-           {{else}}
-             <option value="${curOption}">${curOption}</option>
-           {{/if}}
-         {{/each}}
-       </select>
-     </td>
-   </tr>
-
-   <br/>
-</script>
\ No newline at end of file