first commit
This commit is contained in:
commit
1218dd1517
12716 files changed
+989233
No files matched your search
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents an addon for CodeMirror
|
||||
* @internal
|
||||
*/
|
||||
class Addon
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $identifier = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $modes = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $cssFiles = [];
|
||||
|
||||
/**
|
||||
* @param string $identifier
|
||||
*/
|
||||
public function __construct(string $identifier)
|
||||
{
|
||||
$this->identifier = $identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $modes
|
||||
* @return self
|
||||
*/
|
||||
public function setModes(array $modes): Addon
|
||||
{
|
||||
$this->modes = $modes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getModes(): array
|
||||
{
|
||||
return $this->modes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @return self
|
||||
*/
|
||||
public function setOptions(array $options): Addon
|
||||
{
|
||||
$this->options = $options;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $cssFiles
|
||||
* @return self
|
||||
*/
|
||||
public function setCssFiles(array $cssFiles): Addon
|
||||
{
|
||||
$this->cssFiles = $cssFiles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getCssFiles(): array
|
||||
{
|
||||
return $this->cssFiles;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\T3editor\Controller;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Http\HtmlResponse;
|
||||
use TYPO3\CMS\Core\Http\JsonResponse;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\RootlineUtility;
|
||||
|
||||
/**
|
||||
* Code completion for t3editor
|
||||
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class CodeCompletionController
|
||||
{
|
||||
/**
|
||||
* Loads all templates up to a given page id (walking the rootline) and
|
||||
* cleans parts that are not required for the t3editor codecompletion.
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function loadCompletions(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
// Check whether access is granted (only admin have access to sys_template records):
|
||||
if (!$GLOBALS['BE_USER']->isAdmin()) {
|
||||
return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:t3editor/Resources/Private/Language/locallang.xlf:noPermission'), 500);
|
||||
}
|
||||
$pageId = (int)($request->getParsedBody()['pageId'] ?? $request->getQueryParams()['pageId']);
|
||||
// Check whether there is a pageId given:
|
||||
if (!$pageId) {
|
||||
return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:t3editor/Resources/Private/Language/locallang.xlf:pageIDInteger'), 500);
|
||||
}
|
||||
// Fetch the templates
|
||||
return (new JsonResponse())->setPayload($this->getMergedTemplates($pageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets merged templates by walking the rootline to a given page id.
|
||||
*
|
||||
* @todo oliver@typo3.org: Refactor this method and comment what's going on there
|
||||
* @param int $pageId
|
||||
* @return array Setup part of merged template records
|
||||
*/
|
||||
protected function getMergedTemplates($pageId)
|
||||
{
|
||||
$tsParser = GeneralUtility::makeInstance(ExtendedTemplateService::class);
|
||||
// Gets the rootLine
|
||||
$rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageId)->get();
|
||||
// This generates the constants/config + hierarchy info for the template.
|
||||
$tsParser->runThroughTemplates($rootLine);
|
||||
// ts-setup & ts-constants of the currently edited template should not be included
|
||||
// therefor we have to delete the last template from the stack
|
||||
array_pop($tsParser->config);
|
||||
array_pop($tsParser->constants);
|
||||
$tsParser->linkObjects = true;
|
||||
$tsParser->ext_regLinenumbers = false;
|
||||
$tsParser->generateConfig();
|
||||
$result = $this->treeWalkCleanup($tsParser->setup);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Walks through a tree of TypoScript configuration an cleans it up.
|
||||
*
|
||||
* @TODO oliver@typo3.org: Define and comment why this is necessary and exactly happens below
|
||||
* @param array $treeBranch TypoScript configuration or sub branch of it
|
||||
* @return array Cleaned TypoScript branch
|
||||
*/
|
||||
private function treeWalkCleanup(array $treeBranch)
|
||||
{
|
||||
$cleanedTreeBranch = [];
|
||||
foreach ($treeBranch as $key => $value) {
|
||||
//type definition or value-assignment
|
||||
if (substr($key, -1) !== '.') {
|
||||
if ($value != '') {
|
||||
if (mb_strlen($value) > 20) {
|
||||
$value = mb_substr($value, 0, 20);
|
||||
}
|
||||
if (!isset($cleanedTreeBranch[$key])) {
|
||||
$cleanedTreeBranch[$key] = [];
|
||||
}
|
||||
$cleanedTreeBranch[$key]['v'] = $value;
|
||||
}
|
||||
} else {
|
||||
// subtree (definition of properties)
|
||||
$subBranch = $this->treeWalkCleanup($value);
|
||||
if ($subBranch) {
|
||||
if (substr($key, -1) === '.') {
|
||||
$key = rtrim($key, '.');
|
||||
}
|
||||
if (!isset($cleanedTreeBranch[$key])) {
|
||||
$cleanedTreeBranch[$key] = [];
|
||||
}
|
||||
$cleanedTreeBranch[$key]['c'] = $subBranch;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $cleanedTreeBranch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService(): LanguageService
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\T3editor\Controller;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Http\JsonResponse;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Loads TSref information from a XML file an responds to an AJAX call.
|
||||
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class TypoScriptReferenceController
|
||||
{
|
||||
/**
|
||||
* @var \DOMDocument
|
||||
*/
|
||||
protected $xmlDoc;
|
||||
|
||||
/**
|
||||
* Load TypoScript reference
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function loadReference(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
// Load the TSref XML information:
|
||||
$this->loadFile(GeneralUtility::getFileAbsFileName('EXT:t3editor/Resources/Private/tsref.xml'));
|
||||
return (new JsonResponse())->setPayload($this->getTypes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Load XML file
|
||||
*
|
||||
* @param string $filepath
|
||||
*/
|
||||
protected function loadFile($filepath)
|
||||
{
|
||||
// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader();
|
||||
$this->xmlDoc = new \DOMDocument('1.0', 'utf-8');
|
||||
$this->xmlDoc->loadXML(file_get_contents($filepath));
|
||||
libxml_disable_entity_loader($previousValueOfEntityLoader);
|
||||
// @TODO: oliver@typo3.org: I guess this is not required here
|
||||
$this->xmlDoc->saveXML();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get types from XML
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getTypes(): array
|
||||
{
|
||||
$types = $this->xmlDoc->getElementsByTagName('type');
|
||||
$typeArr = [];
|
||||
foreach ($types as $type) {
|
||||
$typeId = $type->getAttribute('id');
|
||||
$typeName = $type->getAttribute('name');
|
||||
if (!$typeName) {
|
||||
$typeName = $typeId;
|
||||
}
|
||||
$properties = $type->getElementsByTagName('property');
|
||||
$propArr = [];
|
||||
foreach ($properties as $property) {
|
||||
$p = [];
|
||||
$p['name'] = $property->getAttribute('name');
|
||||
$p['type'] = $property->getAttribute('type');
|
||||
$propArr[$property->getAttribute('name')] = $p;
|
||||
}
|
||||
$typeArr[$typeId] = [];
|
||||
$typeArr[$typeId]['properties'] = $propArr;
|
||||
$typeArr[$typeId]['name'] = $typeName;
|
||||
if ($type->hasAttribute('extends')) {
|
||||
$typeArr[$typeId]['extends'] = $type->getAttribute('extends');
|
||||
}
|
||||
}
|
||||
return $typeArr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor\Exception;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Exception;
|
||||
|
||||
/**
|
||||
* Exception thrown for invalid modes
|
||||
* @internal
|
||||
*/
|
||||
class InvalidModeException extends Exception
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor\Form\Element;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Form\Element\AbstractFormElement;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
use TYPO3\CMS\T3editor\Exception\InvalidModeException;
|
||||
use TYPO3\CMS\T3editor\Mode;
|
||||
use TYPO3\CMS\T3editor\Registry\AddonRegistry;
|
||||
use TYPO3\CMS\T3editor\Registry\ModeRegistry;
|
||||
use TYPO3\CMS\T3editor\T3editor;
|
||||
|
||||
/**
|
||||
* t3editor FormEngine widget
|
||||
* @internal
|
||||
*/
|
||||
class T3editorElement extends AbstractFormElement
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $resultArray;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $mode = '';
|
||||
|
||||
/**
|
||||
* Default field information enabled for this element.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultFieldInformation = [
|
||||
'tcaDescription' => [
|
||||
'renderType' => 'tcaDescription',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Default field wizards enabled for this element.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultFieldWizard = [
|
||||
'localizationStateSelector' => [
|
||||
'renderType' => 'localizationStateSelector',
|
||||
],
|
||||
'otherLanguageContent' => [
|
||||
'renderType' => 'otherLanguageContent',
|
||||
'after' => [
|
||||
'localizationStateSelector',
|
||||
],
|
||||
],
|
||||
'defaultLanguageDifferences' => [
|
||||
'renderType' => 'defaultLanguageDifferences',
|
||||
'after' => [
|
||||
'otherLanguageContent',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Render t3editor element
|
||||
*
|
||||
* @return array As defined in initializeResultArray() of AbstractNode
|
||||
* @throws \TYPO3\CMS\T3editor\Exception\InvalidModeException
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \BadFunctionCallException
|
||||
*/
|
||||
public function render(): array
|
||||
{
|
||||
$this->resultArray = $this->initializeResultArray();
|
||||
$this->resultArray['stylesheetFiles'][] = 'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css';
|
||||
$this->resultArray['stylesheetFiles'][] = 'EXT:t3editor/Resources/Public/Css/t3editor.css';
|
||||
$this->resultArray['requireJsModules'][] = [
|
||||
'TYPO3/CMS/T3editor/T3editor' => 'function(T3editor) {T3editor.observeEditorCandidates()}'
|
||||
];
|
||||
|
||||
// Compile and register t3editor configuration
|
||||
GeneralUtility::makeInstance(T3editor::class)->registerConfiguration();
|
||||
|
||||
$registeredAddons = AddonRegistry::getInstance()->getForMode($this->getMode()->getFormatCode());
|
||||
foreach ($registeredAddons as $addon) {
|
||||
foreach ($addon->getCssFiles() as $cssFile) {
|
||||
$this->resultArray['stylesheetFiles'][] = $cssFile;
|
||||
}
|
||||
}
|
||||
|
||||
$parameterArray = $this->data['parameterArray'];
|
||||
|
||||
$attributes = [];
|
||||
if (isset($parameterArray['fieldConf']['config']['rows']) && MathUtility::canBeInterpretedAsInteger($parameterArray['fieldConf']['config']['rows'])) {
|
||||
$attributes['rows'] = $parameterArray['fieldConf']['config']['rows'];
|
||||
}
|
||||
|
||||
$attributes['wrap'] = 'off';
|
||||
$attributes['style'] = 'width:100%;';
|
||||
$attributes['onchange'] = GeneralUtility::quoteJSvalue($parameterArray['fieldChangeFunc']['TBE_EDITOR_fieldChanged']);
|
||||
|
||||
$attributeString = GeneralUtility::implodeAttributes($attributes, true);
|
||||
|
||||
$editorHtml = $this->getHTMLCodeForEditor(
|
||||
$parameterArray['itemFormElName'],
|
||||
'text-monospace enable-tab',
|
||||
$parameterArray['itemFormElValue'],
|
||||
$attributeString,
|
||||
$this->data['tableName'] . ' > ' . $this->data['fieldName'],
|
||||
[
|
||||
'target' => 0,
|
||||
'effectivePid' => $this->data['effectivePid']
|
||||
]
|
||||
);
|
||||
|
||||
$fieldInformationResult = $this->renderFieldInformation();
|
||||
$fieldInformationHtml = $fieldInformationResult['html'];
|
||||
$this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldInformationResult, false);
|
||||
|
||||
$fieldControlResult = $this->renderFieldControl();
|
||||
$fieldControlHtml = $fieldControlResult['html'];
|
||||
$this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldControlResult, false);
|
||||
|
||||
$fieldWizardResult = $this->renderFieldWizard();
|
||||
$fieldWizardHtml = $fieldWizardResult['html'];
|
||||
$this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldWizardResult, false);
|
||||
|
||||
$html = [];
|
||||
$html[] = '<div class="formengine-field-item t3js-formengine-field-item">';
|
||||
$html[] = $fieldInformationHtml;
|
||||
$html[] = '<div class="form-control-wrap">';
|
||||
$html[] = '<div class="form-wizards-wrap">';
|
||||
$html[] = '<div class="form-wizards-element">';
|
||||
$html[] = '<div class="t3editor-wrapper">';
|
||||
$html[] = $editorHtml;
|
||||
$html[] = '</div>';
|
||||
$html[] = '</div>';
|
||||
if (!empty($fieldControlHtml)) {
|
||||
$html[] = '<div class="form-wizards-items-aside">';
|
||||
$html[] = '<div class="btn-group">';
|
||||
$html[] = $fieldControlHtml;
|
||||
$html[] = '</div>';
|
||||
$html[] = '</div>';
|
||||
}
|
||||
if (!empty($fieldWizardHtml)) {
|
||||
$html[] = '<div class="form-wizards-items-bottom">';
|
||||
$html[] = $fieldWizardHtml;
|
||||
$html[] = '</div>';
|
||||
}
|
||||
$html[] = '</div>';
|
||||
$html[] = '</div>';
|
||||
$html[] = '</div>';
|
||||
|
||||
$this->resultArray['html'] = implode(LF, $html);
|
||||
|
||||
return $this->resultArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates HTML with code editor
|
||||
*
|
||||
* @param string $name Name attribute of HTML tag
|
||||
* @param string $class Class attribute of HTML tag
|
||||
* @param string $content Content of the editor
|
||||
* @param string $additionalParams Any additional editor parameters
|
||||
* @param string $alt Alt attribute
|
||||
* @param array $hiddenfields
|
||||
*
|
||||
* @return string Generated HTML code for editor
|
||||
* @throws \TYPO3\CMS\T3editor\Exception\InvalidModeException
|
||||
*/
|
||||
protected function getHTMLCodeForEditor(
|
||||
string $name,
|
||||
string $class = '',
|
||||
string $content = '',
|
||||
string $additionalParams = '',
|
||||
string $alt = '',
|
||||
array $hiddenfields = []
|
||||
): string {
|
||||
$code = [];
|
||||
$attributes = [];
|
||||
$mode = $this->getMode();
|
||||
$registeredAddons = AddonRegistry::getInstance()->getForMode($mode->getFormatCode());
|
||||
|
||||
$attributes['class'] = $class . ' t3editor';
|
||||
$attributes['alt'] = $alt;
|
||||
$attributes['id'] = 't3editor_' . md5($name);
|
||||
$attributes['name'] = $name;
|
||||
|
||||
$settings = AddonRegistry::getInstance()->compileSettings($registeredAddons);
|
||||
$addons = [];
|
||||
foreach ($registeredAddons as $addon) {
|
||||
$addons[] = $addon->getIdentifier();
|
||||
}
|
||||
|
||||
$attributes['data-codemirror-config'] = json_encode([
|
||||
'mode' => $mode->getIdentifier(),
|
||||
'addons' => json_encode($addons),
|
||||
'options' => json_encode($settings)
|
||||
]);
|
||||
|
||||
$attributesString = '';
|
||||
foreach ($attributes as $attribute => $value) {
|
||||
$attributesString .= $attribute . '="' . htmlspecialchars((string)$value) . '" ';
|
||||
}
|
||||
$attributesString .= $additionalParams;
|
||||
|
||||
$code[] = '<textarea ' . $attributesString . '>' . htmlspecialchars($content) . '</textarea>';
|
||||
|
||||
if (!empty($hiddenfields)) {
|
||||
foreach ($hiddenfields as $attributeName => $value) {
|
||||
$code[] = '<input type="hidden" name="' . htmlspecialchars($attributeName) . '" value="' . htmlspecialchars((string)$value) . '" />';
|
||||
}
|
||||
}
|
||||
return implode(LF, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Mode
|
||||
* @throws InvalidModeException
|
||||
*/
|
||||
protected function getMode(): Mode
|
||||
{
|
||||
$config = $this->data['parameterArray']['fieldConf']['config'];
|
||||
|
||||
if (!isset($config['format'])) {
|
||||
return ModeRegistry::getInstance()->getDefaultMode();
|
||||
}
|
||||
|
||||
$identifier = $config['format'];
|
||||
if (strpos($config['format'], '/') !== false) {
|
||||
$parts = explode('/', $config['format']);
|
||||
$identifier = end($parts);
|
||||
}
|
||||
|
||||
return ModeRegistry::getInstance()->getByFormatCode($identifier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor\Hook;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Controller\File\EditFileController;
|
||||
use TYPO3\CMS\Core\Resource\ResourceFactory;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\T3editor\Exception\InvalidModeException;
|
||||
use TYPO3\CMS\T3editor\Registry\ModeRegistry;
|
||||
use TYPO3\CMS\T3editor\T3editor;
|
||||
|
||||
/**
|
||||
* File edit hook for t3editor
|
||||
* @internal This is a specific hook implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class FileEditHook
|
||||
{
|
||||
/**
|
||||
* Hook-function: inject t3editor JavaScript code before the page is compiled
|
||||
* called in file_edit module
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param EditFileController $pObj
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function preOutputProcessingHook(array $parameters, EditFileController $pObj)
|
||||
{
|
||||
// Compile and register t3editor configuration
|
||||
GeneralUtility::makeInstance(T3editor::class)->registerConfiguration();
|
||||
|
||||
$target = '';
|
||||
if (isset($parameters['target']) && is_string($parameters['target'])) {
|
||||
$target = $parameters['target'];
|
||||
}
|
||||
|
||||
$fileExtension = ResourceFactory::getInstance()->retrieveFileOrFolderObject($target)->getExtension();
|
||||
$modeRegistry = GeneralUtility::makeInstance(ModeRegistry::class);
|
||||
try {
|
||||
$mode = $modeRegistry->getByFileExtension($fileExtension);
|
||||
} catch (InvalidModeException $e) {
|
||||
$mode = $modeRegistry->getDefaultMode();
|
||||
}
|
||||
|
||||
$parameters['dataColumnDefinition']['config']['renderType'] = 't3editor';
|
||||
$parameters['dataColumnDefinition']['config']['format'] = $mode->getFormatCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents a mode for CodeMirror
|
||||
* @internal
|
||||
*/
|
||||
class Mode
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $identifier = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $formatCode = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $fileExtensions = [];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $isDefault = false;
|
||||
|
||||
/**
|
||||
* @param string $identifier
|
||||
*/
|
||||
public function __construct(string $identifier)
|
||||
{
|
||||
$this->identifier = $identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getFormatCode(): string
|
||||
{
|
||||
return $this->formatCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $formatCode
|
||||
* @return Mode
|
||||
*/
|
||||
public function setFormatCode(string $formatCode): Mode
|
||||
{
|
||||
$this->formatCode = $formatCode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $fileExtensions
|
||||
* @return self
|
||||
*/
|
||||
public function bindToFileExtensions(array $fileExtensions): Mode
|
||||
{
|
||||
$this->fileExtensions = $fileExtensions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getBoundFileExtensions(): array
|
||||
{
|
||||
return $this->fileExtensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Mode
|
||||
*/
|
||||
public function setAsDefault(): Mode
|
||||
{
|
||||
$this->isDefault = true;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isDefault(): bool
|
||||
{
|
||||
return $this->isDefault;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor\Registry;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\T3editor\Addon;
|
||||
|
||||
/**
|
||||
* Registers and holds t3editor modes
|
||||
* @internal
|
||||
*/
|
||||
class AddonRegistry implements SingletonInterface
|
||||
{
|
||||
/**
|
||||
* @var Addon[]
|
||||
*/
|
||||
protected $registeredAddons = [];
|
||||
|
||||
/**
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function getInstance(): AddonRegistry
|
||||
{
|
||||
return GeneralUtility::makeInstance(static::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers addons for global use in t3editor
|
||||
*
|
||||
* @param Addon $addon
|
||||
* @return self
|
||||
*/
|
||||
public function register(Addon $addon): AddonRegistry
|
||||
{
|
||||
$this->registeredAddons[$addon->getIdentifier()] = $addon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $mode
|
||||
* @return Addon[]
|
||||
*/
|
||||
public function getForMode(string $mode = ''): array
|
||||
{
|
||||
$addons = [];
|
||||
|
||||
foreach ($this->registeredAddons as $addon) {
|
||||
if (empty($addon->getModes()) || in_array($mode, $addon->getModes(), true)) {
|
||||
$addons[] = $addon;
|
||||
}
|
||||
}
|
||||
|
||||
return $addons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Addon[] $addons
|
||||
* @return array
|
||||
*/
|
||||
public function compileSettings(array $addons): array
|
||||
{
|
||||
$settings = [];
|
||||
foreach ($addons as $addon) {
|
||||
$settings = array_merge($settings, $addon->getOptions());
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor\Registry;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\T3editor\Exception\InvalidModeException;
|
||||
use TYPO3\CMS\T3editor\Mode;
|
||||
|
||||
/**
|
||||
* Registers and holds t3editor modes
|
||||
* @internal
|
||||
*/
|
||||
class ModeRegistry implements SingletonInterface
|
||||
{
|
||||
/**
|
||||
* @var Mode[]
|
||||
*/
|
||||
protected $registeredModes = [];
|
||||
|
||||
/**
|
||||
* @var Mode
|
||||
*/
|
||||
protected $defaultMode;
|
||||
|
||||
/**
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function getInstance(): ModeRegistry
|
||||
{
|
||||
return GeneralUtility::makeInstance(static::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers modes for t3editor
|
||||
*
|
||||
* @param Mode $mode
|
||||
* @return self
|
||||
*/
|
||||
public function register(Mode $mode): ModeRegistry
|
||||
{
|
||||
$this->registeredModes[$mode->getIdentifier()] = $mode;
|
||||
if ($mode->isDefault()) {
|
||||
$this->defaultMode = $mode;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes registered modes
|
||||
*
|
||||
* @param string $identifier
|
||||
* @return self
|
||||
*/
|
||||
public function unregister(string $identifier): ModeRegistry
|
||||
{
|
||||
if (isset($this->registeredModes[$identifier])) {
|
||||
unset($this->registeredModes[$identifier]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $identifier
|
||||
* @return bool
|
||||
*/
|
||||
public function isRegistered(string $identifier): bool
|
||||
{
|
||||
return isset($this->registeredModes[$identifier]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $identifier
|
||||
* @return Mode
|
||||
* @throws InvalidModeException
|
||||
*/
|
||||
public function getByIdentifier(string $identifier): Mode
|
||||
{
|
||||
if ($this->isRegistered($identifier)) {
|
||||
return $this->registeredModes[$identifier];
|
||||
}
|
||||
|
||||
throw new InvalidModeException('Tried to get unregistered t3editor mode "' . $identifier . '"', 1499710202);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $formatCode
|
||||
* @return Mode
|
||||
* @throws InvalidModeException
|
||||
*/
|
||||
public function getByFormatCode(string $formatCode): Mode
|
||||
{
|
||||
foreach ($this->registeredModes as $mode) {
|
||||
if ($mode->getFormatCode() === $formatCode) {
|
||||
return $mode;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidModeException('Tried to get unregistered t3editor mode by format code "' . $formatCode . '"', 1499710203);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $fileExtension
|
||||
* @return Mode
|
||||
* @throws InvalidModeException
|
||||
*/
|
||||
public function getByFileExtension(string $fileExtension): Mode
|
||||
{
|
||||
foreach ($this->registeredModes as $mode) {
|
||||
if (in_array($fileExtension, $mode->getBoundFileExtensions(), true)) {
|
||||
return $mode;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidModeException('Cannot find a registered mode for requested file extension "' . $fileExtension . '"', 1500306488);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Mode
|
||||
*/
|
||||
public function getDefaultMode(): Mode
|
||||
{
|
||||
return $this->defaultMode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\T3editor;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Cache\CacheManager;
|
||||
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
use TYPO3\CMS\Core\Package\PackageManager;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\T3editor\Registry\AddonRegistry;
|
||||
use TYPO3\CMS\T3editor\Registry\ModeRegistry;
|
||||
|
||||
/**
|
||||
* Provides necessary code to setup a t3editor instance in FormEngine
|
||||
* @internal
|
||||
*/
|
||||
class T3editor implements SingletonInterface
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $configuration;
|
||||
|
||||
/**
|
||||
* Registers the configuration and bootstraps the modes / addons.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function registerConfiguration()
|
||||
{
|
||||
$configuration = $this->buildConfiguration();
|
||||
|
||||
if (isset($configuration['modes'])) {
|
||||
$modeRegistry = ModeRegistry::getInstance();
|
||||
foreach ($configuration['modes'] as $formatCode => $mode) {
|
||||
$modeInstance = GeneralUtility::makeInstance(Mode::class, $mode['module'])->setFormatCode($formatCode);
|
||||
|
||||
if (!empty($mode['extensions']) && is_array($mode['extensions'])) {
|
||||
$modeInstance->bindToFileExtensions($mode['extensions']);
|
||||
}
|
||||
|
||||
if (isset($mode['default']) && $mode['default'] === true) {
|
||||
$modeInstance->setAsDefault();
|
||||
}
|
||||
|
||||
$modeRegistry->register($modeInstance);
|
||||
}
|
||||
}
|
||||
|
||||
$addonRegistry = GeneralUtility::makeInstance(AddonRegistry::class);
|
||||
if (isset($configuration['addons'])) {
|
||||
foreach ($configuration['addons'] as $addon) {
|
||||
$addonInstance = GeneralUtility::makeInstance(Addon::class, $addon['module']);
|
||||
|
||||
if (!empty($addon['cssFiles']) && is_array($addon['cssFiles'])) {
|
||||
$addonInstance->setCssFiles($addon['cssFiles']);
|
||||
}
|
||||
|
||||
if (!empty($addon['options']) && is_array($addon['options'])) {
|
||||
$addonInstance->setOptions($addon['options']);
|
||||
}
|
||||
|
||||
if (!empty($addon['modes']) && is_array($addon['modes'])) {
|
||||
$addonInstance->setModes($addon['modes']);
|
||||
}
|
||||
|
||||
$addonRegistry->register($addonInstance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the configuration for t3editor. Configuration is stored in caching framework.
|
||||
*
|
||||
* @return array
|
||||
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
|
||||
* @throws \TYPO3\CMS\Core\Cache\Exception\InvalidDataException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected function buildConfiguration(): array
|
||||
{
|
||||
if ($this->configuration !== null) {
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
$this->configuration = [
|
||||
'modes' => [],
|
||||
'addons' => [],
|
||||
];
|
||||
|
||||
$cache = $this->getCache();
|
||||
$cacheIdentifier = $this->generateCacheIdentifier('T3editorConfiguration');
|
||||
$configurationFromCache = $cache->get($cacheIdentifier);
|
||||
if ($configurationFromCache !== false) {
|
||||
$this->configuration = $configurationFromCache;
|
||||
} else {
|
||||
$packageManager = GeneralUtility::makeInstance(PackageManager::class);
|
||||
$packages = $packageManager->getActivePackages();
|
||||
|
||||
foreach ($packages as $package) {
|
||||
$configurationPath = $package->getPackagePath() . 'Configuration/Backend/T3editor';
|
||||
$modesFileNameForPackage = $configurationPath . '/Modes.php';
|
||||
if (is_file($modesFileNameForPackage)) {
|
||||
$definedModes = require_once $modesFileNameForPackage;
|
||||
if (is_array($definedModes)) {
|
||||
$this->configuration['modes'] = array_merge($this->configuration['modes'], $definedModes);
|
||||
}
|
||||
}
|
||||
|
||||
$addonsFileNameForPackage = $configurationPath . '/Addons.php';
|
||||
if (is_file($addonsFileNameForPackage)) {
|
||||
$definedAddons = require_once $addonsFileNameForPackage;
|
||||
if (is_array($definedAddons)) {
|
||||
$this->configuration['addons'] = array_merge($this->configuration['addons'], $definedAddons);
|
||||
}
|
||||
}
|
||||
}
|
||||
$cache->set($cacheIdentifier, $this->configuration);
|
||||
}
|
||||
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
protected function generateCacheIdentifier(string $key): string
|
||||
{
|
||||
return $key . '_' . sha1(TYPO3_version . Environment::getProjectPath() . $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return FrontendInterface
|
||||
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected function getCache(): FrontendInterface
|
||||
{
|
||||
return GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Definitions for routes provided by EXT:t3editor
|
||||
*/
|
||||
return [
|
||||
// Get TSRef
|
||||
't3editor_tsref' => [
|
||||
'path' => '/t3editor/tsref',
|
||||
'target' => \TYPO3\CMS\T3editor\Controller\TypoScriptReferenceController::class . '::loadReference'
|
||||
],
|
||||
|
||||
// Load code completion templates
|
||||
't3editor_codecompletion_loadtemplates' => [
|
||||
'path' => '/t3editor/codecompletion/load-templates',
|
||||
'target' => \TYPO3\CMS\T3editor\Controller\CodeCompletionController::class . '::loadCompletions'
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Addons for t3editor
|
||||
*/
|
||||
return [
|
||||
'dialog/dialog' => [
|
||||
'module' => 'cm/addon/dialog/dialog',
|
||||
'cssFiles' => [
|
||||
'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.css',
|
||||
],
|
||||
],
|
||||
'display/fullscreen' => [
|
||||
'module' => 'cm/addon/display/fullscreen',
|
||||
'cssFiles' => [
|
||||
'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/fullscreen.css',
|
||||
],
|
||||
],
|
||||
'display/autorefresh' => [
|
||||
'module' => 'cm/addon/display/autorefresh',
|
||||
],
|
||||
'display/panel' => [
|
||||
'module' => 'cm/addon/display/panel',
|
||||
],
|
||||
'fold/xml-fold' => [
|
||||
'module' => 'cm/addon/fold/xml-fold',
|
||||
],
|
||||
'scroll/simplescrollbars' => [
|
||||
'module' => 'cm/addon/scroll/simplescrollbars',
|
||||
'cssFiles' => [
|
||||
'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/simplescrollbars.css',
|
||||
],
|
||||
'options' => [
|
||||
'scrollbarStyle' => 'simple',
|
||||
],
|
||||
],
|
||||
'scroll/annotatescrollbar' => [
|
||||
'module' => 'cm/addon/scroll/annotatescrollbar',
|
||||
],
|
||||
'search/searchcursor' => [
|
||||
'module' => 'cm/addon/search/searchcursor',
|
||||
],
|
||||
'search/search' => [
|
||||
'module' => 'cm/addon/search/search',
|
||||
],
|
||||
'search/jump-to-line' => [
|
||||
'module' => 'cm/addon/search/jump-to-line',
|
||||
],
|
||||
'search/matchesonscrollbar' => [
|
||||
'module' => 'cm/addon/search/matchesonscrollbar',
|
||||
'cssFiles' => [
|
||||
'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/matchesonscrollbar.css',
|
||||
],
|
||||
],
|
||||
'edit/matchbrackets' => [
|
||||
'module' => 'cm/addon/edit/matchbrackets',
|
||||
'options' => [
|
||||
'matchBrackets' => true,
|
||||
],
|
||||
],
|
||||
'edit/closebrackets' => [
|
||||
'module' => 'cm/addon/edit/closebrackets',
|
||||
'options' => [
|
||||
'autoCloseBrackets' => true,
|
||||
],
|
||||
],
|
||||
'selection/active-line' => [
|
||||
'module' => 'cm/addon/selection/active-line',
|
||||
'options' => [
|
||||
'styleActiveLine' => true,
|
||||
],
|
||||
],
|
||||
'edit/matchtags' => [
|
||||
'module' => 'cm/addon/edit/matchtags',
|
||||
'options' => [
|
||||
'matchTags' => true,
|
||||
],
|
||||
],
|
||||
'edit/closetag' => [
|
||||
'module' => 'cm/addon/edit/closetag',
|
||||
'options' => [
|
||||
'autoCloseTags' => true,
|
||||
],
|
||||
],
|
||||
'hint/show-hint' => [
|
||||
'module' => 'cm/addon/hint/show-hint',
|
||||
'cssFiles' => [
|
||||
'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.css',
|
||||
],
|
||||
'options' => [
|
||||
'hintOptions' => [
|
||||
'completeSingle' => false,
|
||||
],
|
||||
],
|
||||
],
|
||||
'hint/css-hint' => [
|
||||
'module' => 'cm/addon/hint/css-hint',
|
||||
'modes' => ['css'],
|
||||
],
|
||||
'hint/xml-hint' => [
|
||||
'module' => 'cm/addon/hint/xml-hint',
|
||||
'modes' => ['htmlmixed', 'xml'],
|
||||
],
|
||||
'hint/html-hint' => [
|
||||
'module' => 'cm/addon/hint/html-hint',
|
||||
'modes' => ['htmlmixed'],
|
||||
],
|
||||
'hint/javascript-hint' => [
|
||||
'module' => 'cm/addon/hint/javascript-hint',
|
||||
'modes' => ['javascript'],
|
||||
],
|
||||
'hint/sql-hint' => [
|
||||
'module' => 'cm/addon/hint/sql-hint',
|
||||
'modes' => ['sql'],
|
||||
],
|
||||
'hint/typoscript-hint' => [
|
||||
'module' => 'TYPO3/CMS/T3editor/Addon/Hint/TypoScriptHint',
|
||||
'modes' => ['typoscript'],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Mode definitions for t3editor
|
||||
*/
|
||||
return [
|
||||
'css' => [
|
||||
'module' => 'cm/mode/css/css',
|
||||
'extensions' => ['css'],
|
||||
],
|
||||
'html' => [
|
||||
'module' => 'cm/mode/htmlmixed/htmlmixed',
|
||||
'extensions' => ['htm', 'html'],
|
||||
'default' => true,
|
||||
],
|
||||
'javascript' => [
|
||||
'module' => 'cm/mode/javascript/javascript',
|
||||
'extensions' => ['javascript'],
|
||||
],
|
||||
'php' => [
|
||||
'module' => 'cm/mode/php/php',
|
||||
'extensions' => ['php', 'php5', 'php7', 'phps'],
|
||||
],
|
||||
'typoscript' => [
|
||||
'module' => 'TYPO3/CMS/T3editor/Mode/typoscript/typoscript',
|
||||
'extensions' => ['ts', 'typoscript', 'tsconfig'],
|
||||
],
|
||||
'xml' => [
|
||||
'module' => 'cm/mode/xml/xml',
|
||||
'extensions' => ['xml']
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Activate t3editor for sys_template config
|
||||
if (is_array($GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config'])) {
|
||||
$GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config']['format'] = 'typoscript';
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Activate t3editor for sys_template config
|
||||
if (is_array($GLOBALS['TCA']['be_users']['columns']['TSconfig']['config'])) {
|
||||
$GLOBALS['TCA']['be_users']['columns']['TSconfig']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['be_users']['columns']['TSconfig']['config']['format'] = 'typoscript';
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Activate t3editor for sys_template config
|
||||
if (is_array($GLOBALS['TCA']['pages']['columns']['TSconfig']['config'])) {
|
||||
$GLOBALS['TCA']['pages']['columns']['TSconfig']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['pages']['columns']['TSconfig']['config']['format'] = 'typoscript';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Activate t3editor for sys_template constants
|
||||
if (is_array($GLOBALS['TCA']['sys_template']['columns']['constants']['config'])) {
|
||||
$GLOBALS['TCA']['sys_template']['columns']['constants']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['sys_template']['columns']['constants']['config']['format'] = 'typoscript';
|
||||
}
|
||||
|
||||
// Activate t3editor for sys_template config
|
||||
if (is_array($GLOBALS['TCA']['sys_template']['columns']['config']['config'])) {
|
||||
$GLOBALS['TCA']['sys_template']['columns']['config']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['sys_template']['columns']['config']['config']['format'] = 'typoscript';
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Activate t3editor for tt_content type HTML if this type exists
|
||||
if (is_array($GLOBALS['TCA']['tt_content']['types']['html'])) {
|
||||
if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'])) {
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'] = [];
|
||||
}
|
||||
if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'])) {
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'] = [];
|
||||
}
|
||||
if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'])) {
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'] = [];
|
||||
}
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['renderType'] = 't3editor';
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['wrap'] = 'off';
|
||||
$GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['format'] = 'html';
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
Some icons used in the TYPO3 project are retrieved from the "Silk" icon set of
|
||||
Mark James, which can be found at http://famfamfam.com/lab/icons/silk/. This
|
||||
set is distributed under a Creative Commons Attribution 2.5 License. The
|
||||
license can be found at http://creativecommons.org/licenses/by/2.5/.
|
||||
---------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'TYPO3\\CMS\\T3editor\\CodeCompletion' => \TYPO3\CMS\T3editor\Controller\CodeCompletionController::class,
|
||||
'TYPO3\\CMS\\T3editor\\TypoScriptReferenceLoader' => \TYPO3\CMS\T3editor\Controller\TypoScriptReferenceController::class,
|
||||
];
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace {
|
||||
die('Access denied');
|
||||
}
|
||||
|
||||
namespace TYPO3\CMS\T3editor {
|
||||
/**
|
||||
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0
|
||||
*/
|
||||
class CodeCompletion extends \TYPO3\CMS\T3editor\Controller\CodeCompletionController
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0
|
||||
*/
|
||||
class TypoScriptReferenceLoader extends \TYPO3\CMS\T3editor\Controller\TypoScriptReferenceController
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814999" source-language="en" datatype="plaintext" original="EXT:t3editor/Resources/Private/Language/locallang.xlf" date="2011-10-17T20:22:37Z" product-name="t3editor">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="deactivate" resname="deactivate">
|
||||
<source>Deactivate t3editor</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="template" resname="template">
|
||||
<source>Template</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="file" resname="file">
|
||||
<source>File</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="delimiter" resname="delimiter">
|
||||
<source></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="constants" resname="constants">
|
||||
<source>Constants</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="setup" resname="setup">
|
||||
<source>Setup</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="unknownContentType" resname="unknownContentType">
|
||||
<source>Unknown content type</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="pageIDInteger" resname="pageIDInteger">
|
||||
<source>Syntax error: Parameter pageID must be a valid integer.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="noPermission" resname="noPermission">
|
||||
<source>Access denied: No permission to template records.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="typeIDMissing" resname="typeIDMissing">
|
||||
<source>Syntax error: At least parameter typeID has to be supplied.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="js.label_lines" resname="js.label_lines">
|
||||
<source>lines</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="js.label_documentModified" resname="js.label_documentModified">
|
||||
<source>document has been modified</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="js.label_errorWhileSaving" resname="js.label_errorWhileSaving">
|
||||
<source>An error occurred while saving the data.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
.t3editor-wrapper{border:1px solid transparent}.t3editor-wrapper .CodeMirror-fullscreen{top:64px!important}.t3editor-wrapper .CodeMirror-panel{background:#f7f7f7;padding:3px 6px;font-size:.85em}.t3editor-wrapper .CodeMirror-panel-bottom{border-top:1px solid #ddd}.t3editor-wrapper div.CodeMirror span.CodeMirror-matchingbracket{color:#6ca52b}.has-change .t3editor-wrapper{border-color:#6daadf}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module: TYPO3/CMS/T3editor/Addon/Hint/CompletionResult
|
||||
* Contains the CompletionResult class
|
||||
*/
|
||||
define(['jquery'], function($) {
|
||||
/**
|
||||
*
|
||||
* @type {{tsRef: null, tsTreeNode: null}}
|
||||
* @exports TYPO3/CMS/T3editor/Addon/Hint/CompletionResult
|
||||
*/
|
||||
var CompletionResult = {
|
||||
tsRef: null,
|
||||
tsTreeNode: null
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} config
|
||||
* @returns {{tsRef: null, tsTreeNode: null}}
|
||||
*/
|
||||
CompletionResult.init = function(config) {
|
||||
CompletionResult.tsRef = config.tsRef;
|
||||
CompletionResult.tsTreeNode = config.tsTreeNode;
|
||||
|
||||
return CompletionResult;
|
||||
};
|
||||
|
||||
/**
|
||||
* returns the type of the currentTsTreeNode
|
||||
*
|
||||
* @returns {*}
|
||||
*/
|
||||
CompletionResult.getType = function() {
|
||||
var val = CompletionResult.tsTreeNode.getValue();
|
||||
if (CompletionResult.tsRef.isType(val)) {
|
||||
return CompletionResult.tsRef.getType(val);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* returns a list of possible path completions (proposals), which is:
|
||||
* a list of the children of the current TsTreeNode (= userdefined properties)
|
||||
* and a list of properties allowed for the current object in the TsRef
|
||||
* remove all words from list that don't start with the string in filter
|
||||
*
|
||||
* @param {String} filter beginning of the words contained in the proposal list
|
||||
* @return {Array} an Array of Proposals
|
||||
*/
|
||||
CompletionResult.getFilteredProposals = function(filter) {
|
||||
var defined = [],
|
||||
propArr = [],
|
||||
childNodes = CompletionResult.tsTreeNode.getChildNodes(),
|
||||
value = CompletionResult.tsTreeNode.getValue();
|
||||
|
||||
// first get the childNodes of the Node (=properties defined by the user)
|
||||
for (var key in childNodes) {
|
||||
if (typeof childNodes[key].value !== 'undefined' && childNodes[key].value !== null) {
|
||||
var propObj = {};
|
||||
propObj.word = key;
|
||||
if (CompletionResult.tsRef.typeHasProperty(value, childNodes[key].name)) {
|
||||
CompletionResult.tsRef.cssClass = 'definedTSREFProperty';
|
||||
propObj.type = childNodes[key].value;
|
||||
} else {
|
||||
propObj.cssClass = 'userProperty';
|
||||
if (CompletionResult.tsRef.isType(childNodes[key].value)) {
|
||||
propObj.type = childNodes[key].value;
|
||||
} else {
|
||||
propObj.type = '';
|
||||
}
|
||||
}
|
||||
propArr.push(propObj);
|
||||
defined[key] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// then get the tsref properties
|
||||
var props = CompletionResult.tsRef.getPropertiesFromTypeId(CompletionResult.tsTreeNode.getValue());
|
||||
for (var key in props) {
|
||||
// show just the TSREF properties - no properties of the array-prototype and no properties which have been defined by the user
|
||||
if (typeof props[key].value !== 'undefined' && defined[key] !== true) {
|
||||
var propObj = {};
|
||||
propObj.word = key;
|
||||
propObj.cssClass = 'undefinedTSREFProperty';
|
||||
propObj.type = props[key].value;
|
||||
propArr.push(propObj);
|
||||
}
|
||||
}
|
||||
|
||||
var result = [],
|
||||
wordBeginning = '';
|
||||
|
||||
for (var i = 0; i < propArr.length; i++) {
|
||||
if (filter.length === 0) {
|
||||
result.push(propArr[i]);
|
||||
continue;
|
||||
}
|
||||
wordBeginning = propArr[i].word.substring(0, filter.length);
|
||||
if (wordBeginning.toLowerCase() === filter.toLowerCase()) {
|
||||
result.push(propArr[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
return CompletionResult;
|
||||
});
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module: TYPO3/CMS/T3editor/Addon/Hint/TsCodeCompletion
|
||||
* Contains the TsCodeCompletion class
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'TYPO3/CMS/T3editor/Addon/Hint/TsRef',
|
||||
'TYPO3/CMS/T3editor/Addon/Hint/TsParser',
|
||||
'TYPO3/CMS/T3editor/Addon/Hint/CompletionResult'
|
||||
], function($, TsRef, TsParser, CompletionResult) {
|
||||
/**
|
||||
*
|
||||
* @type {{tsRef: *, proposals: null, compResult: null, currentCursorPosition: null, extTsObjTree: {}, codemirror: null, parser: null, plugins: string[]}}
|
||||
* @exports TYPO3/CMS/T3editor/CodeCompletion/TsCodeCompletion
|
||||
*/
|
||||
var TsCodeCompletion = {
|
||||
tsRef: TsRef,
|
||||
proposals: null,
|
||||
compResult: null,
|
||||
currentCursorPosition: null,
|
||||
extTsObjTree: {},
|
||||
codemirror: null,
|
||||
parser: null
|
||||
};
|
||||
|
||||
/**
|
||||
* All external templates along the rootline have to be loaded,
|
||||
* this function retrieves the JSON code by committing a AJAX request
|
||||
*
|
||||
* @param {number} id
|
||||
*/
|
||||
TsCodeCompletion.loadExtTemplatesAsync = function(id) {
|
||||
// Ensure id is an integer
|
||||
id *= 1;
|
||||
if (isNaN(id) || id === 0) {
|
||||
return null;
|
||||
}
|
||||
$.ajax({
|
||||
url: TYPO3.settings.ajaxUrls['t3editor_codecompletion_loadtemplates'],
|
||||
data: {
|
||||
pageId: id
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
TsCodeCompletion.extTsObjTree.c = response;
|
||||
TsCodeCompletion.resolveExtReferencesRec(TsCodeCompletion.extTsObjTree.c);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Since the references are not resolved server side we have to do it client-side
|
||||
* Benefit: less loading time due to less data which has to be transmitted
|
||||
*
|
||||
* @param {Array} childNodes
|
||||
*/
|
||||
TsCodeCompletion.resolveExtReferencesRec = function(childNodes) {
|
||||
for (var key in childNodes) {
|
||||
var childNode;
|
||||
// if the childnode has a value and there is a part of a reference operator ('<')
|
||||
// and it does not look like a html tag ('>')
|
||||
if (childNodes[key].v && childNodes[key].v[0] === '<' && childNodes[key].v.indexOf('>') === -1) {
|
||||
var path = $.trim(childNodes[key].v.replace(/</, ''));
|
||||
// if there are still whitespaces it's no path
|
||||
if (path.indexOf(' ') === -1) {
|
||||
childNode = TsCodeCompletion.getExtChildNode(path);
|
||||
// if the node was found - reference it
|
||||
if (childNode !== null) {
|
||||
childNodes[key] = childNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if there was no reference-resolving then we go deeper into the tree
|
||||
if (!childNode && childNodes[key].c) {
|
||||
TsCodeCompletion.resolveExtReferencesRec(childNodes[key].c);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the child node of given path
|
||||
*
|
||||
* @param {String} path
|
||||
* @returns {Object}
|
||||
*/
|
||||
TsCodeCompletion.getExtChildNode = function(path) {
|
||||
var extTree = TsCodeCompletion.extTsObjTree,
|
||||
path = path.split('.'),
|
||||
pathSeg;
|
||||
|
||||
for (var i = 0; i < path.length; i++) {
|
||||
pathSeg = path[i];
|
||||
if (typeof extTree.c === 'undefined' || typeof extTree.c[pathSeg] === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
extTree = extTree.c[pathSeg];
|
||||
}
|
||||
return extTree;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
TsCodeCompletion.getFilter = function() {
|
||||
var currentLine = TsCodeCompletion.codemirror.getTokenAt(TsCodeCompletion.currentCursorPosition).string;
|
||||
if (currentLine) {
|
||||
var filter = currentLine.replace('.', '');
|
||||
return filter.replace(/\s/g, '');
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Refreshes the code completion list based on the cursor's position
|
||||
*/
|
||||
TsCodeCompletion.refreshCodeCompletion = function(codemirror) {
|
||||
TsCodeCompletion.codemirror = codemirror;
|
||||
|
||||
// retrieves the node right to the cursor
|
||||
TsCodeCompletion.currentCursorPosition = TsCodeCompletion.codemirror.doc.getCursor();
|
||||
|
||||
// the cursornode has to be stored cause inserted breaks have to be deleted after pressing enter if the codecompletion is active
|
||||
var filter = TsCodeCompletion.getFilter();
|
||||
|
||||
if (TsCodeCompletion.compResult === null || TsCodeCompletion.codemirror.getTokenAt(TsCodeCompletion.currentCursorPosition).string === '.') {
|
||||
// TODO: implement cases: operatorCompletion reference/copy path completion (formerly found in getCompletionResults())
|
||||
var currentTsTreeNode = TsCodeCompletion.parser.buildTsObjTree(TsCodeCompletion.codemirror);
|
||||
TsCodeCompletion.compResult = CompletionResult.init({
|
||||
tsRef: TsRef,
|
||||
tsTreeNode: currentTsTreeNode
|
||||
});
|
||||
}
|
||||
|
||||
TsCodeCompletion.proposals = TsCodeCompletion.compResult.getFilteredProposals(filter);
|
||||
|
||||
var proposals = [];
|
||||
for (var i = 0; i < TsCodeCompletion.proposals.length; i++) {
|
||||
proposals[i] = TsCodeCompletion.proposals[i].word;
|
||||
}
|
||||
|
||||
return proposals;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets the completion list
|
||||
*/
|
||||
TsCodeCompletion.resetCompList = function() {
|
||||
TsCodeCompletion.compResult = null;
|
||||
};
|
||||
|
||||
$(function() {
|
||||
TsCodeCompletion.parser = TsParser.init(TsCodeCompletion.tsRef, TsCodeCompletion.extTsObjTree);
|
||||
TsCodeCompletion.tsRef.loadTsrefAsync();
|
||||
TsCodeCompletion.loadExtTemplatesAsync($('input[name="effectivePid"]').first().val());
|
||||
});
|
||||
|
||||
return TsCodeCompletion;
|
||||
});
|
||||
@@ -0,0 +1,518 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module: TYPO3/CMS/T3editor/Addon/Hint/TsParser
|
||||
* Contains the TsCodeCompletion class
|
||||
*/
|
||||
define([
|
||||
'jquery', 'TYPO3/CMS/T3editor/Addon/Hint/TsRef'
|
||||
], function($) {
|
||||
/**
|
||||
*
|
||||
* @type {{typeId: null, properties: null, typeTree: Array, doc: null, tsRef: null, extTsObjTree: Array, tsTree: null}}
|
||||
* @exports TYPO3/CMS/T3editor/Addon/Hint/TsParser
|
||||
*/
|
||||
var TsParser = {
|
||||
typeId: null,
|
||||
properties: null,
|
||||
typeTree: [],
|
||||
doc: null,
|
||||
tsRef: null,
|
||||
extTsObjTree: [],
|
||||
tsTree: null
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} tsRef
|
||||
* @param {Object} extTsObjTree
|
||||
* @returns {{typeId: null, properties: null, typeTree: Array, doc: null, tsRef: null, extTsObjTree: Array, tsTree: null}}
|
||||
*/
|
||||
TsParser.init = function(tsRef, extTsObjTree) {
|
||||
TsParser.tsRef = tsRef;
|
||||
TsParser.extTsObjTree = extTsObjTree;
|
||||
TsParser.tsTree = new TsParser.treeNode('_L_');
|
||||
|
||||
return TsParser;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} nodeName
|
||||
*/
|
||||
TsParser.treeNode = function(nodeName) {
|
||||
this.name = nodeName;
|
||||
this.childNodes = [];
|
||||
this.extPath = '';
|
||||
this.value = '';
|
||||
this.isExternal = false;
|
||||
|
||||
/**
|
||||
* Returns local properties and the properties of the external templates
|
||||
*
|
||||
* @return {Array}
|
||||
*/
|
||||
this.getChildNodes = function() {
|
||||
var node = this.getExtNode();
|
||||
if (node !== null && typeof node.c === 'object') {
|
||||
for (key in node.c) {
|
||||
var tn = new TsParser.treeNode(key, this.tsObjTree);
|
||||
tn.global = true;
|
||||
tn.value = (node.c[key].v) ? node.c[key].v : "";
|
||||
tn.isExternal = true;
|
||||
this.childNodes[key] = tn;
|
||||
}
|
||||
}
|
||||
return this.childNodes;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value of a node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
this.getValue = function() {
|
||||
if (this.value) {
|
||||
return this.value;
|
||||
}
|
||||
var node = this.getExtNode();
|
||||
if (node && node.v) {
|
||||
return node.v;
|
||||
}
|
||||
|
||||
var type = this.getNodeTypeFromTsref();
|
||||
if (type) {
|
||||
return type;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
/**
|
||||
* This method will try to resolve the properties recursively from right
|
||||
* to left. If the node's value property is not set, it will look for the
|
||||
* value of its parent node, and if there is a matching childProperty
|
||||
* (according to the TSREF) it will return the childProperties value.
|
||||
* If there is no value in the parent node it will go one step further
|
||||
* and look into the parent node of the parent node,...
|
||||
*
|
||||
* @return {String}
|
||||
*/
|
||||
this.getNodeTypeFromTsref = function() {
|
||||
var path = this.extPath.split('.'),
|
||||
lastSeg = path.pop();
|
||||
|
||||
// attention: there will be recursive calls if necessary
|
||||
var parentValue = this.parent.getValue();
|
||||
if (parentValue) {
|
||||
if (TsParser.tsRef.typeHasProperty(parentValue, lastSeg)) {
|
||||
var type = TsParser.tsRef.getType(parentValue);
|
||||
return type.properties[lastSeg].value;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Will look in the external ts-tree (static templates, templates on other pages)
|
||||
* if there is a value or childproperties assigned to the current node.
|
||||
* The method uses the extPath of the current node to navigate to the corresponding
|
||||
* node in the external tree
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
this.getExtNode = function() {
|
||||
var extTree = TsParser.extTsObjTree,
|
||||
path,
|
||||
pathSeg;
|
||||
|
||||
if (this.extPath === '') {
|
||||
return extTree;
|
||||
}
|
||||
path = this.extPath.split('.');
|
||||
|
||||
for (var i = 0; i < path.length; i++) {
|
||||
pathSeg = path[i];
|
||||
if (typeof extTree.c === 'undefined' || typeof extTree.c[pathSeg] === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
extTree = extTree.c[pathSeg];
|
||||
}
|
||||
return extTree;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if there is an operator in the line and return it
|
||||
* if there is none, return -1
|
||||
*
|
||||
* @return {(String|Number)}
|
||||
*/
|
||||
TsParser.getOperator = function(line) {
|
||||
var operators = [':=', '=<', '<', '>', '='];
|
||||
for (var i = 0; i < operators.length; i++) {
|
||||
var op = operators[i];
|
||||
if (line.indexOf(op) !== -1) {
|
||||
// check if there is some HTML in this line (simple check, however it's the only difference between a reference operator and HTML)
|
||||
// we do this check only in case of the two operators "=<" and "<" since the delete operator would trigger our "HTML-finder"
|
||||
if ((op === '=<' || op === '<') && line.indexOf('>') > -1) {
|
||||
// if there is a ">" in the line suppose there's some HTML
|
||||
return '=';
|
||||
}
|
||||
return op;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Build the TypoScript object tree
|
||||
*/
|
||||
TsParser.buildTsObjTree = function(codemirror) {
|
||||
TsParser.tsTree = new TsParser.treeNode('');
|
||||
TsParser.tsTree.value = 'TLO';
|
||||
|
||||
function Stack() {
|
||||
}
|
||||
|
||||
Stack.prototype = [];
|
||||
Stack.prototype.lastElementEquals = function(str) {
|
||||
return this.length > 0 && this[this.length - 1] === str;
|
||||
};
|
||||
|
||||
Stack.prototype.popIfLastElementEquals = function(str) {
|
||||
if (this.lastElementEquals(str)) {
|
||||
this.pop();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var currentLine = 0,
|
||||
cursorPosition = codemirror.getCursor(),
|
||||
line = '',
|
||||
stack = new Stack(),
|
||||
prefixes = [],
|
||||
ignoreLine = false,
|
||||
insideCondition = false;
|
||||
|
||||
while (currentLine <= cursorPosition.line) {
|
||||
line = '';
|
||||
var tokens = codemirror.getLineTokens(currentLine);
|
||||
for (var i = 0; i <= tokens.length; ++i) {
|
||||
if (i < tokens.length && tokens[i].string.length > 0) {
|
||||
var tokenValue = tokens[i].string;
|
||||
|
||||
if (tokenValue[0] === '#') {
|
||||
stack.push('#');
|
||||
} else if (tokenValue === '(') {
|
||||
stack.push('(');
|
||||
} else if (tokenValue[0] === '/' && tokenValue[1] === '*') {
|
||||
stack.push('/*');
|
||||
} else if (tokenValue === '{') {
|
||||
// TODO: ignore whole block if wrong whitespaces in this line
|
||||
if (TsParser.getOperator(line) === -1) {
|
||||
stack.push('{');
|
||||
prefixes.push($.trim(line));
|
||||
ignoreLine = true;
|
||||
}
|
||||
}
|
||||
// TODO: conditions
|
||||
// if condition starts -> ignore everything until end of condition
|
||||
if (tokenValue.search(/^\s*\[.*\]/) !== -1
|
||||
&& line.search(/\S/) === -1
|
||||
&& tokenValue.search(/^\s*\[(global|end|GLOBAL|END)\]/) === -1
|
||||
&& !stack.lastElementEquals('#')
|
||||
&& !stack.lastElementEquals('/*')
|
||||
&& !stack.lastElementEquals('{')
|
||||
&& !stack.lastElementEquals('(')
|
||||
) {
|
||||
insideCondition = true;
|
||||
ignoreLine = true;
|
||||
}
|
||||
|
||||
// if end of condition reached
|
||||
if (line.search(/\S/) === -1
|
||||
&& !stack.lastElementEquals('#')
|
||||
&& !stack.lastElementEquals('/*')
|
||||
&& !stack.lastElementEquals('(')
|
||||
&& (
|
||||
(tokenValue.search(/^\s*\[(global|end|GLOBAL|END)\]/) !== -1
|
||||
&& !stack.lastElementEquals('{'))
|
||||
|| (tokenValue.search(/^\s*\[(global|GLOBAL)\]/) !== -1)
|
||||
)
|
||||
) {
|
||||
insideCondition = false;
|
||||
ignoreLine = true;
|
||||
}
|
||||
|
||||
if (tokenValue === ')') {
|
||||
stack.popIfLastElementEquals('(');
|
||||
}
|
||||
if (tokenValue[0] === '*' && tokenValue[1] === '/') {
|
||||
stack.popIfLastElementEquals('/*');
|
||||
ignoreLine = true;
|
||||
}
|
||||
if (tokenValue === '}') {
|
||||
//no characters except whitespace allowed before closing bracket
|
||||
var trimmedLine = line.replace(/\s/g, '');
|
||||
if (trimmedLine === '') {
|
||||
stack.popIfLastElementEquals('{');
|
||||
if (prefixes.length > 0) {
|
||||
prefixes.pop();
|
||||
}
|
||||
ignoreLine = true;
|
||||
}
|
||||
}
|
||||
if (!stack.lastElementEquals('#')) {
|
||||
line += tokenValue;
|
||||
}
|
||||
} else {
|
||||
// ignore comments, ...
|
||||
if (!stack.lastElementEquals('/*') && !stack.lastElementEquals('(') && !ignoreLine && !insideCondition) {
|
||||
line = $.trim(line);
|
||||
// check if there is any operator in this line
|
||||
var op = TsParser.getOperator(line);
|
||||
if (op !== -1) {
|
||||
// figure out the position of the operator
|
||||
var pos = line.indexOf(op);
|
||||
// the target objectpath should be left to the operator
|
||||
var path = line.substring(0, pos);
|
||||
// if we are in between curly brackets: add prefixes to object path
|
||||
if (prefixes.length > 0) {
|
||||
path = prefixes.join('.') + '.' + path;
|
||||
}
|
||||
// the type or value should be right to the operator
|
||||
var str = line.substring(pos + op.length, line.length);
|
||||
path = $.trim(path);
|
||||
str = $.trim(str);
|
||||
switch (op) { // set a value or create a new object
|
||||
case '=':
|
||||
//ignore if path is empty or contains whitespace
|
||||
if (path.search(/\s/g) === -1 && path.length > 0) {
|
||||
TsParser.setTreeNodeValue(path, str);
|
||||
}
|
||||
break;
|
||||
case '=<': // reference to another object in the tree
|
||||
// resolve relative path
|
||||
if (prefixes.length > 0 && str.substr(0, 1) === '.') {
|
||||
str = prefixes.join('.') + str;
|
||||
}
|
||||
//ignore if either path or str is empty or contains whitespace
|
||||
if (path.search(/\s/g) === -1
|
||||
&& path.length > 0
|
||||
&& str.search(/\s/g) === -1
|
||||
&& str.length > 0
|
||||
) {
|
||||
TsParser.setReference(path, str);
|
||||
}
|
||||
break;
|
||||
case '<': // copy from another object in the tree
|
||||
// resolve relative path
|
||||
if (prefixes.length > 0 && str.substr(0, 1) === '.') {
|
||||
str = prefixes.join('.') + str;
|
||||
}
|
||||
//ignore if either path or str is empty or contains whitespace
|
||||
if (path.search(/\s/g) === -1
|
||||
&& path.length > 0
|
||||
&& str.search(/\s/g) === -1
|
||||
&& str.length > 0
|
||||
) {
|
||||
TsParser.setCopy(path, str);
|
||||
}
|
||||
break;
|
||||
case '>': // delete object value and properties
|
||||
TsParser.deleteTreeNodeValue(path);
|
||||
break;
|
||||
case ':=': // function operator
|
||||
// TODO: function-operator
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
stack.popIfLastElementEquals('#');
|
||||
ignoreLine = false;
|
||||
}
|
||||
}
|
||||
currentLine++;
|
||||
}
|
||||
// when node at cursorPos is reached:
|
||||
// save currentLine, currentTsTreeNode and filter if necessary
|
||||
// if there is a reference or copy operator ('<' or '=<')
|
||||
// return the treeNode of the path right to the operator,
|
||||
// else try to build a path from the whole line
|
||||
if (!stack.lastElementEquals('/*') && !stack.lastElementEquals('(') && !ignoreLine) {
|
||||
var i = line.indexOf('<');
|
||||
|
||||
if (i !== -1) {
|
||||
var path = line.substring(i + 1, line.length);
|
||||
path = $.trim(path);
|
||||
if (prefixes.length > 0 && path.substr(0, 1) === '.') {
|
||||
path = prefixes.join('.') + path;
|
||||
}
|
||||
} else {
|
||||
var path = line;
|
||||
if (prefixes.length > 0) {
|
||||
path = prefixes.join('.') + '.' + path;
|
||||
path = path.replace(/\s/g, '');
|
||||
}
|
||||
}
|
||||
var lastDot = path.lastIndexOf('.');
|
||||
path = path.substring(0, lastDot);
|
||||
}
|
||||
return TsParser.getTreeNode(path);
|
||||
};
|
||||
|
||||
/**
|
||||
* Iterates through the object tree, and creates treenodes
|
||||
* along the path, if necessary
|
||||
*
|
||||
* @param {String} path
|
||||
* @returns {Object}
|
||||
*/
|
||||
TsParser.getTreeNode = function(path) {
|
||||
path = $.trim(path);
|
||||
if (path.length === 0) {
|
||||
return TsParser.tsTree;
|
||||
}
|
||||
var aPath = path.split('.');
|
||||
|
||||
var subTree = TsParser.tsTree.childNodes,
|
||||
pathSeg,
|
||||
parent = TsParser.tsTree;
|
||||
|
||||
// step through the path from left to right
|
||||
for (var i = 0; i < aPath.length; i++) {
|
||||
pathSeg = aPath[i];
|
||||
|
||||
// if there isn't already a treenode
|
||||
if (typeof subTree[pathSeg] === 'undefined' || typeof subTree[pathSeg].childNodes === 'undefined') { // if this subpath is not defined in the code
|
||||
// create a new treenode
|
||||
subTree[pathSeg] = new TsParser.treeNode(pathSeg);
|
||||
subTree[pathSeg].parent = parent;
|
||||
// the extPath has to be set, so the TreeNode can retrieve the respecting node in the external templates
|
||||
var extPath = parent.extPath;
|
||||
if (extPath) {
|
||||
extPath += '.';
|
||||
}
|
||||
extPath += pathSeg;
|
||||
subTree[pathSeg].extPath = extPath;
|
||||
}
|
||||
if (i === aPath.length - 1) {
|
||||
return subTree[pathSeg];
|
||||
}
|
||||
parent = subTree[pathSeg];
|
||||
subTree = subTree[pathSeg].childNodes;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Navigates to the respecting treenode,
|
||||
* create nodes in the path, if necessary, and sets the value
|
||||
*
|
||||
* @param {String} path
|
||||
* @param {String} value
|
||||
*/
|
||||
TsParser.setTreeNodeValue = function(path, value) {
|
||||
var treeNode = TsParser.getTreeNode(path);
|
||||
// if we are inside a GIFBUILDER Object
|
||||
if (treeNode.parent !== null && (treeNode.parent.value === "GIFBUILDER" || treeNode.parent.getValue() === "GMENU_itemState") && value === "TEXT") {
|
||||
value = 'GB_TEXT';
|
||||
}
|
||||
if (treeNode.parent !== null && (treeNode.parent.value === "GIFBUILDER" || treeNode.parent.getValue() === "GMENU_itemState") && value === "IMAGE") {
|
||||
value = 'GB_IMAGE';
|
||||
}
|
||||
|
||||
// just override if it is a real objecttype
|
||||
if (TsParser.tsRef.isType(value)) {
|
||||
treeNode.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Navigates to the respecting treenode,
|
||||
* creates nodes if necessary, empties the value and childNodes-Array
|
||||
*
|
||||
* @param {String} path
|
||||
*/
|
||||
TsParser.deleteTreeNodeValue = function(path) {
|
||||
var treeNode = TsParser.getTreeNode(path);
|
||||
// currently the node is not deleted really, it's just not displayed cause value == null
|
||||
// deleting it would be a cleaner solution
|
||||
treeNode.value = null;
|
||||
treeNode.childNodes = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Copies a reference of the treeNode specified by path2
|
||||
* to the location specified by path1
|
||||
*
|
||||
* @param {String} path1
|
||||
* @param {String} path2
|
||||
*/
|
||||
TsParser.setReference = function(path1, path2) {
|
||||
var path1arr = path1.split('.'),
|
||||
lastNodeName = path1arr[path1arr.length - 1],
|
||||
treeNode1 = TsParser.getTreeNode(path1),
|
||||
treeNode2 = TsParser.getTreeNode(path2);
|
||||
|
||||
if (treeNode1.parent !== null) {
|
||||
treeNode1.parent.childNodes[lastNodeName] = treeNode2;
|
||||
} else {
|
||||
TsParser.tsTree.childNodes[lastNodeName] = treeNode2;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* copies a treeNode specified by path2
|
||||
* to the location specified by path1
|
||||
*
|
||||
* @param {String} path1
|
||||
* @param {String} path2
|
||||
*/
|
||||
TsParser.setCopy = function(path1, path2) {
|
||||
this.clone = function(myObj) {
|
||||
if (typeof myObj !== 'object') {
|
||||
return myObj;
|
||||
}
|
||||
|
||||
var myNewObj = {};
|
||||
for (var i in myObj) {
|
||||
// disable recursive cloning for parent object -> copy by reference
|
||||
if (i !== 'parent') {
|
||||
if (typeof myObj[i] === 'object') {
|
||||
myNewObj[i] = this.clone(myObj[i]);
|
||||
} else {
|
||||
myNewObj[i] = myObj[i];
|
||||
}
|
||||
} else {
|
||||
myNewObj.parent = myObj.parent;
|
||||
}
|
||||
}
|
||||
return myNewObj;
|
||||
};
|
||||
|
||||
var path1arr = path1.split('.'),
|
||||
lastNodeName = path1arr[path1arr.length - 1],
|
||||
treeNode1 = TsParser.getTreeNode(path1),
|
||||
treeNode2 = TsParser.getTreeNode(path2);
|
||||
|
||||
if (treeNode1.parent !== null) {
|
||||
treeNode1.parent.childNodes[lastNodeName] = this.clone(treeNode2);
|
||||
} else {
|
||||
TsParser.tsTree.childNodes[lastNodeName] = this.clone(treeNode2);
|
||||
}
|
||||
};
|
||||
|
||||
return TsParser;
|
||||
});
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module: TYPO3/CMS/T3editor/CodeCompletion/TsRef
|
||||
* Contains the TsCodeCompletion class
|
||||
*/
|
||||
define(['jquery'], function($) {
|
||||
/**
|
||||
*
|
||||
* @type {{typeId: null, properties: null, typeTree: Array, doc: null}}
|
||||
* @exports TYPO3/CMS/T3editor/CodeCompletion/TsRef
|
||||
*/
|
||||
var TsRef = {
|
||||
typeId: null,
|
||||
properties: null,
|
||||
typeTree: [],
|
||||
doc: null
|
||||
};
|
||||
|
||||
/**
|
||||
* Prototypes a TS reference type object
|
||||
*
|
||||
* @param {String} typeId
|
||||
*/
|
||||
TsRef.TsRefType = function(typeId) {
|
||||
this.typeId = typeId;
|
||||
this.properties = [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Prototypes a TS reference property object
|
||||
*
|
||||
* @param {String} parentType
|
||||
* @param {String} name
|
||||
* @param {String} value
|
||||
* @constructor
|
||||
*/
|
||||
TsRef.TsRefProperty = function(parentType, name, value) {
|
||||
this.parentType = parentType;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Load available TypoScript reference
|
||||
*/
|
||||
TsRef.loadTsrefAsync = function() {
|
||||
$.ajax({
|
||||
url: TYPO3.settings.ajaxUrls['t3editor_tsref'],
|
||||
success: function(response) {
|
||||
TsRef.doc = response;
|
||||
TsRef.buildTree();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Build the TypoScript reference tree
|
||||
*/
|
||||
TsRef.buildTree = function() {
|
||||
for (var typeId in TsRef.doc) {
|
||||
var arr = TsRef.doc[typeId];
|
||||
TsRef.typeTree[typeId] = new TsRef.TsRefType(typeId);
|
||||
|
||||
if (typeof arr['extends'] !== 'undefined') {
|
||||
TsRef.typeTree[typeId]['extends'] = arr['extends'];
|
||||
}
|
||||
for (var propName in arr.properties) {
|
||||
var propType = arr.properties[propName].type;
|
||||
TsRef.typeTree[typeId].properties[propName] = new TsRef.TsRefProperty(typeId, propName, propType);
|
||||
}
|
||||
}
|
||||
for (var typeId in TsRef.typeTree) {
|
||||
if (typeof TsRef.typeTree[typeId]['extends'] !== 'undefined') {
|
||||
TsRef.addPropertiesToType(TsRef.typeTree[typeId], TsRef.typeTree[typeId]['extends'], 100);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds properties to TypoScript types
|
||||
*
|
||||
* @param {String} addToType
|
||||
* @param {String} addFromTypeNames
|
||||
* @param {Number} maxRecDepth
|
||||
*/
|
||||
TsRef.addPropertiesToType = function(addToType, addFromTypeNames, maxRecDepth) {
|
||||
if (maxRecDepth < 0) {
|
||||
throw "Maximum recursion depth exceeded while trying to resolve the extends in the TSREF!";
|
||||
return;
|
||||
}
|
||||
var exts = addFromTypeNames.split(','),
|
||||
i;
|
||||
for (i = 0; i < exts.length; i++) {
|
||||
// "Type 'array' which is used to extend 'undefined', was not found in the TSREF!"
|
||||
if (typeof TsRef.typeTree[exts[i]] !== 'undefined') {
|
||||
if (typeof TsRef.typeTree[exts[i]]['extends'] !== 'undefined') {
|
||||
TsRef.addPropertiesToType(TsRef.typeTree[exts[i]], TsRef.typeTree[exts[i]]['extends'], maxRecDepth - 1);
|
||||
}
|
||||
var properties = TsRef.typeTree[exts[i]].properties;
|
||||
for (var propName in properties) {
|
||||
// only add this property if it was not already added by a supertype (subtypes override supertypes)
|
||||
if (typeof addToType.properties[propName] === 'undefined') {
|
||||
addToType.properties[propName] = properties[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get properties from given TypoScript type id
|
||||
*
|
||||
* @param {String} tId
|
||||
* @return {Array}
|
||||
*/
|
||||
TsRef.getPropertiesFromTypeId = function(tId) {
|
||||
if (typeof TsRef.typeTree[tId] !== 'undefined') {
|
||||
// clone is needed to assure that nothing of the tsref is overwritten by user setup
|
||||
TsRef.typeTree[tId].properties.clone = function() {
|
||||
var result = [];
|
||||
for (key in this) {
|
||||
result[key] = new TsRef.TsRefProperty(this[key].parentType, this[key].name, this[key].value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return TsRef.typeTree[tId].properties;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a property of a type exists
|
||||
*
|
||||
* @param {String} typeId
|
||||
* @param {String} propertyName
|
||||
* @return {Boolean}
|
||||
*/
|
||||
TsRef.typeHasProperty = function(typeId, propertyName) {
|
||||
return typeof TsRef.typeTree[typeId] !== 'undefined'
|
||||
&& typeof TsRef.typeTree[typeId].properties[propertyName] !== 'undefined';
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the type
|
||||
*
|
||||
* @param {String} typeId
|
||||
* @return {Object}
|
||||
*/
|
||||
TsRef.getType = function(typeId) {
|
||||
return TsRef.typeTree[typeId];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if type exists in the type tree
|
||||
*
|
||||
* @param {String} typeId
|
||||
* @return {Boolean}
|
||||
*/
|
||||
TsRef.isType = function(typeId) {
|
||||
return typeof TsRef.typeTree[typeId] !== 'undefined';
|
||||
};
|
||||
|
||||
return TsRef;
|
||||
});
|
||||
@@ -0,0 +1,105 @@
|
||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports === 'object' && typeof module === 'object') // CommonJS
|
||||
mod(require('cm/lib/codemirror', 'TYPO3/CMS/T3editor/Addon/Hint/TsCodeCompletion'));
|
||||
else if (typeof define === 'function' && define.amd) // AMD
|
||||
define(['cm/lib/codemirror', 'TYPO3/CMS/T3editor/Addon/Hint/TsCodeCompletion'], mod);
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
})(function(CodeMirror, TsCodeCompletion) {
|
||||
var Pos = CodeMirror.Pos;
|
||||
|
||||
CodeMirror.registerHelper('hint', 'typoscript', function(editor, options) {
|
||||
return typoScriptHint(editor, function(e, cur) {
|
||||
return e.getTokenAt(cur);
|
||||
}, options);
|
||||
});
|
||||
|
||||
function arrayContains(arr, item) {
|
||||
if (!Array.prototype.indexOf) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] === item) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return arr.indexOf(item) !== -1;
|
||||
}
|
||||
|
||||
function typoScriptHint(editor, getToken) {
|
||||
var keywords = TsCodeCompletion.refreshCodeCompletion(editor);
|
||||
|
||||
// Find the token at the cursor
|
||||
var cur = editor.getCursor(),
|
||||
token = getToken(editor, cur);
|
||||
|
||||
if (/\b(?:string|comment)\b/.test(token.type) && tokenIsSubStringOfKeywords(token, keywords)) {
|
||||
return;
|
||||
}
|
||||
token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
|
||||
|
||||
// If it's not a 'word-style' token, ignore the token.
|
||||
if (!/^[\w$_]*$/.test(token.string)) {
|
||||
token = {
|
||||
start: cur.ch, end: cur.ch, string: '', state: token.state,
|
||||
type: token.string === '.' ? 'property' : null
|
||||
};
|
||||
} else if (token.end > cur.ch) {
|
||||
token.end = cur.ch;
|
||||
token.string = token.string.slice(0, cur.ch - token.start);
|
||||
}
|
||||
|
||||
var completions = {
|
||||
list: getCompletions(token, keywords),
|
||||
from: Pos(cur.line, token.start),
|
||||
to: Pos(cur.line, token.end)
|
||||
};
|
||||
|
||||
CodeMirror.on(completions, 'pick', function() {
|
||||
TsCodeCompletion.resetCompList();
|
||||
});
|
||||
|
||||
return completions;
|
||||
}
|
||||
|
||||
function tokenIsSubStringOfKeywords(token, keywords) {
|
||||
var tokenLength = token.string.length;
|
||||
for (var i = 0; i < keywords.length; ++i) {
|
||||
if (token.string === keywords[i].substr(tokenLength)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getCompletions(token, keywords) {
|
||||
var found = [],
|
||||
start = token.string;
|
||||
|
||||
function maybeAdd(str) {
|
||||
if (str.lastIndexOf(start, 0) === 0 && !arrayContains(found, str)) {
|
||||
found.push(str);
|
||||
}
|
||||
}
|
||||
|
||||
// If not, just look in the global object and any local scope
|
||||
// (reading into JS mode internals to get at the local and global variables)
|
||||
for (var v = token.state.localVars; v; v = v.next) {
|
||||
maybeAdd(v.name);
|
||||
}
|
||||
for (var v = token.state.globalVars; v; v = v.next) {
|
||||
maybeAdd(v.name);
|
||||
}
|
||||
for (var i = 0, e = keywords.length; i < e; ++i) {
|
||||
maybeAdd(keywords[i]);
|
||||
}
|
||||
found.sort();
|
||||
|
||||
return found;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,938 @@
|
||||
List of CodeMirror contributors. Updated before every release.
|
||||
|
||||
4oo4
|
||||
4r2r
|
||||
Aaron Brooks
|
||||
Abdelouahab
|
||||
Abdussalam Abdurrahman
|
||||
Abe Fettig
|
||||
Abhishek Gahlot
|
||||
Adam Ahmed
|
||||
Adam King
|
||||
Adam Particka
|
||||
Adam Wight
|
||||
adanlobato
|
||||
Adán Lobato
|
||||
Aditya Toshniwal
|
||||
Adrian Aichner
|
||||
Adrian Heine
|
||||
Adrian Kunz
|
||||
Adrien Bertrand
|
||||
aeroson
|
||||
Ahmad Amireh
|
||||
Ahmad M. Zawawi
|
||||
ahoward
|
||||
Ajin Abraham
|
||||
Akeksandr Motsjonov
|
||||
Alasdair Smith
|
||||
AlbertHilb
|
||||
Alberto González Palomo
|
||||
Alberto Pose
|
||||
Albert Xing
|
||||
Alexander Marks
|
||||
Alexander Pavlov
|
||||
Alexander Schepanovski
|
||||
Alexander Shvets
|
||||
Alexander Solovyov
|
||||
Alexandre Bique
|
||||
Alex Churchill
|
||||
alexey-k
|
||||
Alex Piggott
|
||||
Alf Eaton
|
||||
Aliaksei Chapyzhenka
|
||||
Allen Sarkisyan
|
||||
Ami Fischman
|
||||
Amin Shali
|
||||
Amin Ullah Khan
|
||||
amshali@google.com
|
||||
Amsul
|
||||
amuntean
|
||||
Amy
|
||||
Ananya Sen
|
||||
anaran
|
||||
AndersMad
|
||||
Anders Nawroth
|
||||
Anderson Mesquita
|
||||
Anders Wåglund
|
||||
Andrea G
|
||||
Andreas Reischuck
|
||||
Andres Taylor
|
||||
Andre von Houck
|
||||
Andrew Cheng
|
||||
Andrew Dassonville
|
||||
Andrey Fedorov
|
||||
Andrey Klyuchnikov
|
||||
Andrey Lushnikov
|
||||
Andrey Shchekin
|
||||
Andy Joslin
|
||||
Andy Kimball
|
||||
Andy Li
|
||||
Angelo
|
||||
angelozerr
|
||||
angelo.zerr@gmail.com
|
||||
Ankit
|
||||
Ankit Ahuja
|
||||
Ansel Santosa
|
||||
Anthony Dugois
|
||||
anthonygego
|
||||
Anthony Gégo
|
||||
Anthony Grimes
|
||||
Anton Kovalyov
|
||||
antosarho
|
||||
Apollo Zhu
|
||||
AQNOUCH Mohammed
|
||||
Aram Shatakhtsyan
|
||||
areos
|
||||
Arnab Bose
|
||||
Arnoud Buzing
|
||||
Arsène von Wyss
|
||||
Arthur Müller
|
||||
Arun Narasani
|
||||
as3boyan
|
||||
asolove
|
||||
atelierbram
|
||||
AtomicPages LLC
|
||||
Atul Bhouraskar
|
||||
Aurelian Oancea
|
||||
Axel Lewenhaupt
|
||||
Baptiste Augrain
|
||||
Barret Rennie
|
||||
Bartosz Dziewoński
|
||||
Basarat Ali Syed
|
||||
Bastian Müller
|
||||
belhaj
|
||||
Bem Jones-Bey
|
||||
benbro
|
||||
Benedikt Meurer
|
||||
benhormann
|
||||
Ben Hormann
|
||||
Beni Cherniavsky-Paskin
|
||||
Benjamin DeCoste
|
||||
Benjamin Young
|
||||
Ben Keen
|
||||
Ben Miller
|
||||
Ben Mosher
|
||||
Bernhard Sirlinger
|
||||
Bert Chang
|
||||
Bharad
|
||||
BigBlueHat
|
||||
Billy Moon
|
||||
Bin Ni
|
||||
binny
|
||||
Bjorn Hansen
|
||||
B Krishna Chaitanya
|
||||
Blaine G
|
||||
blukat29
|
||||
Bo
|
||||
boomyjee
|
||||
Bo Peng
|
||||
borawjm
|
||||
Boris K
|
||||
Brad Metcalf
|
||||
Brandon Frohs
|
||||
Brandon Wamboldt
|
||||
Bret Little
|
||||
Brett Zamir
|
||||
Brian Grinstead
|
||||
BrianHung
|
||||
Brian Sletten
|
||||
brrd
|
||||
Bruce Mitchener
|
||||
Bruno Logerfo
|
||||
Bryan Gin-ge Chen
|
||||
Bryan Massoth
|
||||
Caitlin Potter
|
||||
Calin Barbat
|
||||
callodacity
|
||||
Camilo Roca
|
||||
Casey Klebba
|
||||
cBiscuit87
|
||||
César González Íñiguez
|
||||
Chad Jolly
|
||||
Chandra Sekhar Pydi
|
||||
Charles Skelton
|
||||
Cheah Chu Yeow
|
||||
Chhekur
|
||||
Chris Colborne
|
||||
Chris Coyier
|
||||
Chris Ford
|
||||
Chris Granger
|
||||
Chris Houseknecht
|
||||
Chris Lohfink
|
||||
Chris Morgan
|
||||
Chris Reeves
|
||||
Chris Smith
|
||||
Christian Gruen
|
||||
Christian Oyarzun
|
||||
Christian Petrov
|
||||
christopherblaser
|
||||
Christopher Brown
|
||||
Christopher Kramer
|
||||
Christopher Mitchell
|
||||
Christopher Pfohl
|
||||
Christopher Wallis
|
||||
Chunliang Lyu
|
||||
ciaranj
|
||||
clone-it
|
||||
clso
|
||||
CodeAnimal
|
||||
CodeBitt
|
||||
coderaiser
|
||||
Cole R Lawrence
|
||||
ComFreek
|
||||
Cornelius Weig
|
||||
Cristian Prieto
|
||||
Curran Kelleher
|
||||
Curtis Gagliardi
|
||||
d8888
|
||||
dagsta
|
||||
daines
|
||||
Dale Jung
|
||||
Dan Bentley
|
||||
Dan Heberden
|
||||
Daniel, Dao Quang Minh
|
||||
Daniele Di Sarli
|
||||
Daniel Faust
|
||||
Daniel Hanggi
|
||||
Daniel Huigens
|
||||
Daniel Kesler
|
||||
Daniel KJ
|
||||
Daniel Neel
|
||||
Daniel Parnell
|
||||
Daniel Thwaites
|
||||
Danila Malyutin
|
||||
Danny Yoo
|
||||
darealshinji
|
||||
Darius Roberts
|
||||
databricks-david-lewis
|
||||
Dave Brondsema
|
||||
Dave MacLachlan
|
||||
Dave Myers
|
||||
David Barnett
|
||||
David H. Bronke
|
||||
David Mignot
|
||||
David Pathakjee
|
||||
David R. Myers
|
||||
David Rodrigues
|
||||
David Santana
|
||||
David Vázquez
|
||||
David Whittington
|
||||
deebugger
|
||||
Deep Thought
|
||||
Denis Ovsienko
|
||||
Devin Abbott
|
||||
Devon Carew
|
||||
Dick Choi
|
||||
Diego Fernandez
|
||||
dignifiedquire
|
||||
Dimage Sapelkin
|
||||
Dimitri Mitropoulos
|
||||
Dinindu D. Wanniarachchi
|
||||
dmaclach
|
||||
Dmitry Kiselyov
|
||||
domagoj412
|
||||
Dominator008
|
||||
Domizio Demichelis
|
||||
Doug Blank
|
||||
Doug Wikle
|
||||
Drew Bratcher
|
||||
Drew Hintz
|
||||
Drew Khoury
|
||||
Drini Cami
|
||||
Dror BG
|
||||
Duncan Lilley
|
||||
duralog
|
||||
dwelle
|
||||
Ealton
|
||||
eborden
|
||||
edoroshenko
|
||||
edsharp
|
||||
ekhaled
|
||||
Elisée
|
||||
Elmar Peise
|
||||
elpnt
|
||||
Emmanuel Schanzer
|
||||
Enam Mijbah Noor
|
||||
Eric Allam
|
||||
Eric Bogard
|
||||
Erik Demaine
|
||||
Erik Welander
|
||||
erosman
|
||||
eustas
|
||||
Evan Minsk
|
||||
Fabien Dubosson
|
||||
Fabien O'Carroll
|
||||
Fabio Zendhi Nagao
|
||||
Faiza Alsaied
|
||||
Fauntleroy
|
||||
fbuchinger
|
||||
feizhang365
|
||||
Felipe Lalanne
|
||||
Felipe S. S. Schneider
|
||||
Felix Raab
|
||||
ficristo
|
||||
Filip Noetzel
|
||||
Filip Stollár
|
||||
Filype Pereira
|
||||
finalfantasia
|
||||
flack
|
||||
Florian Felten
|
||||
Fons van der Plas
|
||||
Forbes Lindesay
|
||||
ForbesLindesay
|
||||
Ford_Lawnmower
|
||||
Forrest Oliphant
|
||||
Franco Catena
|
||||
Frank Seifferth
|
||||
Frank Wiegand
|
||||
fraxx001
|
||||
Fredrik Borg
|
||||
FUJI Goro (gfx)
|
||||
Gabriel Gheorghian
|
||||
Gabriel Horner
|
||||
Gabriel Nahmias
|
||||
galambalazs
|
||||
Gary Sheng
|
||||
Gautam Mehta
|
||||
Gavin Douglas
|
||||
gekkoe
|
||||
Geordie Hall
|
||||
George Stephanis
|
||||
geowarin
|
||||
Gerard Braad
|
||||
Gergely Hegykozi
|
||||
Germain Chazot
|
||||
Giovanni Calò
|
||||
Glebov Boris
|
||||
Glenn Jorde
|
||||
Glenn Ruehle
|
||||
goldsmcb
|
||||
Golevka
|
||||
Google LLC
|
||||
Gordon Smith
|
||||
Grant Skinner
|
||||
greengiant
|
||||
Gregory Koberger
|
||||
Grzegorz Mazur
|
||||
Guang Li
|
||||
Guan Gui
|
||||
Guillaume Massé
|
||||
Guillaume Massé
|
||||
guraga
|
||||
Gustavo Rodrigues
|
||||
Hakan Tunc
|
||||
Hanno Fellmann
|
||||
Hans Engel
|
||||
Hanzhao Deng
|
||||
Haoran Yu
|
||||
Harald Schilly
|
||||
Hardest
|
||||
Harshvardhan Gupta
|
||||
Hasan Delibaş
|
||||
Hasan Karahan
|
||||
Heanes
|
||||
Hector Oswaldo Caballero
|
||||
Hein Htat
|
||||
Hélio
|
||||
Hendrik Erz
|
||||
Hendrik Wallbaum
|
||||
Henrik Haugbølle
|
||||
Herculano Campos
|
||||
hidaiy
|
||||
Hiroyuki Makino
|
||||
hitsthings
|
||||
Hocdoc
|
||||
Howard
|
||||
Howard Jing
|
||||
Hugues Malphettes
|
||||
Ian Beck
|
||||
Ian Davies
|
||||
Ian Dickinson
|
||||
Ian Henderson
|
||||
ianhi
|
||||
Ian Rose
|
||||
Ian Wehrman
|
||||
Ian Wetherbee
|
||||
Ice White
|
||||
ICHIKAWA, Yuji
|
||||
idleberg
|
||||
Igor Petruk
|
||||
ilvalle
|
||||
Ilya Kharlamov
|
||||
Ilya Zverev
|
||||
Ingo Richter
|
||||
Intervue
|
||||
Irakli Gozalishvili
|
||||
iteriani
|
||||
Ivan Kurnosov
|
||||
Ivoah
|
||||
Jack Douglas
|
||||
Jacob Lee
|
||||
Jaimin
|
||||
Jake Peyser
|
||||
Jakob Kummerow
|
||||
Jakob Miland
|
||||
Jakub T. Jankiewicz
|
||||
Jakub Vrana
|
||||
Jakub Vrána
|
||||
James Campos
|
||||
James Cockshull
|
||||
James Howard
|
||||
James Thorne
|
||||
Jamie Hill
|
||||
Jamie Morris
|
||||
Janice Leung
|
||||
Jan Jongboom
|
||||
jankeromnes
|
||||
Jan Keromnes
|
||||
Jan Odvarko
|
||||
Jan Schär
|
||||
Jan T. Sott
|
||||
Jared Dean
|
||||
Jared Forsyth
|
||||
Jared Jacobs
|
||||
Jason
|
||||
Jason Barnabe
|
||||
Jason Grout
|
||||
Jason Heeris
|
||||
Jason Johnston
|
||||
Jason San Jose
|
||||
Jason Siefken
|
||||
Jayaprabhakar
|
||||
Jay Contonio
|
||||
Jaydeep Solanki
|
||||
Jean Boussier
|
||||
Jeff Blaisdell
|
||||
Jeff Hanke
|
||||
Jeff Jenkins
|
||||
jeffkenton
|
||||
Jeff Pickhardt
|
||||
jem (graphite)
|
||||
Jeremy Parmenter
|
||||
Jim
|
||||
Jim Avery
|
||||
jkaplon
|
||||
JobJob
|
||||
jochenberger
|
||||
Jochen Berger
|
||||
Joel Einbinder
|
||||
joelpinheiro
|
||||
Joe Predham
|
||||
joewalsh
|
||||
Johan Ask
|
||||
Johannes
|
||||
John Chen
|
||||
John Connor
|
||||
John-David Dalton
|
||||
John Engler
|
||||
John Lees-Miller
|
||||
John Ryan
|
||||
John Snelson
|
||||
John Van Der Loo
|
||||
Jon Ander Peñalba
|
||||
Jonas Döbertin
|
||||
Jonas Helfer
|
||||
Jonathan Dierksen
|
||||
Jonathan Hart
|
||||
Jonathan Malmaud
|
||||
Jonathan Rascher
|
||||
Jon Gacnik
|
||||
jongalloway
|
||||
Jon Malmaud
|
||||
Jon Sangster
|
||||
Joo
|
||||
Joost-Wim Boekesteijn
|
||||
José dBruxelles
|
||||
Joseph Pecoraro
|
||||
Josh Barnes
|
||||
Josh Cohen
|
||||
Josh Soref
|
||||
Joshua Newman
|
||||
Josh Watzman
|
||||
jots
|
||||
Joy Zhong
|
||||
jsoojeon
|
||||
ju1ius
|
||||
Juan Benavides Romero
|
||||
Jucovschi Constantin
|
||||
Juho Vuori
|
||||
Julien CROUZET
|
||||
Julien Rebetez
|
||||
Justin Andresen
|
||||
Justin Hileman
|
||||
jwallers@gmail.com
|
||||
kaniga
|
||||
karevn
|
||||
Karol
|
||||
Kaushik Kulkarni
|
||||
Kayur Patel
|
||||
Kazuhito Hokamura
|
||||
kcwiakala
|
||||
Kees de Kooter
|
||||
Kenan Christian Dimas
|
||||
Ken Newman
|
||||
ken restivo
|
||||
Ken Rockot
|
||||
Kevin Earls
|
||||
Kevin Kwok
|
||||
Kevin Muret
|
||||
Kevin Sawicki
|
||||
Kevin Ushey
|
||||
Kier Darby
|
||||
Kim-Anh Tran
|
||||
Klaus Silveira
|
||||
Koh Zi Han, Cliff
|
||||
komakino
|
||||
Konstantin Chernenko
|
||||
Konstantin Lopuhin
|
||||
koops
|
||||
Kris Ciccarello
|
||||
ks-ifware
|
||||
kubelsmieci
|
||||
kvncp
|
||||
KwanEsq
|
||||
Kyle Kelley
|
||||
KyleMcNutt
|
||||
LaKing
|
||||
Lanfei
|
||||
Lanny
|
||||
laobubu
|
||||
Laszlo Vidacs
|
||||
leaf
|
||||
leaf corcoran
|
||||
Lemmon
|
||||
Leo Baschy
|
||||
Leonid Khachaturov
|
||||
Leon Sorokin
|
||||
Leonya Khachaturov
|
||||
lexer2086
|
||||
Liam Newman
|
||||
Libo Cannici
|
||||
Lior Goldberg
|
||||
Lior Shub
|
||||
lishid
|
||||
LloydMilligan
|
||||
LM
|
||||
lochel
|
||||
Lonnie Abelbeck
|
||||
Lorenzo Simionato
|
||||
Lorenzo Stoakes
|
||||
Louis Mauchet
|
||||
Luca Fabbri
|
||||
Lucas Buchala
|
||||
Luciano Longo
|
||||
Luciano Santana
|
||||
Lu Fangjian
|
||||
Łukasz Wielgus
|
||||
Luke Browning
|
||||
Luke Granger-Brown
|
||||
Luke Stagner
|
||||
lynschinzer
|
||||
M1cha
|
||||
Madhura Jayaratne
|
||||
Maksim Lin
|
||||
Maksym Taran
|
||||
Malay Majithia
|
||||
Manideep
|
||||
Manuel Rego Casasnovas
|
||||
Marat Dreizin
|
||||
Marcel Gerber
|
||||
Marcelo Camargo
|
||||
Marc Espín
|
||||
Marco Aurélio
|
||||
Marco Munizaga
|
||||
Marcus Bointon
|
||||
Marek Rudnicki
|
||||
Marijn Haverbeke
|
||||
Mário Gonçalves
|
||||
Mario Pietsch
|
||||
Mark Anderson
|
||||
Mark Boyes
|
||||
Mark Dalgleish
|
||||
Mark Hamstra
|
||||
Mark Lentczner
|
||||
Marko Bonaci
|
||||
Mark Peace
|
||||
Markus Bordihn
|
||||
Markus Olsson
|
||||
Martin Balek
|
||||
Martín Gaitán
|
||||
Martin Hasoň
|
||||
Martin Hunt
|
||||
Martin Laine
|
||||
Martin Zagora
|
||||
Masahiro MATAYOSHI
|
||||
Mason Malone
|
||||
Mateusz Paprocki
|
||||
Mathias Bynens
|
||||
mats cronqvist
|
||||
Matt Diehl
|
||||
Matt Gaide
|
||||
Matthew Bauer
|
||||
Matthew Beale
|
||||
Matthew Casperson
|
||||
matthewhayes
|
||||
Matthew Rathbone
|
||||
Matthew Suozzo
|
||||
Matthias Bussonnier
|
||||
Matthias BUSSONNIER
|
||||
Mattia Astorino
|
||||
Matt MacPherson
|
||||
Matt McDonald
|
||||
Matt Pass
|
||||
Matt Sacks
|
||||
mauricio
|
||||
Maximilian Hils
|
||||
Maxim Kraev
|
||||
Max Kirsch
|
||||
Max Schaefer
|
||||
Max Wu
|
||||
Max Xiantu
|
||||
mbarkhau
|
||||
McBrainy
|
||||
mce2
|
||||
Mélanie Chauvel
|
||||
melpon
|
||||
meshuamam
|
||||
Metatheos
|
||||
Micah Dubinko
|
||||
Michael
|
||||
Michael Chirico
|
||||
Michael Goderbauer
|
||||
Michael Grey
|
||||
Michael Kaminsky
|
||||
Michael Lehenbauer
|
||||
Michael Wadman
|
||||
Michael Walker
|
||||
Michael Zhou
|
||||
Michal Čihař
|
||||
Michal Dorner
|
||||
Michal Kapiczynski
|
||||
Mighty Guava
|
||||
Miguel Castillo
|
||||
mihailik
|
||||
Mika Andrianarijaona
|
||||
Mike
|
||||
Mike Bostock
|
||||
Mike Brevoort
|
||||
Mike Diaz
|
||||
Mike Ivanov
|
||||
Mike Kadin
|
||||
Mike Kobit
|
||||
Milan Szekely
|
||||
MinRK
|
||||
Miraculix87
|
||||
misfo
|
||||
mkaminsky11
|
||||
mloginov
|
||||
mlsad3
|
||||
Moritz Schubotz (physikerwelt)
|
||||
Moritz Schwörer
|
||||
Moshe Wajnberg
|
||||
mps
|
||||
ms
|
||||
mtaran-google
|
||||
Mu-An ✌️ Chiou
|
||||
Mu-An Chiou
|
||||
mzabuawala
|
||||
Narciso Jaramillo
|
||||
nathanlesage
|
||||
Nathan Williams
|
||||
ndr
|
||||
Neil Anderson
|
||||
neon-dev
|
||||
nerbert
|
||||
NetworkNode
|
||||
nextrevision
|
||||
ngn
|
||||
nguillaumin
|
||||
Ng Zhi An
|
||||
Nicholas Bollweg
|
||||
Nicholas Bollweg (Nick)
|
||||
NickKolok
|
||||
Nick Kreeger
|
||||
Nick Small
|
||||
Nicolas Chevobbe
|
||||
Nicolas Kick
|
||||
Nicolò Ribaudo
|
||||
Niels van Groningen
|
||||
nightwing
|
||||
Nikita Beloglazov
|
||||
Nikita Vasilyev
|
||||
Nikolaj Kappler
|
||||
Nikolay Kostov
|
||||
nilp0inter
|
||||
Nils Knappmeier
|
||||
Nina Pypchenko
|
||||
Nisarg Jhaveri
|
||||
nlwillia
|
||||
noragrossman
|
||||
Norman Rzepka
|
||||
Nouzbe
|
||||
Oleksandr Yakovenko
|
||||
Olivia Ytterbrink
|
||||
Opender Singh
|
||||
opl-
|
||||
Oreoluwa Onatemowo
|
||||
orionlee
|
||||
oscar.lofwenhamn
|
||||
Oskar Segersvärd
|
||||
ossdev
|
||||
overdodactyl
|
||||
pablo
|
||||
pabloferz
|
||||
Pablo Zubieta
|
||||
paddya
|
||||
Page
|
||||
paladox
|
||||
Panupong Pasupat
|
||||
paris
|
||||
Paris
|
||||
Paris Kasidiaris
|
||||
Patil Arpith
|
||||
Patrick Kettner
|
||||
Patrick Stoica
|
||||
Patrick Strawderman
|
||||
Paul Garvin
|
||||
Paul Ivanov
|
||||
Paul Masson
|
||||
Paul Schmidt
|
||||
Pavel
|
||||
Pavel Feldman
|
||||
Pavel Petržela
|
||||
Pavel Strashkin
|
||||
Paweł Bartkiewicz
|
||||
peteguhl
|
||||
peter
|
||||
Peter Flynn
|
||||
peterkroon
|
||||
Peter Kroon
|
||||
Peter László
|
||||
Phil DeJarnett
|
||||
Philipp A
|
||||
Philipp Markovics
|
||||
Philip Stadermann
|
||||
Pi Delport
|
||||
Pierre Gerold
|
||||
Pieter Ouwerkerk
|
||||
Piyush
|
||||
Pontus Melke
|
||||
prasanthj
|
||||
Prasanth J
|
||||
Prayag Verma
|
||||
prendota
|
||||
Prendota
|
||||
ps173
|
||||
Qiang Li
|
||||
quiddity-wp
|
||||
Radek Piórkowski
|
||||
Rahul
|
||||
Rahul Anand
|
||||
ramwin1
|
||||
Randall Mason
|
||||
Randy Burden
|
||||
Randy Edmunds
|
||||
Randy Luecke
|
||||
Raphael Amorim
|
||||
Rasmus Erik Voel Jensen
|
||||
Rasmus Schultz
|
||||
raymondf
|
||||
Raymond Hill
|
||||
ray ratchup
|
||||
Ray Ratchup
|
||||
Remi Nyborg
|
||||
Renaud Durlin
|
||||
Reynold Xin
|
||||
Richard Denton
|
||||
Richard van der Meer
|
||||
Richard Z.H. Wang
|
||||
Rishi Goomar
|
||||
Robert Brignull
|
||||
Robert Crossfield
|
||||
Robert Martin
|
||||
Roberto Abdelkader Martínez Pérez
|
||||
robertop23
|
||||
Roberto Vidal
|
||||
Robert Plummer
|
||||
Roman Frolov
|
||||
Roman Janusz
|
||||
Rongjian Zhang
|
||||
Rrandom
|
||||
Rrrandom
|
||||
Ruslan Osmanov
|
||||
rvalavicius
|
||||
Ryan Pangrle
|
||||
Ryan Petrello
|
||||
Ryan Prior
|
||||
ryu-sato
|
||||
sabaca
|
||||
Sam Lee
|
||||
Sam Rawlins
|
||||
Samuel Ainsworth
|
||||
Sam Wilson
|
||||
sandeepshetty
|
||||
Sander AKA Redsandro
|
||||
Sander Verweij
|
||||
santec
|
||||
Sarah McAlear and Wenlin Zhang
|
||||
Sascha Peilicke
|
||||
Sasha Varlamov
|
||||
satamas
|
||||
satchmorun
|
||||
sathyamoorthi
|
||||
Saul Costa
|
||||
S. Chris Colbert
|
||||
SCLINIC\jdecker
|
||||
Scott Aikin
|
||||
Scott Feeney
|
||||
Scott Goodhew
|
||||
Seb35
|
||||
Sebastian Ślepowroński
|
||||
Sebastian Wilzbach
|
||||
Sebastian Zaha
|
||||
Seren D
|
||||
Sergey Goder
|
||||
Sergey Tselovalnikov
|
||||
Se-Won Kim
|
||||
Shane Liesegang
|
||||
shaund
|
||||
shaun gilchrist
|
||||
Shawn A
|
||||
Shea Bunge
|
||||
sheopory
|
||||
Shil S
|
||||
Shiv Deepak
|
||||
Shmuel Englard
|
||||
Shubham Jain
|
||||
Siamak Mokhtari
|
||||
Siddhartha Gunti
|
||||
silverwind
|
||||
Simon Edwards
|
||||
Simon Huber
|
||||
sinkuu
|
||||
Slava Rozhnev
|
||||
snasa
|
||||
soliton4
|
||||
sonson
|
||||
Sorab Bisht
|
||||
spastorelli
|
||||
srajanpaliwal
|
||||
Stanislav Oaserele
|
||||
stan-z
|
||||
Stas Kobzar
|
||||
stasoid
|
||||
Stefan Borsje
|
||||
Steffen Beyer
|
||||
Steffen Bruchmann
|
||||
Steffen Kowalski
|
||||
Stephane Moore
|
||||
Stephen Lavelle
|
||||
Steve Champagne
|
||||
Steve Hoover
|
||||
Steven Yung
|
||||
Steve O'Hara
|
||||
stockiNail
|
||||
stoskov
|
||||
Stryder Crown
|
||||
Stu Kennedy
|
||||
Sungho Kim
|
||||
sverweij
|
||||
Taha Jahangir
|
||||
takamori
|
||||
Tako Schotanus
|
||||
Takuji Shimokawa
|
||||
Takuya Matsuyama
|
||||
Tarmil
|
||||
T. Brandon Ashley
|
||||
TDaglis
|
||||
Teja
|
||||
tel
|
||||
Tentone
|
||||
tfjgeorge
|
||||
Thaddee Tyl
|
||||
thanasis
|
||||
TheHowl
|
||||
themrmax
|
||||
Thiemo Kreuz
|
||||
think
|
||||
Thomas Brouard
|
||||
Thomas Dvornik
|
||||
Thomas Kluyver
|
||||
thomasmaclean
|
||||
Thomas Schmid
|
||||
Tim Alby
|
||||
Tim Baumann
|
||||
Tim Gates
|
||||
Timothy Farrell
|
||||
Timothy Gu
|
||||
Timothy Hatcher
|
||||
Tim van der Lippe
|
||||
Tobias Bertelsen
|
||||
TobiasBg
|
||||
Todd Berman
|
||||
Todd Kennedy
|
||||
tokafew420
|
||||
Tomas-A
|
||||
Tomas Varaneckas
|
||||
Tom Erik Støwer
|
||||
Tom Klancer
|
||||
Tom MacWright
|
||||
Tom McLaughlin
|
||||
Tony Jian
|
||||
tophf
|
||||
Torben Bundt
|
||||
Torgeir Thoresen
|
||||
totalamd
|
||||
Travis Heppe
|
||||
Triangle717
|
||||
Tristan Tarrant
|
||||
TSUYUSATO Kitsune
|
||||
Tugrul Elmas
|
||||
twifkak
|
||||
Tyler Long
|
||||
Tyler Makaro
|
||||
Vadim Dyachenko
|
||||
Vadzim Ramanenka
|
||||
Vaibhav Sagar
|
||||
vamshi.revu
|
||||
VapidWorx
|
||||
Vestimir Markov
|
||||
vf
|
||||
Victor Bocharsky
|
||||
Vincent Woo
|
||||
Volker Mische
|
||||
vtripolitakis
|
||||
wdouglashall
|
||||
Weiyan Shao
|
||||
wenli
|
||||
Wes Cossick
|
||||
Wesley Wiser
|
||||
Weston Ruter
|
||||
Will Binns-Smith
|
||||
Will Dean
|
||||
William Desportes
|
||||
William Jamieson
|
||||
William Stein
|
||||
Willy
|
||||
Wojtek Ptak
|
||||
wonderboyjon
|
||||
Wu Cheng-Han
|
||||
Xavier Mendez
|
||||
Yang Guo
|
||||
Yash Singh
|
||||
Yash-Singh1
|
||||
Yassin N. Hassan
|
||||
YNH Webdev
|
||||
yoongu
|
||||
Yunchi Luo
|
||||
Yuvi Panda
|
||||
Yvonnick Esnault
|
||||
Zac Anger
|
||||
Zachary Dremann
|
||||
ZeeshanNoor
|
||||
Zeno Rocha
|
||||
Zhang Hao
|
||||
Ziv
|
||||
zoobestik
|
||||
zziuni
|
||||
魏鹏刚
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,92 @@
|
||||
# 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
|
||||
|
||||
Note that we are not accepting any new addons or modes into the main
|
||||
distribution. If you've written such a module, please distribute it as
|
||||
a separate NPM package.
|
||||
|
||||
- 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)).
|
||||
Don't put more than one feature/fix in a single pull request.
|
||||
|
||||
By contributing code to CodeMirror you
|
||||
|
||||
- agree to license the contributed code under CodeMirror's [MIT
|
||||
license](https://codemirror.net/LICENSE).
|
||||
|
||||
- confirm that you have the right to contribute and license the code
|
||||
in question. (Either you hold all rights on the code, or the rights
|
||||
holder has explicitly granted the right to use it like this,
|
||||
through a compatible open source license or through a direct
|
||||
agreement with you.)
|
||||
|
||||
### Coding standards
|
||||
|
||||
- 2 spaces per indentation level, no tabs.
|
||||
|
||||
- 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,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,47 @@
|
||||
# CodeMirror
|
||||
|
||||
[](https://github.com/codemirror/codemirror/actions)
|
||||
[](https://www.npmjs.org/package/codemirror)
|
||||
|
||||
CodeMirror is a versatile text editor implemented in JavaScript for
|
||||
the browser. It is specialized for editing code, and comes with over
|
||||
100 language modes and various addons that implement more advanced
|
||||
editing functionality. Every language comes with fully-featured code
|
||||
and syntax highlighting to help with reading and editing complex code.
|
||||
|
||||
A rich programming API and a CSS theming system are available for
|
||||
customizing CodeMirror to fit your application, and extending it with
|
||||
new functionality.
|
||||
|
||||
You can find more information (and the
|
||||
[manual](https://codemirror.net/doc/manual.html)) on the [project
|
||||
page](https://codemirror.net). For questions and discussion, use the
|
||||
[discussion forum](https://discuss.codemirror.net/).
|
||||
|
||||
See
|
||||
[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
|
||||
for contributing guidelines.
|
||||
|
||||
The CodeMirror community aims to be welcoming to everybody. We use the
|
||||
[Contributor Covenant
|
||||
(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
|
||||
conduct.
|
||||
|
||||
### Installation
|
||||
|
||||
Either get the [zip file](https://codemirror.net/codemirror.zip) with
|
||||
the latest version, or make sure you have [Node](https://nodejs.org/)
|
||||
installed and run:
|
||||
|
||||
npm install codemirror
|
||||
|
||||
**NOTE**: This is the source repository for the library, and not the
|
||||
distribution channel. Cloning it is not the recommended way to install
|
||||
the library, and will in fact not work unless you also run the build
|
||||
step.
|
||||
|
||||
### Quickstart
|
||||
|
||||
To build the project, make sure you have Node.js installed (at least version 6)
|
||||
and then `npm install`. To run, just open `index.html` in your
|
||||
browser (you don't need to run a webserver). Run the tests with `npm test`.
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var n={},t=/[^\s\u00a0]/,i=e.Pos,l=e.cmpPos;function o(e){var n=e.search(t);return-1==n?0:n}function r(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=n);for(var t=1/0,l=this.listSelections(),o=null,r=l.length-1;r>=0;r--){var a=l[r].from(),m=l[r].to();a.line>=t||(m.line>=t&&(m=i(t,0)),t=a.line,null==o?this.uncomment(a,m,e)?o="un":(this.lineComment(a,m,e),o="line"):"un"==o?this.uncomment(a,m,e):this.lineComment(a,m,e))}})),e.defineExtension("lineComment",(function(e,l,a){a||(a=n);var m=this,c=r(m,e),s=m.getLine(e.line);if(null!=s&&(g=e,f=s,!/\bstring\b/.test(m.getTokenTypeAt(i(g.line,0)))||/^[\'\"\`]/.test(f))){var g,f,d=a.lineComment||c.lineComment;if(d){var u=Math.min(0!=l.ch||l.line==e.line?l.line+1:l.line,m.lastLine()+1),h=null==a.padding?" ":a.padding,C=a.commentBlankLines||e.line==l.line;m.operation((function(){if(a.indent){for(var n=null,l=e.line;l<u;++l){var r=(c=m.getLine(l)).slice(0,o(c));(null==n||n.length>r.length)&&(n=r)}for(l=e.line;l<u;++l){var c=m.getLine(l),s=n.length;(C||t.test(c))&&(c.slice(0,s)!=n&&(s=o(c)),m.replaceRange(n+d+h,i(l,0),i(l,s)))}}else for(l=e.line;l<u;++l)(C||t.test(m.getLine(l)))&&m.replaceRange(d+h,i(l,0))}))}else(a.blockCommentStart||c.blockCommentStart)&&(a.fullLines=!0,m.blockComment(e,l,a))}})),e.defineExtension("blockComment",(function(e,o,a){a||(a=n);var m=this,c=r(m,e),s=a.blockCommentStart||c.blockCommentStart,g=a.blockCommentEnd||c.blockCommentEnd;if(s&&g){if(!/\bcomment\b/.test(m.getTokenTypeAt(i(e.line,0)))){var f=Math.min(o.line,m.lastLine());f!=e.line&&0==o.ch&&t.test(m.getLine(f))&&--f;var d=null==a.padding?" ":a.padding;e.line>f||m.operation((function(){if(0!=a.fullLines){var n=t.test(m.getLine(f));m.replaceRange(d+g,i(f)),m.replaceRange(s+d,i(e.line,0));var r=a.blockCommentLead||c.blockCommentLead;if(null!=r)for(var u=e.line+1;u<=f;++u)(u!=f||n)&&m.replaceRange(r+d,i(u,0))}else{var h=0==l(m.getCursor("to"),o),C=!m.somethingSelected();m.replaceRange(g,o),h&&m.setSelection(C?o:m.getCursor("from"),o),m.replaceRange(s,e)}}))}}else(a.lineComment||c.lineComment)&&0!=a.fullLines&&m.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,l,o){o||(o=n);var a,m=this,c=r(m,e),s=Math.min(0!=l.ch||l.line==e.line?l.line:l.line-1,m.lastLine()),g=Math.min(e.line,s),f=o.lineComment||c.lineComment,d=[],u=null==o.padding?" ":o.padding;e:if(f){for(var h=g;h<=s;++h){var C=m.getLine(h),p=C.indexOf(f);if(p>-1&&!/comment/.test(m.getTokenTypeAt(i(h,p+1)))&&(p=-1),-1==p&&t.test(C))break e;if(p>-1&&t.test(C.slice(0,p)))break e;d.push(C)}if(m.operation((function(){for(var e=g;e<=s;++e){var n=d[e-g],t=n.indexOf(f),l=t+f.length;t<0||(n.slice(l,l+u.length)==u&&(l+=u.length),a=!0,m.replaceRange("",i(e,t),i(e,l)))}})),a)return!0}var v=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!v||!b)return!1;var k=o.blockCommentLead||c.blockCommentLead,L=m.getLine(g),x=L.indexOf(v);if(-1==x)return!1;var R=s==g?L:m.getLine(s),O=R.indexOf(b,s==g?x+v.length:0),T=i(g,x+1),S=i(s,O+1);if(-1==O||!/comment/.test(m.getTokenTypeAt(T))||!/comment/.test(m.getTokenTypeAt(S))||m.getRange(T,S,"\n").indexOf(b)>-1)return!1;var y=L.lastIndexOf(v,e.ch),E=-1==y?-1:L.slice(0,e.ch).indexOf(b,y+v.length);if(-1!=y&&-1!=E&&E+b.length!=e.ch)return!1;E=R.indexOf(b,l.ch);var M=R.slice(l.ch).lastIndexOf(v,E-l.ch);return y=-1==E||-1==M?-1:l.ch+M,(-1==E||-1==y||y==l.ch)&&(m.operation((function(){m.replaceRange("",i(s,O-(u&&R.slice(O-u.length,O)==u?u.length:0)),i(s,O+b.length));var e=x+v.length;if(u&&L.slice(e,e+u.length)==u&&(e+=u.length),m.replaceRange("",i(g,x),i(g,e)),k)for(var n=g+1;n<=s;++n){var l=m.getLine(n),o=l.indexOf(k);if(-1!=o&&!t.test(l.slice(0,o))){var r=o+k.length;u&&l.slice(r,r+u.length)==u&&(r+=u.length),m.replaceRange("",i(n,o),i(n,r))}}})),!0)}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){var n=/\S/g,t=String.prototype.repeat||function(e){return Array(e+1).join(this)};function o(n){if(n.getOption("disableInput"))return e.Pass;for(var o,r=n.listSelections(),c=[],f=0;f<r.length;f++){var a=r[f].head;if(!/\bcomment\b/.test(n.getTokenTypeAt(a)))return e.Pass;var m=n.getModeAt(a);if(o){if(o!=m)return e.Pass}else o=m;var s,u,d=null,p=o.blockCommentStart,h=o.lineComment;if(p&&o.blockCommentContinue){var b=(s=n.getLine(a.line)).lastIndexOf(o.blockCommentEnd,a.ch-o.blockCommentEnd.length);if(-1!=b&&b==a.ch-o.blockCommentEnd.length||h&&(u=s.lastIndexOf(h,a.ch-1))>-1&&/\bcomment\b/.test(n.getTokenTypeAt({line:a.line,ch:u+1})));else if(a.ch>=p.length&&(u=s.lastIndexOf(p,a.ch-p.length))>-1&&u>b)if(i(0,s)>=u)d=s.slice(0,u);else{var g,C=n.options.tabSize;u=e.countColumn(s,u,C),d=n.options.indentWithTabs?t.call("\t",g=Math.floor(u/C))+t.call(" ",u-C*g):t.call(" ",u)}else(u=s.indexOf(o.blockCommentContinue))>-1&&u<=a.ch&&u<=i(0,s)&&(d=s.slice(0,u));null!=d&&(d+=o.blockCommentContinue)}if(null==d&&h&&l(n))if(null==s&&(s=n.getLine(a.line)),u=s.indexOf(h),a.ch||u){if(u>-1&&i(0,s)>=u){if(!(d=i(a.ch,s)>-1)){var v=n.getLine(a.line+1)||"",y=v.indexOf(h);d=y>-1&&i(0,v)>=y||null}d&&(d=s.slice(0,u)+h+s.slice(u+h.length).match(/^\s*/)[0])}}else d="";if(null==d)return e.Pass;c[f]="\n"+d}n.operation((function(){for(var e=r.length-1;e>=0;e--)n.replaceRange(c[e],r[e].from(),r[e].to(),"+insert")}))}function i(e,t){n.lastIndex=e;var o=n.exec(t);return o?o.index:-1}function l(e){var n=e.getOption("continueComments");return!n||"object"!=typeof n||!1!==n.continueLineComment}e.defineOption("continueComments",null,(function(n,t,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),t){var l="Enter";"string"==typeof t?l=t:"object"==typeof t&&t.key&&(l=t.key);var r={name:"continueComment"};r[l]=o,n.addKeyMap(r)}}))}));
|
||||
@@ -0,0 +1,32 @@
|
||||
.CodeMirror-dialog {
|
||||
position: absolute;
|
||||
left: 0; right: 0;
|
||||
background: inherit;
|
||||
z-index: 15;
|
||||
padding: .1em .8em;
|
||||
overflow: hidden;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.CodeMirror-dialog-top {
|
||||
border-bottom: 1px solid #eee;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-dialog-bottom {
|
||||
border-top: 1px solid #eee;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-dialog input {
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
width: 20em;
|
||||
color: inherit;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.CodeMirror-dialog button {
|
||||
font-size: 70%;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){function o(o,n,t){var i,r=o.getWrapperElement();return(i=r.appendChild(document.createElement("div"))).className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(r,"dialog-opened"),i}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",(function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),l=!1,a=this;function c(o){if("string"==typeof o)s.value=o;else{if(l)return;l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),a.focus(),r.onClose&&r.onClose(u)}}var d,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",(function(e){r.onInput(e,s.value,c)})),r.onKeyUp&&e.on(s,"keyup",(function(e){r.onKeyUp(e,s.value,c)})),e.on(s,"keydown",(function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,c)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),c()),13==o.keyCode&&i(s.value,o))})),!1!==r.closeOnBlur&&e.on(u,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(d=u.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),a.focus()})),!1!==r.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),l=u.getElementsByTagName("button"),a=!1,c=this,d=1;function s(){a||(a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),c.focus())}l[0].focus();for(var f=0;f<l.length;++f){var p=l[f];!function(o){e.on(p,"click",(function(n){e.e_preventDefault(n),s(),o&&o(c)}))}(i[f]),e.on(p,"blur",(function(){--d,setTimeout((function(){d<=0&&s()}),200)})),e.on(p,"focus",(function(){++d}))}})),e.defineExtension("openNotification",(function(t,i){n(this,c);var r,u=o(this,t,i&&i.bottom),l=!1,a=i&&void 0!==i.duration?i.duration:5e3;function c(){l||(l=!0,clearTimeout(r),e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u))}return e.on(u,"click",(function(o){e.e_preventDefault(o),c()})),a&&(r=setTimeout(c,a)),c}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(t,o){clearTimeout(o.timeout),e.off(window,"mouseup",o.hurry),e.off(window,"keyup",o.hurry)}e.defineOption("autoRefresh",!1,(function(o,i){o.state.autoRefresh&&(t(o,o.state.autoRefresh),o.state.autoRefresh=null),i&&0==o.display.wrapper.offsetHeight&&function(o,i){function r(){o.display.wrapper.offsetHeight?(t(o,i),o.display.lastWrapHeight!=o.display.wrapper.clientHeight&&o.refresh()):i.timeout=setTimeout(r,i.delay)}i.timeout=setTimeout(r,i.delay),i.hurry=function(){clearTimeout(i.timeout),i.timeout=setTimeout(r,50)},e.on(window,"mouseup",i.hurry),e.on(window,"keyup",i.hurry)}(o,o.state.autoRefresh={delay:i.delay||250})}))}));
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
.CodeMirror-fullscreen {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,o,r){r==e.Init&&(r=!1),!r!=!o&&(o?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=e.state.fullScreenRestore;t.style.width=o.width,t.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),e.refresh()}(t))}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){function t(e,t,i,n){this.cm=e,this.node=t,this.options=i,this.height=n,this.cleared=!1}function i(e,t){for(var i=t.nextSibling;i;i=i.nextSibling)if(i==e.getWrapperElement())return!0;return!1}e.defineExtension("addPanel",(function(e,n){n=n||{},this.state.panels||function(e){var t=e.getWrapperElement(),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=parseInt(i.height),r=e.state.panels={setHeight:t.style.height,panels:[],wrapper:document.createElement("div")},o=e.hasFocus(),s=e.getScrollInfo();t.parentNode.insertBefore(r.wrapper,t),r.wrapper.appendChild(t),e.scrollTo(s.left,s.top),o&&e.focus();e._setSize=e.setSize,null!=n&&(e.setSize=function(t,i){if(i||(i=r.wrapper.offsetHeight),r.setHeight=i,"number"!=typeof i){var o=/^(\d+\.?\d*)px$/.exec(i);o?i=Number(o[1]):(r.wrapper.style.height=i,i=r.wrapper.offsetHeight)}var s=i-r.panels.map((function(e){return e.node.getBoundingClientRect().height})).reduce((function(e,t){return e+t}),0);e._setSize(t,s),n=i})}(this);var r=this.state.panels,o=r.wrapper,s=this.getWrapperElement(),l=n.replace instanceof t&&!n.replace.cleared;n.after instanceof t&&!n.after.cleared?o.insertBefore(e,n.before.node.nextSibling):n.before instanceof t&&!n.before.cleared?o.insertBefore(e,n.before.node):l?(o.insertBefore(e,n.replace.node),n.replace.clear(!0)):"bottom"==n.position?o.appendChild(e):"before-bottom"==n.position?o.insertBefore(e,s.nextSibling):"after-top"==n.position?o.insertBefore(e,s):o.insertBefore(e,o.firstChild);var p=n&&n.height||e.offsetHeight,a=new t(this,e,n,p);return r.panels.push(a),this.setSize(),n.stable&&i(this,e)&&this.scrollTo(null,this.getScrollInfo().top+p),a})),t.prototype.clear=function(e){if(!this.cleared){this.cleared=!0;var t=this.cm.state.panels;t.panels.splice(t.panels.indexOf(this),1),this.cm.setSize(),this.options.stable&&i(this.cm,this.node)&&this.cm.scrollTo(null,this.cm.getScrollInfo().top-this.height),t.wrapper.removeChild(this.node),0!=t.panels.length||e||function(e){var t=e.state.panels;e.state.panels=null;var i=e.getWrapperElement(),n=e.hasFocus(),r=e.getScrollInfo();t.wrapper.parentNode.replaceChild(i,t.wrapper),e.scrollTo(r.left,r.top),n&&e.focus();i.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}(this.cm)}},t.prototype.changed=function(){this.height=this.node.getBoundingClientRect().height,this.cm.setSize()}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){function o(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function t(e){o(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.style.direction=e.getOption("direction"),t.className="CodeMirror-placeholder CodeMirror-line-like";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),t.appendChild(r),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function r(e){i(e)&&t(e)}function n(e){var r=e.getWrapperElement(),n=i(e);r.className=r.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?t(e):o(e)}function i(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(i,l,a){var c=a&&a!=e.Init;if(l&&!c)i.on("blur",r),i.on("change",n),i.on("swapDoc",n),e.on(i.getInputField(),"compositionupdate",i.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1;if(1==e.lineCount()){var n=e.getInputField();r="TEXTAREA"==n.nodeName?!e.getLine(0).length:!/[^\u200b]/.test(n.querySelector(".CodeMirror-line").textContent)}r?t(e):o(e)}),20)}(i)}),n(i);else if(!l&&c){i.off("blur",r),i.off("change",n),i.off("swapDoc",n),e.off(i.getInputField(),"compositionupdate",i.state.placeholderCompose),o(i);var p=i.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}l&&!i.hasFocus()&&r(i)}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function r(r){r.state.rulerDiv.textContent="";var t=r.getOption("rulers"),l=r.defaultCharWidth(),i=r.charCoords(e.Pos(r.firstLine(),0),"div").left;r.state.rulerDiv.style.minHeight=r.display.scroller.offsetHeight+30+"px";for(var o=0;o<t.length;o++){var s=document.createElement("div");s.className="CodeMirror-ruler";var n,a=t[o];"number"==typeof a?n=a:(n=a.column,a.className&&(s.className+=" "+a.className),a.color&&(s.style.borderColor=a.color),a.lineStyle&&(s.style.borderLeftStyle=a.lineStyle),a.width&&(s.style.borderLeftWidth=a.width)),s.style.left=i+n*l+"px",r.state.rulerDiv.appendChild(s)}}e.defineOption("rulers",!1,(function(e,t){e.state.rulerDiv&&(e.state.rulerDiv.parentElement.removeChild(e.state.rulerDiv),e.state.rulerDiv=null,e.off("refresh",r)),t&&t.length&&(e.state.rulerDiv=e.display.lineSpace.parentElement.insertBefore(document.createElement("div"),e.display.lineSpace),e.state.rulerDiv.className="CodeMirror-rulers",r(e),e.on("refresh",r))}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){var n={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},t=e.Pos;function r(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:n[t]}e.defineOption("autoCloseBrackets",!1,(function(n,t,o){o&&o!=e.Init&&(n.removeKeyMap(i),n.state.closeBrackets=null),t&&(a(r(t,"pairs")),n.state.closeBrackets=t,n.addKeyMap(i))}));var i={Backspace:function(n){var i=s(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=r(i,"pairs"),o=n.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;var f=c(n,o[l].head);if(!f||a.indexOf(f)%2!=0)return e.Pass}for(l=o.length-1;l>=0;l--){var h=o[l].head;n.replaceRange("",t(h.line,h.ch-1),t(h.line,h.ch+1),"+delete")}},Enter:function(n){var t=s(n),i=t&&r(t,"explode");if(!i||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),o=0;o<a.length;o++){if(!a[o].empty())return e.Pass;var f=c(n,a[o].head);if(!f||i.indexOf(f)%2!=0)return e.Pass}n.operation((function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),l(n,-1),a=n.listSelections();for(var t=0;t<a.length;t++){var r=a[t].head.line;n.indentLine(r,null,!0),n.indentLine(r+1,null,!0)}}))}};function a(e){for(var n=0;n<e.length;n++){var t=e.charAt(n),r="'"+t+"'";i[r]||(i[r]=o(t))}}function o(n){return function(i){return function(n,i){var a=s(n);if(!a||n.getOption("disableInput"))return e.Pass;var o=r(a,"pairs"),c=o.indexOf(i);if(-1==c)return e.Pass;for(var h,u=r(a,"closeBefore"),d=r(a,"triples"),p=o.charAt(c+1)==i,g=n.listSelections(),v=c%2==0,b=0;b<g.length;b++){var P,S=g[b],k=S.head,y=n.getRange(k,t(k.line,k.ch+1));if(v&&!S.empty())P="surround";else if(!p&&v||y!=i)if(p&&k.ch>1&&d.indexOf(i)>=0&&n.getRange(t(k.line,k.ch-2),k)==i+i){if(k.ch>2&&/\bstring/.test(n.getTokenTypeAt(t(k.line,k.ch-2))))return e.Pass;P="addFour"}else if(p){var O=0==k.ch?" ":n.getRange(t(k.line,k.ch-1),k);if(e.isWordChar(y)||O==i||e.isWordChar(O))return e.Pass;P="both"}else{if(!v||!(0===y.length||/\s/.test(y)||u.indexOf(y)>-1))return e.Pass;P="both"}else P=p&&f(n,k)?"both":d.indexOf(i)>=0&&n.getRange(k,t(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(h){if(h!=P)return e.Pass}else h=P}var m=c%2?o.charAt(c-1):i,x=c%2?i:o.charAt(c+1);n.operation((function(){if("skip"==h)l(n,1);else if("skipThree"==h)l(n,3);else if("surround"==h){for(var r=n.getSelections(),i=0;i<r.length;i++)r[i]=m+r[i]+x;n.replaceSelections(r,"around"),r=n.listSelections().slice();for(i=0;i<r.length;i++)r[i]=(a=r[i],o=void 0,o=e.cmpPos(a.anchor,a.head)>0,{anchor:new t(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new t(a.head.line,a.head.ch+(o?1:-1))});n.setSelections(r)}else"both"==h?(n.replaceSelection(m+x,null),n.triggerElectric(m+x),l(n,-1)):"addFour"==h&&(n.replaceSelection(m+m+m+m,"before"),l(n,1));var a,o}))}(i,n)}}function s(e){var n=e.state.closeBrackets;return!n||n.override?n:e.getModeAt(e.getCursor()).closeBrackets||n}function l(e,n){for(var t=[],r=e.listSelections(),i=0,a=0;a<r.length;a++){var o=r[a];o.head==e.getCursor()&&(i=a);var s=o.head.ch||n>0?{line:o.head.line,ch:o.head.ch+n}:{line:o.head.line-1};t.push({anchor:s,head:s})}e.setSelections(t,i)}function c(e,n){var r=e.getRange(t(n.line,n.ch-1),t(n.line,n.ch+1));return 2==r.length?r:null}function f(e,n){var r=e.getTokenAt(t(n.line,n.ch+1));return/\bstring/.test(r.type)&&r.start==n.ch&&(0==n.ch||!/\bstring/.test(e.getTokenTypeAt(n)))}a(n.pairs+"`")}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}((function(e){e.defineOption("autoCloseTags",!1,(function(a,l,s){if(s!=e.Init&&s&&a.removeKeyMap("autoCloseTags"),l){var d={name:"autoCloseTags"};"object"==typeof l&&!1===l.whenClosing||(d["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:o(t,!0)}(t)}),"object"==typeof l&&!1===l.whenOpening||(d["'>'"]=function(o){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var a=o.listSelections(),l=[],s=o.getOption("autoCloseTags"),d=0;d<a.length;d++){if(!a[d].empty())return e.Pass;var c=a[d].head,f=o.getTokenAt(c),g=e.innerMode(o.getMode(),f.state),u=g.state,m=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(u),h=m&&m.name;if(!h)return e.Pass;var p="html"==g.mode.configuration,C="object"==typeof s&&s.dontCloseTags||p&&t,b="object"==typeof s&&s.indentTags||p&&n;f.end>c.ch&&(h=h.slice(0,h.length-f.end+c.ch));var v=h.toLowerCase();if(!h||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&m.close||f.string.indexOf("/")==c.ch-f.start-1||C&&r(C,v)>-1||i(o,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u)||[],h,c,!0))return e.Pass;var y="object"==typeof s&&s.emptyTags;if(y&&r(y,h)>-1)l[d]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var x=b&&r(b,v)>-1;l[d]={indent:x,text:">"+(x?"\n\n":"")+"</"+h+">",newPos:x?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var P="object"==typeof s&&s.dontIndentOnAutoClose;for(d=a.length-1;d>=0;d--){var T=l[d];o.replaceRange(T.text,a[d].head,a[d].anchor,"+insert");var j=o.listSelections().slice(0);j[d]={head:T.newPos,anchor:T.newPos},o.setSelections(j),!P&&T.indent&&(o.indentLine(T.newPos.line,null,!0),o.indentLine(T.newPos.line+1,null,!0))}}(o)}),a.addKeyMap(d)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function o(t,n){for(var o=t.listSelections(),r=[],a=n?"/":"</",l=t.getOption("autoCloseTags"),s="object"==typeof l&&l.dontIndentOnSlash,d=0;d<o.length;d++){if(!o[d].empty())return e.Pass;var c=o[d].head,f=t.getTokenAt(c),g=e.innerMode(t.getMode(),f.state),u=g.state;if(n&&("string"==f.type||"<"!=f.string.charAt(0)||f.start!=c.ch-1))return e.Pass;var m,h="xml"!=g.mode.name&&"htmlmixed"==t.getMode().name;if(h&&"javascript"==g.mode.name)m=a+"script";else if(h&&"css"==g.mode.name)m=a+"style";else{var p=g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u),C=p.length?p[p.length-1]:"";if(!p||p.length&&i(t,p,C,c))return e.Pass;m=a+C}">"!=t.getLine(c.line).charAt(f.end)&&(m+=">"),r[d]=m}if(t.replaceSelections(r),o=t.listSelections(),!s)for(d=0;d<o.length;d++)(d==o.length-1||o[d].head.line<o[d+1].head.line)&&t.indentLine(o[d].head.line)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function i(t,n,o,r,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=o)return!1;for(var s=i?1:0,d=n.length-1;d>=0&&n[d]==o;d--)++s;r=l.to;for(d=1;d<s;d++){var c=e.scanForClosingTag(t,r,null,a);if(!c||c.tag!=o)return!1;r=c.to}return!0}e.commands.closeTag=function(e){return o(e)}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;function r(e,t){var i=t.line,r=0,l=0,o=n.exec(e.getLine(i)),s=o[1];do{var a=i+(r+=1),c=e.getLine(a),d=n.exec(c);if(d){var f=d[1],u=parseInt(o[3],10)+r-l,p=parseInt(d[3],10),g=p;if(s!==f||isNaN(p)){if(s.length>f.length)return;if(s.length<f.length&&1===r)return;l+=1}else u===p&&(g=p+1),u>p&&(g=u+1),e.replaceRange(c.replace(n,f+g+d[4]+d[5]),{line:a,ch:0},{line:a,ch:c.length})}}while(d)}e.commands.newlineAndIndentContinueMarkdownList=function(l){if(l.getOption("disableInput"))return e.Pass;for(var o=l.listSelections(),s=[],a=0;a<o.length;a++){var c=o[a].head,d=l.getStateAfter(c.line),f=e.innerMode(l.getMode(),d);if("markdown"!==f.mode.name)return void l.execCommand("newlineAndIndent");var u=!1!==(d=f.state).list,p=0!==d.quote,g=l.getLine(c.line),h=n.exec(g),m=/^\s*$/.test(g.slice(0,c.ch));if(!o[a].empty()||!u&&!p||!h||m)return void l.execCommand("newlineAndIndent");if(t.test(g)){var v=p&&/>\s*$/.test(g),x=!/>\s*$/.test(g);(v||x)&&l.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[a]="\n"}else{var I=h[1],w=h[5],b=!(i.test(h[2])||h[2].indexOf(">")>=0),y=b?parseInt(h[3],10)+1+h[4]:h[2].replace("x"," ");s[a]="\n"+I+y+w,b&&r(l,c)}}l.replaceSelections(s)}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function c(t,e,c){var o=t.getLineHandle(e.line),h=e.ch-1,l=c&&c.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var s=i(c),f=!l&&h>=0&&s.test(o.text.charAt(h))&&r[o.text.charAt(h)]||s.test(o.text.charAt(h+1))&&r[o.text.charAt(++h)];if(!f)return null;var u=">"==f.charAt(1)?1:-1;if(c&&c.strict&&u>0!=(h==e.ch))return null;var m=t.getTokenTypeAt(n(e.line,h+1)),g=a(t,n(e.line,h+(u>0?1:0)),u,m,c);return null==g?null:{from:n(e.line,h),to:g&&g.pos,match:g&&g.ch==f.charAt(0),forward:u>0}}function a(t,e,c,a,o){for(var h=o&&o.maxScanLineLength||1e4,l=o&&o.maxScanLines||1e3,s=[],f=i(o),u=c>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),m=e.line;m!=u;m+=c){var g=t.getLine(m);if(g){var d=c>0?0:g.length-1,k=c>0?g.length:-1;if(!(g.length>h))for(m==e.line&&(d=e.ch-(c<0?1:0));d!=k;d+=c){var p=g.charAt(d);if(f.test(p)&&(void 0===a||(t.getTokenTypeAt(n(m,d+1))||"")==(a||""))){var v=r[p];if(v&&">"==v.charAt(1)==c>0)s.push(p);else{if(!s.length)return{pos:n(m,d),ch:p};s.pop()}}}}}return m-c!=(c>0?t.lastLine():t.firstLine())&&null}function o(t,r,i){for(var a=t.state.matchBrackets.maxHighlightLineLength||1e3,o=i&&i.highlightNonMatching,h=[],l=t.listSelections(),s=0;s<l.length;s++){var f=l[s].empty()&&c(t,l[s].head,i);if(f&&(f.match||!1!==o)&&t.getLine(f.from.line).length<=a){var u=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(t.markText(f.from,n(f.from.line,f.from.ch+1),{className:u})),f.to&&t.getLine(f.to.line).length<=a&&h.push(t.markText(f.to,n(f.to.line,f.to.ch+1),{className:u}))}}if(h.length){e&&t.state.focused&&t.focus();var m=function(){t.operation((function(){for(var t=0;t<h.length;t++)h[t].clear()}))};if(!r)return m;setTimeout(m,800)}}function h(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=o(t,!1,t.state.matchBrackets)}))}function l(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}t.defineOption("matchBrackets",!1,(function(e,n,r){r&&r!=t.Init&&(e.off("cursorActivity",h),e.off("focus",h),e.off("blur",l),l(e)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",h),e.on("focus",h),e.on("blur",l))})),t.defineExtension("matchBrackets",(function(){o(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),c(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,n,r){return a(this,t,e,n,r)}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],t):t(CodeMirror)}((function(t){"use strict";function e(t){t.state.tagHit&&t.state.tagHit.clear(),t.state.tagOther&&t.state.tagOther.clear(),t.state.tagHit=t.state.tagOther=null}function a(a){a.state.failedTagMatch=!1,a.operation((function(){if(e(a),!a.somethingSelected()){var o=a.getCursor(),i=a.getViewport();i.from=Math.min(i.from,o.line),i.to=Math.max(o.line+1,i.to);var r=t.findMatchingTag(a,o,i);if(r){if(a.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(a.state.tagHit=a.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var c="close"==r.at?r.open:r.close;c?a.state.tagOther=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}}}))}function o(t){t.state.failedTagMatch&&a(t)}t.defineOption("matchTags",!1,(function(i,r,n){n&&n!=t.Init&&(i.off("cursorActivity",a),i.off("viewportChange",o),e(i)),r&&(i.state.matchBothTags="object"==typeof r&&r.bothTags,i.on("cursorActivity",a),i.on("viewportChange",o),a(i))})),t.commands.toMatchingTag=function(e){var a=t.findMatchingTag(e,e.getCursor());if(a){var o="close"==a.at?a.open:a.close;o&&e.extendSelection(o.to,o.from)}}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){e.defineOption("showTrailingSpace",!1,(function(i,n,o){o==e.Init&&(o=!1),o&&!n?i.removeOverlay("trailingspace"):!o&&n&&i.addOverlay({token:function(e){for(var i=e.string.length,n=i;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=i,"trailingspace")},name:"trailingspace"})}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerHelper("fold","brace",(function(r,n){var t,i=n.line,o=r.getLine(i);function l(l){for(var f=n.ch,s=0;;){var u=f<=0?-1:o.lastIndexOf(l,f-1);if(-1!=u){if(1==s&&u<n.ch)break;if(t=r.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(t))return u+1;f=u-1}else{if(1==s)break;s=1,f=o.length}}}var f,s,u,a=l("{"),d=l("[");if(null!=a&&(null==d||d>a))u=a,f="{",s="}";else{if(null==d)return;u=d,f="[",s="]"}var c,g,v=1,p=r.lastLine();e:for(var m=i;m<=p;++m)for(var P=r.getLine(m),k=m==i?u:0;;){var b=P.indexOf(f,k),h=P.indexOf(s,k);if(b<0&&(b=P.length),h<0&&(h=P.length),(k=Math.min(b,h))==P.length)break;if(r.getTokenTypeAt(e.Pos(m,k+1))==t)if(k==b)++v;else if(!--v){c=m,g=k;break e}++k}if(null!=c&&i!=c)return{from:e.Pos(i,u),to:e.Pos(c,g)}})),e.registerHelper("fold","import",(function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);i<=o;++i){var l=r.getLine(i).indexOf(";");if(-1!=l)return{startCh:t.end,end:e.Pos(i,l)}}}var i,o=n.line,l=t(o);if(!l||t(o-1)||(i=t(o-2))&&i.end.line==o-1)return null;for(var f=l.end;;){var s=t(f.line+1);if(null==s)break;f=s.end}return{from:r.clipPos(e.Pos(o,l.startCh+1)),to:f}})),e.registerHelper("fold","include",(function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var i=n.line,o=t(i);if(null==o||null!=t(i-1))return null;for(var l=i;;){if(null==t(l+1))break;++l}return{from:e.Pos(i,o+1),to:r.clipPos(e.Pos(l))}}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd}),(function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,i=o.blockCommentEnd;if(r&&i){for(var f,l=n.line,c=t.getLine(l),m=n.ch,a=0;;){var d=m<=0?-1:c.lastIndexOf(r,m-1);if(-1!=d){if(1==a&&d<n.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,d+1)))&&(0==d||c.slice(d-i.length,d)==i||!/comment/.test(t.getTokenTypeAt(e.Pos(l,d))))){f=d+r.length;break}m=d-1}else{if(1==a)return;a=1,m=c.length}}var s,u,b=1,g=t.lastLine();e:for(var h=l;h<=g;++h)for(var k=t.getLine(h),p=h==l?f:0;;){var v=k.indexOf(r,p),y=k.indexOf(i,p);if(v<0&&(v=k.length),y<0&&(y=k.length),(p=Math.min(v,y))==k.length)break;if(p==v)++b;else if(!--b){s=h,u=p;break e}++p}if(null!=s&&(l!=s||u!=f))return{from:e.Pos(l,f),to:e.Pos(s,u)}}}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}((function(n){"use strict";function o(o,e,t,i){if(t&&t.call){var l=t;t=null}else l=r(o,t,"rangeFinder");"number"==typeof e&&(e=n.Pos(e,0));var f=r(o,t,"minFoldSize");function d(n){var r=l(o,e);if(!r||r.to.line-r.from.line<f)return null;for(var t=o.findMarksAt(r.from),d=0;d<t.length;++d)if(t[d].__isFold&&"fold"!==i){if(!n)return null;r.cleared=!0,t[d].clear()}return r}var u=d(!0);if(r(o,t,"scanUp"))for(;!u&&e.line>o.firstLine();)e=n.Pos(e.line-1,0),u=d(!1);if(u&&!u.cleared&&"unfold"!==i){var a=function(n,o,e){var t=r(n,o,"widget");"function"==typeof t&&(t=t(e.from,e.to));if("string"==typeof t){var i=document.createTextNode(t);(t=document.createElement("span")).appendChild(i),t.className="CodeMirror-foldmarker"}else t&&(t=t.cloneNode(!0));return t}(o,t,u);n.on(a,"mousedown",(function(o){c.clear(),n.e_preventDefault(o)}));var c=o.markText(u.from,u.to,{replacedWith:a,clearOnEnter:r(o,t,"clearOnEnter"),__isFold:!0});c.on("clear",(function(e,r){n.signal(o,"unfold",o,e,r)})),n.signal(o,"fold",o,u.from,u.to)}}n.newFoldFunction=function(n,e){return function(r,t){o(r,t,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",(function(n,e,r){o(this,n,e,r)})),n.defineExtension("isFolded",(function(n){for(var o=this.findMarksAt(n),e=0;e<o.length;++e)if(o[e].__isFold)return!0})),n.commands.toggleFold=function(n){n.foldCode(n.getCursor())},n.commands.fold=function(n){n.foldCode(n.getCursor(),null,"fold")},n.commands.unfold=function(n){n.foldCode(n.getCursor(),null,"unfold")},n.commands.foldAll=function(o){o.operation((function(){for(var e=o.firstLine(),r=o.lastLine();e<=r;e++)o.foldCode(n.Pos(e,0),null,"fold")}))},n.commands.unfoldAll=function(o){o.operation((function(){for(var e=o.firstLine(),r=o.lastLine();e<=r;e++)o.foldCode(n.Pos(e,0),null,"unfold")}))},n.registerHelper("fold","combine",(function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r<n.length;++r){var t=n[r](o,e);if(t)return t}}})),n.registerHelper("fold","auto",(function(n,o){for(var e=n.getHelpers(o,"fold"),r=0;r<e.length;r++){var t=e[r](n,o);if(t)return t}}));var e={rangeFinder:n.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function r(n,o,r){if(o&&void 0!==o[r])return o[r];var t=n.options.foldOptions;return t&&void 0!==t[r]?t[r]:e[r]}n.defineOption("foldOptions",null),n.defineExtension("foldOption",(function(n,o){return r(this,n,o)}))}));
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
.CodeMirror-foldmarker {
|
||||
color: blue;
|
||||
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
||||
font-family: arial;
|
||||
line-height: .3;
|
||||
cursor: pointer;
|
||||
}
|
||||
.CodeMirror-foldgutter {
|
||||
width: .7em;
|
||||
}
|
||||
.CodeMirror-foldgutter-open,
|
||||
.CodeMirror-foldgutter-folded {
|
||||
cursor: pointer;
|
||||
}
|
||||
.CodeMirror-foldgutter-open:after {
|
||||
content: "\25BE";
|
||||
}
|
||||
.CodeMirror-foldgutter-folded:after {
|
||||
content: "\25B8";
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],t):t(CodeMirror)}((function(t){"use strict";t.defineOption("foldGutter",!1,(function(o,r,n){n&&n!=t.Init&&(o.clearGutter(o.state.foldGutter.options.gutter),o.state.foldGutter=null,o.off("gutterClick",d),o.off("changes",u),o.off("viewportChange",l),o.off("fold",c),o.off("unfold",c),o.off("swapDoc",u)),r&&(o.state.foldGutter=new e(function(t){!0===t&&(t={});null==t.gutter&&(t.gutter="CodeMirror-foldgutter");null==t.indicatorOpen&&(t.indicatorOpen="CodeMirror-foldgutter-open");null==t.indicatorFolded&&(t.indicatorFolded="CodeMirror-foldgutter-folded");return t}(r)),a(o),o.on("gutterClick",d),o.on("changes",u),o.on("viewportChange",l),o.on("fold",c),o.on("unfold",c),o.on("swapDoc",u))}));var o=t.Pos;function e(t){this.options=t,this.from=this.to=0}function r(t,e){for(var r=t.findMarks(o(e,0),o(e+1,0)),n=0;n<r.length;++n)if(r[n].__isFold){var i=r[n].find(-1);if(i&&i.line===e)return r[n]}}function n(t){if("string"==typeof t){var o=document.createElement("div");return o.className=t+" CodeMirror-guttermarker-subtle",o}return t.cloneNode(!0)}function i(t,e,i){var a=t.state.foldGutter.options,d=e-1,u=t.foldOption(a,"minFoldSize"),l=t.foldOption(a,"rangeFinder"),c="string"==typeof a.indicatorFolded&&f(a.indicatorFolded),s="string"==typeof a.indicatorOpen&&f(a.indicatorOpen);t.eachLine(e,i,(function(e){++d;var i=null,f=e.gutterMarkers;if(f&&(f=f[a.gutter]),r(t,d)){if(c&&f&&c.test(f.className))return;i=n(a.indicatorFolded)}else{var p=o(d,0),m=l&&l(t,p);if(m&&m.to.line-m.from.line>=u){if(s&&f&&s.test(f.className))return;i=n(a.indicatorOpen)}}(i||f)&&t.setGutterMarker(e,a.gutter,i)}))}function f(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function a(t){var o=t.getViewport(),e=t.state.foldGutter;e&&(t.operation((function(){i(t,o.from,o.to)})),e.from=o.from,e.to=o.to)}function d(t,e,n){var i=t.state.foldGutter;if(i){var f=i.options;if(n==f.gutter){var a=r(t,e);a?a.clear():t.foldCode(o(e,0),f)}}}function u(t){var o=t.state.foldGutter;if(o){var e=o.options;o.from=o.to=0,clearTimeout(o.changeUpdate),o.changeUpdate=setTimeout((function(){a(t)}),e.foldOnChangeTimeSpan||600)}}function l(t){var o=t.state.foldGutter;if(o){var e=o.options;clearTimeout(o.changeUpdate),o.changeUpdate=setTimeout((function(){var e=t.getViewport();o.from==o.to||e.from-o.to>20||o.from-e.to>20?a(t):t.operation((function(){e.from<o.from&&(i(t,e.from,o.from),o.from=e.from),e.to>o.to&&(i(t,o.to,e.to),o.to=e.to)}))}),e.updateViewportTimeSpan||400)}}function c(t,o){var e=t.state.foldGutter;if(e){var r=o.line;r>=e.from&&r<e.to&&i(t,r,r+1)}}}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function n(n,t){var i=n.getLine(t),o=i.search(/\S/);return-1==o||/\bcomment\b/.test(n.getTokenTypeAt(e.Pos(t,o+1)))?-1:e.countColumn(i,null,n.getOption("tabSize"))}e.registerHelper("fold","indent",(function(t,i){var o=n(t,i.line);if(!(o<0)){for(var r=null,l=i.line+1,f=t.lastLine();l<=f;++l){var u=n(t,l);if(-1==u);else{if(!(u>o))break;r=l}}return r?{from:e.Pos(i.line,t.getLine(i.line).length),to:e.Pos(r,t.getLine(r).length)}:void 0}}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerHelper("fold","markdown",(function(n,t){function r(t){var r=n.getTokenTypeAt(e.Pos(t,0));return r&&/\bheader\b/.test(r)}function i(e,n,t){var i=n&&n.match(/^#+/);return i&&r(e)?i[0].length:(i=t&&t.match(/^[=\-]+\s*$/))&&r(e+1)?"="==t[0]?1:2:100}var o=n.getLine(t.line),f=n.getLine(t.line+1),l=i(t.line,o,f);if(100!==l){for(var c=n.lastLine(),u=t.line,d=n.getLine(u+2);u<c&&!(i(u+1,f,d)<=l);)++u,f=d,d=n.getLine(u+2);return{from:e.Pos(t.line,o.length),to:e.Pos(u,n.getLine(u).length)}}}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var n=e.Pos;function t(e,n){return e.line-n.line||e.ch-n.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function f(e,t){var i=e.cm.getTokenTypeAt(n(e.line,t));return i&&/\btag\b/.test(i)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(o(e))continue;return}if(f(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n+1}}function a(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(l(e))continue;return}if(f(e,n+1)){r.lastIndex=n,e.ch=n;var t=r.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function s(e){for(;;){r.lastIndex=e.ch;var n=r.exec(e.text);if(!n){if(o(e))continue;return}if(f(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}function h(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(l(e))continue;return}if(f(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n}}function F(e,t){for(var i=[];;){var r,u=s(e),f=e.line,o=e.ch-(u?u[0].length:0);if(!u||!(r=c(e)))return;if("selfClose"!=r)if(u[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==u[2]){i.length=l;break}if(l<0&&(!t||t==u[2]))return{tag:u[2],from:n(f,o),to:n(e.line,e.ch)}}else i.push(u[2])}}function x(e,t){for(var i=[];;){var r=h(e);if(!r)return;if("selfClose"!=r){var u=e.line,f=e.ch,o=a(e);if(!o)return;if(o[1])i.push(o[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:n(e.line,e.ch),to:n(u,f)}}}else a(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new u(e,i.line,0);;){var f=s(r);if(!f||r.line!=i.line)return;var o=c(r);if(!o)return;if(!f[1]&&"selfClose"!=o){var l=n(r.line,r.ch),a=F(r,f[2]);return a&&t(a.from,l)>0?{from:l,to:a.from}:null}}})),e.findMatchingTag=function(e,i,r){var f=new u(e,i.line,i.ch,r);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){var o=c(f),l=o&&n(f.line,f.ch),s=o&&a(f);if(o&&s&&!(t(f,i)>0)){var h={from:n(f.line,f.ch),to:l,tag:s[2]};return"selfClose"==o?{open:h,close:null,at:"open"}:s[1]?{open:x(f,s[2]),close:h,at:"close"}:{open:h,close:F(f=new u(e,l.line,l.ch,r),s[2]),at:"open"}}}},e.findEnclosingTag=function(e,n,t,i){for(var r=new u(e,n.line,n.ch,t);;){var f=x(r,i);if(!f)break;var o=F(new u(e,n.line,n.ch,t),f.tag);if(o)return{open:f,close:o}}},e.scanForClosingTag=function(e,n,t,i){return F(new u(e,n.line,n.ch,i?{from:0,to:i}:null),t)}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var r=/[\w$]+/;e.registerHelper("hint","anyword",(function(t,o){for(var i=o&&o.word||r,n=o&&o.range||500,f=t.getCursor(),s=t.getLine(f.line),a=f.ch,c=a;c&&i.test(s.charAt(c-1));)--c;for(var l=c!=a&&s.slice(c,a),d=o&&o.list||[],u={},p=new RegExp(i.source,"g"),g=-1;g<=1;g+=2)for(var h=f.line,m=Math.min(Math.max(h+g*n,t.firstLine()),t.lastLine())+g;h!=m;h+=g)for(var y,b=t.getLine(h);y=p.exec(b);)h==f.line&&y[0]===l||l&&0!=y[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(u,y[0])||(u[y[0]]=!0,d.push(y[0]));return{list:d,from:e.Pos(f.line,c),to:e.Pos(f.line,a)}}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}((function(e){"use strict";var t={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};e.registerHelper("hint","css",(function(r){var o=r.getCursor(),i=r.getTokenAt(o),s=e.innerMode(r.getMode(),i.state);if("css"==s.mode.name){if("keyword"==i.type&&0=="!important".indexOf(i.string))return{list:["!important"],from:e.Pos(o.line,i.start),to:e.Pos(o.line,i.end)};var n=i.start,a=o.ch,d=i.string.slice(0,a-n);/[^\w$_-]/.test(d)&&(d="",n=a=o.ch);var l=e.resolveMode("text/css"),c=[],f=s.state.state;return"pseudo"==f||"variable-3"==i.type?p(t):"block"==f||"maybeprop"==f?p(l.propertyKeywords):"prop"==f||"parens"==f||"at"==f||"params"==f?(p(l.valueKeywords),p(l.colorKeywords)):"media"!=f&&"media_parens"!=f||(p(l.mediaTypes),p(l.mediaFeatures)),c.length?{list:c,from:e.Pos(o.line,n),to:e.Pos(o.line,a)}:void 0}function p(e){for(var t in e)d&&0!=t.lastIndexOf(d,0)||c.push(t)}}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(l){"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],l):l(CodeMirror)}((function(l){"use strict";var t="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),e=["_blank","_self","_top","_parent"],a=["ascii","utf-8","utf-16","latin1","latin1"],n=["get","post","put","delete"],r=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],o=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],s={attrs:{}},u={a:{attrs:{href:null,ping:null,type:null,media:o,target:e,hreflang:t}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:o,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:s,base:{attrs:{href:null,target:e}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:r,formmethod:n,formnovalidate:["","novalidate"],formtarget:e,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:s,dir:s,div:s,dialog:{attrs:{open:null}},dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":a,autocomplete:["on","off"],enctype:r,method:n,novalidate:["","novalidate"],target:e}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:["head","body"]},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:r,formmethod:n,formnovalidate:["","novalidate"],formtarget:e,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:o,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:a,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noframes:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,heightLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function n(r,n,i,o){var s=r.getCursor(),a=i(r,s);if(!/\b(?:string|comment)\b/.test(a.type)){var l=t.innerMode(r.getMode(),a.state);if("json"!==l.mode.helperType){a.state=l.state,/^[\w$_]*$/.test(a.string)?a.end>s.ch&&(a.end=s.ch,a.string=a.string.slice(0,s.ch-a.start)):a={start:s.ch,end:s.ch,string:"",state:a.state,type:"."==a.string?"property":null};for(var f=a;"property"==f.type;){if("."!=(f=i(r,e(s.line,f.start))).string)return;if(f=i(r,e(s.line,f.start)),!p)var p=[];p.push(f)}return{list:c(a,p,n,o),from:e(s.line,a.start),to:e(s.line,a.end)}}}}function i(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",(function(t,e){return n(t,l,(function(t,e){return t.getTokenAt(e)}),e)})),t.registerHelper("hint","coffeescript",(function(t,e){return n(t,f,i,e)}));var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),l="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),f="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function c(t,e,n,i){var l=[],f=t.string,c=i&&i.globalScope||window;function p(t){0!=t.lastIndexOf(f,0)||function(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(l,t)||l.push(t)}function u(t){"string"==typeof t?r(o,p):t instanceof Array?r(s,p):t instanceof Function&&r(a,p),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,p)}if(e&&e.length){var d,g=e.pop();for(g.type&&0===g.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[g.string]),i&&!1===i.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&e.length;)d=d[e.pop().string];null!=d&&u(d)}else{for(var y=t.state.localVars;y;y=y.next)p(y.name);for(var h=t.state.context;h;h=h.prev)for(y=h.vars;y;y=y.next)p(y.name);for(y=t.state.globalVars;y;y=y.next)p(y.name);if(i&&null!=i.additionalContext)for(var v in i.additionalContext)p(v);i&&!1===i.useGlobalScope||u(c),r(n,p)}return l}}));
|
||||
@@ -0,0 +1,36 @@
|
||||
.CodeMirror-hints {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
|
||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
border-radius: 3px;
|
||||
border: 1px solid silver;
|
||||
|
||||
background: white;
|
||||
font-size: 90%;
|
||||
font-family: monospace;
|
||||
|
||||
max-height: 20em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-hint {
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
border-radius: 2px;
|
||||
white-space: pre;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li.CodeMirror-hint-active {
|
||||
background: #08f;
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function i(t,i){if(this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}}t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",(function(e){e=function(t,i,e){var n=t.options.hintOptions,o={};for(var s in l)o[s]=l[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);o.hint.resolve&&(o.hint=o.hint.resolve(t,i));return o}(this,this.getCursor("start"),e);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var o=0;o<n.length;o++)if(n[o].head.line!=n[o].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new i(this,e);s.options.hint&&(t.signal(this,"startCompletion",this),s.update(!0))}})),t.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var e=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function o(t){return"string"==typeof t?t:t.text}function s(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function c(i,e){this.completion=i,this.data=e,this.picked=!1;var n=this,c=i.cm,r=c.getInputField().ownerDocument,l=r.defaultView||r.parentWindow,h=this.hints=r.createElement("ul"),a=i.cm.options.theme;h.className="CodeMirror-hints "+a,this.selectedHint=e.selectedHint||0;for(var f=e.list,u=0;u<f.length;++u){var p=h.appendChild(r.createElement("li")),d=f[u],m="CodeMirror-hint"+(u!=this.selectedHint?"":" CodeMirror-hint-active");null!=d.className&&(m=d.className+" "+m),p.className=m,d.render?d.render(p,e,d):p.appendChild(r.createTextNode(d.displayText||o(d))),p.hintId=u}var g=i.options.container||r.body,v=c.cursorCoords(i.options.alignWithWord?e.from:null),y=v.left,w=v.bottom,C=!0,H=0,b=0;if(g!==r.body){var k=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,A=k.getBoundingClientRect(),S=r.body.getBoundingClientRect();H=A.left-S.left-k.scrollLeft,b=A.top-S.top-k.scrollTop}h.style.left=y-H+"px",h.style.top=w-b+"px";var x=l.innerWidth||Math.max(r.body.offsetWidth,r.documentElement.offsetWidth),T=l.innerHeight||Math.max(r.body.offsetHeight,r.documentElement.offsetHeight);g.appendChild(h);var M,O=i.options.moveOnOverlap?h.getBoundingClientRect():new DOMRect,F=!!i.options.paddingForScrollbar&&h.scrollHeight>h.clientHeight+1;if(setTimeout((function(){M=c.getScrollInfo()})),O.bottom-T>0){var N=O.bottom-O.top;if(v.top-(v.bottom-O.top)-N>0)h.style.top=(w=v.top-N-b)+"px",C=!1;else if(N>T){h.style.height=T-5+"px",h.style.top=(w=v.bottom-O.top-b)+"px";var P=c.getCursor();e.from.ch!=P.ch&&(v=c.cursorCoords(P),h.style.left=(y=v.left-H)+"px",O=h.getBoundingClientRect())}}var E,W=O.right-x;if(F&&(W+=c.display.nativeBarWidth),W>0&&(O.right-O.left>x&&(h.style.width=x-5+"px",W-=O.right-O.left-x),h.style.left=(y=v.left-W-H)+"px"),F)for(var I=h.firstChild;I;I=I.nextSibling)I.style.paddingRight=c.display.nativeBarWidth+"px";(c.addKeyMap(this.keyMap=function(t,i){var e={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(1-i.menuSize(),!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close};/Mac/.test(navigator.platform)&&(e["Ctrl-P"]=function(){i.moveFocus(-1)},e["Ctrl-N"]=function(){i.moveFocus(1)});var n=t.options.customKeys,o=n?{}:e;function s(t,n){var s;s="string"!=typeof n?function(t){return n(t,i)}:e.hasOwnProperty(n)?e[n]:n,o[t]=s}if(n)for(var c in n)n.hasOwnProperty(c)&&s(c,n[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&s(c,r[c]);return o}(i,{moveFocus:function(t,i){n.changeActive(n.selectedHint+t,i)},setFocus:function(t){n.changeActive(t)},menuSize:function(){return n.screenAmount()},length:f.length,close:function(){i.close()},pick:function(){n.pick()},data:e})),i.options.closeOnUnfocus)&&(c.on("blur",this.onBlur=function(){E=setTimeout((function(){i.close()}),100)}),c.on("focus",this.onFocus=function(){clearTimeout(E)}));c.on("scroll",this.onScroll=function(){var t=c.getScrollInfo(),e=c.getWrapperElement().getBoundingClientRect();M||(M=c.getScrollInfo());var n=w+M.top-t.top,o=n-(l.pageYOffset||(r.documentElement||r.body).scrollTop);if(C||(o+=h.offsetHeight),o<=e.top||o>=e.bottom)return i.cloLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],t):t(CodeMirror)}((function(t){"use strict";var e,r,n,o,i=";",s="AS",a=t.Pos,u=t.cmpPos;function l(t){return"[object Array]"==Object.prototype.toString.call(t)}function f(t){return"string"==typeof t?t:t.text}function c(t,e){return l(e)&&(e={columns:e}),e.text||(e.text=t),e}function p(t){return e[t.toUpperCase()]}function d(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function g(t,e){var r=t.length,n=f(e).substr(0,r);return t.toUpperCase()===n.toUpperCase()}function h(t,e,r,n){if(l(r))for(var o=0;o<r.length;o++)g(e,r[o])&&t.push(n(r[o]));else for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];g(e,s=s&&!0!==s?s.displayText?{text:s.text,displayText:s.displayText}:s.text:i)&&t.push(n(s))}}function v(t){"."==t.charAt(0)&&(t=t.substr(1));for(var e=t.split(o+o),r=0;r<e.length;r++)e[r]=e[r].replace(new RegExp(o,"g"),"");return e.join(o)}function x(t){for(var e=f(t).split("."),r=0;r<e.length;r++)e[r]=o+e[r].replace(new RegExp(o,"g"),o+o)+o;var n=e.join(".");return"string"==typeof t?n:((t=d(t)).text=n,t)}function m(t,e){for(var r=t.split(/\s+/),n=0;n<r.length;n++)r[n]&&e(r[n].replace(/[`,;]/g,""))}function b(t,e){for(var r=e.doc,n=r.getValue(),o=t.toUpperCase(),l="",f="",c=[],d={start:a(0,0),end:a(e.lastLine(),e.getLineHandle(e.lastLine()).length)},g=n.indexOf(i);-1!=g;)c.push(r.posFromIndex(g)),g=n.indexOf(i,g+1);c.unshift(a(0,0)),c.push(a(e.lastLine(),e.getLineHandle(e.lastLine()).text.length));for(var h=null,v=e.getCursor(),x=0;x<c.length;x++){if((null==h||u(v,h)>0)&&u(v,c[x])<=0){d={start:h,end:c[x]};break}h=c[x]}if(d.start){var b=r.getRange(d.start,d.end,!1);for(x=0;x<b.length;x++){if(m(b[x],(function(t){var e=t.toUpperCase();e===o&&p(l)&&(f=l),e!==s&&(l=t)})),f)break}}return f}t.registerHelper("hint","sql",(function(i,s){e=function(t){var e={};if(l(t))for(var r=t.length-1;r>=0;r--){var n=t[r];e[f(n).toUpperCase()]=c(f(n),n)}else if(t)for(var o in t)e[o.toUpperCase()]=c(o,t[o]);return e}(s&&s.tables);var u=s&&s.defaultTable,g=s&&s.disableKeywords;r=u&&p(u),n=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).keywords}(i),o=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).identifierQuote||"`"}(i),u&&!r&&(r=b(u,i)),(r=r||[]).columns&&(r=r.columns);var m,y,C,q=i.getCursor(),A=[],j=i.getTokenAt(q);if(j.end>q.ch&&(j.end=q.ch,j.string=j.string.slice(0,q.ch-j.start)),j.string.match(/^[.`"'\w@][\w$#]*$/g)?(C=j.string,m=j.start,y=j.end):(m=y=q.ch,C=""),"."==C.charAt(0)||C.charAt(0)==o)m=function(t,n,i,s){for(var u=!1,l=[],f=n.start,c=!0;c;)c="."==n.string.charAt(0),u=u||n.string.charAt(0)==o,f=n.start,l.unshift(v(n.string)),"."==(n=s.getTokenAt(a(t.line,n.start))).string&&(c=!0,n=s.getTokenAt(a(t.line,n.start)));var g=l.join(".");h(i,g,e,(function(t){return u?x(t):t})),h(i,g,r,(function(t){return u?x(t):t})),g=l.pop();var m=l.join("."),y=!1,C=m;if(!p(m)){var q=m;(m=b(m,s))!==q&&(y=!0)}var A=p(m);return A&&A.columns&&(A=A.columns),A&&h(i,g,A,(function(t){var e=m;return 1==y&&(e=C),"string"==typeof t?t=e+"."+t:(t=d(t)).text=e+"."+t.text,u?x(t):t})),f}(q,j,A,i);else{var w=function(t,e){return"object"==typeof t?t.className=e:t={text:t,className:e},t};h(A,C,r,(function(t){return w(t,"CodeMirror-hint-table CodeMirror-hint-default-table")})),h(A,C,e,(function(t){return w(t,"CodeMirror-hint-table")})),g||h(A,C,n,(function(t){return w(t.toUpperCase(),"CodeMirror-hint-keyword")}))}return{list:A,from:a(q.line,m),to:a(q.line,y)}}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e=t.Pos;function r(t,e,r){return r?t.indexOf(e)>=0:0==t.lastIndexOf(e,0)}t.registerHelper("hint","xml",(function(n,i){var s=i&&i.schemaInfo,a=i&&i.quoteChar||'"',o=i&&i.matchInMiddle;if(s){var l=n.getCursor(),f=n.getTokenAt(l);if(f.end>l.ch&&(f.end=l.ch,f.string=f.string.slice(0,l.ch-f.start)),(x=t.innerMode(n.getMode(),f.state)).mode.xmlCurrentTag){var g,c,h=[],u=!1,d=/\btag\b/.test(f.type)&&!/>$/.test(f.string),p=d&&/^\w/.test(f.string);if(p){var m=n.getLine(l.line).slice(Math.max(0,f.start-2),f.start),v=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;v&&(c=f.start-("close"==v?2:1))}else d&&"<"==f.string?v="open":d&&"</"==f.string&&(v="close");var y=x.mode.xmlCurrentTag(x.state);if(!d&&!y||v){p&&(g=f.string),u=v;var x,C=x.mode.xmlCurrentContext?x.mode.xmlCurrentContext(x.state):[],b=(x=C.length&&C[C.length-1])&&s[x],O=x?b&&b.children:s["!top"];if(O&&"close"!=v)for(var w=0;w<O.length;++w)g&&!r(O[w],g,o)||h.push("<"+O[w]);else if("close"!=v)for(var A in s)!s.hasOwnProperty(A)||"!top"==A||"!attrs"==A||g&&!r(A,g,o)||h.push("<"+A);x&&(!g||"close"==v&&r(x,g,o))&&h.push("</"+x+">")}else{var M=(b=y&&s[y.name])&&b.attrs,P=s["!attrs"];if(!M&&!P)return;if(M){if(P){var $={};for(var I in P)P.hasOwnProperty(I)&&($[I]=P[I]);for(var I in M)M.hasOwnProperty(I)&&($[I]=M[I]);M=$}}else M=P;if("string"==f.type||"="==f.string){var T,j=(m=n.getRange(e(l.line,Math.max(0,l.ch-60)),e(l.line,"string"==f.type?f.start:f.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!M.hasOwnProperty(j[1])||!(T=M[j[1]]))return;if("function"==typeof T&&(T=T.call(this,n)),"string"==f.type){g=f.string;var q=0;/['"]/.test(f.string.charAt(0))&&(a=f.string.charAt(0),g=f.string.slice(1),q++);var L=f.string.length;if(/['"]/.test(f.string.charAt(L-1))&&(a=f.string.charAt(L-1),g=f.string.substr(q,L-2)),q){var k=n.getLine(l.line);k.length>f.end&&k.charAt(f.end)==a&&f.end++}u=!0}var H=function(t){if(t)for(var e=0;e<t.length;++e)g&&!r(t[e],g,o)||h.push(a+t[e]+a);return z()};return T&&T.then?T.then(H):H(T)}for(var R in"attribute"==f.type&&(g=f.string,u=!0),M)!M.hasOwnProperty(R)||g&&!r(R,g,o)||h.push(R)}return z()}}function z(){return{list:h,from:u?e(l.line,null==c?f.start:c):l,to:u?e(l.line,f.end):l}}}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerHelper("lint","coffeescript",(function(o){var r=[];if(!window.coffeelint)return window.console&&window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run."),r;var i,n;try{for(var t=coffeelint.lint(o),f=0;f<t.length;f++)i=t[f],n=void 0,n=i.lineNumber,r.push({from:e.Pos(n-1,0),to:e.Pos(n,0),severity:i.level,message:i.message})}catch(o){r.push({from:e.Pos(o.location.first_line,0),to:e.Pos(o.location.last_line,o.location.last_column),severity:"error",message:o.message})}return r}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerHelper("lint","css",(function(o,r){var n=[];if(!window.CSSLint)return window.console&&window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run."),n;for(var i=CSSLint.verify(o,r).messages,t=null,s=0;s<i.length;s++){var c=(t=i[s]).line-1,d=t.line-1,f=t.col-1,l=t.col;n.push({from:e.Pos(c,f),to:e.Pos(d,l),message:t.message,severity:t.type})}return n}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("htmlhint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","htmlhint"],e):e(CodeMirror,window.HTMLHint)}((function(e,r){"use strict";var o={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!1,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0};e.registerHelper("lint","html",(function(t,i){var n=[];if(r&&!r.verify&&(r=void 0!==r.default?r.default:r.HTMLHint),r||(r=window.HTMLHint),!r)return window.console&&window.console.error("Error: HTMLHint not found, not defined on window, or not available through define/require, CodeMirror HTML linting cannot run."),n;for(var a=r.verify(t,i&&i.rules||o),l=0;l<a.length;l++){var d=a[l],u=d.line-1,c=d.line-1,s=d.col-1,f=d.col;n.push({from:e.Pos(u,s),to:e.Pos(c,f),message:d.message,severity:d.type})}return n}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.registerHelper("lint","javascript",(function(r,n){if(!window.JSHINT)return window.console&&window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run."),[];n.indent||(n.indent=1),JSHINT(r,n,n.globals);var o=JSHINT.data().errors,i=[];return o&&function(r,n){for(var o=0;o<r.length;o++){var i=r[o];if(i){if(i.line<=0){window.console&&window.console.warn("Cannot display JSHint error (invalid line "+i.line+")",i);continue}var t=i.character-1,a=t+1;if(i.evidence){var d=i.evidence.substring(t).search(/.\b/);d>-1&&(a+=d)}var c={message:i.reason,severity:i.code&&i.code.startsWith("W")?"warning":"error",from:e.Pos(i.line-1,t),to:e.Pos(i.line-1,a)};n.push(c)}}}(o,i),i}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)}((function(o){"use strict";o.registerHelper("lint","json",(function(n){var r=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),r;var e=window.jsonlint.parser||window.jsonlint;e.parseError=function(n,e){var i=e.loc;r.push({from:o.Pos(i.first_line-1,i.first_column),to:o.Pos(i.last_line-1,i.last_column),message:n})};try{e.parse(n)}catch(o){}return r}))}));
|
||||
@@ -0,0 +1,79 @@
|
||||
/* The lint marker gutter */
|
||||
.CodeMirror-lint-markers {
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-tooltip {
|
||||
background-color: #ffd;
|
||||
border: 1px solid black;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
color: black;
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
overflow: hidden;
|
||||
padding: 2px 5px;
|
||||
position: fixed;
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
z-index: 100;
|
||||
max-width: 600px;
|
||||
opacity: 0;
|
||||
transition: opacity .4s;
|
||||
-moz-transition: opacity .4s;
|
||||
-webkit-transition: opacity .4s;
|
||||
-o-transition: opacity .4s;
|
||||
-ms-transition: opacity .4s;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark {
|
||||
background-position: left bottom;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-warning {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-error {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker {
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-message {
|
||||
padding-left: 18px;
|
||||
background-position: top left;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-multiple {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right bottom;
|
||||
width: 100%; height: 100%;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-line-error {
|
||||
background-color: rgba(183, 76, 81, 0.08);
|
||||
}
|
||||
|
||||
.CodeMirror-lint-line-warning {
|
||||
background-color: rgba(255, 211, 0, 0.1);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e="CodeMirror-lint-markers";function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(e,o,r,i){var a=function(e,n,o){var r=document.createElement("div");function i(e){if(!r.parentNode)return t.off(document,"mousemove",i);r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",r.style.left=e.clientX+5+"px"}return r.className="CodeMirror-lint-tooltip cm-s-"+e.options.theme,r.appendChild(o.cloneNode(!0)),e.state.lint.options.selfContain?e.getWrapperElement().appendChild(r):document.body.appendChild(r),t.on(document,"mousemove",i),i(n),null!=r.style.opacity&&(r.style.opacity=1),r}(e,o,r);function s(){var e;t.off(i,"mouseout",s),a&&((e=a).parentNode&&(null==e.style.opacity&&n(e),e.style.opacity=0,setTimeout((function(){n(e)}),600)),a=null)}var l=setInterval((function(){if(a)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){s();break}}if(!a)return clearInterval(l)}),400);t.on(i,"mouseout",s)}function r(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){!function(t,e){var n=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(n.className))return;for(var r=n.getBoundingClientRect(),i=(r.left+r.right)/2,a=(r.top+r.bottom)/2,s=t.findMarksAt(t.coordsChar({left:i,top:a},"client")),u=[],c=0;c<s.length;++c){var f=s[c].__annotation;f&&u.push(f)}u.length&&function(t,e,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),a=0;a<e.length;a++){var s=e[a];i.appendChild(l(s))}o(t,n,i,r)}(t,u,e)}(t,e)},this.waitingFor=0}function i(t){var n=t.state.lint;n.hasGutter&&t.clearGutter(e),a(n)&&function(t){t.eachLine((function(e){var n=e.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass);n&&t.removeLineClass(e,"wrap",n[0])}))}(t);for(var o=0;o<n.marked.length;++o)n.marked[o].clear();n.marked.length=0}function a(t){return t.options.highlightLines}function s(e,n,r,i,a){var s=document.createElement("div"),l=s;return s.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+r,i&&((l=s.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=a&&t.on(l,"mouseover",(function(t){o(e,t,n,l)})),s}function l(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message CodeMirror-lint-message-"+e,void 0!==t.messageHTML?n.innerHTML=t.messageHTML:n.appendChild(document.createTextNode(t.message)),n}function u(e){var n=e.state.lint;if(n){var o=n.options,r=o.options||o,i=o.getAnnotations||e.getHelper(t.Pos(0,0),"lint");if(i)if(o.async||i.async)!function(e,n,o){var r=e.state.lint,i=++r.waitingFor;function a(){i=-1,e.off("change",a)}e.on("change",a),n(e.getValue(),(function(n,o){e.off("change",a),r.waitingFor==i&&(o&&n instanceof t&&(n=o),e.operation((function(){c(e,n)})))}),o,e)}(e,i,r);else{var a=i(e.getValue(),r,e);if(!a)return;a.then?a.then((function(t){e.operation((function(){c(e,t)}))})):e.operation((function(){c(e,a)}))}}}function c(t,n){var o=t.state.lint;if(o){var r=o.options;i(t);for(var u,c,f=function(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}(n),m=0;m<f.length;++m){var d=f[m];if(d){var p=[];d=d.filter((function(t){return!(p.indexOf(t.message)>-1)&&p.push(t.message)}));for(var h=null,v=o.hasGutter&&document.createDocumentFragment(),g=0;g<d.length;++g){var C=d[g],M=C.severity;M||(M="error"),c=M,h="error"==(u=h)?u:c,r.formatAnnotation&&(C=r.formatAnnotation(C)),o.hasGutter&&v.appendChild(l(C)),C.to&&o.marked.push(t.markText(C.from,C.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+M,__annotation:C}))}o.hasGutter&&t.setGutterMarker(m,e,s(t,v,h,f[m].length>1,o.options.tooltips)),a(o)&&t.addLineClass(m,"wrap","CodeMirror-lint-line-"+h)}}r.onUpdateLinting&&r.onUpdateLinting(n,f,t)}}function f(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout((function(){u(t)}),e.options.delay||500))}t.defineOption("lint",!1,(function(n,o,a){if(a&&a!=t.Init&&(i(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",f),t.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),o){for(var s=n.getOption("gutters"),l=!1,c=0;c<s.length;++c)s[c]==e&&(l=!0);var m=n.state.lint=new r(n,(d=o)instanceof Function?{getAnnotations:d}:(d&&!0!==d||(d={}),d),l);!1!==m.options.lintOnChange&&n.on("change",f),0!=m.options.tooltips&&"gutter"!=m.options.tooltips&&t.on(n.getWrapperElement(),"mouseover",m.onMouseOver),u(n)}var d})),t.defineExtension("performLint",(function(){u(this)}))}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)}((function(o){"use strict";o.registerHelper("lint","yaml",(function(e){var r=[];if(!window.jsyaml)return window.console&&window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run."),r;try{jsyaml.loadAll(e)}catch(e){var n=e.mark,i=n?o.Pos(n.line,n.column):o.Pos(0,0),t=i;r.push({from:i,to:t,message:e.message})}return r}))}));
|
||||
@@ -0,0 +1,119 @@
|
||||
.CodeMirror-merge {
|
||||
position: relative;
|
||||
border: 1px solid #ddd;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.CodeMirror-merge, .CodeMirror-merge .CodeMirror {
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; }
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; }
|
||||
.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; }
|
||||
.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; }
|
||||
|
||||
.CodeMirror-merge-pane {
|
||||
display: inline-block;
|
||||
white-space: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
.CodeMirror-merge-pane-rightmost {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-gap {
|
||||
z-index: 2;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid #ddd;
|
||||
border-right: 1px solid #ddd;
|
||||
position: relative;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-scrolllock-wrap {
|
||||
position: absolute;
|
||||
bottom: 0; left: 50%;
|
||||
}
|
||||
.CodeMirror-merge-scrolllock {
|
||||
position: relative;
|
||||
left: -50%;
|
||||
cursor: pointer;
|
||||
color: #555;
|
||||
line-height: 1;
|
||||
}
|
||||
.CodeMirror-merge-scrolllock:after {
|
||||
content: "\21db\00a0\00a0\21da";
|
||||
}
|
||||
.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after {
|
||||
content: "\21db\21da";
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
right: 0; bottom: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copy {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #44c;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copy-reverse {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
color: #44c;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; }
|
||||
.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; }
|
||||
|
||||
.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-r-chunk { background: #ffffe0; }
|
||||
.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; }
|
||||
.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; }
|
||||
.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; }
|
||||
|
||||
.CodeMirror-merge-l-chunk { background: #eef; }
|
||||
.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; }
|
||||
.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; }
|
||||
.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; }
|
||||
|
||||
.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; }
|
||||
.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; }
|
||||
.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; }
|
||||
|
||||
.CodeMirror-merge-collapsed-widget:before {
|
||||
content: "(...)";
|
||||
}
|
||||
.CodeMirror-merge-collapsed-widget {
|
||||
cursor: pointer;
|
||||
color: #88b;
|
||||
background: #eef;
|
||||
border: 1px solid #ddf;
|
||||
font-size: 90%;
|
||||
padding: 0 3px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; }
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror)}((function(e){"use strict";var t=e.Pos,i="http://www.w3.org/2000/svg";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function n(t){t.diffOutOfDate&&(t.diff=L(t.orig.getValue(),t.edit.getValue(),t.mv.options.ignoreWhitespace),t.chunks=D(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}r.prototype={constructor:r,init:function(t,i,r){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=e(t,W({value:i,readOnly:!this.mv.options.allowEditingOriginals},W(r))),"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new _(this.edit)),this.orig.state.trackAlignable=new _(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.orig.state.diffViews=[this];var n=r.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(n)&&(n=[n]),this.classes.classLocation=n,this.diff=L(M(i),M(r.value),this.mv.options.ignoreWhitespace),this.chunks=D(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=!1!==r.showDifferences},registerEvents:function(t){this.forceUpdate=function(t){var i,r={from:0,to:0,marked:[]},a={from:0,to:0,marked:[]},s=!1;function c(e){o=!0,s=!1,"full"==e&&(t.svg&&N(t.svg),t.copyButtons&&N(t.copyButtons),h(t.edit,r.marked,t.classes),h(t.orig,a.marked,t.classes),r.from=r.to=a.from=a.to=0),n(t),t.showDifferences&&(f(t.edit,t.diff,r,DIFF_INSERT,t.classes),f(t.orig,t.diff,a,DIFF_DELETE,t.classes)),"align"==t.mv.options.connect&&k(t),u(t),null!=t.needsScrollSync&&l(t,t.needsScrollSync),o=!1}function g(e){o||(t.dealigned=!0,d(e))}function d(e){o||s||(clearTimeout(i),!0===e&&(s=!0),i=setTimeout(c,!0===e?20:250))}function m(e,i){t.diffOutOfDate||(t.diffOutOfDate=!0,r.from=r.to=a.from=a.to=0),g(i.text.length-1!=i.to.line-i.from.line)}function v(){t.diffOutOfDate=!0,t.dealigned=!0,c("full")}t.edit.on("change",m),t.orig.on("change",m),t.edit.on("swapDoc",v),t.orig.on("swapDoc",v),"align"==t.mv.options.connect&&(e.on(t.edit.state.trackAlignable,"realign",g),e.on(t.orig.state.trackAlignable,"realign",g));return t.edit.on("viewportChange",(function(){d(!1)})),t.orig.on("viewportChange",(function(){d(!1)})),c(),c}(this),s(this,!0,!1),function(e,t){e.edit.on("scroll",(function(){l(e,!0)&&u(e)})),e.orig.on("scroll",(function(){l(e,!1)&&u(e),t&&l(t,!0)&&u(t)}))}(this,t)},setShowDifferences:function(e){(e=!1!==e)!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var o=!1;function l(e,t){if(e.diffOutOfDate)return e.lockScroll&&null==e.needsScrollSync&&(e.needsScrollSync=t),!1;if(e.needsScrollSync=null,!e.lockScroll)return!0;var i,r,n=+new Date;if(t?(i=e.edit,r=e.orig):(i=e.orig,r=e.edit),i.state.scrollSetBy==e&&(i.state.scrollSetAt||0)+250>n)return!1;var o=i.getScrollInfo();if("align"==e.mv.options.connect)v=o.top;else{var l,s,c=.5*o.clientHeight,h=o.top+c,f=i.lineAtHeight(h,"local"),g=function(e,t,i){for(var r,n,o,l,a=0;a<e.length;a++){var s=e[a],c=i?s.editFrom:s.origFrom,h=i?s.editTo:s.origTo;null==n&&(c>t?(n=s.editFrom,l=s.origFrom):h>t&&(n=s.editTo,l=s.origTo)),h<=t?(r=s.editTo,o=s.origTo):c<=t&&(r=s.editFrom,o=s.origFrom)}return{edit:{before:r,after:n},orig:{before:o,after:l}}}(e.chunks,f,t),d=a(i,t?g.edit:g.orig),u=a(r,t?g.orig:g.edit),m=(h-d.top)/(d.bot-d.top),v=u.top-c+m*(u.bot-u.top);if(v>o.top&&(s=o.top/c)<1)v=v*s+o.top*(1-s);else if((l=o.height-o.clientHeight-o.top)<c){var p=r.getScrollInfo();p.height-p.clientHeight-v>l&&(s=l/c)<1&&(v=v*s+(p.height-p.clientHeight-l)*(1-s))}}return r.scrollTo(o.left,v),r.state.scrollSetAt=n,r.state.scrollSetBy=e,!0}function a(e,t){var i=t.after;return null==i&&(i=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(i,"local")}}function s(t,i,r){t.lockScroll=i,i&&0!=r&&l(t,DIFF_INSERT)&&u(t),(i?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function c(e,t,i){for(var r=i.classLocation,n=0;n<r.length;n++)e.removeLineClass(t,r[n],i.chunk),e.removeLineClass(t,r[n],i.start),e.removeLineClass(t,r[n],i.end)}function h(t,i,r){for(var n=0;n<i.length;++n){var o=i[n];o instanceof e.TextMarker?o.clear():o.parent&&c(t,o,r)}i.length=0}function f(e,t,i,r,n){var o=e.getViewport();e.operation((function(){i.from==i.to||o.from-i.to>20||i.from-o.to>20?(h(e,i.marked,n),d(e,t,r,i.marked,o.from,o.to,n),Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(o){e(o,"amd")})):e(CodeMirror,"plain")}((function(e,o){e.modeURL||(e.modeURL="../mode/%N/%N.js");var r={};function n(o,r,n){var t=e.modes[o],i=t&&t.dependencies;if(!i)return r();for(var d=[],a=0;a<i.length;++a)e.modes.hasOwnProperty(i[a])||d.push(i[a]);if(!d.length)return r();var f=function(e,o){var r=o;return function(){0==--r&&e()}}(r,d.length);for(a=0;a<d.length;++a)e.requireMode(d[a],f,n)}e.requireMode=function(t,i,d){if("string"!=typeof t&&(t=t.name),e.modes.hasOwnProperty(t))return n(t,i,d);if(r.hasOwnProperty(t))return r[t].push(i);var a=d&&d.path?d.path(t):e.modeURL.replace(/%N/g,t);if(d&&d.loadMode)d.loadMode(a,(function(){n(t,i,d)}));else if("plain"==o){var f=document.createElement("script");f.src=a;var u=document.getElementsByTagName("script")[0],c=r[t]=[i];e.on(f,"load",(function(){n(t,(function(){for(var e=0;e<c.length;++e)c[e]()}),d)})),u.parentNode.insertBefore(f,u)}else"cjs"==o?(require(a),i()):"amd"==o&&requirejs([a],i)},e.autoLoadMode=function(o,r,n){e.modes.hasOwnProperty(r)||e.requireMode(r,(function(){o.setOption("mode",o.getOption("mode"))}),n)}}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.multiplexingMode=function(n){var t=Array.prototype.slice.call(arguments,1);function r(e,n,t,r){if("string"==typeof n){var i=e.indexOf(n,t);return r&&i>-1?i+n.length:i}var o=n.exec(t?e.slice(t):e);return o?o.index+t+(r?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(n),innerActive:null,inner:null,startingInner:!1}},copyState:function(t){return{outer:e.copyState(n,t.outer),innerActive:t.innerActive,inner:t.innerActive&&e.copyState(t.innerActive.mode,t.inner),startingInner:t.startingInner}},token:function(i,o){if(o.innerActive){var l=o.innerActive;a=i.string;if(!l.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);if((v=l.close&&!o.startingInner?r(a,l.close,i.pos,l.parseDelimiters):-1)==i.pos&&!l.parseDelimiters)return i.match(l.close),o.innerActive=o.inner=null,l.delimStyle&&l.delimStyle+" "+l.delimStyle+"-close";v>-1&&(i.string=a.slice(0,v));var c=l.mode.token(i,o.inner);return v>-1?i.string=a:i.pos>i.start&&(o.startingInner=!1),v==i.pos&&l.parseDelimiters&&(o.innerActive=o.inner=null),l.innerStyle&&(c=c?c+" "+l.innerStyle:l.innerStyle),c}for(var s=1/0,a=i.string,u=0;u<t.length;++u){var v,d=t[u];if((v=r(a,d.open,i.pos))==i.pos){d.parseDelimiters||i.match(d.open),o.startingInner=!!d.parseDelimiters,o.innerActive=d;var f=0;if(n.indent){var m=n.indent(o.outer,"","");m!==e.Pass&&(f=m)}return o.inner=e.startState(d.mode,f),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open"}-1!=v&&v<s&&(s=v)}s!=1/0&&(i.string=a.slice(0,s));var p=n.token(i,o.outer);return s!=1/0&&(i.string=a),p},indent:function(t,r,i){var o=t.innerActive?t.innerActive.mode:n;return o.indent?o.indent(t.innerActive?t.inner:t.outer,r,i):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:n;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var o=0;o<t.length;++o){var l=t[o];"\n"===l.open&&(r.innerActive=l,r.inner=e.startState(l.mode,i.indent?i.indent(r.outer,"",""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(){CodeMirror.defineMode("markdown_with_stex",(function(){var e=CodeMirror.getMode({},"stex"),i=CodeMirror.getMode({},"markdown"),r={open:"$",close:"$",mode:e,delimStyle:"delim",innerStyle:"inner"};return CodeMirror.multiplexingMode(i,r)}));var e=CodeMirror.getMode({},"markdown_with_stex");!function(i){test.mode(i,e,Array.prototype.slice.call(arguments,1),"multiplexing")}("stexInsideMarkdown","[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]"),CodeMirror.defineMode("identical_delim_multiplex",(function(){return CodeMirror.multiplexingMode(CodeMirror.getMode({indentUnit:2},"javascript"),{open:"#",close:"#",mode:CodeMirror.getMode({},"markdown"),parseDelimiters:!0,innerStyle:"q"})}));var i=CodeMirror.getMode({},"identical_delim_multiplex");test.mode("identical_delimiters_with_parseDelimiters",i,["[keyword let] [def x] [operator =] [q #foo][q&em *bar*][q #];"],"multiplexing")}();
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.overlayMode=function(o,r,a){return{startState:function(){return{base:e.startState(o),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(a){return{base:e.copyState(o,a.base),overlay:e.copyState(r,a.overlay),basePos:a.basePos,baseCur:null,overlayPos:a.overlayPos,overlayCur:null}},token:function(e,n){return(e!=n.streamSeen||Math.min(n.basePos,n.overlayPos)<e.start)&&(n.streamSeen=e,n.basePos=n.overlayPos=e.start),e.start==n.basePos&&(n.baseCur=o.token(e,n.base),n.basePos=e.pos),e.start==n.overlayPos&&(e.pos=e.start,n.overlayCur=r.token(e,n.overlay),n.overlayPos=e.pos),e.pos=Math.min(n.basePos,n.overlayPos),null==n.overlayCur?n.baseCur:null!=n.baseCur&&n.overlay.combineTokens||a&&null==n.overlay.combineTokens?n.baseCur+" "+n.overlayCur:n.overlayCur},indent:o.indent&&function(e,r,a){return o.indent(e.base,r,a)},electricChars:o.electricChars,innerMode:function(e){return{state:e.base,mode:o}},blankLine:function(e){var n,t;return o.blankLine&&(n=o.blankLine(e.base)),r.blankLine&&(t=r.blankLine(e.overlay)),null==t?n:a&&null!=n?n+" "+t:t}}}}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e.unicode&&(n+="u"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",n)}function a(e,a){(e.next||e.push)&&t(a,e.next||e.push),this.regex=n(e.regex),this.token=function(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}(e.token),this.data=e}function r(e,t){return function(n,a){if(a.pending){var r=a.pending.shift();return 0==a.pending.length&&(a.pending=null),n.pos+=r.text.length,r.token}if(a.local){if(a.local.end&&n.match(a.local.end)){var o=a.local.endToken||null;return a.local=a.localState=null,o}var l;o=a.local.mode.token(n,a.localState);return a.local.endScan&&(l=a.local.endScan.exec(n.current()))&&(n.pos=n.start+l.index),o}for(var s=e[a.state],d=0;d<s.length;d++){var c=s[d],u=(!c.data.sol||n.sol())&&n.match(c.regex);if(u){c.data.next?a.state=c.data.next:c.data.push?((a.stack||(a.stack=[])).push(a.state),a.state=c.data.push):c.data.pop&&a.stack&&a.stack.length&&(a.state=a.stack.pop()),c.data.mode&&i(t,a,c.data.mode,c.token),c.data.indent&&a.indent.push(n.indentation()+t.indentUnit),c.data.dedent&&a.indent.pop();var p=c.token;if(p&&p.apply&&(p=p(u)),u.length>2&&c.token&&"string"!=typeof c.token){for(var f=2;f<u.length;f++)u[f]&&(a.pending||(a.pending=[])).push({text:u[f],token:c.token[f-1]});return n.backUp(u[0].length-(u[1]?u[1].length:0)),p[0]}return p&&p.join?p[0]:p}}return n.next(),null}}function o(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var a in e)if(e.hasOwnProperty(a)){if(!t.hasOwnProperty(a)||!o(e[a],t[a]))return!1;n++}for(var a in t)t.hasOwnProperty(a)&&n--;return 0==n}function i(t,a,r,i){var l;if(r.persistent)for(var s=a.persistentStates;s&&!l;s=s.next)(r.spec?o(r.spec,s.spec):r.mode==s.mode)&&(l=s);var d=l?l.mode:r.mode||e.getMode(t,r.spec),c=l?l.state:e.startState(d);r.persistent&&!l&&(a.persistentStates={mode:d,spec:r.spec,state:c,next:a.persistentStates}),a.localState=c,a.local={mode:d,end:r.end&&n(r.end),endScan:r.end&&!1!==r.forceEnd&&n(r.end,!1),endToken:i&&i.join?i[i.length-1]:i}}function l(t,n){return function(a,r,o){if(a.local&&a.local.mode.indent)return a.local.mode.indent(a.localState,r,o);if(null==a.indent||a.local||n.dontIndentStates&&function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}(a.state,n.dontIndentStates)>-1)return e.Pass;var i=a.indent.length-1,l=t[a.state];e:for(;;){for(var s=0;s<l.length;s++){var d=l[s];if(d.data.dedent&&!1!==d.data.dedentIfLineStart){var c=d.regex.exec(r);if(c&&c[0]){i--,(d.next||d.push)&&(l=t[d.next||d.push]),r=r.slice(c[0].length);continue e}}}break}return i<0?0:a.indent[i]}}e.defineSimpleMode=function(t,n){e.defineMode(t,(function(t){return e.simpleMode(t,n)}))},e.simpleMode=function(n,o){t(o,"start");var i={},s=o.meta||{},d=!1;for(var c in o)if(c!=s&&o.hasOwnProperty(c))for(var u=i[c]=[],p=o[c],f=0;f<p.length;f++){var h=p[f];u.push(new a(h,o)),(h.indent||h.dedent)&&(d=!0)}var g={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:d?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var a=t.persistentStates;a;a=a.next)n.persistentStates={mode:a.mode,spec:a.spec,state:a.state==t.localState?n.localState:e.copyState(a.mode,a.state),next:n.persistentStates};return n},token:r(i,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:l(i,s)};if(s)for(var S in s)s.hasOwnProperty(S)&&(g[S]=s[S]);return g}}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./runmode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./runmode"],e):e(CodeMirror)}((function(e){"use strict";var o=/^(p|li|div|h\\d|pre|blockquote|td)$/;function r(e,n){if(3==e.nodeType)return n.push(e.nodeValue);for(var t=e.firstChild;t;t=t.nextSibling)r(t,n),o.test(e.nodeType)&&n.push("\n")}e.colorize=function(o,n){o||(o=document.body.getElementsByTagName("pre"));for(var t=0;t<o.length;++t){var i=o[t],d=i.getAttribute("data-lang")||n;if(d){var u=[];r(i,u),i.innerHTML="",e.runMode(u.join(""),d,i),i.className+=" cm-s-default"}}}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(){"use strict";function t(t,e,r){for(var n in e||(e={}),t)!t.hasOwnProperty(n)||!1===r&&e.hasOwnProperty(n)||(e[n]=t[n]);return e}function e(t,e,r,n,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=n||0,s=i||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=r-s%r,o=a+1}}function r(){}var n=function(t,e,r){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};n.prototype.eol=function(){return this.pos>=this.string.length},n.prototype.sol=function(){return this.pos==this.lineStart},n.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},n.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},n.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},n.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},n.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},n.prototype.skipToEnd=function(){this.pos=this.string.length},n.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},n.prototype.backUp=function(t){this.pos-=t},n.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.indentation=function(){return e(this.string,null,this.tabSize)-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.match=function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}var i=function(t){return r?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},n.prototype.current=function(){return this.string.slice(this.start,this.pos)},n.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},n.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},n.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var i={},o={};function s(e){if("string"==typeof e&&o.hasOwnProperty(e))e=o[e];else if(e&&"string"==typeof e.name&&o.hasOwnProperty(e.name)){var n=o[e.name];"string"==typeof n&&(n={name:n}),i=n,a=e,Object.create?p=Object.create(i):(r.prototype=i,p=new r),a&&t(a,p),(e=p).name=n.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return s("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return s("application/json")}var i,a,p;return"string"==typeof e?{name:e}:e||{name:"null"}}var a={};var p,l={__proto__:null,modes:i,mimeModes:o,defineMode:function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),i[t]=e},defineMIME:function(t,e){o[t]=e},resolveMode:s,getMode:function t(e,r){r=s(r);var n=i[r.name];if(!n)return t(e,"text/plain");var o=n(e,r);if(a.hasOwnProperty(r.name)){var p=a[r.name];for(var l in p)p.hasOwnProperty(l)&&(o.hasOwnProperty(l)&&(o["_"+l]=o[l]),o[l]=p[l])}if(o.name=r.name,r.helperType&&(o.helperType=r.helperType),r.modeProps)for(var u in r.modeProps)o[u]=r.modeProps[u];return o},modeExtensions:a,extendMode:function(e,r){t(r,a.hasOwnProperty(e)?a[e]:a[e]={})},copyState:function(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var r={};for(var n in e){var i=e[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},innerMode:function(t,e){for(var r;t.innerMode&&(r=t.innerMode(e))&&r.mode!=t;)e=r.state,t=r.mode;return r||{mode:t,state:e}},startState:function(t,e,r){return!t.startState||t.startState(e,r)}},u="undefined"!=typeof globalThis?globalThis:window;for(var h in u.CodeMirror={},CodeMirror.StringStream=n,l)CodeMirror[h]=l[h];CodeMirror.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.splitLines=function(t){return t.split(/\r?\n|\r/)},CodeMirror.countColumn=e,CodeMirror.defaults={indentUnit:2},p=function(t){t.runMode=function(e,r,n,i){var o=t.getMode(t.defaults,r),s=i&&i.tabSize||t.defaults.tabSize;if(n.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),p=n,l=0;p.innerHTML="",n=function(t,e){if("\n"==t)return p.appendChild(document.createTextNode(a?"\r":t)),void(l=0);for(var r="",n=0;;){var i=t.indexOf("\t",n);if(-1==i){r+=t.slice(n),l+=t.length-n;break}l+=i-n,r+=t.slice(n,i);var o=s-l%s;l+=o;for(var u=0;u<o;++u)r+=" ";n=i+1}if(e){var h=p.appendChild(document.createElement("span"));h.className="cm-"+e.replace(/ +/g," cm-"),h.appendChild(documLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),i=o&&o.tabSize||e.defaults.tabSize;if(r.appendChild){var d=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),c=r,l=0;c.innerHTML="",r=function(e,t){if("\n"==e)return c.appendChild(document.createTextNode(d?"\r":e)),void(l=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),l+=e.length-r;break}l+=o-r,n+=e.slice(r,o);var a=i-l%i;l+=a;for(var u=0;u<a;++u)n+=" ";r=o+1}if(t){var f=c.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else c.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),f=o&&o.state||e.startState(a),s=0,p=u.length;s<p;++s){s&&r("\n");var m=new e.StringStream(u[s],null,{lookAhead:function(e){return u[s+e]},baseToken:function(){}});for(!m.string&&a.blankLine&&a.blankLine(f);!m.eol();){var v=a.token(m,f);r(m.current(),v,s,m.start,f,a),m.start=m.pos}}}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";function copyObj(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function countColumn(t,e,n,r,o){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=r||0,s=o||0;;){var a=t.indexOf("\t",i);if(a<0||a>=e)return s+(e-i);s+=a-i,s+=n-s%n,i=a+1}}function nothing(){}function createObj(t,e){var n;return Object.create?n=Object.create(t):(nothing.prototype=t,n=new nothing),e&©Obj(e,n),n}var StringStream=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},StringStream.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},StringStream.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},StringStream.prototype.backUp=function(t){this.pos-=t},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},StringStream.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},StringStream.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var modes={},mimeModes={};function defineMode(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e}function defineMIME(t,e){mimeModes[t]=e}function resolveMode(t){if("string"==typeof t&&mimeModes.hasOwnProperty(t))t=mimeModes[t];else if(t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)){var e=mimeModes[t.name];"string"==typeof e&&(e={name:e}),(t=createObj(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return resolveMode("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return resolveMode("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function getMode(t,e){e=resolveMode(e);var n=modes[e.name];if(!n)return getMode(t,"text/plain");var r=n(t,e);if(modeExtensions.hasOwnProperty(e.name)){var o=modeExtensions[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var modeExtensions={};function extendMode(t,e){copyObj(e,modeExtensions.hasOwnProperty(t)?modeExtensions[t]:modeExtensions[t]={})}function copyState(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function innerMode(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function startState(t,e,n){return!t.startState||t.startState(e,n)}var modeMethods={__proto__:null,modes:modes,mimeModes:mimeModes,defineMode:defineMode,defineMIME:defineMIME,resolveMode:resolveMode,getMode:getMode,modeExtensions:modeExtensions,extendMode:extendMode,copyState:copyState,innerMode:innerMode,startState:startState};for(var exported in exports.StringStream=StringStream,exports.countColumn=countColumn,modeMethods)exports[exported]=modeMethods[exported];require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")],require.cache[require.resolve("../../addon/runmode/runmode")]=require.cache[require.resolve("./runmode.node")],exports.defineMode("null",(function(){return{tokeLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout((function(){n.redraw()}),t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout((function(){n.computeScale()&&i(20)}),100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",(function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)})),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(e!=this.hScale)return this.hScale=e,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var e=this.cm,i=this.hScale,n=document.createDocumentFragment(),o=this.annotations,r=e.getOption("lineWrapping"),a=r&&1.5*e.defaultTextHeight(),s=null,h=null;function l(t,i){if(s!=t.line){s=t.line,h=e.getLineHandle(t.line);var n=e.getLineHandleVisualStart(h);n!=h&&(s=e.getLineNumber(n),h=n)}return h.widgets&&h.widgets.length||r&&h.height>a?e.charCoords(t,"local")[i?"top":"bottom"]:e.heightAtLine(h,"local")+(i?0:h.height)}var d=e.lastLine();if(e.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var f=c||l(u.from,!0)*i,m=l(u.to,!1)*i;p<o.length-1&&!(o[p+1].to.line>d)&&!((c=l(o[p+1].from,!0)*i)>m+.9);)m=l((u=o[++p]).to,!1)*i;if(m!=f){var g=Math.max(m-f,3),H=n.appendChild(document.createElement("div"));H.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+g+"px",H.className=this.options.className,u.id&&H.setAttribute("annotation-id",u.id)}}}this.div.textContent="",this.div.appendChild(n)},e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function n(n,i){e.changeEnd(i).line==n.lastLine()&&t(n)}function t(e){var n="";e.lineCount()>1&&(n=e.display.scroller.clientHeight-30-e.getLineHandle(e.lastLine()).height+"px");e.state.scrollPastEndPadding!=n&&(e.state.scrollPastEndPadding=n,e.display.lineSpace.parentNode.style.paddingBottom=n,e.off("refresh",t),e.setSize(),e.on("refresh",t))}e.defineOption("scrollPastEnd",!1,(function(i,o,d){d&&d!=e.Init&&(i.off("change",n),i.off("refresh",t),i.display.lineSpace.parentNode.style.paddingBottom="",i.state.scrollPastEndPadding=null),o&&(i.on("change",n),i.on("refresh",t),t(i))}))}));
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div {
|
||||
position: absolute;
|
||||
background: #ccc;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.CodeMirror-simplescroll-horizontal {
|
||||
bottom: 0; left: 0;
|
||||
height: 8px;
|
||||
}
|
||||
.CodeMirror-simplescroll-horizontal div {
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.CodeMirror-simplescroll-vertical {
|
||||
right: 0; top: 0;
|
||||
width: 8px;
|
||||
}
|
||||
.CodeMirror-simplescroll-vertical div {
|
||||
right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
|
||||
position: absolute;
|
||||
background: #bcd;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.CodeMirror-overlayscroll-horizontal {
|
||||
bottom: 0; left: 0;
|
||||
height: 6px;
|
||||
}
|
||||
.CodeMirror-overlayscroll-horizontal div {
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.CodeMirror-overlayscroll-vertical {
|
||||
right: 0; top: 0;
|
||||
width: 6px;
|
||||
}
|
||||
.CodeMirror-overlayscroll-vertical div {
|
||||
right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(e,o,i){this.orientation=o,this.scroll=i,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+o,this.inner=this.node.appendChild(document.createElement("div"));var n=this;function s(e){var o=t.wheelEventPixels(e)["horizontal"==n.orientation?"x":"y"],i=n.pos;n.moveTo(n.pos+o),n.pos!=i&&t.e_preventDefault(e)}t.on(this.inner,"mousedown",(function(e){if(1==e.which){t.e_preventDefault(e);var o="horizontal"==n.orientation?"pageX":"pageY",i=e[o],s=n.pos;t.on(document,"mousemove",h),t.on(document,"mouseup",r)}function r(){t.off(document,"mousemove",h),t.off(document,"mouseup",r)}function h(t){if(1!=t.which)return r();n.moveTo(s+(t[o]-i)*(n.total/n.size))}})),t.on(this.node,"click",(function(e){t.e_preventDefault(e);var o,i=n.inner.getBoundingClientRect();o="horizontal"==n.orientation?e.clientX<i.left?-1:e.clientX>i.right?1:0:e.clientY<i.top?-1:e.clientY>i.bottom?1:0,n.moveTo(n.pos+o*n.screen)})),t.on(this.node,"mousewheel",s),t.on(this.node,"DOMMouseScroll",s)}e.prototype.setPos=function(t,e){return t<0&&(t=0),t>this.total-this.screen&&(t=this.total-this.screen),!(!e&&t==this.pos)&&(this.pos=t,this.inner.style["horizontal"==this.orientation?"left":"top"]=t*(this.size/this.total)+"px",!0)},e.prototype.moveTo=function(t){this.setPos(t)&&this.scroll(t,this.orientation)};function o(t,o,i){this.addClass=t,this.horiz=new e(t,"horizontal",i),o(this.horiz.node),this.vert=new e(t,"vertical",i),o(this.vert.node),this.width=null}e.prototype.update=function(t,e,o){var i=this.screen!=e||this.total!=t||this.size!=o;i&&(this.screen=e,this.total=t,this.size=o);var n=this.screen*(this.size/this.total);n<10&&(this.size-=10-n,n=10),this.inner.style["horizontal"==this.orientation?"width":"height"]=n+"px",this.setPos(this.pos,i)},o.prototype.update=function(t){if(null==this.width){var e=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;e&&(this.width=parseInt(e.height))}var o=this.width||0,i=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=i?"block":"none",n&&(this.vert.update(t.scrollHeight,t.clientHeight,t.viewHeight-(i?o:0)),this.vert.node.style.bottom=i?o+"px":"0"),i&&(this.horiz.update(t.scrollWidth,t.clientWidth,t.viewWidth-(n?o:0)-t.barLeft),this.horiz.node.style.right=n?o+"px":"0",this.horiz.node.style.left=t.barLeft+"px"),{right:n?o:0,bottom:i?o:0}},o.prototype.setScrollTop=function(t){this.vert.setPos(t)},o.prototype.setScrollLeft=function(t){this.horiz.setPos(t)},o.prototype.clear=function(){var t=this.horiz.node.parentNode;t.removeChild(this.horiz.node),t.removeChild(this.vert.node)},t.scrollbarModel.simple=function(t,e){return new o("CodeMirror-simplescroll",t,e)},t.scrollbarModel.overlay=function(t,e){return new o("CodeMirror-overlayscroll",t,e)}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}((function(e){"use strict";function o(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var r=e.getCursor();!function(e,o,r,t,i){e.openDialog?e.openDialog(o,i,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,t))}(e,function(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}(e),e.phrase("Jump to line:"),r.line+1+":"+r.ch,(function(t){var i;if(t)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(o(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var n=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(n=r.line+n+1),e.setCursor(n-1,r.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(o(e,i[1]),r.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],t):t(CodeMirror)}((function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(t){for(var o in this.options={},e)this.options[o]=(t&&t.hasOwnProperty(o)?t:e)[o];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function i(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&r(t,e)}function n(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,r(t,e))}function r(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((function(){c(t)}),e.options.delay)}function a(t,e,o,i){var n=t.state.matchHighlighter;if(t.addOverlay(n.overlay=function(t,e,o){return{token:function(i){if(i.match(t)&&(!e||function(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}(i,e)))return o;i.next(),i.skipTo(t.charAt(0))||i.skipToEnd()}}}(e,o,i)),n.options.annotateScrollbar&&t.showMatchesOnScrollbar){var r=o?new RegExp((/\w/.test(e.charAt(0))?"\\b":"")+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(e.charAt(e.length-1))?"\\b":"")):e;n.matchesonscroll=t.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function c(t){t.operation((function(){var e=t.state.matchHighlighter;if(s(t),t.somethingSelected()||!e.options.showToken){var o=t.getCursor("from"),i=t.getCursor("to");if(o.line==i.line&&(!e.options.wordsOnly||function(t,e,o){if(null!==t.getRange(e,o).match(/^\w+$/)){if(e.ch>0){var i={line:e.line,ch:e.ch-1};if(null===t.getRange(i,e).match(/\W/))return!1}if(o.ch<t.getLine(e.line).length){i={line:o.line,ch:o.ch+1};if(null===t.getRange(o,i).match(/\W/))return!1}return!0}return!1}(t,o,i))){var n=t.getRange(o,i);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&a(t,n,!1,e.options.style)}}else{for(var r=!0===e.options.showToken?/[\w$]/:e.options.showToken,c=t.getCursor(),l=t.getLine(c.line),h=c.ch,u=h;h&&r.test(l.charAt(h-1));)--h;for(;u<l.length&&r.test(l.charAt(u));)++u;h<u&&a(t,l.slice(h,u),r,e.options.style)}}))}t.defineOption("highlightSelectionMatches",!1,(function(e,r,a){if(a&&a!=t.Init&&(s(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",i),e.off("focus",n)),r){var l=e.state.matchHighlighter=new o(r);e.hasFocus()?(l.active=!0,c(e)):e.on("focus",n),e.on("cursorActivity",i)}}))}));
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
.CodeMirror-search-match {
|
||||
background: gold;
|
||||
border-top: 1px solid orange;
|
||||
border-bottom: 1px solid orange;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
opacity: .5;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e,i,o){this.cm=t,this.options=o;var a={listenForChanges:!1};for(var n in o)a[n]=o[n];a.className||(a.className="CodeMirror-search-match"),this.annotation=t.annotateScrollbar(a),this.query=e,this.caseFold=i,this.gap={from:t.firstLine(),to:t.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var s=this;t.on("change",this.changeHandler=function(t,e){s.onChange(e)})}t.defineExtension("showMatchesOnScrollbar",(function(t,i,o){return"string"==typeof o&&(o={className:o}),o||(o={}),new e(this,t,i,o)}));function i(t,e,i){return t<=e?t:Math.max(e,t+i)}e.prototype.findMatches=function(){if(this.gap){for(var e=0;e<this.matches.length;e++){if((a=this.matches[e]).from.line>=this.gap.to)break;a.to.line>=this.gap.from&&this.matches.splice(e--,1)}for(var i=this.cm.getSearchCursor(this.query,t.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),o=this.options&&this.options.maxMatches||1e3;i.findNext();){var a;if((a={from:i.from(),to:i.to()}).from.line>=this.gap.to)break;if(this.matches.splice(e++,0,a),this.matches.length>o)break}this.gap=null}},e.prototype.onChange=function(e){var o=e.from.line,a=t.changeEnd(e).line,n=a-e.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,o,n),e.from.line),this.gap.to=Math.max(i(this.gap.to,o,n),e.from.line)):this.gap={from:e.from.line,to:a+1},n)for(var s=0;s<this.matches.length;s++){var r=this.matches[s],h=i(r.from.line,o,n);h!=r.from.line&&(r.from=t.Pos(h,r.from.ch));var c=i(r.to.line,o,n);c!=r.to.line&&(r.to=t.Pos(c,r.to.ch))}clearTimeout(this.update);var f=this;this.update=setTimeout((function(){f.updateAfterChange()}),250)},e.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},e.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}((function(e){"use strict";function o(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new o)}function t(e){return"string"==typeof e&&e==e.toLowerCase()}function r(e,o,n){return e.getSearchCursor(o,n,{caseFold:t(o),multiline:!0})}function i(e,o,n,t,r){e.openDialog?e.openDialog(o,r,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(n,t))}function a(e){return e.replace(/\\([nrt\\])/g,(function(e,o){return"n"==o?"\n":"r"==o?"\r":"t"==o?"\t":"\\"==o?"\\":e}))}function s(e){var o=e.match(/^\/(.*)\/([a-z]*)$/);if(o)try{e=new RegExp(o[1],-1==o[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,o,n){o.queryText=n,o.query=s(n),e.removeOverlay(o.overlay,t(o.query)),o.overlay=function(e,o){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),o?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(o){e.lastIndex=o.pos;var n=e.exec(o.string);if(n&&n.index==o.pos)return o.pos+=n[0].length||1,"searching";n?o.pos=n.index:o.skipToEnd()}}}(o.query,t(o.query)),e.addOverlay(o.overlay),e.showMatchesOnScrollbar&&(o.annotate&&(o.annotate.clear(),o.annotate=null),o.annotate=e.showMatchesOnScrollbar(o.query,t(o.query)))}function l(o,t,r,a){var s=n(o);if(s.query)return u(o,t);var l=o.getSelection()||s.lastQuery;if(l instanceof RegExp&&"x^"==l.source&&(l=null),r&&o.openDialog){var d=null,m=function(n,t){e.e_stop(t),n&&(n!=s.queryText&&(c(o,s,n),s.posFrom=s.posTo=o.getCursor()),d&&(d.style.opacity=1),u(o,t.shiftKey,(function(e,n){var t;n.line<3&&document.querySelector&&(t=o.display.wrapper.querySelector(".CodeMirror-dialog"))&&t.getBoundingClientRect().bottom-4>o.cursorCoords(n,"window").top&&((d=t).style.opacity=.4)})))};!function(e,o,n,t,r){e.openDialog(o,t,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){f(e)},onKeyDown:r,bottom:e.options.search.bottom})}(o,p(o),l,m,(function(t,r){var i=e.keyName(t),a=o.getOption("extraKeys"),s=a&&a[i]||e.keyMap[o.getOption("keyMap")][i];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(t),c(o,n(o),r),o.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(t),m(r,t))})),a&&l&&(c(o,s,l),u(o,t))}else i(o,p(o),"Search for:",l,(function(e){e&&!s.query&&o.operation((function(){c(o,s,e),s.posFrom=s.posTo=o.getCursor(),u(o,t)}))}))}function u(o,t,i){o.operation((function(){var a=n(o),s=r(o,a.query,t?a.posFrom:a.posTo);(s.find(t)||(s=r(o,a.query,t?e.Pos(o.lastLine()):e.Pos(o.firstLine(),0))).find(t))&&(o.setSelection(s.from(),s.to()),o.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function f(e){e.operation((function(){var o=n(e);o.lastQuery=o.query,o.query&&(o.query=o.queryText=null,e.removeOverlay(o.overlay),o.annotate&&(o.annotate.clear(),o.annotate=null))}))}function p(e){return'<span class="CodeMirror-search-label">'+e.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function d(e,o,n){e.operation((function(){for(var t=r(e,o);t.findNext();)if("string"!=typeof o){var i=e.getRange(t.from(),t.to()).match(o);t.replace(n.replace(/\$(\d)/g,(function(e,o){return i[o]})))}else t.replace(n)}))}function m(e,o){if(!e.getOption("readOnly")){var t=e.getSelection()||n(e).lastQuery,c='<span class="CodeMirror-search-label">'+(o?e.phrase("Replace all:"):e.phrase("Replace:"))+"</span>";i(e,c+function(e){return' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}(e),c,t,(function(n){n&&(n=s(n),i(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'}(e),e.phrase("Replace with:"),"",(function(t){if(t=a(t),o)d(e,n,t);else{f(e);var i=r(e,n,e.getCursor("from")),s=function(){var o,a=i.from();!(o=i.findNext())&&(i=r(e,n),!(o=i.findNext())||a&&i.from().line==a.line&&i.from().ch==a.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),function(e,o,n,t){e.openConfirm?e.openConfirm(o,t):confirm(n)&&t[0]()}(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("Replace?")+"</span> <button>"+e.phrase("Yes")+"</button> <button>"+e.phrase("No")+"</button> <button>"+e.phrase("All")+"</button> <button>"+e.phrase("Stop")+"</button> "}(e),e.phrase("Replace?"),[function(){c(oLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var n,e,r=t.Pos;function i(t,n){for(var e=function(t){var n=t.flags;return null!=n?n:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}(t),r=e,i=0;i<n.length;i++)-1==r.indexOf(n.charAt(i))&&(r+=n.charAt(i));return e==r?t:new RegExp(t.source,r)}function o(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}function l(t,n,e){n=i(n,"g");for(var o=e.line,l=e.ch,h=t.lastLine();o<=h;o++,l=0){n.lastIndex=l;var s=t.getLine(o),f=n.exec(s);if(f)return{from:r(o,f.index),to:r(o,f.index+f[0].length),match:f}}}function h(t,n,e){if(!o(n))return l(t,n,e);n=i(n,"gm");for(var h,s=1,f=e.line,c=t.lastLine();f<=c;){for(var u=0;u<s&&!(f>c);u++){var a=t.getLine(f++);h=null==h?a:h+"\n"+a}s*=2,n.lastIndex=e.ch;var g=n.exec(h);if(g){var m=h.slice(0,g.index).split("\n"),d=g[0].split("\n"),v=e.line+m.length-1,p=m[m.length-1].length;return{from:r(v,p),to:r(v+d.length-1,1==d.length?p+d[0].length:d[d.length-1].length),match:g}}}}function s(t,n,e){for(var r,i=0;i<=t.length;){n.lastIndex=i;var o=n.exec(t);if(!o)break;var l=o.index+o[0].length;if(l>t.length-e)break;(!r||l>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function f(t,n,e){n=i(n,"g");for(var o=e.line,l=e.ch,h=t.firstLine();o>=h;o--,l=-1){var f=t.getLine(o),c=s(f,n,l<0?0:f.length-l);if(c)return{from:r(o,c.index),to:r(o,c.index+c[0].length),match:c}}}function c(t,n,e){if(!o(n))return f(t,n,e);n=i(n,"gm");for(var l,h=1,c=t.getLine(e.line).length-e.ch,u=e.line,a=t.firstLine();u>=a;){for(var g=0;g<h&&u>=a;g++){var m=t.getLine(u--);l=null==l?m:m+"\n"+l}h*=2;var d=s(l,n,c);if(d){var v=l.slice(0,d.index).split("\n"),p=d[0].split("\n"),x=u+v.length,L=v[v.length-1].length;return{from:r(x,L),to:r(x+p.length-1,1==p.length?L+p[0].length:p[p.length-1].length),match:d}}}}function u(t,n,e,r){if(t.length==n.length)return e;for(var i=0,o=e+Math.max(0,t.length-n.length);;){if(i==o)return i;var l=i+o>>1,h=r(t.slice(0,l)).length;if(h==e)return l;h>e?o=l:i=l+1}}function a(t,i,o,l){if(!i.length)return null;var h=l?n:e,s=h(i).split(/\r|\n\r?/);t:for(var f=o.line,c=o.ch,a=t.lastLine()+1-s.length;f<=a;f++,c=0){var g=t.getLine(f).slice(c),m=h(g);if(1==s.length){var d=m.indexOf(s[0]);if(-1==d)continue t;o=u(g,m,d,h)+c;return{from:r(f,u(g,m,d,h)+c),to:r(f,u(g,m,d+s[0].length,h)+c)}}var v=m.length-s[0].length;if(m.slice(v)==s[0]){for(var p=1;p<s.length-1;p++)if(h(t.getLine(f+p))!=s[p])continue t;var x=t.getLine(f+s.length-1),L=h(x),C=s[s.length-1];if(L.slice(0,C.length)==C)return{from:r(f,u(g,m,v,h)+c),to:r(f+s.length-1,u(x,L,C.length,h))}}}}function g(t,i,o,l){if(!i.length)return null;var h=l?n:e,s=h(i).split(/\r|\n\r?/);t:for(var f=o.line,c=o.ch,a=t.firstLine()-1+s.length;f>=a;f--,c=-1){var g=t.getLine(f);c>-1&&(g=g.slice(0,c));var m=h(g);if(1==s.length){var d=m.lastIndexOf(s[0]);if(-1==d)continue t;return{from:r(f,u(g,m,d,h)),to:r(f,u(g,m,d+s[0].length,h))}}var v=s[s.length-1];if(m.slice(0,v.length)==v){var p=1;for(o=f-s.length+1;p<s.length-1;p++)if(h(t.getLine(o+p))!=s[p])continue t;var x=t.getLine(f+1-s.length),L=h(x);if(L.slice(L.length-s[0].length)==s[0])return{from:r(f+1-s.length,u(x,L,x.length-s[0].length,h)),to:r(f,u(g,m,v.length,h))}}}}function m(t,n,e,o){var s;this.atOccurrence=!1,this.doc=t,e=e?t.clipPos(e):r(0,0),this.pos={from:e,to:e},"object"==typeof o?s=o.caseFold:(s=o,o=null),"string"==typeof n?(null==s&&(s=!1),this.matches=function(e,r){return(e?g:a)(t,n,r,s)}):(n=i(n,"gm"),o&&!1===o.multiline?this.matches=function(e,r){return(e?f:l)(t,n,r)}:this.matches=function(e,r){return(e?c:h)(t,n,r)})}String.prototype.normalize?(n=function(t){return t.normalize("NFD").toLowerCase()},e=function(t){return t.normalize("NFD")}):(n=function(t){return t.toLowerCase()},e=function(t){return t}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(n){for(var e=this.matches(n,this.doc.clipPos(n?this.pos.from:this.pos.to));e&&0==t.cmpPos(e.from,e.to);)n?e.from.ch?e.from=r(e.from.line,e.from.ch-1):e=e.from.line==this.doc.firstLine()?null:this.matches(n,this.doc.clipPos(r(e.from.line-1))):e.to.ch<this.doc.getLine(e.to.line).length?e.to=r(e.to.line,e.to.ch+1):e=e.to.line==this.doc.lastLine()?null:this.matches(n,r(e.to.line+1,0));if(e)return this.pos=e,this.atOccurrence=!0,this.pos.match||!0;var i=r(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:i,to:i},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,e){if(this.atOccurrence){var i=t.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,e),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},t.defineExtension("getSearchCursor",(function(t,n,e){return new m(this.doc,t,n,e)})),t.defineDocExtension("geLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var t="CodeMirror-activeline-background";function i(e){for(var i=0;i<e.state.activeLines.length;i++)e.removeLineClass(e.state.activeLines[i],"wrap","CodeMirror-activeline"),e.removeLineClass(e.state.activeLines[i],"background",t),e.removeLineClass(e.state.activeLines[i],"gutter","CodeMirror-activeline-gutter")}function n(e,n){for(var r=[],o=0;o<n.length;o++){var a=n[o],s=e.getOption("styleActiveLine");if("object"==typeof s&&s.nonEmpty?a.anchor.line==a.head.line:a.empty()){var c=e.getLineHandleVisualStart(a.head.line);r[r.length-1]!=c&&r.push(c)}}(function(e,t){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0})(e.state.activeLines,r)||e.operation((function(){i(e);for(var n=0;n<r.length;n++)e.addLineClass(r[n],"wrap","CodeMirror-activeline"),e.addLineClass(r[n],"background",t),e.addLineClass(r[n],"gutter","CodeMirror-activeline-gutter");e.state.activeLines=r}))}function r(e,t){n(e,t.ranges)}e.defineOption("styleActiveLine",!1,(function(t,o,a){var s=a!=e.Init&&a;o!=s&&(s&&(t.off("beforeSelectionChange",r),i(t),delete t.state.activeLines),o&&(t.state.activeLines=[],n(t,t.listSelections()),t.on("beforeSelectionChange",r)))}))}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return l(e);if(e.listSelections().length>1)return f(e);var t=e.getCursor("start"),n=e.getCursor("end"),o=e.state.markedSelection;if(!o.length)return i(e,t,n);var c=o[0].find(),a=o[o.length-1].find();if(!c||!a||n.line-t.line<=8||r(t,a.to)>=0||r(n,c.from)<=0)return f(e);for(;r(t,c.from)>0;)o.shift().clear(),c=o[0].find();r(t,c.from)<0&&(c.to.line-t.line<8?(o.shift().clear(),i(e,t,c.to,0)):i(e,t,c.from,0));for(;r(n,a.to)<0;)o.pop().clear(),a=o[o.length-1].find();r(n,a.to)>0&&(n.line-a.from.line<8?(o.pop().clear(),i(e,a.from,n)):i(e,a.to,n))}(e)}))}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation((function(){l(e)}))}e.defineOption("styleSelectedText",!1,(function(o,r,i){var c=i&&i!=e.Init;r&&!c?(o.state.markedSelection=[],o.state.markedSelectionStyle="string"==typeof r?r:"CodeMirror-selectedtext",f(o),o.on("cursorActivity",t),o.on("change",n)):!r&&c&&(o.off("cursorActivity",t),o.off("change",n),l(o),o.state.markedSelection=o.state.markedSelectionStyle=null)}));var o=e.Pos,r=e.cmpPos;function i(e,t,n,i){if(0!=r(t,n))for(var l=e.state.markedSelection,f=e.state.markedSelectionStyle,c=t.line;;){var a=c==t.line?t:o(c,0),s=c+8,d=s>=n.line,m=d?n:o(s,0),u=e.markText(a,m,{className:f});if(null==i?l.push(u):l.splice(i++,0,u),d)break;c=s}}function l(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function f(e){l(e);for(var t=e.listSelections(),n=0;n<t.length;n++)i(e,t[n].from(),t[n].to())}}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e){e.state.selectionPointer.rects=null,o(e)}function o(e){e.state.selectionPointer.willUpdate||(e.state.selectionPointer.willUpdate=!0,setTimeout((function(){!function(e){var t=e.state.selectionPointer;if(!t)return;if(null==t.rects&&null!=t.mouseX&&(t.rects=[],e.somethingSelected()))for(var o=e.display.selectionDiv.firstChild;o;o=o.nextSibling)t.rects.push(o.getBoundingClientRect());var n=!1;if(null!=t.mouseX)for(var i=0;i<t.rects.length;i++){var l=t.rects[i];l.left<=t.mouseX&&l.right>=t.mouseX&&l.top<=t.mouseY&&l.bottom>=t.mouseY&&(n=!0)}var s=n?t.value:"";e.display.lineDiv.style.cursor!=s&&(e.display.lineDiv.style.cursor=s)}(e),e.state.selectionPointer.willUpdate=!1}),50))}e.defineOption("selectionPointer",!1,(function(n,i){var l=n.state.selectionPointer;l&&(e.off(n.getWrapperElement(),"mousemove",l.mousemove),e.off(n.getWrapperElement(),"mouseout",l.mouseout),e.off(window,"scroll",l.windowScroll),n.off("cursorActivity",t),n.off("scroll",t),n.state.selectionPointer=null,n.display.lineDiv.style.cursor=""),i&&(l=n.state.selectionPointer={value:"string"==typeof i?i:"default",mousemove:function(e){!function(e,t){var n=e.state.selectionPointer;(null==t.buttons?t.which:t.buttons)?n.mouseX=n.mouseY=null:(n.mouseX=t.clientX,n.mouseY=t.clientY);o(e)}(n,e)},mouseout:function(e){!function(e,t){if(!e.getWrapperElement().contains(t.relatedTarget)){var n=e.state.selectionPointer;n.mouseX=n.mouseY=null,o(e)}}(n,e)},windowScroll:function(){t(n)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(n.getWrapperElement(),"mousemove",l.mousemove),e.on(n.getWrapperElement(),"mouseout",l.mouseout),e.on(window,"scroll",l.windowScroll),n.on("cursorActivity",t),n.on("scroll",t))}))}));
|
||||
@@ -0,0 +1,87 @@
|
||||
.CodeMirror-Tern-completion {
|
||||
padding-left: 22px;
|
||||
position: relative;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.CodeMirror-Tern-completion:before {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
bottom: 2px;
|
||||
border-radius: 50%;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.CodeMirror-Tern-completion-unknown:before {
|
||||
content: "?";
|
||||
background: #4bb;
|
||||
}
|
||||
.CodeMirror-Tern-completion-object:before {
|
||||
content: "O";
|
||||
background: #77c;
|
||||
}
|
||||
.CodeMirror-Tern-completion-fn:before {
|
||||
content: "F";
|
||||
background: #7c7;
|
||||
}
|
||||
.CodeMirror-Tern-completion-array:before {
|
||||
content: "A";
|
||||
background: #c66;
|
||||
}
|
||||
.CodeMirror-Tern-completion-number:before {
|
||||
content: "1";
|
||||
background: #999;
|
||||
}
|
||||
.CodeMirror-Tern-completion-string:before {
|
||||
content: "S";
|
||||
background: #999;
|
||||
}
|
||||
.CodeMirror-Tern-completion-bool:before {
|
||||
content: "B";
|
||||
background: #999;
|
||||
}
|
||||
|
||||
.CodeMirror-Tern-completion-guess {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.CodeMirror-Tern-tooltip {
|
||||
border: 1px solid silver;
|
||||
border-radius: 3px;
|
||||
color: #444;
|
||||
padding: 2px 5px;
|
||||
font-size: 90%;
|
||||
font-family: monospace;
|
||||
background-color: white;
|
||||
white-space: pre-wrap;
|
||||
|
||||
max-width: 40em;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
|
||||
transition: opacity 1s;
|
||||
-moz-transition: opacity 1s;
|
||||
-webkit-transition: opacity 1s;
|
||||
-o-transition: opacity 1s;
|
||||
-ms-transition: opacity 1s;
|
||||
}
|
||||
|
||||
.CodeMirror-Tern-hint-doc {
|
||||
max-width: 25em;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
.CodeMirror-Tern-fname { color: black; }
|
||||
.CodeMirror-Tern-farg { color: #70a; }
|
||||
.CodeMirror-Tern-farg-current { text-decoration: underline; }
|
||||
.CodeMirror-Tern-type { color: #07c; }
|
||||
.CodeMirror-Tern-fhint-guess { opacity: .7; }
|
||||
Loaded 100 of 12716 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user