UI: Fix JavaScript error in MSIE due to endswith() usage (#1172)

* index: avoid endswith() for MSIE compatibility

MSIE does not support endswith() [1]. substr() can
be used to work around this limitation.

[1] https://docs.microsoft.com/en-us/scripting/javascript/reference/endswith-method-string-javascript

* index: clean up comment

* ui: update bindata
This commit is contained in:
Christian Hoffmann 2018-01-02 14:25:54 +01:00 committed by Andrey Kuzmin
parent 6f8ccb031c
commit 0e63715b23
2 changed files with 5 additions and 5 deletions

View File

@ -7,9 +7,9 @@
</head> </head>
<body> <body>
<script> <script>
//If there is no trailing slash at the end of the path in the url, // If there is no trailing slash at the end of the path in the url,
// add one. This ensures assets like script.js` are loaded properly // add one. This ensures assets like script.js are loaded properly
if (window.location.pathname.endsWith('/') === false) { if (window.location.pathname.substr(-1) != '/') {
window.location.pathname = window.location.pathname + '/'; window.location.pathname = window.location.pathname + '/';
console.log('added slash'); console.log('added slash');
} }

View File

@ -100,7 +100,7 @@ func uiAppScriptJs() (*asset, error) {
return a, nil return a, nil
} }
var _uiAppIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x93\xc1\x6a\xdc\x30\x10\x86\xef\x79\x8a\xa9\x2f\xf6\x52\xaf\x4c\x6f\x25\xb5\x16\x4a\x92\x43\x0e\xa5\x85\x06\x4a\x6f\x9d\xb5\xc6\xb6\x1a\x59\x32\x9a\x71\x96\x10\xf2\xee\x45\x76\xc9\xae\xb7\x2c\xd5\xc5\x92\x66\xf4\xf3\xcf\x37\x9e\xfa\xdd\xed\xd7\x9b\x87\x9f\xdf\xee\xa0\x97\xc1\xed\xae\xea\xf4\x01\x87\xbe\xd3\x19\xf9\x6c\x77\x05\x00\x50\xf7\x84\x66\xd9\xce\xc7\x81\x04\xa1\xe9\x31\x32\x89\xce\x26\x69\xb7\x1f\xb3\xf3\xb0\xc7\x81\x74\xf6\x64\xe9\x30\x86\x28\x19\x34\xc1\x0b\x79\xd1\xd9\xc1\x1a\xe9\xb5\xa1\x27\xdb\xd0\x76\x3e\x94\x60\xbd\x15\x8b\x6e\xcb\x0d\x3a\xd2\x1f\x4a\xe0\x3e\x5a\xff\xb8\x95\xb0\x6d\xad\x68\x1f\x4e\xe5\xc5\x8a\xa3\xdd\x67\x47\x51\x06\xf4\xd8\x51\xac\xab\xe5\x6e\x31\x5b\x1d\xdd\xd6\xfb\x60\x9e\x4f\x9e\x72\x13\xed\x28\xc7\x8b\xb4\xaa\xea\xbe\x05\xe9\x29\x12\x58\x06\x1f\x40\x22\x5a\x67\x7d\x07\xec\x90\x7b\x40\x49\x51\x20\x6f\x20\xcc\x89\x30\xa2\xf4\x60\xfd\xbc\x9f\xa2\x2b\xcf\xe4\x00\x8d\x81\xe0\x49\xc1\x43\x6f\x19\xc8\xf3\x14\x89\x01\x99\x49\x18\x9c\x7d\x24\x58\x7c\xa8\xdf\xfc\x0b\x30\x12\xb8\x80\x86\x0c\x8c\x31\x8c\x14\xdd\xf3\x4a\xcf\xb6\x50\x1c\xac\x37\xe1\xa0\x5c\x68\x50\x6c\xf0\x2a\x19\x48\x7c\x15\x79\xc3\x3f\xac\xf4\x45\x5e\xe5\x1b\xd0\x5a\x43\x8b\x8e\x69\x03\x2f\x2b\x8d\xb4\x2e\x69\x80\xbe\x1c\x7a\x0f\x79\x95\x7f\xfa\x47\xaa\x09\x9e\x83\x23\xe5\x42\x57\xe4\x68\x92\xf5\x19\x55\xbe\x59\xe7\xbe\x1e\xc1\x57\xe7\xe4\xff\xb6\x02\x38\x36\x3a\x7b\xc3\x91\xed\x2e\x66\xae\x9b\xf6\x84\x11\x70\x1c\x41\xc3\x9d\x1b\xd4\x17\xb4\x5e\xd1\xb0\x27\x53\x98\xd0\x4c\x03\x79\x51\xa9\xf3\x25\xbc\x24\xa8\x66\x6a\x52\x5d\xd7\x20\x71\xa2\x12\x0c\xb5\x38\x39\xb9\x89\x84\x12\xe2\xf5\x69\xf9\xee\xbb\x84\x88\x1d\xa9\x8e\xe4\x5e\x68\x28\xf2\x75\x72\xbe\x81\xd7\xb3\x22\x71\x1c\x55\xfa\xc3\x59\x8d\x14\xd9\xb2\xdc\xae\x5e\x28\x9e\xf6\xa9\x80\x3d\x15\xed\xe4\x67\x1f\x45\x62\xfb\x9f\x16\xbd\x19\xe1\x0b\x46\xca\x79\xc0\xce\x81\x9f\x9c\xd7\x20\xeb\x6a\x99\x84\xba\x5a\xc6\xfc\x4f\x00\x00\x00\xff\xff\x8d\xd0\x1f\x46\xf7\x03\x00\x00") var _uiAppIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x53\xc1\x6e\xdb\x30\x0c\xbd\xf7\x2b\x58\x5f\xe2\x60\xb6\x8c\xde\x86\xce\x0e\x30\xb4\x3d\xf4\x30\x6c\xc0\x7a\xd9\x91\x91\x68\x5b\xab\x2c\x19\x22\xdd\xa0\x28\xfa\xef\x83\xec\xa1\x89\x33\x04\xd3\x25\xa2\x48\xbe\x3c\xbe\x67\xd6\xd7\xf7\xdf\xef\x9e\x7e\xfd\x78\x80\x5e\x06\xb7\xbb\xaa\xd3\x0f\x38\xf4\x5d\x93\x91\xcf\x76\x57\x00\x00\x75\x4f\x68\x96\xeb\x1c\x0e\x24\x08\xba\xc7\xc8\x24\x4d\x36\x49\x5b\x7e\xce\xce\xd3\x1e\x07\x6a\xb2\x17\x4b\x87\x31\x44\xc9\x40\x07\x2f\xe4\xa5\xc9\x0e\xd6\x48\xdf\x18\x7a\xb1\x9a\xca\x39\x28\xc0\x7a\x2b\x16\x5d\xc9\x1a\x1d\x35\x37\x05\x70\x1f\xad\x7f\x2e\x25\x94\xad\x95\xc6\x87\x53\x78\xb1\xe2\x68\xf7\xd5\x51\x94\x01\x3d\x76\x14\xeb\x6a\x79\x5b\xc8\x56\x47\xb6\xf5\x3e\x98\xd7\x93\x56\xd6\xd1\x8e\x72\x7c\x48\xa7\xaa\xe0\xb1\x05\xe9\x29\x12\x58\x06\x1f\x40\x22\x5a\x67\x7d\x07\xec\x90\x7b\x40\x49\x59\x20\x6f\x20\xcc\x85\x30\xa2\xf4\x60\xfd\x7c\x9f\xa2\x2b\xce\xf1\xd0\x18\x08\x9e\x14\x3c\xf5\x96\x81\x3c\x4f\x91\x18\x90\x99\x84\xc1\xd9\x67\x82\x85\x88\xfa\xcd\x80\x91\xc0\x05\x34\x64\x60\x8c\x61\xa4\xe8\x5e\x57\x70\xb6\x85\xfc\x60\xbd\x09\x07\xe5\x82\x46\xb1\xc1\xab\xf4\xff\x49\x5f\xc5\xd3\x9e\x25\xe6\xe5\xcd\x16\xae\x1b\xd8\x54\x9b\x2d\xbc\xad\xba\xd3\xb9\xd4\x0d\xcd\xe5\xd4\xa7\x04\xf6\xe5\x1f\x28\x1d\x3c\x07\x47\xca\x85\x2e\xdf\xa0\x49\xa4\x67\x8d\x36\xdb\x75\xed\xfb\x51\xf2\xea\x5c\xf3\xbf\x26\x00\x47\xdd\x64\x1f\x3a\x64\xbb\x8b\x95\x6b\xbb\x5e\x30\x02\x8e\x23\x34\xf0\xe0\x06\xf5\x0d\xad\x57\x34\xec\xc9\xe4\x26\xe8\x69\x20\x2f\x2a\x79\x5e\xc0\x5b\x92\xd3\x4c\x3a\xcd\x75\x0b\x12\x27\x2a\xc0\x50\x8b\x93\x93\xbb\x48\x28\x21\xde\x9e\x8e\xef\x7e\x4a\x88\xd8\x91\xea\x48\x1e\x85\x86\x7c\xb3\x2e\xde\x6c\xe1\xfd\x6c\x48\x1c\x47\x95\xbe\x6d\x56\x23\x45\xb6\x2c\xf7\xab\x8e\xd9\x1c\x1d\xed\x9e\xf2\x76\xf2\x33\x8f\x3c\x69\xfb\x1f\x8b\x3e\x88\xf0\x05\x22\xc5\xbc\x5a\xe7\x82\x9f\xc4\x6b\x21\xeb\x6a\xd9\x81\xba\x5a\x16\xfc\x4f\x00\x00\x00\xff\xff\x28\x2e\x82\x1a\xf1\x03\x00\x00")
func uiAppIndexHtmlBytes() ([]byte, error) { func uiAppIndexHtmlBytes() ([]byte, error) {
return bindataRead( return bindataRead(
@ -115,7 +115,7 @@ func uiAppIndexHtml() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "ui/app/index.html", size: 1015, mode: os.FileMode(420), modTime: time.Unix(1, 0)} info := bindataFileInfo{name: "ui/app/index.html", size: 1009, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }