updates :)

This commit is contained in:
Henrique Dias
2016-06-30 22:37:52 +01:00
parent 30f077803b
commit 15e48bfad9
18 changed files with 124 additions and 694 deletions

View File

@@ -1,6 +1,8 @@
// Code generated by go-bindata.
// sources:
// assets/.jsbeautifyrc
// assets/assets.go
// assets/binary.go
// assets/public/css/styles.css
// assets/public/js/application.js
// assets/public/js/form2js.js
@@ -9,6 +11,7 @@
// assets/templates/editor.tmpl
// assets/templates/frontmatter.tmpl
// assets/templates/listing.tmpl
// assets/templates/minimal.tmpl
// assets/templates/single.tmpl
// DO NOT EDIT!
@@ -54,6 +57,42 @@ func Jsbeautifyrc() (*asset, error) {
return a, err
}
// assetsGo reads file data from disk. It returns an error on failure.
func assetsGo() (*asset, error) {
path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\assets.go"
name := "assets.go"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// binaryGo reads file data from disk. It returns an error on failure.
func binaryGo() (*asset, error) {
path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\binary.go"
name := "binary.go"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// publicCssStylesCss reads file data from disk. It returns an error on failure.
func publicCssStylesCss() (*asset, error) {
path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\public\\css\\styles.css"
@@ -198,6 +237,24 @@ func templatesListingTmpl() (*asset, error) {
return a, err
}
// templatesMinimalTmpl reads file data from disk. It returns an error on failure.
func templatesMinimalTmpl() (*asset, error) {
path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\minimal.tmpl"
name := "templates/minimal.tmpl"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// templatesSingleTmpl reads file data from disk. It returns an error on failure.
func templatesSingleTmpl() (*asset, error) {
path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\single.tmpl"
@@ -268,16 +325,19 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
".jsbeautifyrc": Jsbeautifyrc,
"public/css/styles.css": publicCssStylesCss,
"public/js/application.js": publicJsApplicationJs,
"public/js/form2js.js": publicJsForm2jsJs,
"templates/actions.tmpl": templatesActionsTmpl,
"templates/base.tmpl": templatesBaseTmpl,
"templates/editor.tmpl": templatesEditorTmpl,
".jsbeautifyrc": Jsbeautifyrc,
"assets.go": assetsGo,
"binary.go": binaryGo,
"public/css/styles.css": publicCssStylesCss,
"public/js/application.js": publicJsApplicationJs,
"public/js/form2js.js": publicJsForm2jsJs,
"templates/actions.tmpl": templatesActionsTmpl,
"templates/base.tmpl": templatesBaseTmpl,
"templates/editor.tmpl": templatesEditorTmpl,
"templates/frontmatter.tmpl": templatesFrontmatterTmpl,
"templates/listing.tmpl": templatesListingTmpl,
"templates/single.tmpl": templatesSingleTmpl,
"templates/listing.tmpl": templatesListingTmpl,
"templates/minimal.tmpl": templatesMinimalTmpl,
"templates/single.tmpl": templatesSingleTmpl,
}
// AssetDir returns the file names below a certain
@@ -319,25 +379,27 @@ type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
".jsbeautifyrc": &bintree{Jsbeautifyrc, map[string]*bintree{}},
"assets.go": &bintree{assetsGo, map[string]*bintree{}},
"binary.go": &bintree{binaryGo, map[string]*bintree{}},
"public": &bintree{nil, map[string]*bintree{
"css": &bintree{nil, map[string]*bintree{
"styles.css": &bintree{publicCssStylesCss, map[string]*bintree{}},
}},
"js": &bintree{nil, map[string]*bintree{
"application.js": &bintree{publicJsApplicationJs, map[string]*bintree{}},
"form2js.js": &bintree{publicJsForm2jsJs, map[string]*bintree{}},
"form2js.js": &bintree{publicJsForm2jsJs, map[string]*bintree{}},
}},
}},
"templates": &bintree{nil, map[string]*bintree{
"actions.tmpl": &bintree{templatesActionsTmpl, map[string]*bintree{}},
"base.tmpl": &bintree{templatesBaseTmpl, map[string]*bintree{}},
"editor.tmpl": &bintree{templatesEditorTmpl, map[string]*bintree{}},
"actions.tmpl": &bintree{templatesActionsTmpl, map[string]*bintree{}},
"base.tmpl": &bintree{templatesBaseTmpl, map[string]*bintree{}},
"editor.tmpl": &bintree{templatesEditorTmpl, map[string]*bintree{}},
"frontmatter.tmpl": &bintree{templatesFrontmatterTmpl, map[string]*bintree{}},
"listing.tmpl": &bintree{templatesListingTmpl, map[string]*bintree{}},
"single.tmpl": &bintree{templatesSingleTmpl, map[string]*bintree{}},
"listing.tmpl": &bintree{templatesListingTmpl, map[string]*bintree{}},
"minimal.tmpl": &bintree{templatesMinimalTmpl, map[string]*bintree{}},
"single.tmpl": &bintree{templatesSingleTmpl, map[string]*bintree{}},
}},
}}
@@ -387,3 +449,4 @@ func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

View File

@@ -555,24 +555,30 @@ header #search div {
opacity: 0;
}
header #search ::-webkit-input-placeholder {
header #search.active div i {
color: #ccc;
display: block;
text-align: center;
}
header #search::-webkit-input-placeholder {
/* WebKit, Blink, Edge */
color: rgba(255, 255, 255, .5);
}
header #search :-moz-placeholder {
header #search:-moz-placeholder {
opacity: 1;
/* Mozilla Firefox 4 to 18 */
color: rgba(255, 255, 255, .5);
}
header #search ::-moz-placeholder {
header #search::-moz-placeholder {
opacity: 1;
/* Mozilla Firefox 19+ */
color: rgba(255, 255, 255, .5);
}
header #search :-ms-input-placeholder {
header #search:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: rgba(255, 255, 255, .5);
}

View File

@@ -171,6 +171,23 @@ var RemoveLastDirectoryPartOf = function(url) {
* *
* * * * * * * * * * * * * * * */
var reloadListing = function() {
let request = new XMLHttpRequest();
request.open('GET', window.location);
request.setRequestHeader('Minimal', 'true');
request.send();
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200) {
document.querySelector('body main').innerHTML = request.responseText;
// Handle date times
let timeList = document.getElementsByTagName("time");
Array.from(timeList).forEach(localizeDatetime);
}
}
}
}
// Rename file event
var renameEvent = function(event) {
if (this.classList.contains('disabled') || !selectedItems.length) {
@@ -261,7 +278,7 @@ var handleFiles = function(files) {
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200) {
history.go(0);
reloadListing();
}
button.changeToDone((request.status != 200), html);
@@ -370,7 +387,7 @@ var newDirEvent = function(event) {
request.onreadystatechange = function() {
if (request.readyState == 4) {
button.changeToDone((request.status != 200), html);
history.go(0);
reloadListing();
}
}
@@ -422,6 +439,8 @@ var searchEvent = function(event) {
box.innerHTML = "Press enter to continue."
if (event.keyCode == 13) {
box.innerHTML = '<i class="material-icons spin">autorenew</i>';
let request = new XMLHttpRequest();
request.open('POST', window.location);
request.setRequestHeader('Command', value);
@@ -441,6 +460,7 @@ var searchEvent = function(event) {
text = text.substring(1, text.length - 1);
text = text.replace('\\n', "\n");
box.innerHTML = text;
reloadListing();
}
}
}
@@ -769,4 +789,4 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
return false;
});
});

View File

@@ -0,0 +1 @@
{{ template "content" .Data }}