Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ADefWebserver committed Nov 30, 2019
1 parent e229a11 commit aeedbf3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
Binary file modified HTMLExample.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion README.md
Expand Up @@ -49,7 +49,7 @@ Below is a list of all the options available on the Text Editor.
**Templates**

- `ToolbarContent` (optional) - Allows the user to define the Toolbar (above the editor control, or in-line when using the bubble theme, and a user highlights text in the editor).
- `EditorContent` (Required) - Allows the user to define the initial content
- `EditorContent` (optional) - Allows the user to define the initial content

**Parameters**

Expand All @@ -58,6 +58,15 @@ Below is a list of all the options available on the Text Editor.
- `Theme` (Optional - Default: `snow`) - Use `snow` to show the Toolbar on top of the editor, and `bubble` for inline editing.
- `DebugLevel` (Optional - Default: `info`) - Determines the level of debug information returned to the web browser console window. Options are `error`, `warn`, `log`, or `info`.

**Methods**

- `GetText` - Gets the content of the editor as Text.
- `GetHTML` - Gets the content of the editor as HTML.
- `GetContent` - Gets the content of the editor in the native Quill JSON Delta format.
- `LoadContent` (`json`) - Allows the content of the editor to be programmatically set.
- `LoadHTMLContent` (`string`) - Allows the content of the editor to be programmatically set.
- `EnableEditor` (`bool`) - Enables or disables the editor.


### Basic Example
(see code in the [Index.razor page](https://github.com/Blazored/TextEditor/blob/master/samples/BlazorServerSide/Pages/Index.razor) in the repo for more examples)
Expand Down Expand Up @@ -101,6 +110,8 @@ Below is a list of all the options available on the Text Editor.
<br />
<button class="btn btn-primary"
@onclick="GetHTML">Get HTML</button>
<button class="btn btn-primary"
@onclick="SetHTML">Set HTML</button>
<br />
<div>
<br />
Expand All @@ -119,6 +130,16 @@ string QuillHTMLContent;
QuillHTMLContent = await this.QuillHtml.GetHTML();
StateHasChanged();
}

public async void SetHTML()
{
string QuillContent =
@"<a href='http://BlazorHelpWebsite.com/'>" +
"<img src='images/BlazorHelpWebsite.gif' /></a>";

await this.QuillHtml.LoadHTMLContent(QuillContent);
StateHasChanged();
}
}
```
### Rich Text Screenshot
Expand Down
4 changes: 3 additions & 1 deletion samples/BlazorClientSide/Pages/Index.razor
Expand Up @@ -143,7 +143,7 @@
</span>
</ToolbarContent>
<EditorContent>
<p></p>
@((MarkupString)@QuillReadOnlyContent)
</EditorContent>
</BlazoredTextEditor>
<br />
Expand All @@ -159,6 +159,8 @@

string QuillHTMLContent;
string QuillContent;
string QuillReadOnlyContent =
@"<span><b>Read Only</b> <u>Content</u></span>";

bool mode = false;

Expand Down
4 changes: 3 additions & 1 deletion samples/BlazorServerSide/Pages/Index.razor
Expand Up @@ -143,7 +143,7 @@
</span>
</ToolbarContent>
<EditorContent>
<p></p>
@((MarkupString)@QuillReadOnlyContent)
</EditorContent>
</BlazoredTextEditor>
<br />
Expand All @@ -159,6 +159,8 @@

string QuillHTMLContent;
string QuillContent;
string QuillReadOnlyContent =
@"<span><b>Read Only</b> <u>Content</u></span>";

bool mode = false;

Expand Down
3 changes: 2 additions & 1 deletion src/Blazored.TextEditor/Interop.cs
Expand Up @@ -74,7 +74,8 @@ public static class Interop
bool mode)
{
return jsRuntime.InvokeAsync<object>(
"QuillFunctions.enableQuillEditor", quillElement, mode);
"QuillFunctions.enableQuillEditor",
quillElement, mode);
}
}
}

0 comments on commit aeedbf3

Please sign in to comment.