go-skeletor/public/theme/style.js

79 lines
2.4 KiB
JavaScript

function resizeSidebar() {
if($("#sidebar").length) {
headerheight=$(".header").height();
windowheight=$(window).height();
$("#sidebar").height(windowheight-headerheight);
}
}
function ckeditor() {
if($(".ckeditor").length) {
ClassicEditor.create( document.querySelector( '.ckeditor' ),
{
toolbar: {
items: ['sourceEditing','|','heading','|','bold','italic','link','bulletedList','numberedList','highlight','fontBackgroundColor','fontColor','|','alignment','outdent','indent','|','imageUpload','imageInsert','mediaEmbed','|','codeBlock','code','blockQuote','horizontalLine','insertTable','|','undo','redo']
},
language: 'fr',
image: {
toolbar: ['imageTextAlternative','imageStyle:inline','imageStyle:block','imageStyle:side','linkImage']
},
table: {
contentToolbar: ['tableColumn','tableRow','mergeTableCells']
},
licenseKey: '',
}
)
.then( editor => {
window.editor = editor;
} )
.catch( error => {
console.error( 'Oops, something went wrong!' );
console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' );
console.warn( 'Build id: idyj5chb4mzw-6v0mlfy1nn7k' );
console.error( error );
} );
}
}
function ModalLoad(idmodal,title,path) {
$("#"+idmodal+" .modal-header h4").text(title);
$("#"+idmodal+" iframe").attr("src",path);
$("#"+idmodal).modal("show");
iFrameResize({log: false, bodyMargin: '0px 0px 20px 0px' }, '.resizeframe');
}
var doit = true;
$(window).resize(function(){
resizeSidebar();
});
$(document).ready(function() {
$(".spectrum").spectrum({
preferredFormat: "hex",
});
$("a[data-method]").on('click',function(){
if($(this).data('confirm')){
doit = confirm($(this).data('confirm'));
if(!doit) return false;
}
});
$("button[data-method]").on('click',function(){
if($(this).data('confirm')){
doit = confirm($(this).data('confirm'));
if(!doit) return false;
}
});
ckeditor();
resizeSidebar();
});