<commit_before>#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// Subtext WebLog
// 
// Subtext is an open source weblog system that is a fork of the .TEXT
// weblog system.
//
// For updated news and information please visit http://subtextproject.com/
// Subtext is hosted at SourceForge at http://sourceforge.net/projects/subtext
// The development mailing list is at <EMAIL> 
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Web.UI;
using System.IO;
using System.Web.UI.WebControls;
using Subtext.Extensibility.Providers;
using System.Web;
using Subtext.Web.Controls;

using FreeTextBoxControls;

namespace Subtext.Web.Providers.RichTextEditor.FTB
{
	/// <summary>
	/// Summary description for FtbRichTextEditor.
	/// </summary>
	public class FtbRichTextEditorProvider: RichTextEditorProvider
	{
		FreeTextBox _ftbCtl;
		string _controlID=string.Empty;
		string _name = string.Empty;

		string _webFormFolder=string.Empty;
		string _toolbarlayout=string.Empty;
		bool _formatHtmlTagsToXhtml=false;
		bool _removeServerNamefromUrls=false;


		public override Control RichTextEditorControl
		{
			get
			{
				return _ftbCtl;
			}
		}

		public override void Initialize(string name, System.Collections.Specialized.NameValueCollection configValue)
		{
			_name=name;
			if(configValue["WebFormFolder"]!=null)
				_webFormFolder=configValue["WebFormFolder"];
			else
				throw new ApplicationException("WebFormFolder must be specified for the FreeTextBox provider to work");
			if(configValue["toolbarlayout"]!=null)
				_toolbarlayout=configValue["toolbarlayout"];
			if(configValue["FormatHtmlTagsToXhtml"]!=null)
				_formatHtmlTagsToXhtml=Boolean.Parse(configValue["FormatHtmlTagsToXhtml"]);
			if(configValue["RemoveServerNamefromUrls"]!=null)
				_removeServerNamefromUrls=Boolean.Parse(configValue["RemoveServerNamefromUrls"]);

		}

		public override void InitializeControl() 
		{
			_ftbCtl=new FreeTextBox();
			_ftbCtl.ID=ControlID;
			if(!_toolbarlayout.Trim().Equals(""))
				_ftbCtl.ToolbarLayout=_toolbarlayout;
			_ftbCtl.FormatHtmlTagsToXhtml=_formatHtmlTagsToXhtml;
			_ftbCtl.RemoveServerNameFromUrls=_removeServerNamefromUrls;

			if(!_webFormFolder.Equals(""))
				_ftbCtl.ImageGalleryUrl=ControlHelper.ExpandTildePath(_webFormFolder+"/ftb.imagegallery.aspx?rif={0}&cif={0}");

			string blogImageRootPath=Subtext.Framework.Format.UrlFormats.StripHostFromUrl(Subtext.Framework.Configuration.Config.CurrentBlog.ImagePath);

			if(!Directory.Exists(HttpContext.Current.Server.MapPath(blogImageRootPath)))
				Directory.CreateDirectory(HttpContext.Current.Server.MapPath(blogImageRootPath));
<commit_msg>Added FCKeditor copy folder to ignore list, and moved the / from the path concat to the webconfig<commit_after>#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// Subtext WebLog
// 
// Subtext is an open source weblog system that is a fork of the .TEXT
// weblog system.
//
// For updated news and information please visit http://subtextproject.com/
// Subtext is hosted at SourceForge at http://sourceforge.net/projects/subtext
// The development mailing list is at <EMAIL> 
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Web.UI;
using System.IO;
using System.Web.UI.WebControls;
using Subtext.Extensibility.Providers;
using System.Web;
using Subtext.Web.Controls;

using FreeTextBoxControls;

namespace Subtext.Web.Providers.RichTextEditor.FTB
{
	/// <summary>
	/// Summary description for FtbRichTextEditor.
	/// </summary>
	public class FtbRichTextEditorProvider: RichTextEditorProvider
	{
		FreeTextBox _ftbCtl;
		string _controlID=string.Empty;
		string _name = string.Empty;

		string _webFormFolder=string.Empty;
		string _toolbarlayout=string.Empty;
		bool _formatHtmlTagsToXhtml=false;
		bool _removeServerNamefromUrls=false;


		public override Control RichTextEditorControl
		{
			get
			{
				return _ftbCtl;
			}
		}

		public override void Initialize(string name, System.Collections.Specialized.NameValueCollection configValue)
		{
			_name=name;
			if(configValue["WebFormFolder"]!=null)
				_webFormFolder=configValue["WebFormFolder"];
			else
				throw new ApplicationException("WebFormFolder must be specified for the FreeTextBox provider to work");
			if(configValue["toolbarlayout"]!=null)
				_toolbarlayout=configValue["toolbarlayout"];
			if(configValue["FormatHtmlTagsToXhtml"]!=null)
				_formatHtmlTagsToXhtml=Boolean.Parse(configValue["FormatHtmlTagsToXhtml"]);
			if(configValue["RemoveServerNamefromUrls"]!=null)
				_removeServerNamefromUrls=Boolean.Parse(configValue["RemoveServerNamefromUrls"]);

		}

		public override void InitializeControl() 
		{
			_ftbCtl=new FreeTextBox();
			_ftbCtl.ID=ControlID;
			if(!_toolbarlayout.Trim().Equals(""))
				_ftbCtl.ToolbarLayout=_toolbarlayout;
			_ftbCtl.FormatHtmlTagsToXhtml=_formatHtmlTagsToXhtml;
			_ftbCtl.RemoveServerNameFromUrls=_removeServerNamefromUrls;

			if(!_webFormFolder.Equals(""))
				_ftbCtl.ImageGalleryUrl=ControlHelper.ExpandTildePath(_webFormFolder+"ftb.imagegallery.aspx?rif={0}&cif={0}");

			string blogImageRootPath=Subtext.Framework.Format.UrlFormats.StripHostFromUrl(Subtext.Framework.Configuration.Config.CurrentBlog.ImagePath);

			if(!Directory.Exists(HttpContext.Current.Server.MapPath(blogImageRootPath)))
				Directory.CreateDirectory(HttpContext.Current.Server.MapPath(blogImageRootPath));

{'fraction_non_alphanumeric': 0.161576522777683, 'fraction_numerical': 0.000682477392936359, 'mean_word_length': 3.7046548956661316, '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': '4673948', 'n_tokens_mistral': 1840, 'n_tokens_neox': 1665, 'n_words': 324}