Răsfoiți Sursa

可视化编辑

moshaorui 3 luni în urmă
părinte
comite
21d2547291

+ 1 - 1
app/Distributor/Repositories/DistAppearance.php

@@ -23,7 +23,7 @@ class DistAppearance extends EloquentRepository
      * (如果原本就有模板与变量,不会重复生成)
      */
     public static function switchTheme($appearanceId,$distId) {
-        //把原始模板复制给分销商
+        //把原始模板与变量复制给分销商
         DistAppearanceTemplate::copyTemplateToDist($appearanceId, $distId);
         DistAppearanceVariable::copyAppearanceVariable($appearanceId, $distId);
         //发报到正式环境

+ 5 - 0
app/Distributor/Repositories/DistAppearanceTemplate.php

@@ -117,6 +117,11 @@ class DistAppearanceTemplate extends EloquentRepository
         foreach ($matches as $match) {
             // 提取 mtb_id 和匹配的 HTML 内容
             $outHtml = $match[0];
+            //如果第一个字符>后边有<,则加上空格
+            $pattern = '/>(?=<)/'; // 匹配 > 后紧跟 <
+            $replacement = '> '; // 在 > 和 < 之间添加一个空格
+            $outHtml = preg_replace($pattern, $replacement, $outHtml, 1);
+
             //去掉mtb_id属性
             $outHtml = preg_replace('/mtb_id="[^"]*"/', '', $outHtml);
             $result[] = [

+ 9 - 9
public/vendor/grapes/grapes.init.js

@@ -73,14 +73,14 @@ const panelsConfig = {
                 //     togglable: false,
                 //     attributes: { title: 'Open Layer Manager' },
                 // },
-                {
-                    id: 'open-blocks',
-                    className: 'fa fa-th-large',
-                    command: 'open-blocks',
-                    active: faThLargeActive,
-                    togglable: true,
-                    attributes: { title: 'Open Blocks' },
-                },
+                // {
+                //     id: 'open-blocks',
+                //     className: 'fa fa-th-large',
+                //     command: 'open-blocks',
+                //     active: faThLargeActive,
+                //     togglable: true,
+                //     attributes: { title: 'Open Blocks' },
+                // },
             ],
         },
     ],
@@ -155,7 +155,7 @@ bm.add('block_p', {
     // Your block properties...
     label: 'Paragraph',
     media: `<svg style="width:20px;height:20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M192 32l64 0 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0c-88.4 0-160-71.6-160-160s71.6-160 160-160z"/></svg>`,
-    content: '<p>insert your text here</p>',
+    content: '<p>insert your paragraph here</p>',
 });
 bm.add('block_span', {
     // Your block properties...