Skip to content

Commit 2c9fd90

Browse files
Fix custom error message feature
1 parent aaa9348 commit 2c9fd90

File tree

4 files changed

+65
-30
lines changed

4 files changed

+65
-30
lines changed

src/GroupDocs.Viewer.UI.API/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,4 @@ builder.Services.AddSingleton<ISearchTermResolver, MySearchTermResolver>();
125125

126126
![GroupDocs.Viewer.UI - Custom search term](https://raw.githubusercontent.com/groupdocs-viewer/groupdocs-viewer.github.io/master/resources/image/ui/custom-search-term.png)
127127

128-
**NOTE:** This feature works only when rendering to HTML. The service should be registered before you register the self-hosted or cloud API for it to take effect. By default, [SearchTermResolver.cs](./SearchTermResolution/Implementation/SearchTermResolver.cs) is registered. This class provides a default implementation that returns an empty string.
129-
128+
**NOTE:** This feature works only when rendering to HTML and when `PreloadPages` is set to `0` which means all the pages are preloaded. The service should be registered before you register the self-hosted or cloud API for it to take effect. By default, [SearchTermResolver.cs](./SearchTermResolution/Implementation/SearchTermResolver.cs) is registered. This class provides a default implementation that returns an empty string.

src/GroupDocs.Viewer.UI.Core/Configuration/Config.cs

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,115 +4,151 @@ public class Config
44
{
55
/// <summary>
66
/// Rendering mode for the UI.
7-
/// Possible values: "RenderingMode.Html", "RenderingMode.Image".
8-
/// Default value is "RenderingMode.Html".
7+
/// Possible values: <c>RenderingMode.Html</c>, <c>RenderingMode.Image</c>.
8+
/// Default value: <c>RenderingMode.Html</c>.
99
/// </summary>
1010
public RenderingMode RenderingMode { get; set; } = RenderingMode.Html;
1111

1212
/// <summary>
13-
/// When enabled app will use pre-generated static content via GET requests.
14-
/// Default value is false.
13+
/// When enabled, the app uses pre-generated static content via GET requests.
14+
/// Default value: <c>false</c>.
1515
/// </summary>
1616
public bool StaticContentMode { get; set; } = false;
1717

1818
/// <summary>
19-
/// File to load by default
19+
/// File to load by default. Set this property to a relative file path or a file ID.
20+
/// By default, no file is loaded unless this property is set or a file name is specified
21+
/// through the <c>file</c> query string parameter, e.g., <c>file=annual-review.docx</c>.
2022
/// </summary>
2123
public string InitialFile { get; set; }
2224

2325
/// <summary>
24-
/// Number of pages to preload
25-
/// </summary>
26+
/// Number of pages to preload. Default value: <c>3</c>.
27+
/// Set to <c>0</c> to render all pages at once.
28+
/// This property also determines how many pages are loaded in subsequent requests.
29+
/// The UI respects scroll direction: when scrolling down, the next pages are loaded;
30+
/// when scrolling up, the previous pages are loaded.
31+
/// </summary>
32+
/// <remarks>
33+
/// <para>If you're using the API without the UI, you can control this setting
34+
/// in the service configuration:</para>
35+
/// <code>
36+
/// using GroupDocs.Viewer.UI.Core.Configuration;
37+
///
38+
/// var builder = WebApplication.CreateBuilder(args);
39+
///
40+
/// builder.Services
41+
/// .AddOptions&lt;Config&gt;()
42+
/// .Configure&lt;IConfiguration&gt;((config, configuration) =>
43+
/// {
44+
/// config.PreloadPages = 0; // Preload all pages at once
45+
/// });
46+
/// </code>
47+
/// </remarks>
2648
public int PreloadPages { get; set; } = 3;
2749

2850
/// <summary>
29-
// Initial zoom level. The default value is not specified; the UI automatically sets the zoom level.
51+
/// Initial zoom level. If not specified, the UI automatically sets the zoom level.
3052
/// </summary>
3153
public ZoomLevel InitialZoom { get; set; }
3254

3355
/// <summary>
34-
/// Enable or disable right-click context menu
56+
/// Enable or disable the right-click context menu.
57+
/// Default value: <c>true</c>.
3558
/// </summary>
3659
public bool EnableContextMenu { get; set; } = true;
3760

3861
/// <summary>
39-
/// Enable or disable clickable links in documents
62+
/// Enable or disable clickable links in documents.
63+
/// Default value: <c>true</c>.
4064
/// </summary>
4165
public bool EnableHyperlinks { get; set; } = true;
4266

4367
/* Control Visibility Settings */
4468

4569
/// <summary>
46-
/// Show or hide header
70+
/// Show or hide the header.
71+
/// Default value: <c>true</c>.
4772
/// </summary>
4873
public bool EnableHeader { get; set; } = true;
4974

5075
/// <summary>
51-
/// Show or hide header
76+
/// Show or hide the toolbar.
77+
/// Default value: <c>true</c>.
5278
/// </summary>
5379
public bool EnableToolbar { get; set; } = true;
5480

5581
/// <summary>
56-
/// Show or hide filename
82+
/// Show or hide the file name.
83+
/// Default value: <c>true</c>.
5784
/// </summary>
5885
public bool EnableFileName { get; set; } = true;
5986

6087
/// <summary>
61-
/// Show or hide thumbnails pane
88+
/// Show or hide the thumbnails pane.
89+
/// Default value: <c>true</c>.
6290
/// </summary>
6391
public bool EnableThumbnails { get; set; } = true;
6492

6593
/// <summary>
66-
/// Show or hide zoom controls
94+
/// Show or hide the zoom controls.
95+
/// Default value: <c>true</c>.
6796
/// </summary>
6897
public bool EnableZoom { get; set; } = true;
6998

7099
/// <summary>
71-
/// Show or hide page navigation menu
100+
/// Show or hide the page navigation menu.
101+
/// Default value: <c>true</c>.
72102
/// </summary>
73103
public bool EnablePageSelector { get; set; } = true;
74104

75105
/// <summary>
76-
/// Show or hide search control
106+
/// Show or hide the search control.
107+
/// Default value: <c>true</c>.
77108
/// </summary>
78109
public bool EnableSearch { get; set; } = true;
79110

80111
/// <summary>
81-
/// Show or hide "Print" button
112+
/// Show or hide the "Print" button.
113+
/// Default value: <c>true</c>.
82114
/// </summary>
83115
public bool EnablePrint { get; set; } = true;
84116

85117
/// <summary>
86-
/// Show or hide "Download PDF" button
118+
/// Show or hide the "Download PDF" button.
119+
/// Default value: <c>true</c>.
87120
/// </summary>
88121
public bool EnableDownloadPdf { get; set; } = true;
89122

90123
/// <summary>
91-
/// Show or hide "Present" button
124+
/// Show or hide the "Present" button.
125+
/// Default value: <c>true</c>.
92126
/// </summary>
93127
public bool EnablePresentation { get; set; } = true;
94128

95129
/// <summary>
96-
/// Show or hide "File Browser" button
130+
/// Show or hide the "File Browser" button.
131+
/// Default value: <c>true</c>.
97132
/// </summary>
98133
public bool EnableFileBrowser { get; set; } = true;
99134

100135
/// <summary>
101-
/// Show or hide "Upload File" button
136+
/// Show or hide the "Upload File" button.
137+
/// Default value: <c>true</c>.
102138
/// </summary>
103139
public bool EnableFileUpload { get; set; } = true;
104140

105-
106-
107141
/* Language and Localization Settings */
108142

109143
/// <summary>
110-
/// Show or hide language menu
144+
/// Show or hide the language menu.
145+
/// Default value: <c>true</c>.
111146
/// </summary>
112147
public bool EnableLanguageSelector { get; set; } = true;
113148

114149
/// <summary>
115-
/// Default language code. Default value is "en".
150+
/// Default language code.
151+
/// Default value: <c>en</c>.
116152
/// </summary>
117153
public LanguageCode DefaultLanguage { get; set; } = LanguageCode.English;
118154

src/GroupDocs.Viewer.UI/App/chunk-3SMDAA4S.js renamed to src/GroupDocs.Viewer.UI/App/chunk-INJWMVGV.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GroupDocs.Viewer.UI/App/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)