resources/assets/js/report.js
/** When pasting to content editable ,remove styles*/
When pasting to content editable ,remove styles
When pasting to content editable remove styles
function disablePasteWithFormatting(){
        $('.table-cell-input [contenteditable]').on('paste',function(e) {
            e.preventDefault();
            var text = (e.originalEvent || e).clipboardData.getData('text/html');
            var $result = $('<div></div>').append($(text));
            $(this).html($result.html());
            $(this).children('style').remove();
            $(this).children('meta').remove();
            $(this).children('link').remove();
            $(this).children().each(function() {
                var item = this;
                $(item).removeAttr('style');
                item = $(item).text();
            });
        });
    }
function disablePasteWithFormatting ( ) { $ ( '.table-cell-input [contenteditable]' ) . on ( 'paste' , function ( e ) { e . preventDefault ( ) ; var text = ( e . originalEvent || e ) . clipboardData . getData ( 'text/html' ) ; var $result = $ ( '<div></div>' ) . append ( $ ( text ) ) ; $ ( this ) . html ( $result . html ( ) ) ; $ ( this ) . children ( 'style' ) . remove ( ) ; $ ( this ) . children ( 'meta' ) . remove ( ) ; $ ( this ) . children ( 'link' ) . remove ( ) ; $ ( this ) . children ( ) . each ( function ( ) { var item = this ; $ ( item ) . removeAttr ( 'style' ) ; item = $ ( item ) . text ( ) ; } ) ; } ) ; }
When pasting to content editable ,remove styles
When pasting to content editable remove styles
// remove unnecesary tags (if paste from word)