-/* jQuery */
import $ from 'jquery';
-/* Annotations */
-import annotator from 'annotator';
+/* Materialize imports */
+import 'materialize-css/dist/css/materialize.css';
+import 'materialize-css/dist/js/materialize';
+
+/* Global imports */
+import '../_global/index';
/* Tools */
-import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools';
+import { initExport, initFilters } from './js/tools';
/* Import shortcuts */
-import './shortcuts/main';
-import './shortcuts/entry';
-import '../../_global/js/shortcuts/main';
-import '../../_global/js/shortcuts/entry';
-
-require('materialize'); // eslint-disable-line
+import './js/shortcuts/main';
+import './js/shortcuts/entry';
-global.jQuery = $;
+/* Theme style */
+import './css/index.scss';
$(document).ready(() => {
// sideNav
formatSubmit: 'dd/mm/yyyy',
hiddenName: true,
format: 'dd/mm/yyyy',
+ container: 'body',
});
initFilters();
initExport();
const scrollPercent = (s / (d - c)) * 100;
$('.progress .determinate').css('width', `${scrollPercent}%`);
});
-
-/* ==========================================================================
- Annotations & Remember position
- ========================================================================== */
-
- if ($('article').length) {
- const app = new annotator.App();
- const x = JSON.parse($('#annotationroutes').html());
-
- app.include(annotator.ui.main, {
- element: document.querySelector('article'),
- });
-
- app.include(annotator.storage.http, x);
-
- app.start().then(() => {
- app.annotations.load({ entry: x.entryId });
- });
-
- $(window).scroll(() => {
- const scrollTop = $(window).scrollTop();
- const docHeight = $(document).height();
- const scrollPercent = (scrollTop) / (docHeight);
- const scrollPercentRounded = Math.round(scrollPercent * 100) / 100;
- savePercent(x.entryId, scrollPercentRounded);
- });
-
- retrievePercent(x.entryId);
-
- $(window).resize(() => {
- retrievePercent(x.entryId);
- });
- }
});