Skip to content
Snippets Groups Projects
Commit 7638a77f authored by Fabian Galinski's avatar Fabian Galinski :pouting_cat:
Browse files

Merge branch 'typo3v8compatibility' into 'master'

Typo3v8compatibility

See merge request !10
parents 166fe568 d3aaeae2
No related branches found
No related tags found
1 merge request!10Typo3v8compatibility
Showing
with 1325 additions and 86 deletions
......@@ -15,6 +15,7 @@ namespace SGalinski\Tinymce4Rte\Controller;
*/
use Psr\Http\Message\ServerRequestInterface;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -210,39 +211,60 @@ class BrowseLinksController extends AbstractLinkBrowserController {
return;
}
if (!empty($this->currentLinkParts['class'])) {
// remove required classes
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], true);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
if (VersionUtility::isVersion870OrHigher()) {
if (!empty($this->currentLinkParts['url'])) {
/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
$linkService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\LinkHandling\LinkService::class);
$data = $linkService->resolve($this->currentLinkParts['url']);
$this->currentLinkParts['type'] = $data['type'];
unset($data['type']);
$this->currentLinkParts['url'] = $data;
}
}
if (empty($this->currentLinkParts['data-htmlarea-external'])) {
// strip siteUrl prefix except for external and mail links
if (strpos($this->currentLinkParts['url'], 'mailto:') === false) {
$paramsPosition = strpos($this->currentLinkParts['url'], '?');
if ($paramsPosition !== false) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $paramsPosition + 1);
if (!empty($this->currentLinkParts['class'])) {
// Only keep last class value (others are automatically added again by required option)
// https://review.typo3.org/#/c/29643
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], true);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
}
}
// special treatment for page links, remove the id= part
$idPosition = strpos($this->currentLinkParts['url'], 'id=');
if ($idPosition !== false) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $idPosition + 3);
} else {
if (!empty($this->currentLinkParts['class'])) {
// remove required classes
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], TRUE);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
}
}
// in RTE the additional params are encoded directly at the end of the href part
// we need to split this again into dedicated fields
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '?');
if ($additionalParamsPosition === false) {
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '&');
}
if ($additionalParamsPosition !== false) {
$this->currentLinkParts['params'] = substr($this->currentLinkParts['url'], $additionalParamsPosition);
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], 0, $additionalParamsPosition);
// in case the first sign was an ? override it with &
$this->currentLinkParts['params'][0] = '&';
if (empty($this->currentLinkParts['data-htmlarea-external'])) {
// strip siteUrl prefix except for external and mail links
if (strpos($this->currentLinkParts['url'], 'mailto:') === FALSE) {
$paramsPosition = strpos($this->currentLinkParts['url'], '?');
if ($paramsPosition !== FALSE) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $paramsPosition + 1);
}
}
// special treatment for page links, remove the id= part
$idPosition = strpos($this->currentLinkParts['url'], 'id=');
if ($idPosition !== FALSE) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $idPosition + 3);
}
// in RTE the additional params are encoded directly at the end of the href part
// we need to split this again into dedicated fields
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '?');
if ($additionalParamsPosition === FALSE) {
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '&');
}
if ($additionalParamsPosition !== FALSE) {
$this->currentLinkParts['params'] = substr($this->currentLinkParts['url'], $additionalParamsPosition);
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], 0, $additionalParamsPosition);
// in case the first sign was an ? override it with &
$this->currentLinkParts['params'][0] = '&';
}
}
}
......@@ -589,4 +611,4 @@ class BrowseLinksController extends AbstractLinkBrowserController {
'contentTypo3Language' => $this->contentTypo3Language
];
}
}
\ No newline at end of file
}
......@@ -14,9 +14,9 @@ namespace SGalinski\Tinymce4Rte\Extension;
* The TYPO3 project - inspiring people to share!
*/
use SGalinski\Tinymce4Rte\RteHtmlAreaApi;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi;
/**
* TYPO3 Image plugin for htmlArea RTE
......
......@@ -18,6 +18,7 @@ use SGalinski\Tinymce\Loader;
use SGalinski\Tinymce4Rte\Extension\Typo3Image;
use SGalinski\Tinymce4Rte\Extension\Typo3Link;
use SGalinski\Tinymce4Rte\RteHtmlAreaApi;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Form\Element\AbstractFormElement;
use TYPO3\CMS\Backend\Form\InlineStackProcessor;
use TYPO3\CMS\Backend\Utility\BackendUtility;
......@@ -274,6 +275,10 @@ class RichTextElement extends AbstractFormElement {
$html = $this->getMainHtml();
if (isset($parameterArray['fieldConf']['config']['wizards']['RTE'])) {
unset($parameterArray['fieldConf']['config']['wizards']['RTE']);
}
$this->resultArray['html'] = $this->renderWizards(
array($html),
$parameterArray['fieldConf']['config']['wizards'],
......@@ -298,36 +303,21 @@ class RichTextElement extends AbstractFormElement {
$backendUser = $this->getBackendUserAuthentication();
if ($this->isInFullScreenMode()) {
$width = '100%';
$height = '100%';
$paddingRight = '0px';
$editorWrapWidth = '100%';
} else {
$options = $backendUser->userTS['options.'];
$width = 530 + (isset($options['RTELargeWidthIncrement']) ? (int) $options['RTELargeWidthIncrement'] : 150);
/** @var InlineStackProcessor $inlineStackProcessor */
$inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
$inlineStackProcessor->initializeByGivenStructure($this->data['inlineStructure']);
$inlineStructureDepth = $inlineStackProcessor->getStructureDepth();
$width -= $inlineStructureDepth > 0 ? ($inlineStructureDepth + 1) * 12 : 0;
$widthOverride = isset($backendUser->uc['rteWidth']) && trim($backendUser->uc['rteWidth']) ?: trim($this->processedRteConfiguration['RTEWidthOverride']);
if ($widthOverride) {
if (strstr($widthOverride, '%')) {
if ($this->client['browser'] !== 'msie') {
$width = (int) $widthOverride > 0 ? (int) $widthOverride : '100%';
}
} else {
$width = (int) $widthOverride > 0 ? (int) $widthOverride : $width;
}
}
$width = strstr($width, '%') ? $width : $width . 'px';
$height = 380 + (isset($options['RTELargeHeightIncrement']) ? (int) $options['RTELargeHeightIncrement'] : 0);
$heightOverride = isset($backendUser->uc['rteHeight']) && (int) $backendUser->uc['rteHeight'] ?: (int) $this->processedRteConfiguration['RTEHeightOverride'];
$height = $heightOverride > 0 ? $heightOverride . 'px' : $height . 'px';
$paddingRight = '2';
$editorWrapWidth = '99%';
}
$rteDivStyle = 'position:relative; left:0px; top:0px; height:' . $height . '; width:' . $width . '; border: 1px solid black; padding: 2 ' . $paddingRight . ' 2 2;';
$rteDivStyle = 'position:relative; left:0px; top:0px; height:' . $height . '; width: 100%;' . '; border: 1px solid black; padding: 2 ' . $paddingRight . ' 2 2;';
$itemFormElementName = $this->data['parameterArray']['itemFormElName'];
......@@ -338,14 +328,28 @@ class RichTextElement extends AbstractFormElement {
$value = $this->transformDatabaseContentToEditor($this->data['parameterArray']['itemFormElValue']);
// Remove this empty data attribute, otherwise an error will throw in TYPO3 8.7.
$validationResults = $this->getValidationDataAsDataAttribute(
$this->data['parameterArray']['fieldConf']['config']
);
if (VersionUtility::isVersion870OrHigher() &&
trim($validationResults) === 'data-formengine-validation-rules="[]"'
) {
$validationResults = '';
}
$result = array();
// next line is required to fix the scrolling toolbar elements in the tinymce
// also fixes the fullscreen dialog
$result[] = '<style>body{position:relative;}div.mce-fullscreen{top: 65px;}</style>';
// The hidden field tells the DataHandler that processing should be done on this value.
$result[] = '<input type="hidden" name="' . htmlspecialchars($triggerFieldName) . '" value="RTE" />';
// $result[] = '<div id="pleasewait' . $this->domIdentifier . '" class="pleasewait" style="display: block;" >';
// $result[] = $this->getLanguageService()->sL('LLL:EXT:tinymce4_rte/Resources/Private/Language/locallang.xlf:Please wait');
// $result[] = '</div>';
$result[] = '<div id="editorWrap' . $this->domIdentifier . '" class="editorWrap" style="width:' . $editorWrapWidth . '; height:100%;">';
$result[] = '<textarea ' . $this->getValidationDataAsDataAttribute($this->data['parameterArray']['fieldConf']['config']) . ' id="RTEarea' . $this->domIdentifier . '" class="tinymce4_rte" name="' . htmlspecialchars($itemFormElementName) . '" rows="0" cols="0" style="' . htmlspecialchars($rteDivStyle) . '">';
$result[] = '<textarea ' . $validationResults . ' id="RTEarea' . $this->domIdentifier . '" class="tinymce4_rte" name="' . htmlspecialchars($itemFormElementName) . '" rows="0" cols="0" style="' . htmlspecialchars($rteDivStyle) . '">';
$result[] = htmlspecialchars($value);
$result[] = '</textarea>';
$result[] = '</div>';
......@@ -591,18 +595,28 @@ class RichTextElement extends AbstractFormElement {
/** @var Loader $tinyMCE */
$tinyMCE = GeneralUtility::makeInstance(Loader::class);
$tinyMCE->loadConfiguration($this->vanillaRteTsConfig['properties']['default.']['tinymceConfiguration']);
if ($this->vanillaRteTsConfig['properties']['default.']['contentCSS'] !== '') {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ? $this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] : (array)$this->vanillaRteTsConfig['properties']['default.']['contentCSS'];
if (!empty($contentCssArray)) {
$contentCssFileArray = array();
foreach ($contentCssArray as $contentCssKey => $contentCssFile) {
$contentCssFileAbs = GeneralUtility::getFileAbsFileName(trim($contentCssFile));
if (is_file($contentCssFileAbs)) {
$contentCssFileArray[] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . PathUtility::stripPathSitePrefix($contentCssFileAbs) . '?' . filemtime($contentCssFileAbs);
}
$contentCssArray = [];
if (VersionUtility::isVersion870OrHigher()) {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ?
$this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] : [];
} else {
if ($this->vanillaRteTsConfig['properties']['default.']['contentCSS'] !== '') {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ?
$this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] :
(array) $this->vanillaRteTsConfig['properties']['default.']['contentCSS'];
}
}
if (!empty($contentCssArray)) {
$contentCssFileArray = [];
foreach ($contentCssArray as $contentCssKey => $contentCssFile) {
$contentCssFileAbs = GeneralUtility::getFileAbsFileName(trim($contentCssFile));
if (is_file($contentCssFileAbs)) {
$contentCssFileArray[] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . PathUtility::stripPathSitePrefix($contentCssFileAbs) . '?' . filemtime($contentCssFileAbs);
}
$tinyMCE->addConfigurationOption('content_css', implode(',', $contentCssFileArray));
}
$tinyMCE->addConfigurationOption('content_css', implode(',', $contentCssFileArray));
}
$tinyMCE->addConfigurationOption(
......@@ -626,12 +640,18 @@ class RichTextElement extends AbstractFormElement {
* @return string RTE initialization inline JavaScript code
*/
protected function getRteInitJsCode() {
$ajaxPingJavaScriptCode = '(function($) {
$(document).ready(function() {
$.get(TYPO3.settings.ajaxUrls[\'tinymce4_rte::ajaxPing\']);
});
})(TYPO3.jQuery);';
return 'if (typeof RTEarea === "undefined") {
RTEarea = new Object();
RTEarea[0] = new Object();
RTEarea[0].version = "' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tinymce4_rte']['version'] . '";
RTEarea[0].editorUrl = "' . ExtensionManagementUtility::extRelPath('tinymce4_rte') . '";
}';
}' . $ajaxPingJavaScriptCode;
}
/**
......
<?php
namespace SGalinski\Tinymce4Rte\Form\Resolver;
/*
......@@ -15,6 +16,7 @@ namespace SGalinski\Tinymce4Rte\Form\Resolver;
*/
use SGalinski\Tinymce4Rte\Form\Element\RichTextElement;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Form\NodeFactory;
use TYPO3\CMS\Backend\Form\NodeResolverInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
......@@ -44,7 +46,7 @@ class RichTextNodeResolver implements NodeResolverInterface {
/**
* Returns RichTextElement as class name if RTE widget should be rendered.
*
* @return string|void New class name or void if this resolver does not change current class name.
* @return string|NULL New class name or void if this resolver does not change current class name.
*/
public function resolve() {
$table = $this->data['tableName'];
......@@ -52,32 +54,54 @@ class RichTextNodeResolver implements NodeResolverInterface {
$row = $this->data['databaseRow'];
$parameterArray = $this->data['parameterArray'];
$backendUser = $this->getBackendUserAuthentication();
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
) {
// @todo: Most of this stuff is prepared by data providers within $this->data already
$specialConfiguration = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
// If "richtext" is within defaultExtras
if (isset($specialConfiguration['richtext'])) {
// Operates by reference on $row! 'pid' is changed ...
BackendUtility::fixVersioningPid($table, $row);
list($recordPid, $tsConfigPid) = BackendUtility::getTSCpidCached($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
if ($tsConfigPid >= 0) {
// Fetch page ts config and do some magic with it to find out if RTE is disabled on TS level.
$rteSetup = $backendUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($recordPid));
$rteTcaTypeValue = $this->data['recordTypeValue'];
$rteSetupConfiguration = BackendUtility::RTEsetup($rteSetup['properties'], $table, $fieldName, $rteTcaTypeValue);
if (!$rteSetupConfiguration['disabled']) {
// Finally, we're sure the editor should really be rendered ...
return RichtextElement::class;
if (VersionUtility::isVersion870OrHigher()) {
$parameterArray = $this->data['parameterArray'];
$backendUser = $this->getBackendUserAuthentication();
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
// If RTE is enabled for field
&& isset($parameterArray['fieldConf']['config']['enableRichtext'])
&& (bool) $parameterArray['fieldConf']['config']['enableRichtext'] === TRUE
// If RTE config is found (prepared by TcaText data provider)
&& isset($parameterArray['fieldConf']['config']['richtextConfiguration'])
&& is_array($parameterArray['fieldConf']['config']['richtextConfiguration'])
// If RTE is not disabled on configuration level
&& !$parameterArray['fieldConf']['config']['richtextConfiguration']['disabled']
) {
return RichTextElement::class;
}
} else {
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
) {
// @todo: Most of this stuff is prepared by data providers within $this->data already
$specialConfiguration = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
// If "richtext" is within defaultExtras
if (isset($specialConfiguration['richtext'])) {
// Operates by reference on $row! 'pid' is changed ...
BackendUtility::fixVersioningPid($table, $row);
list($recordPid, $tsConfigPid) = BackendUtility::getTSCpidCached($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
if ($tsConfigPid >= 0) {
// Fetch page ts config and do some magic with it to find out if RTE is disabled on TS level.
$rteSetup = $backendUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($recordPid));
$rteTcaTypeValue = $this->data['recordTypeValue'];
$rteSetupConfiguration = BackendUtility::RTEsetup(
$rteSetup['properties'], $table, $fieldName, $rteTcaTypeValue
);
if (!$rteSetupConfiguration['disabled']) {
// Finally, we're sure the editor should really be rendered ...
return RichTextElement::class;
}
}
}
}
}
return NULL;
}
......
<?php
namespace SGalinski\Tinymce4Rte\Service;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class SGalinski\SgRoutes\Service\LicensingService
*/
class LicensingService {
/**
* Licensing Service Url
*/
const URL = 'https://www.sgalinski.de/?eID=sgLicensing';
/**
* The key name of the uc array inside of the backend user.
*/
const BACKEND_USER_UC_KEY = 'tinymce4_rte_pinged';
/**
* Licensing Service Url
*/
const EXTENSION_KEY = 'tinymce4_rte';
/** @var bool|NULL */
private static $isLicenseKeyValid;
/**
* @return boolean
*/
public static function checkKey(): bool {
if (static::$isLicenseKeyValid === NULL) {
static::$isLicenseKeyValid = FALSE;
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
if (isset($configuration['key']) && $key = trim($configuration['key'])) {
static::$isLicenseKeyValid = (bool) preg_match('/^([A-Z\d]{6}-?){4}$/', $key);
}
}
return static::$isLicenseKeyValid;
}
/**
* Licensing Service ping
*
* @param boolean $returnUrl
* @return string
*/
public static function ping($returnUrl = FALSE): string {
try {
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
$key = '';
if (isset($configuration['key'])) {
$key = trim($configuration['key']);
}
$params = [
'extension' => self::EXTENSION_KEY,
'host' => GeneralUtility::getIndpEnv('HTTP_HOST'),
// @todo Enable this, when inserting a licensing.
//'key' => $key
];
$params = http_build_query($params);
$pingUrl = self::URL;
$pingUrl .= $params !== '' ? (strpos($pingUrl, '?') === FALSE ? '?' : '&') . $params : '';
if ($returnUrl) {
return $pingUrl;
}
GeneralUtility::getUrl($pingUrl);
} catch (\Exception $exception) {
}
return '';
}
/**
* Generates a random password string based on the configured password policies.
*
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @return ResponseInterface
* @throws \InvalidArgumentException
*/
public function ajaxPing(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface {
/** @var BackendUserAuthentication $backendUser */
$backendUser = $GLOBALS['BE_USER'];
$backendUserUC = $backendUser->uc;
if ($backendUser && !isset($backendUserUC[self::BACKEND_USER_UC_KEY])) {
$backendUserUC[self::BACKEND_USER_UC_KEY] = TRUE;
$backendUser->writeUC($backendUserUC);
self::ping();
}
return $response;
}
}
<?php
namespace SGalinski\Tinymce4Rte\Utility;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
/**
* Helper class to detect the used TYPO3 version.
*/
class VersionUtility {
/**
* Returns true if the current version ts TYPO3 6.2.
*
* @return bool
*/
public static function isVersion62() {
$versionNumber = self::getVersion();
return ($versionNumber >= 6002000 && $versionNumber < 7000000);
}
/**
* Returns true if the current version ts TYPO3 7.6 and less version 8
*
* @return bool
*/
public static function isVersion76() {
$versionNumber = self::getVersion();
return ($versionNumber >= 7006000 && $versionNumber < 8000000);
}
/**
* Returns true if the current version ts TYPO3 7.6 or later
*
* @return bool
*/
public static function isVersion76OOrHigher() {
return (self::getVersion() >= 7006000);
}
/**
* Returns true if the current version ts TYPO3 8.7 or later
*
* @return bool
*/
public static function isVersion870OrHigher() {
return (self::getVersion() >= 8007000);
}
/**
* Returns the current version as an integer.
*
* @return int
*/
protected static function getVersion() {
return VersionNumberUtility::convertVersionNumberToInteger(
VersionNumberUtility::getNumericTypo3Version()
);
}
}
......@@ -13,4 +13,8 @@ return [
'path' => '/rte/insert-image',
'target' => \SGalinski\Tinymce4Rte\Controller\SelectImageController::class . '::buildImageMarkup',
],
'tinymce4_rte::ajaxPing' => [
'path' => '/tinymce4_rte/ajaxPing',
'target' => \SGalinski\Tinymce4Rte\Service\LicensingService::class . '::ajaxPing',
]
];
......@@ -7,17 +7,27 @@ tinymce.init({
autoresize_max_height: 500,
plugins: [
'advlist autolink lists charmap hr anchor pagebreak searchreplace wordcount visualblocks visualchars code',
'nonbreaking save table directionality template paste colorpicker autoresize shy contextmenu'
'nonbreaking save table directionality template paste colorpicker autoresize shy contextmenu fullscreen help',
'codemirror'
],
// Currently not in use typo3image
toolbar1: 'undo redo | styleselect | bold italic | typo3image typo3link unlink | ' +
'alignleft aligncenter alignright alignjustify | bullist numlist outdent indent',
'alignleft aligncenter alignright | bullist numlist outdent indent | fullscreen | help | code',
external_plugins: {
codemirror: 'EXT:tinymce4_rte/Resources/Public/Plugins/tinymce-codemirror/plugins/codemirror/plugin.min.js',
shy: 'EXT:tinymce/Resources/Public/JavaScript/TinymcePlugins/shy/plugin.min.js',
typo3filemanager: 'EXT:tinymce4_rte/Resources/Public/Plugins/Typo3FileManager/typo3filemanager.min.js',
shy: 'EXT:tinymce/Resources/Public/JavaScript/TinymcePlugins/shy/plugin.min.js'
},
// Currently not in use typo3image
contextmenu: 'typo3link unlink inserttable | cell row column deletetable'
contextmenu: 'typo3link unlink inserttable | cell row column deletetable',
codemirror: {
indentOnInit: true,
config: {
// provokes problems while doing copy&paste from the source code window
lineNumbers: false
},
path: 'EXT:tinymce4_rte/Resources/Public/Plugins/tinymce-codemirror/plugins/codemirror/CodeMirror/'
},
// Example for adding/changing style formats
......@@ -56,6 +66,9 @@ tinymce.init({
// ]
// }
// ],
// Activate this, if you've a lot of "style_formats", which could just be applied to specific tags. This can bring a
// better structure, but if you don't have much, then this option will just confuse the customer.
// style_formats_autohide: true,
// formats: {
// greenBox: {
// block: 'div',
......@@ -64,4 +77,4 @@ tinymce.init({
// classes: 'box-green'
// }
// }
});
\ No newline at end of file
});
......@@ -6,4 +6,16 @@ Augments the tinymce-extension with a more powerful and userfriendly interface.
Currently the image browser isn't integrated well in TYPO3 anymore. The wizard dialog can be added, but it crashed
with errors. Also the code in TYPO3 itself is broken and incompatible currently. We will integrate the wizard again if
the dialog will be reintegrated in rtehtmlarea again.
\ No newline at end of file
the dialog will be reintegrated in rtehtmlarea again.
## FAQ
### How can I stop, that my custom classes for the table tag are removed in the frontend?
Just add these two lines into your TypoScript and adapt the class at the end of each line.
This will prevent the deletion of the custom classes from the table tag within the frontend.
```
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.default = responsive
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.list = responsive
```
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
indent_size = 2
node_modules/
*.DS_Store
[submodule "plugins/codemirror/codemirror"]
path = plugins/codemirror/codemirror
url = https://github.com/codemirror/CodeMirror.git
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
Copyright 2013-2015 Arjan Haverkamp (arjan@webgear.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
CodeMirror for TinyMCE4
=======================
The [TinyMCE][] wysiwyg editor comes with a very basic HTML source editor.This
plugin for TinyMCE makes editing HTML source code a more pleasant experience. It
is based on the excellent [CodeMirror][] code editor, developed by Marijn Haverbeke.
This plugin offers the following functionality:
- Syntax highlighting of HTML, Javascript and PHP code
- Line numbers
- Highlighting the line currently being edited
- Automatic indentation
- Many undo/redo levels
- Search/Replace functionality
- Etc. etc.
[TinyMCE]: http://www.tinymce.com/
[CodeMirror]: http://codemirror.net/
Requirements
------------
If you already have codemirror used in your project, you can configure the codemirror path in your configuration, see bellow.
If you don't have codemirror, you need to add it as submodule like this:
1. cd into your tiny_mce directory, which contains folders like: classes, langs, plugins, skins ans themes
2. open terminal and run: git submodule add https://github.com/codemirror/CodeMirror.git plugins/codemirror/codemirror
3. cd into plugins/codemirror/codemirror
4. run command: sudo npm install
5. run command: npm run-script prepublish
Installation
------------
1. Download and install TinyMCE 4 and make sure it runs correctly with default settings.
2. Download this repository found at https://github.com/christiaan/tinymce-codemirror
3. Place the directory `plugins/codemirror` in the `tinymce/plugins` directory.
4. Download CodeMirror (version 4 or later) from http://codemirror.net/codemirror-latest.zip.
5. Unpack codemirror-latest.zip inside the plugins/codemirror folder that was
just created. A folder named codemirror-4.8 (or similar) will be created.
6. Activate the codemirror plugin in TinyMCE:
plugins: ['codemirror']
7. Optionally, add the code button to TinyMCE’s toolbar:
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code'
8. Test: You should see a Source code item in the Tools menu. Click it to edit
the HTML source code.
Configuration
-------------
Additional configuration options
You can modify the behaviour of the codemirror plugin, by adding a codemirror
object to the TinyMCE configuration.
**indentOnInit**: boolean (false) CodeMirror automatically indents code. With
the indentOnInit option, you tell the Source Code editor to indent all code when
the editor opens. This might be slow for large documents.
**fullscreen** boolean (false) Whether to load the tinymce plugin and codemirror
in full screen mode.
**width**: int (800) Codemirror window width
**height**: int (550) Codemirror window height
**saveCursorPosition**: boolean (true) Insert caret marker
**path**: string (codemirror) You might already have CodeMirror hosted elsewhere
(outside TinyMCE). In that case, you can reuse that CodeMirror instance, by
overriding the default path. For example:
path: 'http://www.mysite.com/tools/codemirror-x.y'
**config**: Object CodeMirror configuration object, which is passed on to the
CodeMirror instance. Check http://codemirror.net/doc/manual.html for available
configuration options.
**jsFiles**: Array Array of CodeMirror Javascript files you want to
(additionally) load. For example:
jsFiles: [
'mode/clike/clike.js',
'mode/php/php.js'
]
The following Javascript files are always loaded: lib/codemirror.js,
addon/edit/matchbrackets.js, mode/xml/xml.js, mode/javascript/javascript.js,
mode/css/css.js, mode/htmlmixed/htmlmixed.js, addon/dialog/dialog.js,
addon/search/searchcursor.js, addon/search/search.js,
addon/selection/active-line.js.
**cssFiles**: Array Array of CodeMirror CSS files you want to (additionally)
load. For example:
cssFiles: [
'theme/neat.css',
'theme/elegant.css'
]
The following CSS files are always loaded: lib/codemirror.css,
addon/dialog/dialog.css.
Config example
```js
tinymce.init({
selector: '#html',
plugins: 'codemirror',
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code',
codemirror: {
indentOnInit: true, // Whether or not to indent code on init.
fullscreen: true, // Default setting is false
path: 'CodeMirror', // Path to CodeMirror distribution
config: { // CodeMirror config object
mode: 'application/x-httpd-php',
lineNumbers: false
},
width: 800, // Default value is 800
height: 600, // Default value is 550
saveCursorPosition: true // Insert caret marker
jsFiles: [ // Additional JS files to load
'mode/clike/clike.js',
'mode/php/php.js'
]
}
});
```
Compatibility
-------------
This TinyMCE plugin is compatible with pretty much all browsers out there,
including Firefox, Google Chrome, Safari and Internet Explorer, version 8 or
better. It is NOT compatible with Interner Explorer 6 or 7, simply because
CodeMirror itself does not work in these versions.
Contributing
------------
Run `npm install` in the project folder to install the development dependencies.
When making changes to `plugins/codemirror/plugin.js`, be sure to run
`npm run prepublish` before committing. The `prepublish` script will generate
the `plugins/codemirror/plugin.min.js` file.
Changelog
---------
Version 1.5.1 - 2017-01-20
- FIX: "main" path for codemirror plugin
- IMP: add codemirror as submodule
- IMP: Update Readme
Version 1.5 - 2016-09-14
- Bugfix: Cursor position inside JS, style or &nbps; #2
- Bugfix: z-index issue with table panel and source code dialog #6
- Add: Added CSS and set default CM theme
- Add: Better defaults, per codeMirror
- Add: codemirror config window width and height
Version 1.4 - 2014-12-15
- Bugfix: Replace setLine call to replaceRange (for CodeMirror 4)
This fixed `&#x0;` appearing in the source code.
- Note: This plugin requires CodeMirror version 4 (3 is no longer supported)
Version 1.3 - 2014-03-04
- Bugfix: If any text was highlighted in CodeMirror and the code dialog is
closed and saved, the selected text was removed from TinyMCE.
- Macintosh users now see Macintosh keyboard shortcuts.
Version 1.2 - 2013-09-04
- Dirty state of CodeMirror now passed on to TinyMCE.
- When submitting CodeMirror code to TinyMCE, cursor position is retained.
Note: this only works when the cursor is *not* inside a <tag>.
Version 1.1 - 2013-07-19
- New options jsFiles and cssFiles.
Version 1.0 - 2013-06-29
- Initial release.
Contributors
------------
Arjan Haverkamp <arjan@avoid.org> - original author
Contributors details, check on GitHub: https://github.com/christiaan/tinymce-codemirror/graphs/contributors
Resources/Public/Plugins/tinymce-codemirror/codemirror-logo.png

5.82 KiB

Resources/Public/Plugins/tinymce-codemirror/editor.png

60.1 KiB

TinyMCE
{
"name": "tinymce-codemirror",
"version": "1.5.1",
"description": "CodeMirror for TinyMCE 4",
"main": "plugins/codemirror/plugin.js",
"repository": {
"type": "git",
"url": "git+https://github.com/christiaan/tinymce-codemirror.git"
},
"scripts" : {
"prepublish": "./node_modules/.bin/uglifyjs plugins/codemirror/plugin.js -o plugins/codemirror/plugin.min.js -m"
},
"keywords": [
"tinymce",
"codemirror"
],
"author": "Arjan Haverkamp",
"license": "ISC",
"bugs": {
"url": "https://github.com/christiaan/tinymce-codemirror/issues"
},
"homepage": "https://github.com/christiaan/tinymce-codemirror#readme",
"devDependencies": {
"uglify-js": "^2.7.0"
}
}
List of CodeMirror contributors. Updated before every release.
4r2r
Aaron Brooks
Abdelouahab
Abe Fettig
Adam Ahmed
Adam King
adanlobato
Adán Lobato
Adrian Aichner
aeroson
Ahmad Amireh
Ahmad M. Zawawi
ahoward
Akeksandr Motsjonov
Alberto González Palomo
Alberto Pose
Albert Xing
Alexander Pavlov
Alexander Schepanovski
Alexander Shvets
Alexander Solovyov
Alexandre Bique
alexey-k
Alex Piggott
Aliaksei Chapyzhenka
Amsul
amuntean
Amy
Ananya Sen
anaran
AndersMad
Anders Nawroth
Anderson Mesquita
Andrea G
Andreas Reischuck
Andre von Houck
Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov
Andy Joslin
Andy Kimball
Andy Li
angelozerr
angelo.zerr@gmail.com
Ankit
Ankit Ahuja
Ansel Santosa
Anthony Grimes
Anton Kovalyov
areos
as3boyan
AtomicPages LLC
Atul Bhouraskar
Aurelian Oancea
Bastian Müller
Bem Jones-Bey
benbro
Beni Cherniavsky-Paskin
Benjamin DeCoste
Ben Keen
Bernhard Sirlinger
Bert Chang
Billy Moon
binny
B Krishna Chaitanya
Blaine G
blukat29
boomyjee
borawjm
Brandon Frohs
Brandon Wamboldt
Brett Zamir
Brian Grinstead
Brian Sletten
Bruce Mitchener
Chandra Sekhar Pydi
Charles Skelton
Cheah Chu Yeow
Chris Coyier
Chris Granger
Chris Houseknecht
Chris Morgan
Christian Oyarzun
Christian Petrov
Christopher Brown
ciaranj
CodeAnimal
ComFreek
Curtis Gagliardi
dagsta
daines
Dale Jung
Dan Bentley
Dan Heberden
Daniel, Dao Quang Minh
Daniele Di Sarli
Daniel Faust
Daniel Huigens
Daniel KJ
Daniel Neel
Daniel Parnell
Danny Yoo
darealshinji
Darius Roberts
Dave Myers
David Mignot
David Pathakjee
David Vázquez
deebugger
Deep Thought
Devon Carew
dignifiedquire
Dimage Sapelkin
Dmitry Kiselyov
domagoj412
Dominator008
Domizio Demichelis
Doug Wikle
Drew Bratcher
Drew Hintz
Drew Khoury
Dror BG
duralog
eborden
edsharp
ekhaled
Enam Mijbah Noor
Eric Allam
eustas
Fabien O'Carroll
Fabio Zendhi Nagao
Faiza Alsaied
Fauntleroy
fbuchinger
feizhang365
Felipe Lalanne
Felix Raab
Filip Noetzel
flack
ForbesLindesay
Forbes Lindesay
Ford_Lawnmower
Forrest Oliphant
Frank Wiegand
Gabriel Gheorghian
Gabriel Horner
Gabriel Nahmias
galambalazs
Gautam Mehta
gekkoe
Gerard Braad
Gergely Hegykozi
Giovanni Calò
Glenn Jorde
Glenn Ruehle
Golevka
Gordon Smith
Grant Skinner
greengiant
Gregory Koberger
Guillaume Massé
Guillaume Massé
Gustavo Rodrigues
Hakan Tunc
Hans Engel
Hardest
Hasan Karahan
Herculano Campos
Hiroyuki Makino
hitsthings
Hocdoc
Ian Beck
Ian Dickinson
Ian Wehrman
Ian Wetherbee
Ice White
ICHIKAWA, Yuji
ilvalle
Ingo Richter
Irakli Gozalishvili
Ivan Kurnosov
Jacob Lee
Jakob Miland
Jakub Vrana
Jakub Vrána
James Campos
James Thorne
Jamie Hill
Jan Jongboom
jankeromnes
Jan Keromnes
Jan Odvarko
Jan T. Sott
Jared Forsyth
Jason
Jason Barnabe
Jason Grout
Jason Johnston
Jason San Jose
Jason Siefken
Jaydeep Solanki
Jean Boussier
jeffkenton
Jeff Pickhardt
jem (graphite)
Jeremy Parmenter
Jochen Berger
Johan Ask
John Connor
John Lees-Miller
John Snelson
John Van Der Loo
Jonathan Malmaud
jongalloway
Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn
Joseph Pecoraro
Joshua Newman
Josh Watzman
jots
jsoojeon
Juan Benavides Romero
Jucovschi Constantin
Juho Vuori
Justin Hileman
jwallers@gmail.com
kaniga
Ken Newman
Ken Rockot
Kevin Sawicki
Kevin Ushey
Klaus Silveira
Koh Zi Han, Cliff
komakino
Konstantin Lopuhin
koops
ks-ifware
kubelsmieci
KwanEsq
Lanfei
Lanny
Laszlo Vidacs
leaf corcoran
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
Liam Newman
LM
lochel
Lorenzo Stoakes
Luciano Longo
Luke Stagner
lynschinzer
Maksim Lin
Maksym Taran
Malay Majithia
Manuel Rego Casasnovas
Marat Dreizin
Marcel Gerber
Marco Aurélio
Marco Munizaga
Marcus Bointon
Marek Rudnicki
Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Lentczner
Marko Bonaci
Martin Balek
Martín Gaitán
Martin Hasoň
Mason Malone
Mateusz Paprocki
Mathias Bynens
mats cronqvist
Matthew Beale
Matthias Bussonnier
Matthias BUSSONNIER
Matt McDonald
Matt Pass
Matt Sacks
mauricio
Maximilian Hils
Maxim Kraev
Max Kirsch
Max Xiantu
mbarkhau
Metatheos
Micah Dubinko
Michael Lehenbauer
Michael Zhou
Mighty Guava
Miguel Castillo
mihailik
Mike
Mike Brevoort
Mike Diaz
Mike Ivanov
Mike Kadin
MinRK
Miraculix87
misfo
mloginov
Moritz Schwörer
mps
mtaran-google
Narciso Jaramillo
Nathan Williams
ndr
nerbert
nextrevision
ngn
nguillaumin
Ng Zhi An
Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Small
Niels van Groningen
nightwing
Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
nilp0inter
Nisarg Jhaveri
nlwillia
Norman Rzepka
pablo
Page
Panupong Pasupat
paris
Patil Arpith
Patrick Stoica
Patrick Strawderman
Paul Garvin
Paul Ivanov
Pavel Feldman
Pavel Strashkin
Paweł Bartkiewicz
peteguhl
Peter Flynn
peterkroon
Peter Kroon
prasanthj
Prasanth J
Radek Piórkowski
Rahul
Randall Mason
Randy Burden
Randy Edmunds
Rasmus Erik Voel Jensen
Ray Ratchup
Richard van der Meer
Richard Z.H. Wang
Robert Crossfield
Roberto Abdelkader Martínez Pérez
robertop23
Robert Plummer
Ruslan Osmanov
Ryan Prior
sabaca
Samuel Ainsworth
sandeepshetty
Sander AKA Redsandro
santec
Sascha Peilicke
satchmorun
sathyamoorthi
SCLINIC\jdecker
Scott Aikin
Scott Goodhew
Sebastian Zaha
shaund
shaun gilchrist
Shawn A
sheopory
Shiv Deepak
Shmuel Englard
Shubham Jain
silverwind
snasa
soliton4
sonson
spastorelli
srajanpaliwal
Stanislav Oaserele
Stas Kobzar
Stefan Borsje
Steffen Beyer
Steve O'Hara
stoskov
Taha Jahangir
Takuji Shimokawa
Tarmil
tel
tfjgeorge
Thaddee Tyl
TheHowl
think
Thomas Dvornik
Thomas Schmid
Tim Alby
Tim Baumann
Timothy Farrell
Timothy Hatcher
TobiasBg
Tomas-A
Tomas Varaneckas
Tom Erik Støwer
Tom MacWright
Tony Jian
Travis Heppe
Triangle717
twifkak
Vestimir Markov
vf
Vincent Woo
Volker Mische
wenli
Wesley Wiser
Will Binns-Smith
William Jamieson
William Stein
Willy
Wojtek Ptak
Xavier Mendez
Yassin N. Hassan
YNH Webdev
Yunchi Luo
Yuvi Panda
Zachary Dremann
Zhang Hao
zziuni
魏鹏刚
# How to contribute
- [Getting help](#getting-help-)
- [Submitting bug reports](#submitting-bug-reports-)
- [Contributing code](#contributing-code-)
## Getting help
Community discussion, questions, and informal bug reporting is done on the
[discuss.CodeMirror forum](http://discuss.codemirror.net).
## Submitting bug reports
The preferred way to report bugs is to use the
[GitHub issue tracker](http://github.com/codemirror/CodeMirror/issues). Before
reporting a bug, read these pointers.
**Note:** The issue tracker is for *bugs*, not requests for help. Questions
should be asked on the
[discuss.CodeMirror forum](http://discuss.codemirror.net) instead.
### Reporting bugs effectively
- CodeMirror is maintained by volunteers. They don't owe you anything, so be
polite. Reports with an indignant or belligerent tone tend to be moved to the
bottom of the pile.
- Include information about **the browser in which the problem occurred**. Even
if you tested several browsers, and the problem occurred in all of them,
mention this fact in the bug report. Also include browser version numbers and
the operating system that you're on.
- Mention which release of CodeMirror you're using. Preferably, try also with
the current development snapshot, to ensure the problem has not already been
fixed.
- Mention very precisely what went wrong. "X is broken" is not a good bug
report. What did you expect to happen? What happened instead? Describe the
exact steps a maintainer has to take to make the problem occur. We can not
fix something that we can not observe.
- If the problem can not be reproduced in any of the demos included in the
CodeMirror distribution, please provide an HTML document that demonstrates
the problem. The best way to do this is to go to
[jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
include the resulting link in your bug report.
## Contributing code
- Make sure you have a [GitHub Account](https://github.com/signup/free)
- Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
([how to fork a repo](https://help.github.com/articles/fork-a-repo))
- Make your changes
- If your changes are easy to test or likely to regress, add tests.
Tests for the core go into `test/test.js`, some modes have their own
test suite under `mode/XXX/test.js`. Feel free to add new test
suites to modes that don't have one yet (be sure to link the new
tests into `test/index.html`).
- Follow the general code style of the rest of the project (see
below). Run `bin/lint` to verify that the linter is happy.
- Make sure all tests pass. Visit `test/index.html` in your browser to
run them.
- Submit a pull request
([how to create a pull request](https://help.github.com/articles/fork-a-repo))
### Coding standards
- 2 spaces per indentation level, no tabs.
- Include semicolons after statements.
- Note that the linter (`bin/lint`) which is run after each commit
complains about unused variables and functions. Prefix their names
with an underscore to muffle it.
- CodeMirror does *not* follow JSHint or JSLint prescribed style.
Patches that try to 'fix' code to pass one of these linters will be
unceremoniously discarded.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment