Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8863ec90b | ||
|
|
3ed5a64cef | ||
|
|
013c24733e | ||
|
|
d9d6fb656a | ||
|
|
eb72c5d959 |
No files matched your search
@@ -1,2 +1,3 @@
|
||||
testdata/
|
||||
.github/
|
||||
.git/
|
||||
@@ -38,11 +38,7 @@ func Parse(c *caddy.Controller, plugin string) ([]*filebrowser.FileBrowser, erro
|
||||
Commands: []string{"git", "svn", "hg"},
|
||||
CSS: "",
|
||||
ViewMode: "mosaic",
|
||||
Rules: []*filebrowser.Rule{{
|
||||
Regex: true,
|
||||
Allow: false,
|
||||
Regexp: &filebrowser.Regexp{Raw: "\\/\\..+"},
|
||||
}},
|
||||
Rules: []*filebrowser.Rule{},
|
||||
}
|
||||
|
||||
baseURL := "/"
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
const (
|
||||
// Version is the current File Browser version.
|
||||
Version = "1.8.0"
|
||||
Version = "1.9.0"
|
||||
|
||||
ListViewMode = "list"
|
||||
MosaicViewMode = "mosaic"
|
||||
|
||||
+8
-8
@@ -147,9 +147,9 @@ var (
|
||||
type condition func(path string) bool
|
||||
|
||||
type searchOptions struct {
|
||||
CaseInsensitive bool
|
||||
Conditions []condition
|
||||
Terms []string
|
||||
CaseSensitive bool
|
||||
Conditions []condition
|
||||
Terms []string
|
||||
}
|
||||
|
||||
func extensionCondition(extension string) condition {
|
||||
@@ -181,9 +181,9 @@ func videoCondition(path string) bool {
|
||||
|
||||
func parseSearch(value string) *searchOptions {
|
||||
opts := &searchOptions{
|
||||
CaseInsensitive: strings.Contains(value, "case:insensitive"),
|
||||
Conditions: []condition{},
|
||||
Terms: []string{},
|
||||
CaseSensitive: strings.Contains(value, "case:sensitive"),
|
||||
Conditions: []condition{},
|
||||
Terms: []string{},
|
||||
}
|
||||
|
||||
// removes the options from the value
|
||||
@@ -215,7 +215,7 @@ func parseSearch(value string) *searchOptions {
|
||||
}
|
||||
|
||||
// If it's canse insensitive, put everything in lowercase.
|
||||
if opts.CaseInsensitive {
|
||||
if !opts.CaseSensitive {
|
||||
value = strings.ToLower(value)
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ func search(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error)
|
||||
scope = filepath.Clean(scope)
|
||||
|
||||
err = filepath.Walk(scope, func(path string, f os.FileInfo, err error) error {
|
||||
if search.CaseInsensitive {
|
||||
if !search.CaseSensitive {
|
||||
path = strings.ToLower(path)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
"author": "File Browser contributors",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"filebrowser-frontend": "1.5.0"
|
||||
"filebrowser-frontend": "1.6.0"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
a48cd194336986773da16bd667eb3dbb17ad9b2c
|
||||
5df38dbe052d7325c543606612fe6f4d9a1cdb98
|
||||
Reference in new issue
Block a user