123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- "use strict";
- jQuery( document ).ready(function( $ ) {
- // ====================================
- // Scroll
- // ====================================
- $('a').smoothScroll({
- speed: 400,
- offset: -20
- });
- var sticky = new Sticky('.stickyscroll');
- // ====================================
- // Notifications
- // ====================================
- $(window).bind('beforeunload', () => {
- $('#notifload').addClass('active');
- });
- $(document).ajaxSend(() => {
- $('#notifload').addClass('active');
- }).ajaxComplete(() => {
- $('#notifload').removeClass('active');
- });
- var alerts = new Alerts();
- if(alertsData) {
- _.forEach(alertsData, (alertRow) => {
- alerts.push(alertRow);
- });
- }
- // ====================================
- // Markdown Editor
- // ====================================
- if($('#mk-editor').length === 1) {
- var mde = new SimpleMDE({
- autofocus: true,
- autoDownloadFontAwesome: false,
- element: $("#mk-editor").get(0),
- hideIcons: ['heading', 'quote'],
- placeholder: 'Enter Markdown formatted content here...',
- showIcons: ['strikethrough', 'heading-1', 'heading-2', 'heading-3', 'code', 'table', 'horizontal-rule'],
- spellChecker: false,
- status: false
- });
- }
- // ====================================
- // Establish WebSocket connection
- // ====================================
- var socket = io(ioHost);
- var vueHeader = new Vue({
- el: '#header-container',
- data: {
- searchq: '',
- searchres: []
- },
- watch: {
- searchq: (val, oldVal) => {
- if(val.length >= 3) {
- socket.emit('search', { terms: val }, (data) => {
- vueHeader.$set('searchres', data);
- });
- }
- }
- },
- methods: {
-
- }
- });
- // ====================================
- // Pages logic
- // ====================================
- //=include pages/view.js
- //=include pages/create.js
- //=include pages/edit.js
- //=include pages/source.js
- });
- //=include helpers/form.js
- //=include helpers/pages.js
|