Adding versioning for js files
This commit is contained in:
parent
969159a525
commit
bfd1203536
@ -1,10 +1,10 @@
|
||||
package net.Broken;
|
||||
|
||||
import net.Broken.RestApi.ApiCommandLoader;
|
||||
import net.Broken.Tools.Command.CommandParser;
|
||||
import net.Broken.Tools.EmbedMessageUtils;
|
||||
import net.Broken.Tools.UserManager.UserRegister;
|
||||
import net.Broken.Tools.UserSpamUtils;
|
||||
import net.Broken.RestApi.ApiCommandLoader;
|
||||
import net.dv8tion.jda.core.JDA;
|
||||
import net.dv8tion.jda.core.entities.ChannelType;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
@ -18,7 +18,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
13
src/main/java/net/Broken/webView/GeneralWebView.java
Normal file
13
src/main/java/net/Broken/webView/GeneralWebView.java
Normal file
@ -0,0 +1,13 @@
|
||||
package net.Broken.webView;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class GeneralWebView {
|
||||
@RequestMapping("/")
|
||||
public String music(Model model){
|
||||
return "index";
|
||||
}
|
||||
}
|
33
src/main/java/net/Broken/webView/MvcApplication.java
Normal file
33
src/main/java/net/Broken/webView/MvcApplication.java
Normal file
@ -0,0 +1,33 @@
|
||||
package net.Broken.webView;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.resource.ContentVersionStrategy;
|
||||
import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter;
|
||||
import org.springframework.web.servlet.resource.VersionResourceResolver;
|
||||
|
||||
@Configuration
|
||||
public class MvcApplication extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
VersionResourceResolver versionResourceResolver = new VersionResourceResolver()
|
||||
.addVersionStrategy(new ContentVersionStrategy(), "/**");
|
||||
|
||||
registry.addResourceHandler("/js/*.js")
|
||||
.addResourceLocations("classpath:/static/js/")
|
||||
.setCachePeriod(60 * 60 * 24 * 365) /* one year */
|
||||
.resourceChain(true)
|
||||
.addResolver(versionResourceResolver);
|
||||
}
|
||||
@Bean
|
||||
public ResourceUrlEncodingFilter resourceUrlEncodingFilter() {
|
||||
return new ResourceUrlEncodingFilter();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,18 +3,19 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
|
||||
<title>Discord Bot</title>
|
||||
<title>Music Control - Discord Bot</title>
|
||||
<link rel="icon"
|
||||
type="image/x-icon"
|
||||
href="favicon.png"/>
|
||||
href="/favicon.png"/>
|
||||
|
||||
<!-- CSS -->
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
|
||||
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||
<link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||
<link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||
</head>
|
||||
|
||||
<body class="blue-grey lighten-5" >
|
||||
|
||||
<!--__________________________________________________________-->
|
||||
<!-- NAV BAR -->
|
||||
<!-- AND -->
|
||||
@ -25,10 +26,10 @@
|
||||
<a id="logo-container" href="/" class="brand-logo">Discord Bot</a>
|
||||
<ul class="right hide-on-med-and-down">
|
||||
|
||||
<li class="active">
|
||||
<li class="">
|
||||
<a class="waves-effect waves-light sidenav-trigger" href="/" data-target="slide-out">Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<li class="active">
|
||||
<a class="waves-effect waves-light" href="/music" >Music Control</a>
|
||||
</li>
|
||||
<li id="nav-bar-account">
|
||||
@ -44,6 +45,8 @@
|
||||
<li>
|
||||
<a class="waves-effect waves-light sidenav-trigger" href="/music" data-target="slide-out" >Music Control</a>
|
||||
</li>
|
||||
|
||||
<!--TODO Connection mobile-->
|
||||
</ul>
|
||||
<a href="#" data-activates="nav-mobile" class="button-navbar-mobile button-collapse"><i class="material-icons">menu</i></a>
|
||||
</div>
|
||||
@ -115,19 +118,17 @@
|
||||
<!-- -->
|
||||
<!--__________________________________________________________-->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="section no-pad-bot main" id="index-banner">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Scripts-->
|
||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script src="js/materialize.js"></script>
|
||||
<script src="js/navabar.js"></script>
|
||||
<script src="js/js.cookie.js"></script>
|
||||
<!--<script src="js/init.js"></script>-->
|
||||
|
||||
<script th:src="@{/js/materialize.js}"></script>
|
||||
<script th:src="@{/js/navabar.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.js}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -290,13 +290,14 @@
|
||||
|
||||
<!-- Scripts-->
|
||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script src="js/materialize.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
|
||||
<script>
|
||||
var needLogin = true;
|
||||
</script>
|
||||
<script src="js/navabar.js"></script>
|
||||
<script src="js/js.cookie.js"></script>
|
||||
<script th:src="@{/js/materialize.js}"></script>
|
||||
<script th:src="@{/js/music.js}"></script>
|
||||
<script th:src="@{/js/navabar.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.js}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -192,10 +192,10 @@
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script src="js/materialize.js"></script>
|
||||
<script src="js/register.js"></script>
|
||||
<script src="js/navabar.js"></script>
|
||||
<script src="js/js.cookie.js"></script>
|
||||
<script th:src="@{/js/materialize.js}"></script>
|
||||
<script th:src="@{/js/register.js}"></script>
|
||||
<script th:src="@{/js/navabar.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.js}"></script>
|
||||
|
||||
|
||||
<script th:inline="javascript">
|
||||
|
Loading…
Reference in New Issue
Block a user