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