123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /* ------------------------------------------------------------------------------
- *
- * # Blog page - detailed
- *
- * Demo JS code for blog page kit - detailed view
- *
- * ---------------------------------------------------------------------------- */
- // Setup module
- // ------------------------------
- var BlogSingle = function() {
- //
- // Setup module components
- //
- // CKEditor
- var _componentCKEditor = function() {
- if (typeof CKEDITOR == 'undefined') {
- console.warn('Warning - ckeditor.js is not loaded.');
- return;
- }
- // Initialize
- CKEDITOR.replace('add-comment', {
- height: 200,
- removeButtons: 'Subscript,Superscript',
- toolbarGroups: [
- { name: 'styles' },
- { name: 'editing', groups: [ 'find', 'selection' ] },
- { name: 'basicstyles', groups: [ 'basicstyles' ] },
- { name: 'paragraph', groups: [ 'list', 'blocks', 'align' ] },
- { name: 'links' },
- { name: 'insert' },
- { name: 'colors' },
- { name: 'tools' },
- { name: 'others' },
- { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }
- ]
- });
- };
- // Lightbox
- var _componentFancybox = function() {
- if (!$().fancybox) {
- console.warn('Warning - fancybox.min.js is not loaded.');
- return;
- }
- // Image lightbox
- $('[data-popup="lightbox"]').fancybox({
- padding: 3
- });
- };
- //
- // Return objects assigned to module
- //
- return {
- init: function() {
- _componentCKEditor();
- _componentFancybox();
- }
- }
- }();
- // Initialize module
- // ------------------------------
- document.addEventListener('DOMContentLoaded', function() {
- BlogSingle.init();
- });
|