Skip to content

Commit

Permalink
feat: support for IE11 browser
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiresviana committed Apr 15, 2021
1 parent 20ebbf6 commit 7ec24d9
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
24 changes: 23 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ace-builds": "^1.4.7",
"clipboard": "^2.0.4",
"core-js": "^3.9.1",
"css-vars-ponyfill": "^2.4.3",
"js-base64": "^2.5.1",
"lodash.clonedeep": "^4.5.0",
"lodash.throttle": "^4.1.1",
Expand All @@ -27,7 +28,8 @@
"vue-lazyload": "^1.3.3",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
"vuex-router-sync": "^5.0.0"
"vuex-router-sync": "^5.0.0",
"whatwg-fetch": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.2",
Expand Down Expand Up @@ -64,6 +66,6 @@
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
"not ie < 11"
]
}
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<!-- Inject Some Variables and generate the manifest json -->
<script>
window.FileBrowser = JSON.parse(`[{[ .Json ]}]`);
window.FileBrowser = JSON.parse('[{[ .Json ]}]');

var fullStaticURL = window.location.origin + window.FileBrowser.StaticURL;
var dynamicManifest = {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "whatwg-fetch";
import cssVars from "css-vars-ponyfill";
import { sync } from "vuex-router-sync";
import store from "@/store";
import router from "@/router";
Expand All @@ -7,6 +9,8 @@ import { recaptcha, loginPage } from "@/utils/constants";
import { login, validateLogin } from "@/utils/auth";
import App from "@/App";

cssVars();

sync(store, router);

async function start() {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/views/files/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ export default {
}
},
upload: function () {
if (typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined") {
if (
typeof window.DataTransferItem !== "undefined" &&
typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined"
) {
this.$store.commit("showHover", "upload");
} else {
document.getElementById("upload-input").click();
Expand Down
2 changes: 2 additions & 0 deletions http/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func (d *data) Check(path string) bool {

func handle(fn handleFunc, prefix string, store *storage.Storage, server *settings.Server) http.Handler {
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache")

settings, err := store.Settings.Get()
if err != nil {
log.Fatalf("ERROR: couldn't get settings: %v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion http/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
}
}

b, err := json.MarshalIndent(data, "", " ")
b, err := json.Marshal(data)
if err != nil {
return http.StatusInternalServerError, err
}
Expand Down

0 comments on commit 7ec24d9

Please sign in to comment.