You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/02/07 19:24:32 UTC

svn commit: r1241545 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: proxy-connectors.js templates/proxy-connectors.html

Author: olamy
Date: Tue Feb  7 18:24:32 2012
New Revision: 1241545

URL: http://svn.apache.org/viewvc?rev=1241545&view=rev
Log:
[MRM-1576] rewrite proxies connector page
remove testing stuff.

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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js?rev=1241545&r1=1241544&r2=1241545&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js Tue Feb  7 18:24:32 2012
@@ -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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html?rev=1241545&r1=1241544&r2=1241545&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html Tue Feb  7 18:24:32 2012
@@ -154,22 +154,3 @@
     </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