Merge pull request #308 from mindscratch/embed-external-js-css

Embed bootstrap, jquery and other external dependencies
This commit is contained in:
Victor Marmol 2014-11-14 13:31:45 -08:00
commit a1e72b2017
9 changed files with 1548 additions and 8 deletions

View File

@ -19,17 +19,17 @@ const containersHtmlTemplate = `
<head>
<title>cAdvisor - {{.DisplayName}}</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/bootstrap-3.1.1.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/static/bootstrap-theme-3.1.1.min.css">
<link rel="stylesheet" href="/static/containers.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="/static/jquery-1.10.2.min.js"></script>
<script src="/static/bootstrap-3.1.1.min.js"></script>
<script type="text/javascript" src="/static/google-jsapi.js"></script>
<script type="text/javascript" src="/static/containers.js"></script>
</head>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,8 +25,13 @@ import (
const StaticResource = "/static/"
var staticFiles = map[string]string{
"containers.css": containersCss,
"containers.js": containersJs,
"containers.css": containersCss,
"containers.js": containersJs,
"bootstrap-3.1.1.min.css": bootstrapCss,
"bootstrap-theme-3.1.1.min.css": bootstrapThemeCss,
"jquery-1.10.2.min.js": jqueryJs,
"bootstrap-3.1.1.min.js": bootstrapJs,
"google-jsapi.js": googleJsapiJs,
}
func HandleRequest(w http.ResponseWriter, u *url.URL) error {