From 76ac809f3fd09ed9906b88d7fe7e4790c55eb9b9 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 8 Oct 2013 16:10:31 -0700 Subject: [PATCH] Organize the ui/ subdirectory. Add static handler to serve contents from /ui/static. --- ui/{ => nodejs-webkit}/app.nw | Bin ui/{ => nodejs-webkit}/package.json | 0 ui/{ => nodejs-webkit}/redirect.html | 0 ui/{ => static}/bootstrap/LICENSE | 0 ui/{ => static}/bootstrap/css/bootstrap-theme.css | 0 .../bootstrap/css/bootstrap-theme.min.css | 0 ui/{ => static}/bootstrap/css/bootstrap.css | 0 ui/{ => static}/bootstrap/css/bootstrap.min.css | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin ui/{ => static}/bootstrap/js/bootstrap.js | 0 ui/{ => static}/bootstrap/js/bootstrap.min.js | 0 ui/{ => static}/index.css | 0 ui/{ => templates}/index.html | 4 ++-- ui/ui.go | 3 ++- 17 files changed, 4 insertions(+), 3 deletions(-) rename ui/{ => nodejs-webkit}/app.nw (100%) rename ui/{ => nodejs-webkit}/package.json (100%) rename ui/{ => nodejs-webkit}/redirect.html (100%) rename ui/{ => static}/bootstrap/LICENSE (100%) rename ui/{ => static}/bootstrap/css/bootstrap-theme.css (100%) rename ui/{ => static}/bootstrap/css/bootstrap-theme.min.css (100%) rename ui/{ => static}/bootstrap/css/bootstrap.css (100%) rename ui/{ => static}/bootstrap/css/bootstrap.min.css (100%) rename ui/{ => static}/bootstrap/fonts/glyphicons-halflings-regular.eot (100%) rename ui/{ => static}/bootstrap/fonts/glyphicons-halflings-regular.svg (100%) rename ui/{ => static}/bootstrap/fonts/glyphicons-halflings-regular.ttf (100%) rename ui/{ => static}/bootstrap/fonts/glyphicons-halflings-regular.woff (100%) rename ui/{ => static}/bootstrap/js/bootstrap.js (100%) rename ui/{ => static}/bootstrap/js/bootstrap.min.js (100%) rename ui/{ => static}/index.css (100%) rename ui/{ => templates}/index.html (91%) diff --git a/ui/app.nw b/ui/nodejs-webkit/app.nw similarity index 100% rename from ui/app.nw rename to ui/nodejs-webkit/app.nw diff --git a/ui/package.json b/ui/nodejs-webkit/package.json similarity index 100% rename from ui/package.json rename to ui/nodejs-webkit/package.json diff --git a/ui/redirect.html b/ui/nodejs-webkit/redirect.html similarity index 100% rename from ui/redirect.html rename to ui/nodejs-webkit/redirect.html diff --git a/ui/bootstrap/LICENSE b/ui/static/bootstrap/LICENSE similarity index 100% rename from ui/bootstrap/LICENSE rename to ui/static/bootstrap/LICENSE diff --git a/ui/bootstrap/css/bootstrap-theme.css b/ui/static/bootstrap/css/bootstrap-theme.css similarity index 100% rename from ui/bootstrap/css/bootstrap-theme.css rename to ui/static/bootstrap/css/bootstrap-theme.css diff --git a/ui/bootstrap/css/bootstrap-theme.min.css b/ui/static/bootstrap/css/bootstrap-theme.min.css similarity index 100% rename from ui/bootstrap/css/bootstrap-theme.min.css rename to ui/static/bootstrap/css/bootstrap-theme.min.css diff --git a/ui/bootstrap/css/bootstrap.css b/ui/static/bootstrap/css/bootstrap.css similarity index 100% rename from ui/bootstrap/css/bootstrap.css rename to ui/static/bootstrap/css/bootstrap.css diff --git a/ui/bootstrap/css/bootstrap.min.css b/ui/static/bootstrap/css/bootstrap.min.css similarity index 100% rename from ui/bootstrap/css/bootstrap.min.css rename to ui/static/bootstrap/css/bootstrap.min.css diff --git a/ui/bootstrap/fonts/glyphicons-halflings-regular.eot b/ui/static/bootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from ui/bootstrap/fonts/glyphicons-halflings-regular.eot rename to ui/static/bootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/ui/bootstrap/fonts/glyphicons-halflings-regular.svg b/ui/static/bootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from ui/bootstrap/fonts/glyphicons-halflings-regular.svg rename to ui/static/bootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/ui/bootstrap/fonts/glyphicons-halflings-regular.ttf b/ui/static/bootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from ui/bootstrap/fonts/glyphicons-halflings-regular.ttf rename to ui/static/bootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/ui/bootstrap/fonts/glyphicons-halflings-regular.woff b/ui/static/bootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from ui/bootstrap/fonts/glyphicons-halflings-regular.woff rename to ui/static/bootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/ui/bootstrap/js/bootstrap.js b/ui/static/bootstrap/js/bootstrap.js similarity index 100% rename from ui/bootstrap/js/bootstrap.js rename to ui/static/bootstrap/js/bootstrap.js diff --git a/ui/bootstrap/js/bootstrap.min.js b/ui/static/bootstrap/js/bootstrap.min.js similarity index 100% rename from ui/bootstrap/js/bootstrap.min.js rename to ui/static/bootstrap/js/bootstrap.min.js diff --git a/ui/index.css b/ui/static/index.css similarity index 100% rename from ui/index.css rename to ui/static/index.css diff --git a/ui/index.html b/ui/templates/index.html similarity index 91% rename from ui/index.html rename to ui/templates/index.html index 75c0f06..da3731e 100644 --- a/ui/index.html +++ b/ui/templates/index.html @@ -7,8 +7,8 @@ namebench (v2 alpha) - - + + diff --git a/ui/ui.go b/ui/ui.go index 8e9d997..cb43df7 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -26,12 +26,13 @@ const ( ) var ( - indexTmpl = loadTemplate("ui/index.html") + indexTmpl = loadTemplate("ui/templates/index.html") ) // RegisterHandler registers all known handlers. func RegisterHandlers() { http.HandleFunc("/", Index) + http.Handle("/static/", http.StripPrefix("/static", http.FileServer(http.Dir("ui/static")))) http.HandleFunc("/submit", Submit) }