CN111767702A - Display control method and device of online document, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN111767702A
CN111767702A CN202010817176.1A CN202010817176A CN111767702A CN 111767702 A CN111767702 A CN 111767702A CN 202010817176 A CN202010817176 A CN 202010817176A CN 111767702 A CN111767702 A CN 111767702A
Authority
CN
China
Prior art keywords
document
content
cursor
online document
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010817176.1A
Other languages
Chinese (zh)
Inventor
王放
罗文兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010817176.1A priority Critical patent/CN111767702A/en
Publication of CN111767702A publication Critical patent/CN111767702A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/101Collaborative creation, e.g. joint development of products or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Business, Economics & Management (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to the technical field of computers, in particular to a display control method, a display control device, electronic equipment and a storage medium for an online document, which are used for improving the processing efficiency of the online document, wherein the method comprises the following steps: updating the content edited by the target object in the display area of the document view and controlling the display position of a cursor in the document view according to the editing operation of the target object in the target online document; and adjusting the content edited by the at least one cooperative object in the document view display area according to the editing operation of the at least one cooperative object on the target online document so as 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 front document view display area. According to the method and the device, when the target online document is edited by multiple persons in a collaborative mode, the document view is anchored based on the position of the cursor, the document view does not need to be adjusted continuously, and the processing efficiency of the online document is improved.

Description

Display control method and device of online document, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling display of an online document, an electronic device, and a storage medium.
Background
Online documents are a class of applications that support multi-user collaborative editing, where users can edit the documents in real time on a web page or application, which often provides the ability to co-locate presentations to mark where collaborators are operating, reducing conflicts during collaboration.
However, in the related art, when the user collaboratively edits the online document with another person, the user's own page may also jump and change following the editing of the document by another person due to the view position of the user being calculated according to the length of the document, so that the user needs to continuously adjust his own window to achieve the purpose of collaborative sharing, and the document processing efficiency is low.
Disclosure of Invention
The embodiment of the application provides a display control method and device for an online document, an electronic device and a storage medium, which are used for improving the cooperation capability of the online document and improving the processing efficiency of the online document.
The method for controlling the display of the online document, provided by the embodiment of the application, comprises the following steps:
updating the content edited by the target object and controlling the display position of a cursor in a document view display area according to the editing operation of the target object in the target online document, wherein the target online document is an online document which can be edited cooperatively; and
according to the editing operation of at least one cooperative object on the target online document, adjusting the content edited by the at least one cooperative object 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 adjustment.
An embodiment of the present application provides an online document display control apparatus, including:
the content updating unit is used for updating the content edited by the target object and controlling the display position of a cursor in a document view display area according to the editing operation of the target object in a target online document, and the target online document is a collaborative-editable online document;
and the view adjusting unit is used for adjusting the content edited by at least one cooperative object in the document view display area according to the editing operation of the target online document by the at least one cooperative object, 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 adjustment.
Optionally, the view adjusting unit is specifically configured to:
when content updating information sent by an online document server is received, acquiring first position information of the cursor in the first document view, wherein the content updating information is sent according to editing operation of at least one cooperative object on the target online document;
typesetting the target online document according to the content updating information, and determining second position information of a second position of the second document view after the cursor is typeset;
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;
and rendering a document view and a cursor in the document view display area according to the display content and the first position information.
Optionally, the view adjusting unit is further configured to:
before typesetting the target online document according to the content updating information, acquiring the content updating information of the target object aiming at the target online document; and
the view adjusting unit is specifically configured to:
and typesetting the target online document according to the content updating information of the at least one cooperative object aiming at the target online document and the content updating information of the target object aiming at the target online document, and determining second position information of a second document view after the cursor is typeset.
Optionally, the view adjusting unit is specifically configured to:
when content updating information sent by an online document server is received, first position information of the first position is obtained from a typesetting engine;
sending the content update information of the target online document to the typesetting engine, and acquiring a second document view and second position information of a second position displayed by the cursor in the second document view from the typesetting engine, wherein the second document view is obtained by the typesetting engine after the target online document is typeset again according to the content update information of the target online document;
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;
and 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.
Optionally, the view adjusting unit is further configured to: before sending the content updating information of the target online document to the typesetting engine, acquiring the content updating information of the target object aiming at the target online document; and
the view adjusting unit is specifically configured to:
and sending the content updating information of the at least one cooperative object to the target online document and the content updating information of the target object to the target online document to the typesetting engine.
Optionally, the view adjusting unit is specifically configured to:
obtaining a scroll value for the document view display area while the cursor is held at the first position according to the first position information and the second position information;
and adjusting the document view display area according to the scroll value so as to adjust the display content in the document view display area.
Optionally, the view adjusting unit is specifically configured to:
if the scroll value is a positive number, the document view display area is scrolled downwards along the vertical direction, and the scroll distance is the same as the scroll value;
and if the scroll value is a negative number, the document view display area is scrolled upwards along the vertical direction, and the scroll distance is the absolute value of the scroll value.
Optionally, the view adjusting unit is specifically configured to:
and taking a difference value 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 as a scroll value for the document view display area when the cursor is held at the first position.
Optionally, the view adjusting unit is specifically configured to:
rendering document content in the document view display area according to the display content; and are
And 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.
An electronic device provided by an embodiment of the present application includes a processor and a memory, where the memory stores program codes, and when the program codes are executed by the processor, the processor is caused to execute any one of the steps of the method for controlling display of an online document.
An embodiment of the present application provides a computer-readable storage medium, which includes program code, when the program code runs on an electronic device, the program code is configured to enable the electronic device to execute the steps of any one of the above-mentioned online document display control methods.
Embodiments of the present application provide a computer program product or computer program comprising 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 cause the computer device to execute the steps of any one of the above-mentioned online document display control methods.
The beneficial effect of this application is as follows:
the embodiment of the application provides a display control method and device of an online document, electronic equipment and a storage medium. The method for calculating the view position during editing of the online document anchors the view according to the cursor, and particularly means that when a user edits a document with others at the same time, an area being edited by the user is calculated according to the cursor position, when the document view display area is kept for being edited in cooperation with others, the cursor is positioned at the position for adjusting the display position in the document view displayed in the front file view display area, the change caused by editing by the others is avoided, the problem that the page continuously jumps during co-editing is reduced, the cooperation capability of the online document is improved, and the office efficiency is improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of an application scenario in an embodiment of the present application;
FIG. 2 is a flowchart of a method for controlling display of an online document according to an embodiment of the present application;
FIG. 3A is a schematic illustration of a first document view in an embodiment of the present application;
FIG. 3B is a diagram showing a view of a first second document in the embodiment of the present application;
FIG. 3C is a diagram showing a second document view in the embodiment of the present application;
FIG. 4 is a flowchart of a method for adjusting a document view in an embodiment of the present application;
FIG. 5 is a flowchart of a complete method for controlling the display of online documents on the browser side according to an embodiment of the present application;
FIG. 6 is a diagram illustrating a structure of a document editor in an embodiment of the present application;
FIG. 7 is a flowchart of another online document display control method in the embodiment of the present application;
FIG. 8 is an interaction timing chart of a display control method of an online document in an embodiment of the present application;
FIG. 9 is a schematic diagram illustrating a configuration of a display control apparatus for an online document according to an embodiment of the present application;
fig. 10 is a schematic diagram of a hardware component of an electronic device to which an embodiment of the present application is applied;
fig. 11 is a schematic diagram of a hardware component structure of a terminal device to which an embodiment of the present application is applied.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the technical solutions of the present application. All other embodiments obtained by a person skilled in the art without any inventive step based on the embodiments described in the present application are within the scope of the protection of the present application.
Some concepts related to the embodiments of the present application are described below.
Online documentation: the Document can be edited by multiple persons at the same time, and various types such as online Word/Excel/PPT (powerPoint, presentation)/PDF (Portable Document Format)/collection table and the like are supported. The document can be checked and modified at any time and any place on various devices such as a computer side (personal computer (PC) client side, an online document webpage version), a mobile side (online document Application (App), an online document applet) and a notebook computer. The webpage can be viewed and edited by opening the webpage, the cloud end can be stored in real time, and the authority is safe and controllable.
A typesetting engine: the composition engine of the web browser is also called a page rendering engine, and is responsible for acquiring content (HTML (HyperText Markup Language), XML (eXtensible Markup Language), images, etc.) of a web page, collating information (for example, adding CSS (Cascading style sheets), etc.), and calculating a display mode of the web page, and then outputting the display mode to a display or a printer. All web browsers, email clients, and other applications that require editing and displaying web content require a composition engine.
CSS: is a computer language used to represent the style of files such as HTML or XML. The CSS can not only statically modify the web page, but also dynamically format elements of the web page in coordination with various scripting languages. The CSS can accurately control the typesetting of element positions in the webpage at a pixel level, supports almost all font and font styles and has the capability of editing webpage objects and model styles.
DOM (Document Object Model): is a standard programming interface for processing extensible markup languages. It is a platform and language independent API (Application programming Interface) that can dynamically access programs and scripts to update their content, structure, and style of www (World Wide Web) documents (currently, HTML and XML documents are defined by declarative parts). The document may be further processed and the results of the processing may be added to the current page. The DOM is a tree-based API document that requires that the entire document be represented in memory during processing. When the browser loads an HTML file through the network or the local file system and finishes analyzing the HTML file, the kernel generates the most important data structure of the HTML file: and (4) a DOM tree. Each node on the DOM tree corresponds to each element in the web page, and the web page can dynamically change its structure by operating the DOM tree through JavaScript. The rendering layer in the document editor in the embodiment of the application can realize the rendering of the document view by using the DOM.
canvas element: for rendering 2D (two-dimensional) graphics and images on web pages. The HTML5< canvas > tag is used to draw images (by script, usually JavaScript). However, the < canvas > element itself has no rendering capabilities (it is simply a container for graphics) and must use scripts to accomplish the actual rendering task. The getContext () method may return an object that provides methods and properties for drawing on the canvas, may be used to draw text, lines, rectangles, circles, and the like on the canvas. The rendering layer in the document editor in the embodiment of the present application may use the covas to implement the rendering of the document view.
content table (content edit): is a local native component for rich text editing on a web browser. web online editors are implemented in two forms: one based on iframe (HTML tag) and the other based on contentdigital. The contentdigital attribute is set for the element, which can be made editable within the area of the element. The document editor in the related art uses the content directory capability of the browser to render the document view.
ScrollTop: the scrollTop value of an element is a measure of the distance from the top of the content of the element (rolled up) to the (top of the) visible content of its viewport. When the content of an element does not produce a vertically oriented scroll bar, its scrollTop value is 0. In the embodiment of the application, the scroll value of the display area of the document view when the cursor is kept at the first position can be set through scrollTop; and adjusting the document view display area according to the scroll value to adjust the display content in the second document view.
The following briefly introduces the design concept of the embodiments of the present application:
with the continuous development of network application technology, the application of network office class brings great convenience to daily office of enterprises. Online documents are an emerging network office application. For example, a creator of an online document may submit a document to a server after creating a document and filling in or updating the document content in the document that needs to be processed by other users; meanwhile, the creator of the document sends the link of the document to other users or a group where the other users are located through the instant messaging application, the other users can open the document by clicking the link, and the document contents which need to be processed respectively are searched in the opened document.
However, in the implementation of the document editor in the related art, it is mostly employed to implement the basic editing capability based on the contentdigital capability provided by the browser. The view of the user is changed continuously due to the editing of other people, the window of the user needs to be adjusted continuously, the purpose of common cooperation is achieved, the experience is very poor, and the office efficiency is low.
In view of the above, the present application provides a method and an apparatus for controlling display of an online document, an electronic device, and a storage medium. The method for calculating the view position during editing of the online document, which is provided by the embodiment of the application, particularly means that when a user edits a document with others at the same time, the region being edited by the user can be calculated according to the cursor position, the region can not be changed due to editing by others, and the problem that pages continuously jump during co-editing is reduced, so that the coordination capacity of the online document can be improved, and the office efficiency is improved.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 1 is a schematic diagram of an application scenario of online content display in an embodiment of the present application, where the application scenario includes a plurality of terminal devices and a server, and each terminal device may communicate with the server 130 directly or indirectly. In fig. 1, the user a corresponds to the first terminal device 110, and the user B corresponds to the second terminal device 120, which does not actually limit the number of terminal devices. In some cases, the terminal devices may communicate with each other through the server 130 first, direct communication may be established between the terminal devices, and the manner of direct communication between the terminal devices may be referred to as point-to-point communication.
Among them, each terminal device may have an online document application installed therein, and for simplicity of description, the online document application installed in the first terminal device 110 may be referred to as a first online document application 111, and the online document application installed in the second terminal device 120 may be referred to as a second online document application 121. The online document application related to the embodiment of the application may be a software, or a client such as a web page or an applet, and the server is an online document server corresponding to the software, or the web page or the applet, and the specific type of the client is not limited.
In an alternative embodiment, the communication network is a wired network or a wireless network. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
In this embodiment, the terminal device is an electronic device used by a user, and the electronic device may be a computer device having a certain computing capability and running instant messaging software and a website or social contact software and a website, such as a personal computer, a mobile phone, a tablet computer, a notebook, an e-book reader, and the like. Each terminal device passes through a wireless Network and a server, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), big data, an artificial intelligence platform, and the like.
The target online document in the embodiment of the application is stored on the online document server, and any plurality of terminal devices with access rights can access the target online document and simultaneously or non-simultaneously perform processing operations, such as editing operations, viewing operations and the like, on the target online document. The content update of any terminal device to the online document can be synchronized to other terminal devices, so as to ensure the content consistency of the target online document on all the terminal devices.
It should be noted that, when processing the target online document, the terminal device displays a cursor in the document view, where the cursor is used to prompt the user of the position of the content being edited in the target online document. In the related art, for a certain terminal device, the cursor may be at a certain position in the document when the terminal device processes the target online document, but when the terminal device receives the content update of the target online document from other terminal devices, the document view displayed by the terminal device may continuously jump along with the increase or decrease of the content of the target online document by other terminal devices, resulting in low processing efficiency of the online document. The embodiment of the application provides a method for adjusting a document view based on a cursor position when an online document is edited, so that when multiple persons edit a target online document together, an area being edited by a target object is not subjected to editing by other cooperative objects, the cooperative capability of the online document is improved, and the processing efficiency of the online document is improved.
Referring to fig. 2, an implementation flow chart of a display control method for an online document provided in the embodiment of the present application is applied to an online document application, and a specific implementation flow of the method is as follows:
s21: updating the content edited by the target object in the display area of the document view and controlling the display position of a cursor in the document view according to the editing operation of the target object in the target online document, wherein the target online document is an online document which can be edited cooperatively;
the target online document can be a plurality of types such as Word/Excel/PPT/PDF/collection table which can be edited by multiple persons. When the online document application used by the target object responds to the editing operation, triggered by the target object through the document view, aiming at the target online document, the online document application also sends the change content aiming at the target online document to the online document server, and after receiving the change content, the online document server generates the content updating information aiming at the target online document according to the change content and sends the content updating information to the online document application used by the cooperative object for cooperatively editing the target online document with the target object.
For example, if the online document application used by the target object is the first online document application 111, only one collaborative object for editing the target online document in collaboration with the target object is provided, 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.
In addition, the first online document application 111 needs to send the changed content of the target online document when the target object performs the editing operation to the online document server, and after receiving the changed content, the online document server generates content update information for the target online document according to the changed 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.
As shown in fig. 3A, the portion of the dashed box S30 indicates that there are two users currently editing the target online document, and the document view display area is the portion shown by the dashed box S31 in fig. 3A, and assuming that the two users are the target object and one collaboration object, the current cursor position of the target object is shown as S32 and the current cursor position of the collaboration object is shown as S33.
It should be noted that, when the document view display area is displayed in full screen, the document view display area may occupy the entire screen of the terminal device. And the document view display area may occupy a portion of a screen of the terminal device, etc., when the document view display area is enlarged or reduced. In addition, the document view display area may also be embedded in an operation interface of a certain application, in which case the document view display area may be a designated area in the operation interface of the application, and the like, and is not specifically limited herein.
S22: and adjusting the content edited by the at least one cooperative object in the document view display area according to the editing operation of the at least one cooperative object on the target online document so as 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 front document view display area.
In the embodiment of the application, when at least one cooperative object collaboratively edits a target online document with a target object, an online document application of the cooperative object responds to an editing operation, triggered by a document view, of the cooperative object for the target online document, and then sends changed content for the target online document to an online document server, and after receiving the changed content, the online document server generates content update information for the target online document according to the changed content, and sends the content update information to other cooperative objects and the online document application of the target object. At this time, the online document application of the target object may adjust the content edited by the at least one collaborative object in the document view display area in a state that the cursor is kept at the first position according to the editing operation of the at least one collaborative object on the target online document. Similarly, the online document application for other collaborative objects adjusts the document view in this way.
Still taking the above-mentioned enumerated embodiment as an example, since only the target object and one collaboration object are currently editing the target online document cooperatively, when the second online document application 121 responds to the editing operation for the target online document triggered by the collaboration object, the second online document application 121 sends the change content for the target online document when the collaboration object performs the editing operation to the online document server, and after receiving the change content, the online document server generates the content update information for the target online document according to the change content and sends the content update information 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.
The first document view refers to a document view displayed in the document view display area before the online document application of the target object has not adjusted the content edited by the at least one collaborative object in the document view display area, for example, the document view in the document display area shown in fig. 3A is a first document view shown in the embodiment of the present application, and S32 shown in fig. 3A is a display position, that is, a first position, of a cursor of the target object in the first document view before adjustment.
Referring to FIG. 3B, a diagram of an adjusted document view is shown in an embodiment of the present application. As can be seen from FIG. 3B, after the edited content of the at least one collaboration object is adjusted in the document view display area according to the editing operation of the at least one collaboration object on the target online document, it is still ensured that the cursor of the target object is at the first position, as shown at S34 in FIG. 3B, where S34 is the same as the first position S32 shown in FIG. 3A.
As can be seen from fig. 3A and 3B, in the embodiment of the present application, when a user edits a target online document, if there are other users who have added or subtracted other rows or other previous height changes when editing the target online document, the document view of the user does not change along with the addition or subtraction of the target online document content by other users, but the view is fixed with the cursor position of the user as the focus. Therefore, when the user collaboratively edits the online document with other people, the document view does not need to be continuously adjusted, the collaboration capability of the online document is improved, and the processing efficiency of the online document is further improved.
In an alternative embodiment, S22 may be implemented according to the flowchart shown in fig. 4, which specifically includes the following steps:
s400: when content updating information sent by an online document server is received, first position information of a cursor in a first document view is obtained, and the content updating information is sent according to editing operation of at least one cooperative object on a target online document;
that is to say, 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 monitors that there are other collaborative objects collaboratively editing the target online document with the target object, and at this time, first position information of a first position of a cursor of the target object in a first document view at the current time, for example, coordinates of the cursor in the first document view, is first obtained.
Optionally, the first position information of the first position is obtained from the composition engine provided in the embodiment of the present application. When typesetting, the typesetting engine in the embodiment of the present application still follows the established rules, which may be the same as the typesetting rules in the related art, and is not limited herein.
When the online document server receives the edited content of the target online document sent by the online document client of at least one cooperative object, the online document server can generate an online document change message aiming at the target online document according to the changed content and send the online document change message to the online document application of the target object.
S401: typesetting the target online document according to the content updating information, and determining second position information of a second position of the second document view after the cursor is typeset;
in the embodiment of the application, after receiving the content update information sent by the online document server, the online document application of the target object may adjust the content of the target online document according to the update information, and perform typesetting on the target online document.
Finally, after the target online content is typeset based on the content updating information, the display position of the cursor in the second document view obtained by adjusting the target online document at the moment is determined, and corresponding second position information, such as the coordinate of the cursor in the second document view, is obtained.
As shown in fig. 3C, assuming that the collaborative object has several lines of content added, the second document view obtained by laying out the target online document is shown in fig. 3C, where 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 laying out again.
It should be noted that the target object and the collaborative object may edit the target online document at the same time, and at this time, the online document application of the target object updates 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 at the same time, adjusts the content edited by the collaborative object in the document view display area according to the received content update information sent by the online document server.
Optionally, before step S401, content update information of the target object with respect to the content update information of the target online document may be further acquired. Furthermore, when step S402 is executed, the target online document is typeset according to the content update information of the at least one coordination object for the target online document and the content update information of the target object for the target online document, and the second position information of the second document view after the cursor is typeset is determined.
For example, two lines of contents are added to the target object, three lines of contents are added to the collaborative object, wherein the content update information of each object for the target online document contains text information (or text information of deleted contents), position information and the like of the newly added contents.
Optionally, the process of typesetting the target online document is implemented by the typesetting engine, so that the content update information of the target online document needs to be sent to the typesetting engine, the typesetting engine finishes typesetting the target online document according to the content update information, and after the typesetting is finished, the second document view and the second position information of the second position displayed by the cursor in the second document view can be further obtained from the typesetting engine.
If the target object and the collaborative object edit the target online document at the same time, the content updating information of the target online document is also required to be sent to a typesetting engine, and the content updating information of the target object aiming at the target online document is obtained; and sending the content update information of the target online document and the content update information of the target online document of the at least one cooperative object to a typesetting engine, and typesetting by the typesetting engine, for example, sending the content update information of two newly added lines of content of the target object and three newly added lines of content of the cooperative object to the typesetting engine.
In the embodiment of the present application, the second document view is obtained after the typesetting engine rearranges the target online document according to the content update information of the target online document.
As can be seen from the above, after the typesetting is performed again, the position of the cursor of the target object is also changed, and if the document view is directly rendered, the view may jump, so that the embodiment of the present application anchors the view according to the position of the cursor, and adjusts the display content of the second document view according to the position of the cursor before the rendering, which is specifically implemented based on step S402 and step S403.
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 a first position;
in an optional implementation manner, 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:
obtaining 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; and adjusting the document view display area according to the scroll value to adjust the display content in the second document view, and ensuring that the cursor of the target object is kept at the first position after the display content is adjusted.
That is, when adjusting the display content in the second document view, the effect of compensating the position offset of the cursor is substantially achieved by the scroll value calculated by the first position information and the second position information, and therefore, after adjusting the document view based on the scroll value, when the cooperative object and the target object cooperatively edit the target online document, the cursor of the target object can be kept at the first position, and the document view does not jump along with the editing of the target online document by the cooperative object, so that the cooperative capability and the processing efficiency of the online document can be improved.
S403: and rendering the document view and the cursor in the document view display area according to the display content and the first position information.
In the embodiment of the present application, when rendering a document view in a document view display area according to display content, the document content needs to be rendered in the document view display area, that is, a text that needs to be displayed in a target online document is rendered in the document view display area, where the text that needs to be displayed is a text that is displayed in the document view display area after scrolling the document view according to the above listed scroll values. In addition, the display style of the document view may be rendered according to a CSS file or the like.
In addition, in the embodiment of the application, when the document view is rendered, the position of the cursor in the document view display area can be determined according to the first position information, and the cursor is drawn at the determined position, so that the cursor can be ensured to be kept at the first position. Because the cursor in the embodiment of the application is drawn according to the first position information, but not a cursor model provided by a document editor of the online document application, the cursor in the related art cannot be drawn in the rendering process, but a model provided by the related document editor is directly adopted, the position of the cursor cannot be acquired before rendering, but the position of the cursor in the embodiment of the application can be acquired before rendering after typesetting, and then drawing is performed according to the determined position information in the rendering process, the position of the cursor is maintained, and the coordination capability of the online document is improved based on the cursor anchoring view.
It should be noted that, when rendering the document view and the cursor, the rendering engine provided in the embodiment of the present application may be used to implement the rendering, send the determined display content and the first position information to the rendering engine, and render the document view and the cursor in the document view display area based on the rendering engine.
In an alternative embodiment, when the scroll value for the document view display area when the cursor is held at the first position is obtained based on 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 may be used as the scroll value for the document view display area when the cursor is held at the first position.
It is assumed that the first position information may be represented as (x1, y1) and the second position information may be represented as (x2, y2), where x1 and x2 represent coordinates of the cursor in the horizontal direction (x direction) and y1 and y2 represent coordinates of the cursor in the vertical direction (y direction).
At this time, assuming 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, the scroll value scrollTop is offset-prevOffsetY, and in the embodiment of the present application, the scroll value may be set by the DOM, and the display content of the document view display area is adjusted.
In the above embodiment, the scroll value scrollTop may be calculated in advance according to the y-direction offsets of the cursor twice before and after the content typesetting edited by another person, and the DOM sets the scrollTop (the scroll value of the DOM) to compensate the y-direction offset of the cursor position, thereby achieving the effect of visually anchoring the view.
It should be noted that, in the above embodiments, the target object and one collaborative object are exemplified to edit the target online document at the same time, and the same reason is also used when the target object and multiple collaborative objects edit the target online document at the same time, and no repeated description is given here.
In an alternative embodiment, when the display content of the document view display area is adjusted according to the scroll value, the following two cases are specifically distinguished:
in case one, the scroll value is a positive number, and at this time, the document view display area needs to be scrolled downward in the vertical direction, and the scroll distance is the same as the scroll value.
For example, the editing operation of the collaboration 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 downward with the added several lines of content compared with the first position in the first document view before adjustment, and the offset-prevoffset is a positive value, so that after the document view display area is scrolled downward in the vertical direction, and the scrolling distance is offset-prevoffset, 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 the content edited by at least one collaboration object is adjusted in the document view display area.
And in the second case, the scroll value is a negative number, the document view display area is scrolled upwards along the vertical direction, and the scroll distance is the absolute value of the scroll value.
For example, the editing operation of the collaboration object on the target online document is to delete 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 moved upward following the deleted several lines of content compared with the first position in the first document view before adjustment, and the offset-prevoffset is a negative value, so that after the document view display area is scrolled upward in the vertical direction, and the scrolling distance is prevoffset-offset, 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 the content edited by at least one collaboration object is adjusted in the document view display area.
It should be noted that the first document view in this embodiment of the present application refers to a document view displayed in a document view display area before the online document application typesets the editing operation of the target online document according to at least one collaborative object, and the first position is a display position of a cursor of the target object in the first document view; the second document view is a document view displayed in a document view display area obtained after the online document application typesets the editing operation of the target online document according to the at least one cooperative object, and the second position is a display position of a cursor of the target object in the second document view.
In the above embodiment, the display area of the document view is adjusted by the y-direction offset of the cursor twice before and after the layout to achieve the effect of compensating the y-direction offset of the cursor position, and the view can be ensured to be visually anchored, 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, the document view of the target object does not jump along with the increase or decrease of the content of the target online document by the collaborative object, and the effect of fixing the document view with the cursor position of the target object as the focus is achieved.
In the following, an online document application is taken as an example of a browser, and in this case, the document view is a web page view. Fig. 5 is a flowchart illustrating a complete method of controlling display of an online document on a browser side according to an embodiment of the present application. The specific implementation flow of the method is as follows:
step S51: monitoring the content change of a target online document by an online document application;
step S52: after monitoring that the content of the online document is changed, the online document application judges whether the current change is that the user and others cooperate, if so, the step S53 is executed; otherwise, return to step S51;
step S53: caching the position prevOffsetY of the current cursor in the vertical direction by the online document application;
step S54: detecting the end of typesetting generated by the change of others by the online document application;
step S55: the online document application acquires the latest offset of the current cursor in the vertical direction;
step S56: the online document application determines whether offset is the same as prevoffset, and if so, returns to step S51, otherwise, executes step S57;
step S57: the online document application modifies the scroll value scrollTop of the current DOM, and adds up (offset-prevoffset) the current scrollTop;
step S58: the online document application triggers the rendering process to render the document view and cursor, and returns to step S51 after rendering is complete.
In step S52, there may be two cases when the online document application monitors that the document content is changed, where one case is that the online document application detects the editing operation of the target object on the target online document, and the other case is that the content of the online document receives the content update information for the target online document returned by the online document server, which indicates that at least one collaborative object triggers the editing operation for the target online document by the online document application.
In this step, it is necessary to determine whether the current change is due to collaboration of the user with another person, that is, whether at least one collaboration object exists to perform an editing operation on the target online document, that is, the embodiment of the present application is applicable to a case where the target object and the at least one collaboration object jointly edit the target online document, and if only the target object edits the target online document, the display content of the document view display area may not be adjusted in the manner in the embodiment of the present application, or the document view may be rendered in the manner listed in the embodiment of the present application, 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 may be determined according to the first position information, and the cursor may be drawn at the determined position.
It should be noted that, in this embodiment of the application, the online document server may send the changed content of the target online document to the corresponding online document application (browser) in real time through the online document change message, and the specific process is as follows:
when the cooperative object edits the target online object, the online document client used by the cooperative object submits the edited content to the online document server, and the online document server pushes the edited content to other cooperative objects and the target object. Taking the target object as an example, after the online document application used by the target object receives a push message sent by the online document server, the online document application will trigger the typesetting and rendering processes, where the push message includes content update information.
The typesetting comprises 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 cooperative object according to the content updating information sent by the online document server.
It should be noted that, in the embodiment of the present application, each time the online document application receives content update information sent by the online document server, the composition and rendering are triggered.
In addition, the method for controlling display of an online document in the embodiment of the present application has an important premise that, in the embodiment of the present application, the position of the cursor can be known in advance before rendering by the browser, that is, after the composition is performed by the composition engine, the position of the cursor is obtained before rendering by the rendering layer rendering engine, and then the display content of the document view is adjusted based on the cursor, corresponding to the composition process in step S53.
In the related art, in the implementation of a document editor, it is mostly adopted to implement a basic editing capability based on a content directory capability provided by a browser. In the implementation of the browser, developers do not need to care about the whole process from the input of characters to the final rendering of the characters into a user view, and basic capability support is provided for the typesetting and rendering of the characters by the browser. However, based on the capability of the browser to provide text composition and rendering, the browser does not provide a programmable API between composition and rendering, i.e., the developer cannot intervene in the process between the text composition and rendering of the browser. And thus the position of the cursor cannot be obtained in advance before rendering.
In the implementation of the embodiment of the present application, the latest position of the cursor must be obtained after the typesetting and before the rendering to calculate the distance that the document view needs to be scrolled, which is because if the latest position of the cursor is obtained after the rendering, the whole document view will be rendered twice, and jitter occurs, which affects the user experience. Therefore, the document editor in the related art cannot realize the anchor view function similar to the embodiment of the application, or although the view can be anchored, the document editor generates visual jitter and experiences worse.
The document editor provided by the embodiment of the application is different from the related technology, the document editor kernel in the application is completely independently developed, and the realization of the traditional content table scheme is abandoned, so that the editing area is completely controllable. The overall architecture is shown in fig. 6.
Fig. 6 is a schematic diagram illustrating a structure of a document editor according to an embodiment of the present disclosure. The document editor in the embodiment of the present application includes: the system comprises an input layer, a data layer, a typesetting engine and a rendering layer.
The user can edit or adjust the style of a document view or the text of a target online document through the input layer, and the method further comprises the steps of setting the display of a cursor, selecting a region and the like; the data layer is used for processing the data input by the user through the input layer, and then the document can be typeset through the typesetting engine. After typesetting, the rendering of the document view can be performed through the rendering layer.
The document editor in the embodiment of the application takes over the realization of the typesetting and rendering of the browser, and the typesetting engine and the rendering layer which are independently researched and developed are adopted, so that the latest position of the cursor can be known in advance according to the information provided by the typesetting engine before rendering, and whether difference value rolling is needed or not is determined, and the finally displayed view is ensured to be a view anchoring the cursor.
The specific process is as follows: when content updating information sent by an online document server is received, first position information of a first position is obtained from a typesetting engine; and then sending the content updating information of the target online document to a typesetting engine through a data layer, and obtaining a second document view and second position information of a second position displayed by a cursor of the target object in the second document view from the typesetting engine after typesetting based on the typesetting engine, wherein the second document view is obtained after the typesetting engine typesets the target online document again according to the content updating information of the target online document.
In the embodiment of the application, after the typesetting based on the typesetting engine and before the 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 is adjusted to the first position; the specific implementation mode is as follows: the difference between the coordinate offsetY in the vertical direction in the second position information and the coordinate prevOffsetY in the vertical direction in the first position information is calculated and used as a scroll value scrollTop, and the scrollTop is set by the DOM to compensate the y-direction offset of the cursor position.
After the display content of the second document view is adjusted, 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 through the rendering engine, so that the cursor is still kept at the first position in the rendered document view, as shown in fig. 3B, and the effect of visually anchoring the view is achieved.
Therefore, when the user edits the online document in cooperation with other people, the document view of the user can not be edited by other people, the problem of jitter is avoided, the user does not need to adjust the document view back and forth, and the processing efficiency of the online document is improved.
When the document view is rendered through the rendering layer, the rendering layer can be divided into two parts, wherein one part is DOM and the other part is canvas. The DOM is a standard programming interface for processing an extensible markup language in an embodiment of the present application. Programs and scripts can be dynamically accessed based on the DOM to update its content, structure, and style of the www document. Whereas canvases are mainly used for drawing 2D graphics and images on web pages, such as drawing text, lines, rectangles, circles, and so on.
In particular, the DOM is a tree-based API document that requires that the entire document be represented in memory during processing. When the browser loads an HTML file through the network or the local file system and finishes analyzing the HTML file, the kernel generates the most important data structure of the HTML file: and (4) a DOM tree. Each node on the DOM tree corresponds to each element in the web page, and the web page can dynamically change its structure by operating the DOM tree through JavaScript. The rendering layer in the document editor in the embodiment of the application can realize the rendering of the document view by using the DOM. However, the DOM tree itself cannot be directly used for typesetting and rendering, the kernel generates another tree, a Render tree, each node, Render object, in the Render tree is almost in one-to-one correspondence with the node in the DOM tree, and when a visible DOM node is added to the DOM tree, the kernel generates a corresponding Render object for the visible DOM node to be added to the Render tree. The Render tree is a main job object of the browser composition engine, the composition engine determines the final structure of the Render tree according to the preset composition rule according to the style definition of the DOM tree and the CSS style sheet, including the size and the position of each Render object, and one composed Render tree is the main input of the rendering engine of the rendering layer of the browser. In the embodiment of the application, the cursor of the target object can be used as a node in the DOM tree, and the cursor is drawn based on the DOM at the rendering layer.
Referring to fig. 7, an implementation flow chart of a method for controlling display of an online document according to an embodiment of the present application is applied to an online document server, and a specific implementation flow of the method is as follows:
s71: obtaining updated content of at least one collaborative object after editing operation is carried out on a target online document through an online document application, wherein the target online document is an online document capable of being edited collaboratively;
s72: and generating content updating information aiming at the target online document according to the content of the target online document updated by the at least one cooperative object, and sending the content updating 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 the at least one cooperative object in the document view display area according to the content updating information to keep the cursor at a first position, wherein the first position is a display position of the cursor in a first document view, and the first document view is a document view displayed in the front document view display area.
In the foregoing embodiment, when the target object and at least one collaborative object edit the target online document at the same time, the document view corresponding to the target object does not change along with the increase or decrease of the collaborative object to the content of the target online document, but the document view is fixed with the cursor position of the target object as a focus.
Referring to fig. 8, an interaction timing diagram of a display control method of an online document is shown. The specific implementation flow of the method is as follows:
step S81: the online document application of the target object responds to the editing operation of the target object in the target online document, updates the edited content of the target object in the document view display area and controls the display position of a cursor in the document view;
step S82: the online document server obtains updated content of at least one collaborative object after editing operation is carried out on a target online document through online document application, and content updating information aiming at the target online document is generated according to the content of the target online document updated by the at least one collaborative object;
step S83: the online document server sends the content updating information to an online document application of the target object;
step S84: when the online document application of the target object receives content updating information sent by an online document server, acquiring first position information of a cursor in a first document view from a typesetting engine;
step S85: the online document application of the target object sends the content updating information of the target online document to the typesetting engine, and acquires a second document view and second position information of a second position of the cursor displayed in the second document view from the typesetting engine;
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;
step S87: and the online document application of the target object sends the display content and the first position information to the rendering engine, and the document view and the cursor are rendered in the document view display area through the rendering engine.
Based on the same inventive concept, the embodiment of the application also provides a display control device of the online document. As shown in fig. 9, it is a schematic structural diagram of a display control apparatus 900 for an online document, and may include:
a content updating unit 901, configured to update, according to an editing operation of a target object in a target online document, a content edited by the target object in a document view display area and control a display position of a cursor in a document view, where the target online document is an online document that can be edited cooperatively;
a view adjusting unit 902, configured to adjust, according to an editing operation of the at least one collaborative object on the target online document, content edited by the at least one collaborative object in a document view display area, where the first position is a display position of a cursor in a first document view, and the first document view is a document view displayed in a front document view display area.
Optionally, the view adjusting unit 902 is specifically configured to:
when content updating information sent by an online document server is received, first position information of a cursor in a first document view is obtained, and the content updating information is sent according to editing operation of at least one cooperative object on a target online document;
typesetting the target online document according to the content updating information, and determining second position information of a second position of the second document view after the cursor is typeset;
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 a first position;
and rendering the document view and the cursor in the document view display area according to the display content and the first position information.
Optionally, the view adjusting unit 902 is further configured to:
before typesetting the target online document according to the content updating information, acquiring the content updating information of the target object aiming at the target online document; and
the view adjusting unit 902 is specifically configured to:
and typesetting the target online document according to the content updating information of the at least one cooperative object aiming at the target online document and the content updating information of the target object aiming at the target online document, and determining second position information of the second document view after the cursor is typeset.
Optionally, the view adjusting unit 902 is specifically configured to:
when content updating information sent by an online document server is received, first position information of a first position is obtained from a typesetting engine;
sending the content updating information of the target online document to a typesetting engine, and acquiring a second document view and second position information of a second position displayed by a cursor in the second document view from the typesetting engine, wherein the second document view is obtained by the typesetting engine after the target online document is typeset again according to the content updating information of the target online document;
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 a first position;
and sending the display content and the first position information to a rendering engine so that the rendering engine renders the document view and the cursor in the document view display area.
Optionally, the view adjusting unit 902 is further configured to: before sending the content updating information of the target online document to the typesetting engine, acquiring the content updating information of the target object aiming at the target online document; and
the view adjusting unit 902 is specifically configured to:
and sending the content updating information of the target online document of the at least one cooperative object and the content updating information of the target online document of the target object to a typesetting engine.
Optionally, the view adjusting unit 902 is specifically configured to:
obtaining 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;
and adjusting the document view display area according to the scroll value to adjust the display content in the second document view.
Optionally, the view adjusting unit 902 is specifically configured to:
if the scroll value is positive, the document view display area is scrolled downwards along the vertical direction, and the scroll distance is the same as the scroll value;
if the scroll value is negative, the document view display area is scrolled vertically upward, and the scroll distance is the absolute value of the scroll value.
Optionally, the view adjusting unit 902 is specifically configured to:
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 while the cursor is held at the first position.
Optionally, the view adjusting unit 902 is specifically configured to:
rendering the document content in the document view display area according to the display content; and are
And determining the position of the cursor in the document view display area according to the first position information, and drawing the cursor at the determined position.
For convenience of description, the above parts are separately described as modules (or units) according to functional division. Of course, the functionality of the various modules (or units) may be implemented in the same one or more pieces of software or hardware when implementing the present application.
Having described the method and apparatus for controlling display of an online document according to an exemplary embodiment of the present application, an electronic device according to another exemplary embodiment of the present application is described next.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Fig. 10 is a block diagram illustrating an electronic device 1000 according to an example embodiment, the apparatus comprising:
a processor 1010;
a memory 1020 for storing instructions executable by the processor 1010;
the processor 1010 is configured to execute instructions to implement the display control method of the online document in the embodiment of the present application.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 1020 comprising instructions, executable by the processor 1010 of the electronic device 1000 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, for example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Based on the same inventive concept, the embodiment of the application also provides a terminal device, and the terminal device can be an electronic device such as a smart phone, a tablet computer, a laptop or a PC. Referring to fig. 11, a block diagram of a terminal device according to an exemplary embodiment is shown, where the terminal device includes a display unit 1140, a processor 1180 and a memory 1120, where the display unit 1140 includes a display panel 1141 for displaying information input by a user or information provided to the user, and various object selection pages of the terminal device, and in this embodiment, the display panel is mainly used for displaying pages of applications installed in the terminal device, shortcut windows, and the like. Alternatively, the Display panel 1141 may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
The processor 1180 is configured to read the computer program and then execute a method defined by the computer program, for example, the processor 1180 reads an application program of the online document application, so that the application is executed on the terminal device, and a document view of the online document application is displayed on the display unit 1140. The Processor 1180 may include one or more general processors, and may further include one or more DSPs (Digital Signal processors) for performing relevant operations to implement the technical solutions provided in the embodiments of the present application.
Memory 1120 generally includes both internal and external memory, which may be Random Access Memory (RAM), Read Only Memory (ROM), CACHE memory (CACHE), and the like. The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive. The memory 1120 is used for storing computer programs including application programs and the like corresponding to applications, and other data, which may include data generated after an operating system or application programs are executed, including system data (e.g., configuration parameters of the operating system) and user data. In the embodiment 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 to implement the functions of the adaptation application discussed above.
In addition, the terminal device may further include a display unit 1140 for receiving input numerical information, character information, or contact touch operation/non-contact gesture, and generating signal input related to user setting and function control of the terminal device, and the like. Specifically, in the embodiment of the present application, the display unit 1140 may include a display panel 1141. The display panel 1141, such as a touch screen, may collect touch operations of a user (e.g., operations of a player on the display panel 1141 or on the display panel 1141 using any suitable object or accessory such as a finger, a stylus, etc.) on or near the display panel 1141, and drive the corresponding connection device according to a preset program. Alternatively, the display panel 1141 may include two parts of a touch detection device and a touch controller. The touch detection device comprises a touch controller, a touch detection device and a touch control unit, wherein the touch detection device is used for detecting the touch direction of a user, detecting a signal brought by touch operation and transmitting the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1180, and can receive and execute commands sent by the processor 1180.
The display panel 1141 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the display unit 1140, the terminal device may further include an input unit 1130, and the input unit 1130 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. In fig. 11, an example is given in which the input unit 1130 includes an image input device 1131 and other input devices 1132.
In addition to the above, the terminal device may also 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 may also include one or more sensors 1150, such as acceleration sensors, light sensors, pressure sensors, and the like. The audio circuit 1160 specifically includes a speaker 1161 and a microphone 1162, for example, a user may use voice control, and the terminal device may collect a voice of the user through the microphone 1162, may control the voice of the user, and play a corresponding prompt tone through the speaker 1161 when the user needs to be prompted.
Embodiments of the present application provide a computer program product or computer program comprising 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 cause the computer device to execute the steps of any one of the above-mentioned online document display control methods, for example, the steps shown in fig. 2 may be executed.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with a command execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with a command execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (12)

1. A display control method of an online document, characterized by comprising:
updating the content edited by the target object and controlling the display position of a cursor in a document view display area according to the editing operation of the target object on the target online document, wherein the target online document is an online document which can be edited cooperatively; and
according to the editing operation of at least one cooperative object on the target online document, adjusting the content edited by the at least one cooperative object 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 adjustment.
2. The method of claim 1, wherein the adjusting the content edited by the at least one collaboration object in the document view display area to maintain the cursor at the first position according to the editing operation performed by the at least one collaboration object on the target online document comprises:
when content updating information sent by an online document server is received, acquiring first position information of the cursor in the first document view, wherein the content updating information is sent according to editing operation of at least one cooperative object on the target online document;
typesetting the target online document according to the content updating information, and determining second position information of a second position of the second document view after the cursor is typeset;
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;
and rendering a document view and a cursor in the document view display area according to the display content and the first position information.
3. The method of claim 2, wherein before typesetting the target online document according to the content update information, further comprising:
acquiring content updating information of the target object aiming at the target online document; and
the typesetting the target online document according to the content updating information, and determining second position information of a second document view after the typesetting of the cursor specifically include:
and typesetting the target online document according to the content updating information of the at least one cooperative object aiming at the target online document and the content updating information of the target object aiming at the target online document, and determining second position information of a second document view after the cursor is typeset.
4. The method of claim 1, wherein the adjusting the content edited by the at least one collaboration object in the document view display area to maintain the cursor at the first position according to the editing operation performed by the at least one collaboration object on the target online document comprises:
when content updating information sent by an online document server is received, first position information of the first position is obtained from a typesetting engine;
sending the content update information of the target online document to the typesetting engine, and acquiring a second document view and second position information of a second position displayed by the cursor in the second document view from the typesetting engine, wherein the second document view is obtained by the typesetting engine after the target online document is typeset again according to the content update information of the target online document;
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;
and 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.
5. The method of claim 4, wherein before sending the content update information of the target online document to the layout engine, further comprising: acquiring content updating information of the target object aiming at the target online document; and
sending the content update information of the target online document to the composition engine, which specifically includes:
and sending the content updating information of the at least one cooperative object to the target online document and the content updating information of the target object to the target online document to the typesetting engine.
6. The method according to any one of claims 2 to 5, wherein the adjusting the display content in the document view display area according to the first position information and the second position information specifically comprises:
according to the first position information and the second position information, obtaining a scroll value aiming at the document view display area when the cursor is kept at the first position;
and adjusting the document view display area according to the scroll value so as to adjust the display content in the document view display area.
7. The method according to claim 6, wherein the adjusting the display content of the document view display area according to the scroll value specifically comprises:
if the scroll value is a positive number, the document view display area is scrolled downwards along the vertical direction, and the scroll distance is the same as the scroll value;
and if the scroll value is a negative number, the document view display area is scrolled upwards along the vertical direction, and the scroll distance is the absolute value of the scroll value.
8. The method according to claim 6, wherein the obtaining a scroll value for the document view display area while the cursor is held at the first position according to the first position information and the second position information specifically comprises:
and taking a difference value 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 as a scroll value for the document view display area when the cursor is held at the first position.
9. The method according to claim 2, wherein the rendering a document view and a cursor in the document view display area according to the display content and the first position information specifically comprises:
rendering document content in the document view display area according to the display content; and are
And 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.
10. An apparatus for controlling display of an online document, comprising:
the content updating unit is used for updating the content edited by the target object and controlling the display position of a cursor in a document view display area according to the editing operation of the target object in a target online document, and the target online document is a collaborative-editable online document;
and the view adjusting unit is used for adjusting the content edited by at least one cooperative object in the document view display area according to the editing operation of the target online document by the at least one cooperative object, 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 adjustment.
11. An electronic device, comprising a processor and a memory, wherein the memory stores program code which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 9.
12. Computer-readable storage medium, characterized in that it comprises program code for causing an electronic device to carry out the steps of the method according to any one of claims 1 to 9, when said program product is run on said electronic device.
CN202010817176.1A 2020-08-14 2020-08-14 Display control method and device of online document, electronic equipment and storage medium Pending CN111767702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010817176.1A CN111767702A (en) 2020-08-14 2020-08-14 Display control method and device of online document, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010817176.1A CN111767702A (en) 2020-08-14 2020-08-14 Display control method and device of online document, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111767702A true CN111767702A (en) 2020-10-13

Family

ID=72728935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010817176.1A Pending CN111767702A (en) 2020-08-14 2020-08-14 Display control method and device of online document, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111767702A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764642A (en) * 2020-12-31 2021-05-07 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN114500570A (en) * 2022-02-09 2022-05-13 北京字跳网络技术有限公司 Task processing method and device, electronic equipment and computer readable storage medium
CN114528816A (en) * 2022-01-27 2022-05-24 北京飞书科技有限公司 Collaborative editing information display method and device, electronic equipment and readable medium
CN114650268A (en) * 2022-04-14 2022-06-21 北京字跳网络技术有限公司 Content pushing method, content pushing device, electronic equipment, medium and program product
WO2024087751A1 (en) * 2022-10-24 2024-05-02 天津联想协同科技有限公司 Method and apparatus for positioning editing area of online document, and server and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764642A (en) * 2020-12-31 2021-05-07 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN112764642B (en) * 2020-12-31 2022-11-29 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN114528816A (en) * 2022-01-27 2022-05-24 北京飞书科技有限公司 Collaborative editing information display method and device, electronic equipment and readable medium
CN114500570A (en) * 2022-02-09 2022-05-13 北京字跳网络技术有限公司 Task processing method and device, electronic equipment and computer readable storage medium
CN114500570B (en) * 2022-02-09 2024-02-13 北京字跳网络技术有限公司 Task processing method, device, electronic equipment and computer readable storage medium
CN114650268A (en) * 2022-04-14 2022-06-21 北京字跳网络技术有限公司 Content pushing method, content pushing device, electronic equipment, medium and program product
CN114650268B (en) * 2022-04-14 2024-01-30 北京字跳网络技术有限公司 Content pushing method, device, electronic equipment, medium and program product
WO2024087751A1 (en) * 2022-10-24 2024-05-02 天津联想协同科技有限公司 Method and apparatus for positioning editing area of online document, and server and storage medium

Similar Documents

Publication Publication Date Title
CN111767702A (en) Display control method and device of online document, electronic equipment and storage medium
US20210026526A1 (en) Native overlay for rapid editing of web content
CN109416704B (en) Network-based embeddable collaborative workspace
US10585980B2 (en) Methods and a computing device for maintaining comments and graphical annotations for a document
CA2773152C (en) A method for users to create and edit web page layouts
US10460014B2 (en) Scrolling in large hosted data set
CN103034708B (en) Browser spreadsheet integration
US20160070688A1 (en) Displaying annotations of a document by augmenting the document
CN104657451B (en) The processing method and processing device of the page
KR20110011002A (en) Method and apparatus for web browsing
EP3090356A1 (en) Section based reorganization of document components
US10509853B2 (en) Creating an annotation pane for a document by augmenting the document
US10572106B2 (en) Method and apparatus for performing URL linkage function using the keypad
US10776570B2 (en) Supporting digital ink in markup language documents
CA2918840A1 (en) Presenting fixed format documents in reflowed format
US10410606B2 (en) Rendering graphical assets on electronic devices
US20180357206A1 (en) Content inker
CN107533568A (en) It is determined that the system and method using zoom level
US12056433B2 (en) Multi-mode display for documents in a web browser client application
US20050234838A1 (en) Method and apparatus for providing in place editing within static documents
US11995129B2 (en) System and method for annotating website content
CN112632436A (en) Webpage display method and device, electronic equipment and storage medium
Nebeling Lightweight informed adaptation: Methods and tools for responsive design and development of very flexible, highly adaptive web interfaces
US20240086616A1 (en) Reading assistant in a browser environment
Doan Practical Responsive Web Design

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40030109

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination