Skip to content

Commit 8684a8e

Browse files
committed
MNT Add composer.json file
1 parent 8acb17c commit 8684a8e

386 files changed

Lines changed: 55302 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.doclintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/en/

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# For more information about the properties used in
2+
# this file, please see the EditorConfig documentation:
3+
# http://editorconfig.org/
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[*.{yml,js,json,css,scss,eslintrc,feature}]
17+
indent_size = 2
18+
indent_style = space
19+
20+
# Don't perform any clean-up on thirdparty files
21+
22+
[client/tinymce_lang/**]
23+
trim_trailing_whitespace = false
24+
insert_final_newline = false
25+
26+
[client/src/tinymce/**]
27+
trim_trailing_whitespace = false
28+
insert_final_newline = false
29+
30+
[composer.json]
31+
indent_size = 4

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore dist files
2+
client/dist/
3+
4+
# Ignore vendor
5+
node_modules/
6+
7+
# Ignore language files (auto-generated)
8+
client/lang/
9+
client/tinymce_lang/

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@silverstripe/eslint-config/.eslintrc');

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
ci:
10+
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.sass-cache
2+
/vendor/
3+
/node_modules/
4+
/**/*.js.map
5+
/**/*.css.map
6+
yarn-error.log
7+
composer.lock

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

.stylelintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
client/src/tinymce/*

.stylelintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@silverstripe/eslint-config/.stylelintrc');

_config.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
use SilverStripe\Core\Manifest\ModuleLoader;
4+
use SilverStripe\Forms\HTMLEditor\HTMLEditorConfig;
5+
use SilverStripe\TinyMCE\TinyMCEConfig;
6+
7+
// Avoid creating global variables
8+
call_user_func(function () {
9+
$editorConfig = HTMLEditorConfig::get('cms');
10+
11+
if (!$editorConfig instanceof TinyMCEConfig) {
12+
return;
13+
}
14+
15+
$editorConfig->setOptions([
16+
'friendly_name' => 'Default CMS',
17+
'priority' => '50',
18+
'skin' => 'silverstripe',
19+
'contextmenu' => "searchreplace | sslink anchor ssmedia ssembed inserttable | cell row column deletetable",
20+
'use_native_selects' => false,
21+
]);
22+
$editorConfig->insertButtonsAfter('table', 'anchor');
23+
24+
// Prepare list of plugins to enable
25+
$moduleManifest = ModuleLoader::inst()->getManifest();
26+
$module = $moduleManifest->getModule('silverstripe/htmleditor-tinymce');
27+
$plugins = [];
28+
29+
// Add link plugins if silverstripe/admin is installed.
30+
// The JS in these relies on some of the admin code e.g. modals.
31+
if ($moduleManifest->moduleExists('silverstripe/admin')) {
32+
$plugins += [
33+
'sslink' => $module->getResource('client/dist/js/TinyMCE_sslink.js'),
34+
'sslinkexternal' => $module->getResource('client/dist/js/TinyMCE_sslink-external.js'),
35+
'sslinkemail' => $module->getResource('client/dist/js/TinyMCE_sslink-email.js'),
36+
];
37+
// Move anchor button to be after the link button
38+
$editorConfig->removeButtons('anchor');
39+
$editorConfig->insertButtonsAfter('sslink', 'anchor');
40+
}
41+
42+
// Add plugins for managing assets if silverstripe/asset-admin is installed
43+
if ($moduleManifest->moduleExists('silverstripe/asset-admin')) {
44+
$plugins += [
45+
'ssmedia' => $module->getResource('client/dist/js/TinyMCE_ssmedia.js'),
46+
'ssembed' => $module->getResource('client/dist/js/TinyMCE_ssembed.js'),
47+
'sslinkfile' => $module->getResource('client/dist/js/TinyMCE_sslink-file.js'),
48+
];
49+
$editorConfig->insertButtonsAfter('table', 'ssmedia');
50+
$editorConfig->insertButtonsAfter('ssmedia', 'ssembed');
51+
}
52+
53+
// Add internal link plugins if silverstripe/cms is installed
54+
if ($moduleManifest->moduleExists('silverstripe/cms')) {
55+
$plugins += [
56+
'sslinkinternal' => $module->getResource('client/dist/js/TinyMCE_sslink-internal.js'),
57+
'sslinkanchor' => $module->getResource('client/dist/js/TinyMCE_sslink-anchor.js'),
58+
];
59+
}
60+
61+
if (!empty($plugins)) {
62+
$editorConfig->enablePlugins($plugins);
63+
}
64+
});

0 commit comments

Comments
 (0)