evolution-cms/ecodemirror 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

evolution-cms/ecodemirror

Composer 安装命令:

composer require evolution-cms/ecodemirror

包简介

CodeMirror 6 for Evolution CMS

README 文档

README

Modern CodeMirror 6 editor package for Evolution CMS 3.5.x. This package replaces the legacy CM5 plugin with a Composer‑installed, publishable, and extensible CM6 implementation.

Requirements

  • PHP ^8.3
  • Evolution CMS ^3.5.2
  • Composer 2.2+

Install

composer require evolution-cms/ecodemirror "*"

Register editor (optional auto‑set):

php artisan vendor:publish --tag=ecodemirror-config

Publish assets:

php artisan vendor:publish --tag=ecodemirror-assets

What gets published

  • Config (single source of truth):
    • core/custom/config/cms/settings/eCodeMirror.php
  • Assets:
    • public/assets/plugins/eCodeMirror/dist/eCodeMirror.js
    • public/assets/plugins/eCodeMirror/dist/eCodeMirror.css

System Settings (Overrides)

These are overrides only. The canonical config is core/custom/config/cms/settings/eCodeMirror.php.

  • ecm_profile
  • ecm_theme_mode (auto/light/dark)
  • ecm_theme
  • ecm_font_size
  • ecm_line_height
  • ecm_line_wrapping
  • ecm_emmet
  • ecm_search

Config structure (publish config)

Key sections:

  • profiles — preset options + extensions
  • contexts — map context → profile
  • themes — light/dark theme mapping
  • editor — base options (font, line height, history/state, gutters, keymap)
  • extensions — global feature toggles
  • protected_keys — options not overridable via params

Manager Events

Editor is wired into manager form events:

  • OnDocFormRender
  • OnTempFormRender
  • OnChunkFormRender
  • OnSnipFormRender
  • OnPluginFormRender
  • OnModFormRender
  • OnTVFormRender
  • OnRichTextEditorInit

Build (development only)

Node is required for development builds. In production, use published public/dist.

npm install
npm run build

Build output:

  • public/dist/eCodeMirror.js
  • public/dist/eCodeMirror.css

Notes

  • Assets are cache‑busted via ?v=<mtime> fallback.
  • Legacy CM5 plugin must be disabled when enabling eCodeMirror.
  • Emmet is enabled via profile extensions (emmet), lint currently provides JSON validation when lint is enabled.
  • For resource content, eCodeMirror activates only when richtext is disabled (no RTE), matching legacy behavior.
  • If you previously published core/custom/config/cms/settings/which_editor.php, remove it to avoid forcing eCodeMirror as the RTE.

License

GPL-2.0

统计信息

  • 总下载量: 47
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: TypeScript

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2026-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固