diff --git a/ActiveDirectoryProvider/ActiveDirectoryProvider.cs b/ActiveDirectoryProvider/ActiveDirectoryProvider.cs index 238c5c0..0a9fa9a 100644 --- a/ActiveDirectoryProvider/ActiveDirectoryProvider.cs +++ b/ActiveDirectoryProvider/ActiveDirectoryProvider.cs @@ -357,7 +357,7 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory { /// TODO return and complete /// public ComponentInformation Information { - get { return new ComponentInformation("ActiveDirectoryProvider", "ScrewTurn Software", "3.0.1.417", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/ActiveDirectoryProvider.txt"); } + get { return new ComponentInformation("ActiveDirectoryProvider", "Threeplicate Srl", "3.0.1.417", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/ActiveDirectoryProvider.txt"); } } /// diff --git a/Core/CacheProvider.cs b/Core/CacheProvider.cs index dc565d9..b2babe3 100644 --- a/Core/CacheProvider.cs +++ b/Core/CacheProvider.cs @@ -12,7 +12,7 @@ namespace ScrewTurn.Wiki { public class CacheProvider : ICacheProviderV30 { private readonly ComponentInformation _info = - new ComponentInformation("Local Cache Provider", "ScrewTurn Software", Settings.WikiVersion, "http://www.screwturn.eu", null); + new ComponentInformation("Local Cache Provider", "Threeplicate Srl", Settings.WikiVersion, "http://www.screwturn.eu", null); private IHostV30 _host; diff --git a/Core/Defaults.cs b/Core/Defaults.cs index 35ec0b2..3d1e94c 100644 --- a/Core/Defaults.cs +++ b/Core/Defaults.cs @@ -51,7 +51,7 @@ The ##WIKITITLE## Team."; /// The default content of the edit notice. /// public const string EditNoticeContent = @"Please '''do not''' include contents covered by copyright without the explicit permission of the Author. Always preview the result before saving.{BR} -If you are having trouble, please visit the [http://www.screwturn.eu/Help.aspx|Help section] at [http://www.screwturn.eu|ScrewTurn Software]."; +If you are having trouble, please visit the [http://www.screwturn.eu/Help.aspx|Help section] at the [http://www.screwturn.eu|ScrewTurn Wiki Website]."; /// /// The default content of the footer. diff --git a/Core/FilesStorageProvider.cs b/Core/FilesStorageProvider.cs index f044f89..fc15a15 100644 --- a/Core/FilesStorageProvider.cs +++ b/Core/FilesStorageProvider.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki { public class FilesStorageProvider : IFilesStorageProviderV30 { private readonly ComponentInformation info = new ComponentInformation("Local Files Provider", - "ScrewTurn Software", Settings.WikiVersion, "http://www.screwturn.eu", null); + "Threeplicate Srl", Settings.WikiVersion, "http://www.screwturn.eu", null); // The following strings MUST terminate with DirectorySeparatorPath in order to properly work // in BuildFullPath method diff --git a/Core/PagesStorageProvider.cs b/Core/PagesStorageProvider.cs index 54247b3..30c45a9 100644 --- a/Core/PagesStorageProvider.cs +++ b/Core/PagesStorageProvider.cs @@ -28,7 +28,7 @@ namespace ScrewTurn.Wiki { private const string IndexMappingsFile = "IndexMappings.cs"; private readonly ComponentInformation info = - new ComponentInformation("Local Pages Provider", "ScrewTurn Software", Settings.WikiVersion, "http://www.screwturn.eu", null); + new ComponentInformation("Local Pages Provider", "Threeplicate Srl", Settings.WikiVersion, "http://www.screwturn.eu", null); private IHostV30 host; // This cache is needed due to performance problems diff --git a/Core/SettingsStorageProvider.cs b/Core/SettingsStorageProvider.cs index 6be94c8..fd10786 100644 --- a/Core/SettingsStorageProvider.cs +++ b/Core/SettingsStorageProvider.cs @@ -49,7 +49,7 @@ namespace ScrewTurn.Wiki { public static readonly string ProviderName = "Local Settings Provider"; private readonly ComponentInformation info = - new ComponentInformation(ProviderName, "ScrewTurn Software", Settings.WikiVersion, "http://www.screwturn.eu", null); + new ComponentInformation(ProviderName, "Threeplicate Srl", Settings.WikiVersion, "http://www.screwturn.eu", null); private IHostV30 host; diff --git a/Core/UsersStorageProvider.cs b/Core/UsersStorageProvider.cs index 3dac62b..c622bb0 100644 --- a/Core/UsersStorageProvider.cs +++ b/Core/UsersStorageProvider.cs @@ -17,7 +17,7 @@ namespace ScrewTurn.Wiki { private const string GroupsFile = "Groups.cs"; private readonly ComponentInformation info = new ComponentInformation("Local Users Provider", - "ScrewTurn Software", Settings.WikiVersion, "http://www.screwturn.eu", null); + "Threeplicate Srl", Settings.WikiVersion, "http://www.screwturn.eu", null); private IHostV30 host; diff --git a/PluginPack/DownloadCounter.cs b/PluginPack/DownloadCounter.cs index 4e9775e..1e58840 100644 --- a/PluginPack/DownloadCounter.cs +++ b/PluginPack/DownloadCounter.cs @@ -22,7 +22,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack { private IHostV30 _host; private string _config; private bool _enableLogging = true; - private static readonly ComponentInformation Info = new ComponentInformation("Download Counter", "ScrewTurn Software", "3.0.0.206", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/DownloadCounter.txt"); + private static readonly ComponentInformation Info = new ComponentInformation("Download Counter Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/DownloadCounter.txt"); private static readonly Regex XmlRegex = new Regex(@"\(.+?)\<\/countDownloads\>", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); diff --git a/PluginPack/Footnotes.cs b/PluginPack/Footnotes.cs new file mode 100644 index 0000000..56145a3 --- /dev/null +++ b/PluginPack/Footnotes.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ScrewTurn.Wiki.PluginFramework; +using System.Text.RegularExpressions; + +namespace ScrewTurn.Wiki.Plugins.PluginPack { + + /// + /// Implements a footnotes plugin. + /// + public class Footnotes : IFormatterProviderV30 { + + // Kindly contributed by Jens Felsner + private static readonly ComponentInformation info = new ComponentInformation("Footnotes Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/RssFeedDisplay.txt"); + + private static readonly Regex ReferencesRegex = new Regex("(<[ ]*references[ ]*/[ ]*>|<[ ]*references[ ]*>.*?<[ ]*/[ ]*references[ ]*>)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex RefRegex = new Regex("<[ ]*ref[ ]*>.*?<[ ]*/[ ]*ref[ ]*>", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex RefRemovalRegex = new Regex("(<[ ]*ref[ ]*>|<[ ]*/[ ]*ref[ ]*>)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + + private IHostV30 host = null; + private string config = ""; + + /// + /// Initializes the Storage Provider. + /// + /// The Host of the Component. + /// The Configuration data, if any. + /// If or are null. + /// If is not valid or is incorrect. + public void Init(IHostV30 host, string config) { + this.host = host; + this.config = config != null ? config : ""; + } + + // Replaces the first occurence of 'find' in 'input' with 'replace' + private static string ReplaceFirst(string input, string find, string replace) { + return input.Substring(0, input.IndexOf(find)) + replace + input.Substring(input.IndexOf(find) + find.Length); + } + + /// + /// Performs a Formatting phase. + /// + /// The raw content to Format. + /// The Context information. + /// The Phase. + /// The Formatted content. + public string Format(string raw, ContextInformation context, FormattingPhase phase) { + // Match all * + MatchCollection mc = RefRegex.Matches(raw); + + // No ref-tag found, nothing to do + if(mc.Count == 0) return raw; + + // No references tag + if(ReferencesRegex.Matches(raw).Count == 0) { + return raw + "
Reference Error! Missing element <references/>"; + } + + string output = raw; + string ref_string = ""; + + int footnoteCounter = 0; + + // For each ... replace it with Footnote, append it to ref-section + foreach(Match m in mc) { + footnoteCounter++; + output = ReplaceFirst(output, m.Value, "" + footnoteCounter.ToString() + ""); + + ref_string += ""; + } + ref_string += "
" + footnoteCounter.ToString() + "" + RefRemovalRegex.Replace(m.Value, "") + "
"; + + // Replace with ref-section + output = ReferencesRegex.Replace(output, ref_string); + + return output; + } + + #region IFormatterProviderV30 Member + + /// + /// Specifies whether or not to execute Phase 1. + /// + public bool PerformPhase1 { + get { return false; } + } + + /// + /// Specifies whether or not to execute Phase 2. + /// + public bool PerformPhase2 { + get { return true; } + } + + /// + /// Specifies whether or not to execute Phase 3. + /// + public bool PerformPhase3 { + get { return false; } + } + + /// + /// Gets the execution priority of the provider (0 lowest, 100 highest). + /// + public int ExecutionPriority { + get { return 50; } + } + + /// + /// Prepares the title of an item for display (always during phase 3). + /// + /// The input title. + /// The context information. + /// The prepared title (no markup allowed). + public string PrepareTitle(string title, ContextInformation context) { + return title; + } + + #endregion + + #region IProviderV30 Member + + /// + /// Method invoked on shutdown. + /// + /// This method might not be invoked in some cases. + public void Shutdown() { + } + + /// + /// Gets the Information about the Provider. + /// + public ComponentInformation Information { + get { return info; } + } + + /// + /// Gets a brief summary of the configuration string format, in HTML. Returns null if no configuration is needed. + /// + public string ConfigHelpHtml { + get { return null; } + } + + #endregion + } + +} diff --git a/PluginPack/MultilanguageContentPlugin.cs b/PluginPack/MultilanguageContentPlugin.cs index 3156f28..4aa9eff 100644 --- a/PluginPack/MultilanguageContentPlugin.cs +++ b/PluginPack/MultilanguageContentPlugin.cs @@ -14,7 +14,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack { private IHostV30 host; private string config; - private ComponentInformation info = new ComponentInformation("Multilanguage Content Plugin", "ScrewTurn Software", "3.0.0.180", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Multilanguage.txt"); + private ComponentInformation info = new ComponentInformation("Multilanguage Content Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Multilanguage.txt"); private string defaultLanguage = "en-us"; private bool displayWarning = false; diff --git a/PluginPack/PagesSandbox.cs b/PluginPack/PagesSandbox.cs index fdfe59c..6c222c9 100644 --- a/PluginPack/PagesSandbox.cs +++ b/PluginPack/PagesSandbox.cs @@ -15,7 +15,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack { private IHostV30 host; private string config; - private static readonly ComponentInformation info = new ComponentInformation("Pages Sandbox", "ScrewTurn Software", "3.0.0.180", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/PagesSandbox.txt"); + private static readonly ComponentInformation info = new ComponentInformation("Pages Sandbox", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/PagesSandbox.txt"); private List allNamespaces = new List(5); diff --git a/PluginPack/PluginPack.csproj b/PluginPack/PluginPack.csproj index 309f218..042e78a 100644 --- a/PluginPack/PluginPack.csproj +++ b/PluginPack/PluginPack.csproj @@ -68,6 +68,7 @@ AssemblyVersion.cs + diff --git a/PluginPack/RssFeedDisplay.cs b/PluginPack/RssFeedDisplay.cs index b9a705d..64eec04 100644 --- a/PluginPack/RssFeedDisplay.cs +++ b/PluginPack/RssFeedDisplay.cs @@ -18,7 +18,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack { private IHostV30 _host; private string _config; private bool _enableLogging = true; - private static readonly ComponentInformation Info = new ComponentInformation("RSS Feed Display Plugin", "ScrewTurn Software", "3.0.1.454", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/RssFeedDisplay.txt"); + private static readonly ComponentInformation Info = new ComponentInformation("RSS Feed Display Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/RssFeedDisplay.txt"); private static readonly Regex RssRegex = new Regex(@"{(RSS|Twitter):(.+?)}", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); diff --git a/PluginPack/UnfuddleTickets.cs b/PluginPack/UnfuddleTickets.cs index a17fde0..c3e69dc 100644 --- a/PluginPack/UnfuddleTickets.cs +++ b/PluginPack/UnfuddleTickets.cs @@ -22,7 +22,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack { private const string ConfigHelpHtmlValue = "Config consists of three lines:
<Url> - The base url to the Unfuddle API (i.e. http://account_name.unfuddle.com/api/v1/projects/project_ID)
<Username> - The username to the unfuddle account to use for authentication
<Password> - The password to the unfuddle account to use for authentication
"; private const string LoadErrorMessage = "Unable to load ticket report at this time."; private static readonly Regex UnfuddleRegex = new Regex(@"{unfuddle}", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); - private static readonly ComponentInformation Info = new ComponentInformation("Unfuddle Tickets", "ScrewTurn Software", "3.0.0.204", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/UnfuddleTickets.txt"); + private static readonly ComponentInformation Info = new ComponentInformation("Unfuddle Tickets Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/UnfuddleTickets.txt"); private string _config; private IHostV30 _host; diff --git a/SqlServerProviders/SqlServerFilesStorageProvider.cs b/SqlServerProviders/SqlServerFilesStorageProvider.cs index cf5ca82..7a37dc3 100644 --- a/SqlServerProviders/SqlServerFilesStorageProvider.cs +++ b/SqlServerProviders/SqlServerFilesStorageProvider.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki.Plugins.SqlServer { ///
public class SqlServerFilesStorageProvider : SqlFilesStorageProviderBase { - private readonly ComponentInformation info = new ComponentInformation("SQL Server Files Storage Provider", "ScrewTurn Software", "3.0.0.341", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Files.txt"); + private readonly ComponentInformation info = new ComponentInformation("SQL Server Files Storage Provider", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Files.txt"); private readonly SqlServerCommandBuilder commandBuilder = new SqlServerCommandBuilder(); diff --git a/SqlServerProviders/SqlServerPagesStorageProvider.cs b/SqlServerProviders/SqlServerPagesStorageProvider.cs index f47b584..d691706 100644 --- a/SqlServerProviders/SqlServerPagesStorageProvider.cs +++ b/SqlServerProviders/SqlServerPagesStorageProvider.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki.Plugins.SqlServer { /// public class SqlServerPagesStorageProvider : SqlPagesStorageProviderBase, IPagesStorageProviderV30 { - private readonly ComponentInformation info = new ComponentInformation("SQL Server Pages Storage Provider", "ScrewTurn Software", "3.0.1.403", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Pages.txt"); + private readonly ComponentInformation info = new ComponentInformation("SQL Server Pages Storage Provider", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Pages.txt"); private readonly SqlServerCommandBuilder commandBuilder = new SqlServerCommandBuilder(); diff --git a/SqlServerProviders/SqlServerSettingsStorageProvider.cs b/SqlServerProviders/SqlServerSettingsStorageProvider.cs index f6a1636..84c1862 100644 --- a/SqlServerProviders/SqlServerSettingsStorageProvider.cs +++ b/SqlServerProviders/SqlServerSettingsStorageProvider.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki.Plugins.SqlServer { /// public class SqlServerSettingsStorageProvider : SqlSettingsStorageProviderBase { - private readonly ComponentInformation info = new ComponentInformation("SQL Server Settings Storage Provider", "ScrewTurn Software", "3.0.1.461", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Settings.txt"); + private readonly ComponentInformation info = new ComponentInformation("SQL Server Settings Storage Provider", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Settings.txt"); private readonly SqlServerCommandBuilder commandBuilder = new SqlServerCommandBuilder(); diff --git a/SqlServerProviders/SqlServerUsersStorageProvider.cs b/SqlServerProviders/SqlServerUsersStorageProvider.cs index c2e68d0..083a431 100644 --- a/SqlServerProviders/SqlServerUsersStorageProvider.cs +++ b/SqlServerProviders/SqlServerUsersStorageProvider.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki.Plugins.SqlServer { /// public class SqlServerUsersStorageProvider : SqlUsersStorageProviderBase, IUsersStorageProviderV30 { - private readonly ComponentInformation info = new ComponentInformation("SQL Server Users Storage Provider", "ScrewTurn Software", "3.0.0.341", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Users.txt"); + private readonly ComponentInformation info = new ComponentInformation("SQL Server Users Storage Provider", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Users.txt"); private readonly SqlServerCommandBuilder commandBuilder = new SqlServerCommandBuilder();