RomanL 4 лет назад
Родитель
Сommit
fb70bfee61

+ 9 - 0
inc/classes/BxDolCacheUtilities.php

@@ -23,6 +23,7 @@ class BxDolCacheUtilities extends BxDol
             'less' => array(),
             'css' => array('option' => 'sys_template_cache_css_enable'),
             'js' => array('option' => 'sys_template_cache_js_enable'),
+            'purifier' => array(),
             'custom' => array(),
         );
     }
@@ -94,6 +95,14 @@ class BxDolCacheUtilities extends BxDol
             case 'js':
                 $mixedResult = $this->$sFuncCacheFile($oTemplate->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
                 break;
+                
+            case 'purifier':
+                HTMLPurifier_Bootstrap::registerAutoload();
+                $oConfig = HTMLPurifier_Config::createDefault();
+                $oConfig->set('Cache.DefinitionImpl', null);
+                $oHtmlPurifier = new HTMLPurifier($oConfig);
+                $oHtmlPurifier->purify('');
+                break;    
         }
 
         return $mixedResult;

+ 4 - 8
inc/js/classes/BxDolPage.js

@@ -29,16 +29,12 @@ BxDolPage.prototype.init = function() {
             additionalMarginTop: 30
         });
     }
+    // process embeds
     $(".bx-embed-link").each(function( index ) {
         $obj =  $(this);
-        $.getJSON(sUrlRoot + '/embed.php?', {a: 'get_link', l: $(this).attr('source')}, function(aData){
-            
-            if ($obj.parents('.ql-editor').length == 0 || true){
-                console.log( $obj.html());
-                $obj.html(aData.code);
-                bx_embed_link();
-            }
-   
+        $.getJSON(sUrlRoot + '/embed.php?', {a: 'get_link', l: $(this).attr('source')}, function(aData){ 
+            $obj.html(aData.code);
+            bx_embed_link();
         });
     });
 };

+ 0 - 1
inc/utils.inc.php

@@ -598,7 +598,6 @@ function clear_xss($val)
             new BxDolHTMLPurifierFilterEmbed(),
         ));
    
-        //$oConfig->set('Cache.DefinitionImpl', null); // chear cache
 	    $oConfig->set('HTML.DefinitionID', 'html5-definitions');
 		$oConfig->set('HTML.DefinitionRev', 1);
       

+ 3 - 3
install/sql/system.sql

@@ -320,10 +320,10 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 (@iCategoryId, 'sys_live_updates_interval', '_adm_stg_cpt_option_sys_live_updates_interval', '10000', 'digit', '', '', '', '', 60),
 
-(@iCategoryId, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 70),
-(@iCategoryId, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 73),
+(@iCategoryId, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'}],[\'blockquote\'],[\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 70),
+(@iCategoryId, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'}],[\'blockquote\'],[\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 73),
 (@iCategoryId, 'sys_quill_toolbar_full', '_adm_stg_cpt_option_sys_quill_toolbar_full', '[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[\'bold\',\'italic\',\'underline\',\'clean\'],
-  [{ \'align\': [] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[\'blockquote\'],[{ \'color\': [] }, { \'background\': [] }],[{ \'direction\': \'rtl\' }],[{ \'script\': \'sub\'}, { \'script\': \'super\' }],[\'link\',\'image\',\'code-block\']', 'digit', '', '', '', '', 76),
+  [{ \'align\': [] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[\'blockquote\'],[{ \'color\': [] }, { \'background\': [] }],[{ \'direction\': \'rtl\' }],[{ \'script\': \'sub\'}, { \'script\': \'super\' }],[\'link\',\'image\',\'embed\',\'code-block\']', 'digit', '', '', '', '', 76),
 
 (@iCategoryId, 'sys_search_keyword_min_len', '_adm_stg_cpt_option_sys_search_keyword_min_len', '1', 'digit', '', '', '', '', 80),
 

+ 1 - 0
studio/classes/BxDolStudioDashboard.php

@@ -31,6 +31,7 @@ class BxDolStudioDashboard extends BxTemplStudioWidget
             array('name' => 'less'),
             array('name' => 'css'),
             array('name' => 'js'),
+            array('name' => 'purifier'),
             array('name' => 'custom')
         );