Display control method and device of online document, electronic equipment and storage medium

By adjusting the view based on the cursor position in online documents, the problem of the user's view jumping around due to editing by others is solved, improving the efficiency of collaborative editing and the user experience.

CN111767702BActive Publication Date: 2025-11-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010817176.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-14
Publication Date
2025-11-04
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

During collaborative editing of online documents, the user's view position keeps changing as others edit, resulting in low processing efficiency.

Method used

By adjusting the document view based on the cursor position, keeping the cursor in the first position and anchoring the view according to the cursor position, the view is reduced from changing as others edit.

Benefits of technology

It enhances the collaborative capabilities of online documents, improves office efficiency, and reduces the problem of constant page refreshes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111767702B_ABST
    Figure CN111767702B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field, in particular to an online document display control method and device, electronic equipment and storage medium, so as to improve the processing efficiency of the online document, wherein the method comprises the following steps: updating the content edited by a target object according to the editing operation of the target object in a target online document in a document view display area and controlling the display position of the cursor in the document view; and adjusting the content edited by at least one collaborative object according to the editing operation of the at least one collaborative object on the target online document in the document view display area, so as to keep the cursor at a first position, wherein the first position is the display position of the cursor in a first document view, and the first document view is the document view displayed in the document view display area before the adjustment. Since the application can anchor the document view based on the position of the cursor when multiple persons edit the target online document collaboratively, it is no longer necessary to constantly adjust the document view, and the processing efficiency of the online document is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an online document display control method and device, electronic equipment and storage medium. BACKGROUND

[0002] An online document is an application supporting multi-person collaborative editing, and users can edit the document in real time on a webpage or an application. Such an application often provides the ability of collaborative positioning display to mark the position being operated by a collaborator and reduce conflicts in the collaboration process.

[0003] However, in the related art, when a user collaborates with others to edit an online document, the user's view position is calculated according to the length of the document, so that the user's own page will also jump and change following the editing of the document by others, and thus the user needs to constantly adjust his own window to achieve the purpose of common collaboration, and the processing efficiency of the document is low. SUMMARY

[0004] Embodiments of the present application provide an online document display control method and device, electronic equipment and storage medium to improve the collaboration ability of the online document and improve the processing efficiency of the online document.

[0005] An online document display control method provided by an embodiment of the present application comprises:

[0006] updating content edited by a target object in a document view display area according to an editing operation of the target object in a target online document and controlling the display position of a cursor in the document view, the target online document being a collaboratively editable online document; and

[0007] adjusting content edited by at least one collaborative object in the document view display area according to an editing operation of the at least one collaborative object on the target online document to keep the cursor at a first position, the first position being the display position of the cursor in a first document view, the first document view being a document view displayed in the document view display area before the adjustment.

[0008] An online document display control device provided by an embodiment of the present application comprises:

[0009] a content updating unit configured to update content edited by a target object in a document view display area according to an editing operation of the target object in a target online document and control the display position of a cursor in the document view, the target online document being a collaboratively editable online document;

[0010] a view adjusting unit, configured to adjust content edited by the at least one collaborative object in the document view display area according to an editing operation of the at least one collaborative object on the target online document, wherein the first position is a display position of the cursor in a first document view before the adjustment.

[0011] Optionally, the view adjusting unit is specifically configured to:

[0012] obtain first position information of the cursor in the first document view when receiving the content update information sent by the online document server, the content update information being sent according to an editing operation of the at least one collaborative object on the target online document;

[0013] format the target online document according to the content update information, and determine second position information of a second position of the cursor in a second document view after the formatting;

[0014] adjust display content of the second document view according to the first position information and the second position information, and adjust the display position of the cursor to the first position;

[0015] render a document view and the cursor in the document view display area according to the display content and the first position information.

[0016] Optionally, the view adjusting unit is further configured to:

[0017] obtain content update information of the target object on the target online document before formatting the target online document according to the content update information; and

[0018] The view adjusting unit is specifically configured to:

[0019] format the target online document according to the content update information of the at least one collaborative object on the target online document and the content update information of the target object on the target online document, and determine second position information of a second position of the cursor in a second document view after the formatting.

[0020] Optionally, the view adjusting unit is specifically configured to:

[0021] obtain first position information of the first position from a formatting engine when receiving the content update information sent by the online document server;

[0022] sending the content update information of the target online document to the layout engine, and obtaining a second document view and second position information of a second position where the cursor is displayed in the second document view from the layout engine, the second document view being obtained by the layout engine after re-layout of the target online document according to the content update information of the target online document;

[0023] adjusting display content of the second document view according to the first position information and the second position information, and adjusting the display position of the cursor to the first position;

[0024] sending the display content and the first position information to a rendering engine, so that the rendering engine renders a document view and a cursor in the document view display area.

[0025] Optionally, the view adjustment unit is further configured to: obtain content update information of the target object for the target online document before sending the content update information of the target online document to the layout engine; and

[0026] The view adjustment unit is specifically configured to:

[0027] send the content update information of the target online document by the at least one collaborative object and the content update information of the target object for the target online document to the layout engine.

[0028] Optionally, the view adjustment unit is specifically configured to:

[0029] obtain a scroll value for the document view display area when the cursor is kept at the first position according to the first position information and the second position information;

[0030] adjust the document view display area according to the scroll value, so as to adjust display content in the document view display area.

[0031] Optionally, the view adjustment unit is specifically configured to:

[0032] if the scroll value is positive, the document view display area is scrolled downward along a vertical direction, and a scroll distance is the same as the scroll value;

[0033] if the scroll value is negative, the document view display area is scrolled upward along the vertical direction, and a scroll distance is an absolute value of the scroll value.

[0034] Optionally, the view adjustment unit is specifically configured to:

[0035] The difference between the coordinate value in the vertical direction in the second position information and the coordinate value in the vertical direction in the first position information is taken as a scroll value for the document view display area when the cursor is kept at the first position.

[0036] Optionally, the view adjusting unit is specifically used for:

[0037] According to the display content, rendering document content in the document view display area; and

[0038] According to the first position information, determining the position of the cursor in the document view display area, and drawing the cursor at the determined position.

[0039] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the display control methods of online documents described above.

[0040] An embodiment of the present application provides a computer readable storage medium including program code, and when the program code is run on an electronic device, the program code is used to make the electronic device execute the steps of any one of the display control methods of online documents described above.

[0041] An embodiment of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of any one of the display control methods of online documents described above.

[0042] The present application has the following beneficial effects:

[0043] An embodiment of the present application provides a display control method, device, electronic device and storage medium of an online document. Since the method for calculating a view position when editing an online document is given in the embodiment of the present application, the view is anchored according to a cursor, specifically, when a user and another person edit a document at the same time, the area edited by the user is calculated according to the cursor position, and when the document view display area is kept for collaborative editing with the other person, the cursor is at the display position in the document view displayed in the adjusted document view display area, and will not change because of the editing of the other person, thereby reducing the problem of constant jumping of the page when collaboratively editing, so that the collaborative ability of the online document can be improved, and the office efficiency is improved.

[0044] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0045] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0046] Figure 1 A schematic diagram of an application scenario in an embodiment of the present application;

[0047] Figure 2 A flowchart of a display control method of an online document in an embodiment of the present application;

[0048] Figure 3A A schematic diagram of a first document view in an embodiment of the present application;

[0049] Figure 3B A schematic diagram of a first second document view in an embodiment of the present application;

[0050] Figure 3C A schematic diagram of a second second document view in an embodiment of the present application;

[0051] Figure 4 A flowchart of a method of adjusting a document view in an embodiment of the present application;

[0052] Figure 5 A complete method flowchart of an online document display control on a browser side in an embodiment of the present application;

[0053] Figure 6 A schematic diagram of a component structure of a document editor in an embodiment of the present application;

[0054] Figure 7 A flowchart of another display control method of an online document in an embodiment of the present application;

[0055] Figure 8 An interaction timing diagram of a display control method of an online document in an embodiment of the present application;

[0056] Figure 9 A schematic diagram of a component structure of a display control apparatus of an online document in an embodiment of the present application;

[0057] Figure 10A hardware component structure diagram of an electronic device using the embodiment of the present application;

[0058] Figure 11 A hardware component structure diagram of a terminal device using the embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments described in the present application document, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application technical solutions.

[0060] Some concepts involved in the embodiments of the present application will be introduced below.

[0061] Online document: refers to a document that can be edited by multiple people at the same time, supports multiple types such as online Word / Excel / PPT (PowerPoint, presentation) / PDF (Portable Document Format, portable document format) / collection table, etc. Documents can be viewed and modified at any time and anywhere on multiple types of devices such as computer (PC (personal computer) client, online document web version), mobile terminal (online document App (application), online document applet), notebook, etc. Opening a web page can view and edit, cloud real-time saving, permission security controllable.

[0062] Layout engine: the layout engine of a web browser is also called a page rendering engine, which is responsible for obtaining the content of a web page (HTML (HyperText Markup Language, HyperText Markup Language), XML (eXtensible Markup Language, Extensible Markup Language), images, etc.), arranging information (such as adding CSS (Cascading Style Sheets, Cascading Style Sheets), etc.), and calculating the display method of the web page, and then outputting to the display or printer. All web browsers, email clients and other applications that need to edit and display network content require a layout engine.

[0063] CSS: is a computer language used to style HTML or XML files. CSS can not only modify the web page statically, but also dynamically format the elements of the web page with various scripting languages. CSS can control the layout of the element position in the web page with pixel-level accuracy, support almost all font styles, and have the ability to edit the style of web objects and models.

[0064] DOM (Document Object Model): is a standard programming interface for processing extensible markup language. It is a platform and language independent API (Application Program Interface), which can dynamically access programs and scripts, update their content, structure and style of www (World Wide Web) documents (currently, HTML and XML documents are defined by the specification section). The document can be further processed, and the result of the processing can be added to the current page. DOM is a tree-based API document, which requires the entire document to be represented in memory during processing. When the browser loads an HTML file through the network or the local file system and finishes parsing it, the kernel will generate its most important data structure: the DOM tree. Each node on the DOM tree corresponds to each element in the web page, and the web page can also manipulate this DOM tree through JavaScript to dynamically change its structure. The rendering layer in the document editor in the embodiments of the present application can use DOM to render the document view.

[0065] convas (canvas) element: used to draw 2D (two-dimensional) graphics and images on the web page. HTML5 <canvas>Tags are used to draw images (via scripts, usually JavaScript). However, <canvas>The element itself has no drawing ability (it is just a container for graphics) and must use scripts to do the actual drawing. The getContext() method returns an object that provides methods and properties for drawing on the canvas, which can be used to draw text, lines, rectangles, circles, and so on on the canvas. The rendering layer in the document editor in the embodiments of the present application can use the convas to render the document view.

[0066] contenteditable (content editable): a native component for rich text editing on a web browser. There are two forms of implementation of a web online editor: one is based on iframe (HTML tag), and the other is based on contenteditable. Setting the contenteditable attribute for an element makes the area within the element editable. The document editor in the related art renders the document view by using the contenteditable capability of the browser.

[0067] scrollTop: the scrollTop value of an element is a measure of the distance from the top of the element's content (as scrolled) to the top of its visible content area. When an element's content does not generate a vertical scroll bar, its scrollTop value is 0. In the embodiments of the present application, the scrollTop value can be used to set the scroll value of the document view display area when the cursor is kept at the first position; and the display content in the second document view can be adjusted according to the scroll value.

[0068] The design idea of the embodiments of the present application is briefly introduced as follows:

[0069] With the continuous development of network application technology, network office applications have brought great convenience to the daily office work of enterprises. Online documents are a new network office application. For example, the creator of an online document can create a document, fill in or update the document content that needs to be processed by other users, and then submit the document to the server; at the same time, the creator of the document sends the link of the document to other users or a group of users through an instant messaging application, and other users can open the document by clicking the link and find the document content that needs to be processed in the opened document.

[0070] However, in the implementation of the document editor in the related art, most of them use the contenteditable capability provided by the browser to implement basic editing capabilities. The user's view will constantly change due to the editing of others, and the user needs to constantly adjust his window to achieve the purpose of common collaboration, which has a very poor experience and low office efficiency.

[0071] Therefore, the application provides a display control method and device of an online document, an electronic device and a storage medium. According to the method for calculating the view position in the editing of the online document, the area being edited by the user himself is calculated according to the cursor position, and is not changed due to the editing of others, thereby reducing the problem of continuous jumping of the page in the collaborative editing, improving the collaborative ability of the online document, and improving the office efficiency.

[0072] The preferred embodiments of the application are described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to explain and illustrate the application, and are not used to limit the application, and the embodiments in the application and the features in the embodiments can be combined with each other without conflict.

[0073] As shown in Figure 1 , it is an application scenario diagram of online content display in the embodiments of the application, which includes a plurality of terminal devices and a server. Each terminal device and the server 130 can directly or indirectly communicate with each other. Each terminal device corresponds to a user, Figure 1 In the application scenario, user A corresponds to the first terminal device 110, and user B corresponds to the second terminal device 120. In fact, the number of terminal devices is not limited. In some cases, the terminal devices can first communicate with each other through the server 130, and direct communication can be established between the terminal devices. The direct communication between the terminal devices can be referred to as point-to-point communication. In this case, some interaction processes between the terminal devices can not need the server 130.

[0074] Each terminal device can install an online document application. For simplicity of description, the online document application installed in the first terminal device 110 can be referred to as the first online document application 111, and the online document application installed in the second terminal device 120 can be referred to as the second online document application 121. The online document application involved in the embodiments of the application can be software, a webpage, a client program or the like. The server is an online document server corresponding to the software or the webpage, the client program or the like, and the specific type of the client is not limited.

[0075] In an optional embodiment, the communication network is a wired network or a wireless network. The terminal devices and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the application.

[0076] In the embodiments of the present application, the terminal device is an electronic device used by a user, which can be a personal computer, a mobile phone, a tablet computer, a notebook computer, an electronic book reader, or the like computer device having a certain computing capability and running instant messaging software and websites or social software and websites. Each terminal device is connected to a server through a wireless network. The server can be a physical server, a server cluster composed of multiple physical servers, or a distributed system. The server can also be 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, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms.

[0077] In the embodiments of the present application, the target online document is stored on an online document server, and any terminal device having access permission can access the target online document and simultaneously or non-simultaneously perform processing operations such as editing operations and viewing operations on the target online document. Content updates of the target online document by any terminal device are synchronized to other terminal devices to ensure content consistency of the target online document on all terminal devices.

[0078] It should be noted that when the terminal device processes the target online document, a cursor is displayed in the document view, which is used to prompt the user to the position of the content being edited in the target online document. In the related art, for a certain terminal device, the cursor is at a certain position in the document when the terminal device processes the target online document. However, when the terminal device receives content updates of the target online document by other terminal devices, the document view displayed by the terminal device will constantly jump following the increase or decrease of the content of the target online document by others, resulting in a very low processing efficiency of the online document. The embodiments of the present application propose a method for adjusting a document view based on a cursor position when editing an online document, which ensures that the region being edited by a target object is not affected by editing of other collaborative objects when multiple people collaboratively edit the target online document, thereby improving the collaborative ability of the online document and improving the processing efficiency of the online document.

[0079] Referring to Figure 2 As shown in the figure, an embodiment of an online document display control method provided by the present application is applied to an online document application. The specific implementation process of the method is as follows:

[0080] S21: updating the content edited by the target object in the document view display area and controlling the display position of the cursor in the document view according to the editing operation of the target object in the target online document, the target online document being a collaboratively editable online document;

[0081] The target online document can be Word / Excel / PPT / PDF / collecting table and other types that can be collaboratively edited by multiple users. When the online document application used by the target object responds to the editing operation on the target online document triggered by the target object through the document view, the online document application also sends the change content of the target online document to the online document server. After receiving the change content, the online document server generates content update information for the target online document according to the change content, and sends the content update information to the online document application used by the collaborative object that collaboratively edits the target online document with the target object.

[0082] For example, the online document application used by the target object is the first online document application 111, and there is only one collaborative object that collaboratively edits the target online document with the target object, and the online document application used by the collaborative object is the second online document application 121. When the target object edits the target online content through the first online document application 111, the first online document application 111 updates the content edited by the target object in the document view display area and controls the display position of the cursor of the target object in the document view according to the editing operation of the target object in the target online document.

[0083] In addition, the first online document application 111 also needs to send the change content of the target online document to the online document server when the target object performs the editing operation. After receiving the change content, the online document server generates content update information for the target online document according to the change content, and sends the content update information to the second online document application 121, so that the second online document application 121 adjusts the display content of the document view display area according to the received content update information.

[0084] As shown in Figure 3A The dashed box S30 represents that two users are currently collaboratively editing the target online document. The document view display area is as shown in the dashed box S31. It is assumed that the two users are the target object and a collaborative object, and the current cursor position of the target object is S32, and the current cursor position of the collaborative object is S33. Figure 3A

[0085] It should be noted that when the document view display area is displayed full screen, the document view display area can occupy the entire screen of the terminal device. When the document view display area is enlarged or reduced, the document view display area can occupy a part of the screen of the terminal device, etc. In addition, the document view display area can also be embedded in the operation interface of an application. In this case, the document view display area can be a specified area in the operation interface of the application, etc., which is not limited here.

[0086] ​S22: Based on the editing operation of at least one collaborative object on the target online document, adjust the content edited by at least one collaborative object in the document view display area to keep the cursor at a first position, wherein the first position is the display position of the cursor in the first document view, and the first document view is the document view displayed in the document view display area before adjustment.

[0087] In this embodiment, when at least one collaborating object and a target object collaboratively edit a target online document, the online document application of the collaborating object, in response to the editing operation triggered by the collaborating object through the document view, also sends the changed content of the target online document to the online document server. Upon receiving the changed content, the online document server generates content update information for the target online document based on the changed content and sends the content update information to other collaborating objects and the target object's online document application. At this time, the target object's online document application, while keeping the cursor in the first position, adjusts the content edited by at least one collaborating object in the document view display area according to the editing operation of the target online document by at least one collaborating object. Similarly, the online document applications of other collaborating objects adjust their document views in the same way.

[0088] Taking the above-described embodiments as an example, since currently only the target object and a collaborating object are collaboratively editing the target online document, when the second online document application 121 responds to the editing operation triggered by the collaborating object for the target online document, the second online document application 121 sends the changes made to the target online document by the collaborating object when performing the editing operation to the online document server. After receiving the changes, the online document server generates content update information for the target online document based on the changes and sends it to the first online document application 111, so that the first online document application 111 adjusts the display content of the document view display area according to the received content update information.

[0089] The first document view refers to the document view displayed in the document view display area before the target object's online document application adjusts the content edited by at least one collaborative object in the document view display area, for example... Figure 3A The document view in the document display area shown is a first document view illustrated in the embodiments of this application. Figure 3A S32, as shown, is the display position of the cursor of the target object in the first document view before adjustment, which is also the first position.

[0090] See Figure 3B The image shown is a schematic diagram illustrating an adjusted document view in an embodiment of this application. Figure 3B It can be seen that, after the editing operation of the target online document by at least one collaborative object, the content edited by at least one collaborative object is adjusted in the document view display area, and the cursor of the target object is still ensured to be at the first position, such as Figure 3B S34 shown in FIG. 4, wherein S34 is the same as the first position S32 shown in Figure 3A .

[0091] It can be seen from Figure 3A and Figure 3B that in the embodiment of the present application, when the user edits the target online document, if other users edit the target online document and generate an increase or decrease of other lines or other previous text height changes, the document view of the user will not change with the increase or decrease of the content of the target online document by other users, but the view is fixed with the cursor position of the user as the focus. Thus, when the user collaborates with others to edit the online document, the user no longer needs to constantly adjust the document view, which improves the collaboration ability of the online document, and further improves the processing efficiency of the online document.

[0092] In an optional implementation, S22 can be implemented according to the flowchart shown in Figure 4 , and specifically includes the following steps:

[0093] S400: When the content update information sent by the online document server is received, the first position information of the cursor in the first document view is obtained, and the content update information is sent according to the editing operation of the target online document by at least one collaborative object;

[0094] That is, in the embodiment of the present application, when the online document application used by the target object receives the content update information sent by the online document server, it indicates that the online document application listens to the collaborative editing of the target online document by other collaborative objects. At this time, the first position information of the first position of the cursor of the target object in the first document view at the current time is first obtained, for example, the coordinates of the cursor in the first document view.

[0095] Optionally, the first position information of the first position is obtained from the layout engine provided in the embodiment of the present application. In the embodiment of the present application, the layout engine still follows the established rules when performing layout, which can be the same as the layout rules in related technologies, and is not limited here.

[0096] Wherein, the content update information is sent by the online document server. When the online document server receives the content edited by at least one collaborative object of the online document client for the target online document, it can generate an online document change message for the target online document according to the changed content, and send it to the online document application of the target object.

[0097] S401: layout the target online document according to the content update information, and determine second position information of a second position of the cursor in a second document view after the layout;

[0098] In the embodiment of the present application, after the target object receives the content update information sent by the online document server, the target online document application can adjust the content of the target online document according to the update information, and layout the target online document.

[0099] Finally, after the target online document is laid out based on the content update information, the display position of the cursor in the second document view obtained by adjusting the target online document is determined, and the corresponding second position information, such as the coordinates of the cursor in the second document view, is obtained.

[0100] As shown in Figure 3C , assuming that the collaborative object adds several lines of content, the second document view obtained by laying out the target online document is as shown in Figure 3C , wherein the position shown by the dashed box S35 is the second position, that is, the display position of the cursor of the target object in the second document view obtained by re-layout.

[0101] It should be noted that the target object and the collaborative object can edit the target online document at the same time, and at this time, the target online document application will update the content edited by the target object in the document view display area according to the editing operation of the target object in the target online document, and will also adjust the content edited by the collaborative object in the document view display area according to the content update information received from the online document server.

[0102] Optionally, before step S401, the target object can further obtain the content update information of the target online document. Further, when step S402 is executed, the target online document is laid out according to the content update information of the target online document of at least one collaborative object and the content update information of the target online document of the target object, and the second position information of the cursor in the second document view after the layout is determined.

[0103] For example, the target object adds two lines of content, and the collaborative object adds three lines of content, wherein the content update information of each object for the target online document includes text information of the added content (or text information of the deleted content), position information, etc.

[0104] Optionally, the process of typesetting the target online document is implemented by the typesetting engine, thus the content update information of the target online document needs to be sent to the typesetting engine, and the typesetting engine typesets the target online document according to the content update information. After the typesetting is completed, the second document view and the second position information of the second position of the cursor displayed in the second document view can be further obtained from the typesetting engine.

[0105] If the target object and the collaborative object edit the target online document at the same time, the content update information of the target online document needs to be sent to the typesetting engine to obtain the content update information of the target object for the target online document. Then, the content update information of the target online document of at least one collaborative object and the content update information of the target object for the target online document are sent to the typesetting engine, and the typesetting engine performs typesetting, for example, the content update information of the two rows of content newly added by the target object and the three rows of content newly added by the collaborative object are sent to the typesetting engine.

[0106] In the embodiment of the present application, the second document view is obtained by the typesetting engine after the target online document is re-typeset according to the content update information of the target online document.

[0107] From the above content, it can be seen that after re-typesetting, the position of the cursor of the target object also changes, and if the document view is directly rendered, there will be a problem of view jumping. Therefore, the view is anchored according to the position of the cursor in the embodiment of the present application, and the display content of the second document view is adjusted according to the position of the cursor before rendering, which is implemented based on steps S402 and S403.

[0108] S402: adjusting the display content of the second document view according to the first position information and the second position information, and adjusting the display position of the cursor to the first position;

[0109] In an optional embodiment, when the display content in the second document view is adjusted according to the first position information and the second position information, the specific process is as follows:

[0110] According to the first position information and the second position information, a scroll value for keeping the cursor at the first position is obtained, and the document view display area is adjusted according to the scroll value to adjust the display content in the second document view, so that the cursor of the target object is kept at the first position after the display content is adjusted.

[0111] That is, when adjusting the display content in the second document view, the effect of compensating for the cursor position offset is achieved by the scroll value calculated by the first position information and the second position information, and thus after adjusting the document view based on the scroll value, the cursor of the target object can be kept at the first position when the target object and the collaborative object collaboratively edit the target online document, and the document view will not jump following the editing of the target online document by the collaborative object, thereby improving the collaboration capability and processing efficiency of the online document.

[0112] S403: render the document view and the cursor in the document view display area according to the display content and the first position information.

[0113] In the embodiment of the present application, when rendering the document view in the document view display area according to the display content, the document content needs to be rendered in the document view display area, that is, the text to be displayed in the target online document needs to be rendered in the document view display area, and here the text to be displayed is the text displayed in the document view display area after scrolling the document view according to the scroll value listed above. In addition, the display style of the document view can also be rendered according to the CSS file and the like.

[0114] In addition, in the embodiment of the present application, when rendering the document view, the position of the cursor in the document view display area can also be determined according to the first position information, and the cursor can be drawn at the determined position, so that the cursor can be kept at the first position. Since the cursor in the embodiment of the present application is drawn according to the first position information, rather than the cursor model provided by the document editor of the online document application, the cursor in the related art cannot be drawn in the rendering process, but directly uses the model provided by the related document editor, and the position of the cursor cannot be obtained before rendering, while in the embodiment of the present application, the position of the cursor can be obtained after typesetting and before rendering, and then drawn according to the determined position information in the rendering process, keeping the position of the cursor, and improving the collaboration capability of the online document based on the cursor anchor view.

[0115] It should be noted that when rendering the document view and the cursor, the rendering engine provided in the embodiment of the present application can be used to achieve the rendering, and the determined display content and the first position information are sent to the rendering engine, and the document view and the cursor are rendered in the document view display area based on the rendering engine.

[0116] In an optional implementation, when obtaining the scroll value for the document view display area when keeping the cursor at the first position according to the first position information and the second position information, the difference between the coordinate value in the vertical direction in the second position information and the coordinate value in the vertical direction in the first position information can be taken as the scroll value for the document view display area when keeping the cursor at the first position.

[0117] Assume that the first position information can be represented as (x1, y1), and the second position information can be represented as (x2, y2), where x1 and x2 represent the coordinates of the cursor in the horizontal direction (x direction), and y1 and y2 represent the coordinates of the cursor in the vertical direction (y direction).

[0118] At this time, assume that the coordinate value in the vertical direction in the first position information is y1 = prevOffsetY, and the coordinate value in the vertical direction in the second position information is y2 = offsetY, then the scroll value scrollTop is offsetY - prevOffsetY, and in the embodiment of the present application, the scroll value can be set through DOM, and then the display content of the document view display area is adjusted.

[0119] In the above embodiment, the y direction offset of the cursor before and after the content edited by the other person is typeset, and the scroll value scrollTop is calculated in advance, the y direction offset of the cursor position is compensated by setting scrollTop (the scroll value of DOM), so that the effect of visually anchoring the view is achieved.

[0120] It should be noted that in the above embodiment, the target object and one collaborative object edit the target online document at the same time are taken as examples for illustration, and the same principle applies when the target object and multiple collaborative objects edit the target online document at the same time, which will not be repeated here.

[0121] In an optional implementation, the display content of the document view display area is adjusted according to the scroll value, which is specifically divided into the following two cases:

[0122] Case one, the scroll value is positive, at this time, the document view display area needs to be scrolled down along the vertical direction, and the scroll distance is the same as the scroll value.

[0123] For example, the editing operation of the collaborative object on the target online document is to add several lines of content to the target online document, in this case, for the target object, the second position of the cursor in the adjusted second document view should be moved down along with the added several lines of content compared with the first position in the first document view before adjustment, at this time, offsetY - prevOffsetY is positive, therefore, after the document view display area is scrolled down along the vertical direction, and the scroll distance is offsetY - prevOffsetY, it can be ensured that after the content edited by at least one collaborative object is adjusted in the document view display area, the cursor of the target object is still located at the position in the first document view before adjustment.

[0124] Case two, the scroll value is negative, at this time, the document view display area is scrolled up along the vertical direction, and the scroll distance is the absolute value of the scroll value.

[0125] For example, the editing operation of the collaborative object to the target online document is deleting several lines of content of the target online document, in this case, for the target object, the second position of the cursor in the adjusted second document view should be followed by the deleted several lines of content to move up compared with the first position in the first document view before adjustment, at this time, offsetY-prevOffsetY is negative, thus after rolling the document view display area in the vertical direction by the distance of prevOffsetY-offsetY, it can be ensured that the cursor of the target object is still located at the position in the first document view before adjustment after adjusting the content edited by at least one collaborative object in the document view display area.

[0126] It should be noted that the first document view in the embodiment of the present application refers to the document view displayed in the document view display area before the online document application performs layout according to the editing operation of at least one collaborative object to the target online document, and the first position refers to the display position of the cursor of the target object in the first document view; the second document view refers to the document view displayed in the document view display area after the online document application performs layout according to the editing operation of at least one collaborative object to the target online document, and the second position refers to the display position of the cursor of the target object in the second document view.

[0127] In the above embodiment, the display area of the document view is adjusted by the y-direction offset of the cursor before and after layout to achieve the effect of compensating for the y-direction offset of the cursor position, which can visually anchor the view, so that when the target object and at least one collaborative object collaboratively edit the target online document, the position of the cursor of the target object can be kept from being affected by the content edited by the collaborative object, and the document view of the target object will not jump following the increase or decrease of the content of the target online document edited by the collaborative object, thus realizing the effect of fixing the document view with the cursor position of the target object as the focus.

[0128] The following will take the online document application as a browser as an example for illustration, at this time, the document view is a web view. Referring to Figure 5 It is a complete method flowchart of the display control method of the online document on the browser side provided by the embodiment of the present application. The specific implementation process of the method is as follows:

[0129] Step S51: The online document application listens to the content change of the target online document;

[0130] Step S52: After the online document application listens to the occurrence of the online document content change, it is judged whether the current change is caused by the user collaboration with others, if yes, step S53 is executed; otherwise, return to step S51;

[0131] Step S53: The online document application caches the current cursor position in the vertical direction prevOffsetY;

[0132] Step S54: The online document application detects the end of the layout caused by the change of others;

[0133] Step S55: The online document application acquires the latest offsetY of the current cursor in the vertical direction;

[0134] Step S56: The online document application determines whether offsetY and prevOffsetY are the same, if yes, returns to step S51, otherwise, step S57 is executed;

[0135] Step S57: The online document application modifies the scroll value scrollTop of the current DOM, and adds (offsetY-prevOffsetY) to the current scrollTop;

[0136] Step S58: The online document application triggers the rendering process to render the document view and the cursor, and returns to step S51 after the rendering is completed.

[0137] In step S52, when the online document application listens to the occurrence of the document content change, there can be two cases, one is that the online document application detects the editing operation of the target object on the target online document, and the other is that the online document content receives the content update information returned by the online document server for the target online document, indicating that at least one collaborative object triggers the editing operation on the target online document through the online document application.

[0138] In this step, it is needed to determine whether the current change is from the user and others in collaboration, that is, whether there is at least one collaborative object also performs the editing operation on the target online document, that is, the embodiment of the present application is applicable to the case that the target object and at least one collaborative object jointly edit the target online document, if only the target object edits the target online document, the way in the embodiment of the present application can not be used to adjust the display content of the document view display area, or, the way listed in the embodiment of the present application can be used to render the document view, that is, in addition to rendering the document content in the document view display area according to the display content, the position of the cursor in the document view display area can also be determined according to the first position information, and the cursor is drawn at the determined position.

[0139] It should be noted that in the embodiment of the present application, the online document server will send the change content of the target online document to the corresponding online document application (browser) through the online document change message in real time, and the specific process is as follows:

[0140] When the collaborative object edits the target online object, the online document client used by the collaborative object submits the edited content to the online document server, and the online document server pushes the content to other collaborative objects and the target object. Taking the target object as an example, after the online document application used by the target object receives the push message sent by the online document server, the online document application triggers the layout and rendering process, and the push message includes the content update information.

[0141] The layout includes the step of updating the content edited by the target object according to the editing operation of the target object on the target online document, or adjusting the content edited by the collaborative object according to the content update information sent by the online document server.

[0142] It should be noted that in the embodiment of the present application, the online document application triggers the layout and rendering each time it receives the content update information sent by the online document server.

[0143] In addition, the display control method of the online document in the embodiment of the present application has an important premise, that is, in the embodiment of the present application, the position of the cursor can be known in advance before the browser renders, that is, in the layout process in step S53, the position of the cursor is obtained before the rendering by the rendering layer rendering engine after the layout by the layout engine, and then the display content of the document view is adjusted based on the cursor.

[0144] In the related art, in the implementation of the document editor, most of them use the contenteditable ability provided by the browser to realize the basic editing ability. In the implementation of the browser, the developer does not need to care about the whole process from the user inputting the text to the final rendering of the text into the user view. The browser provides support for the layout and rendering of the text on the basis of the ability. But based on the text layout and rendering ability provided by the browser, the browser does not provide programmable API between the layout and the rendering, that is, the developer cannot intervene in the process between the text layout and the rendering of the browser. Therefore, the position of the cursor cannot be obtained in advance before the rendering.

[0145] In the implementation of the embodiment of the present application, the latest position of the cursor must be obtained after the layout and before the rendering, in order to calculate the distance that the document view needs to scroll. The reason for doing this is that if the latest position of the cursor is obtained after the rendering, the whole document view will be re-rendered, causing jitter and affecting the user experience. Therefore, the document editor in the related art cannot realize the anchor view function similar to the embodiment of the present application, or although it can anchor the view, it will produce visual jitter and worse experience.

[0146] The document editor provided in this application differs from related technologies. The kernel of the document editor in this application is entirely independently developed, abandoning the traditional contenteditable implementation, thus enabling complete control over the editing area. Its overall architecture diagram is as follows: Figure 6 As shown.

[0147] See Figure 6 The diagram shown is a schematic representation of the structural composition of a document editor according to an embodiment of this application. The document editor in this embodiment includes four parts: an input layer, a data layer, a typesetting engine, and a rendering layer.

[0148] The input layer allows users to edit or adjust the style of the document view or the text of the target online document, as well as set the cursor display and make selections. The data layer processes the data entered by the user through the input layer, and then the typesetting engine typeset the document. After typesetting, the rendering layer renders the document view.

[0149] The document editor in this embodiment takes over the browser's layout and rendering implementation, and adopts a self-developed layout engine and rendering layer. This allows the editor to know the latest position of the cursor in advance based on the information provided by the layout engine before rendering, and then determine whether differential scrolling is needed to ensure that the final displayed view is a view anchored to the cursor.

[0150] The specific process is as follows: When receiving content update information sent by the online document server, the first position information of the first position is obtained from the typesetting engine; then the content update information of the target online document is sent to the typesetting engine through the data layer. After typesetting based on the typesetting engine, the second document view and the second position information of the cursor of the target object displayed in the second document view can be obtained from the typesetting engine. The second document view is obtained by the typesetting engine after re-typesetting the target online document according to the content update information of the target online document.

[0151] In this embodiment of the application, after typesetting based on the typesetting engine and before rendering by the rendering engine, the display content of the second document view can be adjusted according to the first position information and the second position information, and the display position of the cursor can be adjusted to the first position. Specifically, the difference between the vertical coordinate offsetY in the second position information and the vertical coordinate prevOffsetY in the first position information is calculated, and the difference is used as the scroll value scrollTop. The y-direction offset of the cursor position is compensated by setting scrollTop through the DOM.

[0152] After adjusting the display content of the second document view, the adjusted display content and the first position information are sent to the rendering engine, and the document view and the cursor are rendered in the document view display area by the rendering engine, so that the cursor in the rendered document view still remains at the first position, as shown in Figure 3B FIG. 3, thereby achieving the effect of visually anchoring the view.

[0153] Thus, when the user collaborates with others to edit an online document, the user's document view can not be affected by the editing of others, and the jumping problem can not occur, and the user does not need to adjust the document view back and forth, thereby improving the processing efficiency of the online document.

[0154] In the rendering of the document view by the rendering layer, there are two parts, one is DOM, and the other is canvas. The DOM is a standard programming interface for processing extensible markup language in the embodiments of the present application. Based on the DOM, programs and scripts can be dynamically accessed, and the content, structure and style of the www document can be updated. The canvas is mainly used for drawing 2D graphics and images on a web page, such as drawing text, lines, rectangles, circles and the like.

[0155] Specifically, the DOM is a tree-based API document, which requires the entire document to be represented in memory during processing. When the browser loads an HTML file through the network or the local file system and finishes parsing it, the kernel generates its most important data structure: the DOM tree. Each node on the DOM tree corresponds to each element in the web page, and the web page can also manipulate this DOM tree through JavaScript to dynamically change its structure. The rendering layer in the document editor in the embodiments of the present application can use the DOM to realize the rendering of the document view. However, the DOM tree itself cannot be directly used for typesetting and rendering, and the kernel will also generate another tree - the Render tree. Each node on the Render tree - RenderObject, is almost one-to-one corresponding to the node on the DOM tree. When a visible DOM node is added to the DOM tree, the kernel will generate the corresponding RenderOject and add it to the Render tree. The Render tree is the main object of the browser typesetting engine, and the typesetting engine determines the final structure of the Render tree according to the style definition of the DOM tree and the CSS style sheet according to the predetermined typesetting rules, including the size and position of each RenderObject in the Render tree. A typeset Render tree is the main input of the rendering engine of the browser rendering layer, and can be considered that the Render tree is the bridge between the browser typesetting engine and the rendering engine. It is the output of the typesetting engine and the input of the rendering engine. In the embodiments of the present application, the cursor of the target object can be a node in the DOM tree, and the rendering layer draws the cursor based on the DOM.

[0156] Referring to Figure 7 As shown in FIG. 7, an embodiment of a display control method of an online document provided by the present application is shown, and the method is applied to an online document server. The specific implementation process of the method is as follows:

[0157] S71: obtaining updated content of the target online document edited by at least one collaborative object through the online document application, the target online document being a collaboratively editable online document;

[0158] S72: generating content update information for the target online document according to the updated content of the target online document by at least one collaborative object, and sending the content update information to the online document application of the target object, so that the online document application of the target object adjusts the content edited by at least one collaborative object in the document view display area according to the content update information, so as to keep the cursor at the first position, wherein the first position is the display position of the cursor in the first document view, and the first document view is the document view displayed in the document view display area before adjustment.

[0159] In the above embodiment, when the target object edits the target online document simultaneously with the at least one collaborative object, the document view corresponding to the target object does not change with the increase or decrease of the target online document content by the collaborative object, but is fixed with the cursor position of the target object as the focus. The method for calculating the view position when editing the online document newly proposed in the embodiment of the application can improve the collaboration capability of the online document and improve office efficiency.

[0160] Referring to Figure 8 FIG. 8 shows an interactive timing diagram of a display control method of an online document. The specific implementation process of the method is as follows:

[0161] Step S81: The online document application of the target object updates the content edited by the target object in the document view display area and controls the display position of the cursor in the document view in response to the editing operation of the target object in the target online document;

[0162] Step S82: The online document server obtains the updated content after the at least one collaborative object edits the target online document through the online document application, and generates content update information for the target online document according to the updated content of the target online document by the at least one collaborative object;

[0163] Step S83: The online document server sends the content update information to the online document application of the target object;

[0164] Step S84: When the online document application of the target object receives the content update information sent by the online document server, the first position information of the cursor in the first document view is obtained from the layout engine;

[0165] Step S85: The online document application of the target object sends the content update information of the target online document to the layout engine, and obtains the second document view and the second position information of the second position of the cursor displayed in the second document view from the layout engine;

[0166] Step S86: The online document application of the target object adjusts the display content of the second document view according to the first position information and the second position information, and adjusts the display position of the cursor to the first position;

[0167] Step S87: The online document application of the target object sends the display content and the first position information to the rendering engine, and renders the document view and the cursor in the document view display area through the rendering engine.

[0168] Based on the same inventive concept, the embodiment of the application also provides an online document display control device. As shown in Figure 9 FIG. 9 shows a structural schematic diagram of an online document display control device 900, which can include:

[0169] The content updating unit 901 is configured to update the content edited by the target object in the document view display area and control the display position of the cursor in the document view according to the editing operation of the target object in the target online document, the target online document being a collaboratively editable online document.

[0170] The view adjusting unit 902 is configured to adjust the content edited by the at least one collaborative object in the document view display area according to the editing operation of the at least one collaborative object on the target online document, the first position being the display position of the cursor in the first document view, the first document view being the document view displayed in the document view display area before the adjustment.

[0171] Optionally, the view adjusting unit 902 is specifically configured to:

[0172] When the content updating information sent by the online document server is received, the first position information of the cursor in the first document view is acquired, the content updating information being sent according to the editing operation of the at least one collaborative object on the target online document.

[0173] The target online document is typeset according to the content updating information, and the second position information of the second position of the cursor in the second document view after the typesetting is determined.

[0174] The display content of the second document view is adjusted according to the first position information and the second position information, and the display position of the cursor is adjusted to the first position.

[0175] The document view and the cursor are rendered in the document view display area according to the display content and the first position information.

[0176] Optionally, the view adjusting unit 902 is further configured to:

[0177] Before the target online document is typeset according to the content updating information, the content updating information of the target object on the target online document is acquired.

[0178] The view adjusting unit 902 is specifically configured to:

[0179] The target online document is typeset according to the content updating information of the at least one collaborative object on the target online document and the content updating information of the target object on the target online document, and the second position information of the second position of the cursor in the second document view after the typesetting is determined.

[0180] Optionally, the view adjusting unit 902 is specifically configured to:

[0181] When the content updating information sent by the online document server is received, the first position information of the first position is acquired from the typesetting engine.

[0182] sending the content update information of the target online document to the layout engine, and obtaining second position information of a second position at which the cursor is displayed in a second document view from the layout engine, the second document view being obtained by the layout engine after re-layout of the target online document according to the content update information of the target online document;

[0183] adjusting display content of the second document view according to the first position information and the second position information, and adjusting the display position of the cursor to the first position;

[0184] sending the display content and the first position information to the rendering engine, so that the rendering engine renders the document view and the cursor in the document view display area.

[0185] Optionally, the view adjustment unit 902 is further configured to: before sending the content update information of the target online document to the layout engine, obtain the content update information of the target online document by the target object; and

[0186] The view adjustment unit 902 is specifically configured to:

[0187] send the content update information of the target online document by the at least one collaborative object and the content update information of the target online document by the target object to the layout engine.

[0188] Optionally, the view adjustment unit 902 is specifically configured to:

[0189] obtain a scroll value for the document view display area when the cursor is kept at the first position according to the first position information and the second position information;

[0190] adjust the document view display area according to the scroll value, so as to adjust the display content in the second document view.

[0191] Optionally, the view adjustment unit 902 is specifically configured to:

[0192] if the scroll value is positive, the document view display area is scrolled downward along the vertical direction, and the scroll distance is the same as the scroll value;

[0193] if the scroll value is negative, the document view display area is scrolled upward along the vertical direction, and the scroll distance is the absolute value of the scroll value.

[0194] Optionally, the view adjustment unit 902 is specifically configured to:

[0195] the difference between the coordinate value in the vertical direction in the second position information and the coordinate value in the vertical direction in the first position information is taken as the scroll value for the document view display area when the cursor is kept at the first position.

[0196] Optionally, the view adjustment unit 902 is specifically configured to:

[0197] render the document content in the document view display area according to the display content; and

[0198] determine the position of the cursor in the document view display area according to the first position information, and draw the cursor at the determined position.

[0199] For the convenience of description, the above parts are divided into modules (or units) according to functions and are described respectively. Of course, the functions of the modules (or units) can be implemented in the same or multiple software or hardware in the implementation of the present application.

[0200] After introducing the display control method and device of the online document of the exemplary embodiment of the present application, next, the electronic device according to another exemplary embodiment of the present application is introduced.

[0201] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be specifically implemented as follows: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software, which can be collectively referred to as "circuit", "module" or "system".

[0202] Figure 10 is a block diagram of an electronic device 1000 according to an exemplary embodiment, which comprises:

[0203] a processor 1010;

[0204] a memory 1020 for storing instructions executable by the processor 1010;

[0205] The processor 1010 is configured to execute the instructions to implement the display control method of the online document in the embodiments of the present application.

[0206] In the exemplary embodiments, a storage medium including instructions is also provided, for example, the memory 1020 including instructions, which can be executed by the processor 1010 of the electronic device 1000 to complete the above method. Alternatively, the storage medium can be a non-transitory computer readable storage medium, for example, the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk and an optical data storage device, etc.

[0207] Based on the same inventive concept, the embodiments of the present application also provide a terminal device, which can be a smartphone, a tablet computer, a laptop computer or a PC, etc. electronic device. Referring to Figure 11 As shown, it is a block diagram of a terminal device according to an exemplary embodiment, which includes a display unit 1140, a processor 1180 and a memory 1120, wherein the display unit 1140 includes a display panel 1141, which is used to display information input by a user or provided to the user and various object selection pages of the terminal device, etc., and in the embodiments of the present application, is mainly used to display pages of applications installed in the terminal device, shortcut windows, etc. Optionally, the display panel 1141 can be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode), etc.

[0208] The processor 1180 is used to read computer programs and then execute methods defined by the computer programs, for example, the processor 1180 reads an application program of an online document application, so as to run the application on the terminal device and display a document view of the online document application on the display unit 1140. The processor 1180 can include one or more general-purpose processors, and can also include one or more DSPs (Digital Signal Processors) for performing related operations to implement the technical solutions provided by the embodiments of the present application.

[0209] The memory 1120 generally includes an internal memory and an external memory, and the internal memory can be a RAM (Random Access Memory), a ROM (Read-Only Memory) and a CACHE, etc. The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive, etc. The memory 1120 is used to store computer programs and other data, the computer programs include application programs corresponding to applications, etc., and the other data can include data generated after the operating system or the application programs are run, which includes system data (for example, configuration parameters of the operating system) and user data. In the embodiments of the present application, program instructions are stored in the memory 1120, and the processor 1180 executes the program instructions stored in the memory 1120 to implement the display control method of the online document discussed above or implement the functions of the adaptive application discussed above.

[0210] In addition, the terminal device can further include a display unit 1140 configured to receive inputted digital information, character information, or contact touch operation / non-contact gesture, and generate signal input related to user settings and function control of the terminal device, etc. Specifically, in the embodiments of the present application, the display unit 1140 can include a display panel 1141. The display panel 1141, for example, a touch screen, can collect touch operations (such as a player using a finger, a stylus, or any suitable object or accessory on or near the display panel 1141) of a user on or near the display panel 1141 and drive the corresponding connection device according to the pre-set program. Optionally, the display panel 1141 can include two parts of a touch detection device and a touch controller. The touch detection device detects the touch position of the user and detects the signal generated by the touch operation and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 1180, and can also receive commands from the processor 1180 and execute them.

[0211] The display panel 1141 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 1140, the terminal device can further include an input unit 1130, which can include but is not limited to one or more of a physical keyboard, function keys (such as volume control buttons, on / off buttons, etc.), trackballs, mice, joysticks, etc. Figure 11 For example, the input unit 1130 includes an image input device 1131 and other input devices 1132.

[0212] In addition to the above, the terminal device can further include a power supply 1190 for powering other modules, an audio circuit 1160, a near field communication module 1170, and an RF circuit 1110. The terminal device can further include one or more sensors 1150, such as an acceleration sensor, a light sensor, a pressure sensor, etc. The audio circuit 1160 specifically includes a speaker 1161 and a microphone 1162, etc. For example, a user can use voice control, and the terminal device can collect the user's voice through the microphone 1162, control according to the user's voice, and play a corresponding prompt sound through the speaker 1161 when the user needs to be prompted.

[0213] The embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the steps of any one of the above-mentioned online document display control methods, for example, can execute the steps as shown in the method 1000 in FIG. 10. Figure 2 The embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the steps of any one of the above-mentioned online document display control methods, for example, can execute the steps as shown in the method 1000 in FIG. 10.

[0214] The program product can employ any combination of one or more computer readable media. The computer readable media can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0215] The program product of embodiments of the present application can employ a compact disc read-only memory (CD-ROM) and include a program code, which can be executed on a computing device. However, the program product of the present application is not limited thereto, and in the present document, a computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0216] The computer readable signal medium can include a computer readable program code in a baseband or propagated as a carrier wave in a propagation medium. Such a propagated computer readable signal medium can take a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. Computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

[0217] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0218] Although preferred embodiments of the present application have been described, those skilled in the art will be able to make additional modifications and variations to these embodiments without departing from the spirit and scope of the application. Accordingly, the appended claims are intended to encompass all such modifications and variations as falling within the scope of the application.

[0219] It is apparent that a person skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, it is intended to include these changes and modifications within the scope of the present application.< / canvas> < / canvas>

Claims

1. A method for controlling the display of online documents, characterized in that, For use in online document applications running in a browser, the method includes: Based on the target object's editing operations on the target online document, update the content edited by the target object in the document view display area and control the cursor's display position in the document view; the target online document is a collaboratively editable online document; and When receiving content update information from an online document server, the first position information of the cursor in the first document view is obtained from the typesetting engine used by the document editor of the online document application. The content update information is sent based on the editing operation of the target online document by at least one collaborative object. The first document view is the document view displayed in the document view display area before the target online document is reformatted. The typesetting engine is used to provide typesetting functions for the online document application instead of the browser. The content update information is sent to the typesetting engine, and the second document view and the second position information of the cursor in the second document view are obtained from the typesetting engine. The second document view is obtained by the typesetting engine after reformatting the target online document according to the content update information of the target online document. The display content of the second document view is adjusted according to the first position information and the second position information to adjust the display position of the cursor to the first position; The displayed content and the first position information are sent to the rendering engine used by the document editor, so that the rendering engine renders the document view and cursor in the document view display area; wherein, the rendering engine is used to provide rendering functions for the online document application in place of the browser.

2. The method as described in claim 1, characterized in that, Before sending the content update information to the typesetting engine, the method further includes: obtaining the content update information of the target object for the target online document; and Sending the content update information to the typesetting engine specifically includes: The content update information of the at least one collaborating object to the target online document, and the content update information of the target object to the target online document, are sent to the typesetting engine.

3. The method as described in claim 1 or 2, characterized in that, Adjusting the display content of the second document view based on the first location information and the second location information specifically includes: Based on the first position information and the second position information, obtain the scroll value for the second document view when the cursor is held in the first position; Adjust the second document view according to the scroll value to adjust the displayed content in the second document view.

4. The method as described in claim 3, characterized in that, Adjusting the display content of the second document view according to the scroll value specifically includes: If the scroll value is positive, the second document view will scroll downwards in the vertical direction, and the scrolling distance will be the same as the scroll value. If the scroll value is negative, the second document view will scroll upwards vertically by a distance equal to the absolute value of the scroll value.

5. The method as described in claim 3, characterized in that, The step of obtaining the scroll value for the second document view when the cursor is held at the first position based on the first position information and the second position information specifically includes: The difference between the vertical coordinate value in the second position information and the vertical coordinate value in the first position information is used as the scroll value for the second document view when the cursor is held in the first position.

6. An online document display control device, applied to an online document application running in a browser, characterized in that, include: The content update unit is used to update the content edited by the target object in the document view display area and control the display position of the cursor in the document view according to the editing operation of the target object in the target online document. The target online document is a collaboratively editable online document. The view adjustment unit is used to obtain the first position information of the cursor in the first document view from the typesetting engine used by the document editor of the online document application when it receives content update information sent by the online document server. The content update information is sent according to the editing operation of the target online document by at least one collaborative object. The first document view is the document view displayed in the document view display area before the target online document is reformatted. The typesetting engine is used to provide typesetting functions for the online document application instead of the browser. The content update information is sent to the typesetting engine, and the second document view and the second position information of the cursor in the second document view are obtained from the typesetting engine. The second document view is obtained by the typesetting engine after reformatting the target online document according to the content update information of the target online document. The display content of the second document view is adjusted according to the first position information and the second position information to adjust the display position of the cursor to the first position; The displayed content and the first position information are sent to the rendering engine used by the document editor, so that the rendering engine renders the document view and cursor in the document view display area; wherein, the rendering engine is used to provide rendering functions for the online document application in place of the browser.

7. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of any one of the methods described in claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It includes program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of any of the methods described in claims 1 to 5.

Citation Information

Patent Citations

  • Persistent viewports

    CN107111638A

  • System and method for ergonomic placement of an object or cursor on a computer display

    US20140258921A1