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