<commit_before><? /* Image and article buttons needs this in order to work */ ?>
<?= @helper('behavior.modal') ?>

<style src="media://com_editors/css/default.css" />

<?= @helper('behavior.validator') ?>

<? if ($options['toggle']) : ?>
    <style src="media://com_editors/css/form.css" />
    <script src="media://com_editors/js/Fx.Toggle.js" />
<? endif ?>

<script src="media://com_editors/tinymce/tiny_mce<?= KDEBUG ? '_src.js' : '.js' ?>" />
<script src="media://com_editors/tinymce/themes/advanced/js/quicktags.js" />
<script src="media://com_editors/tinymce/themes/advanced/js/editor.js" />
<script src="media://com_editors/js/Editor.js" />

<? if($editors) : ?>
<script src="media://com_editors/codemirror/js/codemirror.js" />

<script>	
var quicktagsL10n = 
{
	quickLinks: "(Quick Links)",
	wordLookup: "Enter a word to look up:",
	dictionaryLookup: "Dictionary lookup",
	lookup: "lookup",
	closeAllOpenTags: "Close all open tags",
	closeTags: "close tags",
	enterURL: "Enter the URL",
	enterImageURL: "Enter the URL of the image",
	enterImageDescription: "Enter a description of the image"
};

try { convertEntities(quicktagsL10n);} catch(e) { };
</script>
<? endif ?>
		
<script>
// Support Form.Validator if present
if(this.Form && Form.Validator) {
	console.log('test');
    Form.Validator.add('validate-editor', {
    	errorMsg: function(){
    	    return Form.Validator.getMsg('required');
    	},
    	test: function(element){
    		alert('test');
    		return Editors.get(element.id).getText().trim().length;
    	}
    });
}

var settings = <?= json_encode($settings) ?>, options = <?= json_encode($options) ?>;

settings.setup =  function(ed) {
	ed.onBeforeRenderUI.add(function(ed) {
		//options.tinyMCE = ed;
		new Editor(ed.id, options);
	});<commit_msg>re #65 working on the validation support<commit_after><? /* Image and article buttons needs this in order to work */ ?>
<?= @helper('behavior.modal') ?>

<style src="media://com_editors/css/default.css" />

<?= @helper('behavior.validator') ?>

<? if ($options['toggle']) : ?>
    <style src="media://com_editors/css/form.css" />
    <script src="media://com_editors/js/Fx.Toggle.js" />
<? endif ?>

<script src="media://com_editors/tinymce/tiny_mce<?= KDEBUG ? '_src.js' : '.js' ?>" />
<script src="media://com_editors/tinymce/themes/advanced/js/quicktags.js" />
<script src="media://com_editors/tinymce/themes/advanced/js/editor.js" />
<script src="media://com_editors/js/Editor.js" />

<? if($editors) : ?>
<script src="media://com_editors/codemirror/js/codemirror.js" />

<script>	
var quicktagsL10n = 
{
	quickLinks: "(Quick Links)",
	wordLookup: "Enter a word to look up:",
	dictionaryLookup: "Dictionary lookup",
	lookup: "lookup",
	closeAllOpenTags: "Close all open tags",
	closeTags: "close tags",
	enterURL: "Enter the URL",
	enterImageURL: "Enter the URL of the image",
	enterImageDescription: "Enter a description of the image"
};

try { convertEntities(quicktagsL10n);} catch(e) { };
</script>
<? endif ?>
		
<script>
// Support Form.Validator if present
if(this.Form && Form.Validator) {
    Form.Validator.add('validate-editor', {
    	errorMsg: function(){
    	    return Form.Validator.getMsg('required');
    	},
    	test: function(element){
    		return !!Editors.get(element.id).getText().trim().length;
    	}
    });
}

var settings = <?= json_encode($settings) ?>, options = <?= json_encode($options) ?>;

settings.setup =  function(ed) {
	ed.onBeforeRenderUI.add(function(ed) {
		//options.tinyMCE = ed;
		new Editor(ed.id, options);
	});
{'fraction_non_alphanumeric': 0.19141727837380013, 'fraction_numerical': 0.00282326369282891, 'mean_word_length': 4.2179675994108985, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5398852', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1226, 'n_words': 236}