ソースを参照

imporved newsletter wysiwyg full_html format

bach 2 年 前
コミット
ed68c9895c

+ 29 - 0
composer.json

@@ -13,16 +13,45 @@
         {
             "type": "composer",
             "url": "https://packages.drupal.org/8"
+        },
+        {
+          "type": "package",
+          "package": {
+              "name": "ckeditor-plugin/panelbutton",
+              "version": "4.16.2",
+              "type": "drupal-library",
+              "dist": {
+                  "url": "https://download.ckeditor.com/panelbutton/releases/panelbutton_4.16.2.zip",
+                  "type": "zip"
+              }
+          }
+        },
+        {
+          "type": "package",
+          "package": {
+              "name": "ckeditor-plugin/colorbutton",
+              "version": "4.16.2",
+              "type": "drupal-library",
+              "dist": {
+                  "url": "https://download.ckeditor.com/colorbutton/releases/colorbutton_4.16.2.zip",
+                  "type": "zip"
+              }
+          }
         }
     ],
     "require": {
         "php": ">=7.3",
+        "ckeditor-plugin/colorbutton": "4.16.2",
+        "ckeditor-plugin/panelbutton": "4.16.2",
         "composer/installers": "^1.2",
         "drupal/admin_theme": "1.x-dev@dev",
         "drupal/advagg": "4.x-dev@dev",
         "drupal/amswap": "^3.0",
         "drupal/audiofield": "^1.10",
         "drupal/auto_entitylabel": "^2.x-dev",
+        "drupal/ckeditor_font": "^1.2",
+        "drupal/ckeditor_uploadimage": "^2.0",
+        "drupal/colorbutton": "^1.3",
         "drupal/commerce": "^2.22",
         "drupal/commerce_cart_api": "^1.4",
         "drupal/commerce_cart_redirection": "^3.0",

+ 278 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "358c436d15298ee7e7c259a8ef4fc85e",
+    "content-hash": "300e4fbb6e463643a6103937c14fc7d5",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -171,6 +171,24 @@
             "description": "Drupal code generator",
             "time": "2020-07-15T06:08:04+00:00"
         },
+        {
+            "name": "ckeditor-plugin/colorbutton",
+            "version": "4.16.2",
+            "dist": {
+                "type": "zip",
+                "url": "https://download.ckeditor.com/colorbutton/releases/colorbutton_4.16.2.zip"
+            },
+            "type": "drupal-library"
+        },
+        {
+            "name": "ckeditor-plugin/panelbutton",
+            "version": "4.16.2",
+            "dist": {
+                "type": "zip",
+                "url": "https://download.ckeditor.com/panelbutton/releases/panelbutton_4.16.2.zip"
+            },
+            "type": "drupal-library"
+        },
         {
             "name": "clue/stream-filter",
             "version": "v1.5.0",
@@ -2590,6 +2608,40 @@
             "homepage": "https://github.com/dompdf/dompdf",
             "time": "2020-08-30T22:54:22+00:00"
         },
+        {
+            "name": "drupal-ckeditor-libraries-group/font",
+            "version": "4.16.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/drupal-ckeditor-libraries-group/font.git",
+                "reference": "1260aa141cb8a7f7722ed273908249e7dfc33e72"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/drupal-ckeditor-libraries-group/font/zipball/1260aa141cb8a7f7722ed273908249e7dfc33e72",
+                "reference": "1260aa141cb8a7f7722ed273908249e7dfc33e72",
+                "shasum": ""
+            },
+            "type": "drupal-library",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "GPL-2.0-or-later",
+                "LGPL-2.1-or-later",
+                "MPL-1.1"
+            ],
+            "description": "CKEditor 4 font plugin",
+            "homepage": "https://ckeditor.com/cke4/addon/font",
+            "keywords": [
+                "CKEditor",
+                "font",
+                "plugin"
+            ],
+            "support": {
+                "issues": "https://github.com/ckeditor/ckeditor4/issues",
+                "source": "https://github.com/ckeditor/ckeditor4/tree/master/plugins/font"
+            },
+            "time": "2021-05-18T09:16:45+00:00"
+        },
         {
             "name": "drupal/address",
             "version": "1.9.0",
@@ -3754,6 +3806,174 @@
                 "issues": "https://www.drupal.org/project/issues/checklistapi"
             }
         },
+        {
+            "name": "drupal/ckeditor_font",
+            "version": "1.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/ckeditor_font.git",
+                "reference": "8.x-1.2"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/ckeditor_font-8.x-1.2.zip",
+                "reference": "8.x-1.2",
+                "shasum": "84462a78ddc4bbafb9ebc11f1e2871bfaa994a9f"
+            },
+            "require": {
+                "drupal-ckeditor-libraries-group/font": "^4.13.1",
+                "drupal/core": "^8 || ^9"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "8.x-1.2",
+                    "datestamp": "1617651505",
+                    "security-coverage": {
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0+"
+            ],
+            "authors": [
+                {
+                    "name": "Webbeh",
+                    "homepage": "https://www.drupal.org/user/1160608"
+                },
+                {
+                    "name": "cobenash",
+                    "homepage": "https://www.drupal.org/user/2138470"
+                },
+                {
+                    "name": "darol100",
+                    "homepage": "https://www.drupal.org/user/2667123"
+                },
+                {
+                    "name": "dinarcon",
+                    "homepage": "https://www.drupal.org/user/909522"
+                }
+            ],
+            "description": "This plugin adds Font Size and Font Family dropdowns that applies as inline element style.",
+            "homepage": "https://www.drupal.org/project/ckeditor_font",
+            "keywords": [
+                "Drupal"
+            ],
+            "support": {
+                "source": "http://cgit.drupalcode.org/ckeditor_font",
+                "issues": "http://drupal.org/project/issues/ckeditor_font"
+            }
+        },
+        {
+            "name": "drupal/ckeditor_uploadimage",
+            "version": "2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/ckeditor_uploadimage.git",
+                "reference": "8.x-2.0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/ckeditor_uploadimage-8.x-2.0.zip",
+                "reference": "8.x-2.0",
+                "shasum": "5ef494654bfa2b8a502f2ac8953e36e15a41ae00"
+            },
+            "require": {
+                "drupal/core": "^8.7.7 || ^9"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "8.x-2.0",
+                    "datestamp": "1587641759",
+                    "security-coverage": {
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0+"
+            ],
+            "authors": [
+                {
+                    "name": "Roland Michael dela Peña (arpeggio)",
+                    "homepage": "https://www.webfoobar.com",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "mertres",
+                    "homepage": "https://www.drupal.org/user/3513520"
+                }
+            ],
+            "description": "Integrates CKEditor's Upload Image plugin to Drupal. This enables Drupal's default WYSIWYG text editor capable of uploading images that were dropped or pasted from clipboard into the editor as inline image.",
+            "homepage": "https://drupal.org/project/ckeditor_uploadimage",
+            "support": {
+                "source": "https://git.drupalcode.org/project/ckeditor_uploadimage"
+            }
+        },
+        {
+            "name": "drupal/colorbutton",
+            "version": "1.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/colorbutton.git",
+                "reference": "8.x-1.3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/colorbutton-8.x-1.3.zip",
+                "reference": "8.x-1.3",
+                "shasum": "1a3c8996b1db88e30a512d1a329e570160d783df"
+            },
+            "require": {
+                "drupal/core": "^8 || ^9",
+                "drupal/panelbutton": "^1.3"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "8.x-1.3",
+                    "datestamp": "1626792032",
+                    "security-coverage": {
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Kevin Quillen (kevinquillen)",
+                    "homepage": "https://www.drupal.org/u/kevinquillen",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "ddrozdik",
+                    "homepage": "https://www.drupal.org/user/574124"
+                },
+                {
+                    "name": "kevinquillen",
+                    "homepage": "https://www.drupal.org/user/317279"
+                }
+            ],
+            "description": "Adds the Color Button plugin to CKEditor.",
+            "homepage": "http://drupal.org/project/colorbutton",
+            "keywords": [
+                "Drupal"
+            ],
+            "support": {
+                "source": "http://cgit.drupalcode.org/colorbutton",
+                "issues": "http://drupal.org/project/issues/colorbutton"
+            }
+        },
         {
             "name": "drupal/commerce",
             "version": "2.26.0",
@@ -10444,6 +10664,63 @@
                 "source": "https://git.drupalcode.org/project/pagerer"
             }
         },
+        {
+            "name": "drupal/panelbutton",
+            "version": "1.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/panelbutton.git",
+                "reference": "8.x-1.4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/panelbutton-8.x-1.4.zip",
+                "reference": "8.x-1.4",
+                "shasum": "9e4b83af312607242dde0e095e80fb68264208a1"
+            },
+            "require": {
+                "drupal/core": "^8 || ^9"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "8.x-1.4",
+                    "datestamp": "1626792838",
+                    "security-coverage": {
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Kevin Quillen (kevinquillen)",
+                    "homepage": "https://www.drupal.org/u/kevinquillen",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "ddrozdik",
+                    "homepage": "https://www.drupal.org/user/574124"
+                },
+                {
+                    "name": "kevinquillen",
+                    "homepage": "https://www.drupal.org/user/317279"
+                }
+            ],
+            "description": "Adds the Panel Button plugin to CKEditor. This plugin is a utility plugin that is required by certain user-facing CKEditor plugins.",
+            "homepage": "http://drupal.org/project/panelbutton",
+            "keywords": [
+                "Drupal"
+            ],
+            "support": {
+                "source": "http://cgit.drupalcode.org/panelbutton",
+                "issues": "http://drupal.org/project/issues/panelbutton"
+            }
+        },
         {
             "name": "drupal/password_policy",
             "version": "3.0.0",

+ 4 - 0
config/sync/core.extension.yml

@@ -22,6 +22,9 @@ module:
   bulkdelete: 0
   checklistapi: 0
   ckeditor: 0
+  ckeditor_font: 0
+  ckeditor_uploadimage: 0
+  colorbutton: 0
   commerce: 0
   commerce_cart: 0
   commerce_cart_api: 0
@@ -149,6 +152,7 @@ module:
   options: 0
   page_cache: 0
   pagerer: 0
+  panelbutton: 0
   path: 0
   path_alias: 0
   path_alias_xt: 0

+ 25 - 3
config/sync/editor.editor.full_html.yml

@@ -15,12 +15,23 @@ settings:
         -
           name: Formats
           items:
+            - Format
+            - Styles
+            - Underline
+            - Strike
             - Bold
             - Italic
+            - Blockquote
+        -
+          name: color
+          items:
+            - TextColor
+            - BGColor
         -
           name: Liens
           items:
             - DrupalLink
+            - Linkit
             - DrupalUnlink
         -
           name: Listes
@@ -30,20 +41,31 @@ settings:
         -
           name: Média
           items:
-            - Blockquote
             - DrupalImage
             - video_embed
         -
           name: Outils
           items:
             - Source
+        -
+          name: align
+          items:
+            - JustifyLeft
+            - JustifyCenter
+            - JustifyRight
+            - JustifyBlock
   plugins:
     stylescombo:
       styles: ''
     language:
       language_list: un
+    font:
+      font_names: ''
+      font_sizes: ''
+    colorbutton:
+      colors: ''
     linkit:
-      linkit_profile: ''
+      linkit_profile: default
     video_embed:
       defaults:
         children:
@@ -52,7 +74,7 @@ settings:
           width: '854'
           height: '480'
 image_upload:
-  status: false
+  status: true
   scheme: public
   directory: inline-images
   max_size: ''

+ 5 - 0
config/sync/field.field.node.simplenews_issue.body.yml

@@ -7,6 +7,11 @@ dependencies:
     - node.type.simplenews_issue
   module:
     - text
+    - unique_content_field_validation
+third_party_settings:
+  unique_content_field_validation:
+    unique: false
+    unique_text: ''
 _core:
   default_config_hash: WmXguLYedqjDlEM-2yau5wACNAMvrbCVHXQUn4GQEDA
 id: node.simplenews_issue.body

+ 23 - 18
config/sync/filter.format.full_html.yml

@@ -3,7 +3,7 @@ langcode: fr
 status: true
 dependencies:
   module:
-    - pathologic
+    - editor
     - url_to_video_filter
     - video_embed_wysiwyg
 name: 'full html'
@@ -23,22 +23,6 @@ filters:
     weight: 0
     settings:
       filter_url_length: 72
-  filter_html_image_secure:
-    id: filter_html_image_secure
-    provider: filter
-    status: true
-    weight: 9
-    settings: {  }
-  filter_pathologic:
-    id: filter_pathologic
-    provider: pathologic
-    status: true
-    weight: 50
-    settings:
-      settings_source: global
-      local_settings:
-        protocol_style: full
-        local_paths: ''
   filter_url_to_video:
     id: filter_url_to_video
     provider: url_to_video_filter
@@ -47,11 +31,32 @@ filters:
     settings:
       youtube: '1'
       youtube_webp_preview: '0'
-      autoload: '0'
       vimeo: '1'
+      autoload: '0'
   video_embed_wysiwyg:
     id: video_embed_wysiwyg
     provider: video_embed_wysiwyg
     status: true
     weight: 0
     settings: {  }
+  filter_html:
+    id: filter_html
+    provider: filter
+    status: false
+    weight: -10
+    settings:
+      allowed_html: '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt data-entity-type data-entity-uuid> <s> <p> <h1> <pre>'
+      filter_html_help: true
+      filter_html_nofollow: false
+  editor_file_reference:
+    id: editor_file_reference
+    provider: editor
+    status: true
+    weight: 0
+    settings: {  }
+  filter_html_image_secure:
+    id: filter_html_image_secure
+    provider: filter
+    status: true
+    weight: 9
+    settings: {  }

+ 13 - 0
config/sync/gdpr_fields.gdpr_fields_config.node.yml

@@ -16,5 +16,18 @@ bundles:
       notes: ''
       relationship: 0
       sars_filename: ''
+  simplenews_issue:
+    body:
+      bundle: simplenews_issue
+      name: body
+      entity_type_id: node
+      rtf: 'no'
+      rta: 'no'
+      enabled: false
+      anonymizer: ''
+      notes: ''
+      relationship: 0
+      sars_filename: ''
 filenames:
   thematique: ''
+  simplenews_issue: ''

+ 1 - 0
web/modules/custom/materio_simplenews/materio_simplenews.module

@@ -24,6 +24,7 @@ function materio_simplenews_form_node_simplenews_issue_form_alter(&$form, &$form
       // change default template regarding type of news
       $form['body']['widget'][0]['#default_value'] = materio_simplenews_getSimplenewsNodeBodyTemplate($news_id);
       $form['body']['widget'][0]['#rows'] = 50;
+      $form['body']['widget'][0]['#format'] = 'full_html';
     }
   }