Object processing method and device
By obtaining and updating the clipboard content of the external object of the visual editor, the problem of not being able to copy and paste the external content of the page to the visual editor in the react framework, and effectively copy and paste the content is achieved.
Patent Information
- Application Number
- CN201910572009.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-28
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2039-06-28
AI Technical Summary
When using the react framework, users cannot copy content outside the page's visual editor to the page's visual editor through the copy method.
By getting the clipboard content of the external object of the page's visual editor and updating the clipboard content of the visual editor, the function of pasting the external object into the visual editor is achieved.
It realizes the function of copying and pasting content outside the page's visual editor into the visual editor, solving the problem that the content cannot be updated when users copy and paste.
Smart Images

Figure CN112149015B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to computer technology, and more particularly, to an object processing method and device. Background Art
[0002] When using the react framework to copy the content of the current web page to the current web page, the content that the user wants to copy will be cached in the clipboard of the web page. When the terminal monitors the user's paste operation, the terminal obtains the content from the clipboard of the web page for pasting. When using the react framework to copy the content of another web page to the current web page, the terminal needs to obtain the content from the clipboard of the browser corresponding to the two web pages and paste the content on the current web page.
[0003] However, the user cannot copy the content outside the visual editor of the page into the visual editor of the page through the above-mentioned copying method. Summary of the invention
[0004] The embodiments of the present application provide an object processing method and device, which can achieve the purpose of copying content outside a visual editor of a page into the visual editor of the page.
[0005] In a first aspect, an embodiment of the present application provides an object processing method, comprising: obtaining a first object according to a first paste instruction, the first object being an object outside a visual editor of a first page, the first paste instruction including information of a first paste position selected in the visual editor; updating the cached content in a clipboard of the visual editor to the first object; and pasting the first object to the first paste position of the visual editor according to the information of the first paste position.
[0006] In this solution, when the copied or cut object is an object outside the visual editor of the page and the object needs to be pasted into the visual editor, the electronic device obtains the object from the clipboard of the page where the object is located or from the clipboard of the browser corresponding to the page where the object is located or the clipboard of the operating system, and updates the cached content in the clipboard of the visual editor to the first object, thereby achieving the purpose of pasting the first object outside the visual editor into the visual editor.
[0007] In combination with the first aspect, in a possible implementation of the first aspect, obtaining the first object includes: obtaining the first object from a clipboard of a second page or a clipboard of a first browser or a clipboard of an operating system, the second page is a page where the first object is located, and the first browser is a browser corresponding to the second page.
[0008] In this solution, the first object can be successfully acquired, so that the cache content in the clipboard of the visual editor can be updated to the first object, thereby achieving the purpose of pasting the first object outside the visual editor into the visual editor.
[0009] In combination with the first aspect, in a possible implementation method of the first aspect, it also includes: receiving an instruction to copy or cut a second object, the second object is at least a part of a react component in the visual editor, and the react component corresponds to multiple data nodes; according to the instruction to copy or cut the second object, caching the target data node corresponding to the second object among the multiple data nodes to the clipboard of the visual editor.
[0010] Furthermore, it may also include: receiving a second paste instruction, the second paste instruction including information of a second paste position selected in the visual editor; according to the second paste instruction, copying the target data node in the clipboard of the visual editor, and rendering the copied target data node to display the second object at the second paste position of the visual editor.
[0011] In this solution, when copying or cutting at least part of the react component in the visual editor of the page, at least part of the react component is not cached to the clipboard of the visual editor, but the data nodes corresponding to at least part of the react component are cached to the clipboard of the visual editor. By operating the data nodes corresponding to the react component, the copying or cutting of the react component in the visual editor of the page is achieved.
[0012] In the case where the second object is cut and the second object is part of the react component, the method further includes: deleting a target data node corresponding to the second object from the multiple data nodes; and rendering the multiple data nodes after removing the target data node, so as to display the react component after removing the second object in the visual editor. In the case where the second object is cut and the second object is the entire react component, the method further includes: deleting the multiple data nodes so that the react component does not exist in the visual editor.
[0013] In this solution, when cutting at least part of the react component in the visual editor of the page, at least part of the react component is not cached to the clipboard of the visual editor, but the data nodes corresponding to at least part of the react component are cached to the clipboard of the visual editor, and the cutting of the react component in the visual editor of the page is achieved by operating the data nodes corresponding to the react component.
[0014] In combination with the first aspect, in a possible implementation method of the first aspect, it also includes: receiving an instruction to copy or cut a third object, where the third object is an object of a non-react component in the visual editor; and caching the third object in a clipboard of the visual editor according to the instruction to copy or cut the third object.
[0015] Furthermore, the method may also include: receiving a third paste instruction, wherein the third paste instruction includes information of a third paste position selected in the visual editor; and pasting the third object to the third paste position of the visual editor according to the third paste instruction.
[0016] This solution provides a concrete implementation for cutting or copying objects of non-react components in the visual editor.
[0017] In a second aspect, an embodiment of the present application provides an object processing device, comprising: a processing module, used to obtain a first object according to a first paste instruction, the first object being an object outside a visual editor of a first page, and the first paste instruction including information of a first paste position selected in the visual editor; the processing module is also used to update the cached content in the clipboard of the visual editor to the first object; the processing module is also used to paste the first object to the first paste position of the visual editor according to the information of the first paste position.
[0018] In combination with the second aspect, in a possible implementation of the second aspect, the processing module is specifically used to: obtain the first object from the clipboard of the second page or the clipboard of the first browser or the clipboard of the operating system, the second page is the page where the first object is located, and the first browser is the browser corresponding to the second page.
[0019] In combination with the second aspect, in a possible implementation method of the second aspect, it also includes: a receiving module; the receiving module is used to receive an instruction to copy or cut a second object, the second object is at least a part of a react component in the visual editor, and the react component corresponds to multiple data nodes; the processing module is also used to cache the target data node corresponding to the second object among the multiple data nodes to the clipboard of the visual editor according to the instruction to copy or cut the second object.
[0020] In combination with the second aspect, in a possible implementation of the second aspect, the receiving module is further used to receive a second paste instruction, wherein the second paste instruction includes information of a second paste position selected in the visual editor; the processing module is further used to copy the target data node in the clipboard of the visual editor according to the second paste instruction, and render the copied target data node to display the second object at the second paste position of the visual editor.
[0021] In combination with the second aspect, in a possible implementation of the second aspect, when the second object is cut and the second object is part of the react component, the processing module is also used to: delete the target data node corresponding to the second object from the multiple data nodes; render the multiple data nodes after removing the target data node, so as to display the component of the react component after removing the second object in the visual editor.
[0022] In combination with the second aspect, in a possible implementation of the second aspect, when the second object is cut and the second object is the entire react component, the processing module is also used to delete the multiple data nodes so that the react component does not exist in the visual editor.
[0023] In combination with the second aspect, in a possible implementation method of the second aspect, it also includes: a receiving module; the receiving module is used to receive an instruction to copy or cut a third object, and the third object is an object of a non-react component in the visual editor; the processing module is also used to cache the third object to the clipboard of the visual editor according to the instruction to copy or cut the third object.
[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor; the memory and the processor are connected;
[0025] The memory is used to store program commands;
[0026] The processor is used to implement the method described in the first aspect and any possible implementation manner of the first aspect when the program command is executed.
[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the first aspect and any possible implementation manner of the first aspect is implemented.
[0028] In the present application, when the copied or cut object is an object outside the visual editor of the page and the object needs to be pasted into the visual editor, the electronic device obtains the object from the clipboard of the page where the object is located or from the clipboard of the browser corresponding to the page where the object is located or the clipboard of the operating system, and updates the cached content in the clipboard of the visual editor to the first object, thereby achieving the purpose of pasting the first object outside the visual editor into the visual editor. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0030] Figure 1A Schematic diagram 1 of a visual editor provided in an embodiment of the present application;
[0031] Figure 1B Schematic diagram of a visual editor provided in an embodiment of the present application Figure 2 ;
[0032] Figure 2 Flowchart 1 of the object processing method provided in the embodiment of the present application;
[0033] Figure 3 The process of the object processing method provided in the embodiment of the present application Figure 2 ;
[0034] Figure 4 The process of the object processing method provided in the embodiment of the present application Figure 3 ;
[0035] Figure 5 The process of the object processing method provided in the embodiment of the present application Figure 4 ;
[0036] Figure 6 A functional structure diagram of an object processing device provided in one embodiment of the present application;
[0037] Figure 7 A schematic diagram of the functional structure of an object processing device provided in another embodiment of the present application;
[0038] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In the present application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0041] In order to better understand this application, this application introduces the following elements:
[0042] The clipboard of the operating system in the electronic device is at a higher level than the clipboard of the browser, and the clipboard of the browser is higher than the clipboard of the page. Generally, after the user inputs an instruction to copy or cut an object on page A, when page A is a page under browser A, the object will be cached in the clipboard of page A, the clipboard of browser A, and the clipboard of the operating system, and will not be cached in the clipboards of other pages and other browsers. After the user inputs an instruction to paste the object to the preset position of page A, the electronic device pastes the cached content in the clipboard of page A to the preset position of page A, and the cached content in the clipboard of page A is the object. After the user inputs an instruction to paste the object to the preset position of page B, if pages A and B belong to the same browser, the electronic device pastes the cached content in the clipboard of browser A to the preset position of page B, and the cached content in the clipboard of browser A is the object.
[0043] Combine the following Figure 1A and Figure 1B The technical problems to be solved by this application are described. Figure 1A Schematic diagram 1 of a visual editor provided in an embodiment of the present application, Figure 1BSchematic diagram of a visual editor provided in an embodiment of the present application Figure 2 .
[0044] Currently, after a user inputs an instruction to copy or cut an object A outside a visual editor of a page through a user interface of an electronic device, the object A is not cached in the clipboard of the visual editor. Figure 1A As shown in , the content cached in the clipboard of the visual editor is object B, which is different from object A. If the user continues to input the paste command, object B is pasted into the visual editor, such as Figure 1B That is, when the user needs to paste A into the visual editor, A cannot be obtained from the clipboard of the visual editor to paste A into the visual editor. In order to solve this technical problem, a solution in the embodiment of the present application is proposed.
[0045] The object processing method provided by the present application is described below using specific embodiments.
[0046] First, a specific embodiment is used to illustrate a method for processing an object when the copied or cut object is an object outside the visual editor of the current page.
[0047] Figure 2 Flow chart 1 of the object processing method provided in the embodiment of the present application, the execution subject of this embodiment can be an electronic device, and the electronic device can be a terminal device or a server. Figure 2 , the method of this embodiment includes:
[0048] Step S201: According to a first paste instruction, a first object is obtained, where the first object is an object outside the visual editor of the first page, and the first paste instruction includes information of a first paste position selected in the visual editor.
[0049] Specifically, after receiving an instruction to copy or cut the first object (the instruction to copy or cut the first object may be input by the user through the user interface), the electronic device caches the first object to the clipboard of the second page where the first object is located, the clipboard of the browser to which the second page belongs, and the clipboard of the operating system, that is, the current cached content in the clipboard of the second page, the clipboard of the browser to which the second page belongs, and the clipboard of the operating system is the first object. Among them, if there is a visual editor in the second page, the first object is not at least part of the react component in the visual editor of the second page. It can be understood that the browser to which the second page where the first object is located belongs may be the same as the browser to which the first page belongs, or may be different from the browser to which the first page belongs.
[0050] At the same time, after receiving the instruction to copy or cut the first object, the electronic device will also determine that the first object is an object in the second page.
[0051] If the electronic device obtains the first paste instruction, and the first paste instruction includes information of the first paste position selected in the visual editor of the first page, the electronic device determines that the first object is an object outside the visual editor of the first page according to the first paste instruction. Specifically, it can be: after the electronic device obtains the first paste instruction, it determines that the paste operation needs to be performed in the visual editor of the first page, and according to the record that the most recent cut or copy operation before the paste is for the first object of the second page, it can be determined that the first object is an object outside the visual editor of the first page. The object outside the visual editor of the first page does not exist in the clipboard of the visual editor of the first page, so the electronic device needs to obtain the first object. Wherein, the electronic device obtains the first object, including: obtaining the first object from the clipboard of the second page or the clipboard of the browser corresponding to the second page or the clipboard of the operating system. Optionally, obtaining the first object includes: obtaining the first object from the clipboard of the operating system. Wherein, the first paste instruction can be input by the user through the interface of the visual editor of the first page.
[0052] Step S202: Update the cached content in the clipboard of the visual editor to the first object.
[0053] Specifically, the clipboard of the visual editor is the clipboard of the first page where the visual editor is located.
[0054] Since the first object is an object outside the visual editor of the current page, the current cache content in the clipboard of the visual editor is not the first object, so the cache content in the clipboard of the visual editor is updated to the first object.
[0055] Step S203: Paste the first object to the first paste position of the visual editor according to the information of the first paste position.
[0056] Specifically, after the cache content in the clipboard of the visual editor is updated to the first object, the first object can be obtained from the clipboard of the visual editor and pasted to the first paste position of the visual editor, thereby completing the copy-paste process or the cut-paste process of the first object.
[0057] In this embodiment, when the copied or cut object is an object outside the visual editor of the page and the object needs to be pasted into the visual editor, the electronic device obtains the object from the clipboard of the page where the object is located or from the clipboard of the browser corresponding to the page where the object is located or the clipboard of the operating system, and updates the cached content in the clipboard of the visual editor to the object, thereby achieving the purpose of pasting the first object outside the visual editor into the visual editor.
[0058] Secondly, a specific embodiment is used to illustrate a method for processing a corresponding object when the copied or cut object is at least a part of a react component in a visual editor of the current page.
[0059] Figure 3 The process of the object processing method provided in the embodiment of the present application Figure 2 The execution subject of this embodiment may be an electronic device, which may be a terminal device or a server. Figure 3 , the method of this embodiment includes:
[0060] Step S301: receiving an instruction to copy or cut a second object, where the second object is at least a portion of a react component in a visual editor of a first page, and the react component corresponds to a plurality of data nodes.
[0061] The instruction to copy or cut the third object may be input by the user through the user interface, that is, the instruction to copy or cut the second object input by the user is received.
[0062] After receiving the instruction to copy or cut the second object, the electronic device determines that the second object is at least a part of the react component in the visual editor of the first page.
[0063] The multiple data nodes corresponding to the react component refer to the multiple data nodes included in the data structure corresponding to the react component, one of the multiple data nodes is the root data node, and the remaining data nodes are child data nodes of the root data node. The child data node is the data node included in the data structure corresponding to the child component. The data structure composition of the react component can be shown in Table 1:
[0064] Table 1
[0065]
[0066]
[0067] The data structure of the react component can be: root data node Child data node Or, a child data node That is, each data node includes at least component name, component type, component unique identifier, component attributes and component style.
[0068] It can be understood that the second object may be part or all of a react component. Therefore, the data structure corresponding to the second object may include one or more data nodes. The data nodes included in the data structure corresponding to the second object are called target data nodes in this embodiment, and the target data nodes have one or more.
[0069] Step S302: Cache the target data node corresponding to the second object among the multiple data nodes into the clipboard of the visual editor.
[0070] Specifically, after receiving an instruction to copy or cut the second object and determining that the second object is at least part of a react component in the visual editor of the first page, the electronic device caches a target data node among the multiple data nodes corresponding to the second object in the clipboard of the visual editor.
[0071] In addition, the target data node corresponding to the second object among the multiple data nodes may be cached in a clipboard of a second browser or a clipboard of an operating system, where the second browser is a browser corresponding to the first page.
[0072] In the case where the second object is cut and the second object is part of the react component in the visual editor, after receiving an instruction to copy or cut the second object, the following steps may also be included: deleting a target data node corresponding to the second object from the multiple data nodes, and rendering the multiple data nodes without the target data node, so as to display the component after the second object is removed in the react component in the visual editor.
[0073] In the case where the second object is cut and the second object is the entire react component in the visual editor, after receiving an instruction to copy or cut the second object, the following step may also be included: deleting the multiple data nodes so that the react component does not exist in the visual editor.
[0074] If the third object needs to be pasted into the visual editor, steps S303 to S304 need to be performed.
[0075] Step S303: receiving a second paste instruction, where the second paste instruction includes information of a second paste position selected in the visual editor.
[0076] Step S304: according to the second paste instruction, copy the target data node in the clipboard of the visual editor, and render the copied target data node to display the second object at the second paste position of the visual editor.
[0077] The pasting of the second object is achieved by copying the target data node in the clipboard of the visual editor and rendering the copied target data node to display the second object at the second paste position of the visual editor.
[0078] In this embodiment, when copying or cutting at least part of the react component in the visual editor of the page, at least part of the react component is not cached to the clipboard of the visual editor. Instead, the data nodes corresponding to at least part of the react component are cached to the clipboard of the visual editor. By operating the data nodes corresponding to the react component, the copying or cutting of the react component in the visual editor of the page is achieved.
[0079] Next, a specific embodiment is used to describe a method for processing a corresponding object when the copied or cut object is an object of a non-react component in a visual editor of a page.
[0080] Figure 4 The process of the object processing method provided in the embodiment of the present application Figure 3 The execution subject of this embodiment may be an electronic device, which may be a terminal device or a server. Figure 4 , the method of this embodiment includes:
[0081] Step S401: receiving an instruction to copy or cut a third object, where the third object is an object of a non-react component in a visual editor of a first page.
[0082] The instruction to copy or cut the third object may be input by the user through the user interface, that is, the instruction to copy or cut the third object input by the user is received.
[0083] After receiving the instruction to copy or cut the third object, the electronic device determines that the third object is an object of a non-react component in the visual editor of the first page.
[0084] Step S402: Cache the third object in the clipboard of the visual editor according to the instruction to copy or cut the third object.
[0085] In addition, the third object may also be cached in a clipboard of a second browser or a clipboard of an operating system, where the second browser is a browser corresponding to the first page where the third object is located.
[0086] In the case of cutting the third object, after receiving the instruction to copy or cut the third object, the method further includes the following step: deleting the third object from the visual editor.
[0087] If the third object needs to be pasted into the visual editor, steps S403 to S404 need to be performed.
[0088] Step S403: receiving a third paste instruction, where the third paste instruction includes information of a third paste position selected in the visual editor.
[0089] Step S404: Paste the third object to a third paste position of the visual editor according to the third paste instruction.
[0090] This embodiment implements copying and pasting or cutting and pasting of objects of non-react components in a visual editor of a copy or cut page.
[0091] The following takes an object as an example to illustrate the complete object processing method of this application.
[0092] Figure 5 The process of the object processing method provided in the embodiment of the present application Figure 4 The execution subject of this embodiment may be an electronic device, which may be a terminal device or a server. Figure 5 , the method of this embodiment includes:
[0093] Step S501: Receive an instruction to copy or cut an object.
[0094] If the object is at least part of the react component in the visual editor of the first page, execute steps S502 to S505:
[0095] Step S502: According to an instruction to copy or cut an object, determine that the object is at least a part of a react component in a visual editor of the first page.
[0096] Step S503: Cache the target data node corresponding to the object among the multiple data nodes into the clipboard of the visual editor.
[0097] Step S504: receiving a paste instruction, where the paste instruction includes information of a paste position selected in the visual editor.
[0098] Step S505 : copy the target data node in the clipboard of the visual editor, and render the copied target data node to display the object at the pasting position of the visual editor.
[0099] If the object is an object of a non-react component in the visual editor of the first page, execute steps S506 to S509:
[0100] Step S506: According to the instruction to copy or cut the object, determine that the object is an object of a non-react component in the visual editor of the first page.
[0101] Step S507: Cache the object in the clipboard of the visual editor.
[0102] Step S508: receiving a paste instruction, where the paste instruction includes information of a paste position selected in the visual editor.
[0103] Step S509: Paste the object to the paste position of the visual editor.
[0104] If the object is an object outside the visual editor of the first page and the object is an object of the second page, execute steps S510 to S515:
[0105] Step S510: caching the object to a clipboard of the second page where the object is located according to an instruction to copy or cut the object;
[0106] Step S511: receiving a paste instruction, where the paste instruction includes information of a paste position selected in the visual editor.
[0107] Step S512: determining that the first object is an object outside the visual editor;
[0108] Step S513: obtaining a first object;
[0109] Step S514: updating the cached content in the clipboard of the visual editor to the object;
[0110] Step S515: Paste the object to the paste position of the visual editor.
[0111] The specific implementation of each step of this implementation refers to the above embodiments and will not be repeated in this embodiment.
[0112] This embodiment can achieve the purpose of pasting objects outside and inside the visual editor of a page into the visual editor.
[0113] The object processing method of the present application is described above through specific embodiments. The object processing device of the present application is described below using specific embodiments.
[0114] Figure 6 A functional structure diagram of an object processing device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device of this embodiment may include: a processing module 61.
[0115] The processing module 61 is used to obtain a first object according to a first paste instruction, where the first object is an object outside the visual editor of the first page, and the first paste instruction includes information of a first paste position selected in the visual editor; the processing module is also used to update the cached content in the clipboard of the visual editor to the first object; the processing module is also used to paste the first object to the first paste position of the visual editor according to the information of the first paste position.
[0116] Optionally, the processing module 61 is specifically used to: obtain the first object from the clipboard of the second page or the clipboard of the first browser or the clipboard of the operating system, the second page is the page where the first object is located, and the first browser is the browser corresponding to the second page.
[0117] It should be noted that the object processing device in this embodiment may be a terminal or a server, or may be a chip applied to a terminal or a server, or other combined devices or components having the above functions.
[0118] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0119] Figure 7 A functional structure diagram of an object processing device provided in another embodiment of the present application is shown in FIG. Figure 7 As shown, the device of this embodiment is Figure 6 On the basis of the device structure shown, further, it may include: a receiving module 62.
[0120] The receiving module 62 is used to receive an instruction to copy or cut a second object, where the second object is at least a part of a react component in the visual editor, and the react component corresponds to multiple data nodes; the processing module 61 is also used to cache a target data node corresponding to the second object among the multiple data nodes into the clipboard of the visual editor according to the instruction to copy or cut the second object.
[0121] Optionally, the receiving module 62 is also used to receive a second paste instruction, which includes information of a second paste position selected in the visual editor; the processing module 61 is also used to copy the target data node in the clipboard of the visual editor according to the second paste instruction, and render the copied target data node to display the second object at the second paste position of the visual editor.
[0122] Optionally, when the second object is cut and the second object is part of the react component, the processing module 61 is also used to: delete the target data node corresponding to the second object from the multiple data nodes; render the multiple data nodes after removing the target data node, so as to display the component of the react component after removing the second object in the visual editor.
[0123] Optionally, when the second object is cut and the second object is the entirety of the react component, the processing module 61 is further configured to delete the multiple data nodes so that the react component does not exist in the visual editor.
[0124] Optionally, the receiving module 62 is used to receive an instruction to copy or cut a third object, where the third object is an object of a non-react component in the visual editor; the processing module 61 is also used to cache the third object to the clipboard of the visual editor according to the instruction to copy or cut the third object.
[0125] It should be noted that the object processing device in this embodiment may be a terminal or a server, or may be a chip applied to a terminal or a server, or other combined devices or components having the above functions.
[0126] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0127] Figure 8 For a schematic diagram of the structure of the electronic device provided in the embodiment of the present application, see Figure 8 , the electronic device of this embodiment includes: a processor 72, a memory 71 and a communication bus 73, the communication bus 73 is used to connect the processor 72 and the memory 71, and the processor 72 is coupled to the memory 71;
[0128] The memory 71 is used to store computer programs;
[0129] The processor 72 is used to call the computer program stored in the memory 71 to implement the method in the above method embodiment.
[0130] The computer program may also be stored in a memory outside the electronic device.
[0131] It should be understood that in the embodiment of the present application, the processor 72 may be a CPU, and the processor 52 may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0132] The memory 71 may include a read-only memory and a random access memory, and provide instructions and data to the processor 72. The memory 71 may also include a non-volatile random access memory. For example, the memory 71 may also store information on the device type.
[0133] The memory 71 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0134] The bus 73 may include, in addition to the data bus, a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as bus 73 in the figure.
[0135] An embodiment of the present application provides a readable storage medium, including a program or an instruction. When the program or the instruction is executed on a computer, the method described in any of the above method embodiments is executed.
[0136] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An object processing method, characterized in that: include: According to a first paste instruction, a first object is obtained from a clipboard of a second page or a clipboard of a first browser or a clipboard of an operating system, wherein the second page is a page where the first object is located, the first browser is a browser corresponding to the second page, the first object is an object outside a visual editor of the first page, and the first paste instruction includes information of a first paste position selected in the visual editor; Updating the cached content in the clipboard of the visual editor to the first object; Paste the first object to the first paste position of the visual editor according to the information of the first paste position; The method further includes: receiving an instruction to copy or cut a second object, the second object being at least a portion of a react component in the visual editor, the react component corresponding to a plurality of data nodes; According to the instruction to copy or cut the second object, cache a target data node corresponding to the second object among the multiple data nodes into a clipboard of the visual editor; The method further includes: receiving a second paste instruction, wherein the second paste instruction includes information of a second paste position selected in the visual editor; According to the second paste instruction, the target data node in the clipboard of the visual editor is copied, and the copied target data node is rendered to display the second object at the second paste position of the visual editor.
2. The method according to claim 1, characterized in that In the case where the second object is cut and the second object is part of the react component, the method further includes: Deleting a target data node corresponding to the second object from among the multiple data nodes; Render the nodes obtained by removing the target data node from the multiple data nodes, so as to display the components obtained by removing the second object from the react component in the visual editor.
3. The method according to claim 1, characterized in that In the case where the second object is cut and the second object is the entirety of the react component, the method further includes: The multiple data nodes are deleted so that the react component does not exist in the visual editor.
4. The method according to claim 1, characterized in that Also includes: Receiving an instruction to copy or cut a third object, where the third object is an object of a non-react component in the visual editor; According to the instruction to copy or cut the third object, the third object is cached in the clipboard of the visual editor.
5. An object processing device, characterized in that: include: a processing module, configured to obtain a first object from a clipboard of a second page or a clipboard of a first browser or a clipboard of an operating system according to a first paste instruction, wherein the second page is a page where the first object is located, the first browser is a browser corresponding to the second page, the first object is an object outside a visual editor of the first page, and the first paste instruction includes information of a first paste position selected in the visual editor; The processing module is further used to update the cache content in the clipboard of the visual editor to the first object; The processing module is further used to paste the first object to the first paste position of the visual editor according to the information of the first paste position; The processing module further comprises a receiving module, the receiving module being used to receive an instruction to copy or cut a second object, the second object being at least a part of a react component in the visual editor, the react component corresponding to a plurality of data nodes; the processing module being further used to cache a target data node corresponding to the second object among the plurality of data nodes into a clipboard of the visual editor according to the instruction to copy or cut the second object; The receiving module is further used to receive a second paste instruction, which includes information of a second paste position selected in the visual editor; the processing module is further used to copy the target data node in the clipboard of the visual editor according to the second paste instruction, and render the copied target data node to display the second object at the second paste position of the visual editor.
6. An electronic device, characterized in that: include: A memory and a processor; the memory and the processor are connected; The memory is used to store program commands; The processor is used to implement the method according to any one of claims 1 to 4 when the program command is executed.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Clip data synchronization method and device
CN103853619A