diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html index 26ba918f6..f3cd08915 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -29,7 +29,7 @@ - + diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js index 4b6be7144..429d274fe 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js @@ -69,7 +69,7 @@ $.ajax({ "choosen": "chosen.jquery-0.9.8", "jquery.validate": "jquery.validate-1.9.0", "jquery.json": "jquery.json-2.3.min", - "knockout": "knockout-2.0.0.debug", + "knockout": "knockout-2.2.0rc.debug", "knockout.simpleGrid": "knockout.simpleGrid", "knockout.sortable": "knockout-sortable", "jquery.iframe.transport": "jquery.iframe-transport-1.4", diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js index 73add9ed0..61cf260b2 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js @@ -18,7 +18,7 @@ */ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","knockout", "knockout.simpleGrid","jquery.validate","bootstrap","jquery.fileupload","jquery.fileupload.ui"] - , function() { + , function(jquery,i18n,utils,jqueryTmpl,ko) { ArtifactUpload=function(classifier,pomFile){ this.classifier=classifier; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js index d1701d836..f7b435a8f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -18,7 +18,7 @@ */ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout","knockout.simpleGrid", "knockout.sortable","jquery.validate","bootstrap"] - , function() { + , function(jquery,i18n,utils,jqueryTmpl,ko) { //------------------------- // legacy path part diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index be47ce83c..57590873d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -21,7 +21,7 @@ define("archiva.main",["jquery","jquery.ui","sammy","jquery.tmpl",'i18n',"jquery "redback.roles","redback","archiva.general-admin","archiva.repositories", "archiva.network-proxies","archiva.proxy-connectors","archiva.repository-groups","archiva.artifacts-management", "archiva.proxy-connectors-rules","archiva.docs"], -function(jquery,ui,sammy,tmpl) { +function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryValidate,jqueryJson,ko) { /** * reccord a cookie for session with the logged user diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js index aa0fa78fc..13a5a8cd8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -17,7 +17,7 @@ * under the License. */ define("archiva.network-proxies",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" - ,"knockout.simpleGrid"], function() { + ,"knockout.simpleGrid"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { NetworkProxy=function(id,protocol,host,port,username,password,useNtlm){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js index 3ba35ced9..5ef25a11c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js @@ -17,12 +17,14 @@ * under the License. */ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstrap","jquery.ui","knockout" - ,"knockout.simpleGrid","knockout.sortable","archiva.proxy-connectors"], function() { + ,"knockout.simpleGrid","knockout.sortable","archiva.proxy-connectors"], + function(jquery,i18n,jqueryTmpl,bootstrap,jqueryUi,ko) { ProxyConnectorRulesViewModel=function(proxyConnectorRules,proxyConnectors){ var self=this; - this.proxyConnectorRules=ko.observableArray(proxyConnectorRules?proxyConnectorRules:[]); - this.proxyConnectors=proxyConnectors; + self.proxyConnectorRules=ko.observableArray(proxyConnectorRules?proxyConnectorRules:[]); + self.proxyConnectors=ko.observableArray(proxyConnectors); + self.proxyConnectors.id="select"; // FIXME get that from a REST service // FIXME i18n @@ -163,17 +165,25 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra } + remove=function(){ + $.log("remove"); + } + } ProxyConnectorRuleViewModel=function(proxyConnectorRule,proxyConnectorRulesViewModel,update){ var self=this; this.proxyConnectorRule=proxyConnectorRule; this.proxyConnectorRulesViewModel=proxyConnectorRulesViewModel; - this.availableProxyConnectors=ko.observableArray(proxyConnectorRulesViewModel.proxyConnectors); + this.availableProxyConnectors=proxyConnectorRulesViewModel.proxyConnectors; + this.availableProxyConnectors.id="availableProxyConnectors"; this.update=update; proxyConnectorMoved=function(arg){ $.log("repositoryMoved:"+arg.sourceIndex+" to " + arg.targetIndex); + self.proxyConnectorRule.modified(true); + ///arg.sourceParent.remove(arg.item); + //arg.targetParent.push(arg.item); } saveProxyConnectorRule=function(){ 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 32ad305ee..3defdd4b2 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 @@ -17,7 +17,8 @@ * under the License. */ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" - ,"knockout.simpleGrid","knockout.sortable"], function() { + ,"knockout.simpleGrid","knockout.sortable"], + function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { ProxyConnector=function(sourceRepoId,targetRepoId,proxyId,blackListPatterns,whiteListPatterns,policiesEntries,propertiesEntries, disabled,order){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 0de22a82c..87a541393 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -17,7 +17,7 @@ * under the License. */ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout","knockout.simpleGrid"], - function() { +function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { // FIXME this must be dynamic if we do a plugin mechanism with dynamic repositories types // FIXME i18n diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js index 21444ab26..f52236f4e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js @@ -18,7 +18,7 @@ */ define("archiva.repository-groups",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","jquery.ui","knockout" ,"knockout.simpleGrid","knockout.sortable"], -function() { +function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) { RepositoryGroup=function(id,repositories){ 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 b1ac8efea..40c69f400 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 @@ -17,7 +17,7 @@ * under the License. */ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","knockout.simpleGrid","jqueryFileTree","prettify"] -, function() { +, function(jquery,i18n,jqueryTmpl,choosen,ko,koSimpleGrid) { //----------------------------------------- // browse part diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js index 964b18376..d158b0573 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js @@ -18,12 +18,12 @@ */ define("startup",["jquery","sammy","utils"], -function() { +function(jquery,sammy,utils) { // define a container object with various datas window.archivaModel = {}; - $.log("devMode:"+window.archivaDevMode); + //$.log("devMode:"+window.archivaDevMode); // no cache for ajax queries as we get datas from servers so preventing caching !! jQuery.ajaxSetup( { 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 8e17df8f8..3572799a8 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 @@ -17,7 +17,7 @@ * under the License. */ -require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) { +require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i18n,ko) { loadi18n=function(loadCallback){ $.log("loadi18n"); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout-sortable.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout-sortable.js index 8eccf1300..f4259528b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout-sortable.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout-sortable.js @@ -1,140 +1,285 @@ -//knockout-sortable | (c) 2012 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license -define("knockout.sortable",["jquery","utils","knockout"], function() { +//knockout-sortable 0.6.6 | (c) 2012 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +(function(factory) { + if (typeof define === "function" && define.amd) { + // AMD anonymous module + define(["knockout", "jquery", "jquery.ui"], factory); + } else { + // No module loader (plain