mirror of https://github.com/apache/archiva.git
move start js to a separate js file (index.html is only html now :-) )
make jquery.tmpl.js as a require module to help loading git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1376471 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dcb0764c66
commit
63d8ccb476
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
|
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
|
||||||
<script type="text/javascript" src="js/sammy.0.7.1.js"></script>
|
<script type="text/javascript" src="js/sammy.0.7.1.js"></script>
|
||||||
<script type="text/javascript" src="js/require.2.0.6.js"></script>
|
<script type="text/javascript" data-main="js/archiva/archiva.js" src="js/require.2.0.6.js"></script>
|
||||||
|
|
||||||
<title>Apache Archiva</title>
|
<title>Apache Archiva</title>
|
||||||
|
|
||||||
|
@ -66,111 +66,6 @@
|
||||||
<div id="dialog-confirm" title="" style="display: none">
|
<div id="dialog-confirm" title="" style="display: none">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
appendArchivaVersion=function(){
|
|
||||||
return "_archivaVersion="+window.archivaRuntimeInfo.version;
|
|
||||||
}
|
|
||||||
|
|
||||||
timestampNoCache=function(){
|
|
||||||
if (window.archivaRuntimeInfo.version.match("SNAPSHOT$")=="SNAPSHOT"){
|
|
||||||
return "&archivaTimestamp="+window.archivaRuntimeInfo.timestamp+(window.archivaRuntimeInfo.devMode?"&_="+jQuery.now():"");
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
appendTemplateUrl=function(){
|
|
||||||
return appendArchivaVersion()+timestampNoCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
appendJsNoCacheUrl=function(){
|
|
||||||
return appendArchivaVersion()+timestampNoCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/en",
|
|
||||||
dataType: 'json',
|
|
||||||
cache: false,
|
|
||||||
success:function(data){
|
|
||||||
|
|
||||||
window.archivaDevMode=data.devMode;
|
|
||||||
window.archivaJavascriptLog=data.javascriptLog;
|
|
||||||
window.archivaRuntimeInfo=data;
|
|
||||||
|
|
||||||
require.config({
|
|
||||||
baseUrl: "js/",
|
|
||||||
urlArgs: ""+appendJsNoCacheUrl(),
|
|
||||||
shim: {
|
|
||||||
'sammy':['jquery'],
|
|
||||||
'archiva.main':["jquery","sammy"]
|
|
||||||
},
|
|
||||||
paths: {
|
|
||||||
"i18n":"jquery.i18n.properties-1.0.9",
|
|
||||||
"jquery": "jquery-1.8.0.min",
|
|
||||||
"jquery.tmpl": "jquery.tmpl",
|
|
||||||
"utils": "archiva/utils",
|
|
||||||
"startup": "archiva/startup",
|
|
||||||
"jquery.ui": "jquery-ui-1.8.16.custom.min",
|
|
||||||
"jquery.ui.widget": "jquery.ui.widget-1.8.18",
|
|
||||||
"jquery.cookie": "jquery.cookie.1.0.0",
|
|
||||||
"bootstrap": "bootstrap.2.1.0",
|
|
||||||
"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.simpleGrid": "knockout.simpleGrid",
|
|
||||||
"knockout.sortable": "knockout-sortable",
|
|
||||||
"jquery.iframe.transport": "jquery.iframe-transport-1.4",
|
|
||||||
"jquery.fileupload": "jquery.fileupload-5.10.0",
|
|
||||||
"jquery.fileupload.ip":"jquery.fileupload-ip-1.0.6",
|
|
||||||
"jquery.fileupload.ui":"jquery.fileupload-ui-6.6.3",
|
|
||||||
"tmpl": "tmpl.min",
|
|
||||||
"prettify": "prettify",
|
|
||||||
"sammy": "sammy.0.7.1",
|
|
||||||
"jqueryFileTree": "jqueryFileTree-1.0.1",
|
|
||||||
"redback": "redback/redback",
|
|
||||||
"redback.roles": "redback/roles",
|
|
||||||
"redback.user": "redback/user",
|
|
||||||
"redback.users": "redback/users",
|
|
||||||
"redback.templates": "redback/redback-tmpl",
|
|
||||||
"archiva.general-admin":"archiva/general-admin",
|
|
||||||
"archiva.templates": "archiva/main-tmpl",
|
|
||||||
"archiva.repositories": "archiva/repositories",
|
|
||||||
"archiva.network-proxies": "archiva/network-proxies",
|
|
||||||
"archiva.proxy-connectors": "archiva/proxy-connectors",
|
|
||||||
"archiva.repository-groups": "archiva/repository-groups",
|
|
||||||
"archiva.artifacts-management": "archiva/artifacts-management",
|
|
||||||
"archiva.search": "archiva/search",
|
|
||||||
"archiva.main": "archiva/main"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
requirejs(['jquery','jquery.tmpl','i18n','sammy','startup','utils','domReady!'], function (domReady) {
|
|
||||||
loadi18n(function () {
|
|
||||||
$.ajax({
|
|
||||||
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
|
|
||||||
dataType: 'json',
|
|
||||||
success:function(data){
|
|
||||||
window.archivaDevMode=data.devMode;
|
|
||||||
window.archivaJavascriptLog=data.javascriptLog;
|
|
||||||
window.archivaRuntimeInfo=data;
|
|
||||||
|
|
||||||
require(['sammy','archiva.main','domReady!'],function (domReady) {
|
|
||||||
startArchivaApplication();
|
|
||||||
$("#loadingDiv").hide();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="loadingDiv">
|
<div id="loadingDiv">
|
||||||
<div class="loading-indicator">
|
<div class="loading-indicator">
|
||||||
<img src="images/medium-spinner.gif" />
|
<img src="images/medium-spinner.gif" />
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
appendArchivaVersion=function(){
|
||||||
|
return "_archivaVersion="+window.archivaRuntimeInfo.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
timestampNoCache=function(){
|
||||||
|
if (window.archivaRuntimeInfo.version.match("SNAPSHOT$")=="SNAPSHOT"){
|
||||||
|
return "&archivaTimestamp="+window.archivaRuntimeInfo.timestamp+(window.archivaRuntimeInfo.devMode?"&_="+jQuery.now():"");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
appendTemplateUrl=function(){
|
||||||
|
return appendArchivaVersion()+timestampNoCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
appendJsNoCacheUrl=function(){
|
||||||
|
return appendArchivaVersion()+timestampNoCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/en",
|
||||||
|
dataType: 'json',
|
||||||
|
cache: false,
|
||||||
|
success:function(data){
|
||||||
|
|
||||||
|
window.archivaDevMode=data.devMode;
|
||||||
|
window.archivaJavascriptLog=data.javascriptLog;
|
||||||
|
window.archivaRuntimeInfo=data;
|
||||||
|
|
||||||
|
requirejs.config({
|
||||||
|
baseUrl: "js/",
|
||||||
|
urlArgs: ""+appendJsNoCacheUrl(),
|
||||||
|
shim: {
|
||||||
|
'sammy':['jquery','jquery.tmpl'],
|
||||||
|
'archiva.main':['jquery','sammy','jquery.tmpl'],
|
||||||
|
'utils':['jquery','jquery.tmpl'],
|
||||||
|
'archiva.templates': ['jquery','jquery.tmpl','utils'],
|
||||||
|
'redback.templates': ['jquery','jquery.tmpl','utils']
|
||||||
|
},
|
||||||
|
paths: {
|
||||||
|
"i18n":"jquery.i18n.properties-1.0.9",
|
||||||
|
"jquery": "jquery-1.8.0.min",
|
||||||
|
"jquery.tmpl": "jquery.tmpl",
|
||||||
|
"utils": "archiva/utils",
|
||||||
|
"startup": "archiva/startup",
|
||||||
|
"jquery.ui": "jquery-ui-1.8.16.custom.min",
|
||||||
|
"jquery.ui.widget": "jquery.ui.widget-1.8.18",
|
||||||
|
"jquery.cookie": "jquery.cookie.1.0.0",
|
||||||
|
"bootstrap": "bootstrap.2.1.0",
|
||||||
|
"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.simpleGrid": "knockout.simpleGrid",
|
||||||
|
"knockout.sortable": "knockout-sortable",
|
||||||
|
"jquery.iframe.transport": "jquery.iframe-transport-1.4",
|
||||||
|
"jquery.fileupload": "jquery.fileupload-5.10.0",
|
||||||
|
"jquery.fileupload.ip":"jquery.fileupload-ip-1.0.6",
|
||||||
|
"jquery.fileupload.ui":"jquery.fileupload-ui-6.6.3",
|
||||||
|
"tmpl": "tmpl.min",
|
||||||
|
"prettify": "prettify",
|
||||||
|
"sammy": "sammy.0.7.1",
|
||||||
|
"jqueryFileTree": "jqueryFileTree-1.0.1",
|
||||||
|
"redback": "redback/redback",
|
||||||
|
"redback.roles": "redback/roles",
|
||||||
|
"redback.user": "redback/user",
|
||||||
|
"redback.users": "redback/users",
|
||||||
|
"redback.templates": "redback/redback-tmpl",
|
||||||
|
"archiva.general-admin":"archiva/general-admin",
|
||||||
|
"archiva.templates": "archiva/main-tmpl",
|
||||||
|
"archiva.repositories": "archiva/repositories",
|
||||||
|
"archiva.network-proxies": "archiva/network-proxies",
|
||||||
|
"archiva.proxy-connectors": "archiva/proxy-connectors",
|
||||||
|
"archiva.repository-groups": "archiva/repository-groups",
|
||||||
|
"archiva.artifacts-management": "archiva/artifacts-management",
|
||||||
|
"archiva.search": "archiva/search",
|
||||||
|
"archiva.main": "archiva/main"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
requirejs(['jquery','jquery.tmpl','i18n','sammy','startup','utils','domReady!'], function (domReady) {
|
||||||
|
loadi18n(function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
|
||||||
|
dataType: 'json',
|
||||||
|
success:function(data){
|
||||||
|
window.archivaDevMode=data.devMode;
|
||||||
|
window.archivaJavascriptLog=data.javascriptLog;
|
||||||
|
window.archivaRuntimeInfo=data;
|
||||||
|
|
||||||
|
require(['sammy','jquery','jquery.tmpl','archiva.main','utils','domReady!'],function (domReady) {
|
||||||
|
startArchivaApplication();
|
||||||
|
$("#loadingDiv").hide();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
|
@ -16,13 +16,13 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
define("archiva.templates",["jquery.tmpl","utils","text!templates/archiva/menu.html",
|
require(['jquery',"jquery.tmpl","utils","text!templates/archiva/menu.html",
|
||||||
"text!templates/archiva/generics.html",
|
"text!templates/archiva/generics.html",
|
||||||
"text!templates/archiva/modal.html",
|
"text!templates/archiva/modal.html",
|
||||||
"text!templates/archiva/repositories.html",
|
"text!templates/archiva/repositories.html",
|
||||||
"text!templates/archiva/search.html",
|
"text!templates/archiva/search.html",
|
||||||
"text!templates/archiva/general-admin.html"],
|
"text!templates/archiva/general-admin.html"],
|
||||||
function(jqueryTmpl,utils,menu,generics,modal,repositories,
|
function(jquery,jqueryTmpl,utils,menu,generics,modal,repositories,
|
||||||
search,general_admin) {
|
search,general_admin) {
|
||||||
|
|
||||||
var htmlFragment=$("#html-fragments");
|
var htmlFragment=$("#html-fragments");
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
define("archiva.main",["jquery","sammy","jquery.ui","jquery.cookie","bootstrap","archiva.search",
|
define("archiva.main",["jquery","sammy","jquery.tmpl","jquery.ui","jquery.cookie","bootstrap","archiva.search",
|
||||||
"jquery.validate","jquery.json","knockout","redback.templates","archiva.templates",
|
"jquery.validate","jquery.json","knockout","redback.templates","archiva.templates",
|
||||||
"redback.roles","redback","archiva.general-admin","archiva.repositories",
|
"redback.roles","redback","archiva.general-admin","archiva.repositories",
|
||||||
"archiva.network-proxies","archiva.proxy-connectors","archiva.repository-groups","archiva.artifacts-management"],
|
"archiva.network-proxies","archiva.proxy-connectors","archiva.repository-groups","archiva.artifacts-management"],
|
||||||
|
@ -593,16 +593,5 @@ function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------
|
|
||||||
// extends jquery tmpl to support var def
|
|
||||||
//-----------------------------------------
|
|
||||||
|
|
||||||
$.extend($.tmpl.tag, {
|
|
||||||
"var": {
|
|
||||||
open: "var $1;"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define("utils",["jquery","jquery.tmpl","i18n"], function() {
|
require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
|
||||||
|
|
||||||
loadi18n=function(loadCallback){
|
loadi18n=function(loadCallback){
|
||||||
$.log("loadi18n");
|
$.log("loadi18n");
|
||||||
|
@ -426,6 +426,16 @@ define("utils",["jquery","jquery.tmpl","i18n"], function() {
|
||||||
return this.substring(idx);
|
return this.substring(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// extends jquery tmpl to support var def
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$.extend($.tmpl.tag, {
|
||||||
|
"var": {
|
||||||
|
open: "var $1;"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
|
@ -7,7 +7,11 @@
|
||||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
* http://jquery.org/license
|
* http://jquery.org/license
|
||||||
*/
|
*/
|
||||||
(function( jQuery, undefined ){
|
|
||||||
|
define("jquery.tmpl",["jquery"],
|
||||||
|
function() {
|
||||||
|
|
||||||
|
//(function( jQuery, undefined ){
|
||||||
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
|
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
|
||||||
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
|
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
|
||||||
|
|
||||||
|
@ -481,4 +485,8 @@
|
||||||
jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
|
jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
|
||||||
jQuery( coll ).remove();
|
jQuery( coll ).remove();
|
||||||
}
|
}
|
||||||
})( jQuery );
|
//})( jQuery );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
|
@ -16,9 +16,9 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
define("redback.templates",["jquery.tmpl","utils","text!templates/redback/user-edit.html",
|
require(['jquery',"jquery.tmpl","utils","text!templates/redback/user-edit.html",
|
||||||
"text!templates/redback/login.html"],
|
"text!templates/redback/login.html"],
|
||||||
function(jqueryTmpl,utils,useredit, login) {
|
function(jquery,jqueryTmpl,utils,useredit, login) {
|
||||||
|
|
||||||
var htmlFragment=$("#html-fragments");
|
var htmlFragment=$("#html-fragments");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue