CN113849102B - Document processing method, device, computer equipment and storage medium - Google Patents

Document processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN113849102B
CN113849102B CN202111131718.0A CN202111131718A CN113849102B CN 113849102 B CN113849102 B CN 113849102B CN 202111131718 A CN202111131718 A CN 202111131718A CN 113849102 B CN113849102 B CN 113849102B
Authority
CN
China
Prior art keywords
document
target text
content
object model
text content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111131718.0A
Other languages
Chinese (zh)
Other versions
CN113849102A (en
Inventor
欧思日
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111131718.0A priority Critical patent/CN113849102B/en
Publication of CN113849102A publication Critical patent/CN113849102A/en
Application granted granted Critical
Publication of CN113849102B publication Critical patent/CN113849102B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting

Abstract

The embodiment of the application discloses a document processing method, a document processing device, computer equipment and a storage medium. When a user performs folding operation on text content of a shared document, determining a document object model node corresponding to target text content of the folding operation, adding a folding mark for the document object model node, then folding the target text content at a user interface of a terminal, and when the target text content is in a folding state, if an update instruction for the target text content is received, updating the target document content based on the update instruction. With this, the processing efficiency of the shared document can be improved.

Description

Document processing method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a document processing method, a document processing device, a computer device, and a storage medium.
Background
In modern internet applications, rich text editing is a common requirement, which allows users to set various text formats for edited words, and supports what you see is what you get, so that users can intuitively see the actual editing effect.
When the text is edited, the text can be folded, and the folding operation is generally performed by clicking an unfolding mark of a title in the text, so that text content corresponding to the title can be folded, and the unfolding mark is simultaneously switched to a folding mark. When the user clicks the folding mark again, the text corresponding to the title is unfolded, and the folding mark is switched to the unfolding mark at the same time.
In the related art, a manner in which a text content is folded is to delete the folded content and then to re-add the content when the content is unfolded. But this approach can lead to data confusion in the text editing process.
Disclosure of Invention
The embodiment of the application provides a document processing method, a document processing device, computer equipment and a storage medium, which can improve the processing efficiency of a shared document.
The embodiment of the application provides a document processing method, which comprises the following steps:
responding to a content folding instruction for the shared document;
determining target text content corresponding to the content folding instruction in the shared document, wherein the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal, and the user of the first terminal and the user of the second terminal are operated simultaneously or non-simultaneously;
Hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal;
and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
Correspondingly, the embodiment of the application also provides a document processing device, which comprises:
a response unit configured to respond to a content folding instruction for the shared document;
the determining unit is used for determining target text content corresponding to the content folding instruction in the shared document, wherein the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal and is used for the user of the first terminal and the user of the second terminal to operate simultaneously or non-simultaneously;
the processing unit is used for hiding the document object model node of the target text content and hiding the target text content at the user interface of the first terminal;
and the adjusting unit is used for adjusting the target text content corresponding to the document object model node based on the updated content when receiving the updated content which is sent by the second terminal and is aimed at the target text content in the shared document.
In some embodiments, the processing unit comprises:
an adding subunit, configured to add a hidden flag to a document object model node of the target text content;
and the hiding subunit is used for hiding the target text content corresponding to the hiding mark on the user interface when the hiding mark is identified.
In some embodiments, the adding subunit is specifically configured to:
acquiring a document object model node tree of the shared document, wherein the document object model node tree comprises all document object model nodes in the shared document;
traversing the document object model node tree, and determining a target document object model node corresponding to the target text content;
the hidden mark is added in the target document object model node.
In some embodiments, the adjustment unit comprises:
the receiving subunit is used for acquiring the updated shared document when receiving the update instruction for the shared document sent by the server;
and the first determining subunit is used for determining the difference text content of the shared document and the updated shared document to obtain the updated content.
In some embodiments, the apparatus further comprises:
And the expansion unit is used for carrying out expansion processing on the document object model node of the target text content when receiving a content expansion instruction aiming at the target text content, and displaying the adjusted target text content on the user interface.
In some embodiments, the deployment unit comprises:
a first obtaining subunit, configured to obtain, from a document object model node tree of the shared document, a target document object model node corresponding to the target text content;
and the deleting subunit is used for deleting the hidden mark in the target document object model node.
In some embodiments, the determining unit comprises:
a second determining subunit, configured to determine a target text title corresponding to the content folding instruction in the shared document;
and the second acquisition subunit is used for acquiring the target text content corresponding to the target text title.
In some embodiments, the apparatus further comprises:
a first display unit, configured to, when receiving a deletion instruction for the target text title, perform expansion processing on a document object model node of the target text content, and display the target text content on the user interface;
And the first operation unit is used for deleting the target text title according to the deleting instruction.
In some embodiments, the apparatus further comprises:
a second display unit configured to display the target text content on the user interface when an editing instruction for the target text title is received;
and the second operation unit is used for editing the target text title according to the editing instruction.
In some embodiments, the processing unit comprises:
and the processing subunit is used for hiding the document object model node of the text subtitle and the document object model node of the text content corresponding to the text subtitle.
In some embodiments, the apparatus further comprises:
an obtaining unit, configured to obtain a hidden state of a document object model node of text content corresponding to the text subtitle when a content expansion instruction for the target text title is received;
and the third display unit is used for displaying the target text content on the user interface based on the hidden state.
In some embodiments, the response unit comprises:
a display subunit, configured to display the shared document on the user interface;
A display subunit, configured to display, on the user interface, a state switching control when a selection operation of a user on a document title in the shared document is detected, where the state switching control is used to switch a display state of text content of the shared document;
and the triggering subunit is used for triggering a content folding instruction aiming at the shared document according to the switching operation of the state switching control by the user.
According to the method and the device, when a user performs folding operation on text content of a shared document, a document object model node corresponding to target text content of the folding operation is determined, a folding mark is added to the document object model node, then the target text content is folded on a user interface of a terminal, and when the target text content is in a folding state, if an updating instruction of the target text content is received, the target document content is updated based on the updating instruction. With this, the processing efficiency of the shared document can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a document processing method according to an embodiment of the present application.
Fig. 2 is an application scenario schematic diagram of a document processing method according to an embodiment of the present application.
Fig. 3 is a schematic application scenario diagram of another document processing method according to an embodiment of the present application.
Fig. 4 is a schematic application scenario diagram of another document processing method according to an embodiment of the present application.
Fig. 5 is an application scenario schematic diagram of another document processing method according to an embodiment of the present application.
FIG. 6 is a flowchart of another document processing method according to an embodiment of the present application.
Fig. 7 is a schematic application scenario diagram of another document processing method according to an embodiment of the present application.
Fig. 8 is a block diagram of a document processing apparatus according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides a document processing method, a document processing device, a storage medium and computer equipment. Specifically, the document processing method of the embodiment of the application may be executed by a computer device, where the computer device may be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a personal computer (PC, personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms.
For example, the computer device may be a terminal that may receive a content folding instruction for a shared document by a user of a first terminal, where the shared document is available for operation by at least two users having rights, either simultaneously or non-simultaneously; determining a target text title corresponding to a content folding instruction in the shared document; acquiring target text content corresponding to a target text title; and hiding the document object model node of the target text content, and hiding the target text content in a user interface of the terminal.
Based on the above problems, the embodiments of the present application provide a method, an apparatus, a computer device, and a storage medium for processing a document, which can improve the processing efficiency of a shared document.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The embodiment of the application provides a document processing method, which can be executed by a terminal or a server, and the embodiment of the application is described by taking the document processing method executed by the terminal as an example.
Referring to fig. 1, fig. 1 is a schematic flow chart of a document processing method according to an embodiment of the present application. The specific flow of the document processing method can be as follows:
101. in response to a content collapse instruction for the shared document.
The shared document can be an online document, and the online document can be used for realizing collaborative document editing among a plurality of terminal users, namely, a plurality of terminal users can edit document contents of the same online document at the same time. Specifically, the shared document may be available to at least two authorized users for simultaneous or non-simultaneous operation.
Wherein the content folding instruction is used for folding text content of the shared document. Specifically, the content folding instruction may be triggered by a user operation, for example, a shared document is displayed on a user interface of the terminal, and the user triggers the content folding instruction by operating the user interface.
In some embodiments, to facilitate user operation, the step of "responding to a content collapse instruction for a shared document" may include the following operations:
displaying the shared document on a user interface;
when detecting the selection operation of a user on the document title in the shared document, displaying a state switching control on a user interface;
and triggering a content folding instruction aiming at the shared document according to the switching operation of the state switching control by the user.
The User Interface (UI) is a medium for interaction and information exchange between a system and a User, and the User Interface realizes conversion between an internal form of information and a human acceptable form. The user interface is designed to be interactive communication related software between the user and the hardware, so that the user can conveniently and effectively operate the hardware to achieve bidirectional interaction, the work expected to be completed by the hardware is completed, the user interface is widely defined and comprises a man-machine interaction and a graphic user interface, and the user interface exists in the field of information communication between human beings and machines.
The state switching control is used for switching the display state of the text content of the shared document, and can be used for user operation, folding or unfolding of the content of the shared document and the like. The stateful switchover control may be arranged in a variety of patterns, for example, the stateful switchover control may be in a triangular pattern.
In the embodiment of the application, the terminal may be a computer, and the shared document may be displayed through a user interface of the computer.
For example, referring to fig. 2, fig. 2 is a schematic application scenario diagram of a document processing method according to an embodiment of the present application. In the user interface shown in fig. 2, the content of the shared document is presented.
For convenience of user operation, a plurality of document titles may be set in the shared document, for example, the document titles of the shared document in fig. 2 are "species information", "distribution", "evolution", "habit and reproduction" and "habit", respectively, and different document titles may correspond to different text contents.
Further, an operation control may be generated for each document title, and the operation control may be used to switch the display state of the content corresponding to the document title. In order to avoid that a plurality of operation controls are simultaneously displayed on the user interface and influence the display of text contents of the shared document, the operation controls can be hidden, and when the selection operation of a user on the text title is detected, the operation control corresponding to the text title can be displayed on the user interface. The selection operation may include various operation modes, such as clicking a text title through a mouse operation, or clicking a text title through a touch operation.
For example, please participate in fig. 3, fig. 3 is a schematic application scenario diagram of another document processing method according to an embodiment of the present application. In the user interface shown in fig. 3, when a click operation of the text titled "species information" in the shared document by the user is detected, an operation control is displayed in the user interface.
The operation controls may be in different forms, where the operation controls in different forms correspond to different display states of the text content, for example, the operation controls may include: an expanded form, a collapsed form, etc. When the operation control is in an unfolding form, the content of the text title corresponding to the operation control is in an unfolding state; when the operation control is in a folding form, the text title content corresponding to the operation control is in a folding state. For example, the operation control in fig. 3 may be in an expanded form, and the text content corresponding to the text heading "species information" corresponding to the operation control may be in an expanded state.
The switching operation may include various operations, such as a click operation, a touch operation, and the like. Further, the user of the first terminal can switch the operation control, so that a content folding instruction for the shared document is triggered.
102. And determining target text content corresponding to the content folding instruction in the shared document.
The target text content refers to text content corresponding to user selection operation.
In some embodiments, for convenience of user operation, the step of determining the target text content corresponding to the content folding instruction in the shared document may include the following operations:
determining a target text title corresponding to a content folding instruction in the shared document;
and acquiring target text content corresponding to the target text title.
The content folding instruction can be triggered by a user selecting an operation control in the shared document displayed by the user interface, and the detailed description is given specifically with reference to the previous step.
Further, according to the text title corresponding to the operation control of the user selection operation, determining a target text title corresponding to the content folding instruction, and then obtaining text content corresponding to the target text title, so that the target text content can be obtained.
The target text title refers to a text title corresponding to a selection operation of a user of the first terminal.
For example, the document title of the shared document may include: and if the user of the first terminal selects the first text title, determining that the first text title is the target text title, and using a content folding instruction to fold text content corresponding to the first text title.
The target text content refers to text content included under a target text title.
For example, with continued reference to fig. 3, if the target text is entitled "species information," the target text content may be:
distribution of
Fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, in the north and Beijing peripheral port shops, in the south da vietnam, thailand and north Burmese, and is a major member of the giant panda-sisal zoo herd in the south China.
Evolution of
The ancestor of the panda is the starting panda (Ailuaractos lufengensis), which is the earliest panda mainly eaten meat and evolved from the pseudo-bear.
Or, if the target text is entitled "distribution", the target text content is:
fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, in the north and Beijing peripheral port shops, in the south da vietnam, thailand and north Burmese, and is a major member of the giant panda-sisal zoo herd in the south China.
103. And hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal.
Furthermore, after the target text content is determined, in order to ensure that the data disorder of the shared document is not affected when the user of other terminals modifies the shared document, the document object model node of the target text content can be hidden.
The document object model (Document Object Model, DOM for short) is a standard programming interface for processing extensible markup language. The document object model is a platform and language independent Application Program Interface (API) that can dynamically access programs and scripts and update their content, structure, and style of web syndication documents (e.g., hypertext markup language documents). The document may be further processed and the result of the processing may be added to the current page. The DOM is a tree-based API document that requires that the entire document be represented in memory during processing.
A hypertext markup language (Hyper Text Markup Language, HTML) document is a document that can be read by a web browser to generate a web page that conveys various types of information. The hypertext markup language is a standard markup language for creating web pages. Hypertext markup language is a basic technology, often used by numerous websites for designing user interfaces for web pages, web page applications, and mobile applications along with cascading style sheets (Cascading Style Sheets, CSS), high-level scripting language JavaScript.
In some embodiments, in order to improve the processing efficiency of the shared document, the step of "hiding the document object model node of the target text content" may include the following operations:
Adding a hidden mark for a document object model node of the target text content;
and hiding the target text content corresponding to the hidden mark on the user interface when the hidden mark is identified.
Wherein, the document object model node is a DOM node, and the DOM node refers to that each component in an XML (extensible markup language) document is a node, the whole document is a document node, and each XMI label is an element node. The DOM node may generate a corresponding document object model node by parsing a hypertext markup language (HTML) string. Specifically, after an HTML (hypertext markup language) string is generated, the generated HTML string may be parsed to generate a corresponding DOM node.
Wherein the hidden mark is used for hiding the target text content. In particular, the hidden mark may be implemented using a collapsed attribute (i.e., hidden attribute) in a cascading style sheet technique.
Among them, cascading style sheets (Cascading Style Sheets, CSS) is a computer language for representing file styles such as HTML (an application of standard general markup language) or XML (a subset of standard general markup language). The CSS not only can statically modify the web page, but also can dynamically format each element of the web page in cooperation with various scripting languages. The CSS can accurately control the typesetting of element positions in the webpage at a pixel level, supports almost all font size styles, and has the capability of editing webpage objects and model styles.
Furthermore, the hidden attribute and the HTML data attribute are added to the HTML tag, so that the hiding processing of the text content can be realized. It should be noted that, the HTML tag is a markup language of a browser, generally appears in pairs, and specifies a presentation manner of content marked by the HTML tag, and the HTML tag itself is not presented in the display content of the actual user interface.
Wherein the HTML data attribute embeds the custom data by using the data attribute in the HTML. The data attribute is used for storing private custom data of a page or an application program. The data attribute gives the ability to embed custom data attributes on all HTML elements. The stored (custom) data can be utilized in the JavaScript of the page to create a better user experience (no Ajax calls or server-side database queries are made).
Specifically, the syntax of HTML data-:
<element data-*="somevalue">
the value is a value, that is, a value (in character strings) of a predetermined attribute. Based on this, the hidden mark attribute in the embodiment of the present application may be: data-collapsed.
Specifically, the hidden flag is generated according to the document object model node of the target text title, that is, the document object model node number (i.e., node ID) of the target text title is added as the value of the hidden flag attribute.
First, HTML code of a shared document may be acquired.
For example, the HTML code for a shared document may be as follows:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p id= "p-1" > fossil records that it was once distributed in the southeast yellow river, yangtze river and Zhujiang river basin, north and Beijing peripheral port shops, south da vietnam, thailand and north Burmese are major members of the southern panda-sisal zoo herd in China. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
Further, determining the document object model node included in the shared document according to the HTML code of the shared document may be: h1-1, h2-1, p-1, h2-2, p-2, h1-2, h2-3, p-3, etc.
For example, the target text title may be "distributed," and the document object model node that may determine the target text title is: h2-2, then a hidden flag may be generated from the node ID "h2-2" as: data-collapsed-h2=h2-2.
In some embodiments, the step of adding a hidden mark to a document object model node of the target text content may include the following operations:
acquiring a document object model node tree of a shared document;
traversing a document object model node tree, and determining a target document object model node corresponding to target text content;
a hidden mark is added in the target document object model node.
Wherein the document object model node tree includes all document object model nodes in the shared document. Each document object model element (node object) in the document object model tree corresponds to a hypertext markup language tag or text item within a tag in the hypertext markup language file. Specifically, the document object model node tree may analyze file contents of a hypertext markup language (HTML) file through a document object model, and build a document object model tree corresponding to the HTML file.
And determining a target document object model node corresponding to the target text content, namely searching out the document object model node associated with the target text content from all document object model nodes included in the HTML code of the shared document, so as to obtain the target document object model node.
For example, the target text content may be "fossil records that it has been distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north and Beijing Zhoukou shops, south Vietnam, thailand and North Burmese, the major members of the southern panda-sisal zoo herd in China. ", all document object model nodes in HTML code: the target document object model node corresponding to the target text content selected from h1-1, h2-1, p-1, h2-2, p-2, h1-2, h2-3 and p-3 can be: p-1, then a hidden flag may be added for p-1, resulting in the following code:
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
By adding the hidden mark for the node p-1, the text content corresponding to the node p-1 can be hidden in the user interface, and meanwhile, the text content corresponding to the node p-1 is ensured to still exist in the HTML code.
Specifically, in the embodiment of the present application, an additional storage space storage may be provided, and the node id added with the folding mark is stored through the storage space, so as to implement management on different states of the node.
In some embodiments, to meet the user's needs, after the step of hiding the target text content at the user interface of the terminal, the following steps may be further included:
and when a content expansion instruction aiming at the target text content is received, carrying out expansion processing on the document object model node of the target text content, and displaying the adjusted target text content on a user interface.
The content unfolding instruction is used for unfolding folded text content corresponding to the target text title in the shared text.
The expanding processing of the document object model node of the target text content refers to deleting the folding mark in the document object model node of the target text content.
In some embodiments, the step of "unfolding the document object model node of the target text content" may include the following operations:
obtaining a target document object model node corresponding to target text content from a document object model node tree of a shared document;
the hidden mark in the target document object model node is deleted.
First, the HTML code for obtaining the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
The target text content, that is, the folded text content, may be:
fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, in the north and Beijing peripheral port shops, in the south da vietnam, thailand and north Burmese, and is a major member of the giant panda-sisal zoo herd in the south China.
Further, from all document object model nodes in HTML code: the target document object model node corresponding to the target text content selected from h1-1, h2-1, p-1, h2-2, p-2, h1-2, h2-3 and p-3 can be: p-1, the p-1 node comprising a hidden flag: data-collapsed-h2= "h2-1", then deleting the hidden flag from the p-1 node, and obtaining the HTML code corresponding to the deleted target text content may be:
< p id= "p-1" > fossil records that it was once distributed in the southeast yellow river, yangtze river and Zhujiang river basin, north and Beijing peripheral port shops, south da vietnam, thailand and north Burmese are major members of the southern panda-sisal zoo herd in China. </p)
For example, referring to fig. 4, fig. 4 is a schematic view of another document processing scenario provided in an embodiment of the present application. The interface diagram above fig. 4 is a user interface after the text content with the text title "distributed" is folded, where the operation control of the text title "distributed" is in a folded state, which indicates that the text content with the text title "distributed" has been folded.
Further, by the user operating the operation control, the text content with the "distributed" text title may be expanded, and the interface diagram below in fig. 4 is a user interface after the text content with the "distributed" text title is expanded, where the operation control with the "distributed" text title is in an expanded state, which indicates that the text content with the "distributed" text title has been expanded.
Wherein the content rendering of the rich text editor follows f (state) = > view, i.e. the mapping of states to views, when the states change, the editor calculates the difference of views rendered according to the front and back states, and then modifies according to this difference. Therefore, the operation of the nodes can be reduced, and the running speed of the webpage is improved.
The Rich Text Editor, rich Text Editor, RTE for short, is a Text Editor which can be embedded in a browser and is obtained after being seen. The rich text editor is different from the text editor, and the user can download the free rich text editor on the internet to be embedded in own website or program, so that the user can edit articles or information conveniently.
In some embodiments, in order to improve the processing efficiency of the shared document, the step of "hiding the document object model node of the target text content" may further include the steps of:
when a deleting instruction aiming at the target text title is received, expanding the document object model node of the target text content, and displaying the target text content on a user interface;
and deleting the target text title according to the deleting instruction.
Wherein the deletion instruction is used for deleting the target text title from the shared document. After the document object model node of the target text content is subjected to hiding processing, the target text content corresponding to the target text title is in a folded state in the user interface, namely, is invisible to a user. When the user deletes the target text title, in order not to affect the loss of the target text content, the document object model node of the target text content may be expanded.
The expanding processing of the document object model node of the target text content refers to deleting the folding mark in the document object model node of the target text content. Specifically, reference may be made to the above steps, which are already described in detail, and will not be repeated here.
Further, according to the deleting instruction, deleting the target text title, and then displaying the target text content on the user interface.
For example, the HTML code for the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
When a deleting instruction of a user for 'distributing' the text titles is received, expanding document object model nodes of target text contents, deleting the target text titles according to the deleting instruction, and obtaining HTML codes of the shared document after deleting the target text titles, wherein the HTML codes are as follows:
< h1id= "h1-1" > species information h1>
< p id= "p-1" > fossil records that it was once distributed in the southeast yellow river, yangtze river and Zhujiang river basin, north and Beijing peripheral port shops, south da vietnam, thailand and north Burmese are major members of the southern panda-sisal zoo herd in China. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
For example, referring to fig. 5, fig. 5 is a schematic view of another document processing scenario provided in an embodiment of the present application. The interface diagram at the upper part of fig. 5 is a user interface before the user performs the deletion operation on the text title "distribution", and the interface diagram at the lower part of fig. 5 is a user interface after the user performs the deletion operation on the text title "distribution", and the text title "distribution" is deleted, and meanwhile, the text content corresponding to the text title "distribution" is displayed.
In some embodiments, after the user performs a delete operation on the text content or text title of the shared document, the re-rendering of the DOM node tree may be triggered by the rich text editor, and then the nodes in the edited shared document may be re-marked according to the stored DOM nodes. Since these marks are additionally added, these edits are not modified when the editor is updated. When the user edits and deletes the whole DOM node, the marks are synchronously deleted, and the residual condition can not occur.
Wherein the re-rendering is triggered when the result of the editing operation of the shared document by the user of the other terminal is synchronized to the current terminal, there may be some more complicated operations, such as deleting a large piece of text (including the text content currently folded by the user), and at this time, the folded content needs to be recalculated.
For example, the current shared document includes: title node h2-1 and title node h2-2, wherein title node h2-1 comprises paragraph node p-1 and title node h2-2 comprises paragraph node p-2. If the current header node h2-1 is in a collapsed state, the node p-1 is hidden in the user interface, and if it is detected that other end users delete the node h2-2, then the node p-1 and the node p-2 in the user interface should be hidden, and then the node after the node h2-2 in the node tree of the shared document needs to be re-marked.
In some embodiments, when the text content corresponding to the text title is in the folded state, for convenience of user operation, after the step of hiding the target text content in the user interface of the terminal, the following operations may be further included:
when an editing instruction for a target text title is received, displaying target text content on a user interface;
and editing the target text title according to the editing instruction.
The editing instruction is used for editing the target text title. Because the text content of the target text title is in the folded state, when the user edits the target text title, the text content of the target text title can be automatically displayed on the user interface, and the user can conveniently view the folded text content, so that the editing operation is performed on the target text title according to the text content. And then editing the target text according to the editing instruction.
In some embodiments, multiple levels of titles may be included in a shared document, with higher levels of text titles indicating a broader range of text content included in the text titles.
For example, referring to FIG. 2, the shared document displayed in the user interface of FIG. 2 may include a primary title and a secondary title, where the primary title is: species information, habit and reproduction; the secondary title may include: distribution, evolution, habit.
In order to ensure that folding states of all levels of titles do not affect each other, the step of hiding the document object model node of the target text content may include the following operations:
and hiding the document object model nodes of the text subtitles and the document object model nodes of the text contents corresponding to the text subtitles.
The target text content comprises at least one text subtitle, and the text subtitle can be the next title of the target text title. For example, the target text title may be: the first level title, the text subtitle may be: a secondary title.
The hiding processing of the document object model node of the text subtitle and the document object model node of the text content corresponding to the text subtitle refers to adding a folding mark to the document object model node of the text subtitle and the document object model node of the text content corresponding to the text subtitle respectively.
For example, the HTML code for the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
Wherein, the target text title may be a primary title: species information, text subtitles may be of the secondary title: and (5) distribution and evolution. When receiving a folding instruction to a target text title, a document object model node of a text subtitle included in the target text title includes: the document object model nodes of the text contents corresponding to the text subtitles h2-1 and h2-2 comprise: p-1, p-2. The target text title is: h1-1, the fold-signature generated may be: data-collapsed-h1= "h1-1", further, folding marks may be added to the nodes h2-1, h2-2 and p-1, p-2, respectively, to obtain the following HTML code:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" data-collated-h1= "h1-1" > distribution < >/h2 >
< p-id= "p-1" data-collapsed-h1= "h1-1" data-collapsed-h2= "h2-1" > fossil records that it was once distributed in the southeast yellow river, the Yangtze river and the Zhujiang river basin, north and Beijing peristomal store, south da vietnam, thailand and Burmese north are major members of the southern giant panda-sisal zoon zoo population in China. </p)
< h2 id= "h2-2" data-collapsed-h1= "h1-1" > evolution of h2>
< p-id= "p-2" data-collapsed-h1= "h1-1" > ancestor of panda was starting panda (Ailuaractos lufengensis), which is the earliest meat-based panda evolved from the pseudo-bear class. </p)
In some embodiments, to ensure independence between the various levels of title folding states, after the step of "hiding the document object model node of the target text content", the following steps may be further included:
when a content expanding instruction aiming at a target text title is received, acquiring the hidden state of a document object model node of text content corresponding to a text subtitle;
and displaying the target text content on the user interface based on the hidden state.
The content expansion instruction is used for expanding text content corresponding to the target text title, namely expanding document object model nodes corresponding to the text content of the target text title, and deleting folding marks of the target text title in the document object model nodes corresponding to the text content of the target text title.
For example, before folding, the HTML code for the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" data-collated-h1= "h1-1" > distribution < >/h2 >
< p-id= "p-1" data-collapsed-h1= "h1-1" data-collapsed-h2= "h2-1" > fossil records that it was once distributed in the southeast yellow river, the Yangtze river and the Zhujiang river basin, north and Beijing peristomal store, south da vietnam, thailand and Burmese north are major members of the southern giant panda-sisal zoon zoo population in China. </p)
< h2 id= "h2-2" data-collapsed-h1= "h1-1" > evolution of h2>
< p-id= "p-2" data-collapsed-h1= "h1-1" > ancestor of panda was starting panda (Ailuaractos lufengensis), which is the earliest meat-based panda evolved from the pseudo-bear class. </p)
After folding, the HTML code of the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
Because the text content of the shared document text subtitle "distribution" before folding is in a folding state, that is, the content of the node p1 is in a hidden state, when the unfolding operation is performed on the target text subtitle "species information", the content of the node p1 is still in a hidden state, so that mutual influence among the folding states of all levels of titles can be realized.
104. And when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
The second terminal refers to other terminals for opening the shared document. The user of the second terminal and the user of the first terminal may operate on the shared document simultaneously or non-simultaneously.
In some embodiments, in order to avoid document data from being disordered when the shared document interoperates, the step of receiving the updated content for the target text content in the shared document sent by the second terminal may include the following operations:
When receiving an update instruction for the shared document sent by the server, acquiring the updated shared document;
and determining the difference text content of the shared document and the updated shared document to obtain updated content.
The updating instruction is used for triggering the terminal to update the content of the shared document. Because the shared document can support the simultaneous editing operation and the like of the users of a plurality of terminals, when any user modifies the shared document and stores the modification, the server updates the content of the shared document according to the content modified by the user, and the updated shared document is obtained.
For example, the terminal that currently opens the shared document may include: the terminal comprises a current terminal, a terminal A and a terminal B, wherein a user operating the current terminal is a user of a first terminal, the user operating the terminal A can be the user A, and the user operating the terminal B can be the user B. The server detects that the user A carries out modification operation on the content of the shared document through the terminal A and stores the modified shared document, the server can update the content of the shared document according to the modification operation of the user A to obtain the updated shared document, and then the server can respectively send update instructions to the current terminal and the terminal so that the current terminal and the terminal B update the content of the shared document.
After the terminal receives the update instruction of the shared document sent by the server, the updated shared document can be obtained from the server. Further, the target document content of the shared document is adjusted according to the obtained updated shared document.
Further, after the updated shared document is obtained, the updated shared document and the content of the shared document can be compared, so that the difference text content of the shared document and the updated shared document is determined, and the target text content is obtained.
For example, the text content of the shared document is:
distribution and evolution
Distribution of
Fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, in the north and Beijing peripheral port shops, in the south da vietnam, thailand and north Burmese, and is a major member of the giant panda-sisal zoo herd in the south China.
Evolution of
The ancestor of the panda is the starting panda (Ailuaractos lufengensis), which is the earliest panda mainly eaten meat and evolved from the pseudo-bear.
The text content of the updated shared document may be:
distribution and evolution
Distribution of
Fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, and is a major member of the panda-sisal zoon population in south China.
Evolution of
The ancestor of the panda is the starting panda (Ailuaractos lufengensis), which is the earliest panda mainly eaten meat and evolved from the pseudo-bear.
The difference text content in the shared document can be determined according to the content of the shared document and the updated document as follows: north and beijing peripheral port shops, south da vietnam, thailand and north maine.
Further, the target text content in the shared document is obtained, then the target text content is matched with the difference text content, and if the target text content and the difference text content have the same content, the target text content can be modified based on the difference text content.
For example, the target text content may be:
fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, in the north and Beijing peripheral port shops, in the south da vietnam, thailand and north Burmese, and is a major member of the giant panda-sisal zoo herd in the south China.
The difference text content may be: north and beijing peripheral port shops, south da vietnam, thailand and north maine.
Deleting the difference text content in the updated shared document, the shared document can delete the difference text content in the target text content, and the modified shared text content is obtained as follows: fossil records it has been distributed in the past in the southeast yellow river, the Yangtze river and the Zhujiang river basin, and is a major member of the panda-sisal zoon population in south China.
Therefore, the modification of the content in the folded state can be realized, so that the accuracy of the shared document data can be ensured when a plurality of persons cooperatively operate the shared document.
The embodiment of the application discloses a document processing method, which comprises the following steps: responding to a content folding instruction for the shared document; determining target text content corresponding to a content folding instruction in a shared document, wherein the content of the shared document is synchronously displayed in user interfaces of a first terminal and a second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal; hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal; and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content. When the user performs folding operation on the text content of the shared document, determining a document object model node corresponding to the target text content of the folding operation, adding a folding mark for the document object model node, then folding the target text content at a user interface of the terminal, and when the target text content is in a folding state, if an updating instruction for the target text content is received, updating the target document content based on the updating instruction. With this, the processing efficiency of the shared document can be improved.
In light of the foregoing, the document processing method of the present application will be further described below by way of example. Referring to fig. 6, fig. 6 is a flowchart of another document processing method according to an embodiment of the present application. Taking the application of the document processing method to the terminal as an example, the specific flow can be as follows:
201. the terminal determines a plurality of text titles in the shared document, generates a state switching control of each text title, and displays the state switching control on a user operation interface of the terminal.
The state switching control may be used for switching a display state of the text content of the text title by a user operation, where the display state may include: and displaying and hiding.
Specifically, determining the text title in the shared text may obtain the HTML code of the shared document, and determining the text title according to the title tag in the HTML code.
For example, the HTML code to obtain the shared document may be:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p id= "p-1" > fossil records that it was once distributed in the southeast yellow river, yangtze river and Zhujiang river basin, north and Beijing peripheral port shops, south da vietnam, thailand and north Burmese are major members of the southern panda-sisal zoo herd in China. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
Then it may be determined that the text titles in the shared document include: species information, distribution, evolution, habit and propagation, habit.
Further, a corresponding state switching control is generated for each text title, and the state switching control can be designed into various patterns, such as triangles and the like.
When a user opens a shared document through a terminal, a state operation control of each text title in the shared document may be displayed, for example, refer to fig. 7, and fig. 7 is a schematic view of another application scenario of document processing provided in an embodiment of the present application. In the user operation interface shown in fig. 7, a part of text content of the shared document is displayed, including a text title: species information, distribution, evolution, habit and reproduction habit, wherein each text title corresponds to a state switching control (triangle pattern), and the text content of each text title can be in an unfolding state.
In the embodiment of the application, when the user initially opens the shared document, the text content of the shared document is displayed, and meanwhile, the control is switched in the state of displaying each text title, so that the user can know the folding state of the text content, and follow-up operation is performed according to the current folding state.
202. And the terminal responds to the selection operation of the user on the state switching control, and determines a target text title corresponding to the state switching control of the selection operation.
The selection operation refers to clicking or touch operation on a state switching control, and the like, and a target text title which is required to be operated by a user is determined according to the user selection operation.
For example, when a user selection operation of a state switch control for "distribution" of text titles is detected, it may be determined that the target text title is: distribution.
203. The terminal acquires the target text content of the target text title.
For example, the target text title may be: the text content corresponding to the distribution of the text title may be "fossil records that it was distributed in the yellow river, yangtze river and Zhujiang river basin in the past, the north and Beijing peripheral port stores, the south da vietnam, thailand and north Burmese, are the main members of the giant panda-sisal zoo herd in the south China. ", the target text content can be obtained.
204. And adding a folding mark for the target text content by the terminal, and hiding the target content in the user operation interface.
Wherein the collapse marks are added to the target text content, namely, the collapse marks are added to the nodes of the target text content in the HTML code of the shared document. The collapse tag may be generated from the node ID of the target text title.
For example, the node ID of the target text title may be: h2-1, the fold mark may be: data-collapsed-h2= "h2-1", then add the collapse tag for the node of the target text content.
For example, the HTML code of the shared document with the fold-mark added is as follows:
< h1id= "h1-1" > species information h1>
< h2id= "h2-1" > distribution </h2>
< p-id= "p-1" data-collapsed-h2= "h2-1" > fossil records it was once distributed in the past in southeast yellow river, yangtze river and Zhujiang river basin, north Beijing Zhoukou store, south da vietnam, thailand north burma, are major members of the south giant panda-sisal zoo herd in china. </p)
< h2id= "h2-2" > evolution h2>
< p id= "p-2" > ancestor of panda is starting panda (Ailuaractos lufengensis), which is the earliest panda mainly of meat, evolved from pseudo-bear. </p)
< h1id= "h1-2" > habit and reproduction h1>
< h2id= "h2-3" > habit-
< p id= "p-3" > pandas like living alone, each with a separate active area. Apart from estrus, solitary life is often passed, and both day and night are used. The nest area is 3.9-6.4 km2, the nest area between individuals is overlapped, and the nest area of male body is slightly larger than that of female body. Females only move in the nuclear domain of 30-40 hectares most of the time, and the nest domains between females do not overlap. </p)
Further, hiding the target text content in the user operation interface, and switching the display state of the state switching control of the target text title from a first state to a second state, wherein the first state represents that the content of the text title is unfolded, and the second state represents that the content of the text title is folded, namely invisible to the user.
205. And the terminal receives the document updating instruction, and updates the target text content according to the document updating instruction to obtain the updated shared document.
The document updating instruction is used for triggering the terminal to update the target text content of the shared document, and the server can send the document updating instruction to the terminal so that the operation of the user of other terminals on the shared document is synchronized to the shared document of the current terminal in real time.
At this time, the target text content is in a hidden state at the user operation interface of the terminal, but the HTML data of the shared document stored in the terminal still includes the target text content. Therefore, after the user of other terminals modifies the target text content, the server sends a document updating instruction to the current terminal, and the current terminal can synchronously modify the target text content in the stored HTML data according to the document updating instruction so as to realize the cooperative operation on the shared document and ensure the synchronism of the shared document data.
The embodiment of the application discloses a document processing method, which comprises the following steps: the method comprises the steps that a terminal determines a plurality of text titles in a shared document, generates a state switching control of each text title, displays the state switching control on a user operation interface of the terminal, responds to selection operation of the state switching control by a user, determines a target text title corresponding to the state switching control of the selection operation, obtains target text content of the target text title, adds a folding mark for the target text content, hides the target content on the user operation interface, receives a document updating instruction, updates the target text content according to the document updating instruction, and obtains the updated shared document. With this, document processing management efficiency can be improved.
In order to facilitate better implementation of the document processing method provided by the embodiment of the application, the embodiment of the application also provides a document processing device based on the document processing method. Where the meaning of a noun is the same as in the document processing method described above, specific implementation details may be referred to in the description of the method embodiments.
Referring to fig. 8, fig. 8 is a block diagram of a document processing apparatus according to an embodiment of the present application, where the apparatus includes:
a response unit 301 for responding to a content folding instruction for a shared document;
a determining unit 302, configured to determine target text content corresponding to the content folding instruction in the shared document, where the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal;
a processing unit 303, configured to perform hiding processing on a document object model node of the target text content, and hide the target text content in a user interface of the first terminal;
and the adjusting unit 304 is configured to adjust, when receiving the updated content for the target text content in the shared document sent by the second terminal, the target text content corresponding to the document object model node based on the updated content.
In some embodiments, the processing unit 303 may include:
an adding subunit, configured to add a hidden flag to a document object model node of the target text content;
and the hiding subunit is used for hiding the target text content corresponding to the hiding mark on the user interface when the hiding mark is identified.
In some embodiments, the add subunit may be specifically configured to:
acquiring a document object model node tree of the shared document, wherein the document object model node tree comprises all document object model nodes in the shared document;
traversing the document object model node tree, and determining a target document object model node corresponding to the target text content;
the hidden mark is added in the target document object model node.
In some embodiments, the adjustment unit 304 may include:
the receiving subunit is used for acquiring the updated shared document when receiving the update instruction for the shared document sent by the server;
and the first determining subunit is used for determining the difference text content of the shared document and the updated shared document to obtain the updated content.
In some embodiments, the apparatus may further comprise:
And the expansion unit is used for carrying out expansion processing on the document object model node of the target text content when receiving a content expansion instruction aiming at the target text content, and displaying the adjusted target text content on the user interface.
In some embodiments, the deployment unit may include:
a first obtaining subunit, configured to obtain, from a document object model node tree of the shared document, a target document object model node corresponding to the target text content;
and the deleting subunit is used for deleting the hidden mark in the target document object model node.
In some embodiments, the determining unit 302 may include:
a second determining subunit, configured to determine a target text title corresponding to the content folding instruction in the shared document;
and the second acquisition subunit is used for acquiring the target text content corresponding to the target text title.
In some embodiments, the apparatus may further comprise:
a first display unit, configured to, when receiving a deletion instruction for the target text title, perform expansion processing on a document object model node of the target text content, and display the target text content on the user interface;
And the first operation unit is used for deleting the target text title according to the deleting instruction.
In some embodiments, the apparatus may further comprise:
a second display unit configured to display the target text content on the user interface when an editing instruction for the target text title is received;
and the second operation unit is used for editing the target text title according to the editing instruction.
In some embodiments, the processing unit 303 may include:
and the processing subunit is used for hiding the document object model node of the text subtitle and the document object model node of the text content corresponding to the text subtitle.
In some embodiments, the apparatus may further comprise:
an obtaining unit, configured to obtain a hidden state of a document object model node of text content corresponding to the text subtitle when a content expansion instruction for the target text title is received;
and the third display unit is used for displaying the target text content on the user interface based on the hidden state.
In some embodiments, the response unit 301 may include:
a display subunit, configured to display the shared document on the user interface;
A display subunit, configured to display, on the user interface, a state switching control when a selection operation of a user on a document title in the shared document is detected, where the state switching control is used to switch a display state of text content of the shared document;
and the triggering subunit is used for triggering a content folding instruction aiming at the shared document according to the switching operation of the state switching control by the user.
The embodiment of the application discloses a document processing device, which responds to a content folding instruction for a shared document through a response unit 301; the determining unit 302 determines target text content corresponding to the content folding instruction in the shared document, wherein the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal; the processing unit 303 performs hiding processing on the document object model node of the target text content, and hides the target text content at the user interface of the first terminal; the adjustment unit 304 adjusts the target text content corresponding to the document object model node based on the updated content when receiving the updated content for the target text content in the shared document sent by the second terminal. With this, the processing efficiency of the shared document can be improved.
Correspondingly, the embodiment of the application also provides computer equipment, which can be a server. As shown in fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer readable storage media, and a computer program stored on the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be appreciated by those skilled in the art that the computer device structure shown in the figures is not limiting of the computer device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 501 is a control center of the computer device 500, connects various parts of the entire computer device 500 using various interfaces and lines, and performs various functions of the computer device 500 and processes data by running or loading software programs and/or modules stored in the memory 502, and calling data stored in the memory 502, thereby performing overall monitoring of the computer device 500.
In the embodiment of the present application, the processor 501 in the computer device 500 loads the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 executes the application programs stored in the memory 502, so as to implement various functions:
responding to a content folding instruction for the shared document; determining target text content corresponding to a content folding instruction in a shared document, wherein the content of the shared document is synchronously displayed in user interfaces of a first terminal and a second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal; hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal; and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 9, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch display 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art will appreciate that the computer device structure shown in FIG. 9 is not limiting of the computer device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The touch display screen 503 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of a computer device, which may be composed of graphics, guidance information, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 501, and can receive commands from the processor 501 and execute them. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 501 to determine the type of touch event, and the processor 501 then provides a corresponding visual output on the display panel based on the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 503 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch sensitive display 503 may also implement an input function as part of the input unit 506.
The radio frequency circuitry 504 may be used to transceive radio frequency signals to establish wireless communications with a network device or other computer device via wireless communications.
The audio circuitry 505 may be used to provide an audio interface between a user and a computer device through speakers, microphones, and so on. The audio circuit 505 may transmit the received electrical signal after audio data conversion to a speaker, and convert the electrical signal into a sound signal for output by the speaker; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 505 and converted into audio data, which are processed by the audio data output processor 501 for transmission to, for example, another computer device via the radio frequency circuit 504, or which are output to the memory 502 for further processing. The audio circuit 505 may also include an ear bud jack to provide communication of the peripheral ear bud with the computer device.
The input unit 506 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 507 is used to power the various components of the computer device 500. Alternatively, the power supply 507 may be logically connected to the processor 501 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 507 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 9, the computer device 500 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which will not be described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the computer device provided in this embodiment responds to a content folding instruction for a shared document; determining target text content corresponding to a content folding instruction in a shared document, wherein the content of the shared document is synchronously displayed in user interfaces of a first terminal and a second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal; hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal; and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in any of the document processing methods provided by embodiments of the present application. For example, the computer program may perform the steps of:
responding to a content folding instruction for the shared document;
determining target text content corresponding to a content folding instruction in a shared document, wherein the content of the shared document is synchronously displayed in user interfaces of a first terminal and a second terminal, and is used for simultaneous or non-simultaneous operation of a user of the first terminal and a user of the second terminal;
hiding the document object model node of the target text content, and hiding the target text content in a user interface of the first terminal;
and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any document processing method provided in the embodiments of the present application may be executed by the computer program stored in the storage medium, so that the beneficial effects that any document processing method provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
The foregoing has described in detail the methods, apparatuses, storage media and computer devices provided by the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are provided to assist in understanding the methods and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (14)

1. A document processing method, applied to a first terminal, the method comprising:
responding to a content folding instruction for the shared document;
determining target text content corresponding to the content folding instruction in the shared document, wherein the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal, and the user of the first terminal and the user of the second terminal are operated simultaneously or non-simultaneously;
acquiring a document object model node tree of the shared document, wherein the document object model node tree comprises all document object model nodes in the shared document, and each document object model element in the document object model tree corresponds to one hypertext markup language tag or text in the tag in a hypertext markup language file;
traversing the document object model node tree, and determining a target document object model node corresponding to the target text content;
adding a hiding mark in the target document object model node, and hiding the target text content in a user interface of the first terminal;
and when receiving the updated content which is sent by the second terminal and aims at the target text content in the shared document, adjusting the target text content corresponding to the document object model node based on the updated content.
2. The method of claim 1, wherein hiding the target text content at the user interface of the first terminal comprises:
and hiding the target text content corresponding to the hidden mark on the user interface when the hidden mark is identified.
3. The method of claim 1, wherein the receiving updated content for the target text content in the shared document sent by the second terminal comprises:
when receiving an update instruction for the shared document sent by a server, acquiring the updated shared document;
and determining the difference text content of the shared document and the updated shared document to obtain the updated content.
4. The method of claim 1, further comprising, after hiding the target text content at a user interface of the first terminal:
and when a content expansion instruction aiming at the target text content is received, carrying out expansion processing on the document object model node of the target text content, and displaying the adjusted target text content on the user interface.
5. The method of claim 4, wherein the expanding the document object model node of the target text content comprises:
Obtaining a target document object model node corresponding to the target text content from the document object model node tree of the shared document;
and deleting the hidden mark in the target document object model node.
6. The method of claim 1, wherein the determining the target text content in the shared document corresponding to the content folding instruction comprises:
determining a target text title corresponding to the content folding instruction in the shared document;
and acquiring target text content corresponding to the target text title.
7. The method as recited in claim 6, further comprising:
when a deleting instruction aiming at the target text title is received, expanding a document object model node of the target text content, and displaying the target text content on the user interface;
and deleting the target text title according to the deleting instruction.
8. The method of claim 6, further comprising, after hiding the target text content at a user interface of the first terminal:
displaying the target text content on the user interface when an editing instruction for the target text title is received;
And editing the target text title according to the editing instruction.
9. The method of claim 6, wherein the target text content includes at least one text subtitle therein, the text subtitle being a next level title of the target text title;
the method further comprises the steps of:
and hiding the document object model node of the text subtitle and the document object model node of the text content corresponding to the text subtitle.
10. The method as recited in claim 9, further comprising:
when a content expanding instruction aiming at the target text title is received, acquiring the hidden state of a document object model node of the text content corresponding to the text subtitle;
and displaying the target text content on the user interface based on the hidden state.
11. The method of claim 1, wherein the responding to the content collapse instruction for the shared document comprises:
displaying the shared document on the user interface;
when detecting the selection operation of a user on the document title in the shared document, displaying a state switching control on the user interface, wherein the state switching control is used for switching the display state of the text content of the shared document;
And triggering a content folding instruction aiming at the shared document according to the switching operation of the user on the state switching control.
12. A document processing apparatus, the apparatus comprising:
a response unit configured to respond to a content folding instruction for the shared document;
the determining unit is used for determining target text content corresponding to the content folding instruction in the shared document, wherein the content of the shared document is synchronously displayed in user interfaces of the first terminal and the second terminal and is used for the user of the first terminal and the user of the second terminal to operate simultaneously or non-simultaneously;
the processing unit is used for acquiring a document object model node tree of the shared document, wherein the document object model node tree comprises all document object model nodes in the shared document, and each document object model element in the document object model tree corresponds to one hypertext markup language tag or text in the tag in the hypertext markup language file; traversing the document object model node tree, and determining a target document object model node corresponding to the target text content; adding a hiding mark in the target document object model node, and hiding the target text content in a user interface of the first terminal;
And the adjusting unit is used for adjusting the target text content corresponding to the document object model node based on the updated content when receiving the updated content which is sent by the second terminal and is aimed at the target text content in the shared document.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements the document processing method of any one of claims 1 to 11 when the program is executed by the processor.
14. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the document processing method of any one of claims 1 to 11.
CN202111131718.0A 2021-09-26 2021-09-26 Document processing method, device, computer equipment and storage medium Active CN113849102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111131718.0A CN113849102B (en) 2021-09-26 2021-09-26 Document processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111131718.0A CN113849102B (en) 2021-09-26 2021-09-26 Document processing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113849102A CN113849102A (en) 2021-12-28
CN113849102B true CN113849102B (en) 2023-08-08

Family

ID=78980202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111131718.0A Active CN113849102B (en) 2021-09-26 2021-09-26 Document processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113849102B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115079891B (en) * 2021-03-01 2024-03-15 北京字跳网络技术有限公司 Document content display method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI244010B (en) * 2004-08-27 2005-11-21 Infopower Corp Pivot analysis with the XML/XSL mechanism
WO2007105364A1 (en) * 2006-03-06 2007-09-20 Justsystems Corporation Document processing device and document processing method
CN110795916A (en) * 2019-09-27 2020-02-14 北京浪潮数据技术有限公司 Side bar display method and system of document system
CN113158619A (en) * 2021-04-16 2021-07-23 腾讯科技(深圳)有限公司 Document processing method and device, computer readable storage medium and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9049258B2 (en) * 2009-09-17 2015-06-02 Border Stylo, LLC Systems and methods for anchoring content objects to structured documents
US20130055167A1 (en) * 2011-08-31 2013-02-28 Microsoft Corporation Animation for Expanding/Collapsing Content and for Sorting Content in an Electronic Document

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI244010B (en) * 2004-08-27 2005-11-21 Infopower Corp Pivot analysis with the XML/XSL mechanism
WO2007105364A1 (en) * 2006-03-06 2007-09-20 Justsystems Corporation Document processing device and document processing method
CN110795916A (en) * 2019-09-27 2020-02-14 北京浪潮数据技术有限公司 Side bar display method and system of document system
CN113158619A (en) * 2021-04-16 2021-07-23 腾讯科技(深圳)有限公司 Document processing method and device, computer readable storage medium and computer equipment

Also Published As

Publication number Publication date
CN113849102A (en) 2021-12-28

Similar Documents

Publication Publication Date Title
US10528217B2 (en) Automatically generating column layouts in electronic documents
US20180213077A1 (en) Method and apparatus for controlling smart device, and computer storage medium
US10108715B2 (en) Transformation and presentation of on-demand native application crawling results
CN103365862B (en) It is a kind of for generating the method and apparatus of picture corresponding with the page
WO2017028611A1 (en) Form implementation method and apparatus
WO2014172680A2 (en) Client side page processing
US20120011447A1 (en) Facilitating propagation of user interface patterns or themes
CN111178012A (en) Form rendering method, device and equipment and storage medium
CN110399583B (en) Page display method and device, electronic equipment and storage medium
CN103336794B (en) For providing the corresponding method and apparatus that information is presented in target pages
CN103546623B (en) Method, apparatus and equipment for sending voice messaging and its text description information
WO2017180355A1 (en) Dynamically formatting scalable vector graphics
CN110609965A (en) Page display method and device and storage medium
CN103631877A (en) Webpage table processing method
CN108139895A (en) Font font preview
JPWO2012141183A1 (en) Content providing device for various terminal devices
KR101727235B1 (en) Document editing system and method supporting collaborative editing
CN110278141A (en) A kind of processing method of instant communication information, device and storage medium
CN113849102B (en) Document processing method, device, computer equipment and storage medium
US10628526B2 (en) Providing suggested diagrammatic representations of user entered textual information
CN114201097A (en) Interaction method among multiple application programs
US20150120650A1 (en) Methods and Systems for Utilizing Global Entities In Software Applications
CN113158619A (en) Document processing method and device, computer readable storage medium and computer equipment
US10261979B2 (en) Method and apparatus for rendering a screen-representation of an electronic document
CN113391803B (en) Method, device, terminal equipment and storage medium for creating object management engine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant