<commit_before>using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Text;
using System.Web.Hosting;
using System.Web.UI.WebControls;
using N2.Configuration;
using N2.Resources;
using N2.Web.Tokens;

namespace N2.Web.UI.WebControls
{
	/// <summary>
	/// A wrapper for the ckeditor (http://ckeditor.com).
	/// </summary>
	public class FreeTextArea : TextBox
	{

		public enum EditorModeSetting
		{
			Basic,
			Standard,
			Full,
		}

		static string contentCssUrl;
		static bool configEnabled = true;
		static bool isInitalized = false;
		static string configJsPath = string.Empty;
		static string overwriteStylesSet = string.Empty;
		static string overwriteFormatTags = string.Empty;
		static string overwriteLanguage = string.Empty;
		private EditorModeSetting editorMode = EditorModeSetting.Standard;
		private string additionalFormats = string.Empty;
		private string useStylesSet = string.Empty;
		private bool advancedMenues = false;
		private bool? allowedContent;
		private KeyValueConfigurationCollection customConfig;

		public FreeTextArea()
		{
			TextMode = TextBoxMode.MultiLine;
			CssClass = "ckeditor";
		}

		
		public virtual bool EnableFreeTextArea
		{
			get { return (bool)(ViewState["EnableFreeTextArea"] ?? configEnabled); }
			set { ViewState["EnableFreeTextArea"] = value; }
		}

		public virtual string DocumentBaseUrl
		{
			get { return (string)(ViewState["DocumentBaseUrl"]); }
			set { ViewState["DocumentBaseUrl"] = value; }
		}


		public EditorModeSetting EditorMode
		{
			get { return editorMode; }
			set { editorMode = value; }
		}

		public string AdditionalFormats
		{
			get { return additionalFormats; }
			set { additionalFormats = value; }
		}

		public string UseStylesSet
		{
			get { return useStylesSet; }
			set { useStylesSet = value; }
		}

		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);

			if (!isInitalized)
			{
				isInitalized = true;
				var config = N2.Context.Current.Resolve<EditSection>();
				if (config != null)
				{
					configJsPath = Url.ResolveTokens(config.CkEditor.ConfigJsPath );
					overwriteStylesSet = Url.ResolveTokens(config.CkEditor.OverwriteStylesSet);
					overwriteFormatTags = config.CkEditor.OverwriteFormatTags;
					overwriteLanguage = config.CkEditor.OverwriteLanguage;
					contentCssUrl = Url.ResolveTokens(config.CkEditor.ContentsCssPath);
					advancedMenues = config.CkEditor.AdvancedMenus;
					allowedContent = config.CkEditor.AllowedContent;
					customConfig = config.CkEditor.Settings ?? new KeyValueConfigurationCollection();
				}
			}
		}<commit_msg>Removed static members from free text area control<commit_after>using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Text;
using System.Web.Hosting;
using System.Web.UI.WebControls;
using N2.Configuration;
using N2.Resources;
using N2.Web.Tokens;

namespace N2.Web.UI.WebControls
{
	/// <summary>
	/// A wrapper for the ckeditor (http://ckeditor.com).
	/// </summary>
	public class FreeTextArea : TextBox
	{

		public enum EditorModeSetting
		{
			Basic,
			Standard,
			Full,
		}

		static string contentCssUrl;
		static bool configEnabled = true;
		string configJsPath = string.Empty;
		string overwriteStylesSet = string.Empty;
		string overwriteFormatTags = string.Empty;
		string overwriteLanguage = string.Empty;
		private EditorModeSetting editorMode = EditorModeSetting.Standard;
		private string additionalFormats = string.Empty;
		private string useStylesSet = string.Empty;
		private bool advancedMenues = false;
		private bool? allowedContent;
		private KeyValueConfigurationCollection customConfig;

		public FreeTextArea()
		{
			TextMode = TextBoxMode.MultiLine;
			CssClass = "ckeditor";
		}

		
		public virtual bool EnableFreeTextArea
		{
			get { return (bool)(ViewState["EnableFreeTextArea"] ?? configEnabled); }
			set { ViewState["EnableFreeTextArea"] = value; }
		}

		public virtual string DocumentBaseUrl
		{
			get { return (string)(ViewState["DocumentBaseUrl"]); }
			set { ViewState["DocumentBaseUrl"] = value; }
		}


		public EditorModeSetting EditorMode
		{
			get { return editorMode; }
			set { editorMode = value; }
		}

		public string AdditionalFormats
		{
			get { return additionalFormats; }
			set { additionalFormats = value; }
		}

		public string UseStylesSet
		{
			get { return useStylesSet; }
			set { useStylesSet = value; }
		}

		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);

			var config = N2.Context.Current.Resolve<EditSection>();
			if (config != null)
			{
				configJsPath = Url.ResolveTokens(config.CkEditor.ConfigJsPath);
				overwriteStylesSet = Url.ResolveTokens(config.CkEditor.OverwriteStylesSet);
				overwriteFormatTags = config.CkEditor.OverwriteFormatTags;
				overwriteLanguage = config.CkEditor.OverwriteLanguage;
				contentCssUrl = Url.ResolveTokens(config.CkEditor.ContentsCssPath);
				advancedMenues = config.CkEditor.AdvancedMenus;
				allowedContent = config.CkEditor.AllowedContent;
				customConfig = config.CkEditor.Settings ?? new KeyValueConfigurationCollection();
			}
		}
{'fraction_non_alphanumeric': 0.09378008858078182, 'fraction_numerical': 0.0019256691700365878, 'mean_word_length': 4.102161100196463, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1686626', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1556, 'n_words': 349}