<commit_before>/*
---

name: Editor

description: A Nooku MooTools 1.12 class for extending tinyMCE, CodeMirror and act as an negotiator between them

license: MIT-style license.

author: <NAME> <<EMAIL>>

requires: [Class]

provides: Editor

...
*/

var Editors = new Hash, 
	Editor = new Class({
	
	Implements: [Options, Events],
	
	identifier: false,
	
	options: {
		visible: true,
		toggle: false,
		cookie: new Hash.Cookie('nooku-editor', {duration: 7}),
		autoheight: false,

		tinyMCE: false,

		codemirror: false,
		buttons: [{
		    "display": "b",
		    "tagStart": "<strong>",
		    "tagEnd": "</strong>",
		    "access": "b"
		},
		{
		    "display": "i",
		    "tagStart": "<em>",
		    "tagEnd": "</em>",
		    "access": "i"
		},
		{
		    "display": "link",
		    "tagStart": "",
		    "tagEnd": "</a>",
		    "access": "a"
		},
		{
		    "display": "b-quote",
		    "tagStart": "\n\n<blockquote>",
		    "tagEnd": "</blockquote>\n\n",
		    "access": "q"
		},
		{
		    "display": "del",
		    "tagStart": "<del datetime=\""+(new Date).toUTCString()+"\">",
		    "tagEnd": "</del>",
		    "access": "d"
		},
		{
		    "display": "ins",
		    "tagStart": "<ins datetime=\""+(new Date).toUTCString()+"\">",
		    "tagEnd": "</ins>",
		    "access": "s"
		},
		{
		    "display": "img",
		    "tagStart": "",
		    "tagEnd": "",
		    "access": "m",
		    "open": -1
		},
		{
		    "display": "ul",
		    "tagStart": "<ul>\n",
		    "tagEnd": "</ul>\n\n",
		    "access": "u"
		},
		{
		    "display": "ol",
		    "tagStart": "<ol>\n",
		    "tagEnd": "</ol>\n\n",
		    "access": "o"
		},
		{
		    "display": "li",
		    "tagStart": "\t<li>",
		    "tagEnd": "</li>\n",
		    "access": "l"
		},
		{
		    "display": "code",
		    "tagStart": "<code>",
		    "tagEnd": "</code>",
		    "access": "c"
		},
		{
		    "display": "more",
		    "tagStart": "<hr id=\"system-readmore\" />",
		    "tagEnd": "",
		    "access": "t",
		    "open": -1
		}],
		codemirrorOptions: {
			lineNumbers: true,
			mode: "htmlmixed"
		}
	},

	//Used for checking isDirty state
	startContent: '',

	initialize: function(editor, options, settings){

		//If return editor instance if found
		if(Editors.has(editor)) return Editors.get(editor);

		//Stores the id so the getters works
		this.identifier = editor;
	
		//Sets the options
		this.setOptions(options);

		//@TODO cleanup
		this.settings = settings;

		window.addEvent('domready', function(){

			//Stores an editor reference, and prevents from setting up the html multiple times
			this.editor = $(editor);

            if(this.options.autoheight) {
                var parent = this.editor.getParent(),
                    height = parent.getSize().y,
                    offset = (this.editor.getPosition().y - parent.getPosition().y) + 22,
                    iframeHeight;

                // the 22 offset is for the .editor-toolbar
                this.settings.height = height - offset;

                //@TODO fix in css
                document.html.setStyle('overflow', 'hidden');

                window.addEvent('resize', function(){
                    var newHeight = parent.getSize().y, relativeHeight = height - newHeight;<commit_msg>Do not force overflow:hidden on document.html, this breaks the site application when the editor is being loaded.<commit_after>/*
---

name: Editor

description: A Nooku MooTools 1.12 class for extending tinyMCE, CodeMirror and act as an negotiator between them

license: MIT-style license.

author: <NAME> <<EMAIL>>

requires: [Class]

provides: Editor

...
*/

var Editors = new Hash, 
	Editor = new Class({
	
	Implements: [Options, Events],
	
	identifier: false,
	
	options: {
		visible: true,
		toggle: false,
		cookie: new Hash.Cookie('nooku-editor', {duration: 7}),
		autoheight: false,

		tinyMCE: false,

		codemirror: false,
		buttons: [{
		    "display": "b",
		    "tagStart": "<strong>",
		    "tagEnd": "</strong>",
		    "access": "b"
		},
		{
		    "display": "i",
		    "tagStart": "<em>",
		    "tagEnd": "</em>",
		    "access": "i"
		},
		{
		    "display": "link",
		    "tagStart": "",
		    "tagEnd": "</a>",
		    "access": "a"
		},
		{
		    "display": "b-quote",
		    "tagStart": "\n\n<blockquote>",
		    "tagEnd": "</blockquote>\n\n",
		    "access": "q"
		},
		{
		    "display": "del",
		    "tagStart": "<del datetime=\""+(new Date).toUTCString()+"\">",
		    "tagEnd": "</del>",
		    "access": "d"
		},
		{
		    "display": "ins",
		    "tagStart": "<ins datetime=\""+(new Date).toUTCString()+"\">",
		    "tagEnd": "</ins>",
		    "access": "s"
		},
		{
		    "display": "img",
		    "tagStart": "",
		    "tagEnd": "",
		    "access": "m",
		    "open": -1
		},
		{
		    "display": "ul",
		    "tagStart": "<ul>\n",
		    "tagEnd": "</ul>\n\n",
		    "access": "u"
		},
		{
		    "display": "ol",
		    "tagStart": "<ol>\n",
		    "tagEnd": "</ol>\n\n",
		    "access": "o"
		},
		{
		    "display": "li",
		    "tagStart": "\t<li>",
		    "tagEnd": "</li>\n",
		    "access": "l"
		},
		{
		    "display": "code",
		    "tagStart": "<code>",
		    "tagEnd": "</code>",
		    "access": "c"
		},
		{
		    "display": "more",
		    "tagStart": "<hr id=\"system-readmore\" />",
		    "tagEnd": "",
		    "access": "t",
		    "open": -1
		}],
		codemirrorOptions: {
			lineNumbers: true,
			mode: "htmlmixed"
		}
	},

	//Used for checking isDirty state
	startContent: '',

	initialize: function(editor, options, settings){

		//If return editor instance if found
		if(Editors.has(editor)) return Editors.get(editor);

		//Stores the id so the getters works
		this.identifier = editor;
	
		//Sets the options
		this.setOptions(options);

		//@TODO cleanup
		this.settings = settings;

		window.addEvent('domready', function(){

			//Stores an editor reference, and prevents from setting up the html multiple times
			this.editor = $(editor);

            if(this.options.autoheight) {
                var parent = this.editor.getParent(),
                    height = parent.getSize().y,
                    offset = (this.editor.getPosition().y - parent.getPosition().y) + 22,
                    iframeHeight;

                // the 22 offset is for the .editor-toolbar
                this.settings.height = height - offset;

                window.addEvent('resize', function(){
                    var newHeight = parent.getSize().y, relativeHeight = height - newHeight;
{'fraction_non_alphanumeric': 0.19482140071751677, 'fraction_numerical': 0.0031196381219778507, 'mean_word_length': 2.1805555555555554, 'pattern_counts': {'":': 100, '<': 49, '<?xml version=': 0, '>': 49, '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': '4144423', 'n_tokens_mistral': 2484, 'n_tokens_neox': 2099, 'n_words': 515}