diff --git a/.babelrc b/.babelrc
index a2a58cff..4595f772 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,13 +1,13 @@
-{
- "presets": [
- ["env", { "modules": false }],
- "stage-2"
- ],
- "plugins": ["transform-runtime"],
- "env": {
- "test": {
- "presets": ["env", "stage-2"],
- "plugins": [ "istanbul" ]
- }
- }
-}
+{
+ "presets": [
+ ["env", { "modules": false }],
+ "stage-2"
+ ],
+ "plugins": ["transform-runtime"],
+ "env": {
+ "test": {
+ "presets": ["env", "stage-2"],
+ "plugins": [ "istanbul" ]
+ }
+ }
+}
diff --git a/.dockerignore b/.dockerignore
index 8f664b3d..ac45b0ea 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,4 @@
-assets/
-testdata/
-caddy/
-.github/
+assets/
+testdata/
+caddy/
+.github/
diff --git a/.editorconfig b/.editorconfig
index a34668e5..2043e3a3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,14 +1,14 @@
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-# 4 space indentation
-[*.go]
-indent_style = tab
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# 4 space indentation
+[*.go]
+indent_style = tab
indent_size = 4
\ No newline at end of file
diff --git a/.eslintignore b/.eslintignore
index 34af3774..c8cd7690 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,2 +1,2 @@
-build/*.js
-config/*.js
+build/*.js
+config/*.js
diff --git a/.eslintrc.js b/.eslintrc.js
index 67c085d6..74d59e4f 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,27 +1,27 @@
-// http://eslint.org/docs/user-guide/configuring
-
-module.exports = {
- root: true,
- parser: 'babel-eslint',
- parserOptions: {
- sourceType: 'module'
- },
- env: {
- browser: true,
- },
- // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
- extends: 'standard',
- // required to lint *.vue files
- plugins: [
- 'html'
- ],
- // add your custom rules here
- 'rules': {
- // allow paren-less arrow functions
- 'arrow-parens': 0,
- // allow async-await
- 'generator-star-spacing': 0,
- // allow debugger during development
- 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
- }
-}
+// http://eslint.org/docs/user-guide/configuring
+
+module.exports = {
+ root: true,
+ parser: 'babel-eslint',
+ parserOptions: {
+ sourceType: 'module'
+ },
+ env: {
+ browser: true,
+ },
+ // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
+ extends: 'standard',
+ // required to lint *.vue files
+ plugins: [
+ 'html'
+ ],
+ // add your custom rules here
+ 'rules': {
+ // allow paren-less arrow functions
+ 'arrow-parens': 0,
+ // allow async-await
+ 'generator-star-spacing': 0,
+ // allow debugger during development
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
+ }
+}
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index ad3cfc9a..f361c61a 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -1,24 +1,24 @@
-### Instructions (remove before submitting):
-
-1. Are you asking for help with using Caddy or File Manager? Please use our forum instead: https://forum.caddyserver.com.
-2. If you are filing a bug report, please answer the following questions.
-3. If your issue is not a bug report, you do not need to use this template.
-4. If not using with Caddy, ignore questions 1 and 2.
-
-### 1. Have you downloaded File Manager from caddyserver.com? If yes, when have you done that? If no, and you are running a custom build, which is the revision of File Manager's repository?
-
-### 2. What is your entire Caddyfile?
-```text
-(Put Caddyfile here)
-```
-
-### 3. What are you trying to do?
-
-
-### 4. What did you expect to see?
-
-
-### 5. What did you see instead (give full error messages and/or log)?
-
-
-### 6. How can someone who is starting from scratch reproduce this behaviour as minimally as possible?
+### Instructions (remove before submitting):
+
+1. Are you asking for help with using Caddy or File Manager? Please use our forum instead: https://forum.caddyserver.com.
+2. If you are filing a bug report, please answer the following questions.
+3. If your issue is not a bug report, you do not need to use this template.
+4. If not using with Caddy, ignore questions 1 and 2.
+
+### 1. Have you downloaded File Manager from caddyserver.com? If yes, when have you done that? If no, and you are running a custom build, which is the revision of File Manager's repository?
+
+### 2. What is your entire Caddyfile?
+```text
+(Put Caddyfile here)
+```
+
+### 3. What are you trying to do?
+
+
+### 4. What did you expect to see?
+
+
+### 5. What did you see instead (give full error messages and/or log)?
+
+
+### 6. How can someone who is starting from scratch reproduce this behaviour as minimally as possible?
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 6231c26b..779b2222 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -1,29 +1,29 @@
-build:
- main: cmd/filemanager/main.go
- binary: filemanager
- goos:
- - darwin
- - linux
- - windows
- - freebsd
- - netbsd
- - openbsd
- goarch:
- - amd64
- - 386
- - arm
- - arm64
- ignore:
- - goos: openbsd
- goarch: arm
- goarm: 6
- - goos: freebsd
- goarch: arm
- goarm: 6
-
-archive:
- name_template: "{{.Os}}-{{.Arch}}-{{ .ProjectName }}"
- format: tar.gz
- format_overrides:
- - goos: windows
- format: zip
+build:
+ main: cmd/filemanager/main.go
+ binary: filemanager
+ goos:
+ - darwin
+ - linux
+ - windows
+ - freebsd
+ - netbsd
+ - openbsd
+ goarch:
+ - amd64
+ - 386
+ - arm
+ - arm64
+ ignore:
+ - goos: openbsd
+ goarch: arm
+ goarm: 6
+ - goos: freebsd
+ goarch: arm
+ goarm: 6
+
+archive:
+ name_template: "{{.Os}}-{{.Arch}}-{{ .ProjectName }}"
+ format: tar.gz
+ format_overrides:
+ - goos: windows
+ format: zip
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index f0cc78e8..883952d3 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,46 +1,46 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hacdias@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hacdias@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fe47ed8e..813a4fb1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,14 +1,14 @@
-# Contributing
-
-If you want to contribute or want to build the code from source, you will need to have the most recent version of Go and, if you want to change the static assets (JS, CSS, ...), Node.js installed on your computer. To start developing, you just need to do the following:
-
-1. `go get github.com/hacdias/filemanager`
-2. `cd $GOPATH/src/github.com/hacdias/filemanager`
-3. `npm install`
-4. `npm run dev` - regenerates the static assets automatically
-5. `go install github.com/hacdias/filemanager/cmd/filemanager`
-6. Execute `$GOPATH/bin/filemanager`
-
-The steps 3 and 4 are only required **if you want to develop the front-end**. Otherwise, you can ignore them. Before pulling, if you made any change on assets folder, you must run the `build.sh` script on the root of this repository.
-
-If you are using this as a Caddy plugin, you should use its [official instructions for plugins](https://github.com/mholt/caddy/wiki/Extending-Caddy#2-plug-in-your-plugin) and import `github.com/hacdias/filemanager/caddy/filemanager`.
+# Contributing
+
+If you want to contribute or want to build the code from source, you will need to have the most recent version of Go and, if you want to change the static assets (JS, CSS, ...), Node.js installed on your computer. To start developing, you just need to do the following:
+
+1. `go get github.com/hacdias/filemanager`
+2. `cd $GOPATH/src/github.com/hacdias/filemanager`
+3. `npm install`
+4. `npm run dev` - regenerates the static assets automatically
+5. `go install github.com/hacdias/filemanager/cmd/filemanager`
+6. Execute `$GOPATH/bin/filemanager`
+
+The steps 3 and 4 are only required **if you want to develop the front-end**. Otherwise, you can ignore them. Before pulling, if you made any change on assets folder, you must run the `build.sh` script on the root of this repository.
+
+If you are using this as a Caddy plugin, you should use its [official instructions for plugins](https://github.com/mholt/caddy/wiki/Extending-Caddy#2-plug-in-your-plugin) and import `github.com/hacdias/filemanager/caddy/filemanager`.
diff --git a/Dockerfile b/Dockerfile
index ca676980..d5d3b8e7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,22 +1,22 @@
-FROM golang:alpine
-
-COPY . /go/src/github.com/hacdias/filemanager
-
-WORKDIR /go/src/github.com/hacdias/filemanager
-RUN apk add --no-cache git
-RUN go get ./...
-
-WORKDIR /go/src/github.com/hacdias/filemanager/cmd/filemanager
-RUN CGO_ENABLED=0 go build -a
-RUN mv filemanager /go/bin/filemanager
-
-FROM scratch
-COPY --from=0 /go/bin/filemanager /filemanager
-
-VOLUME /srv
-EXPOSE 80
-
-COPY Docker.json /config.json
-
-ENTRYPOINT ["/filemanager"]
-CMD ["--config", "/config.json"]
+FROM golang:alpine
+
+COPY . /go/src/github.com/hacdias/filemanager
+
+WORKDIR /go/src/github.com/hacdias/filemanager
+RUN apk add --no-cache git
+RUN go get ./...
+
+WORKDIR /go/src/github.com/hacdias/filemanager/cmd/filemanager
+RUN CGO_ENABLED=0 go build -a
+RUN mv filemanager /go/bin/filemanager
+
+FROM scratch
+COPY --from=0 /go/bin/filemanager /filemanager
+
+VOLUME /srv
+EXPOSE 80
+
+COPY Docker.json /config.json
+
+ENTRYPOINT ["/filemanager"]
+CMD ["--config", "/config.json"]
diff --git a/LICENSE.md b/LICENSE.md
index 5e0fd33c..48d49423 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,201 +1,201 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction,
-and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by
-the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all
-other entities that control, are controlled by, or are under common
-control with that entity. For the purposes of this definition,
-"control" means (i) the power, direct or indirect, to cause the
-direction or management of such entity, whether by contract or
-otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity
-exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications,
-including but not limited to software source code, documentation
-source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical
-transformation or translation of a Source form, including but
-not limited to compiled object code, generated documentation,
-and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or
-Object form, made available under the License, as indicated by a
-copyright notice that is included in or attached to the work
-(an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object
-form, that is based on (or derived from) the Work and for which the
-editorial revisions, annotations, elaborations, or other modifications
-represent, as a whole, an original work of authorship. For the purposes
-of this License, Derivative Works shall not include works that remain
-separable from, or merely link (or bind by name) to the interfaces of,
-the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including
-the original version of the Work and any modifications or additions
-to that Work or Derivative Works thereof, that is intentionally
-submitted to Licensor for inclusion in the Work by the copyright owner
-or by an individual or Legal Entity authorized to submit on behalf of
-the copyright owner. For the purposes of this definition, "submitted"
-means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems,
-and issue tracking systems that are managed by, or on behalf of, the
-Licensor for the purpose of discussing and improving the Work, but
-excluding communication that is conspicuously marked or otherwise
-designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity
-on behalf of whom a Contribution has been received by Licensor and
-subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the
-Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-(except as stated in this section) patent license to make, have made,
-use, offer to sell, sell, import, and otherwise transfer the Work,
-where such license applies only to those patent claims licensable
-by such Contributor that are necessarily infringed by their
-Contribution(s) alone or by combination of their Contribution(s)
-with the Work to which such Contribution(s) was submitted. If You
-institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work
-or a Contribution incorporated within the Work constitutes direct
-or contributory patent infringement, then any patent licenses
-granted to You under this License for that Work shall terminate
-as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
-Work or Derivative Works thereof in any medium, with or without
-modifications, and in Source or Object form, provided that You
-meet the following conditions:
-
-(a) You must give any other recipients of the Work or
-Derivative Works a copy of this License; and
-
-(b) You must cause any modified files to carry prominent notices
-stating that You changed the files; and
-
-(c) You must retain, in the Source form of any Derivative Works
-that You distribute, all copyright, patent, trademark, and
-attribution notices from the Source form of the Work,
-excluding those notices that do not pertain to any part of
-the Derivative Works; and
-
-(d) If the Work includes a "NOTICE" text file as part of its
-distribution, then any Derivative Works that You distribute must
-include a readable copy of the attribution notices contained
-within such NOTICE file, excluding those notices that do not
-pertain to any part of the Derivative Works, in at least one
-of the following places: within a NOTICE text file distributed
-as part of the Derivative Works; within the Source form or
-documentation, if provided along with the Derivative Works; or,
-within a display generated by the Derivative Works, if and
-wherever such third-party notices normally appear. The contents
-of the NOTICE file are for informational purposes only and
-do not modify the License. You may add Your own attribution
-notices within Derivative Works that You distribute, alongside
-or as an addendum to the NOTICE text from the Work, provided
-that such additional attribution notices cannot be construed
-as modifying the License.
-
-You may add Your own copyright statement to Your modifications and
-may provide additional or different license terms and conditions
-for use, reproduction, or distribution of Your modifications, or
-for any such Derivative Works as a whole, provided Your use,
-reproduction, and distribution of the Work otherwise complies with
-the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
-any Contribution intentionally submitted for inclusion in the Work
-by You to the Licensor shall be under the terms and conditions of
-this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify
-the terms of any separate license agreement you may have executed
-with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
-names, trademarks, service marks, or product names of the Licensor,
-except as required for reasonable and customary use in describing the
-origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
-agreed to in writing, Licensor provides the Work (and each
-Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied, including, without limitation, any warranties or conditions
-of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-PARTICULAR PURPOSE. You are solely responsible for determining the
-appropriateness of using or redistributing the Work and assume any
-risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
-whether in tort (including negligence), contract, or otherwise,
-unless required by applicable law (such as deliberate and grossly
-negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special,
-incidental, or consequential damages of any character arising as a
-result of this License or out of the use or inability to use the
-Work (including but not limited to damages for loss of goodwill,
-work stoppage, computer failure or malfunction, or any and all
-other commercial damages or losses), even if such Contributor
-has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
-the Work or Derivative Works thereof, You may choose to offer,
-and charge a fee for, acceptance of support, warranty, indemnity,
-or other liability obligations and/or rights consistent with this
-License. However, in accepting such obligations, You may act only
-on Your own behalf and on Your sole responsibility, not on behalf
-of any other Contributor, and only if You agree to indemnify,
-defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason
-of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
-To apply the Apache License to your work, attach the following
-boilerplate notice, with the fields enclosed by brackets "{}"
-replaced with your own identifying information. (Don't include
-the brackets!) The text should be enclosed in the appropriate
-comment syntax for the file format. We also recommend that a
-file or class name and description of purpose be included on the
-same "printed page" as the copyright notice for easier
-identification within third-party archives.
-
-Copyright {yyyy} {name of copyright owner}
-
-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.
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all
+other entities that control, are controlled by, or are under common
+control with that entity. For the purposes of this definition,
+"control" means (i) the power, direct or indirect, to cause the
+direction or management of such entity, whether by contract or
+otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation
+source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a
+copyright notice that is included in or attached to the work
+(an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object
+form, that is based on (or derived from) the Work and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship. For the purposes
+of this License, Derivative Works shall not include works that remain
+separable from, or merely link (or bind by name) to the interfaces of,
+the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including
+the original version of the Work and any modifications or additions
+to that Work or Derivative Works thereof, that is intentionally
+submitted to Licensor for inclusion in the Work by the copyright owner
+or by an individual or Legal Entity authorized to submit on behalf of
+the copyright owner. For the purposes of this definition, "submitted"
+means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems,
+and issue tracking systems that are managed by, or on behalf of, the
+Licensor for the purpose of discussing and improving the Work, but
+excluding communication that is conspicuously marked or otherwise
+designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work,
+where such license applies only to those patent claims licensable
+by such Contributor that are necessarily infringed by their
+Contribution(s) alone or by combination of their Contribution(s)
+with the Work to which such Contribution(s) was submitted. If You
+institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work
+or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses
+granted to You under this License for that Work shall terminate
+as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+Work or Derivative Works thereof in any medium, with or without
+modifications, and in Source or Object form, provided that You
+meet the following conditions:
+
+(a) You must give any other recipients of the Work or
+Derivative Works a copy of this License; and
+
+(b) You must cause any modified files to carry prominent notices
+stating that You changed the files; and
+
+(c) You must retain, in the Source form of any Derivative Works
+that You distribute, all copyright, patent, trademark, and
+attribution notices from the Source form of the Work,
+excluding those notices that do not pertain to any part of
+the Derivative Works; and
+
+(d) If the Work includes a "NOTICE" text file as part of its
+distribution, then any Derivative Works that You distribute must
+include a readable copy of the attribution notices contained
+within such NOTICE file, excluding those notices that do not
+pertain to any part of the Derivative Works, in at least one
+of the following places: within a NOTICE text file distributed
+as part of the Derivative Works; within the Source form or
+documentation, if provided along with the Derivative Works; or,
+within a display generated by the Derivative Works, if and
+wherever such third-party notices normally appear. The contents
+of the NOTICE file are for informational purposes only and
+do not modify the License. You may add Your own attribution
+notices within Derivative Works that You distribute, alongside
+or as an addendum to the NOTICE text from the Work, provided
+that such additional attribution notices cannot be construed
+as modifying the License.
+
+You may add Your own copyright statement to Your modifications and
+may provide additional or different license terms and conditions
+for use, reproduction, or distribution of Your modifications, or
+for any such Derivative Works as a whole, provided Your use,
+reproduction, and distribution of the Work otherwise complies with
+the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "{}"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+Copyright {yyyy} {name of copyright owner}
+
+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.
diff --git a/README.md b/README.md
index d548c397..35d0088b 100644
--- a/README.md
+++ b/README.md
@@ -1,78 +1,78 @@
-
-
-# filemanager
-
-[](https://travis-ci.org/hacdias/filemanager)
-[](https://goreportcard.com/report/hacdias/filemanager)
-[](http://godoc.org/github.com/hacdias/filemanager)
-
-filemanager provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
-
-# Table of contents
-
-+ [Getting started](#getting-started)
-+ [Features](#features)
- - [Users](#users)
- - [Search](#search)
-+ [Contributing](#contributing)
-+ [Donate](#donate)
-
-# Getting started
-
-You can find the Getting Started guide on the [documentation](https://henriquedias.com/filemanager/quick-start/).
-
-# Features
-
-Easy login system.
-
-
-
-Listings of your files, available in two styles: mosaic and list. You can delete, move, rename, upload and create new files, as well as directories. Single files can be downloaded directly, and multiple files as *.zip*, *.tar*, *.tar.gz*, *.tar.bz2* or *.tar.xz*.
-
-
-
-File Manager editor is powered by [Codemirror](https://codemirror.net/) and if you're working with markdown files with metadata, both parts will be separated from each other so you can focus on the content.
-
-
-
-On the settings page, a regular user can set its own custom CSS to personalize the experience and change its password. For admins, they can manage the permissions of each user, set commands which can be executed when certain events are triggered (such as before saving and after saving) and change plugin's settings.
-
-
-
-We also allow the users to search in the directories and execute commands if allowed.
-
-## Users
-
-We support multiple users and each user can have its own scope and custom stylesheet. The administrator is able to choose which permissions should be given to the users, as well as the commands they can execute. Each user also have a set of rules, in which he can be prevented or allowed to access some directories (regular expressions included!).
-
-
-
-## Search
-
-FileManager allows you to search through your files and it has some options. By default, your search will be something like this:
-
-```
-this are keywords
-```
-
-If you search for that it will look at every file that contains "this", "are" or "keywords" on their name. If you want to search for an exact term, you should surround your search by double quotes:
-
-```
-"this is the name"
-```
-
-That will search for any file that contains "this is the name" on its name. It won't search for each separated term this time.
-
-By default, every search will be case sensitive. Although, you can make a case insensitive search by adding `case:insensitive` to the search terms, like this:
-
-```
-this are keywords case:insensitive
-```
-
-# Contributing
-
-The contributing guidelines can be found [here](https://github.com/hacdias/filemanager/blob/master/CONTRIBUTING.md).
-
-# Donate
-
-Enjoying this project? You can [donate to its creator](https://henriquedias.com/donate/). He will appreciate.
+
+
+# filemanager
+
+[](https://travis-ci.org/hacdias/filemanager)
+[](https://goreportcard.com/report/hacdias/filemanager)
+[](http://godoc.org/github.com/hacdias/filemanager)
+
+filemanager provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
+
+# Table of contents
+
++ [Getting started](#getting-started)
++ [Features](#features)
+ - [Users](#users)
+ - [Search](#search)
++ [Contributing](#contributing)
++ [Donate](#donate)
+
+# Getting started
+
+You can find the Getting Started guide on the [documentation](https://henriquedias.com/filemanager/quick-start/).
+
+# Features
+
+Easy login system.
+
+
+
+Listings of your files, available in two styles: mosaic and list. You can delete, move, rename, upload and create new files, as well as directories. Single files can be downloaded directly, and multiple files as *.zip*, *.tar*, *.tar.gz*, *.tar.bz2* or *.tar.xz*.
+
+
+
+File Manager editor is powered by [Codemirror](https://codemirror.net/) and if you're working with markdown files with metadata, both parts will be separated from each other so you can focus on the content.
+
+
+
+On the settings page, a regular user can set its own custom CSS to personalize the experience and change its password. For admins, they can manage the permissions of each user, set commands which can be executed when certain events are triggered (such as before saving and after saving) and change plugin's settings.
+
+
+
+We also allow the users to search in the directories and execute commands if allowed.
+
+## Users
+
+We support multiple users and each user can have its own scope and custom stylesheet. The administrator is able to choose which permissions should be given to the users, as well as the commands they can execute. Each user also have a set of rules, in which he can be prevented or allowed to access some directories (regular expressions included!).
+
+
+
+## Search
+
+FileManager allows you to search through your files and it has some options. By default, your search will be something like this:
+
+```
+this are keywords
+```
+
+If you search for that it will look at every file that contains "this", "are" or "keywords" on their name. If you want to search for an exact term, you should surround your search by double quotes:
+
+```
+"this is the name"
+```
+
+That will search for any file that contains "this is the name" on its name. It won't search for each separated term this time.
+
+By default, every search will be case sensitive. Although, you can make a case insensitive search by adding `case:insensitive` to the search terms, like this:
+
+```
+this are keywords case:insensitive
+```
+
+# Contributing
+
+The contributing guidelines can be found [here](https://github.com/hacdias/filemanager/blob/master/CONTRIBUTING.md).
+
+# Donate
+
+Enjoying this project? You can [donate to its creator](https://henriquedias.com/donate/). He will appreciate.
diff --git a/assets/build/build.js b/assets/build/build.js
index c7c0fbdb..431f3c8f 100644
--- a/assets/build/build.js
+++ b/assets/build/build.js
@@ -1,31 +1,31 @@
-require('./check-versions')()
-
-process.env.NODE_ENV = 'production'
-
-var ora = require('ora')
-var rm = require('rimraf')
-var path = require('path')
-var chalk = require('chalk')
-var webpack = require('webpack')
-var config = require('./config')
-var webpackConfig = require('./webpack.prod.conf')
-
-var spinner = ora('building for production...')
-spinner.start()
-
-rm(path.join(config.assetsRoot, config.assetsSubDirectory), err => {
- if (err) throw err
- webpack(webpackConfig, function (err, stats) {
- spinner.stop()
- if (err) throw err
- process.stdout.write(stats.toString({
- colors: true,
- modules: false,
- children: false,
- chunks: false,
- chunkModules: false
- }) + '\n\n')
-
- console.log(chalk.cyan(' Build complete.\n'))
- })
-})
+require('./check-versions')()
+
+process.env.NODE_ENV = 'production'
+
+var ora = require('ora')
+var rm = require('rimraf')
+var path = require('path')
+var chalk = require('chalk')
+var webpack = require('webpack')
+var config = require('./config')
+var webpackConfig = require('./webpack.prod.conf')
+
+var spinner = ora('building for production...')
+spinner.start()
+
+rm(path.join(config.assetsRoot, config.assetsSubDirectory), err => {
+ if (err) throw err
+ webpack(webpackConfig, function (err, stats) {
+ spinner.stop()
+ if (err) throw err
+ process.stdout.write(stats.toString({
+ colors: true,
+ modules: false,
+ children: false,
+ chunks: false,
+ chunkModules: false
+ }) + '\n\n')
+
+ console.log(chalk.cyan(' Build complete.\n'))
+ })
+})
diff --git a/assets/build/check-versions.js b/assets/build/check-versions.js
index f9133e24..57bcf30a 100644
--- a/assets/build/check-versions.js
+++ b/assets/build/check-versions.js
@@ -1,48 +1,48 @@
-var chalk = require('chalk')
-var semver = require('semver')
-var packageConfig = require('../../package.json')
-var shell = require('shelljs')
-function exec (cmd) {
- return require('child_process').execSync(cmd).toString().trim()
-}
-
-var versionRequirements = [
- {
- name: 'node',
- currentVersion: semver.clean(process.version),
- versionRequirement: packageConfig.engines.node
- }
-]
-
-if (shell.which('npm')) {
- versionRequirements.push({
- name: 'npm',
- currentVersion: exec('npm --version'),
- versionRequirement: packageConfig.engines.npm
- })
-}
-
-module.exports = function () {
- var warnings = []
- for (var i = 0; i < versionRequirements.length; i++) {
- var mod = versionRequirements[i]
- if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
- warnings.push(mod.name + ': ' +
- chalk.red(mod.currentVersion) + ' should be ' +
- chalk.green(mod.versionRequirement)
- )
- }
- }
-
- if (warnings.length) {
- console.log('')
- console.log(chalk.yellow('To use this template, you must update following to modules:'))
- console.log()
- for (var i = 0; i < warnings.length; i++) {
- var warning = warnings[i]
- console.log(' ' + warning)
- }
- console.log()
- process.exit(1)
- }
-}
+var chalk = require('chalk')
+var semver = require('semver')
+var packageConfig = require('../../package.json')
+var shell = require('shelljs')
+function exec (cmd) {
+ return require('child_process').execSync(cmd).toString().trim()
+}
+
+var versionRequirements = [
+ {
+ name: 'node',
+ currentVersion: semver.clean(process.version),
+ versionRequirement: packageConfig.engines.node
+ }
+]
+
+if (shell.which('npm')) {
+ versionRequirements.push({
+ name: 'npm',
+ currentVersion: exec('npm --version'),
+ versionRequirement: packageConfig.engines.npm
+ })
+}
+
+module.exports = function () {
+ var warnings = []
+ for (var i = 0; i < versionRequirements.length; i++) {
+ var mod = versionRequirements[i]
+ if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
+ warnings.push(mod.name + ': ' +
+ chalk.red(mod.currentVersion) + ' should be ' +
+ chalk.green(mod.versionRequirement)
+ )
+ }
+ }
+
+ if (warnings.length) {
+ console.log('')
+ console.log(chalk.yellow('To use this template, you must update following to modules:'))
+ console.log()
+ for (var i = 0; i < warnings.length; i++) {
+ var warning = warnings[i]
+ console.log(' ' + warning)
+ }
+ console.log()
+ process.exit(1)
+ }
+}
diff --git a/assets/build/config.js b/assets/build/config.js
index 885ac29d..19e90718 100644
--- a/assets/build/config.js
+++ b/assets/build/config.js
@@ -1,26 +1,26 @@
-// see http://vuejs-templates.github.io/webpack for documentation.
-var path = require('path')
-
-module.exports = {
- index: path.resolve(__dirname, '../dist/index.html'),
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
- assetsPublicPath: '{{ .BaseURL }}/',
- build: {
- env: {
- NODE_ENV: '"production"'
- },
- productionSourceMap: true,
- // Run the build command with an extra argument to
- // View the bundle analyzer report after build finishes:
- // `npm run build --report`
- // Set to `true` or `false` to always turn it on or off
- bundleAnalyzerReport: process.env.npm_config_report
- },
- dev: {
- env: {
- NODE_ENV: '"development"'
- },
- produceSourceMap: true
- }
-}
+// see http://vuejs-templates.github.io/webpack for documentation.
+var path = require('path')
+
+module.exports = {
+ index: path.resolve(__dirname, '../dist/index.html'),
+ assetsRoot: path.resolve(__dirname, '../dist'),
+ assetsSubDirectory: 'static',
+ assetsPublicPath: '{{ .BaseURL }}/',
+ build: {
+ env: {
+ NODE_ENV: '"production"'
+ },
+ productionSourceMap: true,
+ // Run the build command with an extra argument to
+ // View the bundle analyzer report after build finishes:
+ // `npm run build --report`
+ // Set to `true` or `false` to always turn it on or off
+ bundleAnalyzerReport: process.env.npm_config_report
+ },
+ dev: {
+ env: {
+ NODE_ENV: '"development"'
+ },
+ produceSourceMap: true
+ }
+}
diff --git a/assets/build/service-worker-dev.js b/assets/build/service-worker-dev.js
index 979e1962..5b17a579 100644
--- a/assets/build/service-worker-dev.js
+++ b/assets/build/service-worker-dev.js
@@ -1,17 +1,17 @@
-// This service worker file is effectively a 'no-op' that will reset any
-// previous service worker registered for the same host:port combination.
-// In the production build, this file is replaced with an actual service worker
-// file that will precache your site's local assets.
-// See https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
-
-self.addEventListener('install', () => self.skipWaiting());
-
-self.addEventListener('activate', () => {
- self.clients.matchAll({ type: 'window' }).then(windowClients => {
- for (let windowClient of windowClients) {
- // Force open pages to refresh, so that they have a chance to load the
- // fresh navigation response from the local dev server.
- windowClient.navigate(windowClient.url);
- }
- });
+// This service worker file is effectively a 'no-op' that will reset any
+// previous service worker registered for the same host:port combination.
+// In the production build, this file is replaced with an actual service worker
+// file that will precache your site's local assets.
+// See https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
+
+self.addEventListener('install', () => self.skipWaiting());
+
+self.addEventListener('activate', () => {
+ self.clients.matchAll({ type: 'window' }).then(windowClients => {
+ for (let windowClient of windowClients) {
+ // Force open pages to refresh, so that they have a chance to load the
+ // fresh navigation response from the local dev server.
+ windowClient.navigate(windowClient.url);
+ }
+ });
});
\ No newline at end of file
diff --git a/assets/build/service-worker-prod.js b/assets/build/service-worker-prod.js
index 1179ec20..bf704fda 100644
--- a/assets/build/service-worker-prod.js
+++ b/assets/build/service-worker-prod.js
@@ -1,55 +1,55 @@
-(function() {
- 'use strict';
-
- // Check to make sure service workers are supported in the current browser,
- // and that the current page is accessed from a secure origin. Using a
- // service worker from an insecure origin will trigger JS console errors.
- const isLocalhost = Boolean(window.location.hostname === 'localhost' ||
- // [::1] is the IPv6 localhost address.
- window.location.hostname === '[::1]' ||
- // 127.0.0.1/8 is considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
- );
-
- window.addEventListener('load', function() {
- if ('serviceWorker' in navigator &&
- (window.location.protocol === 'https:' || isLocalhost)) {
- navigator.serviceWorker.register('{{ .BaseURL }}/sw.js')
- .then(function(registration) {
- // updatefound is fired if service-worker.js changes.
- registration.onupdatefound = function() {
- // updatefound is also fired the very first time the SW is installed,
- // and there's no need to prompt for a reload at that point.
- // So check here to see if the page is already controlled,
- // i.e. whether there's an existing service worker.
- if (navigator.serviceWorker.controller) {
- // The updatefound event implies that registration.installing is set
- const installingWorker = registration.installing;
-
- installingWorker.onstatechange = function() {
- switch (installingWorker.state) {
- case 'installed':
- // At this point, the old content will have been purged and the
- // fresh content will have been added to the cache.
- // It's the perfect time to display a "New content is
- // available; please refresh." message in the page's interface.
- break;
-
- case 'redundant':
- throw new Error('The installing ' +
- 'service worker became redundant.');
-
- default:
- // Ignore
- }
- };
- }
- };
- }).catch(function(e) {
- console.error('Error during service worker registration:', e);
- });
- }
- });
-})();
+(function() {
+ 'use strict';
+
+ // Check to make sure service workers are supported in the current browser,
+ // and that the current page is accessed from a secure origin. Using a
+ // service worker from an insecure origin will trigger JS console errors.
+ const isLocalhost = Boolean(window.location.hostname === 'localhost' ||
+ // [::1] is the IPv6 localhost address.
+ window.location.hostname === '[::1]' ||
+ // 127.0.0.1/8 is considered localhost for IPv4.
+ window.location.hostname.match(
+ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
+ )
+ );
+
+ window.addEventListener('load', function() {
+ if ('serviceWorker' in navigator &&
+ (window.location.protocol === 'https:' || isLocalhost)) {
+ navigator.serviceWorker.register('{{ .BaseURL }}/sw.js')
+ .then(function(registration) {
+ // updatefound is fired if service-worker.js changes.
+ registration.onupdatefound = function() {
+ // updatefound is also fired the very first time the SW is installed,
+ // and there's no need to prompt for a reload at that point.
+ // So check here to see if the page is already controlled,
+ // i.e. whether there's an existing service worker.
+ if (navigator.serviceWorker.controller) {
+ // The updatefound event implies that registration.installing is set
+ const installingWorker = registration.installing;
+
+ installingWorker.onstatechange = function() {
+ switch (installingWorker.state) {
+ case 'installed':
+ // At this point, the old content will have been purged and the
+ // fresh content will have been added to the cache.
+ // It's the perfect time to display a "New content is
+ // available; please refresh." message in the page's interface.
+ break;
+
+ case 'redundant':
+ throw new Error('The installing ' +
+ 'service worker became redundant.');
+
+ default:
+ // Ignore
+ }
+ };
+ }
+ };
+ }).catch(function(e) {
+ console.error('Error during service worker registration:', e);
+ });
+ }
+ });
+})();
diff --git a/assets/build/utils.js b/assets/build/utils.js
index 616ceb3a..09f8272a 100644
--- a/assets/build/utils.js
+++ b/assets/build/utils.js
@@ -1,70 +1,70 @@
-var path = require('path')
-var config = require('./config')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-
-exports.assetsPath = function (_path) {
- var assetsSubDirectory = config.assetsSubDirectory
-
- return path.posix.join(assetsSubDirectory, _path)
-}
-
-exports.cssLoaders = function (options) {
- options = options || {}
-
- var cssLoader = {
- loader: 'css-loader',
- options: {
- minimize: process.env.NODE_ENV === 'production',
- sourceMap: options.sourceMap
- }
- }
-
- // generate loader string to be used with extract text plugin
- function generateLoaders (loader, loaderOptions) {
- var loaders = [cssLoader]
- if (loader) {
- loaders.push({
- loader: loader + '-loader',
- options: Object.assign({}, loaderOptions, {
- sourceMap: options.sourceMap
- })
- })
- }
-
- // Extract CSS when that option is specified
- // (which is the case during production build)
- if (options.extract) {
- return ExtractTextPlugin.extract({
- use: loaders,
- fallback: 'vue-style-loader'
- })
- } else {
- return ['vue-style-loader'].concat(loaders)
- }
- }
-
- // https://vue-loader.vuejs.org/en/configurations/extract-css.html
- return {
- css: generateLoaders(),
- postcss: generateLoaders(),
- less: generateLoaders('less'),
- sass: generateLoaders('sass', { indentedSyntax: true }),
- scss: generateLoaders('sass'),
- stylus: generateLoaders('stylus'),
- styl: generateLoaders('stylus')
- }
-}
-
-// Generate loaders for standalone style files (outside of .vue)
-exports.styleLoaders = function (options) {
- var output = []
- var loaders = exports.cssLoaders(options)
- for (var extension in loaders) {
- var loader = loaders[extension]
- output.push({
- test: new RegExp('\\.' + extension + '$'),
- use: loader
- })
- }
- return output
-}
+var path = require('path')
+var config = require('./config')
+var ExtractTextPlugin = require('extract-text-webpack-plugin')
+
+exports.assetsPath = function (_path) {
+ var assetsSubDirectory = config.assetsSubDirectory
+
+ return path.posix.join(assetsSubDirectory, _path)
+}
+
+exports.cssLoaders = function (options) {
+ options = options || {}
+
+ var cssLoader = {
+ loader: 'css-loader',
+ options: {
+ minimize: process.env.NODE_ENV === 'production',
+ sourceMap: options.sourceMap
+ }
+ }
+
+ // generate loader string to be used with extract text plugin
+ function generateLoaders (loader, loaderOptions) {
+ var loaders = [cssLoader]
+ if (loader) {
+ loaders.push({
+ loader: loader + '-loader',
+ options: Object.assign({}, loaderOptions, {
+ sourceMap: options.sourceMap
+ })
+ })
+ }
+
+ // Extract CSS when that option is specified
+ // (which is the case during production build)
+ if (options.extract) {
+ return ExtractTextPlugin.extract({
+ use: loaders,
+ fallback: 'vue-style-loader'
+ })
+ } else {
+ return ['vue-style-loader'].concat(loaders)
+ }
+ }
+
+ // https://vue-loader.vuejs.org/en/configurations/extract-css.html
+ return {
+ css: generateLoaders(),
+ postcss: generateLoaders(),
+ less: generateLoaders('less'),
+ sass: generateLoaders('sass', { indentedSyntax: true }),
+ scss: generateLoaders('sass'),
+ stylus: generateLoaders('stylus'),
+ styl: generateLoaders('stylus')
+ }
+}
+
+// Generate loaders for standalone style files (outside of .vue)
+exports.styleLoaders = function (options) {
+ var output = []
+ var loaders = exports.cssLoaders(options)
+ for (var extension in loaders) {
+ var loader = loaders[extension]
+ output.push({
+ test: new RegExp('\\.' + extension + '$'),
+ use: loader
+ })
+ }
+ return output
+}
diff --git a/assets/build/vue-loader.conf.js b/assets/build/vue-loader.conf.js
index a17529fc..8953aaca 100644
--- a/assets/build/vue-loader.conf.js
+++ b/assets/build/vue-loader.conf.js
@@ -1,12 +1,12 @@
-var utils = require('./utils')
-var config = require('./config')
-var isProduction = process.env.NODE_ENV === 'production'
-
-module.exports = {
- loaders: utils.cssLoaders({
- sourceMap: isProduction
- ? config.build.productionSourceMap
- : config.dev.produceSourceMap,
- extract: isProduction
- })
-}
+var utils = require('./utils')
+var config = require('./config')
+var isProduction = process.env.NODE_ENV === 'production'
+
+module.exports = {
+ loaders: utils.cssLoaders({
+ sourceMap: isProduction
+ ? config.build.productionSourceMap
+ : config.dev.produceSourceMap,
+ extract: isProduction
+ })
+}
diff --git a/assets/build/webpack.base.conf.js b/assets/build/webpack.base.conf.js
index f8188022..53c97bfe 100644
--- a/assets/build/webpack.base.conf.js
+++ b/assets/build/webpack.base.conf.js
@@ -1,69 +1,69 @@
-var path = require('path')
-var utils = require('./utils')
-var config = require('./config')
-var vueLoaderConfig = require('./vue-loader.conf')
-
-function resolve (dir) {
- return path.join(__dirname, '..', dir)
-}
-
-module.exports = {
- entry: {
- app: './assets/src/main.js'
- },
- output: {
- path: config.assetsRoot,
- filename: '[name].js',
- publicPath: config.assetsPublicPath
- },
- resolve: {
- extensions: ['.js', '.vue', '.json'],
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- '@': resolve('src')
- }
- },
- module: {
- rules: [
- {
- test: /\.(yml|yaml)$/,
- loader: 'yml-loader'
- },
- {
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- enforce: 'pre',
- include: [resolve('src'), resolve('test')],
- options: {
- formatter: require('eslint-friendly-formatter')
- }
- },
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: vueLoaderConfig
- },
- {
- test: /\.js$/,
- loader: 'babel-loader',
- include: [resolve('src'), resolve('test')]
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: utils.assetsPath('img/[name].[hash:7].[ext]')
- }
- },
- {
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- // limit: 10000,
- name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
- }
- }
- ]
- }
-}
+var path = require('path')
+var utils = require('./utils')
+var config = require('./config')
+var vueLoaderConfig = require('./vue-loader.conf')
+
+function resolve (dir) {
+ return path.join(__dirname, '..', dir)
+}
+
+module.exports = {
+ entry: {
+ app: './assets/src/main.js'
+ },
+ output: {
+ path: config.assetsRoot,
+ filename: '[name].js',
+ publicPath: config.assetsPublicPath
+ },
+ resolve: {
+ extensions: ['.js', '.vue', '.json'],
+ alias: {
+ 'vue$': 'vue/dist/vue.esm.js',
+ '@': resolve('src')
+ }
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(yml|yaml)$/,
+ loader: 'yml-loader'
+ },
+ {
+ test: /\.(js|vue)$/,
+ loader: 'eslint-loader',
+ enforce: 'pre',
+ include: [resolve('src'), resolve('test')],
+ options: {
+ formatter: require('eslint-friendly-formatter')
+ }
+ },
+ {
+ test: /\.vue$/,
+ loader: 'vue-loader',
+ options: vueLoaderConfig
+ },
+ {
+ test: /\.js$/,
+ loader: 'babel-loader',
+ include: [resolve('src'), resolve('test')]
+ },
+ {
+ test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
+ loader: 'url-loader',
+ options: {
+ limit: 10000,
+ name: utils.assetsPath('img/[name].[hash:7].[ext]')
+ }
+ },
+ {
+ test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+ loader: 'url-loader',
+ options: {
+ // limit: 10000,
+ name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
+ }
+ }
+ ]
+ }
+}
diff --git a/assets/build/webpack.dev.conf.js b/assets/build/webpack.dev.conf.js
index dd75ac4e..3276b7ea 100644
--- a/assets/build/webpack.dev.conf.js
+++ b/assets/build/webpack.dev.conf.js
@@ -1,81 +1,81 @@
-var fs = require('fs')
-var path = require('path')
-var utils = require('./utils')
-var webpack = require('webpack')
-var config = require('./config')
-var merge = require('webpack-merge')
-var baseWebpackConfig = require('./webpack.base.conf')
-var HtmlWebpackPlugin = require('html-webpack-plugin')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-var CopyWebpackPlugin = require('copy-webpack-plugin')
-
-module.exports = merge(baseWebpackConfig, {
- watch: true,
- module: {
- rules: utils.styleLoaders({
- sourceMap: config.dev.produceSourceMap,
- extract: true
- })
- },
- devtool: '#cheap-module-eval-source-map',
- output: {
- path: config.assetsRoot,
- filename: utils.assetsPath('js/[name].[chunkhash].js'),
- chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
- },
- plugins: [
- new webpack.NoEmitOnErrorsPlugin(),
- new FriendlyErrorsPlugin(),
- new webpack.DefinePlugin({
- 'process.env': config.dev.env
- }),
- // extract css into its own file
- new ExtractTextPlugin({
- filename: utils.assetsPath('css/[name].[contenthash].css')
- }),
- // generate dist index.html with correct asset hash for caching.
- // you can customize output by editing /index.html
- // see https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: config.index,
- template: 'assets/index.html',
- inject: true,
- // necessary to consistently work with multiple chunks via CommonsChunkPlugin
- chunksSortMode: 'dependency',
- serviceWorkerLoader: ``
- }),
- // split vendor js into its own file
- new webpack.optimize.CommonsChunkPlugin({
- name: 'vendor',
- minChunks: function (module, count) {
- // any required modules inside node_modules are extracted to vendor
- return (
- module.resource &&
- /\.js$/.test(module.resource) &&
- module.resource.indexOf(
- path.join(__dirname, '../../node_modules')
- ) === 0
- )
- }
- }),
- // extract webpack runtime and module manifest to its own file in order to
- // prevent vendor hash from being updated whenever app bundle is updated
- new webpack.optimize.CommonsChunkPlugin({
- name: 'manifest',
- chunks: ['vendor']
- }),
- new CopyWebpackPlugin([
- {
- from: path.resolve(__dirname, '../static'),
- to: config.assetsSubDirectory,
- ignore: ['.*']
- },
- {
- from: path.resolve(__dirname, '../../node_modules/codemirror/mode/*/*'),
- to: path.join(config.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js')
- }
- ])
- ]
-})
+var fs = require('fs')
+var path = require('path')
+var utils = require('./utils')
+var webpack = require('webpack')
+var config = require('./config')
+var merge = require('webpack-merge')
+var baseWebpackConfig = require('./webpack.base.conf')
+var HtmlWebpackPlugin = require('html-webpack-plugin')
+var ExtractTextPlugin = require('extract-text-webpack-plugin')
+var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
+var CopyWebpackPlugin = require('copy-webpack-plugin')
+
+module.exports = merge(baseWebpackConfig, {
+ watch: true,
+ module: {
+ rules: utils.styleLoaders({
+ sourceMap: config.dev.produceSourceMap,
+ extract: true
+ })
+ },
+ devtool: '#cheap-module-eval-source-map',
+ output: {
+ path: config.assetsRoot,
+ filename: utils.assetsPath('js/[name].[chunkhash].js'),
+ chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
+ },
+ plugins: [
+ new webpack.NoEmitOnErrorsPlugin(),
+ new FriendlyErrorsPlugin(),
+ new webpack.DefinePlugin({
+ 'process.env': config.dev.env
+ }),
+ // extract css into its own file
+ new ExtractTextPlugin({
+ filename: utils.assetsPath('css/[name].[contenthash].css')
+ }),
+ // generate dist index.html with correct asset hash for caching.
+ // you can customize output by editing /index.html
+ // see https://github.com/ampedandwired/html-webpack-plugin
+ new HtmlWebpackPlugin({
+ filename: config.index,
+ template: 'assets/index.html',
+ inject: true,
+ // necessary to consistently work with multiple chunks via CommonsChunkPlugin
+ chunksSortMode: 'dependency',
+ serviceWorkerLoader: ``
+ }),
+ // split vendor js into its own file
+ new webpack.optimize.CommonsChunkPlugin({
+ name: 'vendor',
+ minChunks: function (module, count) {
+ // any required modules inside node_modules are extracted to vendor
+ return (
+ module.resource &&
+ /\.js$/.test(module.resource) &&
+ module.resource.indexOf(
+ path.join(__dirname, '../../node_modules')
+ ) === 0
+ )
+ }
+ }),
+ // extract webpack runtime and module manifest to its own file in order to
+ // prevent vendor hash from being updated whenever app bundle is updated
+ new webpack.optimize.CommonsChunkPlugin({
+ name: 'manifest',
+ chunks: ['vendor']
+ }),
+ new CopyWebpackPlugin([
+ {
+ from: path.resolve(__dirname, '../static'),
+ to: config.assetsSubDirectory,
+ ignore: ['.*']
+ },
+ {
+ from: path.resolve(__dirname, '../../node_modules/codemirror/mode/*/*'),
+ to: path.join(config.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js')
+ }
+ ])
+ ]
+})
diff --git a/assets/src/assets/logo.svg b/assets/src/assets/logo.svg
index 62e6798a..4284f684 100644
--- a/assets/src/assets/logo.svg
+++ b/assets/src/assets/logo.svg
@@ -1,5 +1,5 @@
-