A library of Blazor UI components in Bootstrap style

A library of Blazor UI components in Bootstrap style

2022-09-14 0 864
Resource Number 38492 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation
The recommended thing in this issue is UEditor is a WYSIWYG rich text web editor developed by Baidu’s “FEX front-end R&D team”, which is lightweight, customizable, and focuses on user experience, and is open source based on the MIT protocol.

Get started with deployment

Step 1: Download the editor

Method 1: Complete installation package (recommended)

Neditor.tar.xz

Method 2: Install npm

npm i @notadd/neditor -S

Method 3: Compile and install
git clone https://github.com/notadd/neditor.gi
npm install
npm run build

Step 2: Open the index.html in your browser

Go to the directory dist and open the file index.html using a browser

use

Create a demo file

Unzip the downloaded package, create a demo.html file in the unzipped directory, and fill in the following html code

<!DOCTYPE HTML>
<html lang=”en-US”>

<head>
<meta charset=”UTF-8″>
<title>ueditor demo</title>
</head>

<body>
<!– Load the editor’s container –>
<script id=”container” name=”content” type=”text/plain”>
Here write your initialization content
</script>
<!– Config file –>
<script type=”text/javascript” src=”ueditor.config.js”></script>
<!– Editor source code file –>
<script type=”text/javascript” src=”ueditor.all.js”></script>
<!– Instancing Editor –>
<script type=”text/javascript”>
var ue = UE.getEditor(‘container’);
</script>
</body>

</html>

Open the demo.html in your browser

If you see an editor like this, congratulations, your first deployment was successful!

A library of Blazor UI components in Bootstrap style插图

Pass in the custom parameters

The editor has a number of customizable parameters that can be passed to the editor when instantiated:

var ue = UE.getEditor(‘container’, {
autoHeight: false
});

Set and read the content in the editor

The contents of the editor can be set and read through the getContent and setContent methods

var ue = UE.getContent();
It’s best to do things with the editor after the editor is ready
ue.ready(function() {
Set the contents of the editor
ue.setContent(‘hello’);
Get the html content, return: <p>hello</p>
var html = ue.getContent();
Get plain text content and return: hello
var txt = ue.getContentTxt();
});
Customize toolbar icons

Description of how to modify a configuration item

How to modify the configuration item: 1. Method 1: Modify the toolbars in ueditor.config.js 2. Method 2: Enter the toolbars parameter when instantiating the editor

var ue = UE.getEditor(‘container’);

Simple list

toolbars: [
[‘fullscreen’, ‘source’, ‘undo’, ‘redo’, ‘bold’]
]

Multi-line lists

toolbars: [
[‘fullscreen’, ‘source’, ‘undo’, ‘redo’],
[‘bold’, ‘italic’, ‘underline’, ‘fontborder’, ‘strikethrough’, ‘superscript’, ‘subscript’, ‘removeformat’, ‘formatmatch’, ‘autotypeset’, ‘blockquote’, ‘pasteplain’, ‘|’, ‘ forecolor’, ‘backcolor’, ‘insertorderedlist’, ‘insertunorderedlist’, ‘selectall’, ‘cleardoc’]
]

A library of Blazor UI components in Bootstrap style插图1

Two lines

Description of the deployment package directory

The following table describes the directory structure of the decompressed file of the deployment packageshow

A library of Blazor UI components in Bootstrap style插图2

  • dialogs: The resources and JS files corresponding to the dialog box pop up
    lang: The file that the editor displays internationally
    PHP or JSP or ASP or NET: Background files that involve server-side operations
    themes: style images and style files
    third-party: third-party plug-ins (including code highlighting, source code editing, etc.)
    ueditor.all.js: The result of the development version code merge, the packaging file of all files in the directory
    ueditor.all.min.js: ueditor.all.js a condensed version of the file, which is recommended for general deployment
    ueditor.config.js: Editor’s configuration files, suggestions, and editor instantiation pages are placed in the same directory
    ueditor.parse.js: The edited content displays page references, and styles such as tables, lists, and code highlights are automatically loaded
    ueditor.parse.min.js: ueditor.parse.js a compressed version of the file, which is recommended to be used when the content display page is officially deployed

    Description of the directory of the source code package

A library of Blazor UI components in Bootstrap style插图3

Secondary development method

You don’t need to make any changes to the UEditor code, just develop custom features outside of UEditor through the secondary development interface provided by UEditor. This development method not only avoids modifying the UEditor source code and facilitates future UEditor upgrades, but also allows the custom functionality to be maintained in a file or directory through the interface, which is convenient for future maintenance.

Deploy custom features

For the secondary development of UEditor, it is generally more about adding buttons, drop-down baskets or adding a dialog. Based on these general methods, I wrote three types of custom demos in the _examples directory.

addCustomizeButton.js Add a button
addCustomizeCombox.js Add a drop-down box
addCustomizeDialog.js Add a pop-up layer

In addition to adding an additional HTML page to add the popup layer, all the functional code that needs to be added and modified is maintained in a JS file. Ways to use files:

<script type=”text/javascript” charset=”utf-8″ src=”../ueditor.config.js”></script>
<script type=”text/javascript” charset=”utf-8″ src=”editor_api.js”>
</script>
<script type=”text/javascript” charset=”utf-8″ src=”../lang/zh-cn/zh-cn.js”></script>
<!– add button –>
<script type=”text/javascript” charset=”utf-8″ src=”addCustomizeButton.js”></script>
The newly added button is complete. When you instantiate the editor, you don’t need to add any additional code.

Development details
Now that we’ve talked about how to deploy your features, this section will tell you what interfaces UEditor provides to extend your functionality outside of the editor.

UE.registerUI(‘uiname’, function(editor, uiname) {
//do something
}, [index, [editorId]]);

Considering that everyone’s function basically extends a UI and what this UI does, UEditor provides an interface called registerUI, which allows developers to dynamically inject extended content.

uiname, is the name you gave to the newly added UI, here it can be 1 or more, “uiname” and the latter is “uiname1 uiname2 uiname3”
function, is what you actually have to do, here provide two parameters, editor is the editor instance, if you have multiple editor instances, then after each editor is instantiated, this function will be called, and the editor will be passed in, uiname, the name you gave to the ui, if you added more than one in the front, the function will be called many times, and each ui name will be passed in. If a function returns a UI instance, that UI instance is added to the toolbar by default. Of course, it is also possible to return no UI. For example, if you want to monitor the selectionchange event and pop up the floating layer in some scenarios, you don’t need to return any UI.
index, is the position you want to put in the toolbar, and the default is to put it at the end
editorId, when you have multiple editor instances on your page, you want to extend this ui to that editor instance, where editorId is the id passed in when you initialize the editor, the default is that each instance will join your extension

Add a button

UE.registerUI(‘button’, function(editor, uiName) {
When the registration button is executed, the command command will have a fallback action by default
editor.registerCommand(uiName, {
execCommand: function() {
alert(‘execCommand:’ + uiName)
}
});
Create a button
var btn = new UE.ui.Button({
The name of the button
name: uiName,
prompt
title: uiName,
Add extra styling and specify the icon icon, which is a duplicate icon by default
cssRules: ‘background-position: -500px 0; ‘,
Commands that are executed when clicked
onclick: function() {
You don’t need to execute commands here, you can do your own operations
editor.execCommand(uiName);
}
});
When the point is made on the edit, the button does a state reflection
editor.addListener(‘selectionchange’, function() {
var state = editor.queryCommandState(uiName);
if (state == -1) {
btn.setDisabled(true);
btn.setChecked(false);
} else {
btn.setDisabled(false);
btn.setChecked(state);
}
});
Since you’re adding a button, you need to return this button
return btn;
});

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code A library of Blazor UI components in Bootstrap style https://ictcoder.com/kyym/a-library-of-blazor-ui-components-in-bootstrap-style.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service