Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Aiming at the technical problem that the requirements for editing the existing rich text are continuously increased, in some embodiments of the application, new text content, namely inline components, are added in a rich text field, the inline components are used as the text content in the rich text field, values and/or styles of the inline components can be dynamically changed, a rich text template is generated in advance based on the inline components, and then the rich text is generated based on the rich text template. The style of the in-line components in the rich text template can be flexibly adjusted by combining the characteristic that the style of the in-line components can be dynamically changed, different rich texts can be generated according to the same rich text template by combining the characteristic that the values of the in-line components can be dynamically changed, and the rich text editing is more flexible and is favorable for meeting the continuously increased rich text editing requirements.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
In the embodiment of the present application, a rich text editor is provided, which can be embedded in a browser and implemented by depending on the browser, and of course, can also be implemented as an independent software product. The rich text editor provided by the embodiment of the application not only supports common text content, but also supports at least one in-line component.
The inline components are the text content newly added in the rich text field in the embodiment of the application. Inline components, unlike plain text content in the rich text domain, are somewhat similar to front-end components in that attributes, methods, and events exist, but can exist in the rich text editor as plain text content, and their values and/or styles can be dynamically changed, and their styles and locations can be modified by the rich text editor.
After the inline components which can be edited like common text contents and have the properties, methods and events similar to the front-end components are added in the rich text field, the requirement of dynamic change can be met when contents such as names, ages, serial numbers and the like of people meet in the process of editing the rich text, and the requirement of the change of the style can be met when the style of some contents is required to be adjusted, so that the editing mode and flexibility of the rich text can be greatly enriched.
It is worth noting that the required inline components may be implemented in conjunction with the rich text application scenario before they are used. One or more inline components may be implemented according to the requirements of the rich text application scenario for inline components, with different kinds of inline components belonging to different text content in the rich text domain. For example, in some rich text application scenarios, at least one inline component of a variable component, a sequence number component, a reference sequence number component, a picture component, and a link component, among others, may be defined. For a detailed description of these inline components, reference may be made to the following examples, which are not intended to be detailed here.
The embodiment of the present application does not limit the manner for implementing inline components, and any manner capable of implementing inline components that can be edited by a rich text editor is applicable to the embodiment of the present application. The following embodiments of the present application provide a way to implement inline components, that is, implement at least one inline component using HyperText Markup Language (HTML) tags. Alternatively, the name and the attribute of the at least one inline component may be defined using HTML tags, and the method and the event of the at least one inline component are implemented based on the defined name and attribute of the at least one inline component, thereby obtaining the at least one inline component. Wherein inline components may be implemented using any HTML tag. For example, an input tag or div tag may be utilized to define the name and attributes of at least one inline component.
Taking the input tag as an example, data such as the name and attribute of the in-line component can be put into the data-tips attribute of the input tag. The view (view) layer of the in-row components is realized through the input label, the names and the properties of the in-row components are converted into json character strings which are bound on the data-props properties of the input label, and therefore, the integrity of data can still be kept after the in-row components are copied, cut, pasted and the like in rich text. In addition, the view layer of the inline component is realized by using an input tag, so that the view layer supports the native events and the custom events of all the input tags, and the events supported by the inline component can be realized based on the native events and the custom events; meanwhile, the method of the inline components is realized by a constructor of the inline components, each constructor of the inline components is a class containing a large number of static methods (for simulating events and methods), thereby better separating a view layer and a control layer, which enables the inline components to be inserted in the rich text editor, and the presentation form of the inline components in the rich text editor to be dynamically changed by the inline component constructor. Moreover, intra-row components can also communicate and be linked with each other.
Regardless, after the at least one in-line component is implemented, rich text editing may be performed based on the at least one in-line component. In the embodiment of the application, in order to fully utilize the characteristic that the values and/or styles of inline components can be dynamically changed, a rich text template can be generated based on the inline components, and then a rich text is generated according to the rich text template. The style of the in-line components in the rich text template can be flexibly adjusted by combining the characteristic that the style of the in-line components can be dynamically changed, different rich texts can be generated according to the same rich text template by combining the characteristic that the values of the in-line components can be dynamically changed, and the rich text editing is more flexible and is favorable for meeting the continuously increased rich text editing requirements.
The processes of generating the rich text template and generating the rich text based on the rich text template by the rich text editor will be described in detail below.
Fig. 1a is a schematic flowchart of a rich text processing method according to an exemplary embodiment of the present application. The method shown in fig. 1a mainly describes the process of generating a rich text template by a rich text editor. As shown in fig. 1a, the method comprises the steps of:
101. an editing interface is presented that includes an editing area and component icons for at least one in-row component.
102. At least one target component icon dragged into the editing region is determined in response to at least one component icon dragging operation.
103. And rendering at least one target in-row component corresponding to at least one target component icon into the editing area.
104. A rich text template is generated from at least one target inline component within the edit region.
In this embodiment, the rich text editor provides an editing interface that is an interface for the rich text editor to interact with a user, facilitating the user to edit a desired rich text or rich text template using the rich text editor. As shown in FIGS. 1b and 1c, the editing interface includes an editing area and component icons for at least one in-row component. In fig. 1b, the component icons and the editing area of at least one in-line component are arranged left and right, the component icons are located on the left side of the editing interface, and the editing area is located on the right side of the editing interface. In FIG. 1c, the component icons and the editing area of at least one in-line component are arranged in an upper and lower row, and the component icons are located at the upper part of the editing interface, and the editing area is located below the component icons. It is worth mentioning that. The layout style between the component icons and the edit section is not limited to that shown in fig. 1b and 1 c. Any interface format capable of presenting component icons and edit fields for at least one in-row component is suitable for use with embodiments of the subject application.
Alternatively, the component icons of at least one in-row component may be organized in a list, as shown in FIGS. 1b and 1 c. A component icon represents an in-row component, and there should be a difference between component icons of different in-row components to facilitate a user being able to distinguish between different in-row components by component icons. The component icons may be pictures, graphics, numbers, animations, etc. Furthermore, the component icons of the in-row components can be provided with marking information such as the names of the in-row components, so that a user can quickly identify the in-row components represented by the component icons.
For example, when a user opens the rich text editor, or the rich text editor enters foreground runtime from the background, the rich text editor may present its editing interface to the user. It is noted that, besides the component icons including the editing area and at least one in-line component, the editing interface may also include other tools or components related to rich text editing, such as fonts, font sizes, forward and backward functional components, and this embodiment of the present application is not described here.
Wherein the component icons on the editing interface support drag events. When a user needs to use a certain in-line component, the component icon corresponding to the in-line component can be dragged into the editing area, so that the in-line component corresponding to the component icon can be rendered into the editing area by the rich text editor. If the user needs to use a plurality of inline components, the component icons corresponding to the inline components can be dragged into the editing area, so that the inline components corresponding to the inline components can be rendered into the editing area by the rich text editor. It is worth noting that what the user drags into the editing area is a component icon, but what is actually shown in the editing area is an in-line component corresponding to the component icon.
Based on the above, when the rich text template is generated, the user may perform at least one component icon dragging operation to drag a component icon corresponding to at least one in-line component required in the rich text template into the editing area, so that the at least one in-line component required by the rich text template is rendered into the editing area. For a rich text editor, at least one component icon dragged into the editing region may be determined in response to at least one component icon dragging operation; and rendering at least one in-row component corresponding to the determined at least one component icon dragged into the editing area. For ease of description, the component icon dragged into the edit region is referred to as a target component icon, and the in-line component to which the target component icon corresponds is referred to as a target in-line component. Wherein a target component icon represents a target in-row component.
In an optional embodiment, the user performs a component icon drag-in operation, and the rich text editor responds to the component icon drag-in operation and renders the in-line component corresponding to the component icon into the editing area; and then, the user executes the next component icon dragging operation again and sequentially until the required in-line components in the rich text template are rendered into the editing area.
In another alternative embodiment, the user may continuously perform the component icon drag-in operation without considering the rendering result of the in-row component corresponding to the last component icon drag-in operation when performing the next component icon drag-in operation. For the rich text editor, component icon dragging operations which occur continuously can be recorded, then the dragging operations of all component icons are responded in sequence, corresponding inline components are rendered into the editing area one by one, or multithreading is started, the dragging operations of all component icons are responded in parallel, and the corresponding inline components are rendered into the editing area in parallel.
It should be noted that the at least one target inline component may include the same kind of inline component, that is, the same kind of inline component is dragged into the editing region multiple times. For example, if a rich text template requires multiple uses of the same inline component, the user may drag the component icon for that inline component into the editing region multiple times, such that the inline component is rendered into the editing region multiple times. Of course, the positions of the components in several rows in the same kind are different in the editing area, and the rendered styles may be the same or different. Similarly, if the inline components of the category need to be assigned values, values of the inline components of the category in the next several rows may be the same or different when the rich text is subsequently generated. Of course, the at least one target inline component may be a completely different kind of inline component, or may all be the same kind of inline component.
After rendering at least one target inline component required by the rich text template to the editing region, the rich text template may be generated from the at least one target inline component.
The rich text template may contain different content in different application scenarios. For example, in some application scenarios, the rich text template only includes at least one in-target in-line component, and then the at least one in-target in-line component in the editing region may be directly saved as the rich text template. For another example, in other application scenarios, the rich text template may include other text content besides the at least one in-target-line component, where the other text content mainly refers to common text content, and the common text content may be manually input, copied, pasted, or inserted into the editing area by the user. Based on this, at least one target inline component within the edit section may be saved as a rich text template along with other text content within the edit section.
In this embodiment, the rich text template may be in a structured format or an unstructured format. Optionally, when the rich text template is generated, the structured rich text template may be generated separately, the unstructured rich text template may be generated separately, or the structured rich text template and the unstructured rich text template may be generated simultaneously.
Taking the rich text template as an example, which includes at least one target inline element and other text contents at the same time, the name and attribute value of the at least one target inline element may be saved in one array field, and the other text contents may be saved in another array field, thereby obtaining the structured rich text template. In this way, dynamic modification of components within the target row is facilitated.
Taking the rich text template including at least one in-line target component and other text content as an example, the at least one in-line target component and other text content may be saved as a character string, so as to obtain an unstructured rich text template.
It is worth mentioning that for rich text templates containing at least one in-target component, it is proposed to generate both structured rich text templates and unstructured rich text templates. Of course, if only one rich text template can be generated, it is preferable to consider generating a structured rich text template for the case that at least one target inline component contains an inline component that needs to be assigned.
In one embodiment of the present application, the rich text editor supports at least one inline component, one component icon for each inline component, and having a name, method, attribute, and event. Where the inline component has a default attribute value. To associate a component icon on an interface with an in-row component, the component icon for each in-row component may be associated with the component name and component type for that in-row component when implemented. The component types herein are largely divided into inline and non-inline components.
Based on the above, when the rich text editor is launched or enters into foreground running from the background, an editing interface comprising an editing area and component icons of at least one in-line component can be presented to the user. When the user generates the rich text template, the component icons corresponding to the in-line components required by the rich text template can be dragged into the editing area, that is, the user can send out at least one component icon dragging operation. The rich text editor may determine at least one target component icon dragged into the editing region in response to at least one component icon dragging operation; determining at least one target in-row component corresponding to at least one target component icon according to the component name and the component type respectively associated with the at least one target component icon; further, rendering the at least one in-target-line component into the editing area according to the default attribute value of the at least one in-target-line component; a rich text template is then generated from at least one target inline component within the edit region. This embodiment is relatively simple, and the target in-row component may be rendered directly based on the default attribute values of the target in-row component without modifying the attribute values of the target in-row component.
Optionally, after determining at least one target component icon dragged into the editing area, a component name and a component type respectively associated with the at least one target component icon may be obtained; then, according to the component type associated with each of the at least one target component icon, determining whether the component corresponding to the at least one target component icon is an inline component (i.e. determining whether the inline component is dragged into the editing area); if it is determined that the component corresponding to the at least one target in-row component icon is an in-row component (i.e., it is determined that the in-row component is dragged into the editing region), the target in-row component corresponding to the at least one target component icon (i.e., it is determined that the target in-row component is dragged into the editing region) may be determined according to the component name associated with the at least one target component icon. And then, calling a rendering method corresponding to the in-target-line component dragged into the editing area, and rendering the in-target-line component into the editing area. The corresponding rendering method will be different for different intra-row elements.
In addition, the inline component in the embodiments of the present application has an event attribute, and can support various events, such as a click event, a long-press event, a mouse-over event, a double-click event, and the like. These events may be associated with operations that modify the attribute values of components within a row. Based on the method, when the rich text template is generated, if the attribute value of the in-line component needs to be modified, the rich text editor can be triggered to modify the attribute value of the in-line component through a specified event.
In an alternative embodiment, the rich text editor may determine at least one target component icon dragged into the editing region in response to at least one component icon drag operation; determining at least one target in-row component corresponding to at least one target component icon according to the component name and the component type respectively associated with the at least one target component icon; further, at least one target in-row component is rendered into the edit section according to the default attribute value of the at least one target in-row component. Before generating the rich text template, the user can modify the attribute value of any in-line component in the at least one target in-line component through a specified event, and the modified in-line component can be one or more.
For ease of description, it is assumed that the user needs to modify the attribute values of the components in the first target inline component, which is any inline component of the at least one target inline component. Then, the user may issue a specified event, such as a click event, a double click event, or a mouse-over event, etc., for the first in-target-line component within the edit region. For the rich text editor, the modifiable attribute items for the first in-target in-line component may be displayed in response to a specified event for the first in-target in-line component. In conjunction with FIG. 1b and FIG. 1c, a property area of the inline component is displayed on the editing interface, the property area displaying modifiable property items of the first target inline component.
The user may modify the modifiable attribute items of the components in the first target row. The rich text editor responds to the modification operation of the modifiable attribute items of the components in the first target row, and obtains a new attribute value of the components in the first target row; then, according to the new attribute value of the first target in-row component, re-rendering the first target in-row component into the editing area; a rich text template may then be generated from the first target in-line component re-rendered into the editing region and other non-re-rendered target in-line components.
Further optionally, after the property value of the component in the first target row is modified, the rich text editor needs to replace the default property value with a new property value, for example, write the new property value into the data-prop property of the input tag. The embodiment is relatively flexible, and allows a user to modify the attributes of the in-line components according to requirements, so that a rich text template meeting the requirements of the user is obtained.
It is noted that the modifiable attribute entries may vary according to the different types of inline components. Regardless of the type of inline component, its modifiable attribute entries may be divided into style attributes and non-style attributes. Style attributes refer to attributes that are related to the presentation style of the in-line components, and non-style attributes refer to attributes that are not related to the presentation style of the in-line components. The presentation style of the in-row components includes their size, shape, color, position, border, and the like.
Based on the above, if the modifiable attribute items of the in-first-target-row component include the style attribute, the new attribute value of the in-first-target-row component may include the style attribute value, and based on this, the style of the in-first-target-row component may be different before and after re-rendering. For example, prior to re-rendering, the bounding box of the component in the first target row is red; after re-rendering, the bounding box of the component in the first target row is green.
It is worth mentioning that in the process of generating the rich text template, the attribute value of at least one in-target-line component required by the rich text template may be modified to meet the rich text editing requirement. In addition, after the rich text template is generated, the rich text template can be opened to edit the rich text template again, and in the process of editing the rich text template again, the attribute values of the components in at least one target line contained in the rich text template can be modified. After the rich text template is opened, at least one target in-line component contained in the rich text template is re-rendered into an editing area of an editing interface, for this reason, a user can send out a specified event aiming at the target in-line component needing to be modified (taking the first target in-line component as an example here), and the rich text editor responds to the specified event aiming at the first target in-line component and displays a modifiable attribute item of the first target in-line component, as shown in FIG. 1b and FIG. 1 c; further, responding to the modification operation of the user on the modifiable attribute items of the components in the first target row, and acquiring a new attribute value of the components in the first target row; and according to the new attribute value of the component in the first target row, re-rendering the component in the first target row into the editing area, and further completing re-editing of the rich text template.
It is worth noting that when the modifiable attribute items of the first target inline component are modified, either during the rich text template generation process or during the re-editing process of the rich text template, there may be other inline components associated with the first target inline component in the current rich text template or other rich text templates, and the attribute values between these associated inline components may affect each other. For example, taking the sequence number component in the current rich text template as an example, after the border color of the sequence number in a certain position is changed, the border colors of the sequence numbers in other positions need to be adaptively modified to maintain consistency of sequence number patterns. For another example, still taking the sequence number component in the current rich text template as an example, when the hierarchy to which the sequence number of a certain location belongs changes, the hierarchy of the sequence numbers of other locations that need to belong to the same hierarchy also needs to be changed adaptively, for example, the sequence number 3.1.1 changes to the sequence number 3.1, and correspondingly, the sequence number 3.1.2 needs to change to the sequence number 3.2.
Based on the above analysis, in response to the modification operation on the modifiable attribute items of the components in the first target row, besides acquiring the new attribute value of the components in the first target row and re-rendering the components in the first target row to the editing area according to the new attribute value of the components in the first target row, the attribute values of the components in the rich text template or other rich text templates to which the components in the first target row belong and in other rows associated with the components in the first target row can be modified in association, so as to realize linkage between the components in the rows.
Taking a rich text application scenario as an example, assume that input tags are used to define the following inline components: variable components, sequence number components, reference sequence number components, picture components, link components, and the like. The meaning of the components in each row and their attributes are briefly described below:
and (3) variable components: the method is used for realizing the content which needs to be dynamically changed according to different situations in the rich text field, such as staff names, salaries and the like. Variable components may have attributes such as alias, value displayed, hidden for null, display condition, etc. Alias: the default is to use the "value displayed" in the attribute as the display text of the inline component, but filling out the alias will preferentially use the alias as the display text. The values displayed are: the value of the variable component is obtained, and the value of the parameter provided by the service end can be assigned to the variable component through the formula editor, so that the association between the variable component and the service end is established. Hiding for null: the attribute may be selected to be active or inactive, and if the attribute is inactive, the variable name is displayed by default. The display conditions are as follows: when a certain condition is met, the rendering result of the variable component is displayed in the editing area. When the display is not in stand, the following display is displayed: when the 'display condition' is not satisfied, the rendering result of the variable component is displayed in the editing area, and vice versa when the 'display condition' is satisfied.
Sequence number component: for adding a sequence number to the content in the rich text field. The sequence number component may have attributes of grouping, hierarchy, format, capitalization, reference names, display conditions, and the like. Grouping: the grouping to which the sequence numbers belong may be defined, and a plurality of sequence numbers may be set to the same group, so that the sequence numbers may be linked, for example, when a certain sequence number is clicked, all the sequence numbers in the group are highlighted at the same time. And (3) hierarchy: a hierarchy of ordinal numbers is defined, e.g., hierarchy 1, ordinal number shown as 1, hierarchy 2, ordinal number shown as 1.1, etc. The format is as follows: the format of the serial number is limited, for example, the serial number can be in the format of arabic numerals, roman numerals, english serial numbers, and the like. Capital letters: the device is used for limiting the case of the serial number under the condition of selecting the English serial number; if the capital property of the letter is activated, the sequence number can adopt the capital letter, such as A, A.B and the like; if the capital letter attribute is not activated, the sequence number will be in lower case letters, such as a, a.b, etc. Reference name: the serial number is the unique identifier of the serial number and is mainly used for being associated with a reference serial number component. The display conditions are as follows: when the set conditions are met, the rendering result of the serial number component is displayed in the editing area.
Reference number component: associated with the sequence number component is a reference to the sequence number in the sequence number component. For example, 1.1 in "chapter 1.1" is a serial number, and "this is a reference number as in the above chapter 1.1". The reference serial number is disassociated from the referenced serial number according to the reference name, and the rendering result of the reference serial number is displayed as the value of the referenced serial number. The reference number component may have attributes such as reference name, display condition, etc. Reference name: for association with a referenced sequence number is the reference name of the referenced sequence number.
A picture assembly: for adding pictures in the rich text field, it will also have some attributes of its own, such as picture format, size, etc. A linking component: for adding links in the rich text field, it will also have some attributes of its own, such as the format of the link address, etc.
On the basis of the in-line components, when the rich text editor is started, a style of an editing interface provided for a user is shown in fig. 2 a. As shown in fig. 2a, the editing interface includes: a basic tools area, an editing area, a component area, and an attributes area. The basic tool area is positioned at the top of the editing interface and mainly comprises basic text editing tools such as fonts, word sizes, line heights, indentation and the like. The middle part of the editing interface is an editing area, the left side of the editing area is a component area, and the right side of the editing area is a property area. As shown in FIG. 2a, in this embodiment, the component area includes block-level components and inline components, and the block-level components refer to components defining text formats, mainly including containers, tables, rich text, page breaks, and the like; the inline component is a text content, and mainly comprises icons such as a variable component, a sequence number component, a reference sequence number component, a picture component, a link component and the like. The property area primarily shows modifiable property items for in-row components that the user needs to modify. In fig. 2a, taking the intra-row component that the user needs to modify as an example, the attribute area shows the alias of the variable component, the hidden option as empty, the displayed content, the display condition, and other attribute items.
To generate a recruitment offer template, the user may select a component icon for a desired intra-row component from the left intra-row components and drag it into the edit area. Assuming that the user drags an icon of a variable component into the editing area, the rich text editor determines that the inline component corresponding to the component icon dragged into the editing area is the variable component, and then calls a rendering method of the variable component to render the variable component into the editing area, wherein the variable component comprises the employee name, as shown in fig. 2 b. Next, as shown in fig. 2b, assuming that the user drags an icon of another variable component into the editing area, the rich text editor determines that the inline component corresponding to the component icon dragged into the editing area is a variable component, and then calls a rendering method of the variable component to render the variable component into the editing area, wherein the variable component comprises the english name of the sign-up company. Then, assuming that the user drags the icon of the sequence number component into the editing area, the rich text editor determines that the inline component corresponding to the component icon dragged into the editing area is the sequence number component, and then calls a rendering method of the sequence number component to render the sequence number component into the editing area, wherein the variable component comprises a sequence number 1: x, sequence number 2: XX, serial No. 3: x, and the like. The following of these serial numbers are some common text contents, which are contents with common properties, such as job description, company system, and privacy principle. During this time, the user can modify the property values of the sequence number components through the property area on the right side of the editing interface shown in FIG. 2 b. As shown in FIG. 2b, the property items of the sequence number component, such as grouping, hierarchy, format, reference name, etc., can be modified through the property area on the right.
After the inline components and other common text contents required by the offer template are all input into the editing area and the attribute values of the inline components are adjusted, the inline components and other common text contents in the editing area can be respectively stored into different array fields, and the structured offer template is obtained.
After the rich text template is generated, the rich text template can be published externally so as to be convenient for the service end to use the rich text template. For example, the recruitment offer template can be published to the personnel part of the company, so that the colleagues in the personnel department can directly call the recruitment offer template to quickly generate different offer documents for different application personnel. In order to facilitate the service end to use the rich text template, after the rich text template is generated, a name or an ID and other identifiers can be allocated to the rich text template, and when the rich text template is issued to the outside, information such as the identifier, the brief introduction and the participation of the rich text template can be issued.
As can be seen from the above examples, when a user edits a rich text template (e.g., Offer template, mail template), it is often necessary to have some dynamic variables in the components, such as person name, age, etc., which are different from person to person. Or article number, the number often needs to be changed dynamically when the user modifies the sequence of chapters. In the embodiment of the application, the problem can be easily solved by utilizing the characteristic that the value and/or the style of the inline component can be dynamically changed; in addition, some complex logics such as style change, linkage, dynamic data acquisition and the like can be processed through the attributes, methods and events of the in-line components, so that rich text editing modes are greatly enriched, and the flexibility is improved.
Based on the generated rich text template, the exemplary embodiment of the present application provides another rich text processing method, which mainly describes a process of generating rich text based on the rich text template. As shown in fig. 3, the method mainly includes the following steps:
301. and receiving the rich text template identification sent by the service end.
302. And determining a target rich text template from at least one rich text template according to the rich text template identification.
303. And obtaining the rich text required by the service end according to the target rich text template.
304. And sending the rich text to the service end for the service end to use.
In this embodiment, the service end refers to a computer device that needs to generate a rich text by using a rich text template, and the computer device may be a mobile phone, a PC, or the like. When a rich text template needs to be used, a rich text template identification can be sent to the rich text editor, and the rich text template identification represents the rich text template required by the service end. Optionally, in this embodiment, the at least one rich text template may be generated in advance based on the at least one in-line component. At least one inline component belongs to the text content in the rich text field, and the value and/or style thereof can be dynamically changed, and the detailed description thereof can be referred to the foregoing embodiments.
After receiving the rich text template identifier sent by the service end, the rich text editor can determine a target rich text template from at least one rich text template according to the rich text template identifier; then obtaining a rich text required by the service end according to the target rich text template; and sending the rich text to the service end for the service end to use. The process of generating the rich text is relatively simple and efficient no matter at the service end or for the rich text editor.
In an alternative embodiment, the format of the rich text template may not be the same as that of the target rich text template in consideration of the rich text format supported by the service terminal. Based on the method, the rich text editor can render the target rich text template into the rich text according to the rich text format supported by the service end. For example, the target rich text template is rendered into an HTML document or a PDF document, etc.
In some alternative embodiments, the target rich text template does not require incoming parameters. In this case, after determining the target rich text template, the rich text editor may render the target rich text template into the rich text directly according to a rich text format supported by the service end.
In other alternative embodiments, the target rich text template requires incoming parameters, e.g., the target rich text template contains variant components. In this case, the rich text editor will also receive the rich text template parameters sent by the service end, and the rich text template parameters include parameter names and parameter values. The parameter name here has a corresponding relationship with the name of the component in the row in the target rich text template, for example, the parameter name is the name of the component in the row. Then, the rich text editor can determine inline components to be assigned in the target rich text template according to the parameter names of the rich text template in the parameters; and then, according to the parameter values in the rich text template parameters, assigning the in-line components to be assigned. For example, take the recruitment 0ffer template as an example, assign the employee name and assign the company name. And then, the rich text editor can render the assigned target rich text template into a rich text according to a rich text format supported by the service end.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subjects of steps 101 to 104 may be device a; for another example, the execution subject of steps 101 and 103 may be device a, and the execution subject ofstep 104 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Fig. 4 is a schematic structural diagram of an apparatus 400 provided in an exemplary embodiment of the present application. As shown in fig. 4, the apparatus 400 includes:memory 41,processor 42, andcommunication component 43.
Amemory 41 for storing the computer program and may be configured to store other various data to support operations on the device. Examples of such data include instructions for any application or method operating on the device, contact data, phonebook data, messages, pictures, videos, and so forth.
And thecommunication component 43 is configured to receive the rich text template identifier sent by the service end.
Aprocessor 42, coupled to thememory 41, for executing the computer program in thememory 41 to: determining a target rich text template from at least one rich text template according to the rich text template identification; and obtaining the rich text required by the service end according to the target rich text template.
Thecommunication component 43 is further configured to send the rich text to the service end for use by the service end.
Optionally, when obtaining the rich text required by the service end according to the target rich text template, theprocessor 42 is specifically configured to: and rendering the target rich text template into a rich text according to a rich text format supported by the service end.
Further optionally, thecommunication component 43 is further configured to receive a rich text template entry sent by the service end, where the rich text template entry includes a parameter name and a parameter value. Based thereon,processor 42 is further configured to: before the target rich text template is rendered into a rich text, determining in-line components to be assigned in the target rich text template according to parameter names of the rich text template in parameters; and assigning the inline components to be assigned according to the parameter values in the rich text template parameters.
Further optionally, theprocessor 42 is further configured to: generating at least one rich text template based on the at least one inline component; at least one inline component belongs to the text content in the rich text field, and the value and/or the style of the inline component can be dynamically changed. For a process of generating at least one rich text template based on at least one inline component, reference may be made to the description in the foregoing embodiments, and details are not repeated here.
Further, as shown in fig. 4, the apparatus 400 further includes:display 44,power supply 45,audio 46, and other components. Only some of the components are schematically shown in fig. 4, and the apparatus 400 is not meant to include only the components shown in fig. 4.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program can implement the steps in the method embodiment described above and illustrated by fig. 3 when executed.
Fig. 5 is a schematic structural diagram of an apparatus 500 according to an exemplary embodiment of the present application. As shown in fig. 5, the apparatus 500 includes:memory 51,processor 52 anddisplay 53.
Thememory 51 is used to store computer programs and may be configured to store other various data to support operations on the device. Examples of such data include instructions for any application or method operating on the device, contact data, phonebook data, messages, pictures, videos, and so forth.
Aprocessor 52 coupled to thememory 51 for executing the computer program in thememory 51 for:
presenting an editing interface via thedisplay 53, the editing interface comprising an editing area and component icons for at least one in-row component;
in response to at least one component icon drag-in operation, determining at least one target component icon dragged into the editing area;
rendering at least one target in-row component corresponding to at least one target component icon into the editing area;
generating a rich text template according to at least one target inline component in the editing area; at least one inline component belongs to the text content in the rich text field, and the value and/or the style of the inline component can be dynamically changed.
Optionally, when rendering at least one in-target-row component corresponding to at least one target component icon into the editing region, theprocessor 52 is specifically configured to: determining at least one target in-row component according to the component name and the component type respectively associated with at least one target component icon; rendering at least one target in-row component into the edit section according to the default attribute value of the at least one target in-row component.
Further, theprocessor 52 is further configured to display, via thedisplay 53, modifiable attribute items of the components in the first target row in response to a specified event for the components in the first target row, before generating the rich text template from the at least one component in the target row in the editing area, or during re-editing the rich text template after generating the rich text template; responding to the modification operation of the modifiable attribute items of the components in the first target row, and acquiring new attribute values of the components in the first target row; re-rendering the components in the first target row into the editing area according to the new attribute values of the components in the first target row; wherein the first target inline component is any inline component of the at least one target inline component.
Further,processor 52 is also configured to replace the default attribute value of the component in the first target row with the new attribute value.
Optionally, if the new attribute value of the component in the first target row includes a style attribute value, the style of the component in the first target row before and after re-rendering is different.
Further, theprocessor 52 is configured to perform an associated modification on the property values of the other in-line components associated with the first target in-line component in the rich text template or other rich text templates in response to a modification operation on the modifiable property items of the first target in-line component.
Optionally, when determining the at least one component in the target row according to the component name and the component type respectively associated with the at least one target component icon, theprocessor 52 is specifically configured to: determining whether the component corresponding to the at least one target component icon is an in-row component or not according to the component type respectively associated with the at least one target component icon; and if the component corresponding to the at least one target component icon is the in-line component, determining the target in-line component corresponding to the at least one target component icon according to the component name associated with the at least one target component icon.
Optionally, when theprocessor 52 generates the rich text template according to at least one target inline component in the editing region, it is specifically configured to: at least one target inline component within the edit region is saved as a rich text template along with other text content within the edit region.
Further, theprocessor 52, when saving the at least one target intra-row component in the editing region as the rich text template together with the other text content in the editing region, is specifically configured to:
storing the name and the attribute value of the component in at least one target line into an array field, and storing other text contents into another array field to obtain a structured rich text template;
and/or
And saving the at least one target inline component and other text contents as character strings to obtain the unstructured rich text template.
Optionally, theprocessor 52, before presenting the editing interface through thedisplay 53, is further configured to: and defining the name and the attribute of the at least one inline component by using the HTML tag, and realizing the method and the event of the at least one inline component based on the name and the attribute of the at least one inline component to obtain the at least one inline component.
For example,processor 52 may define at least one in-line component name and attribute using an input tag or div tag.
Optionally, the at least one inline component comprises: at least one of a variable component, a sequence number component, a reference sequence number component, a picture component, and a link component.
Further, as shown in fig. 5, the apparatus 500 further includes:communication components 54,power components 55,audio components 56, and the like. Only some of the components are schematically shown in fig. 5, and the apparatus 500 is not meant to include only the components shown in fig. 5.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program can implement the steps in the method embodiment described above and illustrated by fig. 1 a.
In addition to providing the above apparatus, method, and storage medium, an embodiment of the present application further provides a rich text editor, where the rich text editor includes: an editing interface comprising an editing area and component icons for at least one in-row component. Wherein the editing interface is configured to determine at least one target component icon dragged into the editing region in response to at least one component icon dragging operation; rendering at least one target in-row component corresponding to the at least one target component icon into the editing area; generating a rich text template according to at least one target inline component in the editing area; at least one inline component belongs to the text content in the rich text field, and the value and/or the style of the inline component can be dynamically changed.
Besides the above operations, the editing interface may also perform other operations in the rich text template generation process, and the other operations may refer to the description of the foregoing embodiment and are not described herein again.
The memories of fig. 4 and 5 may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The communication components of fig. 4 and 5 described above are configured to facilitate wired or wireless communication between the device in which the communication component is located and other devices. The device in which the communication component is located may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may further include a Near Field Communication (NFC) module, Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and the like.
The display screens in fig. 4 and 5 described above include screens, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The power supply components of fig. 4 and 5 described above provide power to the various components of the device in which the power supply components are located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
The audio components of fig. 4 and 5 described above may be configured to output and/or input audio signals. For example, the audio component includes a Microphone (MIC) configured to receive an external audio signal when the device in which the audio component is located is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.