Для тех, кто спрашивал как применять JS код выше. Прописываем в условный init.php
[CODE]AddEventHandler("main", "OnBeforeProlog", function() { global $APPLICATION;
$APPLICATION->AddHeadString(<<<JS
<sc ript>
BX.addCustomEvent('OnEditorInitedBefore', function() {
var _this = this;
BX.addCustomEvent(this, 'OnGetParseRules', BX.proxy(function() {
_this.rules.tags.svg = {};
_this.rules.tags.g = {};
_this.rules.tags.path = {};
_this.rules.tags.use = {};
}, this));
});
</sc ript>
JS
, true);
});
[/CODE]
['Custom\EventHandlers', 'OnBeforeHTMLEditorScriptRunsHandler']);[/CODE]
namespace Custom;
class EventHandlers
{
public static function OnBeforeHTMLEditorScriptRunsHandler()
{
\CJSCore::RegisterExt('svg_editor', [
'js' => [
'/local/php_interface/editor.js',
],
]);
\CJSCore::Init(array('svg_editor'));
}
}[/CODE]editor.js[CODE]BX.addCustomEvent('OnEditorInitedBefore', function(toolbar) { var _this = this;
// отучаю резать тэги
BX.addCustomEvent(this, 'OnGetParseRules', BX.proxy(function() {
_this.rules.tags.svg = {};
_this.rules.tags.g = {};
_this.rules.tags.path = {};
_this.rules.tags.use = {};
_this.rules.tags.symbol = {};
}, this));
});[/CODE]
[CODE]AddEventHandler("main", "OnBeforeProlog", function() { global $APPLICATION;
$APPLICATION->AddHeadString(<<<JS
<sc ript>
BX.addCustomEvent('OnEditorInitedBefore', function() {
var _this = this;
BX.addCustomEvent(this, 'OnGetParseRules', BX.proxy(function() {
_this.rules.tags.svg = {};
_this.rules.tags.g = {};
_this.rules.tags.path = {};
_this.rules.tags.use = {};
}, this));
});
</sc ript>
JS
, true);
});
[/CODE]
В таком случае код будет применяться на всех страницах, включая страницы в админке.
P.S. Можно сделать по лучше, вынеся в более правильные обработчики
В условном init.php
[CODE]$eventManager->addEventHandler('fileman', 'OnBeforeHTMLEditorScriptRuns',['Custom\EventHandlers', 'OnBeforeHTMLEditorScriptRunsHandler']);[/CODE]
class
[CODE]<?phpnamespace Custom;
class EventHandlers
{
public static function OnBeforeHTMLEditorScriptRunsHandler()
{
\CJSCore::RegisterExt('svg_editor', [
'js' => [
'/local/php_interface/editor.js',
],
]);
\CJSCore::Init(array('svg_editor'));
}
}[/CODE]editor.js[CODE]BX.addCustomEvent('OnEditorInitedBefore', function(toolbar) { var _this = this;
// отучаю резать тэги
BX.addCustomEvent(this, 'OnGetParseRules', BX.proxy(function() {
_this.rules.tags.svg = {};
_this.rules.tags.g = {};
_this.rules.tags.path = {};
_this.rules.tags.use = {};
_this.rules.tags.symbol = {};
}, this));
});[/CODE]