mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-29 17:02:05 +13:00
Indexer custom CSS file path changes to not use it from program files
This commit is contained in:
parent
1b9e14c2a6
commit
1de5f7977a
9 changed files with 31 additions and 31 deletions
|
@ -55,7 +55,6 @@ Name: "CreateStartupIcon"; Description: "Launch {#AppName} automatically at Wind
|
|||
Source: "{#AppParentDirectory}\ShareX.exe"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "{#AppParentDirectory}\ShareX.exe.config"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "{#AppParentDirectory}\*.dll"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "{#AppParentDirectory}\IndexerDefault.css"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "..\Licenses\*.txt"; DestDir: {app}\Licenses; Flags: ignoreversion
|
||||
Source: "Output\Recorder-devices-setup.exe"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "..\..\ShareX_Chrome\ShareX_Chrome\bin\Release\ShareX_Chrome.exe"; DestDir: {app}; Flags: ignoreversion
|
||||
|
|
|
@ -32,22 +32,6 @@ namespace ShareX.IndexerLib
|
|||
{
|
||||
public static class HtmlHelper
|
||||
{
|
||||
public static string GetCssStyle(string filePath)
|
||||
{
|
||||
string css;
|
||||
|
||||
if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath))
|
||||
{
|
||||
css = File.ReadAllText(filePath, Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
css = Resources.IndexerDefault;
|
||||
}
|
||||
|
||||
return string.Format("<style type=\"text/css\">\r\n{0}\r\n</style>", css);
|
||||
}
|
||||
|
||||
public static string StartTag(string tag, string style = "", string otherFields = "")
|
||||
{
|
||||
string css = string.Empty;
|
||||
|
|
|
@ -44,7 +44,7 @@ public override string Index(string folderPath)
|
|||
StringBuilder sbHtmlIndex = new StringBuilder();
|
||||
sbHtmlIndex.AppendLine(Resources.doctype_xhtml);
|
||||
sbHtmlIndex.AppendLine(HtmlHelper.Tag("title", "Index for " + Path.GetFileName(folderPath)));
|
||||
sbHtmlIndex.AppendLine(HtmlHelper.GetCssStyle(config.CssFilePath));
|
||||
sbHtmlIndex.AppendLine(GetCssStyle());
|
||||
sbHtmlIndex.AppendLine(HtmlHelper.EndTag("head"));
|
||||
sbHtmlIndex.AppendLine(HtmlHelper.StartTag("body"));
|
||||
string index = base.Index(folderPath).Trim();
|
||||
|
@ -127,5 +127,21 @@ protected override string GetFooter()
|
|||
return string.Format("Generated by {0} on {1}.", string.Format("<a href=\"{0}\">{1}</a>", Links.URL_WEBSITE, "ShareX " + Application.ProductVersion),
|
||||
DateTime.UtcNow.ToString("yyyy-MM-dd 'at' HH:mm:ss 'UTC'"));
|
||||
}
|
||||
|
||||
private string GetCssStyle()
|
||||
{
|
||||
string css;
|
||||
|
||||
if (config.UseCustomCSSFile && !string.IsNullOrEmpty(config.CustomCSSFilePath) && File.Exists(config.CustomCSSFilePath))
|
||||
{
|
||||
css = File.ReadAllText(config.CustomCSSFilePath, Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
css = Resources.IndexerDefault;
|
||||
}
|
||||
|
||||
return $"<style type=\"text/css\">\r\n{css}\r\n</style>";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,9 +53,12 @@ public class IndexerSettings
|
|||
[Category("Indexer / Text"), DefaultValue(false), Description("Adds empty line after folders.")]
|
||||
public bool AddEmptyLineAfterFolders { get; set; }
|
||||
|
||||
[Category("Indexer / HTML"), DefaultValue("IndexerDefault.css"), Description("Cascading Style Sheet file path.")]
|
||||
[Category("Indexer / HTML"), DefaultValue(false), Description("Use custom Cascading Style Sheet file.")]
|
||||
public bool UseCustomCSSFile { get; set; }
|
||||
|
||||
[Category("Indexer / HTML"), DefaultValue(""), Description("Custom Cascading Style Sheet file path.")]
|
||||
[Editor(typeof(CssFileNameEditor), typeof(UITypeEditor))]
|
||||
public string CssFilePath { get; set; }
|
||||
public string CustomCSSFilePath { get; set; }
|
||||
|
||||
[Category("Indexer / HTML"), DefaultValue(false), Description("Add W3C validation icons. The W3C validation icons may be used on documents that successfully passed validation for a specific technology, using the W3C validation services.")]
|
||||
public bool AddValidationIcons { get; set; }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34209
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
|
|
@ -112,12 +112,12 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="doctype_xhtml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\doctype_xhtml.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
|
@ -125,6 +125,6 @@
|
|||
<value>..\Resources\valid_xhtml.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="IndexerDefault" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\IndexerDefault.css;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1254</value>
|
||||
<value>..\resources\indexerdefault.css;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
|
@ -92,9 +92,7 @@
|
|||
<None Include="Resources\doctype_xhtml.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="IndexerDefault.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\IndexerDefault.css" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
|
|
|
@ -55,6 +55,7 @@ private enum SetupType
|
|||
private static readonly string steamOutputDir = Path.Combine(outputDir, "ShareX");
|
||||
private static readonly string steamLauncherDir = Path.Combine(parentDir, @"..\ShareX_Steam\ShareX_Steam\bin\Release");
|
||||
private static readonly string steamUpdatesDir = Path.Combine(steamOutputDir, "Updates");
|
||||
private static readonly string chromeReleaseDir = Path.Combine(parentDir, @"..\ShareX_Chrome\ShareX_Chrome\bin\Release");
|
||||
private static readonly string innoSetupPath = @"C:\Program Files (x86)\Inno Setup 5\ISCC.exe";
|
||||
private static readonly string innoSetupScriptPath = Path.Combine(parentDir, "InnoSetup", "ShareX setup.iss");
|
||||
|
||||
|
@ -138,10 +139,9 @@ private static void CreatePortable(string destination)
|
|||
CopyFile(Path.Combine(ReleaseDirectory, "ShareX.exe"), destination);
|
||||
CopyFile(Path.Combine(ReleaseDirectory, "ShareX.exe.config"), destination);
|
||||
CopyFiles(ReleaseDirectory, "*.dll", destination);
|
||||
CopyFile(Path.Combine(ReleaseDirectory, "IndexerDefault.css"), destination);
|
||||
CopyFiles(Path.Combine(parentDir, "Licenses"), "*.txt", Path.Combine(destination, "Licenses"));
|
||||
CopyFile(Path.Combine(outputDir, "Recorder-devices-setup.exe"), destination);
|
||||
CopyFile(Path.Combine(parentDir, @"..\ShareX_Chrome\ShareX_Chrome\bin\Release\ShareX_Chrome.exe"), destination);
|
||||
CopyFile(Path.Combine(chromeReleaseDir, "ShareX_Chrome.exe"), destination);
|
||||
|
||||
string[] languages = new string[] { "de", "es", "fr", "hu", "ko-KR", "nl-NL", "pt-BR", "tr", "zh-CN" };
|
||||
|
||||
|
|
Loading…
Reference in a new issue