mirror of https://github.com/apache/archiva.git
fix autocomplete quick search box
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1305569 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c2d65b256
commit
cc7dbe717b
|
@ -20,6 +20,7 @@ package org.apache.archiva.webapp.ui.services.api;
|
||||||
|
|
||||||
import org.apache.archiva.web.runtime.ArchivaRuntimeInfo;
|
import org.apache.archiva.web.runtime.ArchivaRuntimeInfo;
|
||||||
import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
|
import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -60,7 +61,8 @@ public class DefaultRuntimeInfoService
|
||||||
applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
|
applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
|
||||||
applicationRuntimeInfo.setBaseUrl( getBaseUrl( httpServletRequest ) );
|
applicationRuntimeInfo.setBaseUrl( getBaseUrl( httpServletRequest ) );
|
||||||
|
|
||||||
SimpleDateFormat sfd = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz", new Locale( locale ) );
|
SimpleDateFormat sfd = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz",
|
||||||
|
new Locale( StringUtils.isEmpty( locale ) ? "en" : locale ) );
|
||||||
applicationRuntimeInfo.setTimestampStr( sfd.format( new Date( archivaRuntimeInfo.getTimestamp() ) ) );
|
applicationRuntimeInfo.setTimestampStr( sfd.format( new Date( archivaRuntimeInfo.getTimestamp() ) ) );
|
||||||
|
|
||||||
return applicationRuntimeInfo;
|
return applicationRuntimeInfo;
|
||||||
|
|
|
@ -10,14 +10,7 @@
|
||||||
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
|
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="js/lab.js"></script>
|
<script type="text/javascript" src="js/lab.js"></script>
|
||||||
<script type="text/javascript">
|
|
||||||
var require = {
|
|
||||||
config:{
|
|
||||||
urlArgs: "timeStampCache="+new Date().getTime()
|
|
||||||
},
|
|
||||||
deps: ["js/jquery-1.7.2.js","js/jquery.tmpl.js","js/archiva/utils.js","js/startup.js"]
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="js/require.1.0.7.js"></script>
|
<script type="text/javascript" src="js/require.1.0.7.js"></script>
|
||||||
<script type="text/javascript" src="js/jquery.i18n.properties-1.0.9.js"></script>
|
<script type="text/javascript" src="js/jquery.i18n.properties-1.0.9.js"></script>
|
||||||
|
|
||||||
|
@ -56,19 +49,82 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: "js/",
|
baseUrl: "js/",
|
||||||
urlArgs: "timeStampCache="+new Date().getTime(),
|
urlArgs: "_="+new Date().getTime(),
|
||||||
"paths": {
|
"paths": {
|
||||||
"i18n":"jquery.i18n.properties-1.0.9",
|
"i18n":"jquery.i18n.properties-1.0.9",
|
||||||
"jquery": "jquery-1.7.2"
|
"jquery": "jquery-1.7.2",
|
||||||
|
"jquery_tmpl": "jquery.tmpl",
|
||||||
|
"utils": "archiva/utils",
|
||||||
|
"jquery_ui": "jquery-ui-1.8.16.custom.min"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
require(['domReady'], function (domReady) {
|
require(['domReady','startup','jquery'], function (domReady) {
|
||||||
domReady.withResources(function () {
|
domReady.withResources(function () {
|
||||||
loadJs();
|
|
||||||
|
$.ajax(
|
||||||
|
{
|
||||||
|
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
|
||||||
|
dataType: 'json',
|
||||||
|
success:function(data){
|
||||||
|
window.archivaDevMode=data.devMode;
|
||||||
|
window.archivaJavascriptLog=data.javascriptLog;
|
||||||
|
window.archivaRuntimeInfo=data;
|
||||||
|
|
||||||
|
require.config({
|
||||||
|
baseUrl: "js/",
|
||||||
|
"paths": {
|
||||||
|
"redback": buildLoadJsUrl("redback/redback.js"),
|
||||||
|
"i18nLoad": buildLoadJsUrl("archiva/i18nload.js")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// CacheBust is for dev purpose use false in prod env !
|
||||||
|
var options = {
|
||||||
|
AlwaysPreserveOrder:true,
|
||||||
|
BasePath:"js/",
|
||||||
|
explicit_preloading:false,
|
||||||
|
CacheBust:window.archivaDevMode
|
||||||
|
};
|
||||||
|
$LAB.setGlobalDefaults(options);
|
||||||
|
$LAB
|
||||||
|
//.script(buildLoadJsUrl("jquery.tmpl.js")).wait()
|
||||||
|
//.script(buildLoadJsUrl("archiva/utils.js")).wait()
|
||||||
|
.script(buildLoadJsUrl("archiva/i18nload.js")).wait()
|
||||||
|
.script("jquery.cookie.1.0.0.js").wait()
|
||||||
|
.script("knockout-2.0.0.debug.js").wait()
|
||||||
|
//.script("jquery-ui-1.8.16.custom.min.js").wait()
|
||||||
|
.script("jquery.validate-1.9.0.js").wait()
|
||||||
|
.script("jquery.json-2.3.min.js").wait()
|
||||||
|
.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("archiva/search.js")).wait()
|
||||||
|
.script(buildLoadJsUrl("redback/redback-tmpl.js")).wait()
|
||||||
|
.script("chosen.jquery-0.9.7.js" )
|
||||||
|
.script("bootstrap.2.0.2.js" )
|
||||||
|
.script(buildLoadJsUrl("knockout.simpleGrid.js"))
|
||||||
|
.script(buildLoadJsUrl("knockout-sortable.js"))
|
||||||
|
//.script("jquery.iframe-transport-1.4.js").wait()
|
||||||
|
//.script("jquery.fileupload-5.10.0.js").wait()
|
||||||
|
//.script("jquery.fileupload-ip-1.0.6.js").wait()
|
||||||
|
//.script("jquery.fileupload-ui-6.6.3.js" ).wait()
|
||||||
|
.script(buildLoadJsUrl("redback/user.js")).wait()
|
||||||
|
.script(buildLoadJsUrl("redback/users.js")).wait()
|
||||||
|
//.script(buildLoadJsUrl("redback/redback.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"));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
require( ["order!jquery" ,"order!redback/redback"],
|
require( ["order!jquery" ,"order!redback/redback","jquery_ui"],
|
||||||
function($) {
|
function($) {
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define("utils",["jquery","i18n","js/jquery.tmpl.js"], function() {
|
define("utils",["jquery","i18n","jquery_tmpl"], function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* log message in the console
|
* log message in the console
|
||||||
|
|
|
@ -36,77 +36,6 @@ function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
loadJs=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.config({
|
|
||||||
baseUrl: "js/",
|
|
||||||
"paths": {
|
|
||||||
"i18n":"jquery.i18n.properties-1.0.9",
|
|
||||||
"jquery": "jquery-1.7.2",
|
|
||||||
"redback": buildLoadJsUrl("redback/redback.js"),
|
|
||||||
"utils": buildLoadJsUrl("archiva/utils.js"),
|
|
||||||
"i18nLoad": buildLoadJsUrl("archiva/i18nload.js"),
|
|
||||||
"jquerytmpl": buildLoadJsUrl("jquery.tmpl.js"),
|
|
||||||
"jquery_ui": "jquery-ui-1.8.16.custom.min"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// CacheBust is for dev purpose use false in prod env !
|
|
||||||
var options = {
|
|
||||||
AlwaysPreserveOrder:true,
|
|
||||||
BasePath:"js/",
|
|
||||||
explicit_preloading:false,
|
|
||||||
CacheBust:window.archivaDevMode
|
|
||||||
};
|
|
||||||
$LAB.setGlobalDefaults(options);
|
|
||||||
$LAB
|
|
||||||
.script(buildLoadJsUrl("jquery.tmpl.js")).wait()
|
|
||||||
.script(buildLoadJsUrl("archiva/utils.js")).wait()
|
|
||||||
.script(buildLoadJsUrl("archiva/i18nload.js")).wait()
|
|
||||||
.script("jquery.cookie.1.0.0.js").wait()
|
|
||||||
.script("knockout-2.0.0.debug.js").wait()
|
|
||||||
//.script("jquery-ui-1.8.16.custom.min.js").wait()
|
|
||||||
.script("jquery.validate-1.9.0.js").wait()
|
|
||||||
.script("jquery.json-2.3.min.js").wait()
|
|
||||||
.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("archiva/search.js")).wait()
|
|
||||||
.script(buildLoadJsUrl("redback/redback-tmpl.js")).wait()
|
|
||||||
.script("chosen.jquery-0.9.7.js" )
|
|
||||||
.script("bootstrap.2.0.2.js" )
|
|
||||||
.script(buildLoadJsUrl("knockout.simpleGrid.js"))
|
|
||||||
.script(buildLoadJsUrl("knockout-sortable.js"))
|
|
||||||
//.script("jquery.iframe-transport-1.4.js").wait()
|
|
||||||
//.script("jquery.fileupload-5.10.0.js").wait()
|
|
||||||
//.script("jquery.fileupload-ip-1.0.6.js").wait()
|
|
||||||
//.script("jquery.fileupload-ui-6.6.3.js" ).wait()
|
|
||||||
.script(buildLoadJsUrl("redback/user.js")).wait()
|
|
||||||
.script(buildLoadJsUrl("redback/users.js")).wait()
|
|
||||||
//.script(buildLoadJsUrl("redback/redback.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"));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue