wikijs-fork/client/js/app.js

61 lines
1.3 KiB
JavaScript
Raw Normal View History

"use strict";
jQuery( document ).ready(function( $ ) {
2016-08-28 15:27:05 +00:00
// ====================================
2016-08-28 01:46:10 +00:00
// Scroll
2016-08-28 15:27:05 +00:00
// ====================================
2016-08-28 01:46:10 +00:00
$('a').smoothScroll({
speed: 400,
offset: -20
});
var sticky = new Sticky('.stickyscroll');
2016-08-28 15:27:05 +00:00
// ====================================
// Notifications
// ====================================
$(window).bind('beforeunload', () => {
$('#notifload').addClass('active');
});
$(document).ajaxSend(() => {
$('#notifload').addClass('active');
}).ajaxComplete(() => {
$('#notifload').removeClass('active');
});
2016-08-28 01:46:10 +00:00
2016-08-24 01:09:09 +00:00
var alerts = new Alerts();
if(alertsData) {
_.forEach(alertsData, (alertRow) => {
alerts.push(alertRow);
});
}
2016-08-28 15:27:05 +00:00
// ====================================
// Markdown Editor
// ====================================
2016-08-28 01:46:10 +00:00
if($('#mk-editor').length === 1) {
let mde = new SimpleMDE({
autofocus: true,
autoDownloadFontAwesome: false,
2016-08-28 15:27:05 +00:00
element: $("#mk-editor").get(0),
2016-08-28 01:46:10 +00:00
hideIcons: ['heading', 'quote'],
2016-08-28 15:27:05 +00:00
placeholder: 'Enter Markdown formatted content here...',
2016-08-28 01:46:10 +00:00
showIcons: ['strikethrough', 'heading-1', 'heading-2', 'heading-3', 'code', 'table', 'horizontal-rule'],
2016-08-28 15:27:05 +00:00
spellChecker: false,
status: false
2016-08-28 01:46:10 +00:00
});
}
2016-08-28 15:27:05 +00:00
// ====================================
// Pages logic
// ====================================
//=include pages/edit.js
});