Revisión de directorios y ficheros no necesarios
git-svn-id: https://192.168.0.254/svn/Rodax.factuges_web/trunk@10 e455b18d-f7fe-5245-9c43-e2c35af70a32
This commit is contained in:
parent
887967c284
commit
7f8904d112
@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
|
||||||
* @link http://www.ramirezcobos.com/
|
|
||||||
* @link http://www.2amigos.us/
|
|
||||||
* @copyright 2013 2amigOS! Consultation Group LLC
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
*/
|
|
||||||
return array(
|
|
||||||
'modules' => array(
|
|
||||||
'gii' => array(
|
|
||||||
'class' => 'system.gii.GiiModule',
|
|
||||||
'password' => 'yii',
|
|
||||||
'ipFilters' => array('127.0.0.1','::1'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'components' => array(
|
|
||||||
'db' => array(
|
|
||||||
'connectionString' => 'mysql:host=localhost;dbname=factuges_dev',
|
|
||||||
'username' => 'root',
|
|
||||||
'password' => '',
|
|
||||||
'enableProfiling' => true,
|
|
||||||
'enableParamLogging' => true,
|
|
||||||
'charset' => 'utf8',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'params' => array(
|
|
||||||
'yii.handleErrors' => true,
|
|
||||||
'yii.debug' => true,
|
|
||||||
'yii.traceLevel' => 3,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
# cache directories
|
|
||||||
Thumbs.db
|
|
||||||
*.DS_Store
|
|
||||||
*.empty
|
|
||||||
|
|
||||||
#phpstorm project files
|
|
||||||
.idea
|
|
||||||
|
|
||||||
#netbeans project files
|
|
||||||
nbproject
|
|
||||||
|
|
||||||
#zend studio project files
|
|
||||||
.buildpath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
|
|
||||||
# sass cache files
|
|
||||||
*.sass-cache
|
|
||||||
|
|
||||||
# mac deployment helpers
|
|
||||||
switch
|
|
||||||
|
|
||||||
# Composer files
|
|
||||||
composer*
|
|
||||||
vendor/*
|
|
||||||
|
|
||||||
# docs app
|
|
||||||
docs/app/runtime
|
|
||||||
docs/web/assets
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
Yiistrap
|
|
||||||
========
|
|
||||||
|
|
||||||
Twitter Bootstrap for Yii.
|
|
||||||
22
src/common/lib/vendor/2amigos/yiistrap/TODO.md
vendored
22
src/common/lib/vendor/2amigos/yiistrap/TODO.md
vendored
@ -1,22 +0,0 @@
|
|||||||
TODO
|
|
||||||
====
|
|
||||||
|
|
||||||
## Widgets
|
|
||||||
|
|
||||||
### High prio
|
|
||||||
|
|
||||||
- media object (@tonydspaniard) / to be reviewed
|
|
||||||
|
|
||||||
### Low prio
|
|
||||||
|
|
||||||
- tabs (@tonydspaniard) / to be reviewed
|
|
||||||
- grid view (@tonydspaniard) / to be reviewed
|
|
||||||
- detail view (@tonydspaniard) / work in progress
|
|
||||||
- modal (@tonydspaniard) / to be reviewed
|
|
||||||
- typeahead (@tonydspaniard) / to be reviewed
|
|
||||||
|
|
||||||
## Helpers
|
|
||||||
|
|
||||||
## Other
|
|
||||||
|
|
||||||
- implement bootstrap version of jquery.yiiactiveform.js
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,78 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbWidget class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.behaviors
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('bootstrap.components.TbApi');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap widget behavior.
|
|
||||||
* @property $owner CWidget
|
|
||||||
*/
|
|
||||||
class TbWidget extends CBehavior
|
|
||||||
{
|
|
||||||
private $_api;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copies the id to the widget HTML attributes or vise versa.
|
|
||||||
*/
|
|
||||||
public function copyId()
|
|
||||||
{
|
|
||||||
if (!isset($this->owner->htmlOptions['id']))
|
|
||||||
$this->owner->htmlOptions['id'] = $this->owner->id;
|
|
||||||
else
|
|
||||||
$this->owner->id = $this->owner->htmlOptions['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the given plugin with the API.
|
|
||||||
* @param string $name the plugin name.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param array $options the JavaScript options for the plugin.
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
* @return boolean whether the plugin was registered.
|
|
||||||
*/
|
|
||||||
public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
if (($api = $this->getApi()) !== null)
|
|
||||||
{
|
|
||||||
$api->registerPlugin($name, $selector, $options, $position);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers plugin events with the API.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param string[] $events the JavaScript event configuration (name=>handler).
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
* @return boolean whether the events were registered.
|
|
||||||
*/
|
|
||||||
public function registerEvents($selector, $events, $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
if (($api = $this->getApi()) !== null)
|
|
||||||
{
|
|
||||||
$api->registerEvents($selector, $events, $position);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the API instance.
|
|
||||||
* @return TbApi the api.
|
|
||||||
*/
|
|
||||||
private function getApi()
|
|
||||||
{
|
|
||||||
if (isset($this->_api))
|
|
||||||
return $this->_api;
|
|
||||||
else
|
|
||||||
return $this->_api = Yii::app()->getComponent('bootstrap');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,209 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbApi class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.components
|
|
||||||
* @version 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap API component.
|
|
||||||
*/
|
|
||||||
class TbApi extends CApplicationComponent
|
|
||||||
{
|
|
||||||
// Bootstrap plugins
|
|
||||||
const PLUGIN_AFFIX = 'affix';
|
|
||||||
const PLUGIN_ALERT = 'alert';
|
|
||||||
const PLUGIN_BUTTON = 'button';
|
|
||||||
const PLUGIN_CAROUSEL = 'carousel';
|
|
||||||
const PLUGIN_COLLAPSE = 'collapse';
|
|
||||||
const PLUGIN_DROPDOWN = 'dropdown';
|
|
||||||
const PLUGIN_MODAL = 'modal';
|
|
||||||
const PLUGIN_POPOVER = 'popover';
|
|
||||||
const PLUGIN_SCROLLSPY = 'scrollspy';
|
|
||||||
const PLUGIN_TAB = 'tab';
|
|
||||||
const PLUGIN_TOOLTIP = 'tooltip';
|
|
||||||
const PLUGIN_TRANSITION = 'transition';
|
|
||||||
const PLUGIN_TYPEAHEAD = 'typeahead';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool whether we should copy the asset file or directory even if it is already published before.
|
|
||||||
*/
|
|
||||||
public $forceCopyAssets = false;
|
|
||||||
|
|
||||||
private $_assetsUrl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the Bootstrap CSS.
|
|
||||||
* @param string $url the URL to the CSS file to register.
|
|
||||||
*/
|
|
||||||
public function registerCoreCss($url = null)
|
|
||||||
{
|
|
||||||
if ($url === null)
|
|
||||||
{
|
|
||||||
$fileName = YII_DEBUG ? 'bootstrap.css' : 'bootstrap.min.css';
|
|
||||||
$url = $this->getAssetsUrl() . '/css/' . $fileName;
|
|
||||||
}
|
|
||||||
Yii::app()->clientScript->registerCssFile($url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the responsive Bootstrap CSS.
|
|
||||||
* @param string $url the URL to the CSS file to register.
|
|
||||||
*/
|
|
||||||
public function registerResponsiveCss($url = null)
|
|
||||||
{
|
|
||||||
if ($url === null)
|
|
||||||
{
|
|
||||||
$fileName = YII_DEBUG ? 'bootstrap-responsive.css' : 'bootstrap-responsive.min.css';
|
|
||||||
$url = $this->getAssetsUrl() . '/css/' . $fileName;
|
|
||||||
}
|
|
||||||
/** @var CClientScript $cs */
|
|
||||||
$cs = Yii::app()->getClientScript();
|
|
||||||
$cs->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport');
|
|
||||||
$cs->registerCssFile($url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers all Bootstrap CSS files.
|
|
||||||
*/
|
|
||||||
public function registerAllCss()
|
|
||||||
{
|
|
||||||
$this->registerCoreCss();
|
|
||||||
$this->registerResponsiveCss();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers jQuery and Bootstrap JavaScript.
|
|
||||||
* @param string $url the URL to the JavaScript file to register.
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
*/
|
|
||||||
public function registerCoreScripts($url = null, $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
if ($url === null) {
|
|
||||||
$fileName = YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js';
|
|
||||||
$url = $this->getAssetsUrl() . '/js/' . $fileName;
|
|
||||||
}
|
|
||||||
/** @var CClientScript $cs */
|
|
||||||
$cs = Yii::app()->getClientScript();
|
|
||||||
$cs->registerCoreScript('jquery');
|
|
||||||
$cs->registerScriptFile($url, $position);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the Tooltip and Popover plugins.
|
|
||||||
*/
|
|
||||||
public function registerTooltipAndPopover()
|
|
||||||
{
|
|
||||||
$this->registerPopover();
|
|
||||||
$this->registerTooltip();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers all Bootstrap JavaScript files.
|
|
||||||
*/
|
|
||||||
public function registerAllScripts()
|
|
||||||
{
|
|
||||||
$this->registerCoreScripts();
|
|
||||||
$this->registerTooltipAndPopover();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers all assets.
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
$this->registerAllCss();
|
|
||||||
$this->registerAllScripts();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the Bootstrap Popover plugin.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param array $options the JavaScript options for the plugin.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#popover
|
|
||||||
*/
|
|
||||||
public function registerPopover($selector = 'body', $options = array())
|
|
||||||
{
|
|
||||||
if (!isset($options['selector']))
|
|
||||||
$options['selector'] = 'a[rel=popover]';
|
|
||||||
$this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the Bootstrap Tooltip plugin.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param array $options the JavaScript options for the plugin.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#tooltip
|
|
||||||
*/
|
|
||||||
public function registerTooltip($selector = 'body', $options = array())
|
|
||||||
{
|
|
||||||
if (!isset($options['selector']))
|
|
||||||
$options['selector'] = 'a[rel=tooltip]';
|
|
||||||
$this->registerPlugin(self::PLUGIN_TOOLTIP, $selector, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a specific Bootstrap plugin using the given selector and options.
|
|
||||||
* @param string $name the plugin name.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param array $options the JavaScript options for the plugin.
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
*/
|
|
||||||
public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
$options = !empty($options) ? CJavaScript::encode($options) : '';
|
|
||||||
$script = "jQuery('{$selector}').{$name}({$options});";
|
|
||||||
Yii::app()->clientScript->registerScript($this->getUniqueScriptId(), $script, $position);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers events using the given selector.
|
|
||||||
* @param string $selector the CSS selector.
|
|
||||||
* @param string[] $events the JavaScript event configuration (name=>handler).
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
*/
|
|
||||||
public function registerEvents($selector, $events, $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
if(empty($events))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$script = '';
|
|
||||||
foreach ($events as $name => $handler)
|
|
||||||
{
|
|
||||||
$handler = ($handler instanceof CJavaScriptExpression)
|
|
||||||
? $handler
|
|
||||||
: new CJavaScriptExpression($handler);
|
|
||||||
|
|
||||||
$script .= "jQuery('{$selector}').on('{$name}', {$handler});";
|
|
||||||
}
|
|
||||||
Yii::app()->clientScript->registerScript($this->getUniqueScriptId(), $script, $position);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the url to the published assets folder.
|
|
||||||
* @return string the url.
|
|
||||||
*/
|
|
||||||
protected function getAssetsUrl()
|
|
||||||
{
|
|
||||||
if (isset($this->_assetsUrl))
|
|
||||||
return $this->_assetsUrl;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$assetsPath = Yii::getPathOfAlias('bootstrap.assets');
|
|
||||||
$assetsUrl = Yii::app()->assetManager->publish($assetsPath, true, -1, $this->forceCopyAssets);
|
|
||||||
return $this->_assetsUrl = $assetsUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a "somewhat" random id string.
|
|
||||||
* @return string the id.
|
|
||||||
*/
|
|
||||||
protected function getUniqueScriptId()
|
|
||||||
{
|
|
||||||
return uniqid(__CLASS__ . '#', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "2amigos/yiistrap",
|
|
||||||
"description": "Twitter Bootstrap for the Yii PHP framework. Own maintained version.",
|
|
||||||
"keywords": ["bootstrap", "yii"],
|
|
||||||
"type": "yii-extension",
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Christoffer Niska",
|
|
||||||
"email": "christoffer.niska@gmail.com",
|
|
||||||
"homepage": "http://www.cniska.net/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Antonio Ramirez",
|
|
||||||
"email": "ramirez.cobos@gmail.com",
|
|
||||||
"homepage": "http://www.ramirezcobos.com/"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,693 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbActiveForm class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class TbActiveForm
|
|
||||||
*/
|
|
||||||
class TbActiveForm extends CActiveForm
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the form layout.
|
|
||||||
*/
|
|
||||||
public $layout;
|
|
||||||
/**
|
|
||||||
* @var string the help type. Valid values are TbHtml::HELP_INLINE and TbHtml::HELP_BLOCK.
|
|
||||||
*/
|
|
||||||
public $helpType = TbHtml::HELP_TYPE_BLOCK;
|
|
||||||
/**
|
|
||||||
* @var string the CSS class name for error messages.
|
|
||||||
*/
|
|
||||||
public $errorMessageCssClass = 'error';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
if ($this->stateful)
|
|
||||||
echo TbHtml::statefulFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
|
|
||||||
else
|
|
||||||
echo TbHtml::beginFormTb($this->layout, $this->action, $this->method, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays the first validation error for a model attribute.
|
|
||||||
* @param CModel $model the data model
|
|
||||||
* @param string $attribute the attribute name
|
|
||||||
* @param array $htmlOptions additional HTML attributes to be rendered in the container div tag.
|
|
||||||
* @param boolean $enableAjaxValidation whether to enable AJAX validation for the specified attribute.
|
|
||||||
* @param boolean $enableClientValidation whether to enable client-side validation for the specified attribute.
|
|
||||||
* @return string the validation result (error display or success message).
|
|
||||||
*/
|
|
||||||
public function error($model, $attribute, $htmlOptions = array(), $enableAjaxValidation = true, $enableClientValidation = true)
|
|
||||||
{
|
|
||||||
if (!$this->enableAjaxValidation)
|
|
||||||
$enableAjaxValidation = false;
|
|
||||||
if (!$this->enableClientValidation)
|
|
||||||
$enableClientValidation = false;
|
|
||||||
if (!$enableAjaxValidation && !$enableClientValidation)
|
|
||||||
return TbHtml::error($model, $attribute, $htmlOptions);
|
|
||||||
$id = CHtml::activeId($model, $attribute);
|
|
||||||
$inputID = TbHtml::getOption('inputID', $htmlOptions, $id);
|
|
||||||
unset($htmlOptions['inputID']);
|
|
||||||
if (!isset($htmlOptions['id']))
|
|
||||||
$htmlOptions['id'] = $inputID . '_em_';
|
|
||||||
$option = array(
|
|
||||||
'id' => $id,
|
|
||||||
'inputID' => $inputID,
|
|
||||||
'errorID' => $htmlOptions['id'],
|
|
||||||
'model' => get_class($model),
|
|
||||||
'name' => CHtml::resolveName($model, $attribute),
|
|
||||||
'enableAjaxValidation' => $enableAjaxValidation,
|
|
||||||
'inputContainer' => 'div.control-group', // Bootstrap requires this
|
|
||||||
);
|
|
||||||
$optionNames = array(
|
|
||||||
'validationDelay',
|
|
||||||
'validateOnChange',
|
|
||||||
'validateOnType',
|
|
||||||
'hideErrorMessage',
|
|
||||||
'inputContainer',
|
|
||||||
'errorCssClass',
|
|
||||||
'successCssClass',
|
|
||||||
'validatingCssClass',
|
|
||||||
'beforeValidateAttribute',
|
|
||||||
'afterValidateAttribute',
|
|
||||||
);
|
|
||||||
foreach ($optionNames as $name)
|
|
||||||
{
|
|
||||||
$option[$name] = TbHtml::getOption($name, $htmlOptions);
|
|
||||||
unset($htmlOptions[$name]);
|
|
||||||
}
|
|
||||||
if ($model instanceof CActiveRecord && !$model->isNewRecord)
|
|
||||||
$option['status'] = 1;
|
|
||||||
if ($enableClientValidation)
|
|
||||||
{
|
|
||||||
$validators = TbHtml::getOption('clientValidation', $htmlOptions, array());
|
|
||||||
$attributeName = $attribute;
|
|
||||||
if (($pos = strrpos($attribute, ']')) !== false && $pos !== strlen($attribute) - 1) // e.g. [a]name
|
|
||||||
$attributeName = substr($attribute, $pos + 1);
|
|
||||||
foreach ($model->getValidators($attributeName) as $validator)
|
|
||||||
{
|
|
||||||
if ($validator->enableClientValidation)
|
|
||||||
if (($js = $validator->clientValidateAttribute($model, $attributeName)) != '')
|
|
||||||
$validators[] = $js;
|
|
||||||
}
|
|
||||||
if ($validators !== array())
|
|
||||||
$option['clientValidation'] = "js:function(value, messages, attribute) {\n" . implode("\n", $validators) . "\n}";
|
|
||||||
}
|
|
||||||
$html = TbHtml::error($model, $attribute, $htmlOptions);
|
|
||||||
if ($html === '')
|
|
||||||
{
|
|
||||||
$htmlOptions = TbHtml::addStyles('display:none', $htmlOptions);
|
|
||||||
$html = CHtml::tag('span', $htmlOptions, '');
|
|
||||||
}
|
|
||||||
$this->attributes[$inputID] = $option;
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays a summary of validation errors for one or several models.
|
|
||||||
* @param mixed $models the models whose input errors are to be displayed.
|
|
||||||
* @param string $header a piece of HTML code that appears in front of the errors
|
|
||||||
* @param string $footer a piece of HTML code that appears at the end of the errors
|
|
||||||
* @param array $htmlOptions additional HTML attributes to be rendered in the container div tag.
|
|
||||||
* @return string the error summary. Empty if no errors are found.
|
|
||||||
*/
|
|
||||||
public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
if (!$this->enableAjaxValidation && !$this->enableClientValidation)
|
|
||||||
return TbHtml::errorSummary($models, $header, $footer, $htmlOptions);
|
|
||||||
if (!isset($htmlOptions['id']))
|
|
||||||
$htmlOptions['id'] = $this->id . '_es_';
|
|
||||||
$html = TbHtml::errorSummary($models, $header, $footer, $htmlOptions);
|
|
||||||
if ($html === '')
|
|
||||||
{
|
|
||||||
if ($header === null)
|
|
||||||
$header = '<p>' . Yii::t('yii', 'Please fix the following input errors:') . '</p>';
|
|
||||||
if (!isset($htmlOptions['class']))
|
|
||||||
$htmlOptions['class'] = CHtml::$errorSummaryCss;
|
|
||||||
$htmlOptions['style'] = isset($htmlOptions['style'])
|
|
||||||
? rtrim($htmlOptions['style'], ';') . ';display:none'
|
|
||||||
: 'display:none';
|
|
||||||
$html = CHtml::tag('div', $htmlOptions, $header . '<ul><li>dummy</li></ul>' . $footer);
|
|
||||||
}
|
|
||||||
$this->summaryID = $htmlOptions['id'];
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a text field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activeTextField
|
|
||||||
*/
|
|
||||||
public function textField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeTextField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a password field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activePasswordField
|
|
||||||
*/
|
|
||||||
public function passwordField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activePasswordField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a url field for a model attribute.
|
|
||||||
* @param CModel $model the data model
|
|
||||||
* @param string $attribute the attribute
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field
|
|
||||||
* @see TbHtml::activeUrlField
|
|
||||||
*/
|
|
||||||
public function urlField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeUrlField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an email field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activeEmailField
|
|
||||||
*/
|
|
||||||
public function emailField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeEmailField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a number field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activeNumberField
|
|
||||||
*/
|
|
||||||
public function numberField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeNumberField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a range field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activeRangeField
|
|
||||||
*/
|
|
||||||
public function rangeField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeRangeField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a date field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input field.
|
|
||||||
*/
|
|
||||||
public function dateField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeDateField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a text area for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated text area.
|
|
||||||
* @see TbHtml::activeTextArea
|
|
||||||
*/
|
|
||||||
public function textArea($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeTextArea($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a file field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes
|
|
||||||
* @return string the generated input field.
|
|
||||||
* @see TbHtml::activeFileField
|
|
||||||
*/
|
|
||||||
public function fileField($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeFileField($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a radio button for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated radio button.
|
|
||||||
* @see TbHtml::activeRadioButton
|
|
||||||
*/
|
|
||||||
public function radioButton($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeRadioButton($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a checkbox for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated check box.
|
|
||||||
* @see TbHtml::activeCheckBox
|
|
||||||
*/
|
|
||||||
public function checkBox($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeCheckBox($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a dropdown list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated drop down list.
|
|
||||||
* @see TbHtml::activeDropDownList
|
|
||||||
*/
|
|
||||||
public function dropDownList($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeDropDownList($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a list box for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated list box.
|
|
||||||
* @see TbHtml::activeListBox
|
|
||||||
*/
|
|
||||||
public function listBox($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeListBox($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a radio button list for a model attribute
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display)
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated radio button list.
|
|
||||||
* @see TbHtml::activeRadioButtonList
|
|
||||||
*/
|
|
||||||
public function radioButtonList($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeRadioButtonList($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an inline radio button list for a model attribute
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display)
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated radio button list.
|
|
||||||
* @see TbHtml::activeInlineRadioButtonList
|
|
||||||
*/
|
|
||||||
public function inlineRadioButtonList($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeInlineRadioButtonList($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a checkbox list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display)
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated checkbox list.
|
|
||||||
* @see TbHtml::activeCheckBoxList
|
|
||||||
*/
|
|
||||||
public function checkBoxList($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeCheckBoxList($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an inline checkbox list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $data data for generating the list options (value=>display)
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated checkbox list.
|
|
||||||
* @see TbHtml::activeInlineCheckBoxList
|
|
||||||
*/
|
|
||||||
public function inlineCheckBoxList($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeInlineCheckBoxList($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an uneditable field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated field.
|
|
||||||
* @see TbHtml::activeUneditableField
|
|
||||||
*/
|
|
||||||
public function uneditableField($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeUneditableField($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a search query field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated input.
|
|
||||||
* @see TbHtml::activeSearchField
|
|
||||||
*/
|
|
||||||
public function searchField($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
return TbHtml::activeSearchField($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a text field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeTextFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function textFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeTextFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a password field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activePasswordFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function passwordFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activePasswordFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with an url field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeUrlFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function urlFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeUrlFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with an email field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeEmailFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function emailFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeEmailFieldControlGroup($model, $attribute, null/* no data */, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a number field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeNumberFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function numberFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeNumberFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a range field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeRangeFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function rangeFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeRangeFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a date field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeDateFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function dateFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeDateFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a text area for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeTextAreaControlGroup
|
|
||||||
*/
|
|
||||||
public function textAreaControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeTextAreaControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a check box for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeCheckBoxControlGroup
|
|
||||||
*/
|
|
||||||
public function checkBoxControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeCheckBoxControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a radio button for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeRadioButtonControlGroup
|
|
||||||
*/
|
|
||||||
public function radioButtonControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeRadioButtonControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a drop down list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeDropDownListControlGroup
|
|
||||||
*/
|
|
||||||
public function dropDownListControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeDropDownListControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a list box for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeListBoxControlGroup
|
|
||||||
*/
|
|
||||||
public function listBoxControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeListBoxControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a file field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeFileFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function fileFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeFileFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a radio button list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeRadioButtonListControlGroup
|
|
||||||
*/
|
|
||||||
public function radioButtonListControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeRadioButtonListControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with an inline radio button list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeInlineCheckBoxListControlGroup
|
|
||||||
*/
|
|
||||||
public function inlineRadioButtonListControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeInlineRadioButtonListControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a check box list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeCheckBoxListControlGroup
|
|
||||||
*/
|
|
||||||
public function checkBoxListControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeCheckBoxListControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with an inline check box list for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $data data for generating the list options (value=>display).
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeInlineCheckBoxListControlGroup
|
|
||||||
*/
|
|
||||||
public function inlineCheckBoxListControlGroup($model, $attribute, $data, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeInlineCheckBoxListControlGroup($model, $attribute, $data, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with an uneditable field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeUneditableFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function uneditableFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeUneditableFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a control group with a search field for a model attribute.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions additional HTML attributes.
|
|
||||||
* @return string the generated row.
|
|
||||||
* @see TbHtml::activeSearchFieldControlGroup
|
|
||||||
*/
|
|
||||||
public function searchFieldControlGroup($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
|
|
||||||
return TbHtml::activeSearchFieldControlGroup($model, $attribute, $htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Processes the options for a input row.
|
|
||||||
* @param CModel $model the data model.
|
|
||||||
* @param string $attribute the attribute name.
|
|
||||||
* @param array $htmlOptions the options.
|
|
||||||
* @return array the processed options.
|
|
||||||
*/
|
|
||||||
protected function processRowOptions($model, $attribute, $options)
|
|
||||||
{
|
|
||||||
$errorOptions = TbHtml::popOption('errorOptions', $options, array());
|
|
||||||
$error = $this->error($model, $attribute, $errorOptions);
|
|
||||||
if ($model->hasErrors($attribute))
|
|
||||||
{
|
|
||||||
var_dump($error);
|
|
||||||
$options['error'] = $error;
|
|
||||||
$options['color'] = TbHtml::INPUT_COLOR_ERROR;
|
|
||||||
}
|
|
||||||
$helpOptions = TbHtml::popOption('helpOptions', $options, array());
|
|
||||||
$helpOptions['type'] = $this->helpType;
|
|
||||||
$options['helpOptions'] = $helpOptions;
|
|
||||||
return $options;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbAffix class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap affix widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#affix
|
|
||||||
*/
|
|
||||||
class TbAffix extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the HTML tag for the container.
|
|
||||||
*/
|
|
||||||
public $tagName = 'div';
|
|
||||||
/**
|
|
||||||
* @var mixed pixels to offset from screen when calculating position of scroll.
|
|
||||||
*/
|
|
||||||
public $offset;
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the container.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
$this->htmlOptions['data-spy'] = 'affix';
|
|
||||||
if (isset($this->offset))
|
|
||||||
{
|
|
||||||
if (is_string($this->offset))
|
|
||||||
$this->offset = array('top', $this->offset);
|
|
||||||
|
|
||||||
if (is_array($this->offset) && count($this->offset) === 2)
|
|
||||||
{
|
|
||||||
list($position, $offset) = $this->offset;
|
|
||||||
if (!empty($position))
|
|
||||||
$this->options = TbHtml::defaultOption('data-offset-' . $position, $offset, $this->options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo TbHtml::openTag($this->tagName, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
echo CHtml::closeTag($this->tagName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbAlert class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap alert widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#alerts
|
|
||||||
*/
|
|
||||||
class TbAlert extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var array the alerts configurations (style=>config).
|
|
||||||
*/
|
|
||||||
public $alerts;
|
|
||||||
/**
|
|
||||||
* @var string|boolean the close link text. If this is set false, no close link will be displayed.
|
|
||||||
*/
|
|
||||||
public $closeText = TbHtml::CLOSE_TEXT;
|
|
||||||
/**
|
|
||||||
* @var boolean indicates whether the alert should be an alert block. Defaults to 'true'.
|
|
||||||
*/
|
|
||||||
public $block = true;
|
|
||||||
/**
|
|
||||||
* @var boolean indicates whether alerts should use transitions. Defaults to 'true'.
|
|
||||||
*/
|
|
||||||
public $fade = true;
|
|
||||||
/**
|
|
||||||
* @var string[] the JavaScript event configuration (name=>handler).
|
|
||||||
*/
|
|
||||||
public $events = array();
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the alert container.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
if (is_string($this->alerts))
|
|
||||||
$styles = explode(' ', $this->alerts);
|
|
||||||
else if (!isset($this->alerts))
|
|
||||||
{
|
|
||||||
$styles = array(
|
|
||||||
TbHtml::ALERT_COLOR_SUCCESS,
|
|
||||||
TbHtml::ALERT_COLOR_WARNING,
|
|
||||||
TbHtml::ALERT_COLOR_INFO,
|
|
||||||
TbHtml::ALERT_COLOR_ERROR
|
|
||||||
); // render all styles by default
|
|
||||||
}
|
|
||||||
if (isset($styles))
|
|
||||||
{
|
|
||||||
$this->alerts = array();
|
|
||||||
foreach ($styles as $style)
|
|
||||||
$this->alerts[$style] = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
/* @var $user CWebUser */
|
|
||||||
$user = Yii::app()->getUser();
|
|
||||||
echo TbHtml::openTag('div', $this->htmlOptions);
|
|
||||||
foreach ($this->alerts as $style => $alert)
|
|
||||||
{
|
|
||||||
if (isset($alert['visible']) && !$alert['visible'])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ($user->hasFlash($style))
|
|
||||||
{
|
|
||||||
$htmlOptions = TbHtml::popOption('htmlOptions', $alert, array());
|
|
||||||
$htmlOptions = TbHtml::defaultOption('closeText', $this->closeText, $htmlOptions);
|
|
||||||
$htmlOptions = TbHtml::defaultOption('block', $this->block, $htmlOptions);
|
|
||||||
$htmlOptions = TbHtml::defaultOption('fade', $this->fade, $htmlOptions);
|
|
||||||
echo TbHtml::alert($style, $user->getFlash($style), $htmlOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo '</div>';
|
|
||||||
$this->registerEvents("#{$this->htmlOptions['id']} > .alert", $this->events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbBreadcrumbs class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap breadcrumb widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/components.html#breadcrumbs
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
class TbBreadcrumb extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the divider between links in the breadcrumbs.
|
|
||||||
*/
|
|
||||||
public $divider = '/';
|
|
||||||
/**
|
|
||||||
* @var boolean whether to HTML encode the link labels.
|
|
||||||
*/
|
|
||||||
public $encodeLabel = true;
|
|
||||||
/**
|
|
||||||
* @var string the label for the first link in the breadcrumb.
|
|
||||||
*/
|
|
||||||
public $homeLabel;
|
|
||||||
/**
|
|
||||||
* @var array the url for the first link in the breadcrumb
|
|
||||||
*/
|
|
||||||
public $homeUrl;
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the breadcrumbs.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
/**
|
|
||||||
* @var array list of links to appear in the breadcrumbs.
|
|
||||||
*/
|
|
||||||
public $links = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('divider', $this->divider, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
// todo: consider adding control property for displaying breadcrumbs even when empty.
|
|
||||||
if (!empty($this->links))
|
|
||||||
{
|
|
||||||
$links = array();
|
|
||||||
if ($this->homeLabel !== false)
|
|
||||||
{
|
|
||||||
$label = $this->homeLabel !== null ? $this->homeLabel : TbHtml::icon('home');
|
|
||||||
$links[$label] = $this->homeUrl !== null ? $this->homeUrl : Yii::app()->homeUrl;
|
|
||||||
}
|
|
||||||
foreach ($this->links as $label => $url)
|
|
||||||
{
|
|
||||||
if (is_string($label))
|
|
||||||
{
|
|
||||||
if ($this->encodeLabel)
|
|
||||||
$label = CHtml::encode($label);
|
|
||||||
$links[$label] = $url;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$links[] = $this->encodeLabel ? CHtml::encode($url) : $url;
|
|
||||||
}
|
|
||||||
echo TbHtml::breadcrumbs($links, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbButtonColumn class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @author Christoffer Niska <ChristofferNiska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('zii.widgets.grid.CButtonColumn');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap button column widget.
|
|
||||||
* Used to set buttons to use Glyphicons instead of the defaults images.
|
|
||||||
*/
|
|
||||||
class TbButtonColumn extends CButtonColumn
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the view button icon (defaults to TbHtml::ICON_EYE_OPEN).
|
|
||||||
*/
|
|
||||||
public $viewButtonIcon = TbHtml::ICON_EYE_OPEN;
|
|
||||||
/**
|
|
||||||
* @var string the update button icon (defaults to TbHtml::ICON_PENCIL).
|
|
||||||
*/
|
|
||||||
public $updateButtonIcon = TbHtml::ICON_PENCIL;
|
|
||||||
/**
|
|
||||||
* @var string the delete button icon (defaults to TbHtml::ICON_TRASH).
|
|
||||||
*/
|
|
||||||
public $deleteButtonIcon = TbHtml::ICON_TRASH;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the default buttons (view, update and delete).
|
|
||||||
*/
|
|
||||||
protected function initDefaultButtons()
|
|
||||||
{
|
|
||||||
parent::initDefaultButtons();
|
|
||||||
|
|
||||||
if ($this->viewButtonIcon !== false && !isset($this->buttons['view']['icon']))
|
|
||||||
$this->buttons['view']['icon'] = $this->viewButtonIcon;
|
|
||||||
if ($this->updateButtonIcon !== false && !isset($this->buttons['update']['icon']))
|
|
||||||
$this->buttons['update']['icon'] = $this->updateButtonIcon;
|
|
||||||
if ($this->deleteButtonIcon !== false && !isset($this->buttons['delete']['icon']))
|
|
||||||
$this->buttons['delete']['icon'] = $this->deleteButtonIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a link button.
|
|
||||||
* @param string $id the ID of the button
|
|
||||||
* @param array $button the button configuration which may contain 'label', 'url', 'imageUrl' and 'options' elements.
|
|
||||||
* @param integer $row the row number (zero-based)
|
|
||||||
* @param mixed $data the data object associated with the row
|
|
||||||
*/
|
|
||||||
protected function renderButton($id, $button, $row, $data)
|
|
||||||
{
|
|
||||||
if (isset($button['visible']) && !$this->evaluateExpression($button['visible'], array('row' => $row, 'data' => $data)))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$url = TbHtml::popOption('url', $button, '#');
|
|
||||||
if(strcmp($url, '#') !== 0)
|
|
||||||
$url = $this->evaluateExpression($url, array('data' => $data, 'row' => $row));
|
|
||||||
|
|
||||||
$imageUrl = TbHtml::popOption('imageUrl', $button, false);
|
|
||||||
$label = TbHtml::popOption('label', $button, $id);
|
|
||||||
$options = TbHtml::popOption('options', $button, array());
|
|
||||||
|
|
||||||
$options = TbHtml::defaultOption('title', $label, $options);
|
|
||||||
$options = TbHtml::defaultOption('rel', 'tooltip', $options);
|
|
||||||
|
|
||||||
if ($icon = TbHtml::popOption('icon', $button, false ))
|
|
||||||
{
|
|
||||||
/* todo: not sure if we require this anymore */
|
|
||||||
if (strpos($icon, 'icon') === false)
|
|
||||||
$icon = 'icon-' . implode(' icon-', explode(' ', $icon));
|
|
||||||
|
|
||||||
echo CHtml::link('<i class="' . $icon. '"></i>', $url, $options);
|
|
||||||
|
|
||||||
} else if ($imageUrl && is_string($imageUrl))
|
|
||||||
echo CHtml::link(CHtml::image($imageUrl, $label), $url, $options);
|
|
||||||
else
|
|
||||||
echo CHtml::link($label, $url, $options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbCollapse class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap collapse widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#collapse
|
|
||||||
*/
|
|
||||||
class TbCollapse extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the HTML tag for the container.
|
|
||||||
*/
|
|
||||||
public $tagName = 'div';
|
|
||||||
/**
|
|
||||||
* @var string the content text or path to a partial view with the content.
|
|
||||||
*/
|
|
||||||
public $content;
|
|
||||||
/**
|
|
||||||
* @var string the CSS selector for the parent element.
|
|
||||||
*/
|
|
||||||
public $parent;
|
|
||||||
/**
|
|
||||||
* @var boolean whether to be collapsed on invocation.
|
|
||||||
*/
|
|
||||||
public $toggle;
|
|
||||||
/**
|
|
||||||
* @var string[] $events the JavaScript event configuration (name=>handler).
|
|
||||||
*/
|
|
||||||
public $events = array();
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the container.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
/**
|
|
||||||
* @var array additional data to be passed to the view.
|
|
||||||
*/
|
|
||||||
public $viewData = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('collapse', $this->htmlOptions);
|
|
||||||
$this->htmlOptions['data-toggle'] = 'collapse';
|
|
||||||
if (isset($this->parent))
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('data-parent', $this->parent, $this->htmlOptions);
|
|
||||||
if (isset($this->toggle) && $this->toggle)
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('in', $this->htmlOptions);
|
|
||||||
$controller = $this->getController();
|
|
||||||
if (isset($controller) && $controller->getViewFile($this->content) !== false)
|
|
||||||
$this->content = $this->controller->renderPartial($this->content, $this->viewData, true);
|
|
||||||
echo TbHtml::openTag($this->tagName, $this->htmlOptions);
|
|
||||||
echo $this->content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
echo CHtml::closeTag($this->tagName);
|
|
||||||
$selector = '#' . $this->htmlOptions['id'];
|
|
||||||
$this->registerEvents($selector, $this->events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,93 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbDataColumn class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @author Christoffer Niska <ChristofferNiska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('zii.widgets.grid.CDataColumn');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap grid data column.
|
|
||||||
*/
|
|
||||||
class TbDataColumn extends CDataColumn
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var array HTML options for filter input
|
|
||||||
* @link {TbDataColumn::renderFilterCellContent()}
|
|
||||||
*/
|
|
||||||
public $filterInputOptions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the header cell content.
|
|
||||||
* This method will render a link that can trigger the sorting if the column is sortable.
|
|
||||||
*/
|
|
||||||
protected function renderHeaderCellContent()
|
|
||||||
{
|
|
||||||
if ($this->grid->enableSorting && $this->sortable && $this->name !== null)
|
|
||||||
{
|
|
||||||
$sort = $this->grid->dataProvider->getSort();
|
|
||||||
$label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
|
|
||||||
|
|
||||||
if ($sort->resolveAttribute($this->name) !== false)
|
|
||||||
$label .= '<span class="caret"></span>';
|
|
||||||
|
|
||||||
echo $sort->link($this->name, $label, array('class'=>'sort-link'));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($this->name !== null && $this->header === null)
|
|
||||||
{
|
|
||||||
if ($this->grid->dataProvider instanceof CActiveDataProvider)
|
|
||||||
echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
|
|
||||||
else
|
|
||||||
echo CHtml::encode($this->name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
parent::renderHeaderCellContent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the filter cell.
|
|
||||||
*/
|
|
||||||
public function renderFilterCell()
|
|
||||||
{
|
|
||||||
echo CHtml::openTag('td',$this->filterHtmlOptions);
|
|
||||||
echo '<div class="filter-container">';
|
|
||||||
$this->renderFilterCellContent();
|
|
||||||
echo '</div>';
|
|
||||||
echo CHtml::closeTag('td');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the filter cell content. Here we can provide HTML options for actual filter input
|
|
||||||
*/
|
|
||||||
protected function renderFilterCellContent()
|
|
||||||
{
|
|
||||||
if(is_string($this->filter))
|
|
||||||
echo $this->filter;
|
|
||||||
else if($this->filter!==false && $this->grid->filter!==null && $this->name!==null && strpos($this->name,'.')===false)
|
|
||||||
{
|
|
||||||
if($this->filterInputOptions) {
|
|
||||||
$filterInputOptions = $this->filterInputOptions;
|
|
||||||
if(empty($filterInputOptions['id'])) {
|
|
||||||
$filterInputOptions['id'] = false;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
$filterInputOptions=array();
|
|
||||||
if(is_array($this->filter)) {
|
|
||||||
$filterInputOptions['prompt'] = '';
|
|
||||||
echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, $filterInputOptions);
|
|
||||||
} else if($this->filter===null) {
|
|
||||||
echo CHtml::activeTextField($this->grid->filter, $this->name, $filterInputOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
parent::renderFilterCellContent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbGridView class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @author Christoffer Niska <ChristofferNiska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('zii.widgets.grid.CGridView');
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('bootstrap.widgets.TbDataColumn');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap Zii grid view.
|
|
||||||
*/
|
|
||||||
class TbGridView extends CGridView
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string|array the table style.
|
|
||||||
* Valid values are TbHtml::GRID_STRIPED, TbHtml::GRID_BORDERED, TbHtml::GRID_CONDENSED and/or TbHtml::GRID_HOVER.
|
|
||||||
*/
|
|
||||||
public $type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string the CSS class name for the pager container. Defaults to 'pagination'.
|
|
||||||
*/
|
|
||||||
public $pagerCssClass = 'pagination';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the configuration for the pager.
|
|
||||||
* Defaults to <code>array('class'=>'ext.bootstrap.widgets.TbPager')</code>.
|
|
||||||
*/
|
|
||||||
public $pager = array('class' => 'bootstrap.widgets.TbPager');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string the URL of the CSS file used by this grid view.
|
|
||||||
* Defaults to false, meaning that no CSS will be included.
|
|
||||||
*/
|
|
||||||
public $cssFile = false;
|
|
||||||
/**
|
|
||||||
* @var string the template to be used to control the layout of various sections in the view.
|
|
||||||
*/
|
|
||||||
public $template = "{items}\n<div class=\"row-fluid\"><div class=\"span6\">{pager}</div><div class=\"span6\">{summary}</div></div>";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
parent::init();
|
|
||||||
$classes = array('table');
|
|
||||||
if (isset($this->type) && !empty($this->type))
|
|
||||||
{
|
|
||||||
if (is_string($this->type))
|
|
||||||
$this->type = explode(' ', $this->type);
|
|
||||||
|
|
||||||
foreach ($this->type as $type)
|
|
||||||
$classes[] = 'table-' . $type;
|
|
||||||
}
|
|
||||||
$this->itemsCssClass = implode(' ', $classes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates column objects and initializes them.
|
|
||||||
*/
|
|
||||||
protected function initColumns()
|
|
||||||
{
|
|
||||||
foreach ($this->columns as $i => $column)
|
|
||||||
{
|
|
||||||
if (is_array($column) && !isset($column['class']))
|
|
||||||
$this->columns[$i]['class'] = 'bootstrap.widgets.TbDataColumn';
|
|
||||||
}
|
|
||||||
parent::initColumns();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a column based on a shortcut column specification string.
|
|
||||||
* @param mixed $text the column specification string
|
|
||||||
* @return \TbDataColumn|\CDataColumn the column instance
|
|
||||||
* @throws CException if the column format is incorrect
|
|
||||||
*/
|
|
||||||
protected function createDataColumn($text)
|
|
||||||
{
|
|
||||||
if (!preg_match('/^([\w\.]+)(:(\w*))?(:(.*))?$/', $text, $matches))
|
|
||||||
throw new CException(Yii::t('zii', 'The column must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional.'));
|
|
||||||
$column = new TbDataColumn($this);
|
|
||||||
$column->name = $matches[1];
|
|
||||||
if (isset($matches[3]) && $matches[3] !== '')
|
|
||||||
$column->type = $matches[3];
|
|
||||||
if (isset($matches[5]))
|
|
||||||
$column->header = $matches[5];
|
|
||||||
return $column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbHeroUnit class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap hero unit widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#affix
|
|
||||||
*/
|
|
||||||
class TbHeroUnit extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the heading text.
|
|
||||||
*/
|
|
||||||
public $heading;
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the heading.
|
|
||||||
*/
|
|
||||||
public $headingOptions = array();
|
|
||||||
/**
|
|
||||||
* @var string the content text or path to a partial view with the content.
|
|
||||||
*/
|
|
||||||
public $content;
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the container tag.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
/**
|
|
||||||
* @var array additional data to be passed to the view.
|
|
||||||
*/
|
|
||||||
public $viewData = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$controller = $this->getController();
|
|
||||||
if (isset($controller) && $controller->getViewFile($this->content) !== false)
|
|
||||||
$this->content = $this->controller->renderPartial($this->content, $this->viewData, true);
|
|
||||||
$this->htmlOptions['headingOptions'] = $this->headingOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
echo TbHtml::heroUnit($this->heading, $this->content, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbListView class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('zii.widgets.CListView');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap Zii list view.
|
|
||||||
*/
|
|
||||||
class TbListView extends CListView
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the CSS class name for the pager container. Defaults to 'pagination'.
|
|
||||||
*/
|
|
||||||
public $pagerCssClass = '';
|
|
||||||
/**
|
|
||||||
* @var array the configuration for the pager.
|
|
||||||
* Defaults to <code>array('class'=>'ext.bootstrap.widgets.TbPager')</code>.
|
|
||||||
*/
|
|
||||||
public $pager = array('class'=>'bootstrap.widgets.TbPager');
|
|
||||||
/**
|
|
||||||
* @var string the URL of the CSS file used by this detail view.
|
|
||||||
* Defaults to false, meaning that no CSS will be included.
|
|
||||||
*/
|
|
||||||
public $cssFile = false;
|
|
||||||
/**
|
|
||||||
* @var string the template to be used to control the layout of various sections in the view.
|
|
||||||
*/
|
|
||||||
public $template = "{items}\n<div class=\"row-fluid\"><div class=\"span6\">{pager}</div><div class=\"span6\">{summary}</div></div>";
|
|
||||||
}
|
|
||||||
@ -1,263 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbModal class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class TbModal
|
|
||||||
*/
|
|
||||||
class TbModal extends CWidget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the HTML options for the view container tag.
|
|
||||||
*/
|
|
||||||
public $htmlOptions=array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array The additional HTML attributes of the button that will show the modal. If empty array, only
|
|
||||||
* the markup of the modal will be rendered on the page, so users can easily call the modal manually with their own
|
|
||||||
* scripts. The following special attributes are available:
|
|
||||||
* <ul>
|
|
||||||
* <li>label: string, the label of the button</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* For available options of the button trigger, see http://twitter.github.com/bootstrap/javascript.html#modals.
|
|
||||||
*/
|
|
||||||
public $buttonOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var boolean indicates whether the modal should use transitions. Defaults to 'true'.
|
|
||||||
*/
|
|
||||||
public $fade = true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool $keyboard, closes the modal when escape key is pressed.
|
|
||||||
*/
|
|
||||||
public $keyboard = true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool $show, shows the modal when initialized.
|
|
||||||
*/
|
|
||||||
public $show = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var mixed includes a modal-backdrop element. Alternatively, specify `static` for a backdrop which doesn't close
|
|
||||||
* the modal on click.
|
|
||||||
*/
|
|
||||||
public $backdrop = true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var mixed the remote url. If a remote url is provided, content will be loaded via jQuery's load method and
|
|
||||||
* injected into the .modal-body of the modal.
|
|
||||||
*/
|
|
||||||
public $remote;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that will be invoked immediately when the `show` instance method is called.
|
|
||||||
*/
|
|
||||||
public $onShow;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that will be invoked when the modal has been made visible to the user
|
|
||||||
* (will wait for css transitions to complete).
|
|
||||||
*/
|
|
||||||
public $onShown;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that will be invoked immediately when the hide instance method has been called.
|
|
||||||
*/
|
|
||||||
public $onHide;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that will be invoked when the modal has finished being hidden from the user
|
|
||||||
* (will wait for css transitions to complete).
|
|
||||||
*/
|
|
||||||
public $onHidden;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] the Javascript event handlers.
|
|
||||||
*/
|
|
||||||
protected $events = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $options the plugin options.
|
|
||||||
*/
|
|
||||||
protected $options = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
public $closeText = TbHtml::CLOSE_TEXT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string header content
|
|
||||||
*/
|
|
||||||
public $header;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string body of modal
|
|
||||||
*/
|
|
||||||
public $content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string footer content
|
|
||||||
*/
|
|
||||||
public $footer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's initialization method
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('id', $this->getId(), $this->htmlOptions);
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('role', 'dialog', $this->htmlOptions);
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('tabindex', '-1', $this->htmlOptions);
|
|
||||||
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('modal hide', $this->htmlOptions);
|
|
||||||
if($this->fade)
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('fade', $this->htmlOptions);
|
|
||||||
|
|
||||||
$this->initOptions();
|
|
||||||
$this->initEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize events if any
|
|
||||||
*/
|
|
||||||
public function initEvents()
|
|
||||||
{
|
|
||||||
foreach (array('onShow', 'onShown', 'onHide', 'onHidden') as $event)
|
|
||||||
{
|
|
||||||
if ($this->$event !== null)
|
|
||||||
{
|
|
||||||
$modalEvent = strtolower(substr($event, 2));
|
|
||||||
if ($this->$event instanceof CJavaScriptExpression)
|
|
||||||
{
|
|
||||||
$this->events[$modalEvent] = $this->$event;
|
|
||||||
} else {
|
|
||||||
$this->events[$modalEvent] = new CJavaScriptExpression($this->$event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize plugin options.
|
|
||||||
* ***Important***: The display of the button overrides the initialization of the modal bootstrap widget.
|
|
||||||
*/
|
|
||||||
public function initOptions()
|
|
||||||
{
|
|
||||||
if($remote = TbHtml::popOption('remote', $this->options))
|
|
||||||
$this->options['remote'] = CHtml::normalizeUrl($remote);
|
|
||||||
|
|
||||||
$this->options = TbHtml::defaultOption('backdrop', $this->backdrop, $this->options);
|
|
||||||
$this->options = TbHtml::defaultOption('keyboard', $this->keyboard, $this->options);
|
|
||||||
$this->options = TbHtml::defaultOption('show', $this->show, $this->options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's run method
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
$this->renderModal();
|
|
||||||
$this->renderButton();
|
|
||||||
$this->registerClientScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the button
|
|
||||||
*/
|
|
||||||
public function renderButton()
|
|
||||||
{
|
|
||||||
if(!empty($this->buttonOptions) && is_array($this->buttonOptions))
|
|
||||||
{
|
|
||||||
$this->buttonOptions = TbHtml::defaultOption('data-toggle', 'modal', $this->buttonOptions);
|
|
||||||
|
|
||||||
if($this->remote !== null)
|
|
||||||
$this->buttonOptions = TbHtml::defaultOption('data-remote', CHtml::normalizeUrl($this->remote), $this->buttonOptions);
|
|
||||||
|
|
||||||
$selector = '#' . $this->htmlOptions['id'];
|
|
||||||
|
|
||||||
$label = TbHtml::popOption('label', $this->buttonOptions, 'button');
|
|
||||||
|
|
||||||
$attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href';
|
|
||||||
|
|
||||||
$this->buttonOptions = TbHtml::defaultOption($attr, $selector, $this->buttonOptions);
|
|
||||||
|
|
||||||
echo TbHtml::button($label, $this->buttonOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the modal markup
|
|
||||||
*/
|
|
||||||
public function renderModal()
|
|
||||||
{
|
|
||||||
echo TbHtml::openTag('div', $this->htmlOptions) . PHP_EOL;
|
|
||||||
|
|
||||||
$this->renderModalHeader();
|
|
||||||
$this->renderModalBody();
|
|
||||||
$this->renderModalFooter();
|
|
||||||
|
|
||||||
echo '</div>' . PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the header HTML markup of the modal
|
|
||||||
*/
|
|
||||||
public function renderModalHeader()
|
|
||||||
{
|
|
||||||
echo '<div class="modal-header">' . PHP_EOL;
|
|
||||||
if($this->closeText)
|
|
||||||
echo TbHtml::closeButton($this->closeText, array('data-dismiss'=>'modal'));
|
|
||||||
echo $this->header;
|
|
||||||
echo '</div>' . PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the HTML markup for the body of the modal
|
|
||||||
*/
|
|
||||||
public function renderModalBody()
|
|
||||||
{
|
|
||||||
echo '<div class="modal-body">' . PHP_EOL;
|
|
||||||
echo $this->content;
|
|
||||||
echo '</div>' . PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the HTML markup for the footer of the modal
|
|
||||||
*/
|
|
||||||
public function renderModalFooter()
|
|
||||||
{
|
|
||||||
|
|
||||||
echo '<div class="modal-footer">' . PHP_EOL;
|
|
||||||
echo $this->footer;
|
|
||||||
echo '</div>' . PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers necessary client scripts.
|
|
||||||
*/
|
|
||||||
public function registerClientScript()
|
|
||||||
{
|
|
||||||
$selector = '#' . $this->htmlOptions['id'];
|
|
||||||
|
|
||||||
// do we render a button? If so, bootstrap will handle its behavior through its
|
|
||||||
// mark-up, otherwise, register the plugin.
|
|
||||||
if(empty($this->buttonOptions))
|
|
||||||
$this->registerPlugin(TbApi::PLUGIN_MODAL, $selector, $this->options);
|
|
||||||
|
|
||||||
$this->registerEvents($selector, $this->events);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,174 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbNav class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap navigation menu widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/components.html#navbar
|
|
||||||
*/
|
|
||||||
class TbNav extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the menu type.
|
|
||||||
*/
|
|
||||||
public $type;
|
|
||||||
/**
|
|
||||||
* @var boolean whether the menu items should be stacked on top of each other.
|
|
||||||
*/
|
|
||||||
public $stacked = false;
|
|
||||||
/**
|
|
||||||
* @var string|array the scrollspy target or configuration.
|
|
||||||
*/
|
|
||||||
public $scrollspy;
|
|
||||||
/**
|
|
||||||
* @var array list of menu items. Each menu item is specified as an array of name-value pairs.
|
|
||||||
*/
|
|
||||||
public $items = array();
|
|
||||||
/**
|
|
||||||
* @var boolean whether the labels for menu items should be HTML-encoded. Defaults to true.
|
|
||||||
*/
|
|
||||||
public $encodeLabel = true;
|
|
||||||
/**
|
|
||||||
* @var boolean whether to automatically activate items according to whether their route setting
|
|
||||||
* matches the currently requested route. Defaults to true.
|
|
||||||
*/
|
|
||||||
public $activateItems = true;
|
|
||||||
/**
|
|
||||||
* @var boolean whether to activate parent menu items when one of the corresponding child menu items is active.
|
|
||||||
*/
|
|
||||||
public $activateParents = false;
|
|
||||||
/**
|
|
||||||
* @var boolean whether to hide empty menu items.
|
|
||||||
*/
|
|
||||||
public $hideEmptyItems = true;
|
|
||||||
/**
|
|
||||||
* @var array HTML attributes for the menu's root container tag.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
// todo: consider supporting these.
|
|
||||||
//public $submenuHtmlOptions = array();
|
|
||||||
//public $linkLabelWrapper;
|
|
||||||
//public $linkLabelWrapperHtmlOptions=array();
|
|
||||||
//public $itemCssClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
$route = $this->controller->getRoute();
|
|
||||||
if ($this->stacked)
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('nav-stacked', $this->htmlOptions);
|
|
||||||
if (isset($this->scrollspy))
|
|
||||||
{
|
|
||||||
if (is_string($this->scrollspy))
|
|
||||||
$this->scrollspy = array('target'=>$this->scrollspy);
|
|
||||||
$this->widget('bootstrap.widgets.TbScrollspy', $this->scrollspy);
|
|
||||||
}
|
|
||||||
$this->items = $this->normalizeItems($this->items, $route, $hasActiveChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
if (!empty($this->items))
|
|
||||||
echo TbHtml::nav($this->type, $this->items, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Normalizes the menu items.
|
|
||||||
* @param array $items the items to be normalized.
|
|
||||||
* @param string $route the route of the current request.
|
|
||||||
* @param boolean $active whether there is an active child menu item.
|
|
||||||
* @return array the normalized menu items.
|
|
||||||
*/
|
|
||||||
protected function normalizeItems($items, $route, &$active)
|
|
||||||
{
|
|
||||||
foreach ($items as $i => $item)
|
|
||||||
{
|
|
||||||
// skip dividers
|
|
||||||
if (is_string($item))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (isset($item['visible']) && !$item['visible'])
|
|
||||||
{
|
|
||||||
unset($items[$i]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = TbHtml::defaultOption('label', '', $item);
|
|
||||||
|
|
||||||
if ($this->encodeLabel)
|
|
||||||
$items[$i]['label'] = CHtml::encode($item['label']);
|
|
||||||
|
|
||||||
if (!isset($item['url']) && !isset($item['items']))
|
|
||||||
$items[$i]['header'] = true;
|
|
||||||
|
|
||||||
$hasActiveChild = false;
|
|
||||||
|
|
||||||
if (isset($item['items']) && !empty($item['items']))
|
|
||||||
{
|
|
||||||
$items[$i]['items'] = $this->normalizeItems($item['items'], $route, $hasActiveChild);
|
|
||||||
|
|
||||||
if (empty($items[$i]['items']) && $this->hideEmptyItems)
|
|
||||||
{
|
|
||||||
unset($items[$i]['items']);
|
|
||||||
if (!isset($item['url']))
|
|
||||||
{
|
|
||||||
unset($items[$i]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($item['active']))
|
|
||||||
{
|
|
||||||
if ($this->activateParents && $hasActiveChild || $this->activateItems && $this->isItemActive($item, $route))
|
|
||||||
$active = $items[$i]['active'] = true;
|
|
||||||
else
|
|
||||||
$items[$i]['active'] = false;
|
|
||||||
}
|
|
||||||
else if ($item['active'])
|
|
||||||
$active = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_values($items);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether a menu item is active.
|
|
||||||
* @param array $item the menu item to be checked.
|
|
||||||
* @param string $route the route of the current request.
|
|
||||||
* @return boolean whether the menu item is active.
|
|
||||||
*/
|
|
||||||
protected function isItemActive($item, $route)
|
|
||||||
{
|
|
||||||
if (isset($item['url']) && is_array($item['url']) && !strcasecmp(trim($item['url'][0], '/'), $route))
|
|
||||||
{
|
|
||||||
unset($item['url']['#']);
|
|
||||||
if (count($item['url']) > 1)
|
|
||||||
{
|
|
||||||
foreach (array_splice($item['url'], 1) as $name => $value)
|
|
||||||
{
|
|
||||||
if (!isset($_GET[$name]) || $_GET[$name] != $value)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbNavbar class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap navbar widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/components.html#navbar
|
|
||||||
*/
|
|
||||||
class TbNavbar extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the navbar color.
|
|
||||||
*/
|
|
||||||
public $color;
|
|
||||||
/**
|
|
||||||
* @var string the brand label text.
|
|
||||||
*/
|
|
||||||
public $brandLabel;
|
|
||||||
/**
|
|
||||||
* @var mixed the brand url.
|
|
||||||
*/
|
|
||||||
public $brandUrl;
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the brand link.
|
|
||||||
*/
|
|
||||||
public $brandOptions = array();
|
|
||||||
/**
|
|
||||||
* @var string nanvbar display type.
|
|
||||||
*/
|
|
||||||
public $display = TbHtml::NAVBAR_DISPLAY_FIXEDTOP;
|
|
||||||
/**
|
|
||||||
* @var boolean whether the navbar spans over the whole page.
|
|
||||||
*/
|
|
||||||
public $fluid = false;
|
|
||||||
/**
|
|
||||||
* @var boolean whether to enable collapsing of the navbar on narrow screens.
|
|
||||||
*/
|
|
||||||
public $collapse = false;
|
|
||||||
/**
|
|
||||||
* @var array additional HTML attributes for the collapse widget.
|
|
||||||
*/
|
|
||||||
public $collapseOptions = array();
|
|
||||||
/**
|
|
||||||
* @var array list of navbar item.
|
|
||||||
*/
|
|
||||||
public $items = array();
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the navbar.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
if ($this->brandLabel !== false)
|
|
||||||
{
|
|
||||||
if (!isset($this->brandLabel))
|
|
||||||
$this->brandLabel = CHtml::encode(Yii::app()->name);
|
|
||||||
|
|
||||||
if (!isset($this->brandUrl))
|
|
||||||
$this->brandUrl = Yii::app()->homeUrl;
|
|
||||||
}
|
|
||||||
if (isset($this->color))
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('color', $this->color, $this->htmlOptions);
|
|
||||||
if (isset($this->display) && $this->display !== TbHtml::NAVBAR_DISPLAY_NONE)
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('display', $this->display, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
$brand = $this->brandLabel !== false
|
|
||||||
? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions)
|
|
||||||
: '';
|
|
||||||
ob_start();
|
|
||||||
foreach ($this->items as $item)
|
|
||||||
{
|
|
||||||
if (is_string($item))
|
|
||||||
echo $item;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$widgetClassName = TbHtml::popOption('class', $item);
|
|
||||||
if ($widgetClassName !== null)
|
|
||||||
$this->controller->widget($widgetClassName, $item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$items = ob_get_clean();
|
|
||||||
ob_start();
|
|
||||||
if ($this->collapse !== false)
|
|
||||||
{
|
|
||||||
$this->collapseOptions = TbHtml::addClassName('nav-collapse', $this->collapseOptions);
|
|
||||||
// todo: fix collapse, currently it cannot be clicked when within a navbar
|
|
||||||
ob_start();
|
|
||||||
/* @var TbCollapse $collapseWidget */
|
|
||||||
$collapseWidget = $this->controller->widget('bootstrap.widgets.TbCollapse', array(
|
|
||||||
'toggle' => false, // navbars are collapsed by default
|
|
||||||
'content' => $items,
|
|
||||||
'htmlOptions' => $this->collapseOptions,
|
|
||||||
));
|
|
||||||
$collapseContent = ob_get_clean();
|
|
||||||
echo TbHtml::collapseIcon('#' . $collapseWidget->getId());
|
|
||||||
echo $brand . $collapseContent;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
echo $brand . $items;
|
|
||||||
$containerContent = ob_get_clean();
|
|
||||||
$containerOptions = TbHtml::popOption('containerOptions', $this->htmlOptions, array());
|
|
||||||
$containerOptions = TbHtml::addClassName($this->fluid ? 'container-fluid' : 'container', $containerOptions);
|
|
||||||
ob_start();
|
|
||||||
echo TbHtml::openTag('div', $containerOptions);
|
|
||||||
echo $containerContent;
|
|
||||||
echo '</div>';
|
|
||||||
$content = ob_get_clean();
|
|
||||||
echo TbHtml::navbar($content, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbPager class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap pager widget.
|
|
||||||
* http://twitter.github.com/bootstrap/components.html#pagination
|
|
||||||
*/
|
|
||||||
class TbPager extends CBasePager
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the pager size.
|
|
||||||
*/
|
|
||||||
public $size;
|
|
||||||
/**
|
|
||||||
* @var integer maximum number of page buttons that can be displayed.
|
|
||||||
*/
|
|
||||||
public $maxButtonCount = 5;
|
|
||||||
/**
|
|
||||||
* @var string the text label for the next page button.
|
|
||||||
*/
|
|
||||||
public $nextPageLabel = '›';
|
|
||||||
/**
|
|
||||||
* @var string the text label for the previous page button.
|
|
||||||
*/
|
|
||||||
public $prevPageLabel = '‹';
|
|
||||||
/**
|
|
||||||
* @var string the text label for the first page button.
|
|
||||||
*/
|
|
||||||
public $firstPageLabel = '«';
|
|
||||||
/**
|
|
||||||
* @var string the text label for the last page button.
|
|
||||||
*/
|
|
||||||
public $lastPageLabel = '»';
|
|
||||||
/**
|
|
||||||
* @var array HTML attributes for the pager container tag.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
if (isset($this->size))
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('size', $this->size, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
$links = $this->createPageLinks();
|
|
||||||
if (!empty($links))
|
|
||||||
echo TbHtml::pagination($links, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the page buttons.
|
|
||||||
* @return array a list of page buttons (in HTML code).
|
|
||||||
*/
|
|
||||||
protected function createPageLinks()
|
|
||||||
{
|
|
||||||
if (($pageCount = $this->getPageCount()) <= 1)
|
|
||||||
return array();
|
|
||||||
|
|
||||||
list($beginPage, $endPage) = $this->getPageRange();
|
|
||||||
|
|
||||||
$currentPage = $this->getCurrentPage(false); // currentPage is calculated in getPageRange()
|
|
||||||
$links = array();
|
|
||||||
|
|
||||||
// first page
|
|
||||||
$links[] = $this->createPageLink($this->firstPageLabel, 0, $currentPage <= 0, false);
|
|
||||||
|
|
||||||
// prev page
|
|
||||||
if (($page = $currentPage - 1) < 0)
|
|
||||||
$page = 0;
|
|
||||||
|
|
||||||
$links[] = $this->createPageLink($this->prevPageLabel, $page, $currentPage <= 0, false);
|
|
||||||
|
|
||||||
// internal pages
|
|
||||||
for ($i = $beginPage; $i <= $endPage; ++$i)
|
|
||||||
$links[] = $this->createPageLink($i + 1, $i, false, $i == $currentPage);
|
|
||||||
|
|
||||||
// next page
|
|
||||||
if (($page = $currentPage + 1) >= $pageCount - 1)
|
|
||||||
$page = $pageCount - 1;
|
|
||||||
|
|
||||||
$links[] = $this->createPageLink($this->nextPageLabel, $page, $currentPage >= $pageCount - 1, false);
|
|
||||||
|
|
||||||
// last page
|
|
||||||
$links[] = $this->createPageLink($this->lastPageLabel, $pageCount - 1, $currentPage >= $pageCount - 1, false);
|
|
||||||
|
|
||||||
return $links;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a page link.
|
|
||||||
* @param string $label the link label text.
|
|
||||||
* @param integer $page the page number.
|
|
||||||
* @param boolean $visible whether the link is disabled.
|
|
||||||
* @param boolean $active whether the link is active.
|
|
||||||
* @return string the generated link.
|
|
||||||
*/
|
|
||||||
protected function createPageLink($label, $page, $disabled, $active)
|
|
||||||
{
|
|
||||||
return array(
|
|
||||||
'label' => $label,
|
|
||||||
'url' => $this->createPageUrl($page),
|
|
||||||
'disabled' => $disabled,
|
|
||||||
'active' => $active,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array the begin and end pages that need to be displayed.
|
|
||||||
*/
|
|
||||||
protected function getPageRange()
|
|
||||||
{
|
|
||||||
$currentPage = $this->getCurrentPage();
|
|
||||||
$pageCount = $this->getPageCount();
|
|
||||||
$beginPage = max(0, $currentPage - (int)($this->maxButtonCount / 2));
|
|
||||||
if (($endPage = $beginPage + $this->maxButtonCount - 1) >= $pageCount)
|
|
||||||
{
|
|
||||||
$endPage = $pageCount - 1;
|
|
||||||
$beginPage = max(0, $endPage - $this->maxButtonCount + 1);
|
|
||||||
}
|
|
||||||
return array($beginPage, $endPage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbScrollspy class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap scrollspy widget.
|
|
||||||
* @see http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
|
||||||
*/
|
|
||||||
class TbScrollspy extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the CSS selector for the scrollspy element.
|
|
||||||
*/
|
|
||||||
public $selector = 'body';
|
|
||||||
/**
|
|
||||||
* @var string the CSS selector for the spying element.
|
|
||||||
*/
|
|
||||||
public $target;
|
|
||||||
/**
|
|
||||||
* @var integer the scroll offset (in pixels).
|
|
||||||
*/
|
|
||||||
public $offset;
|
|
||||||
/**
|
|
||||||
* @var string[] $events the JavaScript event configuration (name=>handler).
|
|
||||||
*/
|
|
||||||
public $events = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
// todo: think of a better way of doing this.
|
|
||||||
$script = "jQuery('{$this->selector}').attr('data-spy', 'scroll');";
|
|
||||||
if (isset($this->target))
|
|
||||||
$script .= "jQuery('{$this->selector}').attr('data-target', '{$this->target}');";
|
|
||||||
if (isset($this->offset))
|
|
||||||
$script .= "jQuery('{$this->selector}').attr('data-offset', '{$this->offset}');";
|
|
||||||
Yii::app()->clientScript->registerScript($this->getId(), $script, CClientScript::POS_BEGIN);
|
|
||||||
$this->registerEvents($this->selector, $this->events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,255 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbTabs class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class TbTabs
|
|
||||||
*/
|
|
||||||
class TbTabs extends CWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var array Additional data submitted to the views
|
|
||||||
*/
|
|
||||||
public $viewData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string the type of tabs to display. Defaults to 'tabs'. Valid values are 'tabs' and 'pills'.
|
|
||||||
* Please not that Javascript pills are not fully supported in Bootstrap yet!
|
|
||||||
* @see TbHtml::$navStyles
|
|
||||||
*/
|
|
||||||
public $type = TbHtml::NAV_TYPE_TABS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string the placement of the tabs.
|
|
||||||
* Valid values are TbHtml::TABS_TOP, TbHtml::TABS_RIGHT, TbHtml::TABS_LEFT, TbHtml::TABS_BELOW.
|
|
||||||
* @see TbHtml::tabPlacements
|
|
||||||
*/
|
|
||||||
public $placement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the tab configuration.
|
|
||||||
*/
|
|
||||||
public $tabs = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that This event fires on tab show, but before the new tab has been shown.
|
|
||||||
* Use `event.target` and `event.relatedTarget` to target the active tab and the previous active tab (if available)
|
|
||||||
* respectively.
|
|
||||||
*/
|
|
||||||
public $onShow;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string a javascript function that fires on tab show after a tab has been shown. Use `event.target` and
|
|
||||||
* `event.relatedTarget` to target the active tab and the previous active tab (if available) respectively.
|
|
||||||
*/
|
|
||||||
public $onShown;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the HTML attributes for the widget container.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] the Javascript event handlers.
|
|
||||||
*/
|
|
||||||
protected $events = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the tab menu items.
|
|
||||||
*/
|
|
||||||
protected $menuItems = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the contents of the tabs.
|
|
||||||
*/
|
|
||||||
protected $tabsContent = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's initialization method
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->copyId();
|
|
||||||
if(isset($this->placement))
|
|
||||||
$this->htmlOptions = TbHtml::addClassName('tabs-'.$this->placement, $this->htmlOptions);
|
|
||||||
$this->menuItems = $this->normalizeTabs($this->tabs, $this->tabsContent);
|
|
||||||
$this->initEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize events if any
|
|
||||||
*/
|
|
||||||
public function initEvents()
|
|
||||||
{
|
|
||||||
foreach (array('onShow', 'onShown') as $event)
|
|
||||||
{
|
|
||||||
if ($this->$event !== null)
|
|
||||||
{
|
|
||||||
$modalEvent = strtolower(substr($event, 2));
|
|
||||||
if ($this->$event instanceof CJavaScriptExpression)
|
|
||||||
$this->events[$modalEvent] = $this->$event;
|
|
||||||
else
|
|
||||||
$this->events[$modalEvent] = new CJavaScriptExpression($this->$event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's run method
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
ob_start();
|
|
||||||
$this->renderTabsNavigation();
|
|
||||||
$navigation = ob_get_clean();
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
$this->renderTabsContent();
|
|
||||||
$content = ob_get_clean();
|
|
||||||
|
|
||||||
$this->renderTabs($navigation, $content);
|
|
||||||
|
|
||||||
$this->registerClientScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the
|
|
||||||
* @param string $navigation the menu tabs
|
|
||||||
* @param string $content the tabs contents
|
|
||||||
*/
|
|
||||||
public function renderTabs($navigation, $content)
|
|
||||||
{
|
|
||||||
echo TbHtml::openTag('div', $this->htmlOptions);
|
|
||||||
echo $this->placement === TbHtml::TABS_PLACEMENT_BELOW
|
|
||||||
? $content . $navigation
|
|
||||||
: $navigation . $content;
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders tab navigation
|
|
||||||
*/
|
|
||||||
public function renderTabsNavigation()
|
|
||||||
{
|
|
||||||
$navOptions = TbHtml::popOption('menuOptions', $this->htmlOptions, array());
|
|
||||||
echo TbHtml::nav($this->type, $this->menuItems, $navOptions );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders tabs contents
|
|
||||||
*/
|
|
||||||
public function renderTabsContent()
|
|
||||||
{
|
|
||||||
$contentOptions = TbHtml::popOption('contentOptions', $this->htmlOptions, array());
|
|
||||||
$contentOptions = TbHtml::addClassName('tab-content', $contentOptions);
|
|
||||||
echo TbHtml::openTag('div', $contentOptions );
|
|
||||||
echo implode(' ', $this->tabsContent);
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Normalizes the tab configuration.
|
|
||||||
* @param array $tabs the tab configuration
|
|
||||||
* @param array $panes a reference to the panes array
|
|
||||||
* @param integer $i the current index
|
|
||||||
* @return array the items
|
|
||||||
*/
|
|
||||||
protected function normalizeTabs($tabs, &$panes, &$i = 0)
|
|
||||||
{
|
|
||||||
$id = TbHtml::getOption('id', $this->htmlOptions, $this->getId());
|
|
||||||
$items = array();
|
|
||||||
|
|
||||||
//Check if has an active item
|
|
||||||
$hasActiveItem = false;
|
|
||||||
foreach ($tabs as $tab)
|
|
||||||
{
|
|
||||||
if ($hasActiveItem = TbHtml::getOption('active', $tab, false) === true)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($tabs as $tab)
|
|
||||||
{
|
|
||||||
$item = $tab;
|
|
||||||
|
|
||||||
if (isset($item['visible']) && $item['visible'] === false)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// if no tab should be active, activate first
|
|
||||||
if (!$hasActiveItem && $i == 0)
|
|
||||||
$item['active'] = true;
|
|
||||||
|
|
||||||
// set the label to the title if any
|
|
||||||
if (isset($item['title']))
|
|
||||||
$item['label'] = TbHtml::defaultOption('label', TbHtml::popOption('title', $item), $item);
|
|
||||||
|
|
||||||
$item = TbHtml::defaultOption('itemOptions', array(), $item);
|
|
||||||
|
|
||||||
if (isset($tab['items']))
|
|
||||||
{
|
|
||||||
$item['linkOptions']['data-toggle'] = 'dropdown';
|
|
||||||
$item['items'] = $this->normalizeTabs($item['items'], $panes, $i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$item['linkOptions']['data-toggle'] = 'tab';
|
|
||||||
|
|
||||||
$item = TbHtml::defaultOption('id', $id . '_tab_' . ($i + 1), $item);
|
|
||||||
|
|
||||||
$item['url'] = '#' . $item['id'];
|
|
||||||
|
|
||||||
// no content and we have a view?
|
|
||||||
if (!isset($item['content']) && isset($item['view']))
|
|
||||||
{
|
|
||||||
$view = TbHtml::popOption('view', $item, '');
|
|
||||||
|
|
||||||
$data = TbHtml::popOption('data', $item, array());
|
|
||||||
if (is_array($this->viewData))
|
|
||||||
$data = TbHtml::mergeOptions($this->viewData, $data);
|
|
||||||
|
|
||||||
$process = TbHtml::popOption('processOutput', $item, false);
|
|
||||||
|
|
||||||
$item['content'] = !empty($view)
|
|
||||||
? $this->getController()->renderPartial($view, $data, true, $process)
|
|
||||||
: '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$content = TbHtml::popOption('content', $item, '');
|
|
||||||
$paneOptions = TbHtml::popOption('paneOptions', $item, array());
|
|
||||||
$paneOptions['id'] = TbHtml::popOption('id', $item);
|
|
||||||
|
|
||||||
$classes = array('tab-pane fade');
|
|
||||||
|
|
||||||
if (isset($item['active']) && $item['active'])
|
|
||||||
$classes[] = 'active in';
|
|
||||||
|
|
||||||
$paneOptions = TbHtml::addClassName(implode(' ', $classes), $paneOptions);
|
|
||||||
|
|
||||||
$panes[] = CHtml::tag('div', $paneOptions, $content);
|
|
||||||
|
|
||||||
$i++; // increment the tab-index
|
|
||||||
}
|
|
||||||
|
|
||||||
$items[] = $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $items;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers necessary client scripts.
|
|
||||||
*/
|
|
||||||
public function registerClientScript()
|
|
||||||
{
|
|
||||||
$selector = '#' . $this->htmlOptions['id'];
|
|
||||||
Yii::app()->clientScript->registerScript(__CLASS__.$selector, "jQuery('{$selector}').tab('show');");
|
|
||||||
$this->registerEvents($selector, $this->events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbThumbnails class file.
|
|
||||||
* @author Christoffer Niska <christoffer.niska@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
Yii::import('bootstrap.widgets.TbListView');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap thumbnails widget.
|
|
||||||
* http://twitter.github.com/bootstrap/components.html#thumbnails
|
|
||||||
*/
|
|
||||||
class TbThumbnails extends TbListView
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var mixed a PHP expression that is evaluated for every item and whose result is used
|
|
||||||
* as the URL for the thumbnail.
|
|
||||||
*/
|
|
||||||
public $url;
|
|
||||||
/**
|
|
||||||
* @var integer the number of grid columns that the thumbnails spans over.
|
|
||||||
*/
|
|
||||||
public $span;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the data items for the view.
|
|
||||||
* Each item is corresponding to a single data model instance.
|
|
||||||
*/
|
|
||||||
public function renderItems()
|
|
||||||
{
|
|
||||||
$thumbnails = array();
|
|
||||||
$data = $this->dataProvider->getData();
|
|
||||||
|
|
||||||
if (!empty($data))
|
|
||||||
{
|
|
||||||
$owner = $this->getOwner();
|
|
||||||
$render = $owner instanceof CController ? 'renderPartial' : 'render';
|
|
||||||
foreach ($data as $i => $row)
|
|
||||||
{
|
|
||||||
$thumbnail = array();
|
|
||||||
$d = $this->viewData;
|
|
||||||
$d['index'] = $i;
|
|
||||||
$d['data'] = $row;
|
|
||||||
$d['widget'] = $this;
|
|
||||||
$thumbnail['content'] = $owner->$render($this->itemView, $d, true);
|
|
||||||
if (isset($this->url))
|
|
||||||
$thumbnail['url'] = $this->evaluateExpression($this->url, array('data' => $row));
|
|
||||||
if (isset($this->span))
|
|
||||||
$thumbnail['span'] = $this->span;
|
|
||||||
$thumbnails[] = $thumbnail;
|
|
||||||
}
|
|
||||||
echo TbHtml::thumbnails($thumbnails, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$this->renderEmptyText();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,136 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* TbModal class file.
|
|
||||||
* @author Antonio Ramirez <ramirez.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Christoffer Niska 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package bootstrap.widgets
|
|
||||||
*/
|
|
||||||
|
|
||||||
Yii::import('bootstrap.behaviors.TbWidget');
|
|
||||||
Yii::import('bootstrap.helpers.TbHtml');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class TbTypeAhead
|
|
||||||
*/
|
|
||||||
class TbTypeAhead extends CInputWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var mixed the data source to query against. May be an array of strings or a function. The function is passed
|
|
||||||
* two arguments, the query value in the input field and the process callback. The function may be used synchronously
|
|
||||||
* by returning the data source directly or asynchronously via the process callback's single argument.
|
|
||||||
*/
|
|
||||||
public $source = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int the max number of items to display in the dropdown. Defaults to 8.
|
|
||||||
*/
|
|
||||||
public $items = 8;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int the minimum character length needed before triggering autocomplete suggestions
|
|
||||||
*/
|
|
||||||
public $minLength = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string javascript function the method used to determine if a query matches an item. Accepts a single argument, the item
|
|
||||||
* against which to test the query. Access the current query with this.query. Return a boolean true if query is a
|
|
||||||
* match. Case insensitive.
|
|
||||||
*/
|
|
||||||
public $matcher;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string javascript function method used to sort autocomplete results. Accepts a single argument items and has
|
|
||||||
* the scope of the typeahead instance. Reference the current query with this.query. Exact match, case sensitive,
|
|
||||||
* case insensitive
|
|
||||||
*/
|
|
||||||
public $sorter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string javascript the method used to return selected item. Accepts a single argument, the item and has the
|
|
||||||
* scope of the typeahead instance. Returns selected item.
|
|
||||||
*/
|
|
||||||
public $updater;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string javascript method used to highlight autocomplete results. Accepts a single argument item and has the
|
|
||||||
* scope of the typeahead instance. Should return html. Highlights all default matches
|
|
||||||
*/
|
|
||||||
public $highlighter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the plugin options
|
|
||||||
*/
|
|
||||||
protected $pluginOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's initialization method.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->attachBehavior('TbWidget', new TbWidget);
|
|
||||||
$this->initOptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the plugin options
|
|
||||||
*/
|
|
||||||
public function initOptions()
|
|
||||||
{
|
|
||||||
$options = array();
|
|
||||||
foreach (array('matcher', 'sorter', 'updater', 'highlighter') as $fn)
|
|
||||||
{
|
|
||||||
if ($this->$fn !== null)
|
|
||||||
{
|
|
||||||
if ($this->$fn instanceof CJavaScriptExpression)
|
|
||||||
$options[$fn] = $this->$fn;
|
|
||||||
else
|
|
||||||
$options[$fn] = new CJavaScriptExpression($this->$fn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->pluginOptions = TbHtml::mergeOptions(
|
|
||||||
array(
|
|
||||||
'source' => $this->source,
|
|
||||||
'items' => $this->items,
|
|
||||||
'minLength' => $this->minLength)
|
|
||||||
,
|
|
||||||
$options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's run method.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
$this->renderField();
|
|
||||||
$this->registerClientScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders field
|
|
||||||
*/
|
|
||||||
public function renderField()
|
|
||||||
{
|
|
||||||
list($name, $id) = $this->resolveNameID();
|
|
||||||
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('id', $id, $this->htmlOptions);
|
|
||||||
$this->htmlOptions = TbHtml::defaultOption('name', $name, $this->htmlOptions);
|
|
||||||
|
|
||||||
// by using TbHtml we support all bootstrap options
|
|
||||||
if($this->hasModel())
|
|
||||||
echo TbHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
|
|
||||||
else
|
|
||||||
echo TbHtml::textField($name, $this->value, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register required scripts.
|
|
||||||
*/
|
|
||||||
public function registerClientScript()
|
|
||||||
{
|
|
||||||
/** @var TbApi $api */
|
|
||||||
$selector = '#'.TbHtml::getOption('id', $this->htmlOptions, $this->getId());
|
|
||||||
$this->registerPlugin(TbApi::PLUGIN_TYPEAHEAD, $selector, $this->pluginOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
# cache directories
|
|
||||||
Thumbs.db
|
|
||||||
*.DS_Store
|
|
||||||
*.empty
|
|
||||||
|
|
||||||
#phpstorm project files
|
|
||||||
.idea
|
|
||||||
|
|
||||||
#netbeans project files
|
|
||||||
nbproject
|
|
||||||
|
|
||||||
#eclipse, zend studio, aptana or other eclipse like project files
|
|
||||||
.buildpath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
|
|
||||||
# sass cache files
|
|
||||||
*.sass-cache
|
|
||||||
|
|
||||||
# mac deployment helpers
|
|
||||||
switch
|
|
||||||
index
|
|
||||||
|
|
||||||
|
|
||||||
#demo directories
|
|
||||||
/docs/app/runtime/*
|
|
||||||
/docs/web/assets/*
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
yiiwheels
|
|
||||||
=========
|
|
||||||
|
|
||||||
TODO
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
> [](http://www.2amigos.us)
|
|
||||||
<i>web development has never been so fun</i>
|
|
||||||
[www.2amigos.us](http://www.2amigos.us) - under construction -
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* YiiWheels class file.
|
|
||||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © 2amigos.us 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package yiiwheels
|
|
||||||
*/
|
|
||||||
|
|
||||||
class YiiWheels extends CApplicationComponent
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var array the HTML options for the view container tag.
|
|
||||||
*/
|
|
||||||
public $htmlOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $assetsJs of javascript library names to be registered when initializing the library.
|
|
||||||
*/
|
|
||||||
public $assetsJs = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $assetsCss of style library names to be registered when initializing the library.
|
|
||||||
*/
|
|
||||||
public $assetsCss = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var TbApi $_api
|
|
||||||
*/
|
|
||||||
protected $_api;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string holds the published assets
|
|
||||||
*/
|
|
||||||
protected $_assetsUrl;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Widget's initialization
|
|
||||||
* @throws CException
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
$this->_api = Yii::app()->getComponent('bootstrap');
|
|
||||||
|
|
||||||
if (null === $this->_api) {
|
|
||||||
throw new CException(Yii::t('zii', '"YiiWheels" must work in conjunction with "YiiStrap".'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ensure all widgets - plugins are accessible to the library */
|
|
||||||
Yii::import('bootstrap.widgets.*');
|
|
||||||
/* ensure common behavior is also accessible to the library */
|
|
||||||
Yii::import('yiiwheels.behaviors.WhPlugin');
|
|
||||||
|
|
||||||
/* register css assets */
|
|
||||||
foreach ($this->assetsCss as $css) {
|
|
||||||
$this->registerAssetCss($css);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* register js assets */
|
|
||||||
foreach ($this->assetsJs as $js) {
|
|
||||||
$this->registerAssetJs($js);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the core library (yiistrap) component
|
|
||||||
* @return TbApi
|
|
||||||
*/
|
|
||||||
public function getApi()
|
|
||||||
{
|
|
||||||
return $this->_api;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the assets URL.
|
|
||||||
* Assets folder has few orphan and very useful utility libraries.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAssetsUrl()
|
|
||||||
{
|
|
||||||
if (isset($this->_assetsUrl)) {
|
|
||||||
return $this->_assetsUrl;
|
|
||||||
} else {
|
|
||||||
$forceCopyAssets = $this->getApi()->forceCopyAssets;
|
|
||||||
$path = Yii::getPathOfAlias('yiiwheels');
|
|
||||||
$assetsUrl = Yii::app()->assetManager->publish(
|
|
||||||
$path . DIRECTORY_SEPARATOR . 'assets',
|
|
||||||
false,
|
|
||||||
-1,
|
|
||||||
$forceCopyAssets
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->_assetsUrl = $assetsUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register a specific js file in the asset's js folder
|
|
||||||
* @param string $jsFile
|
|
||||||
* @param int $position the position of the JavaScript code.
|
|
||||||
* @see CClientScript::registerScriptFile
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function registerAssetJs($jsFile, $position = CClientScript::POS_END)
|
|
||||||
{
|
|
||||||
Yii::app()->getClientScript()->registerScriptFile($this->getAssetsUrl() . "/js/{$jsFile}", $position);
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a specific css in the asset's css folder
|
|
||||||
* @param string $cssFile the css file name to register
|
|
||||||
* @param string $media the media that the CSS file should be applied to. If empty, it means all media types.
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function registerAssetCss($cssFile, $media = '')
|
|
||||||
{
|
|
||||||
Yii::app()->getClientScript()->registerCssFile($this->getAssetsUrl() . "/css/{$cssFile}", $media);
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
YiiWheels Assets Folder
|
|
||||||
=======================
|
|
||||||
|
|
||||||
This folder should be used to held ***only*** orphan javascript, css or img files that will enhance the toolkit.
|
|
||||||
Each extension / widget should encapsulate its own assets so we keep this folder with as few files as possible.
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
@charset 'UTF-8';
|
|
||||||
/*
|
|
||||||
* Bootstrap Image Gallery CSS 2.5.2
|
|
||||||
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
|
||||||
*
|
|
||||||
* Copyright 2011, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
.modal-gallery {
|
|
||||||
width: auto;
|
|
||||||
max-height: none;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-body {
|
|
||||||
max-height: none;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-title {
|
|
||||||
display: inline-block;
|
|
||||||
max-height: 54px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-image {
|
|
||||||
position: relative;
|
|
||||||
margin: auto;
|
|
||||||
min-width: 128px;
|
|
||||||
min-height: 128px;
|
|
||||||
overflow: hidden;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-image:hover:before,
|
|
||||||
.modal-gallery .modal-image:hover:after {
|
|
||||||
content: '\2039';
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 15px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
margin-top: -20px;
|
|
||||||
font-size: 60px;
|
|
||||||
font-weight: 100;
|
|
||||||
line-height: 30px;
|
|
||||||
color: #ffffff;
|
|
||||||
text-align: center;
|
|
||||||
background: #222222;
|
|
||||||
border: 3px solid #ffffff;
|
|
||||||
-webkit-border-radius: 23px;
|
|
||||||
-moz-border-radius: 23px;
|
|
||||||
border-radius: 23px;
|
|
||||||
opacity: 0.5;
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-image:hover:after {
|
|
||||||
content: '\203A';
|
|
||||||
left: auto;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
.modal-single .modal-image:hover:before,
|
|
||||||
.modal-single .modal-image:hover:after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.modal-loading .modal-image {
|
|
||||||
background: url(../img/loading.gif) center no-repeat;
|
|
||||||
}
|
|
||||||
.modal-gallery.fade .modal-image {
|
|
||||||
-webkit-transition: width 0.15s ease, height 0.15s ease;
|
|
||||||
-moz-transition: width 0.15s ease, height 0.15s ease;
|
|
||||||
-ms-transition: width 0.15s ease, height 0.15s ease;
|
|
||||||
-o-transition: width 0.15s ease, height 0.15s ease;
|
|
||||||
transition: width 0.15s ease, height 0.15s ease;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-image * {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
opacity: 0;
|
|
||||||
filter: alpha(opacity=0);
|
|
||||||
}
|
|
||||||
.modal-gallery.fade .modal-image * {
|
|
||||||
-webkit-transition: opacity 0.5s linear;
|
|
||||||
-moz-transition: opacity 0.5s linear;
|
|
||||||
-ms-transition: opacity 0.5s linear;
|
|
||||||
-o-transition: opacity 0.5s linear;
|
|
||||||
transition: opacity 0.5s linear;
|
|
||||||
}
|
|
||||||
.modal-gallery .modal-image *.in {
|
|
||||||
opacity: 1;
|
|
||||||
filter: alpha(opacity=100);
|
|
||||||
}
|
|
||||||
.modal-fullscreen {
|
|
||||||
border: none;
|
|
||||||
-webkit-border-radius: 0;
|
|
||||||
-moz-border-radius: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
background: transparent;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.modal-fullscreen.modal-loading {
|
|
||||||
border: 0;
|
|
||||||
-webkit-box-shadow: none;
|
|
||||||
-moz-box-shadow: none;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
.modal-fullscreen .modal-body {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.modal-fullscreen .modal-header,
|
|
||||||
.modal-fullscreen .modal-footer {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
background: transparent;
|
|
||||||
border: 0;
|
|
||||||
-webkit-box-shadow: none;
|
|
||||||
-moz-box-shadow: none;
|
|
||||||
box-shadow: none;
|
|
||||||
opacity: 0;
|
|
||||||
z-index: 2000;
|
|
||||||
}
|
|
||||||
.modal-fullscreen .modal-footer {
|
|
||||||
top: auto;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
.modal-fullscreen .close,
|
|
||||||
.modal-fullscreen .modal-title {
|
|
||||||
color: #fff;
|
|
||||||
text-shadow: 0 0 2px rgba(33, 33, 33, 0.8);
|
|
||||||
}
|
|
||||||
.modal-fullscreen .modal-header:hover,
|
|
||||||
.modal-fullscreen .modal-footer:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
|
||||||
.modal-gallery .btn span {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.modal-fullscreen {
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
@charset 'UTF-8';
|
|
||||||
.modal-gallery{width:auto;max-height:none;outline:none;}
|
|
||||||
.modal-gallery .modal-body{max-height:none;}
|
|
||||||
.modal-gallery .modal-title{display:inline-block;max-height:54px;overflow:hidden;}
|
|
||||||
.modal-gallery .modal-image{position:relative;margin:auto;min-width:128px;min-height:128px;overflow:hidden;cursor:pointer;}
|
|
||||||
.modal-gallery .modal-image:hover:before,.modal-gallery .modal-image:hover:after{content:'\2039';position:absolute;top:50%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);z-index:1;}
|
|
||||||
.modal-gallery .modal-image:hover:after{content:'\203A';left:auto;right:15px;}
|
|
||||||
.modal-single .modal-image:hover:before,.modal-single .modal-image:hover:after{display:none;}
|
|
||||||
.modal-loading .modal-image{background:url(../img/loading.gif) center no-repeat;}
|
|
||||||
.modal-gallery.fade .modal-image{-webkit-transition:width 0.15s ease, height 0.15s ease;-moz-transition:width 0.15s ease, height 0.15s ease;-ms-transition:width 0.15s ease, height 0.15s ease;-o-transition:width 0.15s ease, height 0.15s ease;transition:width 0.15s ease, height 0.15s ease;}
|
|
||||||
.modal-gallery .modal-image *{position:absolute;top:0;opacity:0;filter:alpha(opacity=0);}
|
|
||||||
.modal-gallery.fade .modal-image *{-webkit-transition:opacity 0.5s linear;-moz-transition:opacity 0.5s linear;-ms-transition:opacity 0.5s linear;-o-transition:opacity 0.5s linear;transition:opacity 0.5s linear;}
|
|
||||||
.modal-gallery .modal-image *.in{opacity:1;filter:alpha(opacity=100);}
|
|
||||||
.modal-fullscreen{border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background:transparent;overflow:hidden;}
|
|
||||||
.modal-fullscreen.modal-loading{border:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
|
||||||
.modal-fullscreen .modal-body{padding:0;}
|
|
||||||
.modal-fullscreen .modal-header,.modal-fullscreen .modal-footer{position:absolute;top:0;right:0;left:0;background:transparent;border:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:0;z-index:2000;}
|
|
||||||
.modal-fullscreen .modal-footer{top:auto;bottom:0;}
|
|
||||||
.modal-fullscreen .close,.modal-fullscreen .modal-title{color:#fff;text-shadow:0 0 2px rgba(33, 33, 33, 0.8);}
|
|
||||||
.modal-fullscreen .modal-header:hover,.modal-fullscreen .modal-footer:hover{opacity:1;}
|
|
||||||
@media (max-width:767px){.modal-gallery .btn span{display:none;} .modal-fullscreen{right:0;left:0;}}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
.notifications{position:fixed;z-index:9999}.notifications.top-right{right:10px;top:25px;}
|
|
||||||
.notifications.top-left{left:10px;top:25px;}
|
|
||||||
.notifications.bottom-left{left:10px;bottom:25px;}
|
|
||||||
.notifications.bottom-right{right:10px;bottom:25px;}
|
|
||||||
.notifications>div{position:relative;z-index:9999;margin:5px 0px;}
|
|
||||||
.notifications.center{top:48%;left:0;width:100%;}.notifications.center>div{margin:5px auto;width:20%;text-align:center;}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* bootbox.js v2.3.2
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011-2012 by Nick Payne <nick@kurai.co.uk>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
var bootbox=window.bootbox||function(k){function j(b,a){null==a&&(a=l);return"string"==typeof h[a][b]?h[a][b]:a!=m?j(b,m):b}var l="en",m="en",p=!0,g={},f={},h={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},ru:{OK:"OK",CANCEL:"\u041e\u0442\u043c\u0435\u043d\u0430",
|
|
||||||
CONFIRM:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"}};f.setLocale=function(b){for(var a in h)if(a==b){l=b;return}throw Error("Invalid locale: "+b);};f.addLocale=function(b,a){"undefined"==typeof h[b]&&(h[b]={});for(var c in a)h[b][c]=a[c]};f.setIcons=function(b){g=b;if("object"!==typeof g||null==g)g={}};f.alert=function(){var b="",a=j("OK"),c=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?
|
|
||||||
c=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];c=arguments[2];break;default:throw Error("Incorrect number of arguments: expected 1-3");}return f.dialog(b,{label:a,icon:g.OK,callback:c},{onEscape:c})};f.confirm=function(){var b="",a=j("CANCEL"),c=j("CONFIRM"),e=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?e=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];"function"==typeof arguments[2]?
|
|
||||||
e=arguments[2]:c=arguments[2];break;case 4:b=arguments[0];a=arguments[1];c=arguments[2];e=arguments[3];break;default:throw Error("Incorrect number of arguments: expected 1-4");}return f.dialog(b,[{label:a,icon:g.CANCEL,callback:function(){"function"==typeof e&&e(!1)}},{label:c,icon:g.CONFIRM,callback:function(){"function"==typeof e&&e(!0)}}])};f.prompt=function(){var b="",a=j("CANCEL"),c=j("CONFIRM"),e=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?
|
|
||||||
e=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];"function"==typeof arguments[2]?e=arguments[2]:c=arguments[2];break;case 4:b=arguments[0];a=arguments[1];c=arguments[2];e=arguments[3];break;default:throw Error("Incorrect number of arguments: expected 1-4");}var n=k("<form></form>");n.append("<input autocomplete=off type=text />");var h=f.dialog(n,[{label:a,icon:g.CANCEL,callback:function(){"function"==typeof e&&e(null)}},{label:c,icon:g.CONFIRM,callback:function(){"function"==
|
|
||||||
typeof e&&e(n.find("input[type=text]").val())}}],{header:b});h.on("shown",function(){n.find("input[type=text]").focus();n.on("submit",function(a){a.preventDefault();h.find(".btn-primary").click()})});return h};f.modal=function(){var b,a,c,e={onEscape:null,keyboard:!0,backdrop:!0};switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"object"==typeof arguments[1]?c=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];c=arguments[2];break;default:throw Error("Incorrect number of arguments: expected 1-3");
|
|
||||||
}e.header=a;c="object"==typeof c?k.extend(e,c):e;return f.dialog(b,[],c)};f.dialog=function(b,a,c){var e=null,f="",h=[],c=c||{};null==a?a=[]:"undefined"==typeof a.length&&(a=[a]);for(var d=a.length;d--;){var g=null,j=null,l="",m=null;if("undefined"==typeof a[d].label&&"undefined"==typeof a[d]["class"]&&"undefined"==typeof a[d].callback){var g=0,q=null,o;for(o in a[d])if(q=o,1<++g)break;1==g&&"function"==typeof a[d][o]&&(a[d].label=q,a[d].callback=a[d][o])}"function"==typeof a[d].callback&&(m=a[d].callback);
|
|
||||||
a[d]["class"]?j=a[d]["class"]:d==a.length-1&&2>=a.length&&(j="btn-primary");g=a[d].label?a[d].label:"Option "+(d+1);a[d].icon&&(l="<i class='"+a[d].icon+"'></i> ");f+="<a data-handler='"+d+"' class='btn "+j+"' href='javascript:;'>"+l+""+g+"</a>";h[d]=m}a=["<div class='bootbox modal'>"];if(c.header){d="";if("undefined"==typeof c.headerCloseButton||c.headerCloseButton)d="<a href='javascript:;' class='close'>×</a>";a.push("<div class='modal-header'>"+d+"<h3>"+c.header+"</h3></div>")}a.push("<div class='modal-body'></div>");
|
|
||||||
f&&a.push("<div class='modal-footer'>"+f+"</div>");a.push("</div>");var i=k(a.join("\n"));("undefined"===typeof c.animate?p:c.animate)&&i.addClass("fade");k(".modal-body",i).html(b);i.bind("hidden",function(){i.remove()});i.bind("hide",function(){if("escape"==e&&"function"==typeof c.onEscape)c.onEscape()});k(document).bind("keyup.modal",function(a){27==a.which&&(e="escape")});i.bind("shown",function(){k("a.btn-primary:last",i).focus()});i.on("click",".modal-footer a, a.close",function(a){var b=k(this).data("handler"),
|
|
||||||
b=h[b],c=null;"function"==typeof b&&(c=b());!1!==c&&(a.preventDefault(),e="button",i.modal("hide"))});null==c.keyboard&&(c.keyboard="function"==typeof c.onEscape);k("body").append(i);i.modal({backdrop:c.backdrop||!0,keyboard:c.keyboard});return i};f.hideAll=function(){k(".bootbox").modal("hide")};f.animate=function(b){p=b};return f}(window.jQuery);
|
|
||||||
@ -1,395 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bootstrap Image Gallery 2.8.1
|
|
||||||
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
|
||||||
*
|
|
||||||
* Copyright 2011, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*jslint nomen: true, regexp: true */
|
|
||||||
/*global define, window, document, jQuery */
|
|
||||||
|
|
||||||
(function (factory) {
|
|
||||||
'use strict';
|
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
// Register as an anonymous AMD module:
|
|
||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'load-image',
|
|
||||||
'../.'
|
|
||||||
], factory);
|
|
||||||
} else {
|
|
||||||
// Browser globals:
|
|
||||||
factory(
|
|
||||||
window.jQuery,
|
|
||||||
window.loadImage
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}(function ($, loadImage) {
|
|
||||||
'use strict';
|
|
||||||
// Bootstrap Image Gallery is an extension to the Modal dialog of Twitter's
|
|
||||||
// Bootstrap toolkit, to ease navigation between a set of gallery images.
|
|
||||||
// It features transition effects, fullscreen mode and slideshow functionality.
|
|
||||||
$.extend($.fn.modal.defaults, {
|
|
||||||
// Delegate to search gallery links from, can be anything that
|
|
||||||
// is accepted as parameter for $():
|
|
||||||
delegate: document,
|
|
||||||
// Selector for gallery links:
|
|
||||||
selector: null,
|
|
||||||
// The filter for the selected gallery links (e.g. set to ":odd" to
|
|
||||||
// filter out label and thumbnail linking twice to the same image):
|
|
||||||
filter: '*',
|
|
||||||
// The index of the first gallery image to show:
|
|
||||||
index: 0,
|
|
||||||
// The href of the first gallery image to show (overrides index):
|
|
||||||
href: null,
|
|
||||||
// The range of images around the current one to preload:
|
|
||||||
preloadRange: 2,
|
|
||||||
// Offset of image width to viewport width:
|
|
||||||
offsetWidth: 100,
|
|
||||||
// Offset of image height to viewport height:
|
|
||||||
offsetHeight: 200,
|
|
||||||
// Set to true to display images as canvas elements:
|
|
||||||
canvas: false,
|
|
||||||
// Shows the next image after the given time in ms (0 = disabled):
|
|
||||||
slideshow: 0,
|
|
||||||
// Defines the image division for previous/next clicks:
|
|
||||||
imageClickDivision: 0.5
|
|
||||||
});
|
|
||||||
var originalShow = $.fn.modal.Constructor.prototype.show,
|
|
||||||
originalHide = $.fn.modal.Constructor.prototype.hide;
|
|
||||||
$.extend($.fn.modal.Constructor.prototype, {
|
|
||||||
initLinks: function () {
|
|
||||||
var $this = this,
|
|
||||||
options = this.options,
|
|
||||||
selector = options.selector ||
|
|
||||||
'a[data-target=' + options.target + ']';
|
|
||||||
this.$links = $(options.delegate).find(selector)
|
|
||||||
.filter(options.filter).each(function (index) {
|
|
||||||
if ($this.getUrl(this) === options.href) {
|
|
||||||
options.index = index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!this.$links[options.index]) {
|
|
||||||
options.index = 0;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getUrl: function (element) {
|
|
||||||
return element.href || $(element).data('href');
|
|
||||||
},
|
|
||||||
startSlideShow: function () {
|
|
||||||
var $this = this;
|
|
||||||
if (this.options.slideshow) {
|
|
||||||
this._slideShow = window.setTimeout(
|
|
||||||
function () {
|
|
||||||
$this.next();
|
|
||||||
},
|
|
||||||
this.options.slideshow
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stopSlideShow: function () {
|
|
||||||
window.clearTimeout(this._slideShow);
|
|
||||||
},
|
|
||||||
toggleSlideShow: function () {
|
|
||||||
var node = this.$element.find('.modal-slideshow');
|
|
||||||
if (this.options.slideshow) {
|
|
||||||
this.options.slideshow = 0;
|
|
||||||
this.stopSlideShow();
|
|
||||||
} else {
|
|
||||||
this.options.slideshow = node.data('slideshow') || 5000;
|
|
||||||
this.startSlideShow();
|
|
||||||
}
|
|
||||||
node.find('i').toggleClass('icon-play icon-pause');
|
|
||||||
},
|
|
||||||
preloadImages: function () {
|
|
||||||
var options = this.options,
|
|
||||||
range = options.index + options.preloadRange + 1,
|
|
||||||
link,
|
|
||||||
i;
|
|
||||||
for (i = options.index - options.preloadRange; i < range; i += 1) {
|
|
||||||
link = this.$links[i];
|
|
||||||
if (link && i !== options.index) {
|
|
||||||
$('<img>').prop('src', this.getUrl(link));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
loadImage: function () {
|
|
||||||
var $this = this,
|
|
||||||
modal = this.$element,
|
|
||||||
index = this.options.index,
|
|
||||||
url = this.getUrl(this.$links[index]),
|
|
||||||
oldImg;
|
|
||||||
this.abortLoad();
|
|
||||||
this.stopSlideShow();
|
|
||||||
modal.trigger('beforeLoad');
|
|
||||||
// The timeout prevents displaying a loading status,
|
|
||||||
// if the image has already been loaded:
|
|
||||||
this._loadingTimeout = window.setTimeout(function () {
|
|
||||||
modal.addClass('modal-loading');
|
|
||||||
}, 100);
|
|
||||||
oldImg = modal.find('.modal-image').children().removeClass('in');
|
|
||||||
// The timeout allows transition effects to finish:
|
|
||||||
window.setTimeout(function () {
|
|
||||||
oldImg.remove();
|
|
||||||
}, 3000);
|
|
||||||
modal.find('.modal-title').text(this.$links[index].title);
|
|
||||||
modal.find('.modal-download').prop(
|
|
||||||
'href',
|
|
||||||
url
|
|
||||||
);
|
|
||||||
this._loadingImage = loadImage(
|
|
||||||
url,
|
|
||||||
function (img) {
|
|
||||||
$this.img = img;
|
|
||||||
window.clearTimeout($this._loadingTimeout);
|
|
||||||
modal.removeClass('modal-loading');
|
|
||||||
modal.trigger('load');
|
|
||||||
$this.showImage(img);
|
|
||||||
$this.startSlideShow();
|
|
||||||
},
|
|
||||||
this._loadImageOptions
|
|
||||||
);
|
|
||||||
this.preloadImages();
|
|
||||||
},
|
|
||||||
showImage: function (img) {
|
|
||||||
var modal = this.$element,
|
|
||||||
transition = $.support.transition && modal.hasClass('fade'),
|
|
||||||
method = transition ? modal.animate : modal.css,
|
|
||||||
modalImage = modal.find('.modal-image'),
|
|
||||||
clone,
|
|
||||||
forceReflow;
|
|
||||||
modalImage.css({
|
|
||||||
width: img.width,
|
|
||||||
height: img.height
|
|
||||||
});
|
|
||||||
modal.find('.modal-title').css({ width: Math.max(img.width, 380) });
|
|
||||||
if (transition) {
|
|
||||||
clone = modal.clone().hide().appendTo(document.body);
|
|
||||||
}
|
|
||||||
if ($(window).width() > 767) {
|
|
||||||
method.call(modal.stop(), {
|
|
||||||
'margin-top': -((clone || modal).outerHeight() / 2),
|
|
||||||
'margin-left': -((clone || modal).outerWidth() / 2)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
modal.css({
|
|
||||||
top: ($(window).height() - (clone || modal).outerHeight()) / 2
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (clone) {
|
|
||||||
clone.remove();
|
|
||||||
}
|
|
||||||
modalImage.append(img);
|
|
||||||
forceReflow = img.offsetWidth;
|
|
||||||
modal.trigger('display');
|
|
||||||
if (transition) {
|
|
||||||
if (modal.is(':visible')) {
|
|
||||||
$(img).on(
|
|
||||||
$.support.transition.end,
|
|
||||||
function (e) {
|
|
||||||
// Make sure we don't respond to other transitions events
|
|
||||||
// in the container element, e.g. from button elements:
|
|
||||||
if (e.target === img) {
|
|
||||||
$(img).off($.support.transition.end);
|
|
||||||
modal.trigger('displayed');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
).addClass('in');
|
|
||||||
} else {
|
|
||||||
$(img).addClass('in');
|
|
||||||
modal.one('shown', function () {
|
|
||||||
modal.trigger('displayed');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$(img).addClass('in');
|
|
||||||
modal.trigger('displayed');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
abortLoad: function () {
|
|
||||||
if (this._loadingImage) {
|
|
||||||
this._loadingImage.onload = this._loadingImage.onerror = null;
|
|
||||||
}
|
|
||||||
window.clearTimeout(this._loadingTimeout);
|
|
||||||
},
|
|
||||||
prev: function () {
|
|
||||||
var options = this.options;
|
|
||||||
options.index -= 1;
|
|
||||||
if (options.index < 0) {
|
|
||||||
options.index = this.$links.length - 1;
|
|
||||||
}
|
|
||||||
this.loadImage();
|
|
||||||
},
|
|
||||||
next: function () {
|
|
||||||
var options = this.options;
|
|
||||||
options.index += 1;
|
|
||||||
if (options.index > this.$links.length - 1) {
|
|
||||||
options.index = 0;
|
|
||||||
}
|
|
||||||
this.loadImage();
|
|
||||||
},
|
|
||||||
keyHandler: function (e) {
|
|
||||||
switch (e.which) {
|
|
||||||
case 37: // left
|
|
||||||
case 38: // up
|
|
||||||
e.preventDefault();
|
|
||||||
this.prev();
|
|
||||||
break;
|
|
||||||
case 39: // right
|
|
||||||
case 40: // down
|
|
||||||
e.preventDefault();
|
|
||||||
this.next();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
wheelHandler: function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e = e.originalEvent;
|
|
||||||
this._wheelCounter = this._wheelCounter || 0;
|
|
||||||
this._wheelCounter += (e.wheelDelta || e.detail || 0);
|
|
||||||
if ((e.wheelDelta && this._wheelCounter >= 120) ||
|
|
||||||
(!e.wheelDelta && this._wheelCounter < 0)) {
|
|
||||||
this.prev();
|
|
||||||
this._wheelCounter = 0;
|
|
||||||
} else if ((e.wheelDelta && this._wheelCounter <= -120) ||
|
|
||||||
(!e.wheelDelta && this._wheelCounter > 0)) {
|
|
||||||
this.next();
|
|
||||||
this._wheelCounter = 0;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
initGalleryEvents: function () {
|
|
||||||
var $this = this,
|
|
||||||
modal = this.$element;
|
|
||||||
modal.find('.modal-image').on('click.modal-gallery', function (e) {
|
|
||||||
var modalImage = $(this);
|
|
||||||
if ($this.$links.length === 1) {
|
|
||||||
$this.hide();
|
|
||||||
} else {
|
|
||||||
if ((e.pageX - modalImage.offset().left) / modalImage.width() <
|
|
||||||
$this.options.imageClickDivision) {
|
|
||||||
$this.prev(e);
|
|
||||||
} else {
|
|
||||||
$this.next(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
modal.find('.modal-prev').on('click.modal-gallery', function (e) {
|
|
||||||
$this.prev(e);
|
|
||||||
});
|
|
||||||
modal.find('.modal-next').on('click.modal-gallery', function (e) {
|
|
||||||
$this.next(e);
|
|
||||||
});
|
|
||||||
modal.find('.modal-slideshow').on('click.modal-gallery', function (e) {
|
|
||||||
$this.toggleSlideShow(e);
|
|
||||||
});
|
|
||||||
$(document)
|
|
||||||
.on('keydown.modal-gallery', function (e) {
|
|
||||||
$this.keyHandler(e);
|
|
||||||
})
|
|
||||||
.on(
|
|
||||||
'mousewheel.modal-gallery, DOMMouseScroll.modal-gallery',
|
|
||||||
function (e) {
|
|
||||||
$this.wheelHandler(e);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
destroyGalleryEvents: function () {
|
|
||||||
var modal = this.$element;
|
|
||||||
this.abortLoad();
|
|
||||||
this.stopSlideShow();
|
|
||||||
modal.find('.modal-image, .modal-prev, .modal-next, .modal-slideshow')
|
|
||||||
.off('click.modal-gallery');
|
|
||||||
$(document)
|
|
||||||
.off('keydown.modal-gallery')
|
|
||||||
.off('mousewheel.modal-gallery, DOMMouseScroll.modal-gallery');
|
|
||||||
},
|
|
||||||
show: function () {
|
|
||||||
if (!this.isShown && this.$element.hasClass('modal-gallery')) {
|
|
||||||
var modal = this.$element,
|
|
||||||
options = this.options,
|
|
||||||
windowWidth = $(window).width(),
|
|
||||||
windowHeight = $(window).height();
|
|
||||||
if (modal.hasClass('modal-fullscreen')) {
|
|
||||||
this._loadImageOptions = {
|
|
||||||
maxWidth: windowWidth,
|
|
||||||
maxHeight: windowHeight,
|
|
||||||
canvas: options.canvas
|
|
||||||
};
|
|
||||||
if (modal.hasClass('modal-fullscreen-stretch')) {
|
|
||||||
this._loadImageOptions.minWidth = windowWidth;
|
|
||||||
this._loadImageOptions.minHeight = windowHeight;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this._loadImageOptions = {
|
|
||||||
maxWidth: windowWidth - options.offsetWidth,
|
|
||||||
maxHeight: windowHeight - options.offsetHeight,
|
|
||||||
canvas: options.canvas
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (windowWidth > 767) {
|
|
||||||
modal.css({
|
|
||||||
'margin-top': -(modal.outerHeight() / 2),
|
|
||||||
'margin-left': -(modal.outerWidth() / 2)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
modal.css({
|
|
||||||
top: ($(window).height() - modal.outerHeight()) / 2
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.initGalleryEvents();
|
|
||||||
this.initLinks();
|
|
||||||
if (this.$links.length) {
|
|
||||||
modal.find('.modal-slideshow, .modal-prev, .modal-next')
|
|
||||||
.toggle(this.$links.length !== 1);
|
|
||||||
modal.toggleClass(
|
|
||||||
'modal-single',
|
|
||||||
this.$links.length === 1
|
|
||||||
);
|
|
||||||
this.loadImage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
originalShow.apply(this, arguments);
|
|
||||||
},
|
|
||||||
hide: function () {
|
|
||||||
if (this.isShown && this.$element.hasClass('modal-gallery')) {
|
|
||||||
this.options.delegate = document;
|
|
||||||
this.options.href = null;
|
|
||||||
this.destroyGalleryEvents();
|
|
||||||
}
|
|
||||||
originalHide.apply(this, arguments);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(function () {
|
|
||||||
$(document.body).on(
|
|
||||||
'click.modal-gallery.data-api',
|
|
||||||
'[data-toggle="modal-gallery"]',
|
|
||||||
function (e) {
|
|
||||||
var $this = $(this),
|
|
||||||
options = $this.data(),
|
|
||||||
modal = $(options.target),
|
|
||||||
data = modal.data('modal'),
|
|
||||||
link;
|
|
||||||
if (!data) {
|
|
||||||
options = $.extend(modal.data(), options);
|
|
||||||
}
|
|
||||||
if (!options.selector) {
|
|
||||||
options.selector = 'a[rel=gallery]';
|
|
||||||
}
|
|
||||||
link = $(e.target).closest(options.selector);
|
|
||||||
if (link.length && modal.length) {
|
|
||||||
e.preventDefault();
|
|
||||||
options.href = link.prop('href') || link.data('href');
|
|
||||||
options.delegate = link[0] !== this ? this : document;
|
|
||||||
if (data) {
|
|
||||||
$.extend(data.options, options);
|
|
||||||
}
|
|
||||||
modal.modal(options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,92 +0,0 @@
|
|||||||
/**
|
|
||||||
* bootstrap-notify.js v1.0.0
|
|
||||||
* --
|
|
||||||
* Copyright 2012 Nijiko Yonskai <nijikokun@gmail.com>
|
|
||||||
* Copyright 2012 Goodybag, Inc.
|
|
||||||
* --
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function ($) {
|
|
||||||
var Notification = function (element, options) {
|
|
||||||
// Element collection
|
|
||||||
this.$element = $(element);
|
|
||||||
this.$note = $('<div class="alert"></div>');
|
|
||||||
this.options = $.extend(true, {}, $.fn.notify.defaults, options);
|
|
||||||
this._link = null;
|
|
||||||
|
|
||||||
// Setup from options
|
|
||||||
if (this.options.transition)
|
|
||||||
if (this.options.transition === 'fade')
|
|
||||||
this.$note.addClass('in').addClass(this.options.transition);
|
|
||||||
else this.$note.addClass(this.options.transition);
|
|
||||||
else this.$note.addClass('fade').addClass('in');
|
|
||||||
|
|
||||||
if (this.options.type)
|
|
||||||
this.$note.addClass('alert-' + this.options.type);
|
|
||||||
else this.$note.addClass('alert-success');
|
|
||||||
|
|
||||||
if (this.options.message)
|
|
||||||
if (typeof this.options.message === 'string')
|
|
||||||
this.$note.html(this.options.message);
|
|
||||||
else if (typeof this.options.message === 'object')
|
|
||||||
if (this.options.message.html)
|
|
||||||
this.$note.html(this.options.message.html);
|
|
||||||
else if (this.options.message.text)
|
|
||||||
this.$note.text(this.options.message.text);
|
|
||||||
|
|
||||||
if (this.options.closable)
|
|
||||||
this._link = $('<a class="close pull-right">×</a>'),
|
|
||||||
$(this._link).on('click', $.proxy(Notification.onClose, this)),
|
|
||||||
this.$note.prepend(this._link);
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Notification.onClose = function () {
|
|
||||||
this.options.onClose();
|
|
||||||
$(this.$note).remove();
|
|
||||||
this.options.onClosed();
|
|
||||||
};
|
|
||||||
|
|
||||||
Notification.prototype.show = function () {
|
|
||||||
if (this.options.fadeOut.enabled)
|
|
||||||
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(Notification.onClose, this));
|
|
||||||
|
|
||||||
this.$element.append(this.$note);
|
|
||||||
this.$note.alert();
|
|
||||||
};
|
|
||||||
|
|
||||||
Notification.prototype.hide = function () {
|
|
||||||
if (this.options.fadeOut.enabled)
|
|
||||||
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(Notification.onClose, this));
|
|
||||||
else Notification.onClose.call(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.notify = function (options) {
|
|
||||||
return new Notification(this, options);
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.notify.defaults = {
|
|
||||||
type: 'success',
|
|
||||||
closable: true,
|
|
||||||
transition: 'fade',
|
|
||||||
fadeOut: {
|
|
||||||
enabled: true,
|
|
||||||
delay: 3000
|
|
||||||
},
|
|
||||||
message: null,
|
|
||||||
onClose: function () {},
|
|
||||||
onClosed: function () {}
|
|
||||||
}
|
|
||||||
})(window.jQuery);
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
declarative - Mapper for custom user interface markup - version 1.3.8
|
|
||||||
Copyright 2012, Alex Lawrence
|
|
||||||
Licensed under the MIT license.
|
|
||||||
http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
(function(g,k){"object"===typeof exports?module.exports=k():"function"===typeof define&&define.amd?define(k):g.declarative=k()})(this,function(){var g={attribute:"attribute",element:"element"},k,c={},L=RegExp(/([A-Z])/g);k=c=function(a){return a.replace(L,function(a,d){return"-"+d.toLowerCase()})};var A,c={},n=function(a){throw Error(a);};A=c=function(a){a||n("declarative: Invalid mapping options");a.id||n("declarative: Invalid mapping id");a.types||n("declarative: Missing mapping types");a.types&&
|
|
||||||
!a.types.push&&n("declarative: Invalid mapping types");(!a.callback||"function"!==typeof a.callback)&&n("declarative: Invalid mapping callback");a.mappingMode&&(a.mappingMode!==g.attribute&&a.mappingMode!==g.element)&&n("declarative: Invalid mappingMode")};var B,c={};B=c=function(a){a.prefix=a.prefix||"";a.mappingMode=a.mappingMode||g.attribute;a.distinct=void 0!==a.distinct?a.distinct:!0};var C,c={};C=c=function(a){a.prefix=a.prefix.toLowerCase();a.convertedTypes=[];for(var b=0,d=a.types.length;b<
|
|
||||||
d;b++){var f=k(a.types[b]);a.convertedTypes.push(a.prefix+f)}};var u,D={ensureArray:function(a){return D.isArray(a)?a:[a]},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},indexOf:function(a,b){for(var d=0,f=a.length;d<f;d++)if(a[d]==b)return d;return-1}};u=D;var w,c={};w=c=function(a){return a&&(1===a.nodeType||9===a.nodeType)};var E,c={};E=c=function(a){var b;(b=a[g.attribute].join("],["))&&(b="["+b+"]");a=a[g.element].join(",");return b+(b&&a?",":"")+a};var r,c={},
|
|
||||||
F=function(){throw Error("declarative: Mapping id not existing");},e={};r=c={clear:function(){e={}},add:function(a){a=u.ensureArray(a);for(var b=0,d=a.length;b<d;b++){var f=a[b];A(f);B(f);C(f);e[f.id]=f}},getAll:function(){var a=[],b;for(b in e)e.hasOwnProperty(b)&&a.push(e[b]);return a},get:function(a){if(!u.isArray(a))return e[a]||F();for(var b=[],d=0,f=a.length;d<f;d++)b.push(e[a[d]]||F());return b}};var x={mappingTimeoutMs:1E3,mappingWaitTimeMs:20},M=function(a){a.exports=function(a){try{return eval("output = {"+
|
|
||||||
a+"}")}catch(d){throw Error("declarative: Error parsing options");}};return a.exports}({exports:{}}),G,c={};G=c=function(a){var b,d=function(){b=(new Date).getTime();a(f,c)},f=function(){return(new Date).getTime()-b},c=function(a){setTimeout(d,a)};d()};var H,s=function(){if(!(this instanceof s))return new s;var a=null,b,d,f=[],c=[];this.then=function(g,h){var p=new s;h=h||function(){};var e=this,q=g||function(){};g=function(){try{p.resolve(q.apply(e,arguments))}catch(a){p.reject(a)}};"resolved"==
|
|
||||||
a&&g.apply(this,b);"rejected"==a&&h.apply(this,d);f.push(g);c.push(h);return p};this.resolve=function(){a||(b=arguments,I(this,f,b),a="resolved")};this.reject=function(){a||(d=arguments,I(this,c,d),a="rejected")}},I=function(a,b,d){for(var f=0,c=b.length;f<c;f++)b[f].apply(a,d)};H=s;var J,c={};J=c=function(a){if(!w(a))throw Error("declarative: Invalid DOM element given");a=a.attributes;for(var b,d={},c=0,g=a.length;c<g;c++)b=a[c],b.specified&&(d[b.nodeName]=b.nodeValue);return d};var c={},c=function(a,
|
|
||||||
b){var d;if(a.querySelectorAll){d={};d[g.attribute]=[];d[g.element]=[];for(var c=0,N=b.length;c<N;c++){var e=b[c],h=e.mappingMode;d[h]=d[h].concat(e.convertedTypes)}d=E(d);d=a.querySelectorAll(d)}else d=a.all?a.all:a.getElementsByTagName("*");return d},y,O={},P=c,K=function(a,b,d){b.distinct&&(b=a.getAttribute(z),b||(b=Q++,a.setAttribute(z,b)),v[b]=v[b]||[],v[b].push(d))},v={},z="data-declarative-id",Q=1;y=O=function(a){a=r.get(a);var b=a=u.ensureArray(a);return{to:function(a){if(!w(a))throw Error("declarative: Invalid DOM element given");
|
|
||||||
var c=P(a,b),e,k=c.length,h=a!=document?a:c[--k],p=0,n=b.length,q=0,r=0,s=new H;G(function(a,d){for(;h;){for(p=0;p<n;p++){e=b[p];q=0;for(r=e.convertedTypes.length;q<r;q++){var l=e,j=e.convertedTypes[q],m=h.getAttribute(z);if(!l.distinct||!(0<m&&-1<u.indexOf(v[m],j))){if(e.mappingMode===g.attribute){var l=h,j=e,m=q,t=l.getAttributeNode(j.convertedTypes[m]);t&&t.specified&&(t=M(t.nodeValue),j.callback(l,j.types[m],t),K(l,j,j.convertedTypes[m]))}e.mappingMode===g.element&&(l=h,j=e,m=q,l.nodeName.toLowerCase()==
|
|
||||||
j.convertedTypes[m]&&(t=J(l),j.callback(l,j.types[m],t),K(l,j,j.convertedTypes[m])))}}}h=k&&c[--k];if(a()>x.mappingTimeoutMs){d(x.mappingWaitTimeMs);return}}s.resolve()});return s}}};c={};c.mappingModes=g;c.mappings=r;c.applyAllMappings=function(){for(var a=[],b=r.getAll(),d=0,c=b.length;d<c;d++)a.push(b[d].id);return y(a)};c.settings=x;c.apply=y;return c});
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
|
||||||
* Licensed under the MIT License (LICENSE.txt).
|
|
||||||
*
|
|
||||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
|
||||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
|
||||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
|
||||||
*
|
|
||||||
* Version: 3.0.6
|
|
||||||
*
|
|
||||||
* Requires: 1.2.2+
|
|
||||||
*/
|
|
||||||
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
"object"!==typeof JSON&&(JSON={});
|
|
||||||
(function(){function l(a){return 10>a?"0"+a:a}function q(a){r.lastIndex=0;return r.test(a)?'"'+a.replace(r,function(a){var c=t[a];return"string"===typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function n(a,k){var c,d,h,p,g=e,f,b=k[a];b&&("object"===typeof b&&"function"===typeof b.toJSON)&&(b=b.toJSON(a));"function"===typeof j&&(b=j.call(k,a,b));switch(typeof b){case "string":return q(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);
|
|
||||||
case "object":if(!b)return"null";e+=m;f=[];if("[object Array]"===Object.prototype.toString.apply(b)){p=b.length;for(c=0;c<p;c+=1)f[c]=n(c,b)||"null";h=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+g+"]":"["+f.join(",")+"]";e=g;return h}if(j&&"object"===typeof j){p=j.length;for(c=0;c<p;c+=1)"string"===typeof j[c]&&(d=j[c],(h=n(d,b))&&f.push(q(d)+(e?": ":":")+h))}else for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(h=n(d,b))&&f.push(q(d)+(e?": ":":")+h);h=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+
|
|
||||||
e)+"\n"+g+"}":"{"+f.join(",")+"}";e=g;return h}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var s=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
|
||||||
r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,m,t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,k,c){var d;m=e="";if("number"===typeof c)for(d=0;d<c;d+=1)m+=" ";else"string"===typeof c&&(m=c);if((j=k)&&"function"!==typeof k&&("object"!==typeof k||"number"!==typeof k.length))throw Error("JSON.stringify");return n("",{"":a})});
|
|
||||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,e){function c(a,d){var g,f,b=a[d];if(b&&"object"===typeof b)for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(f=c(b,g),void 0!==f?b[g]=f:delete b[g]);return e.call(a,d,b)}var d;a=String(a);s.lastIndex=0;s.test(a)&&(a=a.replace(s,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
|
||||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"===typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse");})})();
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,369 +0,0 @@
|
|||||||
// fgnass.github.com/spin.js#v1.2.6
|
|
||||||
// usage: new Spinner({color:'#fff', lines: 12}).spin(target);
|
|
||||||
!function(window, document, undefined) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
|
|
||||||
* Licensed under the MIT license
|
|
||||||
*/
|
|
||||||
|
|
||||||
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
|
||||||
, animations = {} /* Animation rules keyed by their name */
|
|
||||||
, useCssAnimations
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility function to create elements. If no tag name is given,
|
|
||||||
* a DIV is created. Optionally properties can be passed.
|
|
||||||
*/
|
|
||||||
function createEl(tag, prop) {
|
|
||||||
var el = document.createElement(tag || 'div')
|
|
||||||
, n
|
|
||||||
|
|
||||||
for(n in prop) el[n] = prop[n]
|
|
||||||
return el
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Appends children and returns the parent.
|
|
||||||
*/
|
|
||||||
function ins(parent /* child1, child2, ...*/) {
|
|
||||||
for (var i=1, n=arguments.length; i<n; i++)
|
|
||||||
parent.appendChild(arguments[i])
|
|
||||||
|
|
||||||
return parent
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert a new stylesheet to hold the @keyframe or VML rules.
|
|
||||||
*/
|
|
||||||
var sheet = function() {
|
|
||||||
var el = createEl('style', {type : 'text/css'})
|
|
||||||
ins(document.getElementsByTagName('head')[0], el)
|
|
||||||
return el.sheet || el.styleSheet
|
|
||||||
}()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an opacity keyframe animation rule and returns its name.
|
|
||||||
* Since most mobile Webkits have timing issues with animation-delay,
|
|
||||||
* we create separate rules for each line/segment.
|
|
||||||
*/
|
|
||||||
function addAnimation(alpha, trail, i, lines) {
|
|
||||||
var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-')
|
|
||||||
, start = 0.01 + i/lines*100
|
|
||||||
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
|
||||||
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
|
||||||
, pre = prefix && '-'+prefix+'-' || ''
|
|
||||||
|
|
||||||
if (!animations[name]) {
|
|
||||||
sheet.insertRule(
|
|
||||||
'@' + pre + 'keyframes ' + name + '{' +
|
|
||||||
'0%{opacity:' + z + '}' +
|
|
||||||
start + '%{opacity:' + alpha + '}' +
|
|
||||||
(start+0.01) + '%{opacity:1}' +
|
|
||||||
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
|
||||||
'100%{opacity:' + z + '}' +
|
|
||||||
'}', sheet.cssRules.length)
|
|
||||||
|
|
||||||
animations[name] = 1
|
|
||||||
}
|
|
||||||
return name
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tries various vendor prefixes and returns the first supported property.
|
|
||||||
**/
|
|
||||||
function vendor(el, prop) {
|
|
||||||
var s = el.style
|
|
||||||
, pp
|
|
||||||
, i
|
|
||||||
|
|
||||||
if(s[prop] !== undefined) return prop
|
|
||||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1)
|
|
||||||
for(i=0; i<prefixes.length; i++) {
|
|
||||||
pp = prefixes[i]+prop
|
|
||||||
if(s[pp] !== undefined) return pp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets multiple style properties at once.
|
|
||||||
*/
|
|
||||||
function css(el, prop) {
|
|
||||||
for (var n in prop)
|
|
||||||
el.style[vendor(el, n)||n] = prop[n]
|
|
||||||
|
|
||||||
return el
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fills in default values.
|
|
||||||
*/
|
|
||||||
function merge(obj) {
|
|
||||||
for (var i=1; i < arguments.length; i++) {
|
|
||||||
var def = arguments[i]
|
|
||||||
for (var n in def)
|
|
||||||
if (obj[n] === undefined) obj[n] = def[n]
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the absolute page-offset of the given element.
|
|
||||||
*/
|
|
||||||
function pos(el) {
|
|
||||||
var o = { x:el.offsetLeft, y:el.offsetTop }
|
|
||||||
while((el = el.offsetParent))
|
|
||||||
o.x+=el.offsetLeft, o.y+=el.offsetTop
|
|
||||||
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
var defaults = {
|
|
||||||
lines: 12, // The number of lines to draw
|
|
||||||
length: 7, // The length of each line
|
|
||||||
width: 5, // The line thickness
|
|
||||||
radius: 10, // The radius of the inner circle
|
|
||||||
rotate: 0, // Rotation offset
|
|
||||||
corners: 1, // Roundness (0..1)
|
|
||||||
color: '#000', // #rgb or #rrggbb
|
|
||||||
speed: 1, // Rounds per second
|
|
||||||
trail: 100, // Afterglow percentage
|
|
||||||
opacity: 1/4, // Opacity of the lines
|
|
||||||
fps: 20, // Frames per second when using setTimeout()
|
|
||||||
zIndex: 2e9, // Use a high z-index by default
|
|
||||||
className: 'spinner', // CSS class to assign to the element
|
|
||||||
top: 'auto', // center vertically
|
|
||||||
left: 'auto' // center horizontally
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The constructor */
|
|
||||||
var Spinner = function Spinner(o) {
|
|
||||||
if (!this.spin) return new Spinner(o)
|
|
||||||
this.opts = merge(o || {}, Spinner.defaults, defaults)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spinner.defaults = {}
|
|
||||||
|
|
||||||
merge(Spinner.prototype, {
|
|
||||||
spin: function(target) {
|
|
||||||
this.stop()
|
|
||||||
var self = this
|
|
||||||
, o = self.opts
|
|
||||||
, el = self.el = css(createEl(0, {className: o.className}), {position: 'relative', width: 0, zIndex: o.zIndex})
|
|
||||||
, mid = o.radius+o.length+o.width
|
|
||||||
, ep // element position
|
|
||||||
, tp // target position
|
|
||||||
|
|
||||||
if (target) {
|
|
||||||
target.insertBefore(el, target.firstChild||null)
|
|
||||||
tp = pos(target)
|
|
||||||
ep = pos(el)
|
|
||||||
css(el, {
|
|
||||||
left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px',
|
|
||||||
top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
el.setAttribute('aria-role', 'progressbar')
|
|
||||||
self.lines(el, self.opts)
|
|
||||||
|
|
||||||
if (!useCssAnimations) {
|
|
||||||
// No CSS animation support, use setTimeout() instead
|
|
||||||
var i = 0
|
|
||||||
, fps = o.fps
|
|
||||||
, f = fps/o.speed
|
|
||||||
, ostep = (1-o.opacity) / (f*o.trail / 100)
|
|
||||||
, astep = f/o.lines
|
|
||||||
|
|
||||||
;(function anim() {
|
|
||||||
i++;
|
|
||||||
for (var s=o.lines; s; s--) {
|
|
||||||
var alpha = Math.max(1-(i+s*astep)%f * ostep, o.opacity)
|
|
||||||
self.opacity(el, o.lines-s, alpha, o)
|
|
||||||
}
|
|
||||||
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
|
|
||||||
})()
|
|
||||||
}
|
|
||||||
return self
|
|
||||||
},
|
|
||||||
|
|
||||||
stop: function() {
|
|
||||||
var el = this.el
|
|
||||||
if (el) {
|
|
||||||
clearTimeout(this.timeout)
|
|
||||||
if (el.parentNode) el.parentNode.removeChild(el)
|
|
||||||
this.el = undefined
|
|
||||||
}
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
|
|
||||||
lines: function(el, o) {
|
|
||||||
var i = 0
|
|
||||||
, seg
|
|
||||||
|
|
||||||
function fill(color, shadow) {
|
|
||||||
return css(createEl(), {
|
|
||||||
position: 'absolute',
|
|
||||||
width: (o.length+o.width) + 'px',
|
|
||||||
height: o.width + 'px',
|
|
||||||
background: color,
|
|
||||||
boxShadow: shadow,
|
|
||||||
transformOrigin: 'left',
|
|
||||||
transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
|
|
||||||
borderRadius: (o.corners * o.width>>1) + 'px'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < o.lines; i++) {
|
|
||||||
seg = css(createEl(), {
|
|
||||||
position: 'absolute',
|
|
||||||
top: 1+~(o.width/2) + 'px',
|
|
||||||
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
|
|
||||||
opacity: o.opacity,
|
|
||||||
animation: useCssAnimations && addAnimation(o.opacity, o.trail, i, o.lines) + ' ' + 1/o.speed + 's linear infinite'
|
|
||||||
})
|
|
||||||
|
|
||||||
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
|
|
||||||
|
|
||||||
ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)')))
|
|
||||||
}
|
|
||||||
return el
|
|
||||||
},
|
|
||||||
|
|
||||||
opacity: function(el, i, val) {
|
|
||||||
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
// VML rendering for IE
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check and init VML support
|
|
||||||
*/
|
|
||||||
;(function() {
|
|
||||||
|
|
||||||
function vml(tag, attr) {
|
|
||||||
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
|
||||||
}
|
|
||||||
|
|
||||||
var s = css(createEl('group'), {behavior: 'url(#default#VML)'})
|
|
||||||
|
|
||||||
if (!vendor(s, 'transform') && s.adj) {
|
|
||||||
|
|
||||||
// VML support detected. Insert CSS rule ...
|
|
||||||
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
|
|
||||||
|
|
||||||
Spinner.prototype.lines = function(el, o) {
|
|
||||||
var r = o.length+o.width
|
|
||||||
, s = 2*r
|
|
||||||
|
|
||||||
function grp() {
|
|
||||||
return css(
|
|
||||||
vml('group', {
|
|
||||||
coordsize: s + ' ' + s,
|
|
||||||
coordorigin: -r + ' ' + -r
|
|
||||||
}),
|
|
||||||
{ width: s, height: s }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
var margin = -(o.width+o.length)*2 + 'px'
|
|
||||||
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
|
||||||
, i
|
|
||||||
|
|
||||||
function seg(i, dx, filter) {
|
|
||||||
ins(g,
|
|
||||||
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
|
|
||||||
ins(css(vml('roundrect', {arcsize: o.corners}), {
|
|
||||||
width: r,
|
|
||||||
height: o.width,
|
|
||||||
left: o.radius,
|
|
||||||
top: -o.width>>1,
|
|
||||||
filter: filter
|
|
||||||
}),
|
|
||||||
vml('fill', {color: o.color, opacity: o.opacity}),
|
|
||||||
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o.shadow)
|
|
||||||
for (i = 1; i <= o.lines; i++)
|
|
||||||
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
|
|
||||||
|
|
||||||
for (i = 1; i <= o.lines; i++) seg(i)
|
|
||||||
return ins(el, g)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spinner.prototype.opacity = function(el, i, val, o) {
|
|
||||||
var c = el.firstChild
|
|
||||||
o = o.shadow && o.lines || 0
|
|
||||||
if (c && i+o < c.childNodes.length) {
|
|
||||||
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
|
|
||||||
if (c) c.opacity = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
useCssAnimations = vendor(s, 'animation')
|
|
||||||
})()
|
|
||||||
|
|
||||||
if (typeof define == 'function' && define.amd)
|
|
||||||
define(function() { return Spinner })
|
|
||||||
else
|
|
||||||
window.Spinner = Spinner
|
|
||||||
|
|
||||||
}(window, document);
|
|
||||||
|
|
||||||
// include jquery plugin
|
|
||||||
/*
|
|
||||||
|
|
||||||
You can now create a spinner using any of the variants below:
|
|
||||||
|
|
||||||
$("#el").spin(); // Produces default Spinner using the text color of #el.
|
|
||||||
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
|
|
||||||
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
|
|
||||||
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
|
|
||||||
|
|
||||||
$("#el").spin(false); // Kills the spinner.
|
|
||||||
|
|
||||||
*/
|
|
||||||
(function($) {
|
|
||||||
$.fn.spin = function(opts, color) {
|
|
||||||
var presets = {
|
|
||||||
"tiny": { lines: 8, length: 2, width: 2, radius: 3 },
|
|
||||||
"small": { lines: 8, length: 4, width: 3, radius: 5 },
|
|
||||||
"large": { lines: 10, length: 8, width: 4, radius: 8 }
|
|
||||||
};
|
|
||||||
if (Spinner) {
|
|
||||||
return this.each(function() {
|
|
||||||
var $this = $(this),
|
|
||||||
data = $this.data();
|
|
||||||
|
|
||||||
if (data.spinner) {
|
|
||||||
data.spinner.stop();
|
|
||||||
delete data.spinner;
|
|
||||||
}
|
|
||||||
if (opts !== false) {
|
|
||||||
if (typeof opts === "string") {
|
|
||||||
if (opts in presets) {
|
|
||||||
opts = presets[opts];
|
|
||||||
} else {
|
|
||||||
opts = {};
|
|
||||||
}
|
|
||||||
if (color) {
|
|
||||||
opts.color = color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
throw "Spinner class not available.";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(jQuery);
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* WhPlugin class file.
|
|
||||||
* Extends the plugins with common shared methods.
|
|
||||||
*
|
|
||||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Antonio Ramirez 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package yiiwheels.behaviors
|
|
||||||
*/
|
|
||||||
class WhPlugin extends CBehavior
|
|
||||||
{
|
|
||||||
protected $_assetsUrl;
|
|
||||||
|
|
||||||
protected static $_api;
|
|
||||||
|
|
||||||
protected static $_wheels;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns
|
|
||||||
* @param $path
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getAssetsUrl($path)
|
|
||||||
{
|
|
||||||
if (isset($this->_assetsUrl)) {
|
|
||||||
return $this->_assetsUrl;
|
|
||||||
} else {
|
|
||||||
$forceCopyAssets = $this->getApi()->forceCopyAssets;
|
|
||||||
|
|
||||||
$assetsUrl = Yii::app()->assetManager->publish($path, false, -1, $forceCopyAssets);
|
|
||||||
|
|
||||||
return $this->_assetsUrl = $assetsUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return TbApi
|
|
||||||
*/
|
|
||||||
public function getApi()
|
|
||||||
{
|
|
||||||
if (self::$_api === null) {
|
|
||||||
self::$_api = self::getYiiWheels()->getApi();
|
|
||||||
}
|
|
||||||
return self::$_api;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the main component
|
|
||||||
* @return YiiWheels
|
|
||||||
*/
|
|
||||||
public function getYiiWheels()
|
|
||||||
{
|
|
||||||
if (self::$_wheels === null) {
|
|
||||||
self::$_wheels = Yii::app()->getComponent('yiiwheels');
|
|
||||||
}
|
|
||||||
return self::$_wheels;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "2amigos/yiiwheels",
|
|
||||||
"description": "Extension library for Yiistrap, Yii Twitter's Bootstrap.",
|
|
||||||
"keywords": ["bootstrap"],
|
|
||||||
"type": "yii-extension",
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Antonio Ramirez",
|
|
||||||
"email": "ramirez.cobos@gmail.com",
|
|
||||||
"homepage": "http://www.ramirezcobos.com/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"repositories": [
|
|
||||||
{
|
|
||||||
"type": "composer",
|
|
||||||
"url": "http://packages.phundament.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"2amigos/yiistrap": "dev-master"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,327 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* WhHtml class file.
|
|
||||||
*
|
|
||||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
|
||||||
* @copyright Copyright © Antonio Ramirez 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package yiiwheels.helpers
|
|
||||||
*/
|
|
||||||
class WhHtml extends TbHtml
|
|
||||||
{
|
|
||||||
const INPUT_DATEPICKER = 'datePickerRow';
|
|
||||||
const INPUT_TIMEPICKER = 'timePickerRow';
|
|
||||||
const INPUT_SELECT2 = 'select2Row';
|
|
||||||
const INPUT_TYPEAHEAD = 'typeAheadRow';
|
|
||||||
const INPUT_MULTISELECT = 'multiSelectRow';
|
|
||||||
const INPUT_MASKMONEY = 'maskMoneyRow';
|
|
||||||
const INPUT_REDACTOR = 'redactorRow';
|
|
||||||
|
|
||||||
static $validInputs = array(
|
|
||||||
self::INPUT_TYPEAHEAD => 'bootstrap.widgets.TbTypeAhead',
|
|
||||||
self::INPUT_DATEPICKER => 'yiiwheels.widgets.datepicker.WhDatePicker',
|
|
||||||
self::INPUT_TIMEPICKER => 'yiiwheels.widgets.timepicker.WhTimePicker',
|
|
||||||
self::INPUT_SELECT2 => 'yiiwheels.widgets.select2.WhSelect2',
|
|
||||||
self::INPUT_MULTISELECT => 'yiiwheels.widgets.multiselect.WhMultiSelect',
|
|
||||||
self::INPUT_MASKMONEY => 'yiiwheels.widgets.maskmoney.WhMaskMoney',
|
|
||||||
self::INPUT_REDACTOR => 'yiiwheels.widgets.redactor.WhRedactor'
|
|
||||||
);
|
|
||||||
|
|
||||||
static $configurationOptions = array(
|
|
||||||
self::INPUT_DATEPICKER => array('pluginOptions', 'events'),
|
|
||||||
self::INPUT_TIMEPICKER => array('pluginOptions', 'events'),
|
|
||||||
self::INPUT_TYPEAHEAD => array('source', 'items', 'matcher', 'sorter', 'updater', 'minLength', 'highlighter'),
|
|
||||||
self::INPUT_SELECT2 => array('pluginOptions', 'events', 'asDropDownList', 'language', 'data'),
|
|
||||||
self::INPUT_MULTISELECT => array('pluginOptions', 'events', 'data'),
|
|
||||||
self::INPUT_MASKMONEY => array('pluginOptions'),
|
|
||||||
self::INPUT_REDACTOR => array('pluginOptions', 'debugMode')
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public static function validInputs()
|
|
||||||
{
|
|
||||||
return array_merge(parent::$inputs, array_keys(self::$validInputs));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a datepicker field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function datePickerRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_DATEPICKER, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_DATEPICKER), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a timepicker field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function timePickerRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$htmlOptions = self::addClassName('bootstrap-timepicker', $htmlOptions);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_TIMEPICKER, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_TIMEPICKER), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a typeahead field
|
|
||||||
* @param string $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function typeAheadRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_TYPEAHEAD, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_TYPEAHEAD), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a select2 field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function select2Row($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_SELECT2, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_SELECT2), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a multiselect field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function multiSelectRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_MULTISELECT, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_MULTISELECT), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a maskmoney field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function maskMoneyRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_MASKMONEY, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_MASKMONEY), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a redactor field
|
|
||||||
* @param $name
|
|
||||||
* @param string $value
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function redactorRow($name, $value = '', $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('name' => $name, 'value' => $value);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_REDACTOR, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_REDACTOR), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Active Fields
|
|
||||||
/**
|
|
||||||
* Renders an active datepicker field
|
|
||||||
* @param $model
|
|
||||||
* @param $attribute
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeDatePickerRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_DATEPICKER, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_DATEPICKER), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an activeTimePickerRow
|
|
||||||
* @param $model
|
|
||||||
* @param $attribute
|
|
||||||
* @param array $htmlOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeTimePickerRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$htmlOptions = self::addClassName('bootstrap-timepicker', $htmlOptions);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_TIMEPICKER, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_TIMEPICKER), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders and active typeahead field
|
|
||||||
* @param CActiveRecord $model
|
|
||||||
* @param string $attribute
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeTypeAheadRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_TYPEAHEAD, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_TYPEAHEAD), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an active select2
|
|
||||||
* @param CActiveRecord $model
|
|
||||||
* @param string $attribute
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeSelect2Row($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_SELECT2, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_SELECT2), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an active multi select field
|
|
||||||
* @param CActiveRecord $model
|
|
||||||
* @param string $attribute
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeMultiSelectRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_MULTISELECT, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_MULTISELECT), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an active mask money field
|
|
||||||
* @param CActiveRecord $model
|
|
||||||
* @param string $attribute
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeMaskMoneyRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_MASKMONEY, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_MASKMONEY), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders an active redactor field
|
|
||||||
* @param CActiveRecord $model
|
|
||||||
* @param string $attribute
|
|
||||||
* @param array $htmlOptions additional attributes of the HTML element. Special attributes are supported.
|
|
||||||
* @see YiiStrap.TbTypeAhead for information about the special attributes.
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function activeRedactorRow($model, $attribute, $htmlOptions = array())
|
|
||||||
{
|
|
||||||
$defaultOptions = array('model' => $model, 'attribute' => $attribute);
|
|
||||||
|
|
||||||
$widgetOptions = self::getWidgetConfigurationOptions(self::INPUT_REDACTOR, $htmlOptions, $defaultOptions);
|
|
||||||
|
|
||||||
return self::widget(self::getWidgetPath(self::INPUT_REDACTOR), $widgetOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Utility methods
|
|
||||||
/**
|
|
||||||
* Gets a specific widget path
|
|
||||||
* @param $widget
|
|
||||||
* @return null
|
|
||||||
*/
|
|
||||||
public static function getWidgetPath($widget)
|
|
||||||
{
|
|
||||||
return array_key_exists($widget, self::$validInputs) ? self::$validInputs[$widget] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders a widget
|
|
||||||
* @param $widget
|
|
||||||
* @param array $widgetOptions
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function widget($widget, $widgetOptions = array())
|
|
||||||
{
|
|
||||||
ob_start();
|
|
||||||
Yii::app()->getController()->widget($widget, $widgetOptions);
|
|
||||||
return ob_get_clean();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extracts widget configuration options from array of htmlOptions
|
|
||||||
* @param string $widget the widget name
|
|
||||||
* @param array $htmlOptions additional HTML options
|
|
||||||
* @param array $options the default widget options
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
protected static function getWidgetConfigurationOptions($widget, $htmlOptions, $options = array())
|
|
||||||
{
|
|
||||||
$configurationOptions = self::$configurationOptions[$widget];
|
|
||||||
|
|
||||||
$options = self::moveOptions(
|
|
||||||
$configurationOptions,
|
|
||||||
$htmlOptions,
|
|
||||||
$options);
|
|
||||||
|
|
||||||
$options['htmlOptions'] = self::removeOptions($htmlOptions, $configurationOptions);
|
|
||||||
|
|
||||||
return $options;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* WhAceEditor widget class
|
|
||||||
*
|
|
||||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
|
||||||
* @author Matt Tabin <amigo.tabin@gmail.com>
|
|
||||||
* @copyright Copyright © 2amigos.us 2013-
|
|
||||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
|
||||||
* @package YiiWheels.widgets.ace
|
|
||||||
* @uses YiiWheels.helpers.WhHtml
|
|
||||||
*/
|
|
||||||
Yii::import('yiiwheels.helpers.WhHtml');
|
|
||||||
|
|
||||||
class WhAceEditor extends CInputWidget
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string the theme
|
|
||||||
*/
|
|
||||||
public $theme = 'clouds';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string the editor mode
|
|
||||||
*/
|
|
||||||
public $mode = 'html';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array the options for the ace editor
|
|
||||||
*/
|
|
||||||
public $pluginOptions = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] the JavaScript event handlers.
|
|
||||||
*/
|
|
||||||
public $events = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the widget.
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
if (empty($this->theme)) {
|
|
||||||
throw new CException(Yii::t(
|
|
||||||
'zii',
|
|
||||||
'"{attribute}" cannot be empty.',
|
|
||||||
array('{attribute}' => 'theme')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($this->mode)) {
|
|
||||||
throw new CException(Yii::t(
|
|
||||||
'zii',
|
|
||||||
'"{attribute}" cannot be empty.',
|
|
||||||
array('{attribute}' => 'mode')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the widget.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
$this->renderField();
|
|
||||||
$this->registerClientScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders field
|
|
||||||
*/
|
|
||||||
public function renderField()
|
|
||||||
{
|
|
||||||
list($name, $id) = $this->resolveNameID();
|
|
||||||
|
|
||||||
$this->htmlOptions = WhHtml::defaultOption('id', $id, $this->htmlOptions);
|
|
||||||
$this->htmlOptions = WhHtml::defaultOption('name', $name, $this->htmlOptions);
|
|
||||||
|
|
||||||
$tagOptions = $this->htmlOptions;
|
|
||||||
|
|
||||||
$tagOptions['id'] = 'aceEditor_' . $tagOptions['id'];
|
|
||||||
|
|
||||||
echo WhHtml::tag('div', $tagOptions);
|
|
||||||
|
|
||||||
$this->htmlOptions['style'] = 'display:none';
|
|
||||||
|
|
||||||
if ($this->hasModel()) {
|
|
||||||
echo WhHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
|
|
||||||
} else {
|
|
||||||
echo WhHtml::textArea($name, $this->value, $this->htmlOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->htmlOptions = $tagOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers required client script for bootstrap ace editor.
|
|
||||||
*/
|
|
||||||
public function registerClientScript()
|
|
||||||
{
|
|
||||||
/* publish assets dir */
|
|
||||||
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
|
|
||||||
$assetsUrl = $this->getAssetsUrl($path);
|
|
||||||
|
|
||||||
/* @var $cs CClientScript */
|
|
||||||
$cs = Yii::app()->getClientScript();
|
|
||||||
|
|
||||||
$cs->registerScriptFile($assetsUrl . '/js/ace.js');
|
|
||||||
|
|
||||||
$id = WhHtml::getOption('id', $this->htmlOptions, $this->getId());
|
|
||||||
|
|
||||||
/* Global value that will hold the editor */
|
|
||||||
$cs->registerScript(uniqid(__CLASS__ . '#' . $id, true), 'var ' . $id . ';', CClientScript::POS_HEAD);
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
/* initialize plugin */
|
|
||||||
$selector = WhHtml::getOption('id', $this->htmlOptions, $this->getId());
|
|
||||||
|
|
||||||
echo $selector . '= ace.edit("' . $id . '");' . PHP_EOL;
|
|
||||||
echo $selector . '.setTheme("ace/theme/' . $this->theme . '");' . PHP_EOL;
|
|
||||||
echo $selector . '.getSession().setMode("ace/mode/' . $this->mode . '");' . PHP_EOL;
|
|
||||||
|
|
||||||
if (!empty($this->events) && is_array($this->events)) {
|
|
||||||
foreach ($this->events as $name => $handler) {
|
|
||||||
$handler = ($handler instanceof CJavaScriptExpression)
|
|
||||||
? $handler
|
|
||||||
: new CJavaScriptExpression($handler);
|
|
||||||
|
|
||||||
echo $id . ".getSession().on('{$name}', {$handler});" . PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$cs->registerScript(uniqid(__CLASS__ . '#ReadyJS' . $id, true), ob_get_clean());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,86 +0,0 @@
|
|||||||
ace.define("ace/ext/searchbox", ["require", "exports", "module", "ace/lib/dom", "ace/lib/lang", "ace/lib/event", "ace/keyboard/hash_handler", "ace/lib/keys"], function (e, t, n) {
|
|
||||||
var r = e("../lib/dom"), i = e("../lib/lang"), s = e("../lib/event"), o = "/* ------------------------------------------------------------------------------------------* Editor Search Form* --------------------------------------------------------------------------------------- */.ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 297px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;display: block;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;display: block;float: left;height: 22px;margin: 0;padding: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;display: block;float: right;font-family: Arial;font-size: 16px;height: 14px;line-height: 16px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}", u = e("../keyboard/hash_handler").HashHandler, a = e("../lib/keys");
|
|
||||||
r.importCssString(o, "ace_searchbox");
|
|
||||||
var f = '<div class="ace_search right"> <button action="hide" class="ace_searchbtn_close"></button> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"> <button action="findNext" class="ace_searchbtn next"></button> <button action="findPrev" class="ace_searchbtn prev"></button> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"> <button action="replace" class="ace_replacebtn">Replace</button> <button action="replaceAll" class="ace_replacebtn">All</button> </div></div>'.replace(/>\s+/g, ">"), l = function (e, t, n) {
|
|
||||||
var i = r.createElement("div");
|
|
||||||
i.innerHTML = f, this.element = i.firstChild, this.$init(), this.setEditor(e)
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.setEditor = function (e) {
|
|
||||||
e.searchBox = this, e.container.appendChild(this.element), this.editor = e
|
|
||||||
}, this.$init = function () {
|
|
||||||
var e = this.element;
|
|
||||||
this.searchBox = e.querySelector(".ace_search_form"), this.replaceBox = e.querySelector(".ace_replace_form"), this.searchInput = this.searchBox.querySelector(".ace_search_field"), this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
|
|
||||||
var t = this;
|
|
||||||
s.addListener(e, "mousedown", function (e) {
|
|
||||||
setTimeout(function () {
|
|
||||||
t.activeInput.focus()
|
|
||||||
}, 0), s.stopPropagation(e)
|
|
||||||
}), s.addListener(e, "click", function (e) {
|
|
||||||
var n = e.target, r = n.getAttribute("action");
|
|
||||||
r && t[r] && t[r](), s.stopPropagation(e)
|
|
||||||
}), s.addCommandKeyListener(e, function (e, n, r) {
|
|
||||||
var i = a.keyCodeToString(r), o = t.$searchBarKb.findKeyCommand(n, i);
|
|
||||||
o && o.exec && (o.exec(t), s.stopEvent(e))
|
|
||||||
}), this.$onChange = i.delayedCall(function () {
|
|
||||||
t.find(!1, !1)
|
|
||||||
}), s.addListener(this.searchInput, "input", function () {
|
|
||||||
t.$onChange.schedule(20)
|
|
||||||
}), s.addListener(this.searchInput, "focus", function () {
|
|
||||||
t.activeInput = t.searchInput
|
|
||||||
}), s.addListener(this.replaceInput, "focus", function () {
|
|
||||||
t.activeInput = t.replaceInput
|
|
||||||
})
|
|
||||||
}, this.$closeSearchBarKb = new u([
|
|
||||||
{bindKey: "Esc", name: "closeSearchBar", exec: function (e) {
|
|
||||||
e.searchBox.hide()
|
|
||||||
}}
|
|
||||||
]), this.$searchBarKb = new u, this.$searchBarKb.bindKeys({"Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function (e) {
|
|
||||||
var t = e.isReplace = !e.isReplace;
|
|
||||||
e.replaceBox.style.display = t ? "" : "none", e[t ? "replaceInput" : "searchInput"].focus()
|
|
||||||
}, esc: function (e) {
|
|
||||||
setTimeout(function () {
|
|
||||||
e.hide()
|
|
||||||
})
|
|
||||||
}, Return: function (e) {
|
|
||||||
e.activeInput == e.replaceInput && e.replace(), e.findNext()
|
|
||||||
}, "Shift-Return": function (e) {
|
|
||||||
e.activeInput == e.replaceInput && e.replace(), e.findPrev()
|
|
||||||
}, Tab: function (e) {
|
|
||||||
(e.activeInput == e.replaceInput ? e.searchInput : e.replaceInput).focus()
|
|
||||||
}}), this.find = function (e, t) {
|
|
||||||
this.editor.find(this.searchInput.value, {skipCurrent: e, backwards: t, wrap: !0}), this.editor.session.highlight(this.editor.$search.$options.re)
|
|
||||||
}, this.findNext = function () {
|
|
||||||
this.find(!0, !1)
|
|
||||||
}, this.findPrev = function () {
|
|
||||||
this.find(!0, !0)
|
|
||||||
}, this.replace = function () {
|
|
||||||
this.editor.replace(this.replaceInput.value), this.findNext()
|
|
||||||
}, this.replaceAll = function () {
|
|
||||||
this.editor.replaceAll(this.replaceInput.value)
|
|
||||||
}, this.hide = function () {
|
|
||||||
this.element.style.display = "none", this.editor.keyBinding.removeKeyboardHandler(this.$searchKeybingin), this.editor.focus()
|
|
||||||
}, this.show = function (e, t) {
|
|
||||||
this.element.style.display = "", this.replaceBox.style.display = t ? "" : "none", this.isReplace = t, e && (this.searchInput.value = e), this.searchInput.focus(), this.searchInput.select(), this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)
|
|
||||||
}
|
|
||||||
}).call(l.prototype), t.SearchBox = l, t.Search = function (e, t) {
|
|
||||||
var n = e.searchBox || new l(e);
|
|
||||||
n.show(e.session.getTextRange(), t)
|
|
||||||
}, t.ISearch = function (e, t) {
|
|
||||||
this.$changeListener = this.$changeListener.bind(this), this.startRange = e.selection.toOrientedRange(), this.options = t || {}
|
|
||||||
}, function () {
|
|
||||||
this.setSession = function (e) {
|
|
||||||
this.session && this.session.removeListener(this.$changeListener), this.session = e, this.session.addListener(this.$changeListener)
|
|
||||||
}, this.setSearchString = function () {
|
|
||||||
}, this.getValue = function () {
|
|
||||||
return this.value == null && (this.value = this.session.getValue()), this.value
|
|
||||||
}, this.$changeListener = function () {
|
|
||||||
this.value = null
|
|
||||||
}, this.find = function () {
|
|
||||||
}, this.$edgeBefore = function () {
|
|
||||||
this.cursor = this.startRange[this.options.backwards ? "start" : "end"]
|
|
||||||
}, this.$edgeAfter = function () {
|
|
||||||
}, this.next = function (e) {
|
|
||||||
}
|
|
||||||
}.call(t.ISearch.prototype)
|
|
||||||
})
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
ace.define("ace/ext/spellcheck", ["require", "exports", "module"], function (e, t, n) {
|
|
||||||
text.spellcheck = !0, host.on("nativecontextmenu", function (e) {
|
|
||||||
if (!host.selection.isEmpty())return;
|
|
||||||
var t = host.getCursorPosition(), n = host.session.getWordRange(t.row, t.column), r = host.session.getTextRange(n);
|
|
||||||
host.session.tokenRe.lastIndex = 0;
|
|
||||||
if (!host.session.tokenRe.test(r))return;
|
|
||||||
var e = r + " " + PLACEHOLDER;
|
|
||||||
text.value = e, text.setSelectionRange(r.length + 1, r.length + 1), text.setSelectionRange(0, 0), inputHandler = function (t) {
|
|
||||||
if (t == e)return"";
|
|
||||||
if (t.lastIndexOf(e) == t.length - e.length)return t.slice(0, -e.length);
|
|
||||||
if (t.indexOf(e) == 0)return t.slice(e.length);
|
|
||||||
if (t.slice(-2) == PLACEHOLDER) {
|
|
||||||
var r = t.slice(0, -2);
|
|
||||||
if (r.slice(-1) == " ")return r = r.slice(0, -1), host.session.replace(n, r), r
|
|
||||||
}
|
|
||||||
return t
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
ace.define("ace/ext/static_highlight", ["require", "exports", "module", "ace/edit_session", "ace/layer/text"], function (e, t, n) {
|
|
||||||
var r = e("../edit_session").EditSession, i = e("../layer/text").Text, s = ".ace_editor {font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;font-size: 12px;}.ace_editor .ace_gutter { width: 25px !important;display: block;float: left;text-align: right; padding: 0 3px 0 0; margin-right: 3px;}.ace_line { clear: both; }*.ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}";
|
|
||||||
t.render = function (e, t, n, o, u) {
|
|
||||||
o = parseInt(o || 1, 10);
|
|
||||||
var a = new r("");
|
|
||||||
a.setMode(t), a.setUseWorker(!1);
|
|
||||||
var f = new i(document.createElement("div"));
|
|
||||||
f.setSession(a), f.config = {characterWidth: 10, lineHeight: 20}, a.setValue(e);
|
|
||||||
var l = [], c = a.getLength();
|
|
||||||
for (var h = 0; h < c; h++)l.push("<div class='ace_line'>"), u || l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (h + o) + "</span>"), f.$renderLine(l, h, !0, !1), l.push("</div>");
|
|
||||||
var p = "<div class=':cssClass'> <div class='ace_editor ace_scroller ace_text-layer'> :code </div> </div>".replace(/:cssClass/, n.cssClass).replace(/:code/, l.join(""));
|
|
||||||
return f.destroy(), {css: s + n.cssText, html: p}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -1,185 +0,0 @@
|
|||||||
ace.define("ace/ext/textarea", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/lib/net", "ace/ace", "ace/theme/textmate", "ace/mode/text"], function (e, t, n) {
|
|
||||||
function a(e, t) {
|
|
||||||
for (var n in t)e.style[n] = t[n]
|
|
||||||
}
|
|
||||||
|
|
||||||
function f(e, t) {
|
|
||||||
if (e.type != "textarea")throw"Textarea required!";
|
|
||||||
var n = e.parentNode, i = document.createElement("div"), s = function () {
|
|
||||||
var t = "position:relative;";
|
|
||||||
["margin-top", "margin-left", "margin-right", "margin-bottom"].forEach(function (n) {
|
|
||||||
t += n + ":" + u(e, i, n) + ";"
|
|
||||||
});
|
|
||||||
var n = u(e, i, "width") || e.clientWidth + "px", r = u(e, i, "height") || e.clientHeight + "px";
|
|
||||||
t += "height:" + r + ";width:" + n + ";", t += "display:inline-block;", i.setAttribute("style", t)
|
|
||||||
};
|
|
||||||
r.addListener(window, "resize", s), s(), n.insertBefore(i, e.nextSibling);
|
|
||||||
while (n !== document) {
|
|
||||||
if (n.tagName.toUpperCase() === "FORM") {
|
|
||||||
var o = n.onsubmit;
|
|
||||||
n.onsubmit = function (n) {
|
|
||||||
e.value = t(), o && o.call(this, n)
|
|
||||||
};
|
|
||||||
break
|
|
||||||
}
|
|
||||||
n = n.parentNode
|
|
||||||
}
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
|
|
||||||
function l(t, n, r) {
|
|
||||||
s.loadScript(t, function () {
|
|
||||||
e([n], r)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function c(n, r, i, s, o, u) {
|
|
||||||
function c(e) {
|
|
||||||
return e === "true" || e == 1
|
|
||||||
}
|
|
||||||
|
|
||||||
var a = n.getSession(), f = n.renderer;
|
|
||||||
u = u || l, n.setDisplaySettings = function (e) {
|
|
||||||
e == null && (e = i.style.display == "none"), e ? (i.style.display = "block", i.hideButton.focus(), n.on("focus", function t() {
|
|
||||||
n.removeListener("focus", t), i.style.display = "none"
|
|
||||||
})) : n.focus()
|
|
||||||
}, n.setOption = function (t, i) {
|
|
||||||
if (o[t] == i)return;
|
|
||||||
switch (t) {
|
|
||||||
case"gutter":
|
|
||||||
f.setShowGutter(c(i));
|
|
||||||
break;
|
|
||||||
case"mode":
|
|
||||||
i != "text" ? u("mode-" + i + ".js", "ace/mode/" + i, function () {
|
|
||||||
var t = e("../mode/" + i).Mode;
|
|
||||||
a.setMode(new t)
|
|
||||||
}) : a.setMode(new (e("../mode/text").Mode));
|
|
||||||
break;
|
|
||||||
case"theme":
|
|
||||||
i != "textmate" ? u("theme-" + i + ".js", "ace/theme/" + i, function () {
|
|
||||||
n.setTheme("ace/theme/" + i)
|
|
||||||
}) : n.setTheme("ace/theme/textmate");
|
|
||||||
break;
|
|
||||||
case"fontSize":
|
|
||||||
r.style.fontSize = i;
|
|
||||||
break;
|
|
||||||
case"keybindings":
|
|
||||||
switch (i) {
|
|
||||||
case"vim":
|
|
||||||
n.setKeyboardHandler("ace/keyboard/vim");
|
|
||||||
break;
|
|
||||||
case"emacs":
|
|
||||||
n.setKeyboardHandler("ace/keyboard/emacs");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
n.setKeyboardHandler(null)
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case"softWrap":
|
|
||||||
switch (i) {
|
|
||||||
case"off":
|
|
||||||
a.setUseWrapMode(!1), f.setPrintMarginColumn(80);
|
|
||||||
break;
|
|
||||||
case"40":
|
|
||||||
a.setUseWrapMode(!0), a.setWrapLimitRange(40, 40), f.setPrintMarginColumn(40);
|
|
||||||
break;
|
|
||||||
case"80":
|
|
||||||
a.setUseWrapMode(!0), a.setWrapLimitRange(80, 80), f.setPrintMarginColumn(80);
|
|
||||||
break;
|
|
||||||
case"free":
|
|
||||||
a.setUseWrapMode(!0), a.setWrapLimitRange(null, null), f.setPrintMarginColumn(80)
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case"useSoftTabs":
|
|
||||||
a.setUseSoftTabs(c(i));
|
|
||||||
break;
|
|
||||||
case"showPrintMargin":
|
|
||||||
f.setShowPrintMargin(c(i));
|
|
||||||
break;
|
|
||||||
case"showInvisibles":
|
|
||||||
n.setShowInvisibles(c(i))
|
|
||||||
}
|
|
||||||
o[t] = i
|
|
||||||
}, n.getOption = function (e) {
|
|
||||||
return o[e]
|
|
||||||
}, n.getOptions = function () {
|
|
||||||
return o
|
|
||||||
};
|
|
||||||
for (var h in t.options)n.setOption(h, t.options[h]);
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
function h(e, t, n, i) {
|
|
||||||
function f(e, t, n, r) {
|
|
||||||
if (!n) {
|
|
||||||
e.push("<input type='checkbox' title='", t, "' ", r == "true" ? "checked='true'" : "", "'></input>");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
e.push("<select title='" + t + "'>");
|
|
||||||
for (var i in n)e.push("<option value='" + i + "' "), r == i && e.push(" selected "), e.push(">", n[i], "</option>");
|
|
||||||
e.push("</select>")
|
|
||||||
}
|
|
||||||
|
|
||||||
var s = null, o = {mode: "Mode:", gutter: "Display Gutter:", theme: "Theme:", fontSize: "Font Size:", softWrap: "Soft Wrap:", keybindings: "Keyboard", showPrintMargin: "Show Print Margin:", useSoftTabs: "Use Soft Tabs:", showInvisibles: "Show Invisibles"}, u = {mode: {text: "Plain", javascript: "JavaScript", xml: "XML", html: "HTML", css: "CSS", scss: "SCSS", python: "Python", php: "PHP", java: "Java", ruby: "Ruby", c_cpp: "C/C++", coffee: "CoffeeScript", json: "json", perl: "Perl", clojure: "Clojure", ocaml: "OCaml", csharp: "C#", haxe: "haXe", svg: "SVG", textile: "Textile", groovy: "Groovy", liquid: "Liquid", Scala: "Scala"}, theme: {clouds: "Clouds", clouds_midnight: "Clouds Midnight", cobalt: "Cobalt", crimson_editor: "Crimson Editor", dawn: "Dawn", eclipse: "Eclipse", idle_fingers: "Idle Fingers", kr_theme: "Kr Theme", merbivore: "Merbivore", merbivore_soft: "Merbivore Soft", mono_industrial: "Mono Industrial", monokai: "Monokai", pastel_on_dark: "Pastel On Dark", solarized_dark: "Solarized Dark", solarized_light: "Solarized Light", textmate: "Textmate", twilight: "Twilight", vibrant_ink: "Vibrant Ink"}, gutter: s, fontSize: {"10px": "10px", "11px": "11px", "12px": "12px", "14px": "14px", "16px": "16px"}, softWrap: {off: "Off", 40: "40", 80: "80", free: "Free"}, keybindings: {ace: "ace", vim: "vim", emacs: "emacs"}, showPrintMargin: s, useSoftTabs: s, showInvisibles: s}, a = [];
|
|
||||||
a.push("<table><tr><th>Setting</th><th>Value</th></tr>");
|
|
||||||
for (var l in i)a.push("<tr><td>", o[l], "</td>"), a.push("<td>"), f(a, l, u[l], i[l]), a.push("</td></tr>");
|
|
||||||
a.push("</table>"), e.innerHTML = a.join("");
|
|
||||||
var c = function (e) {
|
|
||||||
var t = e.currentTarget;
|
|
||||||
n.setOption(t.title, t.value)
|
|
||||||
}, h = function (e) {
|
|
||||||
var t = e.currentTarget;
|
|
||||||
n.setOption(t.title, t.checked)
|
|
||||||
}, p = e.getElementsByTagName("select");
|
|
||||||
for (var d = 0; d < p.length; d++)p[d].onchange = c;
|
|
||||||
var v = e.getElementsByTagName("input");
|
|
||||||
for (var d = 0; d < v.length; d++)v[d].onclick = h;
|
|
||||||
var m = document.createElement("input");
|
|
||||||
m.type = "button", m.value = "Hide", r.addListener(m, "click", function () {
|
|
||||||
n.setDisplaySettings(!1)
|
|
||||||
}), e.appendChild(m), e.hideButton = m
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("../lib/event"), i = e("../lib/useragent"), s = e("../lib/net"), o = e("../ace");
|
|
||||||
e("../theme/textmate"), n.exports = t = o;
|
|
||||||
var u = function (e, t, n) {
|
|
||||||
var r = e.style[n];
|
|
||||||
r || (window.getComputedStyle ? r = window.getComputedStyle(e, "").getPropertyValue(n) : r = e.currentStyle[n]);
|
|
||||||
if (!r || r == "auto" || r == "intrinsic")r = t.style[n];
|
|
||||||
return r
|
|
||||||
};
|
|
||||||
t.transformTextarea = function (e, t) {
|
|
||||||
var n, s = f(e, function () {
|
|
||||||
return n.getValue()
|
|
||||||
});
|
|
||||||
e.style.display = "none", s.style.background = "white";
|
|
||||||
var u = document.createElement("div");
|
|
||||||
a(u, {top: "0px", left: "0px", right: "0px", bottom: "0px", border: "1px solid gray", position: "absolute"}), s.appendChild(u);
|
|
||||||
var l = document.createElement("div");
|
|
||||||
a(l, {position: "absolute", right: "0px", bottom: "0px", background: "red", cursor: "nw-resize", borderStyle: "solid", borderWidth: "9px 8px 10px 9px", width: "2px", borderColor: "lightblue gray gray lightblue", zIndex: 101});
|
|
||||||
var p = document.createElement("div"), d = {top: "0px", left: "20%", right: "0px", bottom: "0px", position: "absolute", padding: "5px", zIndex: 100, color: "white", display: "none", overflow: "auto", fontSize: "14px", boxShadow: "-5px 2px 3px gray"};
|
|
||||||
i.isOldIE ? d.backgroundColor = "#333" : d.backgroundColor = "rgba(0, 0, 0, 0.6)", a(p, d), s.appendChild(p);
|
|
||||||
var v = {}, m = o.edit(u);
|
|
||||||
n = m.getSession(), n.setValue(e.value || e.innerHTML), m.focus(), s.appendChild(l), c(m, u, p, o, v, t), h(p, l, m, v);
|
|
||||||
var g = "";
|
|
||||||
return r.addListener(l, "mousemove", function (e) {
|
|
||||||
var t = this.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
|
|
||||||
n + r < (t.width + t.height) / 2 ? (this.style.cursor = "pointer", g = "toggle") : (g = "resize", this.style.cursor = "nw-resize")
|
|
||||||
}), r.addListener(l, "mousedown", function (e) {
|
|
||||||
if (g == "toggle") {
|
|
||||||
m.setDisplaySettings();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
s.style.zIndex = 1e5;
|
|
||||||
var t = s.getBoundingClientRect(), n = t.width + t.left - e.clientX, i = t.height + t.top - e.clientY;
|
|
||||||
r.capture(l, function (e) {
|
|
||||||
s.style.width = e.clientX - t.left + n + "px", s.style.height = e.clientY - t.top + i + "px", m.resize()
|
|
||||||
}, function () {
|
|
||||||
})
|
|
||||||
}), m
|
|
||||||
}, t.options = {mode: "text", theme: "textmate", gutter: "false", fontSize: "12px", softWrap: "off", keybindings: "ace", showPrintMargin: "false", useSoftTabs: "true", showInvisibles: "false"}
|
|
||||||
}), ace.define("ace/theme/textmate", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
|
|
||||||
t.isDark = !1, t.cssClass = "ace-tm", t.cssText = '.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm .ace_scroller {background-color: #FFFFFF;}.ace-tm .ace_cursor {border-left: 2px solid black;}.ace-tm .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_markup.ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_markup.ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';
|
|
||||||
var r = e("../lib/dom");
|
|
||||||
r.importCssString(t.cssText, t.cssClass)
|
|
||||||
})
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
ace.define("ace/keyboard/emacs", ["require", "exports", "module", "ace/lib/dom", "ace/keyboard/hash_handler", "ace/lib/keys"], function (e, t, n) {
|
|
||||||
var r = e("../lib/dom"), i = function (e, t) {
|
|
||||||
var n = this.scroller.getBoundingClientRect(), r = Math.floor((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth), i = Math.floor((t + this.scrollTop - n.top) / this.lineHeight);
|
|
||||||
return this.session.screenToDocumentPosition(i, r)
|
|
||||||
}, s = e("./hash_handler").HashHandler;
|
|
||||||
t.handler = new s;
|
|
||||||
var o = !1, u, a;
|
|
||||||
t.handler.attach = function (e) {
|
|
||||||
o || (o = !0, r.importCssString(" .emacs-mode .ace_cursor{ border: 2px rgba(50,250,50,0.8) solid!important; -moz-box-sizing: border-box!important; -webkit-box-sizing: border-box!important; box-sizing: border-box!important; background-color: rgba(0,250,0,0.9); opacity: 0.5; } .emacs-mode .ace_cursor.ace_hidden{ opacity: 1; background-color: transparent; } .emacs-mode .ace_overwrite-cursors .ace_cursor { opacity: 1; background-color: transparent; border-width: 0 0 2px 2px !important; } .emacs-mode .ace_text-layer { z-index: 4 } .emacs-mode .ace_cursor-layer { z-index: 2 }", "emacsMode")), u = e.session.$selectLongWords, e.session.$selectLongWords = !0, a = e.session.$useEmacsStyleLineStart, e.session.$useEmacsStyleLineStart = !0, e.session.$emacsMark = null, t.markMode = function () {
|
|
||||||
return e.session.$emacsMark
|
|
||||||
}, t.setMarkMode = function (t) {
|
|
||||||
e.session.$emacsMark = t
|
|
||||||
}, e.on("click", l), e.on("changeSession", f), e.renderer.screenToTextCoordinates = i, e.setStyle("emacs-mode")
|
|
||||||
}, t.handler.detach = function (e) {
|
|
||||||
delete e.renderer.screenToTextCoordinates, e.session.$selectLongWords = u, e.session.$useEmacsStyleLineStart = a, e.removeEventListener("click", l), e.removeEventListener("changeSession", f), e.unsetStyle("emacs-mode")
|
|
||||||
};
|
|
||||||
var f = function (e) {
|
|
||||||
e.oldSession && (e.oldSession.$selectLongWords = u, e.oldSession.$useEmacsStyleLineStart = a), u = e.session.$selectLongWords, e.session.$selectLongWords = !0, a = e.session.$useEmacsStyleLineStart, e.session.$useEmacsStyleLineStart = !0, e.session.hasOwnProperty("$emacsMark") || (e.session.$emacsMark = null)
|
|
||||||
}, l = function (e) {
|
|
||||||
e.editor.session.$emacsMark = null
|
|
||||||
}, c = e("../lib/keys").KEY_MODS, h = {C: "ctrl", S: "shift", M: "alt"};
|
|
||||||
["S-C-M", "S-C", "S-M", "C-M", "S", "C", "M"].forEach(function (e) {
|
|
||||||
var t = 0;
|
|
||||||
e.split("-").forEach(function (e) {
|
|
||||||
t |= c[h[e]]
|
|
||||||
}), h[t] = e.toLowerCase() + "-"
|
|
||||||
}), t.handler.bindKey = function (e, t) {
|
|
||||||
if (!e)return;
|
|
||||||
var n = this.commmandKeyBinding;
|
|
||||||
e.split("|").forEach(function (e) {
|
|
||||||
e = e.toLowerCase(), n[e] = t, e = e.split(" ")[0], n[e] || (n[e] = "null")
|
|
||||||
}, this)
|
|
||||||
}, t.handler.handleKeyboard = function (e, n, r, i) {
|
|
||||||
if (n == -1) {
|
|
||||||
t.setMarkMode(null);
|
|
||||||
if (e.count) {
|
|
||||||
var s = Array(e.count + 1).join(r);
|
|
||||||
return e.count = null, {command: "insertstring", args: s}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (r == "\0")return;
|
|
||||||
var o = h[n];
|
|
||||||
if (o == "c-" || e.universalArgument) {
|
|
||||||
var u = parseInt(r[r.length - 1]);
|
|
||||||
if (u)return e.count = u, {command: "null"}
|
|
||||||
}
|
|
||||||
e.universalArgument = !1, o && (r = o + r), e.keyChain && (r = e.keyChain += " " + r);
|
|
||||||
var a = this.commmandKeyBinding[r];
|
|
||||||
e.keyChain = a == "null" ? r : "";
|
|
||||||
if (!a)return;
|
|
||||||
if (a == "null")return{command: "null"};
|
|
||||||
if (a == "universalArgument")return e.universalArgument = !0, {command: "null"};
|
|
||||||
if (typeof a != "string") {
|
|
||||||
var f = a.args;
|
|
||||||
a = a.command, a == "goorselect" && (a = f[0], t.markMode() && (a = f[1]), f = null)
|
|
||||||
}
|
|
||||||
typeof a == "string" && ((a == "insertstring" || a == "splitline" || a == "togglecomment") && t.setMarkMode(null), a = this.commands[a] || e.editor.commands.commands[a]), !a.readonly && !a.isYank && (e.lastCommand = null);
|
|
||||||
if (e.count) {
|
|
||||||
var u = e.count;
|
|
||||||
return e.count = 0, {args: f, command: {exec: function (e, t) {
|
|
||||||
for (var n = 0; n < u; n++)a.exec(e, t)
|
|
||||||
}}}
|
|
||||||
}
|
|
||||||
return{command: a, args: f}
|
|
||||||
}, t.emacsKeys = {"Up|C-p": {command: "goorselect", args: ["golineup", "selectup"]}, "Down|C-n": {command: "goorselect", args: ["golinedown", "selectdown"]}, "Left|C-b": {command: "goorselect", args: ["gotoleft", "selectleft"]}, "Right|C-f": {command: "goorselect", args: ["gotoright", "selectright"]}, "C-Left|M-b": {command: "goorselect", args: ["gotowordleft", "selectwordleft"]}, "C-Right|M-f": {command: "goorselect", args: ["gotowordright", "selectwordright"]}, "Home|C-a": {command: "goorselect", args: ["gotolinestart", "selecttolinestart"]}, "End|C-e": {command: "goorselect", args: ["gotolineend", "selecttolineend"]}, "C-Home|S-M-,": {command: "goorselect", args: ["gotostart", "selecttostart"]}, "C-End|S-M-.": {command: "goorselect", args: ["gotoend", "selecttoend"]}, "S-Up|S-C-p": "selectup", "S-Down|S-C-n": "selectdown", "S-Left|S-C-b": "selectleft", "S-Right|S-C-f": "selectright", "S-C-Left|S-M-b": "selectwordleft", "S-C-Right|S-M-f": "selectwordright", "S-Home|S-C-a": "selecttolinestart", "S-End|S-C-e": "selecttolineend", "S-C-Home": "selecttostart", "S-C-End": "selecttoend", "C-l": "recenterTopBottom", "M-s": "centerselection", "M-g": "gotoline", "C-x C-p": "selectall", "C-Down": {command: "goorselect", args: ["gotopagedown", "selectpagedown"]}, "C-Up": {command: "goorselect", args: ["gotopageup", "selectpageup"]}, "PageDown|C-v": {command: "goorselect", args: ["gotopagedown", "selectpagedown"]}, "PageUp|M-v": {command: "goorselect", args: ["gotopageup", "selectpageup"]}, "S-C-Down": "selectpagedown", "S-C-Up": "selectpageup", "C-s": "findnext", "C-r": "findprevious", "M-C-s": "findnext", "M-C-r": "findprevious", "S-M-5": "replace", Backspace: "backspace", "Delete|C-d": "del", "Return|C-m": {command: "insertstring", args: "\n"}, "C-o": "splitline", "M-d|C-Delete": {command: "killWord", args: "right"}, "C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"}, "C-k": "killLine", "C-y|S-Delete": "yank", "M-y": "yankRotate", "C-g": "keyboardQuit", "C-w": "killRegion", "M-w": "killRingSave", "C-Space": "setMark", "C-x C-x": "exchangePointAndMark", "C-t": "transposeletters", "M-u": "touppercase", "M-l": "tolowercase", "M-/": "autocomplete", "C-u": "universalArgument", "M-;": "togglecomment", "C-/|C-x u|S-C--|C-z": "undo", "S-C-/|S-C-x u|C--|S-C-z": "redo", "C-x r": "selectRectangularRegion"}, t.handler.bindKeys(t.emacsKeys), t.handler.addCommands({recenterTopBottom: function (e) {
|
|
||||||
var t = e.renderer, n = t.$cursorLayer.getPixelPosition(), r = t.$size.scrollerHeight - t.lineHeight, i = t.scrollTop;
|
|
||||||
Math.abs(n.top - i) < 2 ? i = n.top - r : Math.abs(n.top - i - r * .5) < 2 ? i = n.top : i = n.top - r * .5, e.session.setScrollTop(i)
|
|
||||||
}, selectRectangularRegion: function (e) {
|
|
||||||
e.multiSelect.toggleBlockSelection()
|
|
||||||
}, setMark: function (e) {
|
|
||||||
var n = t.markMode();
|
|
||||||
if (n) {
|
|
||||||
cp = e.getCursorPosition();
|
|
||||||
if (e.selection.isEmpty() && n.row == cp.row && n.column == cp.column) {
|
|
||||||
t.setMarkMode(null);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
n = e.getCursorPosition(), t.setMarkMode(n), e.selection.setSelectionAnchor(n.row, n.column)
|
|
||||||
}, exchangePointAndMark: {exec: function (e) {
|
|
||||||
var t = e.selection.getRange();
|
|
||||||
e.selection.setSelectionRange(t, !e.selection.isBackwards())
|
|
||||||
}, readonly: !0, multiselectAction: "forEach"}, killWord: {exec: function (e, n) {
|
|
||||||
e.clearSelection(), n == "left" ? e.selection.selectWordLeft() : e.selection.selectWordRight();
|
|
||||||
var r = e.getSelectionRange(), i = e.session.getTextRange(r);
|
|
||||||
t.killRing.add(i), e.session.remove(r), e.clearSelection()
|
|
||||||
}, multiselectAction: "forEach"}, killLine: function (e) {
|
|
||||||
t.setMarkMode(null);
|
|
||||||
var n = e.getCursorPosition();
|
|
||||||
n.column == 0 && e.session.doc.getLine(n.row).length == 0 ? e.selection.selectLine() : (e.clearSelection(), e.selection.selectLineEnd());
|
|
||||||
var r = e.getSelectionRange(), i = e.session.getTextRange(r);
|
|
||||||
t.killRing.add(i), e.session.remove(r), e.clearSelection()
|
|
||||||
}, yank: function (e) {
|
|
||||||
e.onPaste(t.killRing.get()), e.keyBinding.$data.lastCommand = "yank"
|
|
||||||
}, yankRotate: function (e) {
|
|
||||||
if (e.keyBinding.$data.lastCommand != "yank")return;
|
|
||||||
e.undo(), e.onPaste(t.killRing.rotate()), e.keyBinding.$data.lastCommand = "yank"
|
|
||||||
}, killRegion: function (e) {
|
|
||||||
t.killRing.add(e.getCopyText()), e.commands.byName.cut.exec(e)
|
|
||||||
}, killRingSave: function (e) {
|
|
||||||
t.killRing.add(e.getCopyText())
|
|
||||||
}});
|
|
||||||
var p = t.handler.commands;
|
|
||||||
p.yank.isYank = !0, p.yankRotate.isYank = !0, t.killRing = {$data: [], add: function (e) {
|
|
||||||
e && this.$data.push(e), this.$data.length > 30 && this.$data.shift()
|
|
||||||
}, get: function () {
|
|
||||||
return this.$data[this.$data.length - 1] || ""
|
|
||||||
}, pop: function () {
|
|
||||||
return this.$data.length > 1 && this.$data.pop(), this.get()
|
|
||||||
}, rotate: function () {
|
|
||||||
return this.$data.unshift(this.$data.pop()), this.get()
|
|
||||||
}}
|
|
||||||
})
|
|
||||||
@ -1,592 +0,0 @@
|
|||||||
ace.define("ace/keyboard/vim", ["require", "exports", "module", "ace/keyboard/vim/commands", "ace/keyboard/vim/maps/util", "ace/lib/useragent"], function (e, t, n) {
|
|
||||||
var r = e("./vim/commands"), i = r.coreCommands, s = e("./vim/maps/util"), o = e("../lib/useragent"), u = {i: {command: i.start}, I: {command: i.startBeginning}, a: {command: i.append}, A: {command: i.appendEnd}, "ctrl-f": {command: "gotopagedown"}, "ctrl-b": {command: "gotopageup"}};
|
|
||||||
t.handler = {handleMacRepeat: function (e, t, n) {
|
|
||||||
if (t == -1)e.inputChar = n, e.lastEvent = "input"; else if (e.inputChar && e.$lastHash == t && e.$lastKey == n) {
|
|
||||||
if (e.lastEvent == "input")e.lastEvent = "input1"; else if (e.lastEvent == "input1")return!0
|
|
||||||
} else e.$lastHash = t, e.$lastKey = n, e.lastEvent = "keypress"
|
|
||||||
}, handleKeyboard: function (e, t, n, s, a) {
|
|
||||||
if (t != 0 && (n == "" || n == "\0"))return null;
|
|
||||||
t == 1 && (n = "ctrl-" + n);
|
|
||||||
if (n == "esc" && t == 0 || n == "ctrl-[")return{command: i.stop};
|
|
||||||
if (e.state == "start") {
|
|
||||||
o.isMac && this.handleMacRepeat(e, t, n) && (t = -1, n = e.inputChar);
|
|
||||||
if (t == -1 || t == 1 || t == 0 && n.length > 1)return r.inputBuffer.idle && u[n] ? u[n] : {command: {exec: function (e) {
|
|
||||||
return r.inputBuffer.push(e, n)
|
|
||||||
}}};
|
|
||||||
if (n.length == 1 && (t == 0 || t == 4))return{command: "null", passEvent: !0};
|
|
||||||
if (n == "esc" && t == 0)return{command: i.stop}
|
|
||||||
} else if (n == "ctrl-w")return{command: "removewordleft"}
|
|
||||||
}, attach: function (e) {
|
|
||||||
e.on("click", t.onCursorMove), s.currentMode !== "insert" && r.coreCommands.stop.exec(e), e.$vimModeHandler = this
|
|
||||||
}, detach: function (e) {
|
|
||||||
e.removeListener("click", t.onCursorMove), s.noMode(e), s.currentMode = "normal"
|
|
||||||
}, actions: r.actions, getStatusText: function () {
|
|
||||||
return s.currentMode == "insert" ? "INSERT" : s.onVisualMode ? (s.onVisualLineMode ? "VISUAL LINE " : "VISUAL ") + r.inputBuffer.status : r.inputBuffer.status
|
|
||||||
}}, t.onCursorMove = function (e) {
|
|
||||||
r.onCursorMove(e.editor, e), t.onCursorMove.scheduled = !1
|
|
||||||
}
|
|
||||||
}), ace.define("ace/keyboard/vim/commands", ["require", "exports", "module", "ace/keyboard/vim/maps/util", "ace/keyboard/vim/maps/motions", "ace/keyboard/vim/maps/operators", "ace/keyboard/vim/maps/aliases", "ace/keyboard/vim/registers"], function (e, t, n) {
|
|
||||||
"never use strict";
|
|
||||||
function g(e) {
|
|
||||||
m.previous = {action: {action: {fn: e}}}
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("./maps/util"), i = e("./maps/motions"), s = e("./maps/operators"), o = e("./maps/aliases"), u = e("./registers"), a = 1, f = 2, l = 3, c = 4, h = 8, p = function (t, n, r) {
|
|
||||||
while (0 < n--)t.apply(this, r)
|
|
||||||
}, d = function (e) {
|
|
||||||
var t = e.renderer, n = t.$cursorLayer.getPixelPosition(), r = n.top, i = h * t.layerConfig.lineHeight;
|
|
||||||
2 * i > t.$size.scrollerHeight && (i = t.$size.scrollerHeight / 2), t.scrollTop > r - i && t.session.setScrollTop(r - i), t.scrollTop + t.$size.scrollerHeight < r + i + t.lineHeight && t.session.setScrollTop(r + i + t.lineHeight - t.$size.scrollerHeight)
|
|
||||||
}, v = t.actions = {z: {param: !0, fn: function (e, t, n, r) {
|
|
||||||
switch (r) {
|
|
||||||
case"z":
|
|
||||||
e.renderer.alignCursor(null, .5);
|
|
||||||
break;
|
|
||||||
case"t":
|
|
||||||
e.renderer.alignCursor(null, 0);
|
|
||||||
break;
|
|
||||||
case"b":
|
|
||||||
e.renderer.alignCursor(null, 1)
|
|
||||||
}
|
|
||||||
}}, r: {param: !0, fn: function (e, t, n, r) {
|
|
||||||
r && r.length && (p(function () {
|
|
||||||
e.insert(r)
|
|
||||||
}, n || 1), e.navigateLeft())
|
|
||||||
}}, R: {fn: function (e, t, n, i) {
|
|
||||||
r.insertMode(e), e.setOverwrite(!0)
|
|
||||||
}}, "~": {fn: function (e, t, n) {
|
|
||||||
p(function () {
|
|
||||||
var t = e.selection.getRange();
|
|
||||||
t.isEmpty() && t.end.column++;
|
|
||||||
var n = e.session.getTextRange(t), r = n.toUpperCase();
|
|
||||||
r == n ? e.navigateRight() : e.session.replace(t, r)
|
|
||||||
}, n || 1)
|
|
||||||
}}, "*": {fn: function (e, t, n, r) {
|
|
||||||
e.selection.selectWord(), e.findNext(), d(e);
|
|
||||||
var i = e.selection.getRange();
|
|
||||||
e.selection.setSelectionRange(i, !0)
|
|
||||||
}}, "#": {fn: function (e, t, n, r) {
|
|
||||||
e.selection.selectWord(), e.findPrevious(), d(e);
|
|
||||||
var i = e.selection.getRange();
|
|
||||||
e.selection.setSelectionRange(i, !0)
|
|
||||||
}}, m: {param: !0, fn: function (e, t, n, r) {
|
|
||||||
var i = e.session, s = i.vimMarkers || (i.vimMarkers = {}), o = e.getCursorPosition();
|
|
||||||
s[r] || (s[r] = e.session.doc.createAnchor(o)), s[r].setPosition(o.row, o.column, !0)
|
|
||||||
}}, n: {fn: function (e, t, n, r) {
|
|
||||||
var i = e.getLastSearchOptions();
|
|
||||||
i.backwards = !1, e.selection.moveCursorRight(), e.selection.clearSelection(), e.findNext(i), d(e);
|
|
||||||
var s = e.selection.getRange();
|
|
||||||
s.end.row = s.start.row, s.end.column = s.start.column, e.selection.setSelectionRange(s, !0)
|
|
||||||
}}, N: {fn: function (e, t, n, r) {
|
|
||||||
var i = e.getLastSearchOptions();
|
|
||||||
i.backwards = !0, e.findPrevious(i), d(e);
|
|
||||||
var s = e.selection.getRange();
|
|
||||||
s.end.row = s.start.row, s.end.column = s.start.column, e.selection.setSelectionRange(s, !0)
|
|
||||||
}}, v: {fn: function (e, t, n, i) {
|
|
||||||
e.selection.selectRight(), r.visualMode(e, !1)
|
|
||||||
}, acceptsMotion: !0}, V: {fn: function (e, t, n, i) {
|
|
||||||
var s = e.getCursorPosition().row;
|
|
||||||
e.selection.clearSelection(), e.selection.moveCursorTo(s, 0), e.selection.selectLineEnd(), e.selection.visualLineStart = s, r.visualMode(e, !0)
|
|
||||||
}, acceptsMotion: !0}, Y: {fn: function (e, t, n, i) {
|
|
||||||
r.copyLine(e)
|
|
||||||
}}, p: {fn: function (e, t, n, r) {
|
|
||||||
var i = u._default;
|
|
||||||
e.setOverwrite(!1);
|
|
||||||
if (i.isLine) {
|
|
||||||
var s = e.getCursorPosition(), o = i.text.split("\n");
|
|
||||||
e.session.getDocument().insertLines(s.row + 1, o), e.moveCursorTo(s.row + 1, 0)
|
|
||||||
} else e.navigateRight(), e.insert(i.text), e.navigateLeft();
|
|
||||||
e.setOverwrite(!0), e.selection.clearSelection()
|
|
||||||
}}, P: {fn: function (e, t, n, r) {
|
|
||||||
var i = u._default;
|
|
||||||
e.setOverwrite(!1);
|
|
||||||
if (i.isLine) {
|
|
||||||
var s = e.getCursorPosition(), o = i.text.split("\n");
|
|
||||||
e.session.getDocument().insertLines(s.row, o), e.moveCursorTo(s.row, 0)
|
|
||||||
} else e.insert(i.text);
|
|
||||||
e.setOverwrite(!0), e.selection.clearSelection()
|
|
||||||
}}, J: {fn: function (e, t, n, r) {
|
|
||||||
var i = e.session;
|
|
||||||
t = e.getSelectionRange();
|
|
||||||
var s = {row: t.start.row, column: t.start.column};
|
|
||||||
n = n || t.end.row - t.start.row;
|
|
||||||
var o = Math.min(s.row + (n || 1), i.getLength() - 1);
|
|
||||||
t.start.column = i.getLine(s.row).length, t.end.column = i.getLine(o).length, t.end.row = o;
|
|
||||||
var u = "";
|
|
||||||
for (var a = s.row; a < o; a++) {
|
|
||||||
var f = i.getLine(a + 1);
|
|
||||||
u += " " + /^\s*(.*)$/.exec(f)[1] || ""
|
|
||||||
}
|
|
||||||
i.replace(t, u), e.moveCursorTo(s.row, s.column)
|
|
||||||
}}, u: {fn: function (e, t, n, r) {
|
|
||||||
n = parseInt(n || 1, 10);
|
|
||||||
for (var i = 0; i < n; i++)e.undo();
|
|
||||||
e.selection.clearSelection()
|
|
||||||
}}, "ctrl-r": {fn: function (e, t, n, r) {
|
|
||||||
n = parseInt(n || 1, 10);
|
|
||||||
for (var i = 0; i < n; i++)e.redo();
|
|
||||||
e.selection.clearSelection()
|
|
||||||
}}, ":": {fn: function (e, t, n, r) {
|
|
||||||
}}, "/": {fn: function (e, t, n, r) {
|
|
||||||
}}, "?": {fn: function (e, t, n, r) {
|
|
||||||
}}, ".": {fn: function (e, t, n, i) {
|
|
||||||
r.onInsertReplaySequence = m.lastInsertCommands;
|
|
||||||
var s = m.previous;
|
|
||||||
s && m.exec(e, s.action, s.param)
|
|
||||||
}}, "ctrl-x": {fn: function (e, t, n, r) {
|
|
||||||
e.modifyNumber(-(n || 1))
|
|
||||||
}}, "ctrl-a": {fn: function (e, t, n, r) {
|
|
||||||
e.modifyNumber(n || 1)
|
|
||||||
}}}, m = t.inputBuffer = {accepting: [a, f, l, c], currentCmd: null, currentCount: "", status: "", operator: null, motion: null, lastInsertCommands: [], push: function (e, t, n) {
|
|
||||||
var r = !0;
|
|
||||||
this.idle = !1;
|
|
||||||
var u = this.waitingForParam;
|
|
||||||
if (u)this.exec(e, u, t); else if (t === "0" && !this.currentCount.length || !t.match(/^\d+$/) || !this.isAccepting(a))if (!this.operator && this.isAccepting(f) && s[t])this.operator = {ch: t, count: this.getCount()}, this.currentCmd = f, this.accepting = [a, l, c], this.exec(e, {operator: this.operator}); else if (i[t] && this.isAccepting(l)) {
|
|
||||||
this.currentCmd = l;
|
|
||||||
var h = {operator: this.operator, motion: {ch: t, count: this.getCount()}};
|
|
||||||
i[t].param ? this.waitForParam(h) : this.exec(e, h)
|
|
||||||
} else if (o[t] && this.isAccepting(l))o[t].operator.count = this.getCount(), this.exec(e, o[t]); else if (v[t] && this.isAccepting(c)) {
|
|
||||||
var p = {action: {fn: v[t].fn, count: this.getCount()}};
|
|
||||||
v[t].param ? this.waitForParam(p) : this.exec(e, p), v[t].acceptsMotion && (this.idle = !1)
|
|
||||||
} else this.operator ? this.exec(e, {operator: this.operator}, t) : (r = t.length == 1, this.reset()); else this.currentCount += t, this.currentCmd = a, this.accepting = [a, f, l, c];
|
|
||||||
if (this.waitingForParam || this.motion || this.operator)this.status += t; else if (this.currentCount)this.status = this.currentCount; else {
|
|
||||||
if (!this.status)return r;
|
|
||||||
this.status = ""
|
|
||||||
}
|
|
||||||
return e._emit("changeStatus"), r
|
|
||||||
}, waitForParam: function (e) {
|
|
||||||
this.waitingForParam = e
|
|
||||||
}, getCount: function () {
|
|
||||||
var e = this.currentCount;
|
|
||||||
return this.currentCount = "", e && parseInt(e, 10)
|
|
||||||
}, exec: function (e, t, n) {
|
|
||||||
var o = t.motion, u = t.operator, a = t.action;
|
|
||||||
n || (n = t.param), u && (this.previous = {action: t, param: n});
|
|
||||||
if (u && !e.selection.isEmpty()) {
|
|
||||||
s[u.ch].selFn && (s[u.ch].selFn(e, e.getSelectionRange(), u.count, n), this.reset());
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!o && !a && u && n)s[u.ch].fn(e, null, u.count, n), this.reset(); else if (o) {
|
|
||||||
var f = function (t) {
|
|
||||||
t && typeof t == "function" && (o.count && !l.handlesCount ? p(t, o.count, [e, null, o.count, n]) : t(e, null, o.count, n))
|
|
||||||
}, l = i[o.ch], c = l.sel;
|
|
||||||
u ? c && p(function () {
|
|
||||||
f(l.sel), s[u.ch].fn(e, e.getSelectionRange(), u.count, n)
|
|
||||||
}, u.count || 1) : (r.onVisualMode || r.onVisualLineMode) && c ? f(l.sel) : f(l.nav), this.reset()
|
|
||||||
} else a && (a.fn(e, e.getSelectionRange(), a.count, n), this.reset());
|
|
||||||
y(e)
|
|
||||||
}, isAccepting: function (e) {
|
|
||||||
return this.accepting.indexOf(e) !== -1
|
|
||||||
}, reset: function () {
|
|
||||||
this.operator = null, this.motion = null, this.currentCount = "", this.status = "", this.accepting = [a, f, l, c], this.idle = !0, this.waitingForParam = null
|
|
||||||
}};
|
|
||||||
t.coreCommands = {start: {exec: function b(e) {
|
|
||||||
r.insertMode(e), g(b)
|
|
||||||
}}, startBeginning: {exec: function w(e) {
|
|
||||||
e.navigateLineStart(), r.insertMode(e), g(w)
|
|
||||||
}}, stop: {exec: function (t) {
|
|
||||||
m.reset(), r.onVisualMode = !1, r.onVisualLineMode = !1, m.lastInsertCommands = r.normalMode(t)
|
|
||||||
}}, append: {exec: function E(e) {
|
|
||||||
var t = e.getCursorPosition(), n = e.session.getLine(t.row).length;
|
|
||||||
n && e.navigateRight(), r.insertMode(e), g(E)
|
|
||||||
}}, appendEnd: {exec: function S(e) {
|
|
||||||
e.navigateLineEnd(), r.insertMode(e), g(S)
|
|
||||||
}}};
|
|
||||||
var y = t.onCursorMove = function (e, t) {
|
|
||||||
if (r.currentMode === "insert" || y.running)return;
|
|
||||||
if (!e.selection.isEmpty()) {
|
|
||||||
y.running = !0;
|
|
||||||
if (r.onVisualLineMode) {
|
|
||||||
var n = e.selection.visualLineStart, i = e.getCursorPosition().row;
|
|
||||||
if (n <= i) {
|
|
||||||
var s = e.session.getLine(i);
|
|
||||||
e.selection.clearSelection(), e.selection.moveCursorTo(n, 0), e.selection.selectTo(i, s.length)
|
|
||||||
} else {
|
|
||||||
var s = e.session.getLine(n);
|
|
||||||
e.selection.clearSelection(), e.selection.moveCursorTo(n, s.length), e.selection.selectTo(i, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
y.running = !1;
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t && (r.onVisualLineMode || r.onVisualMode) && (e.selection.clearSelection(), r.normalMode(e)), y.running = !0;
|
|
||||||
var o = e.getCursorPosition(), u = e.session.getLine(o.row).length;
|
|
||||||
u && o.column === u && e.navigateLeft(), y.running = !1
|
|
||||||
}
|
|
||||||
}), ace.define("ace/keyboard/vim/maps/util", ["require", "exports", "module", "ace/keyboard/vim/registers", "ace/lib/dom"], function (e, t, n) {
|
|
||||||
var r = e("../registers"), i = e("../../../lib/dom");
|
|
||||||
i.importCssString(".insert-mode .ace_cursor{ border-left: 2px solid #333333;}.ace_dark.insert-mode .ace_cursor{ border-left: 2px solid #eeeeee;}.normal-mode .ace_cursor{ border: 0!important; background-color: red; opacity: 0.5;}", "vimMode"), n.exports = {onVisualMode: !1, onVisualLineMode: !1, currentMode: "normal", noMode: function (e) {
|
|
||||||
e.unsetStyle("insert-mode"), e.unsetStyle("normal-mode"), e.commands.recording && e.commands.toggleRecording(e), e.setOverwrite(!1)
|
|
||||||
}, insertMode: function (e) {
|
|
||||||
this.currentMode = "insert", e.setStyle("insert-mode"), e.unsetStyle("normal-mode"), e.setOverwrite(!1), e.keyBinding.$data.buffer = "", e.keyBinding.$data.state = "insertMode", this.onVisualMode = !1, this.onVisualLineMode = !1, this.onInsertReplaySequence ? (e.commands.macro = this.onInsertReplaySequence, e.commands.replay(e), this.onInsertReplaySequence = null, this.normalMode(e)) : (e._emit("changeStatus"), e.commands.recording || e.commands.toggleRecording(e))
|
|
||||||
}, normalMode: function (e) {
|
|
||||||
this.currentMode = "normal", e.unsetStyle("insert-mode"), e.setStyle("normal-mode"), e.clearSelection();
|
|
||||||
var t;
|
|
||||||
return e.getOverwrite() || (t = e.getCursorPosition(), t.column > 0 && e.navigateLeft()), e.setOverwrite(!0), e.keyBinding.$data.buffer = "", e.keyBinding.$data.state = "start", this.onVisualMode = !1, this.onVisualLineMode = !1, e._emit("changeStatus"), e.commands.recording ? (e.commands.toggleRecording(e), e.commands.macro) : []
|
|
||||||
}, visualMode: function (e, t) {
|
|
||||||
if (this.onVisualLineMode && t || this.onVisualMode && !t) {
|
|
||||||
this.normalMode(e);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
e.setStyle("insert-mode"), e.unsetStyle("normal-mode"), e._emit("changeStatus"), t ? this.onVisualLineMode = !0 : (this.onVisualMode = !0, this.onVisualLineMode = !1)
|
|
||||||
}, getRightNthChar: function (e, t, n, r) {
|
|
||||||
var i = e.getSession().getLine(t.row), s = i.substr(t.column + 1).split(n);
|
|
||||||
return r < s.length ? s.slice(0, r).join(n).length : null
|
|
||||||
}, getLeftNthChar: function (e, t, n, r) {
|
|
||||||
var i = e.getSession().getLine(t.row), s = i.substr(0, t.column).split(n);
|
|
||||||
return r < s.length ? s.slice(-1 * r).join(n).length : null
|
|
||||||
}, toRealChar: function (e) {
|
|
||||||
return e.length === 1 ? e : /^shift-./.test(e) ? e[e.length - 1].toUpperCase() : ""
|
|
||||||
}, copyLine: function (e) {
|
|
||||||
var t = e.getCursorPosition();
|
|
||||||
e.selection.clearSelection(), e.moveCursorTo(t.row, t.column), e.selection.selectLine(), r._default.isLine = !0, r._default.text = e.getCopyText().replace(/\n$/, ""), e.selection.clearSelection(), e.moveCursorTo(t.row, t.column)
|
|
||||||
}}
|
|
||||||
}), ace.define("ace/keyboard/vim/registers", ["require", "exports", "module"], function (e, t, n) {
|
|
||||||
"never use strict";
|
|
||||||
n.exports = {_default: {text: "", isLine: !1}}
|
|
||||||
}), ace.define("ace/keyboard/vim/maps/motions", ["require", "exports", "module", "ace/keyboard/vim/maps/util", "ace/search", "ace/range"], function (e, t, n) {
|
|
||||||
function s(e) {
|
|
||||||
if (typeof e == "function") {
|
|
||||||
var t = e;
|
|
||||||
e = this
|
|
||||||
} else var t = e.getPos;
|
|
||||||
return e.nav = function (e, n, r, i) {
|
|
||||||
var s = t(e, n, r, i, !1);
|
|
||||||
if (!s)return;
|
|
||||||
e.clearSelection(), e.moveCursorTo(s.row, s.column)
|
|
||||||
}, e.sel = function (e, n, r, i) {
|
|
||||||
var s = t(e, n, r, i, !0);
|
|
||||||
if (!s)return;
|
|
||||||
e.selection.selectTo(s.row, s.column)
|
|
||||||
}, e
|
|
||||||
}
|
|
||||||
|
|
||||||
function h(e, t, n) {
|
|
||||||
return c.$options.needle = t, c.$options.backwards = n == -1, c.find(e.session)
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("./util"), i = function (e, t) {
|
|
||||||
var n = e.renderer.getScrollTopRow(), r = e.getCursorPosition().row, i = r - n;
|
|
||||||
t && t.call(e), e.renderer.scrollToRow(e.getCursorPosition().row - i)
|
|
||||||
}, o = /[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/, u = /[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/, a = /\s/, f = function (e, t) {
|
|
||||||
var n = e.selection;
|
|
||||||
this.range = n.getRange(), t = t || n.selectionLead, this.row = t.row, this.col = t.column;
|
|
||||||
var r = e.session.getLine(this.row), i = e.session.getLength();
|
|
||||||
this.ch = r[this.col] || "\n", this.skippedLines = 0, this.next = function () {
|
|
||||||
return this.ch = r[++this.col] || this.handleNewLine(1), this.ch
|
|
||||||
}, this.prev = function () {
|
|
||||||
return this.ch = r[--this.col] || this.handleNewLine(-1), this.ch
|
|
||||||
}, this.peek = function (t) {
|
|
||||||
var n = r[this.col + t];
|
|
||||||
return n ? n : t == -1 ? "\n" : this.col == r.length - 1 ? "\n" : e.session.getLine(this.row + 1)[0] || "\n"
|
|
||||||
}, this.handleNewLine = function (t) {
|
|
||||||
if (t == 1)return this.col == r.length ? "\n" : this.row == i - 1 ? "" : (this.col = 0, this.row++, r = e.session.getLine(this.row), this.skippedLines++, r[0] || "\n");
|
|
||||||
if (t == -1)return this.row === 0 ? "" : (this.row--, r = e.session.getLine(this.row), this.col = r.length, this.skippedLines--, "\n")
|
|
||||||
}, this.debug = function () {
|
|
||||||
console.log(r.substring(0, this.col) + "|" + this.ch + "'" + this.col + "'" + r.substr(this.col + 1))
|
|
||||||
}
|
|
||||||
}, l = e("../../../search").Search, c = new l, p = e("../../../range").Range;
|
|
||||||
n.exports = {w: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
if (t.ch && u.test(t.ch))while (t.ch && u.test(t.ch))t.next(); else while (t.ch && !o.test(t.ch))t.next();
|
|
||||||
while (t.ch && a.test(t.ch) && t.skippedLines < 2)t.next();
|
|
||||||
return t.skippedLines == 2 && t.prev(), {column: t.col, row: t.row}
|
|
||||||
}), W: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
while (t.ch && (!a.test(t.ch) || !!a.test(t.peek(1))) && t.skippedLines < 2)t.next();
|
|
||||||
return t.skippedLines == 2 ? t.prev() : t.next(), {column: t.col, row: t.row}
|
|
||||||
}), b: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
t.prev();
|
|
||||||
while (t.ch && a.test(t.ch) && t.skippedLines > -2)t.prev();
|
|
||||||
if (t.ch && u.test(t.ch))while (t.ch && u.test(t.ch))t.prev(); else while (t.ch && !o.test(t.ch))t.prev();
|
|
||||||
return t.ch && t.next(), {column: t.col, row: t.row}
|
|
||||||
}), B: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
t.prev();
|
|
||||||
while (t.ch && (!!a.test(t.ch) || !a.test(t.peek(-1))) && t.skippedLines > -2)t.prev();
|
|
||||||
return t.skippedLines == -2 && t.next(), {column: t.col, row: t.row}
|
|
||||||
}), e: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
t.next();
|
|
||||||
while (t.ch && a.test(t.ch))t.next();
|
|
||||||
if (t.ch && u.test(t.ch))while (t.ch && u.test(t.ch))t.next(); else while (t.ch && !o.test(t.ch))t.next();
|
|
||||||
return t.ch && t.prev(), {column: t.col, row: t.row}
|
|
||||||
}), E: new s(function (e) {
|
|
||||||
var t = new f(e);
|
|
||||||
t.next();
|
|
||||||
while (t.ch && (!!a.test(t.ch) || !a.test(t.peek(1))))t.next();
|
|
||||||
return{column: t.col, row: t.row}
|
|
||||||
}), l: {nav: function (e) {
|
|
||||||
var t = e.getCursorPosition(), n = t.column, r = e.session.getLine(t.row).length;
|
|
||||||
r && n !== r && e.navigateRight()
|
|
||||||
}, sel: function (e) {
|
|
||||||
var t = e.getCursorPosition(), n = t.column, r = e.session.getLine(t.row).length;
|
|
||||||
r && n !== r && e.selection.selectRight()
|
|
||||||
}}, h: {nav: function (e) {
|
|
||||||
var t = e.getCursorPosition();
|
|
||||||
t.column > 0 && e.navigateLeft()
|
|
||||||
}, sel: function (e) {
|
|
||||||
var t = e.getCursorPosition();
|
|
||||||
t.column > 0 && e.selection.selectLeft()
|
|
||||||
}}, H: {nav: function (e) {
|
|
||||||
var t = e.renderer.getScrollTopRow();
|
|
||||||
e.moveCursorTo(t)
|
|
||||||
}, sel: function (e) {
|
|
||||||
var t = e.renderer.getScrollTopRow();
|
|
||||||
e.selection.selectTo(t)
|
|
||||||
}}, M: {nav: function (e) {
|
|
||||||
var t = e.renderer.getScrollTopRow(), n = e.renderer.getScrollBottomRow(), r = t + (n - t) / 2;
|
|
||||||
e.moveCursorTo(r)
|
|
||||||
}, sel: function (e) {
|
|
||||||
var t = e.renderer.getScrollTopRow(), n = e.renderer.getScrollBottomRow(), r = t + (n - t) / 2;
|
|
||||||
e.selection.selectTo(r)
|
|
||||||
}}, L: {nav: function (e) {
|
|
||||||
var t = e.renderer.getScrollBottomRow();
|
|
||||||
e.moveCursorTo(t)
|
|
||||||
}, sel: function (e) {
|
|
||||||
var t = e.renderer.getScrollBottomRow();
|
|
||||||
e.selection.selectTo(t)
|
|
||||||
}}, k: {nav: function (e) {
|
|
||||||
e.navigateUp()
|
|
||||||
}, sel: function (e) {
|
|
||||||
e.selection.selectUp()
|
|
||||||
}}, j: {nav: function (e) {
|
|
||||||
e.navigateDown()
|
|
||||||
}, sel: function (e) {
|
|
||||||
e.selection.selectDown()
|
|
||||||
}}, i: {param: !0, sel: function (e, t, n, r) {
|
|
||||||
switch (r) {
|
|
||||||
case"w":
|
|
||||||
e.selection.selectWord();
|
|
||||||
break;
|
|
||||||
case"W":
|
|
||||||
e.selection.selectAWord();
|
|
||||||
break;
|
|
||||||
case"(":
|
|
||||||
case"{":
|
|
||||||
case"[":
|
|
||||||
var i = e.getCursorPosition(), s = e.session.$findClosingBracket(r, i, /paren/);
|
|
||||||
if (!s)return;
|
|
||||||
var o = e.session.$findOpeningBracket(e.session.$brackets[r], i, /paren/);
|
|
||||||
if (!o)return;
|
|
||||||
o.column++, e.selection.setSelectionRange(p.fromPoints(o, s));
|
|
||||||
break;
|
|
||||||
case"'":
|
|
||||||
case'"':
|
|
||||||
case"/":
|
|
||||||
var s = h(e, r, 1);
|
|
||||||
if (!s)return;
|
|
||||||
var o = h(e, r, -1);
|
|
||||||
if (!o)return;
|
|
||||||
e.selection.setSelectionRange(p.fromPoints(o.end, s.start))
|
|
||||||
}
|
|
||||||
}}, a: {param: !0, sel: function (e, t, n, r) {
|
|
||||||
switch (r) {
|
|
||||||
case"w":
|
|
||||||
e.selection.selectAWord();
|
|
||||||
break;
|
|
||||||
case"W":
|
|
||||||
e.selection.selectAWord();
|
|
||||||
break;
|
|
||||||
case"(":
|
|
||||||
case"{":
|
|
||||||
case"[":
|
|
||||||
var i = e.getCursorPosition(), s = e.session.$findClosingBracket(r, i, /paren/);
|
|
||||||
if (!s)return;
|
|
||||||
var o = e.session.$findOpeningBracket(e.session.$brackets[r], i, /paren/);
|
|
||||||
if (!o)return;
|
|
||||||
s.column++, e.selection.setSelectionRange(p.fromPoints(o, s));
|
|
||||||
break;
|
|
||||||
case"'":
|
|
||||||
case'"':
|
|
||||||
case"/":
|
|
||||||
var s = h(e, r, 1);
|
|
||||||
if (!s)return;
|
|
||||||
var o = h(e, r, -1);
|
|
||||||
if (!o)return;
|
|
||||||
s.column++, e.selection.setSelectionRange(p.fromPoints(o.start, s.end))
|
|
||||||
}
|
|
||||||
}}, f: new s({param: !0, handlesCount: !0, getPos: function (e, t, n, i, s) {
|
|
||||||
var o = e.getCursorPosition(), u = r.getRightNthChar(e, o, i, n || 1);
|
|
||||||
if (typeof u == "number")return o.column += u + (s ? 2 : 1), o
|
|
||||||
}}), F: new s({param: !0, handlesCount: !0, getPos: function (e, t, n, i, s) {
|
|
||||||
var o = e.getCursorPosition(), u = r.getLeftNthChar(e, o, i, n || 1);
|
|
||||||
if (typeof u == "number")return o.column -= u + 1, o
|
|
||||||
}}), t: new s({param: !0, handlesCount: !0, getPos: function (e, t, n, i, s) {
|
|
||||||
var o = e.getCursorPosition(), u = r.getRightNthChar(e, o, i, n || 1);
|
|
||||||
if (typeof u == "number")return o.column += u + (s ? 1 : 0), o
|
|
||||||
}}), T: new s({param: !0, handlesCount: !0, getPos: function (e, t, n, i, s) {
|
|
||||||
var o = e.getCursorPosition(), u = r.getLeftNthChar(e, o, i, n || 1);
|
|
||||||
if (typeof u == "number")return o.column -= u, o
|
|
||||||
}}), "^": {nav: function (e) {
|
|
||||||
e.navigateLineStart()
|
|
||||||
}, sel: function (e) {
|
|
||||||
e.selection.selectLineStart()
|
|
||||||
}}, $: {nav: function (e) {
|
|
||||||
e.navigateLineEnd()
|
|
||||||
}, sel: function (e) {
|
|
||||||
e.selection.selectLineEnd()
|
|
||||||
}}, 0: new s(function (e) {
|
|
||||||
return{row: e.selection.lead.row, column: 0}
|
|
||||||
}), G: {nav: function (e, t, n, r) {
|
|
||||||
!n && n !== 0 && (n = e.session.getLength()), e.gotoLine(n)
|
|
||||||
}, sel: function (e, t, n, r) {
|
|
||||||
!n && n !== 0 && (n = e.session.getLength()), e.selection.selectTo(n, 0)
|
|
||||||
}}, g: {param: !0, nav: function (e, t, n, r) {
|
|
||||||
switch (r) {
|
|
||||||
case"m":
|
|
||||||
console.log("Middle line");
|
|
||||||
break;
|
|
||||||
case"e":
|
|
||||||
console.log("End of prev word");
|
|
||||||
break;
|
|
||||||
case"g":
|
|
||||||
e.gotoLine(n || 0);
|
|
||||||
case"u":
|
|
||||||
e.gotoLine(n || 0);
|
|
||||||
case"U":
|
|
||||||
e.gotoLine(n || 0)
|
|
||||||
}
|
|
||||||
}, sel: function (e, t, n, r) {
|
|
||||||
switch (r) {
|
|
||||||
case"m":
|
|
||||||
console.log("Middle line");
|
|
||||||
break;
|
|
||||||
case"e":
|
|
||||||
console.log("End of prev word");
|
|
||||||
break;
|
|
||||||
case"g":
|
|
||||||
e.selection.selectTo(n || 0, 0)
|
|
||||||
}
|
|
||||||
}}, o: {nav: function (e, t, n, i) {
|
|
||||||
n = n || 1;
|
|
||||||
var s = "";
|
|
||||||
while (0 < n--)s += "\n";
|
|
||||||
s.length && (e.navigateLineEnd(), e.insert(s), r.insertMode(e))
|
|
||||||
}}, O: {nav: function (e, t, n, i) {
|
|
||||||
var s = e.getCursorPosition().row;
|
|
||||||
n = n || 1;
|
|
||||||
var o = "";
|
|
||||||
while (0 < n--)o += "\n";
|
|
||||||
o.length && (s > 0 ? (e.navigateUp(), e.navigateLineEnd(), e.insert(o)) : (e.session.insert({row: 0, column: 0}, o), e.navigateUp()), r.insertMode(e))
|
|
||||||
}}, "%": new s(function (e) {
|
|
||||||
var t = /[\[\]{}()]/g, n = e.getCursorPosition(), r = e.session.getLine(n.row)[n.column];
|
|
||||||
if (!t.test(r)) {
|
|
||||||
var i = h(e, t);
|
|
||||||
if (!i)return;
|
|
||||||
n = i.start
|
|
||||||
}
|
|
||||||
var s = e.session.findMatchingBracket({row: n.row, column: n.column + 1});
|
|
||||||
return s
|
|
||||||
}), "{": new s(function (e) {
|
|
||||||
var t = e.session, n = t.selection.lead.row;
|
|
||||||
while (n > 0 && !/\S/.test(t.getLine(n)))n--;
|
|
||||||
while (/\S/.test(t.getLine(n)))n--;
|
|
||||||
return{column: 0, row: n}
|
|
||||||
}), "}": new s(function (e) {
|
|
||||||
var t = e.session, n = t.getLength(), r = t.selection.lead.row;
|
|
||||||
while (r < n && !/\S/.test(t.getLine(r)))r++;
|
|
||||||
while (/\S/.test(t.getLine(r)))r++;
|
|
||||||
return{column: 0, row: r}
|
|
||||||
}), "ctrl-d": {nav: function (e, t, n, r) {
|
|
||||||
e.selection.clearSelection(), i(e, e.gotoPageDown)
|
|
||||||
}, sel: function (e, t, n, r) {
|
|
||||||
i(e, e.selectPageDown)
|
|
||||||
}}, "ctrl-u": {nav: function (e, t, n, r) {
|
|
||||||
e.selection.clearSelection(), i(e, e.gotoPageUp)
|
|
||||||
}, sel: function (e, t, n, r) {
|
|
||||||
i(e, e.selectPageUp)
|
|
||||||
}}, "`": new s({param: !0, handlesCount: !0, getPos: function (e, t, n, r, i) {
|
|
||||||
var s = e.session, o = s.vimMarkers && s.vimMarkers[r];
|
|
||||||
if (o)return o.getPosition()
|
|
||||||
}}), "'": new s({param: !0, handlesCount: !0, getPos: function (e, t, n, r, i) {
|
|
||||||
var s = e.session, o = s.vimMarkers && s.vimMarkers[r];
|
|
||||||
if (o) {
|
|
||||||
var u = o.getPosition(), a = e.session.getLine(u.row);
|
|
||||||
return u.column = a.search(/\S/), u.column == -1 && (u.column = a.length), u
|
|
||||||
}
|
|
||||||
}})}, n.exports.backspace = n.exports.left = n.exports.h, n.exports.right = n.exports.l, n.exports.up = n.exports.k, n.exports.down = n.exports.j, n.exports.pagedown = n.exports["ctrl-d"], n.exports.pageup = n.exports["ctrl-u"]
|
|
||||||
}), ace.define("ace/keyboard/vim/maps/operators", ["require", "exports", "module", "ace/keyboard/vim/maps/util", "ace/keyboard/vim/registers"], function (e, t, n) {
|
|
||||||
"never use strict";
|
|
||||||
var r = e("./util"), i = e("../registers");
|
|
||||||
n.exports = {d: {selFn: function (e, t, n, s) {
|
|
||||||
i._default.text = e.getCopyText(), i._default.isLine = r.onVisualLineMode, r.onVisualLineMode ? e.removeLines() : e.session.remove(t), r.normalMode(e)
|
|
||||||
}, fn: function (e, t, n, r) {
|
|
||||||
n = n || 1;
|
|
||||||
switch (r) {
|
|
||||||
case"d":
|
|
||||||
i._default.text = "", i._default.isLine = !0;
|
|
||||||
for (var s = 0; s < n; s++) {
|
|
||||||
e.selection.selectLine(), i._default.text += e.getCopyText();
|
|
||||||
var o = e.getSelectionRange();
|
|
||||||
if (!o.isMultiLine()) {
|
|
||||||
lastLineReached = !0;
|
|
||||||
var u = o.start.row - 1, a = e.session.getLine(u).length;
|
|
||||||
o.setStart(u, a), e.session.remove(o), e.selection.clearSelection();
|
|
||||||
break
|
|
||||||
}
|
|
||||||
e.session.remove(o), e.selection.clearSelection()
|
|
||||||
}
|
|
||||||
i._default.text = i._default.text.replace(/\n$/, "");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
t && (e.selection.setSelectionRange(t), i._default.text = e.getCopyText(), i._default.isLine = !1, e.session.remove(t), e.selection.clearSelection())
|
|
||||||
}
|
|
||||||
}}, c: {selFn: function (e, t, n, i) {
|
|
||||||
e.session.remove(t), r.insertMode(e)
|
|
||||||
}, fn: function (e, t, n, i) {
|
|
||||||
n = n || 1;
|
|
||||||
switch (i) {
|
|
||||||
case"c":
|
|
||||||
for (var s = 0; s < n; s++)e.removeLines(), r.insertMode(e);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
t && (e.session.remove(t), r.insertMode(e))
|
|
||||||
}
|
|
||||||
}}, y: {selFn: function (e, t, n, s) {
|
|
||||||
i._default.text = e.getCopyText(), i._default.isLine = r.onVisualLineMode, e.selection.clearSelection(), r.normalMode(e)
|
|
||||||
}, fn: function (e, t, n, r) {
|
|
||||||
n = n || 1;
|
|
||||||
switch (r) {
|
|
||||||
case"y":
|
|
||||||
var s = e.getCursorPosition();
|
|
||||||
e.selection.selectLine();
|
|
||||||
for (var o = 0; o < n - 1; o++)e.selection.moveCursorDown();
|
|
||||||
i._default.text = e.getCopyText().replace(/\n$/, ""), e.selection.clearSelection(), i._default.isLine = !0, e.moveCursorToPosition(s);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (t) {
|
|
||||||
var s = e.getCursorPosition();
|
|
||||||
e.selection.setSelectionRange(t), i._default.text = e.getCopyText(), i._default.isLine = !1, e.selection.clearSelection(), e.moveCursorTo(s.row, s.column)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}, ">": {selFn: function (e, t, n, i) {
|
|
||||||
n = n || 1;
|
|
||||||
for (var s = 0; s < n; s++)e.indent();
|
|
||||||
r.normalMode(e)
|
|
||||||
}, fn: function (e, t, n, r) {
|
|
||||||
n = parseInt(n || 1, 10);
|
|
||||||
switch (r) {
|
|
||||||
case">":
|
|
||||||
var i = e.getCursorPosition();
|
|
||||||
e.selection.selectLine();
|
|
||||||
for (var s = 0; s < n - 1; s++)e.selection.moveCursorDown();
|
|
||||||
e.indent(), e.selection.clearSelection(), e.moveCursorToPosition(i), e.navigateLineEnd(), e.navigateLineStart()
|
|
||||||
}
|
|
||||||
}}, "<": {selFn: function (e, t, n, i) {
|
|
||||||
n = n || 1;
|
|
||||||
for (var s = 0; s < n; s++)e.blockOutdent();
|
|
||||||
r.normalMode(e)
|
|
||||||
}, fn: function (e, t, n, r) {
|
|
||||||
n = n || 1;
|
|
||||||
switch (r) {
|
|
||||||
case"<":
|
|
||||||
var i = e.getCursorPosition();
|
|
||||||
e.selection.selectLine();
|
|
||||||
for (var s = 0; s < n - 1; s++)e.selection.moveCursorDown();
|
|
||||||
e.blockOutdent(), e.selection.clearSelection(), e.moveCursorToPosition(i), e.navigateLineEnd(), e.navigateLineStart()
|
|
||||||
}
|
|
||||||
}}}
|
|
||||||
}), "use strict", ace.define("ace/keyboard/vim/maps/aliases", ["require", "exports", "module"], function (e, t, n) {
|
|
||||||
n.exports = {x: {operator: {ch: "d", count: 1}, motion: {ch: "l", count: 1}}, X: {operator: {ch: "d", count: 1}, motion: {ch: "h", count: 1}}, D: {operator: {ch: "d", count: 1}, motion: {ch: "$", count: 1}}, C: {operator: {ch: "c", count: 1}, motion: {ch: "$", count: 1}}, s: {operator: {ch: "c", count: 1}, motion: {ch: "l", count: 1}}, S: {operator: {ch: "c", count: 1}, param: "c"}}
|
|
||||||
})
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
ace.define("ace/mode/abap", ["require", "exports", "module", "ace/tokenizer", "ace/mode/abap_highlight_rules", "ace/mode/folding/coffee", "ace/range", "ace/mode/text", "ace/lib/oop"], function (e, t, n) {
|
|
||||||
function f() {
|
|
||||||
this.$tokenizer = new r((new i).getRules(), "i"), this.foldingRules = new s
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("../tokenizer").Tokenizer, i = e("./abap_highlight_rules").AbapHighlightRules, s = e("./folding/coffee").FoldMode, o = e("../range").Range, u = e("./text").Mode, a = e("../lib/oop");
|
|
||||||
a.inherits(f, u), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t);
|
|
||||||
return r
|
|
||||||
}, this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = new o(0, 0, 0, 0);
|
|
||||||
for (var s = n; s <= r; ++s) {
|
|
||||||
var u = t.getLine(s);
|
|
||||||
if (hereComment.test(u))continue;
|
|
||||||
commentLine.test(u) ? u = u.replace(commentLine, "$1") : u = u.replace(indentation, "$&#"), i.end.row = i.start.row = s, i.end.column = u.length + 1, t.replace(i, u)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/abap_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
var e = this.createKeywordMapper({"variable.language": "this", keyword: "ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT BACK CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT FETCH FIELDS FORM FORMAT FREE FROM FUNCTION GENERATE GET HIDE IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION LEAVE LIKE LINE LOAD LOCAL LOOP MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY ON OVERLAY OPTIONAL OTHERS PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES UNASSIGN ULINE UNPACK UPDATE WHEN WHILE WINDOW WRITE OCCURS STRUCTURE OBJECT PROPERTY CASTING APPEND RAISING VALUE COLOR CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT ID NUMBER FOR TITLE OUTPUT WITH EXIT USING INTO WHERE GROUP BY HAVING ORDER BY SINGLE APPENDING CORRESPONDING FIELDS OF TABLE LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", "constant.language": "TRUE FALSE NULL SPACE", "support.type": "c n i p f d t x string xstring decfloat16 decfloat34", "keyword.operator": "abs sign ceil floor trunc frac acos asin atan cos sin tan abapOperator cosh sinh tanh exp log log10 sqrt strlen xstrlen charlen numofchar dbmaxlen lines"}, "text", !0, " "), t = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "string", regex: "`", next: "string"},
|
|
||||||
{token: "string", regex: "'", next: "qstring"},
|
|
||||||
{token: "doc.comment", regex: /^\*.+/},
|
|
||||||
{token: "comment", regex: /".+$/},
|
|
||||||
{token: "invalid", regex: "\\.{2,}"},
|
|
||||||
{token: "keyword.operator", regex: /\W[\-+\%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/},
|
|
||||||
{token: "paren.lparen", regex: "[\\[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+\\b"},
|
|
||||||
{token: "variable.parameter", regex: /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/},
|
|
||||||
{token: "keyword", regex: t},
|
|
||||||
{token: "variable.parameter", regex: /\w+-\w+(?:-\w+)*/},
|
|
||||||
{token: e, regex: "\\b\\w+\\b"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "constant.language.escape", regex: "''"},
|
|
||||||
{token: "string", regex: "'", next: "start"},
|
|
||||||
{token: "string", regex: ".|w+"}
|
|
||||||
], string: [
|
|
||||||
{token: "constant.language.escape", regex: "``"},
|
|
||||||
{token: "string", regex: "`", next: "start"},
|
|
||||||
{token: "string", regex: ".|w+"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.AbapHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/coffee", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = this.indentationBlock(e, n);
|
|
||||||
if (r)return r;
|
|
||||||
var i = /\S/, o = e.getLine(n), u = o.search(i);
|
|
||||||
if (u == -1 || o[u] != "#")return;
|
|
||||||
var a = o.length, f = e.getLength(), l = n, c = n;
|
|
||||||
while (++n < f) {
|
|
||||||
o = e.getLine(n);
|
|
||||||
var h = o.search(i);
|
|
||||||
if (h == -1)continue;
|
|
||||||
if (o[h] != "#")break;
|
|
||||||
c = n
|
|
||||||
}
|
|
||||||
if (c > l) {
|
|
||||||
var p = e.getLine(c).length;
|
|
||||||
return new s(l, a, c, p)
|
|
||||||
}
|
|
||||||
}, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.search(/\S/), s = e.getLine(n + 1), o = e.getLine(n - 1), u = o.search(/\S/), a = s.search(/\S/);
|
|
||||||
if (i == -1)return e.foldWidgets[n - 1] = u != -1 && u < a ? "start" : "", "";
|
|
||||||
if (u == -1) {
|
|
||||||
if (i == a && r[i] == "#" && s[i] == "#")return e.foldWidgets[n - 1] = "", e.foldWidgets[n + 1] = "", "start"
|
|
||||||
} else if (u == i && r[i] == "#" && o[i] == "#" && e.getLine(n - 2).search(/\S/) == -1)return e.foldWidgets[n - 1] = "start", e.foldWidgets[n + 1] = "", "";
|
|
||||||
return u != -1 && u < i ? e.foldWidgets[n - 1] = "start" : e.foldWidgets[n - 1] = "", i < a ? "start" : ""
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,202 +0,0 @@
|
|||||||
ace.define("ace/mode/asciidoc", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/asciidoc_highlight_rules", "ace/mode/folding/asciidoc"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./asciidoc_highlight_rules").AsciidocHighlightRules, u = e("./folding/asciidoc").FoldMode, a = function () {
|
|
||||||
var e = new o;
|
|
||||||
this.$tokenizer = new s(e.getRules()), this.foldingRules = new u
|
|
||||||
};
|
|
||||||
r.inherits(a, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
if (e == "listblock") {
|
|
||||||
var r = /^((?:.+)?)([-+*][ ]+)/.exec(t);
|
|
||||||
return r ? (new Array(r[1].length + 1)).join(" ") + r[2] : ""
|
|
||||||
}
|
|
||||||
return this.$getIndent(t)
|
|
||||||
}
|
|
||||||
}.call(a.prototype), t.Mode = a
|
|
||||||
}), ace.define("ace/mode/asciidoc_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
function t(e) {
|
|
||||||
var t = /\w/.test(e) ? "\\b" : "(?:\\B|^)";
|
|
||||||
return t + e + "[^" + e + "].*?" + e + "(?![\\w*])"
|
|
||||||
}
|
|
||||||
|
|
||||||
var e = "[a-zA-Z¡-]+\\b";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "empty", regex: /$/},
|
|
||||||
{token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"},
|
|
||||||
{token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"},
|
|
||||||
{token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"},
|
|
||||||
{token: "keyword", regex: /^={4,}\s*$/},
|
|
||||||
{token: "text", regex: /^\s*$/},
|
|
||||||
{token: "empty", regex: "", next: "dissallowDelimitedBlock"}
|
|
||||||
], dissallowDelimitedBlock: [
|
|
||||||
{include: "paragraphEnd"},
|
|
||||||
{token: "comment", regex: "^//.+$"},
|
|
||||||
{token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"},
|
|
||||||
{include: "listStart"},
|
|
||||||
{token: "literal", regex: /^\s+.+$/, next: "indentedBlock"},
|
|
||||||
{token: "empty", regex: "", next: "text"}
|
|
||||||
], paragraphEnd: [
|
|
||||||
{token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"},
|
|
||||||
{token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"},
|
|
||||||
{token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"},
|
|
||||||
{token: "option", regex: /^\[.*\]\s*$/, next: "start"},
|
|
||||||
{token: "pageBreak", regex: /^>{3,}$/, next: "start"},
|
|
||||||
{token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"},
|
|
||||||
{token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"},
|
|
||||||
{token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"},
|
|
||||||
{token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"},
|
|
||||||
{token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"}
|
|
||||||
], listStart: [
|
|
||||||
{token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"},
|
|
||||||
{token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"},
|
|
||||||
{token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"},
|
|
||||||
{token: "keyword", regex: /^\+\s*$/, next: "start"}
|
|
||||||
], text: [
|
|
||||||
{token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/},
|
|
||||||
{token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/},
|
|
||||||
{token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/},
|
|
||||||
{include: "macros"},
|
|
||||||
{include: "paragraphEnd"},
|
|
||||||
{token: "literal", regex: /\+{3,}/, next: "smallPassthrough"},
|
|
||||||
{token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/},
|
|
||||||
{token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/},
|
|
||||||
{token: "keyword", regex: /\s\+$/},
|
|
||||||
{token: "text", regex: e},
|
|
||||||
{token: ["keyword", "string", "keyword"], regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/},
|
|
||||||
{token: "keyword", regex: /<<[\w\d\-$]+,?|>>/},
|
|
||||||
{token: "constant.character", regex: /\({2,3}.*?\){2,3}/},
|
|
||||||
{token: "keyword", regex: /\[\[.+?\]\]/},
|
|
||||||
{token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/},
|
|
||||||
{include: "quotes"},
|
|
||||||
{token: "empty", regex: /^\s*$/, next: "start"}
|
|
||||||
], listText: [
|
|
||||||
{include: "listStart"},
|
|
||||||
{include: "text"}
|
|
||||||
], indentedBlock: [
|
|
||||||
{token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"},
|
|
||||||
{token: "literal", regex: "", next: "start"}
|
|
||||||
], listingBlock: [
|
|
||||||
{token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "constant.numeric", regex: "<\\d+>"},
|
|
||||||
{token: "literal", regex: "[^<]+"},
|
|
||||||
{token: "literal", regex: "<"}
|
|
||||||
], literalBlock: [
|
|
||||||
{token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "constant.numeric", regex: "<\\d+>"},
|
|
||||||
{token: "literal", regex: "[^<]+"},
|
|
||||||
{token: "literal", regex: "<"}
|
|
||||||
], passthroughBlock: [
|
|
||||||
{token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "literal", regex: e + "|\\d+"},
|
|
||||||
{include: "macros"},
|
|
||||||
{token: "literal", regex: "."}
|
|
||||||
], smallPassthrough: [
|
|
||||||
{token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "literal", regex: e + "|\\d+"},
|
|
||||||
{include: "macros"}
|
|
||||||
], commentBlock: [
|
|
||||||
{token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "doc.comment", regex: "^.*$"}
|
|
||||||
], tableBlock: [
|
|
||||||
{token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"},
|
|
||||||
{token: "tableBlock", regex: /\|/},
|
|
||||||
{include: "text", noEscape: !0}
|
|
||||||
], innerTableBlock: [
|
|
||||||
{token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"},
|
|
||||||
{token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"},
|
|
||||||
{token: "tableBlock", regex: /\!/}
|
|
||||||
], macros: [
|
|
||||||
{token: "macro", regex: /{[\w\-$]+}/},
|
|
||||||
{token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/},
|
|
||||||
{token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/},
|
|
||||||
{token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/},
|
|
||||||
{token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/},
|
|
||||||
{token: "keyword", regex: /^:.+?:(?= |$)/}
|
|
||||||
], quotes: [
|
|
||||||
{token: "string.italic", regex: /__[^_\s].*?__/},
|
|
||||||
{token: "string.italic", regex: t("_")},
|
|
||||||
{token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/},
|
|
||||||
{token: "keyword.bold", regex: t("\\*")},
|
|
||||||
{token: "literal", regex: t("\\+")},
|
|
||||||
{token: "literal", regex: /\+\+[^+\s].*?\+\+/},
|
|
||||||
{token: "literal", regex: /\$\$.+?\$\$/},
|
|
||||||
{token: "literal", regex: t("`")},
|
|
||||||
{token: "keyword", regex: t("^")},
|
|
||||||
{token: "keyword", regex: t("~")},
|
|
||||||
{token: "keyword", regex: /##?/},
|
|
||||||
{token: "keyword", regex: /(?:\B|^)``|\b''/}
|
|
||||||
]};
|
|
||||||
var n = {macro: "constant.character", tableBlock: "doc.comment", titleUnderline: "markup.heading", singleLineTitle: "markup.heading", pageBreak: "string", option: "string.regexp", otherBlock: "markup.list", literal: "support.function", optionalTitle: "constant.numeric", escape: "constant.language.escape", link: "markup.underline.list"};
|
|
||||||
for (var r in this.$rules) {
|
|
||||||
var i = this.$rules[r];
|
|
||||||
for (var s = i.length; s--;) {
|
|
||||||
var o = i[s];
|
|
||||||
if (o.include || typeof o == "string") {
|
|
||||||
var u = [s, 1].concat(this.$rules[o.include || o]);
|
|
||||||
o.noEscape && (u = u.filter(function (e) {
|
|
||||||
return!e.next
|
|
||||||
})), i.splice.apply(i, u)
|
|
||||||
} else o.token in n && (o.token = n[o.token])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.AsciidocHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/asciidoc", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/, this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n);
|
|
||||||
return this.foldingStartMarker.test(r) ? r[0] == "=" ? this.singleLineHeadingRe.test(r) ? "start" : e.getLine(n - 1).length != e.getLine(n).length ? "" : "start" : e.bgTokenizer.getState(n) == "dissallowDelimitedBlock" ? "end" : "start" : ""
|
|
||||||
}, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
function l(t) {
|
|
||||||
return f = e.getTokens(t)[0], f && f.type
|
|
||||||
}
|
|
||||||
|
|
||||||
function d() {
|
|
||||||
var t = f.value.match(p);
|
|
||||||
if (t)return t[0].length;
|
|
||||||
var r = c.indexOf(f.value[0]) + 1;
|
|
||||||
return r == 1 && e.getLine(n - 1).length != e.getLine(n).length ? Infinity : r
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e.getLine(n), i = r.length, o = e.getLength(), u = n, a = n;
|
|
||||||
if (!r.match(this.foldingStartMarker))return;
|
|
||||||
var f, c = ["=", "-", "~", "^", "+"], h = "markup.heading", p = this.singleLineHeadingRe;
|
|
||||||
if (l(n) == h) {
|
|
||||||
var v = d();
|
|
||||||
while (++n < o) {
|
|
||||||
if (l(n) != h)continue;
|
|
||||||
var m = d();
|
|
||||||
if (m <= v)break
|
|
||||||
}
|
|
||||||
var g = f && f.value.match(this.singleLineHeadingRe);
|
|
||||||
a = g ? n - 1 : n - 2;
|
|
||||||
if (a > u)while (a > u && (!l(a) || f.value[0] == "["))a--;
|
|
||||||
if (a > u) {
|
|
||||||
var y = e.getLine(a).length;
|
|
||||||
return new s(u, i, a, y)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var b = e.bgTokenizer.getState(n);
|
|
||||||
if (b == "dissallowDelimitedBlock") {
|
|
||||||
while (n-- > 0)if (e.bgTokenizer.getState(n).lastIndexOf("Block") == -1)break;
|
|
||||||
a = n + 1;
|
|
||||||
if (a < u) {
|
|
||||||
var y = e.getLine(n).length;
|
|
||||||
return new s(a, 5, u, i - 5)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (++n < o)if (e.bgTokenizer.getState(n) == "dissallowDelimitedBlock")break;
|
|
||||||
a = n;
|
|
||||||
if (a > u) {
|
|
||||||
var y = e.getLine(n).length;
|
|
||||||
return new s(u, 5, a, y - 5)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
ace.define("ace/mode/c9search", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/c9search_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/folding/c9search"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./c9search_highlight_rules").C9SearchHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./folding/c9search").FoldMode, f = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules(), "i"), this.$outdent = new u, this.foldingRules = new a
|
|
||||||
};
|
|
||||||
r.inherits(f, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t);
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/c9search_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text"], regex: "(^\\s+[0-9]+)(:\\s*)(.+)"},
|
|
||||||
{token: ["string", "text"], regex: "(.+)(:$)"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.C9SearchHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/folding/c9search", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /^(\S.*\:|Searching for.*)$/, this.foldingStopMarker = /^(\s+|Found.*)$/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.doc.getAllLines(n), s = r[n], o = /^(Found.*|Searching for.*)$/, u = /^(\S.*\:|\s*)$/, a = o.test(s) ? o : u;
|
|
||||||
if (this.foldingStartMarker.test(s)) {
|
|
||||||
for (var f = n + 1, l = e.getLength(); f < l; f++)if (a.test(r[f]))break;
|
|
||||||
return new i(n, s.length, f, 0)
|
|
||||||
}
|
|
||||||
if (this.foldingStopMarker.test(s)) {
|
|
||||||
for (var f = n - 1; f >= 0; f--) {
|
|
||||||
s = r[f];
|
|
||||||
if (a.test(s))break
|
|
||||||
}
|
|
||||||
return new i(f, s.length, n, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,248 +0,0 @@
|
|||||||
ace.define("ace/mode/c_cpp", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/c_cpp_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./c_cpp_highlight_rules").c_cppHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("./behaviour/cstyle").CstyleBehaviour, l = e("./folding/cstyle").FoldMode, c = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new f, this.foldingRules = new l
|
|
||||||
};
|
|
||||||
r.inherits(c, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var u = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
} else if (e == "doc-start") {
|
|
||||||
if (o == "start")return"";
|
|
||||||
var u = t.match(/^\s*(\/?)\*/);
|
|
||||||
u && (u[1] && (r += " "), r += "* ")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(c.prototype), t.Mode = c
|
|
||||||
}), ace.define("ace/mode/c_cpp_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = t.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b", u = function () {
|
|
||||||
var e = "break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using", t = "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template", n = "const|extern|register|restrict|static|volatile|inline|private:|protected:|public:|friend|explicit|virtual|export|mutable|typename", r = "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eqconst_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace", s = "NULL|true|false|TRUE|FALSE", u = this.$keywords = this.createKeywordMapper({"keyword.control": e, "storage.type": t, "storage.modifier": n, "keyword.operator": r, "variable.language": "this", "constant.language": s}, "identifier"), a = "[a-zA-Z\\$_¡-][a-zA-Zd\\$_¡-]*\\b";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: '["].*\\\\$', next: "qqstring"},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "string", regex: "['].*\\\\$", next: "qstring"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "keyword", regex: "(?:#include|#import|#pragma|#line|#define|#undef|#if|#ifdef|#else|#elif|#ifndef)\\b", next: "directive"},
|
|
||||||
{token: "keyword", regex: "(?:#endif)\\b"},
|
|
||||||
{token: "support.function.C99.c", regex: o},
|
|
||||||
{token: u, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "string", regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "string", regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
], directive: [
|
|
||||||
{token: "constant.other.multiline", regex: /\\/},
|
|
||||||
{token: "constant.other.multiline", regex: /.*\\/},
|
|
||||||
{token: "constant.other", regex: "\\s*<.+?>", next: "start"},
|
|
||||||
{token: "constant.other", regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', next: "start"},
|
|
||||||
{token: "constant.other", regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", next: "start"},
|
|
||||||
{token: "constant.other", regex: /[^\\\/]+/, next: "start"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(u, s), t.c_cppHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
ace.define("ace/mode/clojure", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/clojure_highlight_rules", "ace/mode/matching_parens_outdent", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./clojure_highlight_rules").ClojureHighlightRules, u = e("./matching_parens_outdent").MatchingParensOutdent, a = e("../range").Range, f = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u
|
|
||||||
};
|
|
||||||
r.inherits(f, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)#/;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, ";")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var o = t.match(/[\(\[]/);
|
|
||||||
o && (r += " "), o = t.match(/[\)]/), o && (r = "")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/clojure_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
var e = "* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - -> ->> .. / < <= = == > > >= >= accessor aclone add-classpath add-watch agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq zero? zipmap", t = "throw try var def do fn if let loop monitor-enter monitor-exit new quote recur set!", n = "true false nil", r = this.createKeywordMapper({keyword: t, "constant.language": n, "support.function": e}, "identifier", !1, " ");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: ";.*$"},
|
|
||||||
{token: "keyword", regex: "[\\(|\\)]"},
|
|
||||||
{token: "keyword", regex: "[\\'\\(]"},
|
|
||||||
{token: "keyword", regex: "[\\[|\\]]"},
|
|
||||||
{token: "keyword", regex: "[\\{|\\}|\\#\\{|\\#\\}]"},
|
|
||||||
{token: "keyword", regex: "[\\&]"},
|
|
||||||
{token: "keyword", regex: "[\\#\\^\\{]"},
|
|
||||||
{token: "keyword", regex: "[\\%]"},
|
|
||||||
{token: "keyword", regex: "[@]"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language", regex: "[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]"},
|
|
||||||
{token: r, regex: "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"},
|
|
||||||
{token: "string", regex: '"', next: "string"},
|
|
||||||
{token: "string", regex: /:[\w*+!\-_?:\/]+/},
|
|
||||||
{token: "string.regexp", regex: '/#"(?:\\.|(?:\\")|[^""\n])*"/g'}
|
|
||||||
], string: [
|
|
||||||
{token: "constant.language.escape", regex: "\\\\.|\\\\$"},
|
|
||||||
{token: "string", regex: '[^"\\\\]+'},
|
|
||||||
{token: "string", regex: '"', next: "start"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.ClojureHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_parens_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\)/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\))/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingParensOutdent = i
|
|
||||||
})
|
|
||||||
@ -1,140 +0,0 @@
|
|||||||
ace.define("ace/mode/coffee", ["require", "exports", "module", "ace/tokenizer", "ace/mode/coffee_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/folding/coffee", "ace/range", "ace/mode/text", "ace/worker/worker_client", "ace/lib/oop"], function (e, t, n) {
|
|
||||||
function c() {
|
|
||||||
this.$tokenizer = new r((new i).getRules()), this.$outdent = new s, this.foldingRules = new o
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("../tokenizer").Tokenizer, i = e("./coffee_highlight_rules").CoffeeHighlightRules, s = e("./matching_brace_outdent").MatchingBraceOutdent, o = e("./folding/coffee").FoldMode, u = e("../range").Range, a = e("./text").Mode, f = e("../worker/worker_client").WorkerClient, l = e("../lib/oop");
|
|
||||||
l.inherits(c, a), function () {
|
|
||||||
var e = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/, t = /^(\s*)#/, n = /^\s*###(?!#)/, r = /^\s*/;
|
|
||||||
this.getNextLineIndent = function (t, n, r) {
|
|
||||||
var i = this.$getIndent(n), s = this.$tokenizer.getLineTokens(n, t).tokens;
|
|
||||||
return(!s.length || s[s.length - 1].type !== "comment") && t === "start" && e.test(n) && (i += r), i
|
|
||||||
}, this.toggleCommentLines = function (e, i, s, o) {
|
|
||||||
console.log("toggle");
|
|
||||||
var a = new u(0, 0, 0, 0);
|
|
||||||
for (var f = s; f <= o; ++f) {
|
|
||||||
var l = i.getLine(f);
|
|
||||||
if (n.test(l))continue;
|
|
||||||
t.test(l) ? l = l.replace(t, "$1") : l = l.replace(r, "$&#"), a.end.row = a.start.row = f, a.end.column = l.length + 1, i.replace(a, l)
|
|
||||||
}
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
var t = new f(["ace"], "ace/mode/coffee_worker", "Worker");
|
|
||||||
return t.attachToDocument(e.getDocument()), t.on("error", function (t) {
|
|
||||||
e.setAnnotations([t.data])
|
|
||||||
}), t.on("ok", function (t) {
|
|
||||||
e.clearAnnotations()
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
}.call(c.prototype), t.Mode = c
|
|
||||||
}), ace.define("ace/mode/coffee_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
function s() {
|
|
||||||
var e = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*", t = "this|throw|then|try|typeof|super|switch|return|break|by|continue|catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|or|on|unless|until|and|yes", n = "true|false|null|undefined|NaN|Infinity", r = "case|const|default|function|var|void|with|enum|export|implements|interface|let|package|private|protected|public|static|yield|__hasProp|slice|bind|indexOf", i = "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray", s = "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|encodeURIComponent|decodeURI|decodeURIComponent|String|", o = "window|arguments|prototype|document", u = this.createKeywordMapper({keyword: t, "constant.language": n, "invalid.illegal": r, "language.support.class": i, "language.support.function": s, "variable.language": o}, "identifier"), a = {token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source}, f = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "constant.numeric", regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"},
|
|
||||||
{stateName: "qdoc", token: "string", regex: "'''", next: [
|
|
||||||
{token: "string", regex: "'''", next: "start"},
|
|
||||||
{token: "constant.language.escape", regex: f},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]},
|
|
||||||
{stateName: "qqdoc", token: "string", regex: '"""', next: [
|
|
||||||
{token: "string", regex: '"""', next: "start"},
|
|
||||||
{token: "constant.language.escape", regex: f},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]},
|
|
||||||
{stateName: "qstring", token: "string", regex: "'", next: [
|
|
||||||
{token: "string", regex: "'", next: "start"},
|
|
||||||
{token: "constant.language.escape", regex: f},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]},
|
|
||||||
{stateName: "qqstring", token: "string.start", regex: '"', next: [
|
|
||||||
{token: "string.end", regex: '"', next: "start"},
|
|
||||||
{token: "constant.language.escape", regex: f},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]},
|
|
||||||
{stateName: "js", token: "string", regex: "`", next: [
|
|
||||||
{token: "string", regex: "`", next: "start"},
|
|
||||||
{token: "constant.language.escape", regex: f},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]},
|
|
||||||
{token: "string.regex", regex: "///", next: "heregex"},
|
|
||||||
{token: "string.regex", regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/},
|
|
||||||
{token: "comment", regex: "###(?!#)", next: "comment"},
|
|
||||||
{token: "comment", regex: "#.*"},
|
|
||||||
{token: ["punctuation.operator", "text", "identifier"], regex: "(\\.)(\\s*)(" + r + ")"},
|
|
||||||
{token: "punctuation.operator", regex: "\\."},
|
|
||||||
{token: ["keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class"], regex: "(class)(\\s+)(" + e + ")(?:(\\s+)(extends)(\\s+)(" + e + "))?"},
|
|
||||||
{token: ["entity.name.function", "text", "keyword.operator", "text"].concat(a.token), regex: "(" + e + ")(\\s*)([=:])(\\s*)" + a.regex},
|
|
||||||
a,
|
|
||||||
{token: "variable", regex: "@(?:" + e + ")?"},
|
|
||||||
{token: u, regex: e},
|
|
||||||
{token: "punctuation.operator", regex: "\\,|\\."},
|
|
||||||
{token: "storage.type", regex: "[\\-=]>"},
|
|
||||||
{token: "keyword.operator", regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"},
|
|
||||||
{token: "paren.lparen", regex: "[({[]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\]})]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], heregex: [
|
|
||||||
{token: "string.regex", regex: ".*?///[imgy]{0,4}", next: "start"},
|
|
||||||
{token: "comment.regex", regex: "\\s+(?:#.*)?"},
|
|
||||||
{token: "string.regex", regex: "\\S+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: "###", next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
]}, this.normalizeRules()
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules;
|
|
||||||
r.inherits(s, i), t.CoffeeHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/folding/coffee", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = this.indentationBlock(e, n);
|
|
||||||
if (r)return r;
|
|
||||||
var i = /\S/, o = e.getLine(n), u = o.search(i);
|
|
||||||
if (u == -1 || o[u] != "#")return;
|
|
||||||
var a = o.length, f = e.getLength(), l = n, c = n;
|
|
||||||
while (++n < f) {
|
|
||||||
o = e.getLine(n);
|
|
||||||
var h = o.search(i);
|
|
||||||
if (h == -1)continue;
|
|
||||||
if (o[h] != "#")break;
|
|
||||||
c = n
|
|
||||||
}
|
|
||||||
if (c > l) {
|
|
||||||
var p = e.getLine(c).length;
|
|
||||||
return new s(l, a, c, p)
|
|
||||||
}
|
|
||||||
}, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.search(/\S/), s = e.getLine(n + 1), o = e.getLine(n - 1), u = o.search(/\S/), a = s.search(/\S/);
|
|
||||||
if (i == -1)return e.foldWidgets[n - 1] = u != -1 && u < a ? "start" : "", "";
|
|
||||||
if (u == -1) {
|
|
||||||
if (i == a && r[i] == "#" && s[i] == "#")return e.foldWidgets[n - 1] = "", e.foldWidgets[n + 1] = "", "start"
|
|
||||||
} else if (u == i && r[i] == "#" && o[i] == "#" && e.getLine(n - 2).search(/\S/) == -1)return e.foldWidgets[n - 1] = "start", e.foldWidgets[n + 1] = "", "";
|
|
||||||
return u != -1 && u < i ? e.foldWidgets[n - 1] = "start" : e.foldWidgets[n - 1] = "", i < a ? "start" : ""
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,217 +0,0 @@
|
|||||||
ace.define("ace/mode/csharp", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/csharp_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./csharp_highlight_rules").CSharpHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode, l = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new a, this.foldingRules = new f
|
|
||||||
};
|
|
||||||
r.inherits(l, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var o = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
o && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}.call(l.prototype), t.Mode = l
|
|
||||||
}), ace.define("ace/mode/csharp_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = this.createKeywordMapper({"variable.language": "this", keyword: "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic", "constant.language": "null|true|false"}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: e, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.CSharpHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,71 +0,0 @@
|
|||||||
ace.define("ace/mode/dart", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/dart_highlight_rules", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./dart_highlight_rules").DartHighlightRules, u = e("./folding/cstyle").FoldMode, a = function () {
|
|
||||||
var e = new o;
|
|
||||||
this.foldingRules = new u, this.$tokenizer = new s(e.getRules())
|
|
||||||
};
|
|
||||||
r.inherits(a, i), function () {
|
|
||||||
}.call(a.prototype), t.Mode = a
|
|
||||||
}), ace.define("ace/mode/dart_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
var e = "true|false|null", t = "this|super", n = "try|catch|finally|throw|break|case|continue|default|do|else|for|if|in|return|switch|while|new", r = "abstract|class|extends|external|factory|implements|interface|get|native|operator|set|typedef", i = "static|final|const", s = "void|bool|num|int|double|Dynamic|var|String", o = this.createKeywordMapper({"constant.language.dart": e, "variable.language.dart": t, "keyword.control.dart": n, "keyword.declaration.dart": r, "storage.modifier.dart": i, "storage.type.primitive.dart": s}, "identifier"), u = {token: "string", regex: ".+"};
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: /\/\/.*$/},
|
|
||||||
{token: "comment", regex: /\/\*/, next: "comment"},
|
|
||||||
{token: ["meta.preprocessor.script.dart"], regex: "^(#!.*)$"},
|
|
||||||
{token: "keyword.other.import.dart", regex: "#(?:\\b)(?:library|import|source|resource)(?:\\b)"},
|
|
||||||
{token: ["keyword.other.import.dart", "text"], regex: "(?:\\b)(prefix)(\\s*:)"},
|
|
||||||
{regex: "\\bas\\b", token: "keyword.cast.dart"},
|
|
||||||
{regex: "\\?|:", token: "keyword.control.ternary.dart"},
|
|
||||||
{regex: "(?:\\b)(is\\!?)(?:\\b)", token: ["keyword.operator.dart"]},
|
|
||||||
{regex: "(<<|>>>?|~|\\^|\\||&)", token: ["keyword.operator.bitwise.dart"]},
|
|
||||||
{regex: "((?:&|\\^|\\||<<|>>>?)=)", token: ["keyword.operator.assignment.bitwise.dart"]},
|
|
||||||
{regex: "(===?|!==?|<=?|>=?)", token: ["keyword.operator.comparison.dart"]},
|
|
||||||
{regex: "((?:[+*/%-]|\\~)=)", token: ["keyword.operator.assignment.arithmetic.dart"]},
|
|
||||||
{regex: "=", token: "keyword.operator.assignment.dart"},
|
|
||||||
{token: "string", regex: "'''", next: "qdoc"},
|
|
||||||
{token: "string", regex: '"""', next: "qqdoc"},
|
|
||||||
{token: "string", regex: "'", next: "qstring"},
|
|
||||||
{token: "string", regex: '"', next: "qqstring"},
|
|
||||||
{regex: "(\\-\\-|\\+\\+)", token: ["keyword.operator.increment-decrement.dart"]},
|
|
||||||
{regex: "(\\-|\\+|\\*|\\/|\\~\\/|%)", token: ["keyword.operator.arithmetic.dart"]},
|
|
||||||
{regex: "(!|&&|\\|\\|)", token: ["keyword.operator.logical.dart"]},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: o, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
], qdoc: [
|
|
||||||
{token: "string", regex: ".*?'''", next: "start"},
|
|
||||||
u
|
|
||||||
], qqdoc: [
|
|
||||||
{token: "string", regex: '.*?"""', next: "start"},
|
|
||||||
u
|
|
||||||
], qstring: [
|
|
||||||
{token: "string", regex: "[^\\\\']*(?:\\\\.[^\\\\']*)*'", next: "start"},
|
|
||||||
u
|
|
||||||
], qqstring: [
|
|
||||||
{token: "string", regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', next: "start"},
|
|
||||||
u
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.DartHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
ace.define("ace/mode/diff", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/diff_highlight_rules", "ace/mode/folding/diff"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./diff_highlight_rules").DiffHighlightRules, u = e("./folding/diff").FoldMode, a = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules(), "i"), this.foldingRules = new u(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i")
|
|
||||||
};
|
|
||||||
r.inherits(a, i), function () {
|
|
||||||
}.call(a.prototype), t.Mode = a
|
|
||||||
}), ace.define("ace/mode/diff_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$", token: "punctuation.definition.separator.diff", name: "keyword"},
|
|
||||||
{regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$", token: ["constant", "constant.numeric", "constant", "comment.doc.tag"]},
|
|
||||||
{regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", token: ["constant.numeric", "punctuation.definition.range.diff", "constant.function", "constant.numeric", "punctuation.definition.range.diff", "invalid"], name: "meta."},
|
|
||||||
{regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$", token: ["constant.numeric", "meta.tag"]},
|
|
||||||
{regex: "^([!+>])(.*?)(\\s*)$", token: ["support.constant", "text", "invalid"]},
|
|
||||||
{regex: "^([<\\-])(.*?)(\\s*)$", token: ["support.function", "string", "invalid"]},
|
|
||||||
{regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", token: ["variable", "variable", "keyword", "variable"]},
|
|
||||||
{regex: "^Index.+$", token: "variable"},
|
|
||||||
{regex: "\\s*$", token: "invalid"},
|
|
||||||
{defaultToken: "invisible"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.DiffHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/diff", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function (e, t) {
|
|
||||||
this.regExpList = e, this.flag = t, this.foldingStartMarker = RegExp("^(" + e.join("|") + ")", this.flag)
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = {row: n, column: r.length}, o = this.regExpList;
|
|
||||||
for (var u = 1; u <= o.length; u++) {
|
|
||||||
var a = RegExp("^(" + o.slice(0, u).join("|") + ")", this.flag);
|
|
||||||
if (a.test(r))break
|
|
||||||
}
|
|
||||||
for (var f = e.getLength(); ++n < f;) {
|
|
||||||
r = e.getLine(n);
|
|
||||||
if (a.test(r))break
|
|
||||||
}
|
|
||||||
if (n == i.row + 1)return;
|
|
||||||
return s.fromPoints(i, {row: n - 1, column: r.length})
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,115 +0,0 @@
|
|||||||
ace.define("ace/mode/dot", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/matching_brace_outdent", "ace/mode/dot_highlight_rules", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./matching_brace_outdent").MatchingBraceOutdent, u = e("./dot_highlight_rules").DotHighlightRules, a = e("./folding/cstyle").FoldMode, f = function () {
|
|
||||||
var e = new u;
|
|
||||||
this.$outdent = new o, this.foldingRules = new a, this.$tokenizer = new s(e.getRules())
|
|
||||||
};
|
|
||||||
r.inherits(f, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new Range(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var a = t.getLine(o), f = a.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = f[0].length, t.replace(u, f[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var u = t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/dot_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules", "ace/mode/doc_comment_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("../lib/lang"), s = e("./text_highlight_rules").TextHighlightRules, o = e("./doc_comment_highlight_rules").DocCommentHighlightRules, u = function () {
|
|
||||||
var e = i.arrayToMap("strict|node|edge|graph|digraph|subgraph".split("|")), t = i.arrayToMap("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z".split("|"));
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: /\/\/.*$/},
|
|
||||||
{token: "comment", regex: /#.*$/},
|
|
||||||
{token: "comment", merge: !0, regex: /\/\*/, next: "comment"},
|
|
||||||
{token: "string", regex: "'(?=.)", next: "qstring"},
|
|
||||||
{token: "string", regex: '"(?=.)', next: "qqstring"},
|
|
||||||
{token: "constant.numeric", regex: /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/},
|
|
||||||
{token: "keyword.operator", regex: /\+|=|\->/},
|
|
||||||
{token: "punctuation.operator", regex: /,|;/},
|
|
||||||
{token: "paren.lparen", regex: /[\[{]/},
|
|
||||||
{token: "paren.rparen", regex: /[\]}]/},
|
|
||||||
{token: "comment", regex: /^#!.*$/},
|
|
||||||
{token: function (n) {
|
|
||||||
return e.hasOwnProperty(n.toLowerCase()) ? "keyword" : t.hasOwnProperty(n.toLowerCase()) ? "variable" : "text"
|
|
||||||
}, regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", merge: !0, next: "start"},
|
|
||||||
{token: "comment", merge: !0, regex: ".+"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "string", regex: '[^"\\\\]+', merge: !0},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qqstring", merge: !0},
|
|
||||||
{token: "string", regex: '"|$', next: "start", merge: !0}
|
|
||||||
], qstring: [
|
|
||||||
{token: "string", regex: "[^'\\\\]+", merge: !0},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qstring", merge: !0},
|
|
||||||
{token: "string", regex: "'|$", next: "start", merge: !0}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(u, s), t.DotHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,261 +0,0 @@
|
|||||||
ace.define("ace/mode/glsl", ["require", "exports", "module", "ace/lib/oop", "ace/mode/c_cpp", "ace/tokenizer", "ace/mode/glsl_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./c_cpp").Mode, s = e("../tokenizer").Tokenizer, o = e("./glsl_highlight_rules").glslHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("./behaviour/cstyle").CstyleBehaviour, l = e("./folding/cstyle").FoldMode, c = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new f, this.foldingRules = new l
|
|
||||||
};
|
|
||||||
r.inherits(c, i), t.Mode = c
|
|
||||||
}), ace.define("ace/mode/c_cpp", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/c_cpp_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./c_cpp_highlight_rules").c_cppHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("./behaviour/cstyle").CstyleBehaviour, l = e("./folding/cstyle").FoldMode, c = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new f, this.foldingRules = new l
|
|
||||||
};
|
|
||||||
r.inherits(c, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var u = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
} else if (e == "doc-start") {
|
|
||||||
if (o == "start")return"";
|
|
||||||
var u = t.match(/^\s*(\/?)\*/);
|
|
||||||
u && (u[1] && (r += " "), r += "* ")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(c.prototype), t.Mode = c
|
|
||||||
}), ace.define("ace/mode/c_cpp_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = t.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b", u = function () {
|
|
||||||
var e = "break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using", t = "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template", n = "const|extern|register|restrict|static|volatile|inline|private:|protected:|public:|friend|explicit|virtual|export|mutable|typename", r = "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eqconst_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace", s = "NULL|true|false|TRUE|FALSE", u = this.$keywords = this.createKeywordMapper({"keyword.control": e, "storage.type": t, "storage.modifier": n, "keyword.operator": r, "variable.language": "this", "constant.language": s}, "identifier"), a = "[a-zA-Z\\$_¡-][a-zA-Zd\\$_¡-]*\\b";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: '["].*\\\\$', next: "qqstring"},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "string", regex: "['].*\\\\$", next: "qstring"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "keyword", regex: "(?:#include|#import|#pragma|#line|#define|#undef|#if|#ifdef|#else|#elif|#ifndef)\\b", next: "directive"},
|
|
||||||
{token: "keyword", regex: "(?:#endif)\\b"},
|
|
||||||
{token: "support.function.C99.c", regex: o},
|
|
||||||
{token: u, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "string", regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "string", regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
], directive: [
|
|
||||||
{token: "constant.other.multiline", regex: /\\/},
|
|
||||||
{token: "constant.other.multiline", regex: /.*\\/},
|
|
||||||
{token: "constant.other", regex: "\\s*<.+?>", next: "start"},
|
|
||||||
{token: "constant.other", regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', next: "start"},
|
|
||||||
{token: "constant.other", regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", next: "start"},
|
|
||||||
{token: "constant.other", regex: /[^\\\/]+/, next: "start"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(u, s), t.c_cppHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
}), ace.define("ace/mode/glsl_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/c_cpp_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./c_cpp_highlight_rules").c_cppHighlightRules, s = function () {
|
|
||||||
var e = "attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct", t = "radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData", n = this.createKeywordMapper({"variable.language": "this", keyword: e, "constant.language": t}, "identifier");
|
|
||||||
this.$rules = (new i).$rules, this.$rules.start.forEach(function (e) {
|
|
||||||
typeof e.token == "function" && (e.token = n)
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.glslHighlightRules = s
|
|
||||||
})
|
|
||||||
@ -1,236 +0,0 @@
|
|||||||
ace.define("ace/mode/golang", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/golang_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./golang_highlight_rules").GolangHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode, l = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.foldingRules = new f
|
|
||||||
};
|
|
||||||
r.inherits(l, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new Range(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var a = t.getLine(o), f = a.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = f[0].length, t.replace(u, f[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var u = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(l.prototype), t.Mode = l
|
|
||||||
}), ace.define("ace/mode/golang_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = "true|else|false|break|case|return|goto|if|const|continue|struct|default|switch|for|func|import|package|chan|defer|fallthrough|go|interface|map|rangeselect|type|var", t = "nil|true|false|iota", n = this.createKeywordMapper({"variable.language": "this", keyword: e, "constant.language": t}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: '["].*\\\\$', next: "qqstring"},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "string", regex: "['].*\\\\$", next: "qstring"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant", regex: "<[a-zA-Z0-9.]+>"},
|
|
||||||
{token: "keyword", regex: "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},
|
|
||||||
{token: n, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "string", regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "string", regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next: "start"},
|
|
||||||
{token: "string", regex: ".+"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.GolangHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,328 +0,0 @@
|
|||||||
ace.define("ace/mode/groovy", ["require", "exports", "module", "ace/lib/oop", "ace/mode/javascript", "ace/tokenizer", "ace/mode/groovy_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./javascript").Mode, s = e("../tokenizer").Tokenizer, o = e("./groovy_highlight_rules").GroovyHighlightRules, u = function () {
|
|
||||||
i.call(this), this.$tokenizer = new s((new o).getRules())
|
|
||||||
};
|
|
||||||
r.inherits(u, i), function () {
|
|
||||||
this.createWorker = function (e) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}.call(u.prototype), t.Mode = u
|
|
||||||
}), ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./javascript_highlight_rules").JavaScriptHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("../worker/worker_client").WorkerClient, l = e("./behaviour/cstyle").CstyleBehaviour, c = e("./folding/cstyle").FoldMode, h = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new l, this.foldingRules = new c
|
|
||||||
};
|
|
||||||
r.inherits(h, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start" || e == "regex_allowed") {
|
|
||||||
var u = t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
} else if (e == "doc-start") {
|
|
||||||
if (o == "start" || e == "regex_allowed")return"";
|
|
||||||
var u = t.match(/^\s*(\/?)\*/);
|
|
||||||
u && (u[1] && (r += " "), r += "* ")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
var t = new f(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
|
||||||
return t.attachToDocument(e.getDocument()), t.on("jslint", function (t) {
|
|
||||||
e.setAnnotations(t.data)
|
|
||||||
}), t.on("terminate", function () {
|
|
||||||
e.clearAnnotations()
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
}.call(h.prototype), t.Mode = h
|
|
||||||
}), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = this.createKeywordMapper({"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document", keyword: "const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": "const|let|var|function", "constant.language": "null|Infinity|NaN|undefined", "support.function": "alert", "constant.language.boolean": "true|false"}, "identifier"), t = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void", n = "[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b", r = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: /\/\/.*$/},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: /\/\*/, next: "comment"},
|
|
||||||
{token: "string", regex: "'(?=.)", next: "qstring"},
|
|
||||||
{token: "string", regex: '"(?=.)', next: "qqstring"},
|
|
||||||
{token: "constant.numeric", regex: /0[xX][0-9a-fA-F]+\b/},
|
|
||||||
{token: "constant.numeric", regex: /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"], regex: "(" + n + ")(\\.)(prototype)(\\.)(" + n + ")(\\s*)(=)", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(function)(\\s+)(" + n + ")(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["text", "text", "storage.type", "text", "paren.lparen"], regex: "(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: "keyword", regex: "(?:" + t + ")\\b", next: "regex_allowed"},
|
|
||||||
{token: ["punctuation.operator", "support.function"], regex: /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.function.dom"], regex: /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.constant"], regex: /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function.firebug"], regex: /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},
|
|
||||||
{token: e, regex: n},
|
|
||||||
{token: "keyword.operator", regex: /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, next: "regex_allowed"},
|
|
||||||
{token: "punctuation.operator", regex: /\?|\:|\,|\;|\./, next: "regex_allowed"},
|
|
||||||
{token: "paren.lparen", regex: /[\[({]/, next: "regex_allowed"},
|
|
||||||
{token: "paren.rparen", regex: /[\])}]/},
|
|
||||||
{token: "keyword.operator", regex: /\/=?/, next: "regex_allowed"},
|
|
||||||
{token: "comment", regex: /^#!.*$/}
|
|
||||||
], regex_allowed: [i.getStartRule("doc-start"), {token: "comment", regex: "\\/\\*", next: "comment_regex_allowed"}, {token: "comment", regex: "\\/\\/.*$"}, {token: "string.regexp", regex: "\\/", next: "regex"}, {token: "text", regex: "\\s+"}, {token: "empty", regex: "", next: "start"}], regex: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "string.regexp", regex: "/\\w*", next: "start"},
|
|
||||||
{token: "invalid", regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},
|
|
||||||
{token: "constant.language.escape", regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},
|
|
||||||
{token: "constant.language.delimiter", regex: /\|/},
|
|
||||||
{token: "constant.language.escape", regex: /\[\^?/, next: "regex_character_class"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp"}
|
|
||||||
], regex_character_class: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "constant.language.escape", regex: "]", next: "regex"},
|
|
||||||
{token: "constant.language.escape", regex: "-"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp.charachterclass"}
|
|
||||||
], function_arguments: [
|
|
||||||
{token: "variable.parameter", regex: n},
|
|
||||||
{token: "punctuation.operator", regex: "[, ]+"},
|
|
||||||
{token: "punctuation.operator", regex: "$"},
|
|
||||||
{token: "empty", regex: "", next: "start"}
|
|
||||||
], comment_regex_allowed: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "regex_allowed"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qqstring"},
|
|
||||||
{token: "string", regex: '"|$', next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qstring"},
|
|
||||||
{token: "string", regex: "'|$", next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.JavaScriptHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
}), ace.define("ace/mode/groovy_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = "assert|with|abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|def|float|native|super|while", t = "null|Infinity|NaN|undefined", n = "AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object", r = this.createKeywordMapper({"variable.language": "this", keyword: e, "support.function": n, "constant.language": t}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
{token: "string", regex: '"""', next: "qqstring"},
|
|
||||||
{token: "string", regex: "'''", next: "qstring"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: r, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "lparen", regex: "[[({]"},
|
|
||||||
{token: "rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "constant.language.escape", regex: /\\(?:u[0-9A-Fa-f]{4}|.|$)/},
|
|
||||||
{token: "constant.language.escape", regex: /\$[\w\d]+/},
|
|
||||||
{token: "constant.language.escape", regex: /\$\{[^"\}]+\}?/},
|
|
||||||
{token: "string", regex: '"{3,5}', next: "start"},
|
|
||||||
{token: "string", regex: ".+?"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "constant.language.escape", regex: /\\(?:u[0-9A-Fa-f]{4}|.|$)/},
|
|
||||||
{token: "string", regex: "'{3,5}", next: "start"},
|
|
||||||
{token: "string", regex: ".+?"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.GroovyHighlightRules = o
|
|
||||||
})
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
ace.define("ace/mode/haml", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/haml_highlight_rules", "ace/mode/folding/coffee"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./haml_highlight_rules").HamlHighlightRules, u = e("./folding/coffee").FoldMode, a = function () {
|
|
||||||
var e = new o;
|
|
||||||
this.foldingRules = new u, this.$tokenizer = new s(e.getRules())
|
|
||||||
};
|
|
||||||
r.inherits(a, i), function () {
|
|
||||||
}.call(a.prototype), t.Mode = a
|
|
||||||
}), ace.define("ace/mode/haml_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules", "ace/mode/ruby_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = e("./ruby_highlight_rules"), o = s.RubyHighlightRules, u = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "punctuation.section.comment", regex: /^\s*\/.*/},
|
|
||||||
{token: "punctuation.section.comment", regex: /^\s*#.*/},
|
|
||||||
{token: "string.quoted.double", regex: "==.+?=="},
|
|
||||||
{token: "keyword.other.doctype", regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"},
|
|
||||||
s.qString,
|
|
||||||
s.qqString,
|
|
||||||
s.tString,
|
|
||||||
{token: ["entity.name.tag.haml"], regex: /^\s*%[\w:]+/, next: "tag_single"},
|
|
||||||
{token: ["meta.escape.haml"], regex: "^\\s*\\\\."},
|
|
||||||
s.constantNumericHex,
|
|
||||||
s.constantNumericFloat,
|
|
||||||
s.constantOtherSymbol,
|
|
||||||
{token: "text", regex: "=|-|~", next: "embedded_ruby"}
|
|
||||||
], tag_single: [
|
|
||||||
{token: "entity.other.attribute-name.class.haml", regex: "\\.[\\w-]+"},
|
|
||||||
{token: "entity.other.attribute-name.id.haml", regex: "#[\\w-]+"},
|
|
||||||
{token: "punctuation.section", regex: "\\{", next: "section"},
|
|
||||||
s.constantOtherSymbol,
|
|
||||||
{token: "text", regex: /\s/, next: "start"},
|
|
||||||
{token: "empty", regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", next: "start"}
|
|
||||||
], section: [s.constantOtherSymbol, s.qString, s.qqString, s.tString, s.constantNumericHex, s.constantNumericFloat, {token: "punctuation.section", regex: "\\}", next: "start"}], embedded_ruby: [s.constantNumericHex, s.constantNumericFloat, {token: "support.class", regex: "[A-Z][a-zA-Z_\\d]+"}, {token: (new o).getKeywords(), regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token: ["keyword", "text", "text"], regex: "(?:do|\\{)(?: \\|[^|]+\\|)?$", next: "start"}, {token: ["text"], regex: "^$", next: "start"}, {token: ["text"], regex: "^(?!.*\\|\\s*$)", next: "start"}]}
|
|
||||||
};
|
|
||||||
r.inherits(u, i), t.HamlHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/ruby_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = t.constantOtherSymbol = {token: "constant.other.symbol.ruby", regex: "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"}, o = t.qString = {token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, u = t.qqString = {token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, a = t.tString = {token: "string", regex: "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"}, f = t.constantNumericHex = {token: "constant.numeric", regex: "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"}, l = t.constantNumericFloat = {token: "constant.numeric", regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"}, c = function () {
|
|
||||||
var e = "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|validates_inclusion_of|validates_numericality_of|validates_with|validates_each|authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|cache|expire_fragment|expire_cache_for|observe|cache_sweeper|has_many|has_one|belongs_to|has_and_belongs_to_many", t = "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield", n = "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING", r = "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|$!|root_url|flash|session|cookies|params|request|response|logger|self", i = this.$keywords = this.createKeywordMapper({keyword: t, "constant.language": n, "variable.language": r, "support.function": e, "invalid.deprecated": "debugger"}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "#.*$"},
|
|
||||||
{token: "comment", regex: "^=begin\\s", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
o,
|
|
||||||
u,
|
|
||||||
a,
|
|
||||||
{token: "text", regex: "::"},
|
|
||||||
{token: "variable.instance", regex: "@{1,2}[a-zA-Z_\\d]+"},
|
|
||||||
{token: "support.class", regex: "[A-Z][a-zA-Z_\\d]+"},
|
|
||||||
s,
|
|
||||||
f,
|
|
||||||
l,
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: i, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "punctuation.separator.key-value", regex: "=>"},
|
|
||||||
{stateName: "heredoc", token: function (e, t, n) {
|
|
||||||
var r = e[3] == "-" ? "heredoc" : "indentedHeredoc", i = e.split(this.splitRegex);
|
|
||||||
return n.push(r, i[3]), [
|
|
||||||
{type: "constant", value: "<<"},
|
|
||||||
{type: "string", value: i[2]},
|
|
||||||
{type: "support.class", value: i[3]},
|
|
||||||
{type: "string", value: i[4]}
|
|
||||||
]
|
|
||||||
}, regex: "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", rules: {heredoc: [
|
|
||||||
{token: function (e, t, n) {
|
|
||||||
return e == n[1] ? (n.shift(), n.shift(), "support.class") : "string"
|
|
||||||
}, regex: ".*$", next: "start"}
|
|
||||||
], indentedHeredoc: [
|
|
||||||
{token: "string", regex: "^ +"},
|
|
||||||
{token: function (e, t, n) {
|
|
||||||
return e == n[1] ? (n.shift(), n.shift(), "support.class") : "string"
|
|
||||||
}, regex: ".*$", next: "start"}
|
|
||||||
]}},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: "^=end\\s.*$", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}, this.normalizeRules()
|
|
||||||
};
|
|
||||||
r.inherits(c, i), t.RubyHighlightRules = c
|
|
||||||
}), ace.define("ace/mode/folding/coffee", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = this.indentationBlock(e, n);
|
|
||||||
if (r)return r;
|
|
||||||
var i = /\S/, o = e.getLine(n), u = o.search(i);
|
|
||||||
if (u == -1 || o[u] != "#")return;
|
|
||||||
var a = o.length, f = e.getLength(), l = n, c = n;
|
|
||||||
while (++n < f) {
|
|
||||||
o = e.getLine(n);
|
|
||||||
var h = o.search(i);
|
|
||||||
if (h == -1)continue;
|
|
||||||
if (o[h] != "#")break;
|
|
||||||
c = n
|
|
||||||
}
|
|
||||||
if (c > l) {
|
|
||||||
var p = e.getLine(c).length;
|
|
||||||
return new s(l, a, c, p)
|
|
||||||
}
|
|
||||||
}, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.search(/\S/), s = e.getLine(n + 1), o = e.getLine(n - 1), u = o.search(/\S/), a = s.search(/\S/);
|
|
||||||
if (i == -1)return e.foldWidgets[n - 1] = u != -1 && u < a ? "start" : "", "";
|
|
||||||
if (u == -1) {
|
|
||||||
if (i == a && r[i] == "#" && s[i] == "#")return e.foldWidgets[n - 1] = "", e.foldWidgets[n + 1] = "", "start"
|
|
||||||
} else if (u == i && r[i] == "#" && o[i] == "#" && e.getLine(n - 2).search(/\S/) == -1)return e.foldWidgets[n - 1] = "start", e.foldWidgets[n + 1] = "", "";
|
|
||||||
return u != -1 && u < i ? e.foldWidgets[n - 1] = "start" : e.foldWidgets[n - 1] = "", i < a ? "start" : ""
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,215 +0,0 @@
|
|||||||
ace.define("ace/mode/haxe", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/haxe_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./haxe_highlight_rules").HaxeHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode, l = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new a, this.foldingRules = new f
|
|
||||||
};
|
|
||||||
r.inherits(l, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var o = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
o && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(l.prototype), t.Mode = l
|
|
||||||
}), ace.define("ace/mode/haxe_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std", t = "null|true|false", n = this.createKeywordMapper({"variable.language": "this", keyword: e, "constant.language": t}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: n, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({<]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}>]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.HaxeHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,316 +0,0 @@
|
|||||||
ace.define("ace/mode/java", ["require", "exports", "module", "ace/lib/oop", "ace/mode/javascript", "ace/tokenizer", "ace/mode/java_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./javascript").Mode, s = e("../tokenizer").Tokenizer, o = e("./java_highlight_rules").JavaHighlightRules, u = function () {
|
|
||||||
i.call(this), this.$tokenizer = new s((new o).getRules())
|
|
||||||
};
|
|
||||||
r.inherits(u, i), function () {
|
|
||||||
this.createWorker = function (e) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}.call(u.prototype), t.Mode = u
|
|
||||||
}), ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./javascript_highlight_rules").JavaScriptHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("../worker/worker_client").WorkerClient, l = e("./behaviour/cstyle").CstyleBehaviour, c = e("./folding/cstyle").FoldMode, h = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new l, this.foldingRules = new c
|
|
||||||
};
|
|
||||||
r.inherits(h, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start" || e == "regex_allowed") {
|
|
||||||
var u = t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
} else if (e == "doc-start") {
|
|
||||||
if (o == "start" || e == "regex_allowed")return"";
|
|
||||||
var u = t.match(/^\s*(\/?)\*/);
|
|
||||||
u && (u[1] && (r += " "), r += "* ")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
var t = new f(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
|
||||||
return t.attachToDocument(e.getDocument()), t.on("jslint", function (t) {
|
|
||||||
e.setAnnotations(t.data)
|
|
||||||
}), t.on("terminate", function () {
|
|
||||||
e.clearAnnotations()
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
}.call(h.prototype), t.Mode = h
|
|
||||||
}), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = this.createKeywordMapper({"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document", keyword: "const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": "const|let|var|function", "constant.language": "null|Infinity|NaN|undefined", "support.function": "alert", "constant.language.boolean": "true|false"}, "identifier"), t = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void", n = "[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b", r = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: /\/\/.*$/},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: /\/\*/, next: "comment"},
|
|
||||||
{token: "string", regex: "'(?=.)", next: "qstring"},
|
|
||||||
{token: "string", regex: '"(?=.)', next: "qqstring"},
|
|
||||||
{token: "constant.numeric", regex: /0[xX][0-9a-fA-F]+\b/},
|
|
||||||
{token: "constant.numeric", regex: /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"], regex: "(" + n + ")(\\.)(prototype)(\\.)(" + n + ")(\\s*)(=)", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(function)(\\s+)(" + n + ")(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["text", "text", "storage.type", "text", "paren.lparen"], regex: "(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: "keyword", regex: "(?:" + t + ")\\b", next: "regex_allowed"},
|
|
||||||
{token: ["punctuation.operator", "support.function"], regex: /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.function.dom"], regex: /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.constant"], regex: /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function.firebug"], regex: /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},
|
|
||||||
{token: e, regex: n},
|
|
||||||
{token: "keyword.operator", regex: /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, next: "regex_allowed"},
|
|
||||||
{token: "punctuation.operator", regex: /\?|\:|\,|\;|\./, next: "regex_allowed"},
|
|
||||||
{token: "paren.lparen", regex: /[\[({]/, next: "regex_allowed"},
|
|
||||||
{token: "paren.rparen", regex: /[\])}]/},
|
|
||||||
{token: "keyword.operator", regex: /\/=?/, next: "regex_allowed"},
|
|
||||||
{token: "comment", regex: /^#!.*$/}
|
|
||||||
], regex_allowed: [i.getStartRule("doc-start"), {token: "comment", regex: "\\/\\*", next: "comment_regex_allowed"}, {token: "comment", regex: "\\/\\/.*$"}, {token: "string.regexp", regex: "\\/", next: "regex"}, {token: "text", regex: "\\s+"}, {token: "empty", regex: "", next: "start"}], regex: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "string.regexp", regex: "/\\w*", next: "start"},
|
|
||||||
{token: "invalid", regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},
|
|
||||||
{token: "constant.language.escape", regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},
|
|
||||||
{token: "constant.language.delimiter", regex: /\|/},
|
|
||||||
{token: "constant.language.escape", regex: /\[\^?/, next: "regex_character_class"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp"}
|
|
||||||
], regex_character_class: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "constant.language.escape", regex: "]", next: "regex"},
|
|
||||||
{token: "constant.language.escape", regex: "-"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp.charachterclass"}
|
|
||||||
], function_arguments: [
|
|
||||||
{token: "variable.parameter", regex: n},
|
|
||||||
{token: "punctuation.operator", regex: "[, ]+"},
|
|
||||||
{token: "punctuation.operator", regex: "$"},
|
|
||||||
{token: "empty", regex: "", next: "start"}
|
|
||||||
], comment_regex_allowed: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "regex_allowed"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qqstring"},
|
|
||||||
{token: "string", regex: '"|$', next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qstring"},
|
|
||||||
{token: "string", regex: "'|$", next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.JavaScriptHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
}), ace.define("ace/mode/java_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = "abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while", t = "null|Infinity|NaN|undefined", n = "AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object", r = this.createKeywordMapper({"variable.language": "this", keyword: e, "constant.language": t, "support.function": n}, "identifier");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: r, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "lparen", regex: "[[({]"},
|
|
||||||
{token: "rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.JavaHighlightRules = o
|
|
||||||
})
|
|
||||||
@ -1,283 +0,0 @@
|
|||||||
ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/range", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./javascript_highlight_rules").JavaScriptHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("../range").Range, f = e("../worker/worker_client").WorkerClient, l = e("./behaviour/cstyle").CstyleBehaviour, c = e("./folding/cstyle").FoldMode, h = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new l, this.foldingRules = new c
|
|
||||||
};
|
|
||||||
r.inherits(h, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\/\//;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "//")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens, o = i.state;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start" || e == "regex_allowed") {
|
|
||||||
var u = t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
|
||||||
u && (r += n)
|
|
||||||
} else if (e == "doc-start") {
|
|
||||||
if (o == "start" || e == "regex_allowed")return"";
|
|
||||||
var u = t.match(/^\s*(\/?)\*/);
|
|
||||||
u && (u[1] && (r += " "), r += "* ")
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
var t = new f(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
|
||||||
return t.attachToDocument(e.getDocument()), t.on("jslint", function (t) {
|
|
||||||
e.setAnnotations(t.data)
|
|
||||||
}), t.on("terminate", function () {
|
|
||||||
e.clearAnnotations()
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
}.call(h.prototype), t.Mode = h
|
|
||||||
}), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./doc_comment_highlight_rules").DocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = this.createKeywordMapper({"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document", keyword: "const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": "const|let|var|function", "constant.language": "null|Infinity|NaN|undefined", "support.function": "alert", "constant.language.boolean": "true|false"}, "identifier"), t = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void", n = "[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b", r = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: /\/\/.*$/},
|
|
||||||
i.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: /\/\*/, next: "comment"},
|
|
||||||
{token: "string", regex: "'(?=.)", next: "qstring"},
|
|
||||||
{token: "string", regex: '"(?=.)', next: "qqstring"},
|
|
||||||
{token: "constant.numeric", regex: /0[xX][0-9a-fA-F]+\b/},
|
|
||||||
{token: "constant.numeric", regex: /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"], regex: "(" + n + ")(\\.)(prototype)(\\.)(" + n + ")(\\s*)(=)", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(" + n + ")(\\.)(" + n + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(function)(\\s+)(" + n + ")(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + n + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: ["text", "text", "storage.type", "text", "paren.lparen"], regex: "(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments"},
|
|
||||||
{token: "keyword", regex: "(?:" + t + ")\\b", next: "regex_allowed"},
|
|
||||||
{token: ["punctuation.operator", "support.function"], regex: /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.function.dom"], regex: /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},
|
|
||||||
{token: ["punctuation.operator", "support.constant"], regex: /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},
|
|
||||||
{token: ["storage.type", "punctuation.operator", "support.function.firebug"], regex: /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},
|
|
||||||
{token: e, regex: n},
|
|
||||||
{token: "keyword.operator", regex: /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, next: "regex_allowed"},
|
|
||||||
{token: "punctuation.operator", regex: /\?|\:|\,|\;|\./, next: "regex_allowed"},
|
|
||||||
{token: "paren.lparen", regex: /[\[({]/, next: "regex_allowed"},
|
|
||||||
{token: "paren.rparen", regex: /[\])}]/},
|
|
||||||
{token: "keyword.operator", regex: /\/=?/, next: "regex_allowed"},
|
|
||||||
{token: "comment", regex: /^#!.*$/}
|
|
||||||
], regex_allowed: [i.getStartRule("doc-start"), {token: "comment", regex: "\\/\\*", next: "comment_regex_allowed"}, {token: "comment", regex: "\\/\\/.*$"}, {token: "string.regexp", regex: "\\/", next: "regex"}, {token: "text", regex: "\\s+"}, {token: "empty", regex: "", next: "start"}], regex: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "string.regexp", regex: "/\\w*", next: "start"},
|
|
||||||
{token: "invalid", regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},
|
|
||||||
{token: "constant.language.escape", regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},
|
|
||||||
{token: "constant.language.delimiter", regex: /\|/},
|
|
||||||
{token: "constant.language.escape", regex: /\[\^?/, next: "regex_character_class"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp"}
|
|
||||||
], regex_character_class: [
|
|
||||||
{token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},
|
|
||||||
{token: "constant.language.escape", regex: "]", next: "regex"},
|
|
||||||
{token: "constant.language.escape", regex: "-"},
|
|
||||||
{token: "empty", regex: "$", next: "start"},
|
|
||||||
{defaultToken: "string.regexp.charachterclass"}
|
|
||||||
], function_arguments: [
|
|
||||||
{token: "variable.parameter", regex: n},
|
|
||||||
{token: "punctuation.operator", regex: "[, ]+"},
|
|
||||||
{token: "punctuation.operator", regex: "$"},
|
|
||||||
{token: "empty", regex: "", next: "start"}
|
|
||||||
], comment_regex_allowed: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "regex_allowed"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: "\\*\\/", next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qqstring"},
|
|
||||||
{token: "string", regex: '"|$', next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
], qstring: [
|
|
||||||
{token: "constant.language.escape", regex: r},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qstring"},
|
|
||||||
{token: "string", regex: "'|$", next: "start"},
|
|
||||||
{defaultToken: "string"}
|
|
||||||
]}, this.embedRules(i, "doc-", [i.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.JavaScriptHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,204 +0,0 @@
|
|||||||
ace.define("ace/mode/json", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/json_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle", "ace/worker/worker_client"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./json_highlight_rules").JsonHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode, l = e("../worker/worker_client").WorkerClient, c = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new a, this.foldingRules = new f
|
|
||||||
};
|
|
||||||
r.inherits(c, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t);
|
|
||||||
if (e == "start") {
|
|
||||||
var i = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
i && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}, this.createWorker = function (e) {
|
|
||||||
var t = new l(["ace"], "ace/mode/json_worker", "JsonWorker");
|
|
||||||
return t.attachToDocument(e.getDocument()), t.on("error", function (t) {
|
|
||||||
e.setAnnotations([t.data])
|
|
||||||
}), t.on("ok", function () {
|
|
||||||
e.clearAnnotations()
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
}.call(c.prototype), t.Mode = c
|
|
||||||
}), ace.define("ace/mode/json_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "variable", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},
|
|
||||||
{token: "string", regex: '"', next: "string"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: "invalid.illegal", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "invalid.illegal", regex: "\\/\\/.*$"},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], string: [
|
|
||||||
{token: "constant.language.escape", regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},
|
|
||||||
{token: "string", regex: '[^"\\\\]+'},
|
|
||||||
{token: "string", regex: '"', next: "start"},
|
|
||||||
{token: "string", regex: "", next: "start"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.JsonHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,220 +0,0 @@
|
|||||||
ace.define("ace/mode/jsx", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/jsx_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
function l() {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.$outdent = new u, this.$behaviour = new a, this.foldingRules = new f
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./jsx_highlight_rules").JsxHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode;
|
|
||||||
r.inherits(l, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e), s = i.tokens;
|
|
||||||
if (s.length && s[s.length - 1].type == "comment")return r;
|
|
||||||
if (e == "start") {
|
|
||||||
var o = t.match(/^.*[\{\(\[]\s*$/);
|
|
||||||
o && (r += n)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(l.prototype), t.Mode = l
|
|
||||||
}), ace.define("ace/mode/jsx_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("../lib/lang"), s = e("./doc_comment_highlight_rules").DocCommentHighlightRules, o = e("./text_highlight_rules").TextHighlightRules, u = function () {
|
|
||||||
var e = i.arrayToMap("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|if|throw|delete|in|try|class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|number|int|string|boolean|variant|log|assert".split("|")), t = i.arrayToMap("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined".split("|")), n = i.arrayToMap("debugger|with|const|export|let|private|public|yield|protected|extern|native|as|operator|__fake__|__readonly__".split("|")), r = "[a-zA-Z_][a-zA-Z0-9_]*\\b";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
s.getStartRule("doc-start"),
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string.regexp", regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
|
|
||||||
{token: "constant.language.boolean", regex: "(?:true|false)\\b"},
|
|
||||||
{token: ["storage.type", "text", "entity.name.function"], regex: "(function)(\\s+)(" + r + ")"},
|
|
||||||
{token: function (r) {
|
|
||||||
return r == "this" ? "variable.language" : r == "function" ? "storage.type" : e.hasOwnProperty(r) || n.hasOwnProperty(r) ? "keyword" : t.hasOwnProperty(r) ? "constant.language" : /^_?[A-Z][a-zA-Z0-9_]*$/.test(r) ? "language.support.class" : "identifier"
|
|
||||||
}, regex: r},
|
|
||||||
{token: "keyword.operator", regex: "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},
|
|
||||||
{token: "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."},
|
|
||||||
{token: "paren.lparen", regex: "[[({<]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}>]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}, this.embedRules(s, "doc-", [s.getEndRule("start")])
|
|
||||||
};
|
|
||||||
r.inherits(u, o), t.JsxHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment.doc.tag", regex: "@[\\w\\d_]+"},
|
|
||||||
{token: "comment.doc.tag", regex: "\\bTODO\\b"},
|
|
||||||
{defaultToken: "comment.doc"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), s.getStartRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e}
|
|
||||||
}, s.getEndRule = function (e) {
|
|
||||||
return{token: "comment.doc", regex: "\\*\\/", next: e}
|
|
||||||
}, t.DocCommentHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
ace.define("ace/mode/latex", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/latex_highlight_rules", "ace/mode/folding/latex", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./latex_highlight_rules").LatexHighlightRules, u = e("./folding/latex").FoldMode, a = e("../range").Range, f = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.foldingRules = new u
|
|
||||||
};
|
|
||||||
r.inherits(f, i), function () {
|
|
||||||
this.toggleCommentLines = function (e, t, n, r) {
|
|
||||||
var i = !0, s = /^(\s*)\%/;
|
|
||||||
for (var o = n; o <= r; o++)if (!s.test(t.getLine(o))) {
|
|
||||||
i = !1;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (i) {
|
|
||||||
var u = new a(0, 0, 0, 0);
|
|
||||||
for (var o = n; o <= r; o++) {
|
|
||||||
var f = t.getLine(o), l = f.match(s);
|
|
||||||
u.start.row = o, u.end.row = o, u.end.column = l[0].length, t.replace(u, l[1])
|
|
||||||
}
|
|
||||||
} else t.indentRows(n, r, "%")
|
|
||||||
}, this.getNextLineIndent = function (e, t, n) {
|
|
||||||
return this.$getIndent(t)
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/latex_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "keyword", regex: "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},
|
|
||||||
{token: "lparen", regex: "[[({]"},
|
|
||||||
{token: "rparen", regex: "[\\])}]"},
|
|
||||||
{token: "string", regex: "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"},
|
|
||||||
{token: "comment", regex: "%.*$"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.LatexHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/latex", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range", "ace/token_iterator"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = e("../../token_iterator").TokenIterator, u = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(u, i), function () {
|
|
||||||
this.foldingStartMarker = /^\s*\\(begin)|(section|subsection)\b|{\s*$/, this.foldingStopMarker = /^\s*\\(end)\b|^\s*}/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.doc.getLine(n), i = this.foldingStartMarker.exec(r);
|
|
||||||
if (i)return i[1] ? this.latexBlock(e, n, i[0].length - 1) : i[2] ? this.latexSection(e, n, i[0].length - 1) : this.openingBracketBlock(e, "{", n, i.index);
|
|
||||||
var i = this.foldingStopMarker.exec(r);
|
|
||||||
if (i)return i[1] ? this.latexBlock(e, n, i[0].length - 1) : this.closingBracketBlock(e, "}", n, i.index + i[0].length)
|
|
||||||
}, this.latexBlock = function (e, t, n) {
|
|
||||||
var r = {"\\begin": 1, "\\end": -1}, i = new o(e, t, n), u = i.getCurrentToken();
|
|
||||||
if (!u || u.type !== "keyword")return;
|
|
||||||
var a = u.value, f = r[a], l = function () {
|
|
||||||
var e = i.stepForward(), t = e.type == "lparen" ? i.stepForward().value : "";
|
|
||||||
return f === -1 && (i.stepBackward(), t && i.stepBackward()), t
|
|
||||||
}, c = [l()], h = f === -1 ? i.getCurrentTokenColumn() : e.getLine(t).length, p = t;
|
|
||||||
i.step = f === -1 ? i.stepBackward : i.stepForward;
|
|
||||||
while (u = i.step()) {
|
|
||||||
if (u.type !== "keyword")continue;
|
|
||||||
var d = r[u.value];
|
|
||||||
if (!d)continue;
|
|
||||||
var v = l();
|
|
||||||
if (d === f)c.unshift(v); else if (c.shift() !== v || !c.length)break
|
|
||||||
}
|
|
||||||
if (c.length)return;
|
|
||||||
var t = i.getCurrentTokenRow();
|
|
||||||
return f === -1 ? new s(t, e.getLine(t).length, p, h) : new s(p, h, t, i.getCurrentTokenColumn())
|
|
||||||
}, this.latexSection = function (e, t, n) {
|
|
||||||
var r = ["\\subsection", "\\section", "\\begin", "\\end"], i = new o(e, t, n), u = i.getCurrentToken();
|
|
||||||
if (!u || u.type != "keyword")return;
|
|
||||||
var a = r.indexOf(u.value), f = 0, l = t;
|
|
||||||
while (u = i.stepForward()) {
|
|
||||||
if (u.type !== "keyword")continue;
|
|
||||||
var c = r.indexOf(u.value);
|
|
||||||
if (c >= 2) {
|
|
||||||
f || (l = i.getCurrentTokenRow() - 1), f += c == 2 ? 1 : -1;
|
|
||||||
if (f < 0)break
|
|
||||||
} else if (c >= a)break
|
|
||||||
}
|
|
||||||
f || (l = i.getCurrentTokenRow() - 1);
|
|
||||||
while (l > t && !/\S/.test(e.getLine(l)))l--;
|
|
||||||
return new s(t, e.getLine(t).length, l, e.getLine(l).length)
|
|
||||||
}
|
|
||||||
}.call(u.prototype)
|
|
||||||
})
|
|
||||||
@ -1,236 +0,0 @@
|
|||||||
ace.define("ace/mode/less", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/less_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./less_highlight_rules").LessHighlightRules, u = e("./matching_brace_outdent").MatchingBraceOutdent, a = e("./behaviour/css").CssBehaviour, f = e("./folding/cstyle").FoldMode, l = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules(), "i"), this.$outdent = new u, this.$behaviour = new a, this.foldingRules = new f
|
|
||||||
};
|
|
||||||
r.inherits(l, i), function () {
|
|
||||||
this.getNextLineIndent = function (e, t, n) {
|
|
||||||
var r = this.$getIndent(t), i = this.$tokenizer.getLineTokens(t, e).tokens;
|
|
||||||
if (i.length && i[i.length - 1].type == "comment")return r;
|
|
||||||
var s = t.match(/^.*\{\s*$/);
|
|
||||||
return s && (r += n), r
|
|
||||||
}, this.checkOutdent = function (e, t, n) {
|
|
||||||
return this.$outdent.checkOutdent(t, n)
|
|
||||||
}, this.autoOutdent = function (e, t, n) {
|
|
||||||
this.$outdent.autoOutdent(t, n)
|
|
||||||
}
|
|
||||||
}.call(l.prototype), t.Mode = l
|
|
||||||
}), ace.define("ace/mode/less_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("../lib/lang"), s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
var e = i.arrayToMap(function () {
|
|
||||||
var e = "-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-".split("|"), t = "appearance|background-clip|background-inline-policy|background-origin|background-size|binding|border-bottom-colors|border-left-colors|border-right-colors|border-top-colors|border-end|border-end-color|border-end-style|border-end-width|border-image|border-start|border-start-color|border-start-style|border-start-width|box-align|box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|box-pack|box-sizing|column-count|column-gap|column-width|column-rule|column-rule-width|column-rule-style|column-rule-color|float-edge|font-feature-settings|font-language-override|force-broken-image-icon|image-region|margin-end|margin-start|opacity|outline|outline-color|outline-offset|outline-radius|outline-radius-bottomleft|outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|outline-style|outline-width|padding-end|padding-start|stack-sizing|tab-size|text-blink|text-decoration-color|text-decoration-line|text-decoration-style|transform|transform-origin|transition|transition-delay|transition-duration|transition-property|transition-timing-function|user-focus|user-input|user-modify|user-select|window-shadow|border-radius".split("|"), n = "azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|"), r = [];
|
|
||||||
for (var i = 0, s = e.length; i < s; i++)Array.prototype.push.apply(r, (e[i] + t.join("|" + e[i])).split("|"));
|
|
||||||
return Array.prototype.push.apply(r, t), Array.prototype.push.apply(r, n), r
|
|
||||||
}()), t = i.arrayToMap("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem".split("|")), n = i.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")), r = i.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")), s = i.arrayToMap("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare|when|not|and".split("|")), o = i.arrayToMap("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp".split("|")), u = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: "\\/\\/.*$"},
|
|
||||||
{token: "comment", regex: "\\/\\*", next: "comment"},
|
|
||||||
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
|
|
||||||
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
|
|
||||||
{token: "constant.numeric", regex: u + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"},
|
|
||||||
{token: "constant.numeric", regex: "#[a-f0-9]{6}"},
|
|
||||||
{token: "constant.numeric", regex: "#[a-f0-9]{3}"},
|
|
||||||
{token: "constant.numeric", regex: u},
|
|
||||||
{token: function (e) {
|
|
||||||
return s.hasOwnProperty(e) ? "keyword" : "variable"
|
|
||||||
}, regex: "@[a-z0-9_\\-@]*\\b"},
|
|
||||||
{token: function (i) {
|
|
||||||
return e.hasOwnProperty(i.toLowerCase()) ? "support.type" : s.hasOwnProperty(i) ? "keyword" : n.hasOwnProperty(i) ? "constant.language" : t.hasOwnProperty(i) ? "support.function" : r.hasOwnProperty(i.toLowerCase()) ? "support.constant.color" : o.hasOwnProperty(i.toLowerCase()) ? "variable.language" : "text"
|
|
||||||
}, regex: "\\-?[@a-z_][@a-z0-9_\\-]*"},
|
|
||||||
{token: "variable.language", regex: "#[a-z0-9-_]+"},
|
|
||||||
{token: "variable.language", regex: "\\.[a-z0-9-_]+"},
|
|
||||||
{token: "variable.language", regex: ":[a-z0-9-_]+"},
|
|
||||||
{token: "constant", regex: "[a-z0-9-_]+"},
|
|
||||||
{token: "keyword.operator", regex: "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"},
|
|
||||||
{token: "paren.lparen", regex: "[[({]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\])}]"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], comment: [
|
|
||||||
{token: "comment", regex: ".*?\\*\\/", next: "start"},
|
|
||||||
{token: "comment", regex: ".+"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.LessHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../range").Range, i = function () {
|
|
||||||
};
|
|
||||||
(function () {
|
|
||||||
this.checkOutdent = function (e, t) {
|
|
||||||
return/^\s+$/.test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
}), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("./cstyle").CstyleBehaviour, o = e("../../token_iterator").TokenIterator, u = function () {
|
|
||||||
this.inherit(s), this.add("colon", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i === ":") {
|
|
||||||
var s = n.getCursorPosition(), u = new o(r, s.row, s.column), a = u.getCurrentToken();
|
|
||||||
a && a.value.match(/\s+/) && (a = u.stepBackward());
|
|
||||||
if (a && a.type === "support.type") {
|
|
||||||
var f = r.doc.getLine(s.row), l = f.substring(s.column, s.column + 1);
|
|
||||||
if (l === ":")return{text: "", selection: [1, 1]};
|
|
||||||
if (!f.substring(s.column).match(/^\s*;/))return{text: ":;", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("colon", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s === ":") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u === ";")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("semicolon", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i === ";") {
|
|
||||||
var s = n.getCursorPosition(), o = r.doc.getLine(s.row), u = o.substring(s.column, s.column + 1);
|
|
||||||
if (u === ";")return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(u, s), t.CssBehaviour = u
|
|
||||||
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../behaviour").Behaviour, s = e("../../token_iterator").TokenIterator, o = e("../../lib/lang"), u = ["text", "paren.rparen", "punctuation.operator"], a = ["text", "paren.rparen", "punctuation.operator", "comment"], f = 0, l = -1, c = "", h = 0, p = -1, d = "", v = "", m = function () {
|
|
||||||
m.isSaneInsertion = function (e, t) {
|
|
||||||
var n = e.getCursorPosition(), r = new s(t, n.row, n.column);
|
|
||||||
if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
|
|
||||||
var i = new s(t, n.row, n.column + 1);
|
|
||||||
if (!this.$matchTokenType(i.getCurrentToken() || "text", u))return!1
|
|
||||||
}
|
|
||||||
return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a)
|
|
||||||
}, m.$matchTokenType = function (e, t) {
|
|
||||||
return t.indexOf(e.type || e) > -1
|
|
||||||
}, m.recordAutoInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isAutoInsertedClosing(r, i, c[0]) || (f = 0), l = r.row, c = n + i.substr(r.column), f++
|
|
||||||
}, m.recordMaybeInsert = function (e, t, n) {
|
|
||||||
var r = e.getCursorPosition(), i = t.doc.getLine(r.row);
|
|
||||||
this.isMaybeInsertedClosing(r, i) || (h = 0), p = r.row, d = i.substr(0, r.column) + n, v = i.substr(r.column), h++
|
|
||||||
}, m.isAutoInsertedClosing = function (e, t, n) {
|
|
||||||
return f > 0 && e.row === l && n === c[0] && t.substr(e.column) === c
|
|
||||||
}, m.isMaybeInsertedClosing = function (e, t) {
|
|
||||||
return h > 0 && e.row === p && t.substr(e.column) === v && t.substr(0, e.column) == d
|
|
||||||
}, m.popAutoInsertedClosing = function () {
|
|
||||||
c = c.substr(1), f--
|
|
||||||
}, m.clearMaybeInsertedClosing = function () {
|
|
||||||
h = 0, p = -1
|
|
||||||
}, this.add("braces", "insertion", function (e, t, n, r, i) {
|
|
||||||
var s = n.getCursorPosition(), u = r.doc.getLine(s.row);
|
|
||||||
if (i == "{") {
|
|
||||||
var a = n.getSelectionRange(), f = r.doc.getTextRange(a);
|
|
||||||
if (f !== "" && f !== "{" && n.getWrapBehavioursEnabled())return{text: "{" + f + "}", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return/[\]\}\)]/.test(u[s.column]) ? (m.recordAutoInsert(n, r, "}"), {text: "{}", selection: [1, 1]}) : (m.recordMaybeInsert(n, r, "{"), {text: "{", selection: [1, 1]})
|
|
||||||
} else if (i == "}") {
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}") {
|
|
||||||
var c = r.$findOpeningBracket("}", {column: s.column + 1, row: s.row});
|
|
||||||
if (c !== null && m.isAutoInsertedClosing(s, u, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
} else if (i == "\n" || i == "\r\n") {
|
|
||||||
var p = "";
|
|
||||||
m.isMaybeInsertedClosing(s, u) && (p = o.stringRepeat("}", h), m.clearMaybeInsertedClosing());
|
|
||||||
var l = u.substring(s.column, s.column + 1);
|
|
||||||
if (l == "}" || p !== "") {
|
|
||||||
var d = r.findMatchingBracket({row: s.row, column: s.column}, "}");
|
|
||||||
if (!d)return null;
|
|
||||||
var v = this.getNextLineIndent(e, u.substring(0, s.column), r.getTabString()), g = this.$getIndent(u);
|
|
||||||
return{text: "\n" + v + "\n" + g + p, selection: [1, v.length, 1, v.length]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("braces", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "{") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.end.column, i.end.column + 1);
|
|
||||||
if (u == "}")return i.end.column++, i;
|
|
||||||
h--
|
|
||||||
}
|
|
||||||
}), this.add("parens", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "(") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "(" + o + ")", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, ")"), {text: "()", selection: [1, 1]}
|
|
||||||
} else if (i == ")") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == ")") {
|
|
||||||
var l = r.$findOpeningBracket(")", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("parens", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "(") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == ")")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == "[") {
|
|
||||||
var s = n.getSelectionRange(), o = r.doc.getTextRange(s);
|
|
||||||
if (o !== "" && n.getWrapBehavioursEnabled())return{text: "[" + o + "]", selection: !1};
|
|
||||||
if (m.isSaneInsertion(n, r))return m.recordAutoInsert(n, r, "]"), {text: "[]", selection: [1, 1]}
|
|
||||||
} else if (i == "]") {
|
|
||||||
var u = n.getCursorPosition(), a = r.doc.getLine(u.row), f = a.substring(u.column, u.column + 1);
|
|
||||||
if (f == "]") {
|
|
||||||
var l = r.$findOpeningBracket("]", {column: u.column + 1, row: u.row});
|
|
||||||
if (l !== null && m.isAutoInsertedClosing(u, a, i))return m.popAutoInsertedClosing(), {text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("brackets", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && s == "[") {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == "]")return i.end.column++, i
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
|
|
||||||
if (i == '"' || i == "'") {
|
|
||||||
var s = i, o = n.getSelectionRange(), u = r.doc.getTextRange(o);
|
|
||||||
if (u !== "" && u !== "'" && u != '"' && n.getWrapBehavioursEnabled())return{text: s + u + s, selection: !1};
|
|
||||||
var a = n.getCursorPosition(), f = r.doc.getLine(a.row), l = f.substring(a.column - 1, a.column);
|
|
||||||
if (l == "\\")return null;
|
|
||||||
var c = r.getTokens(o.start.row), h = 0, p, d = -1;
|
|
||||||
for (var v = 0; v < c.length; v++) {
|
|
||||||
p = c[v], p.type == "string" ? d = -1 : d < 0 && (d = p.value.indexOf(s));
|
|
||||||
if (p.value.length + h > o.start.column)break;
|
|
||||||
h += c[v].value.length
|
|
||||||
}
|
|
||||||
if (!p || d < 0 && p.type !== "comment" && (p.type !== "string" || o.start.column !== p.value.length + h - 1 && p.value.lastIndexOf(s) === p.value.length - 1)) {
|
|
||||||
if (!m.isSaneInsertion(n, r))return;
|
|
||||||
return{text: s + s, selection: [1, 1]}
|
|
||||||
}
|
|
||||||
if (p && p.type === "string") {
|
|
||||||
var g = f.substring(a.column, a.column + 1);
|
|
||||||
if (g == s)return{text: "", selection: [1, 1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
|
|
||||||
var s = r.doc.getTextRange(i);
|
|
||||||
if (!i.isMultiLine() && (s == '"' || s == "'")) {
|
|
||||||
var o = r.doc.getLine(i.start.row), u = o.substring(i.start.column + 1, i.start.column + 2);
|
|
||||||
if (u == s)return i.end.column++, i
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
r.inherits(m, i), t.CstyleBehaviour = m
|
|
||||||
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, s), function () {
|
|
||||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.match(this.foldingStartMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index;
|
|
||||||
return i[1] ? this.openingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s + i[0].length, 1)
|
|
||||||
}
|
|
||||||
if (t !== "markbeginend")return;
|
|
||||||
var i = r.match(this.foldingStopMarker);
|
|
||||||
if (i) {
|
|
||||||
var s = i.index + i[0].length;
|
|
||||||
return i[1] ? this.closingBracketBlock(e, i[1], n, s) : e.getCommentFoldRange(n, s, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,28 +0,0 @@
|
|||||||
ace.define("ace/mode/lisp", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/lisp_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./lisp_highlight_rules").LispHighlightRules, u = function () {
|
|
||||||
var e = new o;
|
|
||||||
this.$tokenizer = new s(e.getRules())
|
|
||||||
};
|
|
||||||
r.inherits(u, i), function () {
|
|
||||||
}.call(u.prototype), t.Mode = u
|
|
||||||
}), ace.define("ace/mode/lisp_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
var e = "case|do|let|loop|if|else|when", t = "eq|neq|and|or", n = "null|nil", r = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn", i = this.createKeywordMapper({"keyword.control": e, "keyword.operator": t, "constant.language": n, "support.function": r}, "identifier", !0);
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "comment", regex: ";.*$"},
|
|
||||||
{token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},
|
|
||||||
{token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)"},
|
|
||||||
{token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], regex: "(\\*)(\\S*)(\\*)"},
|
|
||||||
{token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},
|
|
||||||
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},
|
|
||||||
{token: i, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "string", regex: '"(?=.)', next: "qqstring"}
|
|
||||||
], qqstring: [
|
|
||||||
{token: "constant.character.escape.lisp", regex: "\\\\."},
|
|
||||||
{token: "string", regex: '[^"\\\\]+'},
|
|
||||||
{token: "string", regex: "\\\\$", next: "qqstring"},
|
|
||||||
{token: "string", regex: '"|$', next: "start"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.LispHighlightRules = s
|
|
||||||
})
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
ace.define("ace/mode/ls", function (e, t, n) {
|
|
||||||
function u(e, t) {
|
|
||||||
function n() {
|
|
||||||
}
|
|
||||||
|
|
||||||
return n.prototype = (e.superclass = t).prototype, (e.prototype = new n).constructor = e, typeof t.extended == "function" && t.extended(e), e
|
|
||||||
}
|
|
||||||
|
|
||||||
function a(e, t) {
|
|
||||||
var n = {}.hasOwnProperty;
|
|
||||||
for (var r in t)n.call(t, r) && (e[r] = t[r]);
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
var r, i, s, o;
|
|
||||||
r = "(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*", t.Mode = i = function (t) {
|
|
||||||
function o() {
|
|
||||||
var t;
|
|
||||||
this.$tokenizer = new (e("ace/tokenizer").Tokenizer)(o.Rules);
|
|
||||||
if (t = e("ace/mode/matching_brace_outdent"))this.$outdent = new t.MatchingBraceOutdent
|
|
||||||
}
|
|
||||||
|
|
||||||
var n, i = u((a(o, t).displayName = "LiveScriptMode", o), t).prototype, s = o;
|
|
||||||
return n = RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*" + r + ")?))\\s*$"), i.getNextLineIndent = function (e, t, r) {
|
|
||||||
var i, s;
|
|
||||||
return i = this.$getIndent(t), s = this.$tokenizer.getLineTokens(t, e).tokens, (!s.length || s[s.length - 1].type !== "comment") && e === "start" && n.test(t) && (i += r), i
|
|
||||||
}, i.toggleCommentLines = function (t, n, r, i) {
|
|
||||||
var s, o, u, a, f, l;
|
|
||||||
s = /^(\s*)#/, o = new (e("ace/range").Range)(0, 0, 0, 0);
|
|
||||||
for (u = r; u <= i; ++u)a = u, (f = s.test(l = n.getLine(a))) ? l = l.replace(s, "$1") : l = l.replace(/^\s*/, "$&#"), o.end.row = o.start.row = a, o.end.column = l.length + 1, n.replace(o, l);
|
|
||||||
return 1 - f * 2
|
|
||||||
}, i.checkOutdent = function (e, t, n) {
|
|
||||||
var r;
|
|
||||||
return(r = this.$outdent) != null ? r.checkOutdent(t, n) : void 8
|
|
||||||
}, i.autoOutdent = function (e, t, n) {
|
|
||||||
var r;
|
|
||||||
return(r = this.$outdent) != null ? r.autoOutdent(t, n) : void 8
|
|
||||||
}, o
|
|
||||||
}(e("ace/mode/text").Mode), s = "(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))", o = {token: "string", regex: ".+"}, i.Rules = {start: [
|
|
||||||
{token: "keyword", regex: "(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)" + s},
|
|
||||||
{token: "constant.language", regex: "(?:true|false|yes|no|on|off|null|void|undefined)" + s},
|
|
||||||
{token: "invalid.illegal", regex: "(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)" + s},
|
|
||||||
{token: "language.support.class", regex: "(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)" + s},
|
|
||||||
{token: "language.support.function", regex: "(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)" + s},
|
|
||||||
{token: "variable.language", regex: "(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)" + s},
|
|
||||||
{token: "identifier", regex: r + "\\s*:(?![:=])"},
|
|
||||||
{token: "variable", regex: r},
|
|
||||||
{token: "keyword.operator", regex: "(?:\\.{3}|\\s+\\?)"},
|
|
||||||
{token: "keyword.variable", regex: "(?:@+|::|\\.\\.)", next: "key"},
|
|
||||||
{token: "keyword.operator", regex: "\\.\\s*", next: "key"},
|
|
||||||
{token: "string", regex: "\\\\\\S[^\\s,;)}\\]]*"},
|
|
||||||
{token: "string.doc", regex: "'''", next: "qdoc"},
|
|
||||||
{token: "string.doc", regex: '"""', next: "qqdoc"},
|
|
||||||
{token: "string", regex: "'", next: "qstring"},
|
|
||||||
{token: "string", regex: '"', next: "qqstring"},
|
|
||||||
{token: "string", regex: "`", next: "js"},
|
|
||||||
{token: "string", regex: "<\\[", next: "words"},
|
|
||||||
{token: "string.regex", regex: "//", next: "heregex"},
|
|
||||||
{token: "comment.doc", regex: "/\\*", next: "comment"},
|
|
||||||
{token: "comment", regex: "#.*"},
|
|
||||||
{token: "string.regex", regex: "\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}", next: "key"},
|
|
||||||
{token: "constant.numeric", regex: "(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},
|
|
||||||
{token: "lparen", regex: "[({[]"},
|
|
||||||
{token: "rparen", regex: "[)}\\]]", next: "key"},
|
|
||||||
{token: "keyword.operator", regex: "\\S+"},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
], heregex: [
|
|
||||||
{token: "string.regex", regex: ".*?//[gimy$?]{0,4}", next: "start"},
|
|
||||||
{token: "string.regex", regex: "\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:r,next:"start"},{token:"text",regex:".",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[ ^\\\\']*(?:\\\\.[^\\\\'
|
|
||||||
]*)*
|
|
||||||
'",next:"key"},o],qqstring:[{token:"string",regex:'[ ^\\\\"]*(?:\\\\.[^\\\\"
|
|
||||||
]*)*
|
|
||||||
"',next:"
|
|
||||||
key
|
|
||||||
"},o],js:[{token:"
|
|
||||||
string
|
|
||||||
",regex:"[ ^\\\\`]*
|
|
||||||
(? :\\\\.
|
|
||||||
[ ^\\\\`]*)*`",next:"
|
|
||||||
key
|
|
||||||
"},o],words:[{token:"
|
|
||||||
string
|
|
||||||
",regex:".* ?\\]>
|
|
||||||
",next:"
|
|
||||||
key
|
|
||||||
"},o]}}),ace.define("
|
|
||||||
ace / mode / matching_brace_outdent
|
|
||||||
",["
|
|
||||||
require
|
|
||||||
","
|
|
||||||
exports
|
|
||||||
","
|
|
||||||
module
|
|
||||||
","
|
|
||||||
ace / range
|
|
||||||
"],function(e,t,n){var r=e("..
|
|
||||||
/range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/ ^\s + $ /
|
|
||||||
.
|
|
||||||
test(e) ? /^\s*\}/.test(t) : !1
|
|
||||||
}, this.autoOutdent = function (e, t) {
|
|
||||||
var n = e.getLine(t), i = n.match(/^(\s*\})/);
|
|
||||||
if (!i)return 0;
|
|
||||||
var s = i[1].length, o = e.findMatchingBracket({row: t, column: s});
|
|
||||||
if (!o || o.row == t)return 0;
|
|
||||||
var u = this.$getIndent(e.getLine(o.row));
|
|
||||||
e.replace(new r(t, 0, t, s - 1), u)
|
|
||||||
}, this.$getIndent = function (e) {
|
|
||||||
var t = e.match(/^(\s+)/);
|
|
||||||
return t ? t[1] : ""
|
|
||||||
}
|
|
||||||
}).
|
|
||||||
call(i.prototype), t.MatchingBraceOutdent = i
|
|
||||||
})
|
|
||||||
@ -1,114 +0,0 @@
|
|||||||
ace.define("ace/mode/lua", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/lua_highlight_rules", "ace/mode/folding/lua", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./lua_highlight_rules").LuaHighlightRules, u = e("./folding/lua").FoldMode, a = e("../range").Range, f = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules()), this.foldingRules = new u
|
|
||||||
};
|
|
||||||
r.inherits(f, i), function () {
|
|
||||||
function n(t) {
|
|
||||||
var n = 0;
|
|
||||||
for (var r = 0; r < t.length; r++) {
|
|
||||||
var i = t[r];
|
|
||||||
i.type == "keyword" ? i.value in e && (n += e[i.value]) : i.type == "paren.lparen" ? n++ : i.type == "paren.rparen" && n--
|
|
||||||
}
|
|
||||||
return n < 0 ? -1 : n > 0 ? 1 : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var e = {"function": 1, then: 1, "do": 1, "else": 1, elseif: 1, repeat: 1, end: -1, until: -1}, t = ["else", "elseif", "end", "until"];
|
|
||||||
this.getNextLineIndent = function (e, t, r) {
|
|
||||||
var i = this.$getIndent(t), s = 0, o = this.$tokenizer.getLineTokens(t, e), u = o.tokens;
|
|
||||||
return e == "start" && (s = n(u)), s > 0 ? i + r : s < 0 && i.substr(i.length - r.length) == r && !this.checkOutdent(e, t, "\n") ? i.substr(0, i.length - r.length) : i
|
|
||||||
}, this.checkOutdent = function (e, n, r) {
|
|
||||||
if (r != "\n" && r != "\r" && r != "\r\n")return!1;
|
|
||||||
if (n.match(/^\s*[\)\}\]]$/))return!0;
|
|
||||||
var i = this.$tokenizer.getLineTokens(n.trim(), e).tokens;
|
|
||||||
return!i || !i.length ? !1 : i[0].type == "keyword" && t.indexOf(i[0].value) != -1
|
|
||||||
}, this.autoOutdent = function (e, t, r) {
|
|
||||||
var i = t.getLine(r - 1), s = this.$getIndent(i).length, o = this.$tokenizer.getLineTokens(i, "start").tokens, u = t.getTabString().length, f = s + u * n(o), l = this.$getIndent(t.getLine(r)).length;
|
|
||||||
if (l < f)return;
|
|
||||||
t.outdentRows(new a(r, 0, r + 2, 0))
|
|
||||||
}
|
|
||||||
}.call(f.prototype), t.Mode = f
|
|
||||||
}), ace.define("ace/mode/lua_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = function () {
|
|
||||||
var e = "break|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while|or|and|not", t = "true|false|nil|_G|_VERSION", n = "string|xpcall|package|tostring|print|os|unpack|require|getfenv|setmetatable|next|assert|tonumber|io|rawequal|collectgarbage|getmetatable|module|rawset|math|debug|pcall|table|newproxy|type|coroutine|_G|select|gcinfo|pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|load|error|loadfile|sub|upper|len|gfind|rep|find|match|char|dump|gmatch|reverse|byte|format|gsub|lower|preload|loadlib|loaded|loaders|cpath|config|path|seeall|exit|setlocale|date|getenv|difftime|remove|time|clock|tmpname|rename|execute|lines|write|close|flush|open|output|type|read|stderr|stdin|input|stdout|popen|tmpfile|log|max|acos|huge|ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|gethook|setmetatable|setlocal|traceback|setfenv|getinfo|setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|foreachi|maxn|foreach|concat|sort|remove|resume|yield|status|wrap|create|running|__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber", r = "string|package|os|io|math|debug|table|coroutine", i = "", s = "setn|foreach|foreachi|gcinfo|log10|maxn", o = this.createKeywordMapper({keyword: e, "support.function": n, "invalid.deprecated": s, "constant.library": r, "constant.language": t, "invalid.illegal": i, "variable.language": "this"}, "identifier"), u = "(?:(?:[1-9]\\d*)|(?:0))", a = "(?:0[xX][\\dA-Fa-f]+)", f = "(?:" + u + "|" + a + ")", l = "(?:\\.\\d+)", c = "(?:\\d+)", h = "(?:(?:" + c + "?" + l + ")|(?:" + c + "\\.))", p = "(?:" + h + ")";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{stateName: "bracketedComment", token: function (e, t, n) {
|
|
||||||
return n.unshift(this.next, e.length, t), "comment"
|
|
||||||
}, regex: /\-\-\[=*\[/, next: [
|
|
||||||
{token: function (e, t, n) {
|
|
||||||
return e.length == n[1] ? (n.shift(), n.shift(), this.next = n.shift()) : this.next = "", "comment"
|
|
||||||
}, regex: /(?:[^\\]|\\.)*?\]=*\]/, next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
]},
|
|
||||||
{token: "comment", regex: "\\-\\-.*$"},
|
|
||||||
{stateName: "bracketedString", token: function (e, t, n) {
|
|
||||||
return n.unshift(this.next, e.length, t), "comment"
|
|
||||||
}, regex: /\[=*\[/, next: [
|
|
||||||
{token: function (e, t, n) {
|
|
||||||
return e.length == n[1] ? (n.shift(), n.shift(), this.next = n.shift()) : this.next = "", "comment"
|
|
||||||
}, regex: /(?:[^\\]|\\.)*?\]=*\]/, next: "start"},
|
|
||||||
{defaultToken: "comment"}
|
|
||||||
]},
|
|
||||||
{token: "string", regex: '"(?:[^\\\\]|\\\\.)*?"'},
|
|
||||||
{token: "string", regex: "'(?:[^\\\\]|\\\\.)*?'"},
|
|
||||||
{token: "constant.numeric", regex: p},
|
|
||||||
{token: "constant.numeric", regex: f + "\\b"},
|
|
||||||
{token: o, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."},
|
|
||||||
{token: "paren.lparen", regex: "[\\[\\(\\{]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\]\\)\\}]"},
|
|
||||||
{token: "text", regex: "\\s+|\\w+"}
|
|
||||||
]}, this.normalizeRules()
|
|
||||||
};
|
|
||||||
r.inherits(s, i), t.LuaHighlightRules = s
|
|
||||||
}), ace.define("ace/mode/folding/lua", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range", "ace/token_iterator"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = e("../../token_iterator").TokenIterator, u = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(u, i), function () {
|
|
||||||
this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/, this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = this.foldingStartMarker.test(r), s = this.foldingStopMarker.test(r);
|
|
||||||
if (i && !s) {
|
|
||||||
var o = r.match(this.foldingStartMarker);
|
|
||||||
if (o[1] == "then" && /\belseif\b/.test(r))return;
|
|
||||||
if (o[1]) {
|
|
||||||
if (e.getTokenAt(n, o.index + 1).type === "keyword")return"start"
|
|
||||||
} else {
|
|
||||||
if (!o[2])return"start";
|
|
||||||
var u = e.bgTokenizer.getState(n) || "";
|
|
||||||
if (u.indexOf("comment") != -1 || u.indexOf("string") != -1)return"start"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (t != "markbeginend" || !s || i && s)return"";
|
|
||||||
var o = r.match(this.foldingStopMarker);
|
|
||||||
if (o[0] === "end") {
|
|
||||||
if (e.getTokenAt(n, o.index + 1).type === "keyword")return"end"
|
|
||||||
} else {
|
|
||||||
if (o[0][0] !== "]")return"end";
|
|
||||||
var u = e.bgTokenizer.getState(n - 1) || "";
|
|
||||||
if (u.indexOf("comment") != -1 || u.indexOf("string") != -1)return"end"
|
|
||||||
}
|
|
||||||
}, this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = e.doc.getLine(n), i = this.foldingStartMarker.exec(r);
|
|
||||||
if (i)return i[1] ? this.luaBlock(e, n, i.index + 1) : i[2] ? e.getCommentFoldRange(n, i.index + 1) : this.openingBracketBlock(e, "{", n, i.index);
|
|
||||||
var i = this.foldingStopMarker.exec(r);
|
|
||||||
if (i)return i[0] === "end" && e.getTokenAt(n, i.index + 1).type === "keyword" ? this.luaBlock(e, n, i.index + 1) : i[0][0] === "]" ? e.getCommentFoldRange(n, i.index + 1) : this.closingBracketBlock(e, "}", n, i.index + i[0].length)
|
|
||||||
}, this.luaBlock = function (e, t, n) {
|
|
||||||
var r = new o(e, t, n), i = {"function": 1, "do": 1, then: 1, elseif: -1, end: -1, repeat: 1, until: -1}, u = r.getCurrentToken();
|
|
||||||
if (!u || u.type != "keyword")return;
|
|
||||||
var a = u.value, f = [a], l = i[a];
|
|
||||||
if (!l)return;
|
|
||||||
var c = l === -1 ? r.getCurrentTokenColumn() : e.getLine(t).length, h = t;
|
|
||||||
r.step = l === -1 ? r.stepBackward : r.stepForward;
|
|
||||||
while (u = r.step()) {
|
|
||||||
if (u.type !== "keyword")continue;
|
|
||||||
var p = l * i[u.value];
|
|
||||||
if (p > 0)f.unshift(u.value); else if (p <= 0) {
|
|
||||||
f.shift();
|
|
||||||
if (!f.length && u.value != "elseif")break;
|
|
||||||
p === 0 && f.unshift(u.value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var t = r.getCurrentTokenRow();
|
|
||||||
return l === -1 ? new s(t, e.getLine(t).length, h, c) : new s(h, c, t, r.getCurrentTokenColumn())
|
|
||||||
}
|
|
||||||
}.call(u.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,22 +0,0 @@
|
|||||||
ace.define("ace/mode/lucene", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/lucene_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./lucene_highlight_rules").LuceneHighlightRules, u = function () {
|
|
||||||
this.$tokenizer = new s((new o).getRules())
|
|
||||||
};
|
|
||||||
r.inherits(u, i), t.Mode = u
|
|
||||||
}), ace.define("ace/mode/lucene_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("../lib/lang"), s = e("./text_highlight_rules").TextHighlightRules, o = function () {
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "constant.character.negation", regex: "[\\-]"},
|
|
||||||
{token: "constant.character.interro", regex: "[\\?]"},
|
|
||||||
{token: "constant.character.asterisk", regex: "[\\*]"},
|
|
||||||
{token: "constant.character.proximity", regex: "~[0-9]+\\b"},
|
|
||||||
{token: "keyword.operator", regex: "(?:AND|OR|NOT)\\b"},
|
|
||||||
{token: "paren.lparen", regex: "[\\(]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\)]"},
|
|
||||||
{token: "keyword", regex: "[\\S]+:"},
|
|
||||||
{token: "string", regex: '".*?"'},
|
|
||||||
{token: "text", regex: "\\s+"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(o, s), t.LuceneHighlightRules = o
|
|
||||||
})
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
ace.define("ace/mode/makefile", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/makefile_highlight_rules", "ace/mode/folding/coffee"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text").Mode, s = e("../tokenizer").Tokenizer, o = e("./makefile_highlight_rules").MakefileHighlightRules, u = e("./folding/coffee").FoldMode, a = function () {
|
|
||||||
var e = new o;
|
|
||||||
this.foldingRules = new u, this.$tokenizer = new s(e.getRules())
|
|
||||||
};
|
|
||||||
r.inherits(a, i), function () {
|
|
||||||
}.call(a.prototype), t.Mode = a
|
|
||||||
}), ace.define("ace/mode/makefile_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules", "ace/mode/sh_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = e("./sh_highlight_rules"), o = function () {
|
|
||||||
var e = this.createKeywordMapper({keyword: s.reservedKeywords, "support.function.builtin": s.languageConstructs, "invalid.deprecated": "debugger"}, "string");
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: "string.interpolated.backtick.makefile", regex: "`", next: "shell-start"},
|
|
||||||
{token: "punctuation.definition.comment.makefile", regex: /#(?=.)/, next: "comment"},
|
|
||||||
{token: ["keyword.control.makefile"], regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)"},
|
|
||||||
{token: ["entity.name.function.makefile", "text"], regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)"}
|
|
||||||
], comment: [
|
|
||||||
{token: "punctuation.definition.comment.makefile", regex: /.+\\/},
|
|
||||||
{token: "punctuation.definition.comment.makefile", regex: ".+", next: "start"}
|
|
||||||
], "shell-start": [
|
|
||||||
{token: e, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "string", regex: "\\w+"},
|
|
||||||
{token: "string.interpolated.backtick.makefile", regex: "`", next: "start"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(o, i), t.MakefileHighlightRules = o
|
|
||||||
}), ace.define("ace/mode/sh_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
|
|
||||||
var r = e("../lib/oop"), i = e("./text_highlight_rules").TextHighlightRules, s = t.reservedKeywords = "!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set", o = t.languageConstructs = "[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait", u = function () {
|
|
||||||
var e = this.createKeywordMapper({keyword: s, "support.function.builtin": o, "invalid.deprecated": "debugger"}, "identifier"), t = "(?:(?:[1-9]\\d*)|(?:0))", n = "(?:\\.\\d+)", r = "(?:\\d+)", i = "(?:(?:" + r + "?" + n + ")|(?:" + r + "\\.))", u = "(?:(?:" + i + "|" + r + ")" + ")", a = "(?:" + u + "|" + i + ")", f = "(?:&" + r + ")", l = "[a-zA-Z][a-zA-Z0-9_]*", c = "(?:(?:\\$" + l + ")|(?:" + l + "=))", h = "(?:\\$(?:SHLVL|\\$|\\!|\\?))", p = "(?:" + l + "\\s*\\(\\))";
|
|
||||||
this.$rules = {start: [
|
|
||||||
{token: ["text", "comment"], regex: /(^|\s)(#.*)$/},
|
|
||||||
{token: "string", regex: '"(?:[^\\\\]|\\\\.)*?"'},
|
|
||||||
{token: "variable.language", regex: h},
|
|
||||||
{token: "variable", regex: c},
|
|
||||||
{token: "support.function", regex: p},
|
|
||||||
{token: "support.function", regex: f},
|
|
||||||
{token: "string", regex: "'(?:[^\\\\]|\\\\.)*?'"},
|
|
||||||
{token: "constant.numeric", regex: a},
|
|
||||||
{token: "constant.numeric", regex: t + "\\b"},
|
|
||||||
{token: e, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
|
|
||||||
{token: "keyword.operator", regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="},
|
|
||||||
{token: "paren.lparen", regex: "[\\[\\(\\{]"},
|
|
||||||
{token: "paren.rparen", regex: "[\\]\\)\\}]"}
|
|
||||||
]}
|
|
||||||
};
|
|
||||||
r.inherits(u, i), t.ShHighlightRules = u
|
|
||||||
}), ace.define("ace/mode/folding/coffee", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode", "ace/range"], function (e, t, n) {
|
|
||||||
var r = e("../../lib/oop"), i = e("./fold_mode").FoldMode, s = e("../../range").Range, o = t.FoldMode = function () {
|
|
||||||
};
|
|
||||||
r.inherits(o, i), function () {
|
|
||||||
this.getFoldWidgetRange = function (e, t, n) {
|
|
||||||
var r = this.indentationBlock(e, n);
|
|
||||||
if (r)return r;
|
|
||||||
var i = /\S/, o = e.getLine(n), u = o.search(i);
|
|
||||||
if (u == -1 || o[u] != "#")return;
|
|
||||||
var a = o.length, f = e.getLength(), l = n, c = n;
|
|
||||||
while (++n < f) {
|
|
||||||
o = e.getLine(n);
|
|
||||||
var h = o.search(i);
|
|
||||||
if (h == -1)continue;
|
|
||||||
if (o[h] != "#")break;
|
|
||||||
c = n
|
|
||||||
}
|
|
||||||
if (c > l) {
|
|
||||||
var p = e.getLine(c).length;
|
|
||||||
return new s(l, a, c, p)
|
|
||||||
}
|
|
||||||
}, this.getFoldWidget = function (e, t, n) {
|
|
||||||
var r = e.getLine(n), i = r.search(/\S/), s = e.getLine(n + 1), o = e.getLine(n - 1), u = o.search(/\S/), a = s.search(/\S/);
|
|
||||||
if (i == -1)return e.foldWidgets[n - 1] = u != -1 && u < a ? "start" : "", "";
|
|
||||||
if (u == -1) {
|
|
||||||
if (i == a && r[i] == "#" && s[i] == "#")return e.foldWidgets[n - 1] = "", e.foldWidgets[n + 1] = "", "start"
|
|
||||||
} else if (u == i && r[i] == "#" && o[i] == "#" && e.getLine(n - 2).search(/\S/) == -1)return e.foldWidgets[n - 1] = "start", e.foldWidgets[n + 1] = "", "";
|
|
||||||
return u != -1 && u < i ? e.foldWidgets[n - 1] = "start" : e.foldWidgets[n - 1] = "", i < a ? "start" : ""
|
|
||||||
}
|
|
||||||
}.call(o.prototype)
|
|
||||||
})
|
|
||||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user