mirror of https://github.com/perkeep/perkeep.git
Adds less (CSS processor) v1.7.4 (Apache v2)
Change-Id: I364e46d395c0752df8c585a5aeab3aa9a289162c
This commit is contained in:
parent
37e38ad8b9
commit
ffb660b54d
2
make.go
2
make.go
|
@ -391,7 +391,7 @@ func buildSrcPath(fromSrc string) string {
|
||||||
// kept in between runs.
|
// kept in between runs.
|
||||||
func genEmbeds() error {
|
func genEmbeds() error {
|
||||||
cmdName := exeName(filepath.Join(buildGoPath, "bin", "genfileembed"))
|
cmdName := exeName(filepath.Join(buildGoPath, "bin", "genfileembed"))
|
||||||
for _, embeds := range []string{"server/camlistored/ui", "pkg/server", "third_party/react", "third_party/glitch", "third_party/fontawesome", "app/publisher"} {
|
for _, embeds := range []string{"server/camlistored/ui", "pkg/server", "third_party/react", "third_party/less", "third_party/glitch", "third_party/fontawesome", "app/publisher"} {
|
||||||
embeds := buildSrcPath(embeds)
|
embeds := buildSrcPath(embeds)
|
||||||
args := []string{"--output-files-stderr", embeds}
|
args := []string{"--output-files-stderr", embeds}
|
||||||
cmd := exec.Command(cmdName, args...)
|
cmd := exec.Command(cmdName, args...)
|
||||||
|
|
|
@ -47,10 +47,11 @@ import (
|
||||||
fontawesomestatic "camlistore.org/third_party/fontawesome"
|
fontawesomestatic "camlistore.org/third_party/fontawesome"
|
||||||
glitchstatic "camlistore.org/third_party/glitch"
|
glitchstatic "camlistore.org/third_party/glitch"
|
||||||
reactstatic "camlistore.org/third_party/react"
|
reactstatic "camlistore.org/third_party/react"
|
||||||
|
lessstatic "camlistore.org/third_party/less"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
staticFilePattern = regexp.MustCompile(`^([a-zA-Z0-9\-\_]+\.(html|js|css|png|jpg|gif|svg))$`)
|
staticFilePattern = regexp.MustCompile(`^([a-zA-Z0-9\-\_\.]+\.(html|js|css|png|jpg|gif|svg))$`)
|
||||||
identOrDotPattern = regexp.MustCompile(`^[a-zA-Z\_]+(\.[a-zA-Z\_]+)*$`)
|
identOrDotPattern = regexp.MustCompile(`^[a-zA-Z\_]+(\.[a-zA-Z\_]+)*$`)
|
||||||
|
|
||||||
// Download URL suffix:
|
// Download URL suffix:
|
||||||
|
@ -62,6 +63,7 @@ var (
|
||||||
thumbnailPattern = regexp.MustCompile(`^thumbnail/([^/]+)(/.*)?$`)
|
thumbnailPattern = regexp.MustCompile(`^thumbnail/([^/]+)(/.*)?$`)
|
||||||
treePattern = regexp.MustCompile(`^tree/([^/]+)(/.*)?$`)
|
treePattern = regexp.MustCompile(`^tree/([^/]+)(/.*)?$`)
|
||||||
closurePattern = regexp.MustCompile(`^closure/(([^/]+)(/.*)?)$`)
|
closurePattern = regexp.MustCompile(`^closure/(([^/]+)(/.*)?)$`)
|
||||||
|
lessPattern = regexp.MustCompile(`^less/(.+)$`)
|
||||||
reactPattern = regexp.MustCompile(`^react/(.+)$`)
|
reactPattern = regexp.MustCompile(`^react/(.+)$`)
|
||||||
fontawesomePattern = regexp.MustCompile(`^fontawesome/(.+)$`)
|
fontawesomePattern = regexp.MustCompile(`^fontawesome/(.+)$`)
|
||||||
glitchPattern = regexp.MustCompile(`^glitch/(.+)$`)
|
glitchPattern = regexp.MustCompile(`^glitch/(.+)$`)
|
||||||
|
@ -101,6 +103,7 @@ type UIHandler struct {
|
||||||
uiDir string // if sourceRoot != "", this is sourceRoot+"/server/camlistored/ui"
|
uiDir string // if sourceRoot != "", this is sourceRoot+"/server/camlistored/ui"
|
||||||
|
|
||||||
closureHandler http.Handler
|
closureHandler http.Handler
|
||||||
|
fileLessHandler http.Handler
|
||||||
fileReactHandler http.Handler
|
fileReactHandler http.Handler
|
||||||
fileFontawesomeHandler http.Handler
|
fileFontawesomeHandler http.Handler
|
||||||
fileGlitchHandler http.Handler
|
fileGlitchHandler http.Handler
|
||||||
|
@ -440,6 +443,8 @@ func (ui *UIHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
ui.serveQR(rw, req)
|
ui.serveQR(rw, req)
|
||||||
case getSuffixMatches(req, closurePattern):
|
case getSuffixMatches(req, closurePattern):
|
||||||
ui.serveClosure(rw, req)
|
ui.serveClosure(rw, req)
|
||||||
|
case getSuffixMatches(req, lessPattern):
|
||||||
|
ui.serveFromDiskOrStatic(rw, req, lessPattern, ui.fileLessHandler, lessstatic.Files)
|
||||||
case getSuffixMatches(req, reactPattern):
|
case getSuffixMatches(req, reactPattern):
|
||||||
ui.serveFromDiskOrStatic(rw, req, reactPattern, ui.fileReactHandler, reactstatic.Files)
|
ui.serveFromDiskOrStatic(rw, req, reactPattern, ui.fileReactHandler, reactstatic.Files)
|
||||||
case getSuffixMatches(req, glitchPattern):
|
case getSuffixMatches(req, glitchPattern):
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
Copyright 2014 The Camlistore Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package less provides the LESS CSS framework/rewriter.
|
||||||
|
|
||||||
|
See http://lesscss.org/
|
||||||
|
|
||||||
|
#fileembed pattern .*\.js$
|
||||||
|
*/
|
||||||
|
package less
|
||||||
|
|
||||||
|
import "camlistore.org/pkg/fileembed"
|
||||||
|
|
||||||
|
var Files = &fileembed.Files{}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue