CN112149392A - Rich text editing method and device - Google Patents
Rich text editing method and device Download PDFInfo
- Publication number
- CN112149392A CN112149392A CN201910500148.4A CN201910500148A CN112149392A CN 112149392 A CN112149392 A CN 112149392A CN 201910500148 A CN201910500148 A CN 201910500148A CN 112149392 A CN112149392 A CN 112149392A
- Authority
- CN
- China
- Prior art keywords
- cross
- current page
- rich text
- server
- domain resource
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9558—Details of hyperlinks; Management of linked annotations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Abstract
The invention discloses a rich text editing method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a cross-domain resource link from an editing area of a rich text editor; according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache; and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor. According to the implementation mode, a foreground program is adopted to automatically initiate a downloading request, cross-domain resources are downloaded to a current page cache, so that the technical problems that the pressure of a server is large and the operation cost of a user is increased are solved, the pressure of the server is reduced, the pressure of a server for acquiring remote files is distributed to each user when a plurality of users make concurrent requests, the users do not need to manually download and upload the files, and the operation cost of the users is reduced.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a rich text editing method and device.
Background
The rich text editor generally needs to support the introduction of external resources (i.e., cross-domain resources), which may be pictures or files copied from other websites by a user, so as to avoid that the contents of the websites cannot be viewed when external resource links fail, and to facilitate resource retrieval of the websites, a backup is left on a server of the websites instead of just one external resource link when the user saves the files. The conventional schemes are generally divided into the following two processing modes:
1. the user fills a resource link, and the background server downloads and stores the resource file on the server from the server.
2. The user downloads the resource file to the client, and then the resource file is directly uploaded by using the file uploading function of the rich text editor and stored on the server.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. the pressure of the server is increased, if a plurality of users request concurrently, the flow of the background server is likely to be greatly influenced, the background program needs to consider downloading resource queuing, deploying a plurality of servers for capturing and the like in the aspect of optimization, and the downloaded files are likely to be shielded by the anti-theft chain rule.
2. The operation cost of the user is increased, and the user needs to manually download and upload files.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for editing a rich text, which can solve the problems of excessive pressure on a background server and increased operation cost of a user.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a rich text editing method including: acquiring a cross-domain resource link from an input box of a rich text editor; according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache; and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
Optionally, automatically initiating a download request by using a foreground program according to the cross-domain resource link, and downloading the cross-domain resource to the current page cache, including: calling a fetch method in a foreground program, and automatically initiating a downloading request to a remote resource server according to the cross-domain resource link; and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request.
Optionally, automatically uploading the cross-domain resource in the current page cache to a file server of a rich text editor, including: uploading cross-domain resources in the current page cache to a file server of a rich text editor in a tabular data format through an XMLHttpRequest object; or embedding a sub-page in the current page, and uploading the cross-domain resources in the current page cache to a file server of the rich text editor through a form in the sub-page.
Optionally, after the cross-domain resource in the current page cache is automatically uploaded to a file server of a rich text editor, the method further includes: determining a storage path of the cross-domain resource in the file server; and returning the storage path to the foreground program.
According to still another aspect of an embodiment of the present invention, there is provided a rich text editing apparatus including: an acquisition module to: acquiring a cross-domain resource link from an input box of a rich text editor; a download module to: according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache; an upload module to: and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
Optionally, the downloading module is further configured to: calling a fetch method in a foreground program, and automatically initiating a downloading request to a remote resource server according to the cross-domain resource link; and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request.
Optionally, the upload module is further configured to: uploading cross-domain resources in the current page cache to a file server of a rich text editor in a tabular data format through an XMLHttpRequest object; or embedding a sub-page in the current page, and uploading the cross-domain resources in the current page cache to a file server of the rich text editor through a form in the sub-page.
Optionally, the apparatus further comprises a return module configured to: determining a storage path of the cross-domain resource in the file server; and returning the storage path to the foreground program.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the rich text editing method as provided by embodiments of the present invention.
According to a further aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements a rich text editing method as provided by embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: because the technical means that the foreground program automatically initiates the downloading request and downloads the cross-domain resources to the current page cache is adopted, the technical problems of high pressure of a server and increased operation cost of users are solved, the pressure of the server is further reduced, the pressure of a server for acquiring remote files is distributed to each user when a plurality of users make concurrent requests, the users do not need to manually download and upload the files, and the operation cost of the users is reduced. And moreover, the downloading resources are captured without considering the deployment of a plurality of servers, and the condition that the downloaded files are shielded by the anti-theft chain rule is also avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a basic flow of a rich text editing method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main flow of a rich text editing method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a flow of a preferred method of rich text editing according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the basic modules of a rich text editing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of modules of a rich text editing preferred apparatus according to an embodiment of the present invention.
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of a basic flow of a method for inserting a cross-domain resource into a rich text editor, according to an embodiment of the invention. As shown in fig. 1, an embodiment of the present invention provides a rich text editing method, including:
s101, acquiring a cross-domain resource link from an input box of a rich text editor;
s102, according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request, and the cross-domain resource is downloaded to a current page for caching;
and S103, automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
In the prior art, resource files are downloaded and uploaded through a server, so that the server is inevitably overloaded, and the performance of the server is influenced. The embodiment of the invention adopts the technical means that a foreground program of a client browser automatically initiates a downloading request to download cross-domain resources to the current page cache, distributes the pressure of a server for acquiring remote files to each client when a plurality of client users concurrently request, saves the burden of downloading the files by the server, and brings convenience to the operation of the users, thereby overcoming the technical problems of high pressure of the server and increased operation cost of the users, further achieving the technical effects of reducing the pressure of the server, avoiding manual downloading and uploading of the files by the users and reducing the operation cost of the users.
In step S102 of the embodiment of the present invention, automatically initiating a download request by using a foreground program according to the cross-domain resource link, and downloading the cross-domain resource to a current page cache, includes: calling a fetch method in a foreground program, and automatically initiating a downloading request to a remote resource server according to the cross-domain resource link; and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request. The fetch method is an asynchronous request scheme, is a javascript function built in a browser, and can be used for acquiring cross-domain resources. Except for calling the fetch method in the foreground program, the method can also be obtained by using an XMLHttpRequest object, an analytic format needs to be set into a data stream during calling, a request header of a download request is set without verification information, and the download request is processed by binding a receiving completion event.
The embodiment of the invention adopts the technical means that the foreground program automatically initiates the downloading request to download the cross-domain resources to the current page cache, thereby saving the burden of a server for downloading files and further achieving the technical effect of relieving the pressure of a server.
In step S103 of the embodiment of the present invention, automatically uploading the cross-domain resource in the current page cache to a file server of a rich text editor, includes: automatically uploading cross-domain resources in a current page cache to a file server of a rich text editor in a tabular data (formData) format through an XMLHttpRequest object; or embedding a sub-page in the current page, and uploading the cross-domain resources in the current page cache to a file server of the rich text editor through a form in the sub-page. The XMLHttpRequest (XHR) in the embodiment of the invention is a group of API function sets which can be called by script languages embedded in JavaScript, JScript, VBScript and other web browsers, and XML or other data is transmitted and received between the browser and the web server through HTTP. The XMLHttpRequest object can be used for interacting with the server, so that the Web page can only update part of the page without influencing the operation of a user. The formData format is a key-value pair data format, so that XMLHttpRequest is used for sending data to realize the serialization of form data, thereby reducing the splicing of form elements and improving the working efficiency.
The embodiment of the invention adopts the technical means that a foreground program automatically initiates a downloading request to download cross-domain resources to the current page cache, distributes the pressure of a server for acquiring remote files to each user when a plurality of users make concurrent requests, saves the burden of the server for downloading the files, and brings convenience to the operation of the users, thereby overcoming the technical problems of high pressure of a server and increased operation cost of the users, further achieving the technical effects of reducing the pressure of the server, avoiding manual downloading and uploading of the files by the users and reducing the operation cost of the users.
In step S103 of the embodiment of the present invention, after the cross-domain resource in the current page cache is automatically uploaded to a file server of a rich text editor, the method further includes: determining a storage path of the cross-domain resource in the file server; and returning the storage path to the foreground program. After the cross-domain resources in the current page cache are automatically uploaded to the file server of the rich text editor, the storage path is returned to the foreground program, so that the subsequent calling of the cross-domain resources in the rich text editor is facilitated. Specifically, the method may include, but is not limited to, after returning the storage path to the foreground program, embedding the path code into the rich text input box by using the foreground program, so that the user may preview the cross-domain resource in real time in the rich text box. Meanwhile, the technical effects of relieving the pressure of the server, avoiding manual file downloading and uploading of a user and reducing the operation cost of the user are achieved.
Fig. 2 is a schematic diagram of a preferred flow of a rich text editing method according to an embodiment of the present invention. As shown in fig. 2, a user inputs a file resource link to be inserted in a rich text editor, a foreground program uses a fetch method of a browser to request a remote resource server, after acquiring a file data stream, sends file data in a formData format to the file server through an XMLHttpRequest object, starts to upload automatically, and after uploading a file, the file server returns a storage path of the uploaded file in the file server to the foreground program, and the uploading is completed.
FIG. 3 is a schematic diagram of the flow of a preferred method of inserting cross-domain resources into a rich text editor, according to an embodiment of the invention; as shown in fig. 3, an embodiment of the present invention provides a rich text editing preferred method, including:
s301, acquiring a cross-domain resource link from an input box of a rich text editor;
s302, the client calls a fetch method in a foreground program of the browser, automatically initiates a downloading request to a remote resource server according to the cross-domain resource link, and downloads the cross-domain resources in the remote resource server to a current page cache of the browser;
step S303, calling an XMLHttpRequest object by the client, converting the cross-domain resources in the current page cache into a formData format, and then automatically uploading the cross-domain resources to a file server of a rich text editor;
and S304, determining a storage path of the cross-domain resource in the file server, and returning the storage path to a foreground program.
The embodiment of the invention adopts the technical means that a foreground program of a browser automatically initiates a downloading request to download cross-domain resources to the current page cache, distributes the pressure of a server for acquiring remote files to each user when a plurality of users request simultaneously, saves the burden of downloading the files by the server, and brings convenience to the operation of the users, thereby overcoming the technical problems of high pressure of a server and increased operation cost of the users, further achieving the technical effects of reducing the pressure of the server, avoiding manual downloading and uploading of the files by the users and reducing the operation cost of the users. The XMLHttpRequest object can be used for interacting with the server, so that the Web page can only update part of the page without influencing the operation of a user. The formData format is a key-value pair data format, so that XMLHttpRequest is used for sending data to realize the serialization of form data, thereby reducing the splicing of form elements and improving the working efficiency. The memory path is returned to the foreground program to facilitate subsequent invocation of the span resources in the rich text editor.
FIG. 4 is a schematic diagram of the basic modules of an apparatus for inserting cross-domain resources into a rich text editor, according to an embodiment of the invention. An embodiment of the present invention provides a rich text editing apparatus 400, including:
an obtaining module 401 configured to: acquiring a cross-domain resource link from an input box of a rich text editor;
a download module 402 for: according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache;
an upload module 403, configured to: and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
The embodiment of the invention adopts the technical means that a foreground program of a browser automatically initiates a downloading request to download cross-domain resources to the current page cache, distributes the pressure of a server for acquiring remote files to each user when a plurality of users request simultaneously, saves the burden of downloading the files by the server, and brings convenience to the operation of the users, thereby overcoming the technical problems of high pressure of a server and increased operation cost of the users, further achieving the technical effects of reducing the pressure of the server, avoiding manual downloading and uploading of the files by the users and reducing the operation cost of the users.
In this embodiment of the present invention, the downloading module 402 is further configured to: calling a fetch method in a foreground program, and automatically initiating a downloading request to a remote resource server according to the cross-domain resource link; and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request. The embodiment of the invention adopts the technical means that the foreground program automatically initiates the downloading request to download the cross-domain resources to the current page cache, thereby saving the burden of a server for downloading files and further achieving the technical effect of relieving the pressure of a server.
In this embodiment of the present invention, the uploading module 403 is further configured to: and automatically uploading the cross-domain resources in the current page cache to a file server in a formData format through an XMLHttpRequest object. The XMLHttpRequest (XHR) in the embodiment of the invention is a group of API function sets which can be called by script languages embedded in JavaScript, JScript, VBScript and other web browsers, and XML or other data is transmitted and received between the browser and the web server through HTTP. The XMLHttpRequest object can be used for interacting with the server, so that the Web page can only update part of the page without influencing the operation of a user. The formData format is a key-value pair data format, so that XMLHttpRequest is used for sending data to realize the serialization of form data, thereby reducing the splicing of form elements and improving the working efficiency. The technical means that a foreground program automatically initiates a downloading request and cross-domain resources are downloaded to a current page cache is adopted, when a plurality of users concurrently request, the pressure of a server for obtaining remote files is distributed to each user, the burden of the server for downloading the files is saved, and convenience is brought to the operation of the users, so that the technical problems that the pressure of a server is high and the operation cost of the users is increased are solved, the pressure of the server is reduced, the files are not required to be manually downloaded and uploaded by the users, and the operation cost of the users is reduced.
In an embodiment of the present invention, the apparatus further includes a return module, configured to: determining a storage path of the cross-domain resource in a file server; and returning the storage path to the foreground program. After the cross-domain resources in the current page cache are automatically uploaded to the file server of the rich text editor, the storage path is returned to the foreground program, so that the subsequent calling of the cross-domain resources in the rich text editor is facilitated. Meanwhile, the technical effects of relieving the pressure of the server, avoiding manual file downloading and uploading of a user and reducing the operation cost of the user are achieved.
FIG. 5 is a schematic diagram of the modules of a preferred apparatus for inserting cross-domain resources into a rich text editor, according to an embodiment of the invention. The embodiment of the present invention provides a rich text editing and optimizing device 500, which includes:
an obtaining module 501, configured to: acquiring a cross-domain resource link from an input box of a rich text editor;
a download module 502 for: the client calls a fetch method in a foreground program of the browser, automatically initiates a downloading request to the remote resource server according to the cross-domain resource link, and downloads the cross-domain resources in the remote resource server to the current page cache of the browser; except for calling the fetch method in the foreground program, the method can also be obtained by using an XMLHttpRequest object, an analytic format needs to be set into a data stream during calling, a request header of a download request is set without verification information, and the download request is processed by binding a receiving completion event.
An upload module 503, configured to: a client calls an XMLHttpRequest object, converts the cross-domain resources in the current page cache into a formData format and then automatically uploads the cross-domain resources to a file server of a rich text editor; or embedding a sub-page in the current page, and uploading the cross-domain resources in the current page cache to a file server of the rich text editor through a form in the sub-page.
A return module 504 for: and determining a storage path of the cross-domain resource in the file server, and returning the storage path to a foreground program.
The embodiment of the invention adopts the technical means that a foreground program of a browser automatically initiates a downloading request to download cross-domain resources to the current page cache, distributes the pressure of a server for acquiring remote files to each user when a plurality of users request simultaneously, saves the burden of downloading the files by the server, and brings convenience to the operation of the users, thereby overcoming the technical problems of high pressure of a server and increased operation cost of the users, further achieving the technical effects of reducing the pressure of the server, avoiding manual downloading and uploading of the files by the users and reducing the operation cost of the users. The XMLHttpRequest object can be used for interacting with the server, so that the Web page can only update part of the page without influencing the operation of a user. The formData format is a key-value pair data format, so that XMLHttpRequest is used for sending data to realize the serialization of form data, thereby reducing the splicing of form elements and improving the working efficiency. The memory path is returned to the foreground program to facilitate subsequent invocation of the span resources in the rich text editor.
Fig. 6 illustrates an exemplary system architecture 600 of a rich text editing method or apparatus to which embodiments of the invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 601, 602, and 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 601, 602, and 603. The background management server can analyze and process the received data such as the product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that the rich text editing method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the rich text editing apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a computer-readable storage medium according to the embodiments of the invention.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the rich text editing method as provided by embodiments of the present invention.
A computer-readable medium of an embodiment of the present invention has a computer program stored thereon, which when executed by a processor implements a rich text editing method as provided by an embodiment of the present invention.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an acquisition module, a downloading module and an uploading module. The names of these modules do not in some cases form a limitation on the module itself, for example, the feature extraction module may also be described as a "module for acquiring cross-domain resource links".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a cross-domain resource link from an editing area of a rich text editor; according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache; and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
According to the technical scheme of the embodiment of the invention, a foreground program is adopted to automatically initiate a downloading request and download cross-domain resources to the current page cache, so that the technical problems of high pressure of a server and increased operation cost of a user are solved, the pressure of the server is reduced, the pressure of a server for acquiring remote files is distributed to each user when a plurality of users have concurrent requests, the users do not need to manually download and upload the files, and the operation cost of the users is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A rich text editing method, comprising:
acquiring a cross-domain resource link from an editing area of a rich text editor;
triggering a downloading request by using a foreground program according to the cross-domain resource link, and downloading the cross-domain resource to the current page cache;
and uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
2. The method of claim 1, wherein the downloading request triggered by the foreground program according to the cross-domain resource link to download the cross-domain resource to the current page cache comprises:
calling a fetch method in a foreground program, and triggering a downloading request to a remote resource server according to the cross-domain resource link;
and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request.
3. The method of claim 1, wherein uploading the cross-domain resource in the current page cache to a file server of a rich text editor comprises:
uploading cross-domain resources in the current page cache to a file server of a rich text editor in a tabular data format through an XMLHttpRequest object; or the like, or, alternatively,
embedding a sub-page in the current page, and uploading cross-domain resources in the current page cache to a file server of a rich text editor through a form in the sub-page.
4. The method of claim 1, wherein after automatically uploading the cross-domain resource in the current page cache to a file server of a rich text editor, the method further comprises:
determining a storage path of the cross-domain resource in the file server;
and returning the storage path to the foreground program.
5. A rich text editing apparatus, comprising:
an acquisition module to: acquiring a cross-domain resource link from an editing area of a rich text editor;
a download module to: according to the cross-domain resource link, a foreground program is used for automatically initiating a downloading request to download the cross-domain resource to the current page cache;
an upload module to: and automatically uploading the cross-domain resources in the current page cache to a file server of a rich text editor.
6. The apparatus of claim 5, wherein the download module is further configured to:
calling a fetch method in a foreground program, and automatically initiating a downloading request to a remote resource server according to the cross-domain resource link;
and downloading the cross-domain resources in the remote resource server to the current page cache according to the downloading request.
7. The apparatus of claim 5, wherein the upload module is further configured to:
uploading cross-domain resources in the current page cache to a file server of a rich text editor in a tabular data format through an XMLHttpRequest object; or the like, or, alternatively,
embedding a sub-page in the current page, and uploading cross-domain resources in the current page cache to a file server of a rich text editor through a form in the sub-page.
8. The apparatus of claim 5, further comprising a return module to:
determining a storage path of the cross-domain resource in the file server;
and returning the storage path to the foreground program.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910500148.4A CN112149392A (en) | 2019-06-11 | 2019-06-11 | Rich text editing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910500148.4A CN112149392A (en) | 2019-06-11 | 2019-06-11 | Rich text editing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112149392A true CN112149392A (en) | 2020-12-29 |
Family
ID=73868428
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910500148.4A Pending CN112149392A (en) | 2019-06-11 | 2019-06-11 | Rich text editing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112149392A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112769925A (en) * | 2020-12-31 | 2021-05-07 | 南威软件股份有限公司 | Picture uploading method, system, terminal and medium based on rich text editor |
CN116760823A (en) * | 2023-08-15 | 2023-09-15 | 北京安锐卓越信息技术股份有限公司 | File access method and device, electronic equipment and storage medium |
-
2019
- 2019-06-11 CN CN201910500148.4A patent/CN112149392A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112769925A (en) * | 2020-12-31 | 2021-05-07 | 南威软件股份有限公司 | Picture uploading method, system, terminal and medium based on rich text editor |
CN112769925B (en) * | 2020-12-31 | 2023-12-15 | 南威软件股份有限公司 | Picture uploading method, system, terminal and medium based on rich text editor |
CN116760823A (en) * | 2023-08-15 | 2023-09-15 | 北京安锐卓越信息技术股份有限公司 | File access method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107844324B (en) | Client page jump processing method and device | |
CN110096660B (en) | Method and device for loading page pictures and electronic equipment | |
CN107547629B (en) | Method and device for downloading client static resources, electronic equipment and readable medium | |
CN110661826B (en) | Method for processing network request by proxy server side and proxy server | |
CN113382083B (en) | Webpage screenshot method and device | |
CN113517985B (en) | File data processing method and device, electronic equipment and computer readable medium | |
CN108874825B (en) | Abnormal data verification method and device | |
CN107357526B (en) | Method and apparatus for processing network data, server, and storage medium | |
CN112596920A (en) | Message processing method and device, electronic equipment and storage medium | |
CN112149392A (en) | Rich text editing method and device | |
US20190245827A1 (en) | Method and apparatus for synchronizing contact information and medium | |
CN112214250A (en) | Application program assembly loading method and device | |
CN112084042A (en) | Message processing method and device | |
CN113452733A (en) | File downloading method and device | |
CN111427899A (en) | Method, device, equipment and computer readable medium for storing file | |
CN112685481A (en) | Data processing method and device | |
CN109088907B (en) | File transfer method and device | |
CN107547437B (en) | Application identification method and device | |
CN113779122B (en) | Method and device for exporting data | |
CN110851194A (en) | Method and device for acquiring code for realizing new interface | |
CN114115941A (en) | Resource sending method, page rendering method, device, electronic equipment and medium | |
CN112688982B (en) | User request processing method and device | |
CN109087097B (en) | Method and device for updating same identifier of chain code | |
CN113761433A (en) | Service processing method and device | |
CN111291290A (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |