File: src/webdav.js

Recommend this page to a friend!
  Classes of Dom Hastings  >  JS Webdav Client  >  src/webdav.js  >  Download  
File: src/webdav.js
Role: Class source
Content type: text/plain
Description: Class source
Class: JS Webdav Client
Access files of a Webdav server
Author: By
Last change: Add ability to sort entries with directories first by adding `data-sort-directories-first` attribute to an element on the page. This fixes #55.
Add `[data-disable-check]` selector check to optionally disable `HEAD` requests. Closes #52.
Further bugfixes and improvements.

- Fix `font-size` for users who have changed the default font.
- IE11 compatibility.
Rewritten from the ground up using ES modules and trying to separate the
UI from the core functionality.

- Rewote code and organised into ES modules.
- Remove jQuery dependency (#30).
- Add keyboard navigation.
- Switch WebDAV test container to Alpine Linux.
- Add `eslint` for code style validation.
- Add `karma`/`jasmine` for testing.
- Add `.babelrc`.
- Add some basic unit tests.
- Rework `package.json` scripts.
- Add `Webpack` for building.
- Remove inlined external assets to resolve as module dependencies.
- Update document title on navigation
- Add toasts to notify of errors (#49).
- Add `.gitattributes` file to avoid CSS being counted incorrectly on
GitHub.
- Add `EventObject` class for handling events within the UI.
- Add a check (`HEAD` request) before trying to show images, fonts,
videos, audio to prevent invalid lightbox from showing up.
- Update `.editorconfig`.
- Add `stylelint`.
Date: 1 month ago
Size: 589 bytes
 

Contents

Class file image Download
import 'basiclightbox/src/styles/main.scss';
import 'prismjs/themes/prism.css';
import 'melba-toast/dist/css/Melba.css';
import 'webdav-js/assets/scss/style.scss';
import 'whatwg-fetch'; // IE11 compatibility
import NativeDOM from './lib/UI/NativeDOM.js';

const ui = new NativeDOM(document.body, {
  bypassCheck: !! document.querySelector('[data-disable-check]'),
  sortDirectoriesFirst: !! document.querySelector('[data-sort-directories-first]'),
});

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', () => ui.render());
}
else {
  ui.render();
}