CN113867726A - Method and device for expanding page rich text editor, storage medium and electronic equipment - Google Patents

Method and device for expanding page rich text editor, storage medium and electronic equipment Download PDF

Info

Publication number
CN113867726A
CN113867726A CN202111143870.0A CN202111143870A CN113867726A CN 113867726 A CN113867726 A CN 113867726A CN 202111143870 A CN202111143870 A CN 202111143870A CN 113867726 A CN113867726 A CN 113867726A
Authority
CN
China
Prior art keywords
editing
data
rich text
module
text editor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111143870.0A
Other languages
Chinese (zh)
Inventor
陈子闽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seashell Housing Beijing Technology Co Ltd
Original Assignee
Beijing Fangjianghu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Fangjianghu Technology Co Ltd filed Critical Beijing Fangjianghu Technology Co Ltd
Priority to CN202111143870.0A priority Critical patent/CN113867726A/en
Publication of CN113867726A publication Critical patent/CN113867726A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Document Processing Apparatus (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the disclosure discloses an extension method and device of a page rich text editor, a storage medium and electronic equipment, wherein the method comprises the following steps: in response to receiving a page editing instruction, adding at least one editing module which can be independently edited in a rich text editor corresponding to a page; editing in the at least one editing module according to the module editing instruction to obtain at least one edited editing module; exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module; rendering a page based on the first data and the at least one group of second data to obtain a rendered page; in the embodiment, the effect of visually editing the content in the rich text is realized by independently editing the editing module, but the editing process is not limited by the control of the rich text, and the change processing of events and content is flexible.

Description

Method and device for expanding page rich text editor, storage medium and electronic equipment
Technical Field
The disclosure relates to the technical field of data processing, and in particular to an extension method and device of a page rich text editor, a storage medium and an electronic device.
Background
In document services, in order to achieve richer display effects, documents are entered by using a rich text editor, which provides functions of modifying font sizes and colors, inserting pictures and the like, but with the increase of rich text forms required by the entering people, for example, functions of adding form submission and the like in documents, the existing rich text editor cannot meet the requirements.
Disclosure of Invention
The present disclosure is proposed to solve the above technical problems. The embodiment of the disclosure provides an extension method and device of a page rich text editor, a storage medium and electronic equipment.
According to an aspect of the embodiments of the present disclosure, there is provided an extension method of a page rich text editor, including:
in response to receiving a page editing instruction, adding at least one editing module which can be independently edited in a rich text editor corresponding to a page;
editing in the at least one editing module according to the module editing instruction to obtain at least one edited editing module;
exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module;
rendering a page based on the first data and the at least one group of second data to obtain a rendered page.
Optionally, adding at least one editing module capable of independently editing in the rich text editor corresponding to the page includes:
inserting at least one placeholder element corresponding to the at least one edit module size in data of the rich text editor; each placeholder element corresponds to one editing module;
and covering the editing module corresponding to at least one placeholder element to a position corresponding to the placeholder element.
Optionally, the overlaying the editing module corresponding to at least one of the placeholder elements to a position corresponding to the placeholder element includes:
and covering the editing module corresponding to at least one placeholder element to the position corresponding to the placeholder element through absolute positioning.
Optionally, the editing in the at least one editing module according to the module editing instruction to obtain the edited at least one editing module includes:
responding to a click event of the at least one editing module obtained by monitoring, adjusting the state of the at least one editing module to be an editing state, and adjusting the state of the rich text editor to be a read-only state;
and controlling the at least one editing module to receive the edited content according to the module editing instruction in an editing state to obtain the edited at least one editing module.
Optionally, the method further comprises:
responding to the monitored focus losing event of the at least one editing module, adjusting the state of the at least one editing module to be a read-only state, and adjusting the state of the rich text editor to be an editing state;
and controlling the rich text editor to receive the edited content according to the text editing instruction in the editing state to obtain the edited rich text editor.
Optionally, the rendering the page based on the first data and the at least one group of second data to obtain a rendered page includes:
determining at least one placeholder data corresponding to the at least one placeholder element included in the first data;
replacing the at least one placeholder data with the at least one second data to obtain replaced complete data;
and rendering the page based on the complete data to obtain the rendered page.
Optionally, the method further comprises:
in response to receiving a first update instruction to edit the rendered page;
acquiring complete data corresponding to the rendered page;
obtaining a rich text editor having at least one editing module based on the complete data;
updating the at least one editing module and/or the rich text editor according to a second updating instruction;
and exporting the updated data corresponding to the at least one editing module and/or the rich text editor, and rendering the page based on the updated data to obtain the updated page.
Optionally, the obtaining a rich text editor having at least one editing module based on the complete data includes:
decomposing the complete data to obtain at least one group of second data and first data;
inputting the first data into a rich text editor corresponding to the page;
rendering the at least one group of second data in sequence to obtain at least one editing module;
and covering the at least one editing module to a position corresponding to the at least one placeholder element in the rich text editor to obtain the rich text editor with the at least one editing module.
Optionally, decomposing the complete data to obtain at least one set of second data and first data includes:
identifying and extracting at least one group of second data corresponding to the at least one editing module from the complete data according to the set parameters corresponding to the at least one editing module;
and replacing the position corresponding to the at least one group of second data in the complete data with at least one placeholder element to obtain first data corresponding to the rich text editor.
According to another aspect of the embodiments of the present disclosure, there is provided an extension apparatus of a page rich text editor, including:
the editing extension module is used for responding to the received page editing instruction and adding at least one editing module which can be independently edited in the rich text editor corresponding to the page;
the instruction response module is used for editing in the at least one editing module according to the module editing instruction to obtain at least one edited editing module;
the data export module is used for exporting the first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module;
and the page rendering module is used for rendering the page based on the first data and the at least one group of second data to obtain the rendered page.
Optionally, the edit extension module includes:
a placeholder for inserting at least one placeholder element corresponding to the at least one edit module size in the data of the rich text editor; each placeholder element corresponds to one editing module;
and the module covering unit is used for covering the editing module corresponding to at least one placeholder element to the position corresponding to the placeholder element.
Optionally, the module overlay unit is specifically configured to overlay the editing module corresponding to at least one of the placeholder elements to a position corresponding to the placeholder element through absolute positioning.
Optionally, the instruction response module is specifically configured to, in response to a click event obtained by monitoring the at least one editing module, adjust a state of the at least one editing module to an editing state, and adjust a state of the rich text editor to a read-only state; and controlling the at least one editing module to receive the edited content according to the module editing instruction in an editing state to obtain the edited at least one editing module.
Optionally, the apparatus provided in this embodiment further includes:
the rich text editing module is used for responding to the monitored focus losing event of the at least one editing module, adjusting the state of the at least one editing module to be a read-only state, and adjusting the state of the rich text editor to be an editing state; and controlling the rich text editor to receive the edited content according to the text editing instruction in the editing state to obtain the edited rich text editor.
Optionally, the page rendering module is specifically configured to determine at least one placeholder data corresponding to the at least one placeholder element included in the first data; replacing the at least one placeholder data with the at least one second data to obtain replaced complete data; and rendering the page based on the complete data to obtain the rendered page.
Optionally, the apparatus provided in this embodiment further includes:
an update instruction module, configured to respond to receiving a first update instruction for editing the rendered page;
the data acquisition module is used for acquiring complete data corresponding to the rendered page;
the data decomposition module is used for obtaining a rich text editor with at least one editing module based on the complete data;
the updating processing module is used for updating the at least one editing module and/or the rich text editor according to a second updating instruction;
and the updating and rendering module is used for exporting the updated data corresponding to the at least one editing module and/or the rich text editor, and rendering the page based on the updated data to obtain the updated page.
Optionally, the data decomposition module is specifically configured to decompose the complete data to obtain at least one group of second data and first data; inputting the first data into a rich text editor corresponding to the page; rendering the at least one group of second data in sequence to obtain at least one editing module; and covering the at least one editing module to a position corresponding to the at least one placeholder element in the rich text editor to obtain the rich text editor with the at least one editing module.
Optionally, when obtaining at least one set of second data and first data based on the complete data decomposition, the data decomposition module is configured to identify and extract at least one set of second data corresponding to the at least one editing module from the complete data according to the setting parameter corresponding to the at least one editing module; and replacing the position corresponding to the at least one group of second data in the complete data with at least one placeholder element to obtain first data corresponding to the rich text editor.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the method for expanding a page rich text editor according to any one of the embodiments.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instruction from the memory and execute the instruction to implement the method for expanding the page rich text editor according to any of the embodiments.
Based on the method and the device for expanding the page rich text editor, the storage medium and the electronic equipment, at least one editing module capable of independently editing is added in the rich text editor corresponding to the page in response to the received page editing instruction; editing in the at least one editing module according to the module editing instruction to obtain at least one edited editing module; exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module; rendering a page based on the first data and the at least one group of second data to obtain a rendered page; in the embodiment, the effect of visually editing the content in the rich text is realized by independently editing the editing module, but the editing process is not limited by the control of the rich text, and the change processing of events and content is flexible.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a flowchart illustrating an expanding method of a page rich text editor provided in an exemplary embodiment of the present disclosure.
FIG. 2 is a schematic flow chart of step 102 in the embodiment shown in FIG. 1 of the present disclosure.
Fig. 3 is a schematic flow chart of step 104 in the embodiment shown in fig. 1 of the present disclosure.
Fig. 4 is a schematic flow chart of step 108 in the embodiment shown in fig. 1 of the present disclosure.
Fig. 5 is a flowchart illustrating an expanding method of a page rich text editor provided by another exemplary embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an expansion apparatus of a page rich text editor provided in an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship. The data referred to in this disclosure may include unstructured data, such as text, images, video, etc., as well as structured data.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
Fig. 1 is a flowchart illustrating an expanding method of a page rich text editor provided in an exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device, as shown in fig. 1, and includes the following steps:
step 102, in response to receiving a page editing instruction, adding at least one editing module capable of independently editing in a rich text editor corresponding to a page.
The editing module is independent of the rich text editor, is positioned in the rich text editor on the display, and is not controlled by the logic of the rich text editor in operation.
And 104, editing in at least one editing module according to the module editing instruction to obtain at least one edited editing module.
In one embodiment, the editing processing of at least one editing module can be separately realized according to the module editing instruction, and the editing processing can comprise the processing of adding, modifying, deleting data or format and the like to the editing module; in the process of editing the editing module, the rich text editor is not affected completely; and the data in the rich text editor can be independently edited, and all editing modules are not influenced at the moment.
And 106, exporting first data corresponding to the rich text editor and at least one group of second data corresponding to at least one edited editing module.
Alternatively, both the first data and the second data may be hypertext markup language (html) text.
And 108, rendering the page based on the first data and at least one group of second data to obtain a rendered page.
In this embodiment, the page is rendered based on the first data and the at least one group of second data together, and the rendered page includes not only the content in the rich text editor but also the editing content in the editing module.
Based on the method for expanding the page rich text editor provided by the embodiment of the disclosure, at least one editing module capable of independently editing is added in the rich text editor corresponding to the page in response to the received page editing instruction; editing in at least one editing module according to the module editing instruction to obtain at least one edited editing module; exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module; rendering the page based on the first data and at least one group of second data to obtain a rendered page; in the embodiment, the effect of visually editing the content in the rich text is realized by independently editing the editing module, but the editing process is not limited by the control of the rich text, and the change processing of events and content is flexible; the implementation allows new plug-ins in rich text form to be developed without the need to know the current editor implementation.
As shown in fig. 2, based on the embodiment shown in fig. 1, step 102 may include the following steps:
step 1021, inserting at least one placeholder element corresponding to the at least one editing module size in the data of the rich text editor.
Wherein each placeholder element corresponds to an editing module.
Optionally, adding an operation button in a toolbar of the rich text editor, and triggering the insertion of the editing module in the article by clicking the button; after an operation button is clicked, inserting at least one non-editable placeholder element into the rich text editor, wherein the size of each placeholder element is the same as that of one editing module; alternatively, the placeholder elements may be placeholderd using simple div tags.
And step 1022, covering the editing module corresponding to the at least one placeholder element to a position corresponding to the placeholder element.
In this embodiment, prop up the space of at least one editor module size in with rich text editor through simple placeholder element, insert the editor module element outside rich text editor simultaneously, through placeholder element's position and length and width, cover the editor module element in placeholder element top, realize that the editor module is located rich text editor in the visual effect.
Optionally, step 1022 in the above embodiments may include:
and covering the editing module corresponding to the at least one placeholder element to the position corresponding to the placeholder element through absolute positioning.
In this embodiment, the editing module is covered to the position corresponding to the placeholder element by using absolute positioning (absolute) in a positioning manner corresponding to the style file (CSS file), where absolute positioning refers to that an element is separated from the document stream and is directly positioned with respect to the nearest positioned ancestor element; by adopting absolute positioning, the effect that the editing module is positioned in the rich text editor is visually presented, and the placeholder elements are completely covered.
As shown in fig. 3, based on the embodiment shown in fig. 1, step 104 may include the following steps:
step 1041, in response to the click event to the at least one editing module obtained by monitoring, adjusting the state of the at least one editing module to an editing state, and adjusting the state of the rich text editor to a read-only state.
Alternatively, the click event may be an onClick event.
And 1042, controlling at least one editing module to receive the edited content according to the module editing instruction in the editing state to obtain the edited at least one editing module.
In the embodiment, an onClick event of an editing module is monitored, when the editing module is clicked, the rich text editor is set to be in a read-only state, namely, the event in a rich text editing area is not processed any more, the editing module is set to be in an editing state, a cursor is set into the editing module at the same time, at the moment, the editing content is received only through the editing module, editing operation is performed in the editing module, all operation support degrees depend on the function realization of the editing module, and the operation support degrees are not restricted and limited by the rich text editor; the independent editing of the editing module is realized, the editing process is not influenced by a rich text editor, and the content processing of the editing module is more flexible.
In some optional embodiments, the method provided in this embodiment may further include:
responding to the monitoring to obtain a focus losing event of at least one editing module, adjusting the state of at least one editing module to be a read-only state, and adjusting the state of a rich text editor to be an editing state;
and controlling the rich text editor to receive the edited content according to the text editing instruction in an editing state to obtain the edited rich text editor.
In this embodiment, by monitoring, when a focus lost event (onBlur event) of the editing module is monitored, that is, a non-editing module area is clicked, the editing module is set to be in a read-only state, the rich text editor is set to be in an editing state, and data in the editing module is stored for subsequent export; in the embodiment, flexible editing switching is realized by monitoring events, i.e. editing can be performed in an editing module or a rich text editor, and the two are mutually exclusive, i.e. only one editing module or rich text editor can be used for editing at the same time.
As shown in fig. 4, based on the embodiment shown in fig. 1, step 108 may include the following steps:
step 1081, at least one placeholder data corresponding to at least one placeholder element included in the first data is determined.
In this embodiment, since at least one placeholder element is added to the rich text editor before editing, and the editing module and the rich text editor are independent of each other, only placeholder data corresponding to the added placeholder element is included in the first data.
And step 1082, replacing at least one of the placeholder data with at least one set of second data to obtain the replaced complete data.
Alternatively, the first data and the second data may be hypertext markup language (html) text, html being a markup language that includes a series of tags by which documents on the network may be formatted in a uniform manner to connect the dispersed Internet resources into a logical whole. html text is descriptive text consisting of html commands that can specify words, graphics, animations, sounds, tables, links, etc.
And step 1083, rendering the page based on the complete data to obtain a rendered page.
In this embodiment, in order to achieve the effect that the rendered page is edited, the content edited by at least one editing module needs to be inserted into the rich text editor, and in this embodiment, the second data corresponding to the at least one editing module is replaced into the place occupying data corresponding to the at least one editing module, so that the obtained complete data is equivalent to the effect that all edits are completed in the rich text editor, and further, the page rendered based on the complete data realizes displaying all editing processing results. And the corresponding html code can be stored when the data is stored, so that the occupied div needs to be replaced by the html code of the editing module when the data is stored, and the effect of directly rendering the document by using the html code in a non-editing state is ensured to be consistent with the effect of the editing state.
Fig. 5 is a flowchart illustrating an expanding method of a page rich text editor provided by another exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device, as shown in fig. 5, and includes the following steps:
step 502, in response to receiving a page editing instruction, adding at least one editing module capable of independently editing in a rich text editor corresponding to a page.
The technical implementation and technical effect of this step can refer to step 102 in the embodiment provided in fig. 1, and are not described herein again.
And 504, editing in at least one editing module according to the module editing instruction to obtain at least one edited editing module.
The technical implementation and technical effect of this step in this embodiment can refer to step 104 in the embodiment provided in fig. 1, and are not described herein again.
Step 506, exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module.
The technical implementation and technical effect of this step in this embodiment can refer to step 106 in the embodiment provided in fig. 1, and are not described herein again.
And step 508, rendering the page based on the first data and the at least one group of second data to obtain a rendered page.
The technical implementation and technical effect of this step in this embodiment can refer to step 108 in the embodiment provided in fig. 1, and are not described herein again.
Step 510, in response to receiving a first update instruction to edit the rendered page.
After the rendering of the page is completed, the embodiment has completed the rendering process of a complete page, and on this basis, if an update operation (modification, deletion, addition, and the like) needs to be performed on the rendered page, a first update instruction is received, and complete data is obtained according to the first update instruction.
And step 512, obtaining complete data corresponding to the rendered page.
For a page needing to be updated, first obtaining complete data corresponding to the page, wherein the data comprises first data corresponding to a rich text editor and second data corresponding to at least one editing module.
Based on the complete data, a rich text editor having at least one editing module is obtained, step 514.
Optionally, the rich text editor and the at least one editing module can be separated from the complete data by decomposition, so as to realize mutually independent editing between the rich text editor and the editing module in the updating editing process.
And 516, updating at least one editing module and/or rich text editor according to the second updating instruction.
After the relatively independent rich text editor and the at least one editing module are obtained, when updating operation is performed, the at least one editing module can be independently processed, or the rich text editor can be independently processed, or the at least one editing module and the rich text editor can be respectively processed through event switching, and a specific updating processing process refers to a process of editing according to event monitoring in the embodiment; and performing specific updating operation (modification, deletion, addition and the like) on the rendered page according to the second updating instruction.
And 518, exporting the updated data corresponding to the at least one editing module and/or the rich text editor, and rendering the page based on the updated data to obtain the updated page.
The rendering process in this step may refer to the rendering processes in steps 106 and 108 in the above embodiments, and will not be described herein again.
When the page needs to be updated, the complete data corresponding to the page is decomposed again to generate the rich text editor and the at least one editing module, so that more flexible page content change is realized.
Optionally, step 514 in the above embodiment may include:
decomposing the complete data to obtain at least one group of second data and first data;
inputting the first data into a rich text editor corresponding to the page;
rendering at least one group of second data in sequence to obtain at least one editing module;
and covering at least one editing module to a position corresponding to at least one placeholder element in the rich text editor to obtain the rich text editor with at least one editing module.
In this embodiment, when an existing page is updated and edited, a code (second data) segment corresponding to an editing module in an html code needs to be identified, a specific identification process may be performed according to parameter identification set at a code position corresponding to each editing module when complete data is stored, and when each second data needs to be identified, the position of each second data can be determined by identifying the set parameters, and then at least one second data is obtained by decomposition; and replacing the position of the original second data with the placeholder element, and covering an editable editing module on the upper layer to update the content in at least one editing module covered on the rich text editor.
Optionally, decomposing the complete data to obtain at least one set of second data and first data, including:
identifying and extracting at least one group of second data corresponding to at least one editing module from the complete data according to the set parameters corresponding to the at least one editing module;
and replacing the position corresponding to at least one group of second data in the complete data with at least one placeholder element to obtain first data corresponding to the rich text editor.
In this embodiment, in order to identify at least one group of second data in the complete data, when the second data is combined with the first data, a setting parameter for identifying a position of each editing module may be added to each group of second data; moreover, in order to realize that the obtained rich text editor can also be covered with at least one editing module, after at least one group of second data in the perfected data is extracted, the corresponding position is replaced with a corresponding placeholder element, so that a position which can be covered by at least one editing module is reserved in the rich text editor generated based on the replaced first data, and the independent content updating in the editing module is realized in the embodiment, and the page content can be updated through the editing module on the premise of not knowing the realization of the current editor.
Any of the page rich text editor extension methods provided by the embodiments of the present disclosure may be performed by any suitable device having data processing capabilities, including but not limited to: terminal equipment, a server and the like. Alternatively, any of the page rich text editor extension methods provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor may execute any of the page rich text editor extension methods mentioned by the embodiments of the present disclosure by calling a corresponding instruction stored in a memory. And will not be described in detail below.
Exemplary devices
Fig. 6 is a schematic structural diagram of an expansion apparatus of a page rich text editor provided in an exemplary embodiment of the present disclosure. As shown in fig. 6, the apparatus provided in this embodiment includes:
and the editing extension module 61 is used for responding to the received page editing instruction, and adding at least one editing module which can be independently edited in the rich text editor corresponding to the page.
And the instruction response module 62 is configured to edit in at least one editing module according to the module editing instruction, so as to obtain at least one edited editing module.
And a data export module 63, configured to export first data corresponding to the rich text editor and at least one group of second data corresponding to the at least one edited editing module.
And a page rendering module 64, configured to render the page based on the first data and the at least one group of second data, so as to obtain a rendered page.
Based on the extension device of the page rich text editor provided by the above embodiment of the present disclosure, in response to receiving a page editing instruction, at least one editing module capable of independently editing is added in the rich text editor corresponding to a page; editing in at least one editing module according to the module editing instruction to obtain at least one edited editing module; exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module; rendering the page based on the first data and at least one group of second data to obtain a rendered page; in the embodiment, the effect of visually editing the content in the rich text is realized by independently editing the editing module, but the editing process is not limited by the control of the rich text, and the change processing of events and content is flexible; the implementation allows new plug-ins in rich text form to be developed without the need to know the current editor implementation.
Optionally, the editing extension module includes:
the placeholder unit is used for inserting at least one placeholder element corresponding to the size of the at least one editing module into the data of the rich text editor; each placeholder element corresponds to one editing module;
and the module covering unit is used for covering the editing module corresponding to the at least one placeholder element to the position corresponding to the placeholder element.
Optionally, the module overlay unit is specifically configured to overlay the editing module corresponding to the at least one placeholder element to the position corresponding to the placeholder element through absolute positioning.
Optionally, the instruction response module is specifically configured to, in response to a click event of the at least one editing module obtained through monitoring, adjust a state of the at least one editing module to an editing state, and adjust a state of the rich text editor to a read-only state; and controlling at least one editing module to receive the editing content according to the module editing instruction in an editing state to obtain at least one edited editing module.
Optionally, the apparatus provided in this embodiment further includes:
the rich text editing module is used for responding to the monitoring to obtain the focus losing event of the at least one editing module, adjusting the state of the at least one editing module to be a read-only state, and adjusting the state of the rich text editor to be an editing state; and controlling the rich text editor to receive the edited content according to the text editing instruction in an editing state to obtain the edited rich text editor.
Optionally, the page rendering module is specifically configured to determine at least one placeholder data corresponding to at least one placeholder element included in the first data; replacing at least one piece of placeholder data with at least one piece of second data to obtain replaced complete data; and rendering the page based on the complete data to obtain the rendered page.
Optionally, the apparatus provided in this embodiment further includes:
the updating instruction module is used for responding to a first updating instruction for editing the rendered page;
the data acquisition module is used for acquiring complete data corresponding to the rendered page;
the data decomposition module is used for obtaining a rich text editor with at least one editing module based on the complete data;
the updating processing module is used for updating at least one editing module and/or rich text editor according to the second updating instruction;
and the updating and rendering module is used for exporting the updated data corresponding to the at least one editing module and/or the rich text editor, and rendering the page based on the updated data to obtain the updated page.
Optionally, the data decomposition module is specifically configured to decompose the complete data to obtain at least one group of second data and first data; inputting the first data into a rich text editor corresponding to the page; rendering at least one group of second data in sequence to obtain at least one editing module; and covering at least one editing module to a position corresponding to at least one placeholder element in the rich text editor to obtain the rich text editor with at least one editing module.
Optionally, the data decomposition module is configured to identify and extract at least one group of second data corresponding to at least one editing module from the complete data according to a setting parameter corresponding to the at least one editing module when the complete data decomposition is performed to obtain the at least one group of second data and the first data; and replacing the position corresponding to at least one group of second data in the complete data with at least one placeholder element to obtain first data corresponding to the rich text editor.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 7. The electronic device may be either or both of the first device 100 and the second device 200, or a stand-alone device separate from them that may communicate with the first device and the second device to receive the collected input signals therefrom.
FIG. 7 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure.
As shown in fig. 7, the electronic device 70 includes one or more processors 71 and a memory 72.
The processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 70 to perform desired functions.
Memory 72 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 71 to implement the method for extending the page rich text editor of the various embodiments of the present disclosure described above and/or other desired functionality. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 70 may further include: an input device 73 and an output device 74, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, when the electronic device is the first device 100 or the second device 200, the input device 73 may be a microphone or a microphone array as described above for capturing an input signal of a sound source. When the electronic device is a stand-alone device, the input means 73 may be a communication network connector for receiving the acquired input signals from the first device 100 and the second device 200.
The input device 73 may also include, for example, a keyboard, a mouse, and the like.
The output device 74 may output various information including the determined distance information, direction information, and the like to the outside. The output devices 74 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 70 relevant to the present disclosure are shown in fig. 7, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device 70 may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method for extending a page rich text editor according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method for extending a page rich text editor according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A method for expanding a page rich text editor is characterized by comprising the following steps:
in response to receiving a page editing instruction, adding at least one editing module which can be independently edited in a rich text editor corresponding to a page;
editing in the at least one editing module according to the module editing instruction to obtain at least one edited editing module;
exporting first data corresponding to the rich text editor and at least one group of second data corresponding to the edited editing module;
rendering a page based on the first data and the at least one group of second data to obtain a rendered page.
2. The method according to claim 1, wherein adding at least one editing module capable of independently editing in the rich text editor corresponding to the page comprises:
inserting at least one placeholder element corresponding to the at least one edit module size in data of the rich text editor; each placeholder element corresponds to one editing module;
and covering the editing module corresponding to at least one placeholder element to a position corresponding to the placeholder element.
3. The method of claim 2, wherein overlaying the edit module corresponding to the at least one placeholder element to a location corresponding to the placeholder element comprises:
and covering the editing module corresponding to at least one placeholder element to the position corresponding to the placeholder element through absolute positioning.
4. The method according to any one of claims 1-3, wherein said editing in said at least one editing module according to module editing instructions to obtain an edited at least one editing module comprises:
responding to a click event of the at least one editing module obtained by monitoring, adjusting the state of the at least one editing module to be an editing state, and adjusting the state of the rich text editor to be a read-only state;
and controlling the at least one editing module to receive the edited content according to the module editing instruction in an editing state to obtain the edited at least one editing module.
5. The method of any of claims 1-4, further comprising:
responding to the monitored focus losing event of the at least one editing module, adjusting the state of the at least one editing module to be a read-only state, and adjusting the state of the rich text editor to be an editing state;
and controlling the rich text editor to receive the edited content according to the text editing instruction in the editing state to obtain the edited rich text editor.
6. The method according to any of claims 1-5, wherein said rendering the page based on the first data and the at least one set of second data to obtain a rendered page comprises:
determining at least one placeholder data corresponding to the at least one placeholder element included in the first data;
replacing the at least one placeholder data with the at least one second data to obtain replaced complete data;
and rendering the page based on the complete data to obtain the rendered page.
7. The method of any of claims 1-6, further comprising:
in response to receiving a first update instruction to edit the rendered page;
acquiring complete data corresponding to the rendered page;
obtaining a rich text editor having at least one editing module based on the complete data;
updating the at least one editing module and/or the rich text editor according to a second updating instruction;
and exporting the updated data corresponding to the at least one editing module and/or the rich text editor, and rendering the page based on the updated data to obtain the updated page.
8. The method of claim 7, wherein deriving a rich text editor having at least one editing module based on the integrity data comprises:
decomposing the complete data to obtain at least one group of second data and first data;
inputting the first data into a rich text editor corresponding to the page;
rendering the at least one group of second data in sequence to obtain at least one editing module;
and covering the at least one editing module to a position corresponding to the at least one placeholder element in the rich text editor to obtain the rich text editor with the at least one editing module.
9. The method of claim 8, wherein the decomposing based on the complete data to obtain at least one set of second data and first data comprises:
identifying and extracting at least one group of second data corresponding to the at least one editing module from the complete data according to the set parameters corresponding to the at least one editing module;
and replacing the position corresponding to the at least one group of second data in the complete data with at least one placeholder element to obtain first data corresponding to the rich text editor.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the method for expanding a rich text editor of a page as claimed in any one of the preceding claims 1 to 9.
CN202111143870.0A 2021-09-28 2021-09-28 Method and device for expanding page rich text editor, storage medium and electronic equipment Pending CN113867726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143870.0A CN113867726A (en) 2021-09-28 2021-09-28 Method and device for expanding page rich text editor, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143870.0A CN113867726A (en) 2021-09-28 2021-09-28 Method and device for expanding page rich text editor, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113867726A true CN113867726A (en) 2021-12-31

Family

ID=78991823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143870.0A Pending CN113867726A (en) 2021-09-28 2021-09-28 Method and device for expanding page rich text editor, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113867726A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309298A (en) * 2022-08-30 2022-11-08 医渡云(北京)技术有限公司 Text structuring method and device, medium and equipment based on rich text editor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309298A (en) * 2022-08-30 2022-11-08 医渡云(北京)技术有限公司 Text structuring method and device, medium and equipment based on rich text editor
CN115309298B (en) * 2022-08-30 2024-05-10 医渡云(北京)技术有限公司 Text structuring method and device based on rich text editor, medium and equipment

Similar Documents

Publication Publication Date Title
US10318628B2 (en) System and method for creation of templates
US8549395B2 (en) Method and system for transforming an integrated webpage
US6021416A (en) Dynamic source code capture for a selected region of a display
US10565293B2 (en) Synchronizing DOM element references
US9612715B2 (en) Real-time preview of uniform resource identifier addressable dynamic content
JP4344693B2 (en) System and method for browser document editing
US10387535B2 (en) System and method for selectively displaying web page elements
WO2009011837A1 (en) Extraction and reapplication of design information to existing websites
EP1816586A1 (en) Data processing system, data processing method, and management server
WO2014093407A2 (en) Appending content with annotation
US20090037801A1 (en) Method and apparatus for automatic user manual generation
CN113655999A (en) Rendering method, device and equipment of page control and storage medium
US10628526B2 (en) Providing suggested diagrammatic representations of user entered textual information
US6424978B1 (en) Formatting card-based hypermedia documents by automatic scripting
CN113867726A (en) Method and device for expanding page rich text editor, storage medium and electronic equipment
EP1826682A1 (en) Document managing device and document managing method
US8225217B2 (en) Method and system for displaying information on a user interface
CN112905944A (en) Page online dynamic generation method and device, electronic equipment and readable storage medium
CN117055987A (en) Webpage display method and device, electronic equipment and computer readable storage medium
US11526578B2 (en) System and method for producing transferable, modular web pages
US20150317404A1 (en) Accessing Content in a Rich Internet Application
CN114385946A (en) Data structure editing method and device, electronic equipment and storage medium
JP2004362343A (en) Source code conversion apparatus, source code conversion method, and program
US7428697B2 (en) Preserving content or attribute information during conversion from a structured document to a computer program
CN112068826A (en) Text input control method, system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220325

Address after: 100085 Floor 101 102-1, No. 35 Building, No. 2 Hospital, Xierqi West Road, Haidian District, Beijing

Applicant after: Seashell Housing (Beijing) Technology Co.,Ltd.

Address before: 101300 room 24, 62 Farm Road, Erjie village, Yangzhen Town, Shunyi District, Beijing

Applicant before: Beijing fangjianghu Technology Co.,Ltd.