"jquery_json": "jquery.json-2.3.min",
"knockout.simpleGrid": "knockout.simpleGrid",
"knockout": "knockout-2.0.0.debug",
- "knockout.sortable": "knockout-sortable"
+ "knockout.sortable": "knockout-sortable",
+ "redback": "redback/redback",
+ "general-admin":"archiva/general-admin",
+ "redback-templates": "redback/redback-tmpl",
+ "main-templates": "archiva/main-tmpl",
+ "repositories": "archiva/repositories",
+ "network-proxies": "archiva/network-proxies",
+ "proxy-connectors": "archiva/proxy-connectors",
+ "repository-groups": "archiva/repository-groups",
+ "roles": "redback/roles",
+ "user": "redback/user",
+ "users": "redback/users"
}
// file upload dependencies
//.script("jquery.iframe-transport-1.4.js").wait()
//.script("jquery.fileupload-ip-1.0.6.js").wait()
//.script("jquery.fileupload-ui-6.6.3.js" ).wait()
});
- require(['domReady','jquery','i18n','startup'], function (domReady) {
+ require(['order!domReady','order!jquery','order!i18n','order!startup'], function (domReady) {
domReady.withResources(function () {
loadi18n();
$.ajax(
window.archivaJavascriptLog=data.javascriptLog;
window.archivaRuntimeInfo=data;
- require.config({
- baseUrl: "js/",
- urlArgs: "_="+new Date().getTime(),
- "paths": {
- "redback": buildLoadJsUrl("redback/redback.js")
-
- }
- });
-
// CacheBust is for dev purpose use false in prod env !
var options = {
AlwaysPreserveOrder:true,
};
$LAB.setGlobalDefaults(options);
$LAB
- .script(buildLoadJsUrl("archiva/main-tmpl.js")).wait()
- .script(buildLoadJsUrl("archiva/general-admin.js"))
- .script(buildLoadJsUrl("archiva/repositories.js")).wait()
- .script(buildLoadJsUrl("archiva/network-proxies.js")).wait()
- .script(buildLoadJsUrl("archiva/proxy-connectors.js")).wait()
- .script(buildLoadJsUrl("redback/operation.js")).wait()
- .script(buildLoadJsUrl("archiva/repository-groups.js")).wait()
- .script(buildLoadJsUrl("redback/redback-tmpl.js")).wait()
- .script(buildLoadJsUrl("redback/user.js")).wait()
- .script(buildLoadJsUrl("redback/users.js")).wait()
- .script(buildLoadJsUrl("redback/register.js")).wait()
- .script(buildLoadJsUrl("redback/permission.js")).wait()
- .script(buildLoadJsUrl("redback/resource.js")).wait()
- .script(buildLoadJsUrl("redback/roles.js")).wait()
.script(buildLoadJsUrl("archiva/main.js"));
}
})
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("general-admin",["jquery","i18n","order!utils","order!jquery_tmpl","order!knockout","jquery_validate","bootstrap"]
+ , function() {
//-------------------------
// legacy path part
}
});
}
+
});
\ No newline at end of file
* specific language governing permissions and limitations
* under the License.
*/
-require(["text!js/archiva/templates/menu.html"+appendTemplateUrl(),
+define("main-templates",["text!js/archiva/templates/menu.html"+appendTemplateUrl(),
"text!js/archiva/templates/message.html"+appendTemplateUrl(),
"text!js/archiva/templates/modal.html"+appendTemplateUrl(),
"text!js/archiva/templates/grids-generics.html"+appendTemplateUrl(),
"text!js/archiva/templates/proxy-connectors.html"+appendTemplateUrl(),
"text!js/archiva/templates/repository-groups.html"+appendTemplateUrl(),
"text!js/archiva/templates/search.html"+appendTemplateUrl(),
- "text!js/archiva/templates/general-admin.html"+appendTemplateUrl()],
+ "text!js/archiva/templates/general-admin.html"+appendTemplateUrl(),
+ "jquery_tmpl","utils"],
function(menu,message,modal,grids_generics,repositories,network_proxies,proxies_connectors,
repository_groups,search,general_admin) {
* under the License.
*/
require( ["order!jquery","jquery_ui","jquery_cookie","bootstrap","order!archiva/search",
- "jquery_validate","jquery_json","order!knockout","order!redback/redback"],
+ "jquery_validate","jquery_json","order!knockout","order!redback-templates","order!main-templates","order!roles",
+ "order!redback","general-admin","repositories","network-proxies","proxy-connectors","repository-groups"],
function() {
+
// define a container object with various datas
window.archivaModel = {};
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("network-proxies",["jquery","i18n","jquery_tmpl","bootstrap","jquery_validate"], function() {
NetworkProxy=function(id,protocol,host,port,username,password,useNtlm){
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("proxy-connectors",["jquery","i18n","jquery_tmpl","bootstrap","jquery_validate"], function() {
ProxyConnector=function(sourceRepoId,targetRepoId,proxyId,blackListPatterns,whiteListPatterns,policiesEntries,propertiesEntries,
disabled,order){
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("repositories",["jquery","i18n","jquery_tmpl","bootstrap","jquery_validate"], function() {
// FIXME this must be dynamic if we do a plugin mechanism with dynamic repositories types
// FIXME i18n
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("repository-groups",["jquery","i18n","jquery_tmpl","bootstrap","jquery_validate","jquery_ui"],
+function() {
RepositoryGroup=function(id,repositories){
+++ /dev/null
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-$(function() {
-
-
- Operation=function(name) {
- this.name=ko.observable(name);
- }
-
- /**
- * @param data Operation response from redback rest api
- */
- mapOperation=function(data) {
- return new Operation(data.name,null);
- }
-
-
-});
\ No newline at end of file
+++ /dev/null
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-$(function() {
-
-
- Permission=function(name,operation,resource) {
- this.name=ko.observable(name);
- this.operation=ko.observable(operation);
- this.resource=ko.observable(resource);
- }
-
- /**
- * @param data Permission response from redback rest api
- */
- mapPermission=function(data) {
- return new Permission(data.name,
- data.operation?mapOperation(data.operation):null,
- data.resource?mapResource(data.resource):null);
- }
-
-
-});
\ No newline at end of file
* specific language governing permissions and limitations
* under the License.
*/
-require(["text!js/redback/templates/user-edit.html"+appendTemplateUrl(),
+define("redback-templates",["text!js/redback/templates/user-edit.html"+appendTemplateUrl(),
"text!js/redback/templates/user-grids.html"+appendTemplateUrl(),
"text!js/redback/templates/login.html"+appendTemplateUrl(),
"text!js/redback/templates/register-form.html"+appendTemplateUrl(),
"text!js/redback/templates/password-change-form.html"+appendTemplateUrl(),
"text!js/redback/templates/user-edit-form.html"+appendTemplateUrl(),
- "text!js/redback/templates/roles-tmpl.html"+appendTemplateUrl()],
+ "text!js/redback/templates/roles-tmpl.html"+appendTemplateUrl(),
+ "jquery_tmpl","utils"],
function(useredit, usergrids, login,register,passwordchange,usereditform,roles) {
var htmlFragment=$("#html-fragments");
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("redback",["jquery","order!utils","jquery_validate","jquery_json","roles","user","users"], function() {
// define a container object with various datas
window.redbackModel = {userOperationNames:null,key:null,i18n:$.i18n.map};
});
}
+ Operation=function(name) {
+ this.name=ko.observable(name);
+ }
+
+ /**
+ * @param data Operation response from redback rest api
+ */
+ mapOperation=function(data) {
+ return new Operation(data.name,null);
+ }
+
+ Permission=function(name,operation,resource) {
+ this.name=ko.observable(name);
+ this.operation=ko.observable(operation);
+ this.resource=ko.observable(resource);
+ }
+
+ /**
+ * @param data Permission response from redback rest api
+ */
+ mapPermission=function(data) {
+ return new Permission(data.name,
+ data.operation?mapOperation(data.operation):null,
+ data.resource?mapResource(data.resource):null);
+ }
+
+ Resource=function(identifier,pattern) {
+ this.identifier=ko.observable(identifier);
+ this.pattern=ko.observable(pattern);
+ }
+
+ /**
+ * @param data Resource response from redback rest api
+ */
+ mapResource=function(data) {
+ return new Resource(data.identifier,data.pattern);
+ }
+
+ //---------------------------------------
+ // register part
+ //---------------------------------------
+
+ /**
+ * open the register modal box
+ */
+ registerBox=function(){
+ if (window.modalRegisterWindow==null) {
+ window.modalRegisterWindow = $("#modal-register").modal({backdrop:'static',show:false});
+ window.modalRegisterWindow.bind('hidden', function () {
+ $("#modal-register-err-message").hide();
+ })
+ }
+ window.modalRegisterWindow.modal('show');
+ $("#user-register-form").validate({
+ showErrors: function(validator, errorMap, errorList) {
+ customShowError("#user-register-form",validator,errorMap,errorMap);
+ }
+ });
+ $("#modal-register").delegate("#modal-register-ok", "click keydown keypress", function(e) {
+ e.preventDefault();
+ register();
+ });
+ //$("#modal-register").focus();
+ }
+
+ /**
+ * validate the register form and call REST service
+ */
+ register=function(){
+ $.log("register.js#register");
+ var valid = $("#user-register-form").valid();
+ if (!valid) {
+ return;
+ }
+ clearUserMessages();
+ $("#modal-register-ok").attr("disabled","disabled");
+
+ $('#modal-register-footer').append(smallSpinnerImg());
+
+ var user = {};
+ user.username = $("#user-register-form-username").val();
+ user.fullName = $("#user-register-form-fullname").val();
+ user.email = $("#user-register-form-email").val();
+ jQuery.ajax({
+ url: 'restServices/redbackServices/userService/registerUser',
+ data: JSON.stringify(user),
+ type: 'POST',
+ contentType: "application/json",
+ success: function(result){
+ var registered = false;
+ if (result == "-1") {
+ registered = false;
+ } else {
+ registered = true;
+ }
+
+ if (registered == true) {
+ window.modalRegisterWindow.modal('hide');
+ $("#register-link").hide();
+ // FIXME i18n
+ displaySuccessMessage("registered your key has been sent");
+ }
+ },
+ complete: function(){
+ $("#modal-register-ok").removeAttr("disabled");
+ removeSmallSpinnerImg();
+ },
+ error: function(result) {
+ var obj = jQuery.parseJSON(result.responseText);
+ displayRedbackError(obj);
+ window.modalRegisterWindow.modal('hide');
+ }
+ })
+
+ }
+
+ /**
+ * validate a registration key and go to change password key
+ * @param key
+ */
+ validateKey=function(key,registration) {
+ // FIXME spinner display
+ $.ajax({
+ url: 'restServices/redbackServices/userService/validateKey/'+key,
+ type: 'GET',
+ success: function(result){
+ window.redbackModel.key=key;
+ $.log("validateKey#sucess");
+ changePasswordBox(false,registration?registration:true,null);
+ },
+ complete: function(){
+ // hide spinner
+ },
+ error: function(result) {
+ $.log("validateKey#error");
+ var obj = jQuery.parseJSON(result.responseText);
+ $.log("validateKey#error response:"+obj);
+ displayRedbackError(obj);
+ }
+ })
+ }
+
});
\ No newline at end of file
+++ /dev/null
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-$(function() {
-
- /**
- * open the register modal box
- */
- registerBox=function(){
- if (window.modalRegisterWindow==null) {
- window.modalRegisterWindow = $("#modal-register").modal({backdrop:'static',show:false});
- window.modalRegisterWindow.bind('hidden', function () {
- $("#modal-register-err-message").hide();
- })
- }
- window.modalRegisterWindow.modal('show');
- $("#user-register-form").validate({
- showErrors: function(validator, errorMap, errorList) {
- customShowError("#user-register-form",validator,errorMap,errorMap);
- }
- });
- $("#modal-register").delegate("#modal-register-ok", "click keydown keypress", function(e) {
- e.preventDefault();
- register();
- });
- //$("#modal-register").focus();
- }
-
- /**
- * validate the register form and call REST service
- */
- register=function(){
- $.log("register.js#register");
- var valid = $("#user-register-form").valid();
- if (!valid) {
- return;
- }
- clearUserMessages();
- $("#modal-register-ok").attr("disabled","disabled");
-
- $('#modal-register-footer').append(smallSpinnerImg());
-
- var user = {};
- user.username = $("#user-register-form-username").val();
- user.fullName = $("#user-register-form-fullname").val();
- user.email = $("#user-register-form-email").val();
- jQuery.ajax({
- url: 'restServices/redbackServices/userService/registerUser',
- data: '{"user":'+JSON.stringify(user)+'}',
- type: 'POST',
- contentType: "application/json",
- success: function(result){
- var registered = false;
- if (result == "-1") {
- registered = false;
- } else {
- registered = true;
- }
-
- if (registered == true) {
- window.modalRegisterWindow.modal('hide');
- $("#register-link").hide();
- // FIXME i18n
- displaySuccessMessage("registered your key has been sent");
- }
- },
- complete: function(){
- $("#modal-register-ok").removeAttr("disabled");
- removeSmallSpinnerImg();
- },
- error: function(result) {
- var obj = jQuery.parseJSON(result.responseText);
- displayRedbackError(obj);
- window.modalRegisterWindow.modal('hide');
- }
- })
-
- }
-
- /**
- * validate a registration key and go to change password key
- * @param key
- */
- validateKey=function(key,registration) {
- // FIXME spinner display
- $.ajax({
- url: 'restServices/redbackServices/userService/validateKey/'+key,
- type: 'GET',
- success: function(result){
- window.redbackModel.key=key;
- $.log("validateKey#sucess");
- changePasswordBox(false,registration?registration:true,null);
- },
- complete: function(){
- // hide spinner
- },
- error: function(result) {
- $.log("validateKey#error");
- var obj = jQuery.parseJSON(result.responseText);
- $.log("validateKey#error response:"+obj);
- displayRedbackError(obj);
- }
- })
- }
-
-});
\ No newline at end of file
+++ /dev/null
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-$(function() {
-
-
- Resource=function(identifier,pattern) {
- this.identifier=ko.observable(identifier);
- this.pattern=ko.observable(pattern);
- }
-
- /**
- * @param data Resource response from redback rest api
- */
- mapResource=function(data) {
- return new Resource(data.identifier,data.pattern);
- }
-
-
-});
\ No newline at end of file
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("roles",["jquery","order!utils","i18n","jquery_validate","order!knockout","order!knockout.simpleGrid"], function() {
Role = function(name,description,assignable,childRoleNames,parentRoleNames,users,parentsRolesUsers,permissions,otherUsers){
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("user",["jquery","order!utils","i18n","jquery_validate","order!knockout","order!knockout.simpleGrid"], function() {
/**
* object model for user with some function to create/update/delete users
* specific language governing permissions and limitations
* under the License.
*/
-$(function() {
+define("users",["jquery","order!utils","i18n","jquery_validate","order!knockout","order!knockout.simpleGrid"], function() {
/**
* view model used for users grid