METHOD FOR INVOKING LOCAL KEYBOARD ON HTML PAGE IN USER TERMINAL DEVICE AND APPARATUS THEREOF
20170235378 · 2017-08-17
Inventors
Cpc classification
G06F3/023
PHYSICS
G06F2203/04804
PHYSICS
G06F9/454
PHYSICS
G06F3/04886
PHYSICS
G06F40/143
PHYSICS
International classification
G06F3/023
PHYSICS
Abstract
A method and an apparatus for invoking a local keyboard on an HTML page in a user terminal device are disclosed. The method includes analyzing an HTML page when a user terminal device loads the HTML page, and generating a local input field at each page input field having a recognition identifier if page input field(s) having recognition identifier(s) and needing to invoke local keyboard(s) exist(s); setting a type of a local keyboard that needs to be invoked by each local input field; and transmitting input information received by the local input field through a corresponding local keyboard to the HTML page. By generating a local input field at a page input field having a recognition identifier, the present disclosure can implement an invocation of a local keyboard that cannot be invoked by a page input field through the local input field.
Claims
1. A method implemented by a computing device, the method comprising: analyzing a webpage when the computing device loads the webpage, and generating a local input field at a page input field having a recognition identifier, the page input field needing to invoke a local keyboard, wherein the local input field covers the page input field at a same location; setting a type of the local keyboard to be invoked by the local input field; and transmitting input information received by the local input field through the local keyboard to the webpage.
2. The method of claim 1, further comprising: determining whether the local input field invoking the local keyboard will be blocked by the local keyboard after a triggering event of displaying the local keyboard is received; and adjusting an offset of a scroll view of a webpage container of the computing device and a content height of the webpage to enable the local input field invoking the local keyboard not to be blocked by the local keyboard in response to determining that the cal input field invoking the local keyboard will be blocked by the local keyboard.
3. The method of claim 2, further comprising: determining whether the content height of the webpage is an initial value in response to receiving a triggering event of hiding the local keyboard; and restoring the content height of the webpage to the initial value in response to determining that the content height of the webpage is not the initial value.
4. The method of claim 1, wherein generating the local input field at the page input field having the recognition identifier comprises: calculating location information of the page input field having the recognition identifier, and acquiring an input type of the page input field having the recognition identifier; and generating the local input field at the page input field having the recognition identifier to cover the page input field at a corresponding location based on the location information and the input type, wherein the local input field is a transparent input field, and an input type of the local input field is identical to the input type of the page input field covered by the local input field.
5. The method of claim 4, wherein generating the local input field at the page input field having the recognition identifier further comprises adding prompt information included in the page input field into the local input field covering the page input field, and removing the prompt information from the page input field.
6. The method of claim 1, further comprising: determining whether a webpage container of the computing device includes a local input field generated for a previous webpage; removing the generated local input field in response to determining that the webpage container includes the local input field generated for the previous webpage, wherein generating the local input field at the page input field having the recognition identifier is performed after the local input field generated for the previous webpage is removed.
7. The method of claim 1, wherein the webpage comprises an HTML5 page, and the computing device runs an iOS system.
8. An apparatus comprising: one or more processors; memory; an analysis unit stored in the memory and executable by the one or more processors to analyze a webpage when the webpage is loaded, and determine whether a page input field having a recognition identifier and needing to invoke a local keyboard exists; a generation unit configured to generate a local input field at the page input field having the recognition identifier when a determination result of the analysis unit is affirmative, wherein the local input field covers the page input field at a same location; a setting unit configured to set a type of the local keyboard to be invoked by the local input field; and a transmission unit configured to transmit input information received by the local input field through the local keyboard to the webpage.
9. The apparatus of claim 8, further comprising: a first determination unit configured to determine whether the local input field invoking the local keyboard will be blocked by the local keyboard after a triggering event of displaying the local keyboard is received; and an adjustment unit configured to adjust an offset of a scroll view of a webpage container and a content height of the webpage if a determination result of the first determination unit is positive to enable the local input field invoking the local keyboard not to be blocked by the local keyboard.
10. The apparatus of claim 9, further comprising: a second determination unit configured to determine whether the content height of the webpage is an initial value after a triggering event of hiding the local keyboard is received; and a restoring unit configured to restore the content height of the webpage to the initial value when a determination result of the second determination unit is negative.
11. The apparatus of claim 8, wherein the generation unit comprises: a location calculation sub-unit configured to calculate location information of the page input field having the recognition identifier, and acquire an input type of the page input field having the recognition identifier; and an input field generation sub-unit configured to generate the local input field at the page input field having the recognition identifier to cover the page input field at a corresponding location based on the location information and the input type, wherein the local input field is a transparent input field, and an input type of the local input field is identical to the input type of the page input field covered by the local input field.
12. The apparatus of claim 11, wherein the page input field includes prompt information, and the generation unit further comprises a prompt removal sub-unit configured to add the prompt information included in the page input field into the local input field covering the page input field, and remove the prompt information from the page input field.
13. The apparatus of claim 8, further comprising: a third determination unit configured to determine whether a webpage container includes a local input field generated for a previous webpage; a removal unit configured to remove the generated local input field in response to determining that the webpage container includes the local input field generated for the previous webpage; and an execution unit configured to control the generation unit to generate the local input field at the page input field having the recognition identifier when the determination result of the third determination unit is negative.
14. One or more computer-readable media storing executable instructions that, when executed by one or more processors, cause the one or more processors to perform acts comprising: analyzing a webpage when the webpage is loaded, and generating a local input field at a page input field having a recognition identifier, the page input field needing to invoke a local keyboard, wherein the local input field covers the page input field at a same location; setting a type of the local keyboard to be invoked by the local input field; and transmitting input information received by the local input field through the local keyboard to the webpage.
15. The one or more computer-readable media of claim 14, the acts further comprising: determining whether the local input field invoking the local keyboard will be blocked by the local keyboard after a triggering event of displaying the local keyboard is received; and adjusting an offset of a scroll view of a webpage container and a content height of the webpage to enable the local input field invoking the local keyboard not to be blocked by the local keyboard in response to determining that the cal input field invoking the local keyboard will be blocked by the local keyboard.
16. The one or more computer-readable media of claim 15, the acts further comprising: determining whether the content height of the webpage is an initial value in response to receiving a triggering event of hiding the local keyboard; and restoring the content height of the webpage to the initial value in response to determining that the content height of the webpage is not the initial value.
17. The one or more computer-readable media of claim 14, wherein generating the local input field at the page input field having the recognition identifier comprises: calculating location information of the page input field having the recognition identifier, and acquiring an input type of the page input field having the recognition identifier; and generating the local input field at the page input field having the recognition identifier to cover the page input field at a corresponding location based on the location information and the input type, wherein the local input field is a transparent input field, and an input type of the local input field is identical to the input type of the page input field covered by the local input field.
18. The one or more computer-readable media of claim 17, wherein generating the local input field at the page input field having the recognition identifier further comprises adding prompt information included in the page input field into the local input field covering the page input field, and removing the prompt information from the page input field.
19. The one or more computer-readable media of claim 14, the acts further comprising: determining whether a webpage container includes a local input field generated for a previous webpage; removing the generated local input field in response to determining that the webpage container includes the local input field generated for the previous webpage, wherein generating the local input field at the page input field having the recognition identifier is performed after the local input field generated for the previous webpage is removed.
20. The one or more computer-readable media of claim 14, wherein the webpage comprises an HTML5 page.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0013]
[0014]
[0015]
DETAILED DESCRIPTION
[0016] A number of technical details are provided hereinafter to facilitate readers to understand the present application in a better manner. However, one of ordinary skill in the art can understand that technical solutions under the protection of the claims of the present application may also be implemented even without these technical details and various modifications and changes based on the following implementations.
[0017] The implementations of the present disclosure are described in further detail in conjunction with the accompanying drawings hereinafter to make the objectives, the technical solutions and the advantages of the present disclosure more clearly.
[0018] In implementations, the present disclosure provides a method for invoking a local keyboard on an HTML page in a user terminal device.
[0019] As shown in
[0020] At S102, a recognition identifier is added to an HTML page input field that needs to invoke a local keyboard. Local keyboards refer to keyboards that a user terminal possess, which includes a system built-in keyboard and a customized keyboard of the terminal. A customized keyboard refers to a keyboard that is not provided in a system of a terminal which is designed according to a specific demand, for example, a numeric keypad that is only used for inputting a monetary amount, a keyboard that is only used for inputting an identity card number, etc. A page input field refers to a label INPUT of the HTML. A recognition identifier refers to an identifier used for distinguishing from other input fields which do not need to invoke a local keyboard, for example, adding a pattern category, an attribute, etc., to an INPUT label.
[0021] At S104, an HTML page is analyzed when the user terminal device loads the HTML page, and a determination is made as to whether page input field(s) having recognition identifier(s) and needing to invoke local keyboard(s) exist(s). The determination is made based on the recognition identifier that is added to the INPUT label at S102.
[0022] If a determination result is affirmative, S106 is performed. Otherwise, the process is ended.
[0023] At S106, a respective local input field is generated at each page input field having a recognition identifier. A local input field covers a page input field at the same location.
[0024] At S108, a type of a respective local keyboard that needs to be invoked by each local input field is configured. Respective types of local keyboards that need to be invoked by different local input fields may be the same or different, which may depend on keyboard type identifiers added to the page input fields.
[0025] At S110, input information which is received by the respective local input field through a corresponding local keyboard is transmitted to the HTML page.
[0026] The process is then ended.
[0027] In implementations, prior to S110, the method may further include determining whether a local input field invoking a local keyboard will be blocked by the invoked local keyboard, in response to receiving a triggering event of invoking the local keyboard for display; performing a response to a user input directly, and performing S110 after the user input is completed if a determination result is negative; and adjusting an offset of a scroll view of a webpage container of the user terminal device and a content height of the HTML page to enable the local input field invoking the local keyboard not to be blocked by the local keyboard if the determination result is positive.
[0028] Specifically, a view of a webpage container of the user terminal device may be scrolled so that the local input field invoking the local keyboard will not be blocked by the keyboard. When a webpage height is insufficient for scrolling to prevent the input field from being blocked, a content height of the HTML is increased, and the manner of increasing the height may include increasing the padding-bottom of a webpage body, or adding blank height place holder(s), etc.
[0029] In the above operation, a distance of the scrolling that needs to be conducted and the HTML content height that needs to be increased may be determined based on a height of the local keyboard, a position of the bottom of the page input field relative to the user equipment webpage container, and a height of a screen. As shown in
[0030] Moreover, in implementations, prior to S110, the method may further include determining whether a content height of the current HTML page is an initial value in response to receiving a triggering event of hiding a local keyboard; and restoring the content height of the current HTML page to the initial value, and triggering scrolling of the HTML page if a determination result is negative, and performing S110 if the determination result is positive.
[0031] In the above implementations, an execution order of the processing after receiving a display event of invoking a local keyboard and the processing after receiving a trigger event of hiding a local keyboard is not fixed. One processing may be conducted after another processing, or both processing may be conducted in parallel.
[0032] Moreover, in implementations, 5106 may include calculating location information of each page input field having the recognition identifier determined in the current HTML page, and acquiring an input type of each page input field having the recognition identifier; and generating the respective local input field at each page input field having the recognition identifier to cover the page input field at a corresponding location based on the location information and the input type, wherein the local input field is a transparent input field, and an input type of the local input field is identical to an input type of the page input field covered by the local input field.
[0033] It may be understood that a local input field is set as a transparent input field, such that a design pattern of a page input field in an entire HTML page may be preserved after the page input field is covered by the local input field.
[0034] Moreover, in implementations, 5106 may further include adding prompt information included in a page input field having an input prompt into a local input field that covers the page input field, and removing the prompt information from the page input field.
[0035] It may be understood that transferring prompt information of a page input field into a local input field that covers the page input field can avoid generating a ghost image of the prompt information when the local input field is a transparent input field.
[0036] If a currently loaded HTML page includes a local input field that is left behind by a previous HTML page, a situation, in which a local keyboard is invoked out at a location where no input is needed or the local keyboard covers a page input field of the currently loaded HTML page, may occur when a user clicks on the current HTML page. Therefore, the local input field that is left behind needs to be removed in advance to avoid the occurrence of this situation. Therefore, in implementations, prior to S104, the method may further include determining whether a webpage container of the current user terminal device includes a generated local input field; removing the generated local input field if a determination result is positive; and directly performing S104 if the determination result is negative.
[0037] In implementations, the HTML page is an HTML5 page, and an iOS system runs in the user terminal device. Apparently, it can be understood that the method disclosed in the present disclosure may also be used to solve the problem if other versions of HTML pages or other operating systems of user terminal devices have the same problem.
[0038] By adding a recognition identifier to an input field of a HTML page, a local input field may be generated at a page input field having a recognition identifier to cover the page input field when the page is loaded. As such, the local input field can implement an invocation of a local keyboard that cannot be invoked by the page input field.
[0039] The method implementations of the present disclosure can all be implemented in a form of software, hardware, firmware, or the like. Regardless of whether the present disclosure is implemented by means of software, hardware or firmware, an instruction code can be stored in any type of computer accessible storage device (e.g., permanent or modifiable, volatile or non-volatile, solid-state or non-solid-state, fixed or replaceable media, etc.). Similarly, the storage device may be, for example, a Programmable Array Logic (“PLA”), a Random Access Memory (“RAM”), a Programmable Read Only Memory (“PROM”), a Read-Only Memory (“ROM”), an Electrically Erasable Programmable ROM (“EEPROM”), a magnetic disk, an optical disc, a Digital Versatile Disc (“DVD”), etc.
[0040] In implementations, the present disclosure further provides an apparatus for invoking a local keyboard on an HTML page in a user terminal device.
[0041] As shown in
[0042] The memory 308 may include a form of computer-readable media, e.g., a non-permanent storage device, random-access memory (RAM) and/or a nonvolatile internal storage, such as read-only memory (ROM) or flash RAM. The memory 308 is an example of computer-readable media.
[0043] The computer-readable media may include a permanent or non-permanent type, a removable or non-removable media, which may achieve storage of information using any method or technology. The information may include a computer-readable instruction, a data structure, a program module or other data. Examples of computer storage media include, but not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electronically erasable programmable read-only memory (EEPROM), quick flash memory or other internal storage technology, compact disk read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media, which may be used to store information that may be accessed by a computing device. As defined herein, the computer-readable media does not include transitory media, such as modulated data signals and carrier waves. For the ease of description, the system is divided into various types of units based on functions, and the units are described separately in the foregoing description. Apparently, the functions of various units may be implemented in one or more software and/or hardware components during an implementation of the present disclosure.
[0044] In implementations, the memory 308 may include program units 310 and program data 312. The program units 310 may include an addition unit 314 configured to add a recognition identifier on an HTML page input field that needs to invoke a local keyboard; an analysis unit 316 configured to analyze an HTML page when a user terminal device loads the HTML page, and determine whether page input field(s) having recognition identifier(s) and needing to invoke local keyboard(s) exist(s); a generation unit 318 configured to generate a local input field at each page input field having a recognition identifier when a determination result of the analysis unit is positive, wherein the local input field covers the respective page input field at a same location; a setting unit 320 configured to set a type of a local keyboard that needs to be invoked by each local input field; and a transmission unit 322 configured to transmit input information received by the local input field through a corresponding local keyboard to the HTML page.
[0045] Moreover, in implementations, the apparatus may further include a first determination unit 324, an adjustment unit 326, a second determination unit 328, and a restoring unit 330. The first determination unit 324 may determine whether the local input field invoking the local keyboard will be blocked by the invoked local keyboard after a triggering event of displaying the local keyboard is received. The adjustment unit 326 may adjust an offset of a scroll view of a webpage container of the user terminal device and a content height of the HTML page if a determination result of the first determination unit is positive, such that the local input field invoking the local keyboard will not be blocked by the local keyboard. In implementations, the scroll view of the webpage container of the user terminal device may be scrolled for a distance so that when a webpage height is insufficient for scrolling to make the input field visible, the content height of the HTML page is adjusted to prevent the local input field from being blocked by the invoked local keyboard. The second determination unit 328 may determine whether the content height of the HTML page is an initial value after a triggering event of hiding the local keyboard is received. The restoring unit 330 may restore the content height of the HTML page to the initial value when a determination result of the second determination unit is negative, and trigger scrolling of the HTML page.
[0046] Moreover, in implementations, the generation unit 318 may include a location calculation sub-unit 332 configured to calculate location information of each page input field having the recognition identifier determined in the current HTML page, and acquire an input type of each page input field having the recognition identifier; an input field generation sub-unit 334 configured to generate the local input field at each page input field having the recognition identifier to cover the page input field at a corresponding location based on the location information and the input type, wherein the local input field is a transparent input field, and an input type of the local input field is identical to an input type of the page input field covered by the local input field; and a prompt removal sub-unit 336 configured to add prompt information included in a page input field having an input prompt into a local input field that covers the page input field, and remove the prompt information from the page input field.
[0047] Moreover, in implementations, the apparatus 300 may further include a third determination unit 338 configured to determine whether a generated local input field in a webpage container of the user terminal device exists before the analysis unit analyzes the HTML page loaded by the user terminal device; a removal unit 340 configured to remove the generated local input field when a determination result of the third determination unit is positive; and an execution unit 342 configured to control the generation unit to generate the local input field at each page input field having the recognition identifier when the determination result of the third determination unit is negative.
[0048] The first implementation is a method embodiment corresponding to the present implementation. The present implementation may be implemented in conjunction with the first implementation. Related technical details mentioned in the first implementation are still effective in the present implementation, and are repeatedly described herein to reduce redundancy. Correspondingly, related technical details mentioned in the present implementation are also applicable to the first implementation.
[0049] It should be noted that the units mentioned in the apparatus implementations of the present disclosure are logical units. Physically, a logical unit may be implemented by a physical unit, a portion of a physical unit, or a combination of a plurality of physical units. Physical implementations of these logical units per se are not the most important, but a combination of functions implemented by the logical units is the key to solve the technical problem raised in the present disclosure. In addition, in order to highlight the innovative parts of the present disclosure, each apparatus implementation of the present disclosure does not introduce units that are not closely related to the technical problem raised in the present disclosure. However, this does not indicate that the apparatus implementations do not include other units.
[0050] It should be noted that relational terms such as “first” and “second” in the claims and specification of the present patent application are only used to differentiate one entity or operation from another entity or operation, but do not require or imply any actual relationship or order between these entities or operations. Moreover, terms such as “include”, “comprise”, or any variants thereof are intended to cover a non-exclusive inclusion, such that a process, a method, a product, or a device that includes a series of elements includes not only such elements but also other elements not specified expressly, or may further include inherent elements of the process, the method, the product, or the device. Without additional restrictions, an element limited by “include a/an . . . ” does not exclude other same elements existing in the process, the method, the product, or the device that includes the element.
[0051] Although the present disclosure has been illustrated and described with reference to some exemplary implementations of the present disclosure, one of ordinary skill in the art should understand that various modifications can be made to the present disclosure in forms and details without departing from the spirit and scope of the present disclosure.