A web document editing method, device, terminal and storage medium

By receiving web document operations in the application, obtaining environment information and updating toolbar options, the problem of web document editing complexity is solved, and the online editing of web documents and the user experience is improved.

CN110728112BActive Publication Date: 2025-05-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910959890.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-10
Publication Date
2025-05-06
Estimated Expiration
2039-10-10

AI Technical Summary

Technical Problem

The prior art cannot effectively reduce the complexity of the web document editing process and the user experience is poor.

Method used

By receiving the actions performed on the web document displayed in the web view of the application, obtaining the environment information of the current web document, determining whether to display the toolbar view according to the operation location, and updating the tool options in the toolbar to realize online editing of the web document.

Benefits of technology

It realizes online editing of web documents, reduces the complexity of the document editing process and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110728112B_ABST
    Figure CN110728112B_ABST
Patent Text Reader

Abstract

The present invention provides a web document editing method, device, terminal and storage medium, which receive a first operation performed on a web document displayed in a web view of an application; obtain environmental information of the current web document, and determine whether to display a toolbar view in the application according to the environmental information; if it is determined to display the toolbar view in the application, update the document format indicated by the tool options in the toolbar generated based on the native program of the application to the target document format indicated by the environmental information to obtain a target toolbar, and display the toolbar view loaded with the target toolbar in the application, so as to realize online editing of the web document based on the interaction between the target toolbar and the web document, thereby reducing the complexity of document editing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of web document editing, and more specifically, to a web document editing method, device, terminal and storage medium. Background Art

[0002] Traditional technology terminals can only view / edit documents based on related applications for processing document formats. The document viewing / editing process is complicated and the user experience is poor.

[0003] Currently, based on web page documents [such as HTML (Hypertext Markup Language) documents] technology, online browsing of web page documents can be achieved and the complexity of the document browsing process can be reduced, but the complexity of the document editing process cannot be reduced. Summary of the invention

[0004] In view of this, the present invention proposes a web document editing method, device, terminal and storage medium to achieve online editing of web documents to reduce the complexity of the document editing process.

[0005] In order to achieve the above objectives, the proposed solution is as follows:

[0006] The first aspect of the present invention discloses a method for editing a webpage document, comprising:

[0007] receiving a first operation performed on a web document displayed in a web view of an application;

[0008] Acquire environmental information of the current web page document, the environmental information including an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0009] Determining whether to display a toolbar view in the application according to an operation position of the first operation on the web document;

[0010] If it is determined to display the toolbar view in the application, the document format indicated by the tool option in the toolbar is updated to the target document format indicated by the document format information to obtain the target toolbar, and the toolbar view loaded with the target toolbar is displayed in the application; the toolbar is generated based on the native program of the application.

[0011] A second aspect of the present invention discloses a web document editing device, comprising:

[0012] A first receiving unit, configured to receive a first operation performed on a web page document displayed in a web page view of an application;

[0013] A first acquisition unit, configured to acquire environment information of the current web page document, wherein the environment information includes an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0014] a toolbar view determining unit, configured to determine whether to display a toolbar view in the application according to an operation position of the first operation on the web document;

[0015] The first updating unit is used to update the document format indicated by the tool option in the toolbar to the target document format indicated by the document format information to obtain a target toolbar if it is determined to display the toolbar view in the application, and to display the toolbar view loaded with the target toolbar in the application; the toolbar is generated based on the native program of the application.

[0016] The third aspect of the present invention discloses a terminal, comprising: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the web document editing method disclosed in any one of the first aspects of the present invention.

[0017] A fourth aspect of the present invention discloses a storage medium, wherein the storage medium stores computer executable instructions, and the computer executable instructions are used to execute the web page document editing method disclosed in any one of the first aspects of the present invention.

[0018] The embodiment of the present invention provides a web document editing method, device, terminal and storage medium, which receive a first operation performed on a web document displayed in a web view of an application; obtain environmental information of the current web document, and determine whether to display a toolbar view in the application according to the environmental information; if it is determined to display the toolbar view in the application, update the document format indicated by the tool options in the toolbar generated based on the native program of the application to the target document format indicated by the environmental information to obtain a target toolbar, and display the toolbar view loaded with the target toolbar in the application, so as to facilitate online editing of the web document based on the interaction between the target toolbar and the web document, thereby reducing the complexity of document editing. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0020] Figure 1 A schematic diagram of a flow chart of a web document editing method provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of a flow chart of another web document editing method provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of a flow chart of another web document editing method provided by an embodiment of the present invention;

[0023] Figure 4(a) to Figure 4(h) A schematic diagram of an application scenario of a web document editing method provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of a web document editing device provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Example:

[0028] In the conventional technology, if a user wants to view / edit a document in an application of a terminal, the user needs to download a related application for processing the document format in the terminal, so as to view / edit the document in the application based on the related application. For example, if a user wants to view / edit a document in an instant messaging application, the user needs to download a related application for processing the document format in the terminal (for example, if the document is in .word format, the user needs to download a WPS application for processing .word format in the terminal), so as to view / edit the document in the instant messaging application based on the WPS application.

[0029] At present, based on the web document technology, the documents in the terminal application can be web documents, and the web documents can be viewed online in the terminal application without downloading the related application for processing the document format in the terminal as in the traditional technology, which reduces the complexity of document viewing. However, although the online viewing of web documents can be realized at present, the complexity of the document viewing process is reduced, the document editing process is still relatively complicated, and the online editing of documents cannot be realized.

[0030] Therefore, the embodiments of the present invention provide a document editing method, device, terminal and storage medium to implement online editing of web page documents and reduce the complexity of the document editing process.

[0031] As a preferred implementation of the embodiment of the present invention, a toolbar can be generated based on the native program of the application in the terminal, and the toolbar can be called a native toolbar. Through the interaction between the web document in the application and the toolbar applied to the application, the web document can be edited online. If the web document is generated based on HTML5 technology, the web document can also be called an H5 document.

[0032] The following is a detailed description of a web document editing method provided by an embodiment of the present invention. Figure 1 .

[0033] like Figure 1 The web document editing method shown is applied to an application in a terminal, and the method includes:

[0034] S101, receiving a first operation performed on a web page document displayed in a web page view of an application;

[0035] In the embodiment of the present invention, a browser can be loaded in the application of the terminal, and the browser provides a web page view, and the web page view can load and display the web page document in the application. The user on the terminal side can perform operations on the web page document. For the sake of distinction, the operation performed by the user on the web page document is temporarily referred to as the first operation.

[0036] As a preferred implementation of the embodiment of the present invention, the first operation can be a text input operation, a text selection operation, a click operation, etc. The above is only the preferred content of the first operation provided by the embodiment of the present invention. The inventor can set the specific content of the first operation according to his own needs and is not limited here.

[0037] S102, obtaining environmental information of the current web page document, the environmental information including an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0038] As a preferred implementation of an embodiment of the present invention, after a user performs a first operation on a web page document, environmental information of the current web page document may be obtained, and the environmental information may include an operation position of the first operation on the web page document and document format information of the web page document at the operation position.

[0039] In the embodiment of the present invention, preferably, the document format information of the current web page document at the operation position of the first operation may be the document format information of the cursor text of the current web page document.

[0040] The above are merely preferred contents of the environmental information provided by the embodiments of the present invention. The inventors can set the specific contents of the environmental information according to their own needs and are not limited here.

[0041] S103, determining whether to display a toolbar view in the application according to an operation position of the first operation on the webpage document;

[0042] In an embodiment of the present invention, if the operation position of the first operation on the web page document is the title of the web page document, it is determined not to display the toolbar view on the web page document; if the operation position of the first operation on the web page document is the body of the web page document, it is determined to display the toolbar view on the web page document.

[0043] S104: If it is determined to display the toolbar view in the application, the document format indicated by the tool option in the toolbar generated based on the native program of the application is updated to the target document format indicated by the document format information to obtain the target toolbar, and the toolbar view loaded with the target toolbar is displayed in the application.

[0044] In an embodiment of the present invention, if it is determined to display a toolbar view in an application, a toolbar generated based on a native program of the application can be determined, the toolbar includes at least one tool option, and the document format indicated by the tool option in the toolbar is updated to the target document format indicated by the document format information to obtain a target toolbar; and then the toolbar view loaded with the target toolbar is displayed in the application.

[0045] Figure 2 Another flow chart of a web document editing method provided by an embodiment of the present invention. Figure 2 As shown, the method includes:

[0046] S201, monitoring a system keyboard display event; the system keyboard display event is an operation event on a web document, or an operation event on a first tool option when a keyboard view loaded with a system keyboard is not displayed in an application;

[0047] In the embodiment of the present invention, the system keyboard display event can be a focus generation event. As a preferred embodiment of the present invention, the operation event performed on the web document can be considered as a focus generation event. When the keyboard view loaded with the system keyboard is not displayed in the application, the operation event of the first tool option on the toolbar can also be considered as a focus event.

[0048] The toolbar includes at least one tool option, and the at least one tool option includes a first tool option, a second tool option, and a third tool option. The number of the first tool option is one, and the first tool option is related to the system keyboard, and the first tool option can be a keyboard tool option. The number of the second tool options is at least one, and at least one second tool option can at least be related to the document format, and at least one second tool option includes a font tool option and / or a list tool option; wherein the font tool option is used to control the font of the cursor text in the web document, and the list tool option is used to control the list of the cursor text in the web document. The number of the third tool option is at least one, and at least one third tool option can be an undo tool option and / or a redo tool option.

[0049] Furthermore, the toolbar provided by the embodiment of the present invention may also include a fourth tool option, the number of which is at least one, and the fourth tool option may be a picture tool option, a forwarding tool option, an associated tool option, etc. Among them, the picture tool option is used to insert a picture into a web document, the forwarding tool option is used for the interaction between the web document and the application, and the associated tool option is also used for the interaction between the web document and the application, and is mainly used to push the web document to associated friends.

[0050] Forwarding tool options, for example, when the application is an instant messaging application, a registered user of the instant messaging application forwards a web page document to a friend user of the registered user in the instant messaging application, or publishes the web page document to a shared space of the instant messaging application (e.g., Moments) so that the friend users of the registered user in the instant messaging application can view the web page document through the shared space.

[0051] The associated tool option, for example, when the application is an instant messaging application, a registered user of the instant messaging application associates a friend user and reminds the friend user to view the web document.

[0052] In an embodiment of the present invention, when a tool view other than the first tool option is displayed in an application program, but a keyboard view loaded with a system keyboard is not displayed, an operation event on the first tool option on the toolbar can be considered as a focus event. Among them, the second tool option, the third tool option, and the fourth tool option can all be considered as non-first tool options.

[0053] S202, receiving a first operation performed on a web page document displayed in a web page view of an application;

[0054] S203, displaying a keyboard view loaded with a system keyboard in the application;

[0055] In the embodiment of the present invention, the received first operation is an operation event on a webpage document. Therefore, after receiving the first operation, a keyboard view may be displayed in the application program, and a system keyboard may be loaded in the keyboard view.

[0056] S204, obtaining environmental information of the current web page document, the environmental information including an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0057] In an embodiment of the present invention, after receiving the first operation, environmental information of the current web document may also be obtained, the environmental information including the operation position of the first operation on the web document and document format information of the web document at the operation position of the first operation.

[0058] If the toolbar also includes a third tool option, the environment information may also include third option status information. If the third tool option is an undo tool option, the third option status information is used to indicate a first target state of the undo tool option, and the first target state is an enabled state or a disabled state; if the third tool option is a restore tool option, the third option status information is used to indicate a second target state of the restore tool option, and the second target state is an enabled state or a disabled state; if the third tool option is a recall tool option and a restore tool option, the third option status information is used to indicate a first target state of the undo tool option and a second target state of the restore tool option, and the first target state is an enabled state or a disabled state, and the second target state is an enabled state or a disabled state. Among them, the enabled state indicates that the tool option can be used, and the disabled state indicates that the tool option cannot be used.

[0059] S205: determining whether to display a toolbar view in the application according to an operation position of the first operation on the webpage document;

[0060] S206, if it is determined to display the toolbar view in the application, determine a toolbar generated based on the native program of the application, update the state of the first tool option in the toolbar based on the display state of the keyboard view in the application, update the document format indicated by the second tool option in the toolbar to the target document format indicated by the document format information, and obtain the target toolbar;

[0061] In an embodiment of the present invention, preferably, the display status of the keyboard view in the application is displayed / not displayed. If the current keyboard view is not displayed in the application, the status of the first tool option in the update toolbar is not expanded; if the current keyboard view is displayed in the application, the status of the first tool option in the update toolbar is expanded.

[0062] Furthermore, if the toolbar also includes a third tool option, after determining the toolbar generated by the native program based on the application, the state of the first tool option in the toolbar can be updated based on the display status of the keyboard view in the application, the document format indicated by the second tool option in the toolbar can be updated to the target document format indicated by the document format information, and the state of the third tool option in the toolbar can be updated to the target state indicated by the third option state information to obtain the target toolbar.

[0063] For example, if the third option state information is used to indicate the first target state of the undo tool option, and the first target state is a disabled state, the state of the undo tool option in the toolbar is updated to a disabled state.

[0064] S207, displaying the toolbar view loaded with the target toolbar in the application;

[0065] S208, obtaining operation information of a second operation performed on a target tool option of a target toolbar;

[0066] In the embodiment of the present invention, preferably, when a toolbar view is displayed in an application, a target toolbar is loaded in the toolbar view, the target toolbar includes at least one tool option, and the user can perform a second operation on the tool option in the toolbar. For the sake of distinction, the tool option in the toolbar on which the user performs the second operation is temporarily referred to as a target tool option. After receiving the second operation performed on the target tool option of the target toolbar, operation information of the second operation can be obtained.

[0067] In the embodiment of the present invention, the second operation may be a single-click operation, and the target tool option may be a tool option or a sub-tool option in the tool option.

[0068] As a preferred implementation of the embodiment of the present invention, when the tool option is the first tool option, the operation information of the second operation performed by the user on the first tool option is opposite to the state of the first tool option in the toolbar displayed in step S207. For example, if the state of the first tool option in the toolbar displayed in step S207 is the expanded state, the obtained operation information of the second operation indicates the non-expanded state; if the state of the first tool option in the toolbar displayed in step S207 is the non-expanded state, the obtained operation information of the second operation indicates the expanded state.

[0069] As a preferred implementation of an embodiment of the present invention, when the tool option is the second tool option, at least one sub-tool option can be displayed in the tool view of the tool option, and the sub-tool option operated by the user in at least one sub-tool option based on the second operation can be used as the target tool option, and the option information of the target tool option is regarded as the operation information of the second operation on the target tool option. Among them, the option information of the target tool option can represent whether the target tool option is selected, or the option information of the target tool option can also represent the parameter value set by the user for the target tool option. For example, the parameter value set by the user for the target tool option "font size sub-tool option" is "14".

[0070] As a preferred implementation of the embodiment of the present invention, when the third tool option is an undo tool option, if the current state of the undo tool option is enabled, the user indicates an undo operation based on the operation information of the undo tool option of the second operation; when the third tool option is a restore tool option, if the current state of the restore tool option is enabled, the user indicates a restore operation based on the operation information of the restore tool option of the second operation. The undo operation indicates the most recent operation on the webpage document in the history of undoing; and the restore operation indicates the most recent operation on the webpage document in the history of restoring.

[0071] As a preferred implementation of the embodiment of the present invention, if the fourth tool option is a picture tool option, the operation information of the user in the picture tool option based on the second operation may be a picture selected by the user to be inserted into the webpage document.

[0072] As a preferred implementation of an embodiment of the present invention, if the fourth tool option is a forwarding tool option, the operation information of the user in the forwarding tool option based on the second operation can be the document recipient selected by the user for receiving the web page document, and the document recipient can be a friend or a shared space.

[0073] As a preferred implementation of the present invention, if the fourth tool option is an association tool option, the operation information of the user in the association tool option based on the second operation may be the friend to be associated selected by the user. For example, the friend to be @ selected by the user.

[0074] S209, searching for a correspondence between a preset tool option and an interface, and acquiring a target interface corresponding to the target tool option;

[0075] In the embodiment of the present invention, the correspondence between the tool options and the interfaces is preset, and the preset interface corresponding to the target tool option is searched. For the convenience of distinction, the found interface is temporarily referred to as the target interface.

[0076] Among them, the pre-set interface is provided by H5, and calling the interface can realize the processing of H5 web page documents.

[0077] S210, calling the target interface for injecting operation information to operate the web page document.

[0078] In the embodiment of the present invention, after the operation information is injected into the target interface, the target interface is called to implement the operation on the web page document.

[0079] As a preferred implementation manner of an embodiment of the present invention, the target tool option is the first tool option. When the operation information of the second operation obtained indicates the expansion state, the operation information is injected into the interface corresponding to the first tool option, and the calling interface can control the display of the keyboard view in the web document.

[0080] As a preferred implementation manner of an embodiment of the present invention, when the target tool option is the first tool option and the operation information of the second operation obtained indicates an unexpanded state, the operation information is injected into the interface corresponding to the first tool option, and the interface is called to hide the keyboard view and the toolbar view.

[0081] As a preferred implementation manner of an embodiment of the present invention, when the tool option is a second tool option, at least one sub-tool option can be displayed in the tool view of the tool option, and the sub-tool option operated by the user based on the second operation in at least one sub-tool option of the target tool option can be regarded as the target tool option, and the option information of the target tool option can be regarded as the operation information of the second operation on the target tool option.

[0082] For example, when the second tool option is a text tool option, the text tool option may include a bold sub-tool option, an italic sub-tool option, an underline sub-tool option, and a font size sub-tool option; the sub-tool option operated by the user through the second operation is taken as the target tool option. If the target tool options are "Italic Sub-tool Option" and "Font Size Sub-tool Option", the option information of the "Italic Sub-tool Option" represents whether the current "Italic Sub-tool Option" is selected; the option information of the "Font Size Sub-tool Option" represents the parameter value set by the user for the "Font Size Sub-tool Option", that is, the font size set by the user for the "Font Size Sub-tool Option". The option information of the "Font Size Sub-Tool Option" is injected as operation information into the interface corresponding to the "Font Size Sub-Tool Option", and the interface is called. If the option information of the "Font Size Sub-Tool Option" indicates that the parameter value set by the user for the "Font Size Sub-Tool Option" is 14, then the font size of the cursor text in the web document is modified to "14"; and the option information of the "Italic Sub-Tool Option" is injected as operation information into the interface corresponding to the "Italic Sub-Tool Option", and the interface is called. If the option information of the "Italic Sub-Tool Option" indicates that the current "Italic Sub-Tool Option" is selected, then the cursor text in the web document is set to italic.

[0083] As a preferred implementation of an embodiment of the present invention, when the target tool option is an undo tool option, the user indicates an undo operation in the operation information of the undo tool option based on the second operation, injects the operation information into the interface corresponding to the undo tool option, and calls the interface to undo the most recent undo operation on the web page document in the undo history.

[0084] As a preferred implementation of an embodiment of the present invention, when the target tool option is a restore tool option, the user indicates a restore operation based on the operation information of the restore tool option in the second operation, injects the operation information into the interface corresponding to the restore tool option, and calls the interface to restore the most recent operation undone on the web page document in the history.

[0085] As a preferred implementation manner of an embodiment of the present invention, the target tool option is a picture tool option, and the user can select a picture to be inserted into the web document based on the operation information of the second operation in the picture tool option; the picture is injected into the interface corresponding to the picture tool option, and the interface is called to insert the picture into the web document.

[0086] As a preferred implementation manner of an embodiment of the present invention, the target tool option is a forwarding tool option, and the operation information of the user in the forwarding tool option based on the second operation can be the document recipient selected by the user for receiving the web page document; the operation information is injected into the interface corresponding to the forwarding tool option, the interface is called, and the web page document is sent to the document recipient.

[0087] As a preferred implementation manner of an embodiment of the present invention, the target tool option is an associated tool option. The user can select the friend to be @ed by the user based on the operation information of the associated tool option in the second operation, inject the operation information into the interface corresponding to the associated tool option, call the interface, and prompt the @ed friend to view the web document.

[0088] The embodiment of the present invention provides a web document editing method, which can realize online editing of web document based on the toolbar of the remote program of the application program, thereby reducing the complexity of web document editing.

[0089] A web document editing method provided by an embodiment of the present invention is applied to an application program, wherein an HTML-based web document is provided in the application program, and the application program can load a browser, and the browser provides a web page view, in which a web document can be loaded to realize viewing and editing of the web document. Specifically, based on the interaction between the web document and the document editing tool, the interaction between the web document and a toolbar generated based on the native program of the application program can be realized, thereby realizing online editing of the web document. Among them, the document editing tool is also generated based on the native program of the application program.

[0090] As a preferred implementation of the embodiment of the present invention, since the web page document is implemented based on HTML and the document editing tool is implemented based on the native program of the application program, the two cannot directly interact with each other. Therefore, the embodiment of the present invention also provides an interaction mechanism between the web page document and the document editing tool to provide technical support for online editing of the web page document. Now, from the perspective of web page document editing, an interaction mechanism between a web page document and a document editing tool provided by the embodiment of the present invention is described in detail.

[0091] Figure 3 A schematic diagram of a web document editing method provided by an embodiment of the present invention. Figure 3 The web document editing method shown is applied to the front end and the middle end, wherein the browser in the application can be regarded as the front end, and the document editing tool in the application can be regarded as the middle end. The method includes:

[0092] S301, the document editing tool monitors a system keyboard display event; the system keyboard display event is an operation event on a web document, or an operation event on a first tool option when a keyboard view loaded with a system keyboard is not displayed in an application;

[0093] In an embodiment of the present invention, the terminal can monitor the system keyboard display event, and after monitoring the system keyboard display event, report the system keyboard display event to the document editing tool applied to the application, so that after receiving the system keyboard display event, the document editing tool controls the display of the keyboard view in the application, and the system keyboard is loaded in the keyboard view.

[0094] S302: The browser receives a first operation performed on a web page document displayed in a web page view of an application program;

[0095] In an embodiment of the present invention, the terminal can monitor the first operation performed by the user on the web document displayed in the web view of the application, and then execute step S303; and the browser can also receive the first operation performed by the user on the web document displayed in the web view of the application, and then execute step S304.

[0096] S303, the document editing tool controls the display of a keyboard view loaded with a system keyboard in the application;

[0097] S304: The browser obtains environment information of the current web page document, where the environment information includes an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0098] S305, the browser sends the environment information to the JS layer;

[0099] In the embodiment of the present invention, after acquiring the environment information, the browser cannot directly transmit the environment information to the document editing tool, but transmits the environment information to the JS layer.

[0100] As a preferred implementation of the embodiment of the present invention, the JS layer can be regarded as an intermediate layer, based on which the interaction between the browser and the document editing tool in the application can be realized, wherein the JS layer can be regarded as a javascript layer.

[0101] In the embodiment of the present invention, preferably, after receiving the first operation performed on the web page document displayed in the web page view of the application, the browser can obtain the environment information of the current web page document.

[0102] As a preferred implementation mode of an embodiment of the present invention, a method for obtaining environmental information of the current web page document may be to obtain a preset set of signalings, wherein the set of signalings includes at least one signaling; for each signaling, the signaling value of the signaling is obtained from the current web page document, and then the target signaling is obtained; based on this, a target signaling is obtained for each signaling in a set of signalings, and at least one target signaling is obtained for at least one signaling, and the obtained at least one target signaling can be regarded as the environmental information obtained from the current web page document.

[0103] In this embodiment, the browser can call a native method to obtain the environment information of the current web page document. Among them, at least one target signaling is as follows:

[0104] bold:'true'; bold is a signaling, 'true' is the signaling value of bold, bold:'true' indicates that the cursor text is in bold state; bold:'false' indicates that the cursor text is not in bold state;

[0105] italic:'false'; where italic is the signaling, 'false' is the signaling value of italic, italic:'false' indicates that the cursor text is not in a italic state; italic:'italic' indicates that the cursor text is in a italic state;

[0106] underline:'u'; where underline is the signaling, and u is the signaling value of underline. underline:'u' indicates that the cursor text is underlined; underline:" indicates that the cursor text is not underlined.

[0107] strike:'strike'; where strike is a signal, 'strike' is the signal value of the strike signal, strike:'strike' indicates that the cursor text has a strikethrough; strike:" indicates that the cursor text does not have a strikethrough;

[0108] size:'24'; size is a signaling, 24 is the signaling value of size, and size:'24' indicates that the font size of the cursor text is 24;

[0109] color:'#000000'; color is a signal, '#000000' is the signal value of color, and color:'#000000' indicates that the color of the cursor text is the color corresponding to #000000;

[0110] list:'false' / / 'ordered' / / 'bullet'; list is a signaling, list:'false' indicates that the cursor text has neither a sequence number nor a bullet; list:'ordered' indicates that the cursor text has a sequence number; list:'bullet' indicates that the cursor text has a bullet;

[0111] task-list:'false' / / 'true'; task-list is a signaling. task-list:'false' indicates that the cursor text is in a non-to-do format. task-list:'true' indicates that the cursor text is in a to-do format. If the cursor text is in the to-do format, it means that there are to-do tasks in the cursor text. If the cursor text is in a non-to-do format, it means that there are no to-do tasks in the cursor text.

[0112] align:'left' / / 'center' / / 'right'; align is a signaling, align:'left' means the cursor text is left-aligned; align:'center' means the cursor text is centered; align:'right' means the cursor text is right-aligned;

[0113] undo:'true'; undo is a signaling, 'true' is the signaling value of the undo signaling, undo:'true' indicates that the undo tool option is enabled; undo:'false' indicates that the undo tool option is disabled;

[0114] redo:'false'; redo is a signaling, 'false' is the signaling value of the redo signaling, redo:'false' indicates that the recovery tool option is disabled; redo:'true' indicates that the recovery tool option is enabled;

[0115] hideToolbar:'false'; wherein hideToolbar is a signaling, and 'false' is the signaling value of the hideToolbar signaling; hideToolbar:'false' indicates that the operation position of the first operation is located in the body of the web document; hideToolbar:'true' indicates that the operation position of the first operation is located in the title of the web document.

[0116] The above is merely the preferred content of a group of signaling provided by the embodiment of the present invention. The inventor can set the preferred content of the signaling in a group of signaling according to his own needs, and no limitation is made here.

[0117] S306, JS layer stores environment information;

[0118] In the embodiment of the present invention, after the JS layer receives the environment information, it can store the environment information in a queue.

[0119] S307, the browser sends a specific network request;

[0120] In an embodiment of the present invention, all network requests sent by the browser can be captured by the document editing tool. After a specific network request sent from the browser is received by the document editing tool, the specific network request is used to trigger the document editing tool to execute the environment information acquisition function provided by the JS layer, such as qmailBridge.fetchQueue(), to obtain environment information from the queue of the JS layer.

[0121] In an embodiment of the present invention, a web page document can accumulate operations and use schame to send a specific network request, wherein the specific network request is, for example, qqmailapijs: / / dispatch_message / .

[0122] The above environment information acquisition function and specific network request are preferred contents provided by the embodiment of the present invention. The inventors can set the specific contents of the environment information acquisition function and the specific network request according to their own needs, which are not limited here.

[0123] S308, the document editing tool captures a specific network request;

[0124] S309, the document editing tool calls a preset environment information acquisition function to request the JS layer to acquire environment information;

[0125] S310, the document editing tool obtains environmental information;

[0126] S311, the document editing tool determines whether to display a toolbar view in the application according to an operation position of the first operation on the webpage document;

[0127] S312: If the document editing tool determines to display a toolbar view in the application, determine a toolbar generated based on a native program of the application, update the state of the first tool option in the toolbar based on the display state of the keyboard view in the application, update the document format indicated by the second tool option in the toolbar to the target document format indicated by the document format information, and obtain a target toolbar;

[0128] S313, the document editing tool controls displaying a toolbar view loaded with a target toolbar in the application;

[0129] S314, the document editing tool obtains operation information of a second operation performed on a target tool option of a target toolbar;

[0130] In the embodiment of the present invention, after the document editing tool control displays the toolbar view loaded with the target toolbar in the application, it can also receive a second operation performed by the user on the target tool option in the target toolbar and obtain operation information of the second operation.

[0131] S315, the document editing tool searches for a correspondence between a preset tool option and an interface, and obtains a target interface corresponding to the target tool option;

[0132] In the embodiment of the present invention, H5 provides a set of API interfaces. After native directly injects operation information into the API interfaces, the web page document can be operated by calling the API interfaces.

[0133] If the tool option does not include a sub-tool option, an interface corresponding to the tool option is pre-set; if the tool option includes at least one sub-tool option, an interface corresponding to each sub-tool option is pre-set.

[0134] For example, WeDocs.toggleFormat(") is a pre-set interface corresponding to the "bold" sub-tool option. If the second operation is performed on the "bold" sub-tool option and the operation result obtained is "bold", "bold" is injected into WeDocs.toggleFormat(") to obtain WeDocs.toggleFormat('bold'), and WeDocs.toggleFormat('bold') is called to make the cursor text of the web document bold.

[0135] WeDocs.toggleFormat(") is a pre-set interface corresponding to the "Italicize" sub-tool option. If the second operation is performed on the "Italicize" sub-tool option and the operation result obtained is "italic", "italic" is injected into WeDocs.toggleFormat(") to obtain WeDocs.toggleFormat('italic'), and WeDocs.toggleFormat('italic') is called to italicize the cursor text of the web document.

[0136] S316: The document editing tool calls the target interface for injecting operation information to operate the web document.

[0137] Further, referring to steps S317-S319, the document editing tool can also implement control over the keyboard view and the toolbar view.

[0138] S317, the document editing tool monitors a system keyboard disappearance event; the system keyboard disappearance event is a first operation event on a first tool option when a keyboard view is displayed in an application, or a second operation event on a second tool option when a keyboard view is displayed in an application;

[0139] In an embodiment of the present invention, when a system keyboard view is displayed in an application, an operation event on a first tool option in a toolbar may be regarded as a first operation event, and an operation event on a second tool option in a toolbar may be regarded as a second operation event. The operation event on the first tool option in the toolbar may be a single-click event, and the operation event on the second tool option in the toolbar may be a single-click event.

[0140] S318: If the document editing tool detects the first operation event, the keyboard view and the toolbar view are hidden in the application program;

[0141] In an embodiment of the present invention, the terminal system can monitor the first operation event and the second operation event, and report the monitored first operation event and the second operation event to the document editing tool. If the document editing tool receives the first operation event, it controls the hiding of the keyboard view and the toolbar view in the application.

[0142] S319: If the document editing tool detects the second operation event, the keyboard view is hidden in the application and a tool view of the second tool option is displayed in the application;

[0143] In the embodiment of the present invention, the document editing tool receives the second operation event, controls hiding of the keyboard view in the application program, and displays a tool view of the second tool option operated by the second operation event in the application program.

[0144] S320: If the tool view of the second tool option includes a target sub-tool option, a trigger operation on the target sub-tool option is received, and the tool view of the second tool option is hidden in the application and a keyboard view is displayed.

[0145] In an embodiment of the present invention, the second tool option includes at least one sub-tool option, and one or more sub-tool options can be determined in advance from the at least one sub-tool option, and the determined sub-tool options are used as target sub-tool options. Among them, the first sub-tool option for list control of the cursor text in the web document can be regarded as the target sub-tool option, and the second sub-tool option for setting the title of the cursor text in the web document can also be regarded as the target sub-tool option. Among them, the number of the first sub-tool options can be one or more, and the number of the second sub-tool options can be one or more.

[0146] As a preferred implementation manner of an embodiment of the present invention, if the tool view of the second tool option includes a target sub-tool option, if the user performs a trigger operation on the target sub-tool option, the document editing tool will respond to the trigger operation, hide the tool view of the second tool option displayed in the application, and display the keyboard view in the application.

[0147] In order to facilitate the understanding of a web document editing method provided by an embodiment of the present invention, a schematic diagram of the web document editing method is now provided. Based on the schematic diagram of the web document editing method, an application scenario of a web document editing method provided by an embodiment of the present invention can be described in detail.

[0148] FIG4(a) is a file creation interface loaded in the web page view of the terminal browser. When the user clicks "New Document" or "+" in FIG4(a), the document selection interface shown in FIG4(b) can be displayed in the web page view. The user can choose to create a "document" or a "table". If the user chooses to create a "document" and clicks to confirm, the document interface shown in FIG4(c) can be loaded and displayed in the web page view. The document consists of a title and a body. Referring to FIG4(d), if the cursor is at the title of the document, the system keyboard is displayed; referring to FIG4(e), if the cursor is at the body of the document, the system keyboard and the toolbar are displayed. The toolbar includes multiple tool options, which are the keyboard tool option, the font tool option, the list tool option, the picture tool option, the undo tool option, and the redo tool option.

[0149] If the user clicks the font tool option, Figure 4(f) is displayed in the web page view; if the user clicks the list tool option, Figure 4(g) is displayed in the web page view; if the user clicks the picture tool option, the picture list in the terminal is displayed, so that the user can select the picture to be inserted into the web page text from the picture list; if the user clicks the undo tool option, the most recent operation on the web page document in history is undone; if the user clicks the restore tool option, the most recent operation on the web page document in history is restored. Furthermore, the toolbar can also include an association tool option and a forwarding tool option, which are not described in detail here.

[0150] Furthermore, if the keyboard tool option in Figure 4(f) is clicked, the interface shown in Figure 4(e) is displayed; if the keyboard tool option in Figure 4(g) is clicked, the interface shown in Figure 4(e) is displayed; when the keyboard tool option is clicked in the interface shown in Figure 4(e), the interface shown in Figure 4(h) is displayed.

[0151] Furthermore, if any of the first sub-tool options in Figure 4(f) is clicked, the interface shown in Figure 4(e) is displayed; if any of the second sub-tool options in Figure 4(g) is clicked, the interface shown in Figure 4(e) is displayed. It should be noted that the interface shown in Figure 4(e) here mainly refers to displaying the keyboard view. Further, when the first sub-tool option / second sub-tool option is clicked, the format of the cursor text in the interface shown in Figure 4(e) will also be modified to the format corresponding to the clicked first sub-tool option / second sub-tool option. For example, when "Large Title" in the first sub-tool option is clicked, the interface shown in Figure 4(e) will be displayed, and further, the text format of the cursor text in the interface shown in Figure 4(e) is the text format indicated by "Large Title".

[0152] The embodiment of the present invention can realize the interaction between the web page document and the toolbar through the interaction between the document editing tool and the web page document, thereby realizing the online editing of the web page document and reducing the complexity of the web page document editing.

[0153] Figure 5 A schematic diagram of the structure of a web document editing device provided by an embodiment of the present invention.

[0154] like Figure 5 As shown, the web page editing device includes:

[0155] A first receiving unit 501 is used to receive a first operation performed on a web page document displayed in a web page view of an application;

[0156] A first acquisition unit 502 is used to acquire environmental information of the current web document, where the environmental information includes an operation position of the first operation on the web document and document format information of the web document at the operation position of the first operation;

[0157] A toolbar view determining unit 503, configured to determine whether to display a toolbar view in the application according to an operation position of the first operation on the webpage document;

[0158] The first updating unit 504 is used to update the document format indicated by the tool option in the toolbar generated based on the native program of the application to the target document format indicated by the document format information to obtain the target toolbar, and display the toolbar view loaded with the target toolbar in the application.

[0159] The specific principles and execution processes of each unit in the web document editing device disclosed in the above embodiment of the present invention are the same as those of the web document editing method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the web document editing method disclosed in the above embodiment of the present invention, and no further details will be given here.

[0160] In an embodiment of the present invention, if it is determined to display a toolbar view in an application, a toolbar generated based on a native program of the application can be determined, the toolbar includes at least one tool option, and the document format indicated by the tool option in the toolbar is updated to the target document format indicated by the document format information to obtain a target toolbar; and then the toolbar view loaded with the target toolbar is displayed in the application.

[0161] Preferably, the web document editing device 500 further includes:

[0162] A second acquisition unit, used to acquire operation information of a second operation performed on a target tool option of a target toolbar;

[0163] A third acquisition unit is used to find the correspondence between the preset tool options and interfaces, and acquire the target interface corresponding to the target tool option;

[0164] The calling unit is used to call the target interface operation web page document for injecting operation information.

[0165] In the embodiment of the present invention, the toolbar of the remote program based on the application program can realize the online editing of the web page document, thereby reducing the complexity of the web page document editing.

[0166] Preferably, the toolbar includes a first tool option, and the first tool option is related to the system keyboard. The web document editing device 500 further includes:

[0167] A first monitoring unit is used to monitor a system keyboard display event; the system keyboard display event is an operation event on a web document, or an operation event on a first tool option when a keyboard view loaded with a system keyboard is not displayed in an application;

[0168] The first display unit is used to display a keyboard view in an application program if a system keyboard display event is detected.

[0169] Preferably, the toolbar further includes a second tool option different from the first tool option. The web document editing device 500 further includes:

[0170] The second monitoring unit is used to monitor a system keyboard disappearance event; the system keyboard disappearance event is a first operation event on a first tool option when a keyboard view is displayed in an application, or a second operation event on a second tool option when a keyboard view is displayed in an application;

[0171] It should be noted that if the first operation event is detected, the hiding unit is executed, and if the second operation event is detected, the second display unit is executed.

[0172] Hiding unit, used to hide the keyboard view and toolbar view in the application;

[0173] The second display unit is used to hide the keyboard view in the application and display the tool view of the second tool option in the application.

[0174] Preferably, the tool view of the second tool option includes a target sub-tool option, and the target sub-tool option includes: a first sub-tool option for performing list control on the cursor text in the web document, and / or a second sub-tool option for performing title control on the cursor text in the web document. The web document editing device 500 further includes:

[0175] The second receiving unit is used to receive a trigger operation on a target sub-tool option, hide the tool view of the second tool option in the application and display the keyboard view.

[0176] Preferably, the tool view further includes a third tool option different from the first tool option and the second tool option. The web document editing device 500 further includes:

[0177] The second updating unit is used to update the state of the third option in the toolbar to the target state indicated by the third option state information in the environment information when the toolbar view is displayed in the application.

[0178] Preferably, the toolbar view determining unit 503 includes: a non-display unit and a third display unit.

[0179] a non-display unit, configured to determine not to display the toolbar view in the application program if the operation position of the first operation on the webpage document is the title of the webpage document;

[0180] The third display unit is used to determine to display a toolbar view in the application program if the operation position of the first operation on the webpage document is the body of the webpage document.

[0181] A web document editing method provided by an embodiment of the present invention has been described in detail above. Now, a web document editing method provided by an embodiment of the present invention will be introduced from the perspective of a terminal.

[0182] For ease of understanding, a terminal to which a web document editing method provided by an embodiment of the present invention is applicable is now described in detail. Figure 6 .

[0183] like Figure 6 The terminal shown may include: a processor 601 , a memory 602 , a communication interface 603 , an input unit 604 , a display 605 , and a communication bus 606 .

[0184] The memory 602 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory at least stores a program for implementing the following functions:

[0185] receiving a first operation performed on a web document displayed in a web view of an application;

[0186] Acquire environmental information of the current web page document, the environmental information including an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation;

[0187] Determining whether to display a toolbar view in the application program according to an operation position of the first operation on the webpage document;

[0188] If it is determined to display the toolbar view in the application, the document format indicated by the tool option in the toolbar generated based on the native program of the application is updated to the target document format indicated by the document format information to obtain the target toolbar, and the toolbar view loaded with the target toolbar is displayed in the application.

[0189] Optionally, the detailed and extended functions of the program can be referred to the description below.

[0190] The processor 601 , the memory 602 , the communication interface 603 , the input unit 604 , and the display 605 all communicate with each other via the communication bus 606 .

[0191] In the embodiment of the present invention, the processor 601 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, etc.

[0192] The processor can call and execute the program stored in the memory 602 .

[0193] The communication interface 603 may be an interface of a communication module, such as an interface of a GSM module.

[0194] The present invention may further include an input unit 604, which may include a touch sensing unit for sensing a touch event on the touch display panel, a keyboard, and the like.

[0195] The display 605 includes a display panel, such as a touch display panel, etc. In a possible case, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0196] certainly, Figure 6 The terminal structure shown does not constitute a limitation on the terminal in the embodiment of the present invention. In actual applications, the terminal may include Figure 6 More or fewer components than shown, or combinations of certain components.

[0197] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the above-mentioned web page document editing method.

[0198] Optionally, the detailed functions and extended functions of the computer executable instructions may refer to the above description.

[0199] The embodiments of the present invention provide a web document editing method, device, terminal and storage medium, which receive a first operation performed on a web document displayed in a web view of an application; obtain environmental information of the current web document, and determine whether to display a toolbar view in the application according to the environmental information; if it is determined to display the toolbar view in the application, update the document format indicated by the tool options in the toolbar generated based on the native program of the application to the target document format indicated by the environmental information to obtain a target toolbar, and display the toolbar view loaded with the target toolbar in the application, so as to facilitate online editing of the web document based on the interaction between the toolbar and the web document, thereby reducing the complexity of document editing.

[0200] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0201] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0202] The above description of the embodiments disclosed in the present invention enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A web document editing method, characterized in that: include: receiving a first operation performed on a web document displayed in a web view of an application; Acquire environmental information of the current web page document, the environmental information including an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation; Determining whether to display a toolbar view in the application according to an operation position of the first operation on the web document; If it is determined to display the toolbar view in the application, the document format indicated by the tool option in the toolbar is updated to the target document format indicated by the document format information to obtain a target toolbar, and the toolbar view loaded with the target toolbar is displayed in the application; the toolbar is generated based on the native program of the application; Acquire operation information of a second operation performed on a target tool option of the target toolbar; Find the correspondence between the preset tool options and interfaces, and obtain the target interface corresponding to the target tool option; The target interface injected with the operation information is called to operate the web page document.

2. The method according to claim 1, characterized in that The toolbar includes a first tool option, the first tool option is related to the system keyboard, and the method further includes: Monitoring a system keyboard display event; the system keyboard display event is an operation event on the webpage document, or an operation event on the first tool option when a keyboard view loaded with the system keyboard is not displayed in the application; If the system keyboard display event is detected, the keyboard view is displayed in the application.

3. The method according to claim 2, characterized in that The toolbar further includes a second tool option different from the first tool option, and the method further includes: Monitoring a system keyboard disappearance event; the system keyboard disappearance event is a first operation event on the first tool option when the keyboard view is displayed in the application, or a second operation event on the second tool option when the keyboard view is displayed in the application; If the first operation event is detected, hiding the keyboard view and the toolbar view in the application; If the second operation event is detected, the keyboard view is hidden in the application and the tool view of the second tool option is displayed in the application.

4. The method according to claim 3, characterized in that The tool view of the second tool option includes a target sub-tool option, and the target sub-tool option includes: a first sub-tool option for list control of the cursor text in the web document, and / or a second sub-tool option for title control of the cursor text in the web document, and the method further includes: A trigger operation on the target sub-tool option is received, a tool view of the second tool option is hidden in the application, and the keyboard view is displayed.

5. The method according to claim 3, characterized in that: The toolbar further includes a third tool option different from the first tool option and the second tool option, and the method further includes: When the toolbar view is displayed in the application, the state of the third tool option in the toolbar is updated to a target state indicated by the third tool option state information in the environment information.

6. The method according to claim 1, characterized in that The determining whether to display a toolbar view in the application according to the operation position of the first operation on the web document comprises: If the operation position of the first operation on the web document is the title of the web document, determining not to display a toolbar view in the application; If the operation position of the first operation on the web document is the body of the web document, it is determined to display a toolbar view in the application.

7. A web document editing device, characterized in that: include: A first receiving unit, configured to receive a first operation performed on a web page document displayed in a web page view of an application; A first acquisition unit, configured to acquire environment information of the current web page document, wherein the environment information includes an operation position of the first operation on the web page document and document format information of the web page document at the operation position of the first operation; a toolbar view determining unit, configured to determine whether to display a toolbar view in the application according to an operation position of the first operation on the web document; A first updating unit is configured to update the document format indicated by the tool option in the toolbar to the target document format indicated by the document format information to obtain a target toolbar if it is determined to display the toolbar view in the application, and to display the toolbar view loaded with the target toolbar in the application; the toolbar is generated based on a native program of the application; A second acquisition unit, configured to acquire operation information of a second operation performed on a target tool option of the target toolbar; A third acquisition unit is used to find the correspondence between the preset tool options and interfaces, and acquire the target interface corresponding to the target tool option; The calling unit is used to call the target interface injected with the operation information to operate the web page document.

8. The device according to claim 7, characterized in that The toolbar includes a first tool option, the first tool option is related to a system keyboard, and the device further includes: A first monitoring unit is used to monitor a system keyboard display event; the system keyboard display event is an operation event on the webpage document, or an operation event on the first tool option when a keyboard view loaded with the system keyboard is not displayed in the application; The first display unit is configured to display the keyboard view in the application program if the system keyboard display event is detected.

9. A terminal, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the web document editing method according to any one of claims 1-6.

10. A storage medium, characterized in that: The storage medium stores computer executable instructions, and the computer executable instructions are used to execute the web document editing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Browser-oriented webpage labeling system

    CN101739415A

  • Internet-enabled graphical user interface with toolbar icons having built-in links to world-wide web documents and an integrated web browser

    EP0798655A2