-
Notifications
You must be signed in to change notification settings - Fork 4
NEW Migrate TinyMCE code and config to new repo #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
emteknetnz
merged 1 commit into
silverstripe:1.0
from
creative-commoners:pulls/1.0/migrate-here
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docs/en/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # For more information about the properties used in | ||
| # this file, please see the EditorConfig documentation: | ||
| # http://editorconfig.org/ | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [*.{yml,js,json,css,scss,eslintrc,feature}] | ||
| indent_size = 2 | ||
| indent_style = space | ||
|
|
||
| # Don't perform any clean-up on thirdparty files | ||
|
|
||
| [client/tinymce_lang/**] | ||
| trim_trailing_whitespace = false | ||
| insert_final_newline = false | ||
|
|
||
| [client/src/tinymce/**] | ||
| trim_trailing_whitespace = false | ||
| insert_final_newline = false | ||
|
|
||
| [composer.json] | ||
| indent_size = 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Ignore dist files | ||
| client/dist/ | ||
|
|
||
| # Ignore vendor | ||
| node_modules/ | ||
|
|
||
| # Ignore language files (auto-generated) | ||
| client/lang/ | ||
| client/tinymce_lang/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = require('@silverstripe/eslint-config/.eslintrc'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| ci: | ||
| uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .sass-cache | ||
| /vendor/ | ||
| /node_modules/ | ||
| /**/*.js.map | ||
| /**/*.css.map | ||
| yarn-error.log | ||
| composer.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| client/src/tinymce/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = require('@silverstripe/eslint-config/.stylelintrc'); |
GuySartorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <?php | ||
|
|
||
| use SilverStripe\Core\Manifest\ModuleLoader; | ||
| use SilverStripe\Forms\HTMLEditor\HTMLEditorConfig; | ||
| use SilverStripe\TinyMCE\TinyMCEConfig; | ||
|
|
||
| // Avoid creating global variables | ||
| call_user_func(function () { | ||
| $editorConfig = HTMLEditorConfig::get('cms'); | ||
|
|
||
| if (!$editorConfig instanceof TinyMCEConfig) { | ||
| return; | ||
| } | ||
|
|
||
| $editorConfig->setOptions([ | ||
| 'friendly_name' => 'Default CMS', | ||
| 'priority' => '50', | ||
| 'skin' => 'silverstripe', | ||
| 'contextmenu' => "searchreplace | sslink anchor ssmedia ssembed inserttable | cell row column deletetable", | ||
| 'use_native_selects' => false, | ||
| ]); | ||
| $editorConfig->insertButtonsAfter('table', 'anchor'); | ||
|
|
||
| // Prepare list of plugins to enable | ||
| $moduleManifest = ModuleLoader::inst()->getManifest(); | ||
| $module = $moduleManifest->getModule('silverstripe/htmleditor-tinymce'); | ||
| $plugins = []; | ||
|
|
||
| // Add link plugins if silverstripe/admin is installed. | ||
| // The JS in these relies on some of the admin code e.g. modals. | ||
| if ($moduleManifest->moduleExists('silverstripe/admin')) { | ||
| $plugins += [ | ||
| 'sslink' => $module->getResource('client/dist/js/TinyMCE_sslink.js'), | ||
| 'sslinkexternal' => $module->getResource('client/dist/js/TinyMCE_sslink-external.js'), | ||
| 'sslinkemail' => $module->getResource('client/dist/js/TinyMCE_sslink-email.js'), | ||
| ]; | ||
| // Move anchor button to be after the link button | ||
| $editorConfig->removeButtons('anchor'); | ||
| $editorConfig->insertButtonsAfter('sslink', 'anchor'); | ||
| } | ||
GuySartorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Add plugins for managing assets if silverstripe/asset-admin is installed | ||
| if ($moduleManifest->moduleExists('silverstripe/asset-admin')) { | ||
| $plugins += [ | ||
| 'ssmedia' => $module->getResource('client/dist/js/TinyMCE_ssmedia.js'), | ||
| 'ssembed' => $module->getResource('client/dist/js/TinyMCE_ssembed.js'), | ||
| 'sslinkfile' => $module->getResource('client/dist/js/TinyMCE_sslink-file.js'), | ||
| ]; | ||
| $editorConfig->insertButtonsAfter('table', 'ssmedia'); | ||
| $editorConfig->insertButtonsAfter('ssmedia', 'ssembed'); | ||
| } | ||
|
|
||
| // Add internal link plugins if silverstripe/cms is installed | ||
| if ($moduleManifest->moduleExists('silverstripe/cms')) { | ||
| $plugins += [ | ||
| 'sslinkinternal' => $module->getResource('client/dist/js/TinyMCE_sslink-internal.js'), | ||
| 'sslinkanchor' => $module->getResource('client/dist/js/TinyMCE_sslink-anchor.js'), | ||
| ]; | ||
| } | ||
|
|
||
| if (!empty($plugins)) { | ||
| $editorConfig->enablePlugins($plugins); | ||
| } | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| Name: tinymce-config | ||
| --- | ||
| SilverStripe\Forms\HTMLEditor\HTMLEditorConfig: | ||
| default_config_definitions: | ||
| cms: | ||
| configClass: 'SilverStripe\TinyMCE\TinyMCEConfig' | ||
GuySartorelli marked this conversation as resolved.
Show resolved
Hide resolved
emteknetnz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| SilverStripe\Admin\LeftAndMain: | ||
| extra_requirements_javascript: | ||
| - 'silverstripe/htmleditor-tinymce: client/dist/js/bundle.js' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| Name: tinymce-injector | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| SilverStripe\Forms\HTMLEditor\HTMLEditorConfig: | ||
| class: SilverStripe\TinyMCE\TinyMCEConfig | ||
GuySartorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| SilverStripe\TinyMCE\TinyMCEScriptGenerator: '%$SilverStripe\TinyMCE\TinyMCECombinedGenerator' | ||
| SilverStripe\TinyMCE\TinyMCECombinedGenerator: | ||
| class: SilverStripe\TinyMCE\TinyMCECombinedGenerator | ||
| properties: | ||
| AssetHandler: '%$SilverStripe\Assets\Storage\GeneratedAssetHandler' | ||
GuySartorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "presets": [ | ||
| "@babel/preset-env", | ||
| "@babel/preset-react" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Run TinyMCE behat tests with this command | ||
| # ========================================================================= # | ||
| # chromedriver | ||
| # vendor/bin/behat @htmleditor-tinymce | ||
| # ========================================================================= # | ||
| default: | ||
| suites: | ||
| htmleditor-tinymce: | ||
| paths: | ||
| - '%paths.modules.htmleditor-tinymce%/tests/behat/features' | ||
| contexts: | ||
| - SilverStripe\Framework\Tests\Behaviour\FeatureContext | ||
| - SilverStripe\Framework\Tests\Behaviour\CmsFormsContext | ||
| - SilverStripe\Framework\Tests\Behaviour\CmsUiContext | ||
| - SilverStripe\BehatExtension\Context\BasicContext | ||
| - SilverStripe\BehatExtension\Context\LoginContext | ||
| - SilverStripe\CMS\Tests\Behaviour\AnchorContext | ||
| - | ||
| SilverStripe\AssetAdmin\Tests\Behat\Context\FixtureContext: | ||
| - "%paths.modules.htmleditor-tinymce%/tests/behat/files/" | ||
|
|
||
| extensions: | ||
| SilverStripe\BehatExtension\MinkExtension: | ||
| default_session: facebook_web_driver | ||
| javascript_session: facebook_web_driver | ||
| facebook_web_driver: | ||
| browser: chrome | ||
| wd_host: "http://127.0.0.1:9515" #chromedriver port | ||
|
|
||
| SilverStripe\BehatExtension\Extension: | ||
| screenshot_path: '%paths.base%/artifacts/screenshots' | ||
| bootstrap_file: vendor/silverstripe/framework/tests/behat/serve-bootstrap.php |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.