CN105786454A - Input method and device based on XMLHttpRequest - Google Patents

Input method and device based on XMLHttpRequest Download PDF

Info

Publication number
CN105786454A
CN105786454A CN201410784882.5A CN201410784882A CN105786454A CN 105786454 A CN105786454 A CN 105786454A CN 201410784882 A CN201410784882 A CN 201410784882A CN 105786454 A CN105786454 A CN 105786454A
Authority
CN
China
Prior art keywords
input
button
xmlhttprequest
order
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410784882.5A
Other languages
Chinese (zh)
Inventor
周敏岚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201410784882.5A priority Critical patent/CN105786454A/en
Publication of CN105786454A publication Critical patent/CN105786454A/en
Pending legal-status Critical Current

Links

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The invention discloses an input method based on XMLHttpRequest. The input method based on the XMLHttpRequest comprises the steps that an input command is generated by an input method module; an XMLHttpRequest module detects the input command, carries out protocol conversion and generates a URL request; and a browser module detects the URL request and executes the input command corresponding to the URL request. The input method and device based on the XMLHttpRequest disclosed by the invention are characterized in that the command in the input method is converted into the URL request by the XMLHttpRequest module through a certain protocol, and internal communications with a browser can be implemented; and corresponding treatments are executed inside the browser according to the different commands, so that interactions between an input method UI and the browser are realized. In this way, difficulty in transplantation and re-development can be reduced greatly.

Description

Input method and device based on XMLHttpRequest
Technical field
The present invention relates to a kind of input method, particularly relate to a kind of input method based on XMLHttpRequest (client is with the standard technique of http-server communication) and device.
Background technology
Web technology has become the theme of current era development, and this also makes the application of sing on web have also been obtained vivosphere widely, and the application based on browser is especially prominent, and inputting is the requisite factor of browser.
A kind of input mode that Web input method is given birth to as this kind of application of Web, the inevitable experience affecting user to a great extent of its interactivity, it transplants characteristic must affect the efficiency of developer.At present, input method largely adopts the mode of plug-in unit, is namely reached the effect communicated with browser by JavaScript (java script) method of extension browser and attribute.This method NJSE (NativeJavaScriptExtension owing to being particular platform, local java script extension), therefore, very big limitation is there is on page code is read and transplanted, need to revise up at different platforms (Presto (data query engine)/Webkit (browser engine increased income)) the JavaScript expansion interface of the page, transplant and redevelopment difficulty is bigger.
Summary of the invention
Present invention is primarily targeted at the technical problem that input method is transplanted and redevelopment difficulty is bigger solving existing browser.
For achieving the above object, the present invention provides a kind of input method based on XMLHttpRequest, and the described input method based on XMLHttpRequest comprises the following steps:
Input method module generates input order;
XMLHttpRequest module detects input order, and carries out protocol conversion, generates URL request;
Browser module detects described URL request, and performs the input order of corresponding described URL request.
Preferably, the concrete steps of described input method module generation input order include:
Obtain the position of current focus;
Generate the input order corresponding with the button being positioned at described position.
Preferably, the concrete steps of the input order that described generation is corresponding with the button being positioned at described position include:
Judging that the type of button, described push-button type include character input button, function button and logical buttons, described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button;
If described button is character input button, then obtain the character of correspondence, by character assignment in corresponding global variable, and generate character input order;
If described button is function button, then obtain the key assignments of correspondence systematic function input order;
If described button is logical buttons, then calls the power function of correspondence, and generate logic input order.
Preferably, described browser module detects described URL request, and the concrete steps performing the order of corresponding described URL request include:
Described URL request is carried out protocol filtering and command analysis;
Corresponding order is performed with parameter according to the order parsed.
Preferably, described URL request is sent the request of input command information by the OPEN function of XMLHttpRequest object, Send function.
Additionally, to achieve these goals, the present invention also provides for a kind of input equipment based on XMLHttpRequest, and described input equipment includes:
Input method module, is used for generating input order;
XMLHttpRequest module, is used for detecting input order, and carries out protocol conversion, generate URL request;
Browser module, is used for detecting described URL request, and performs the input order of corresponding described URL request.
Preferably, described input method module includes:
Acquiring unit, for obtaining the positional information of current focus;
Processing unit, for generating the input order corresponding with the button being positioned at described position.
Preferably, described processing unit includes:
Logic judgment unit, for judging the type of button, described push-button type includes character input button, function button and logical buttons, and described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button;
Character input order generates unit, for obtaining the character of corresponding character input button, by character assignment in corresponding global variable, and generates character input order;
Function input order generates unit, for obtaining the key assignments of corresponding function button, and systematic function input order;
Logic input order generates unit, for calling the power function of counterlogic button, and generates logic input order.
Preferably, described browser module includes:
Filter element, for carrying out protocol filtering to described URL request;
Resolution unit, for carrying out command analysis to described URL request;
Performance element, for performing corresponding order according to the order parsed with parameter.
Preferably, described XMLHttpRequest module includes input content transport module, for sending input command information by the OPEN function of XMLHttpRequest object, Send function.
The input method based on XMLHttpRequest of the present invention and device, by XMLHttpRequest module by the order in input method through certain protocol conversion be URL request and browser intercommunication, different orders is done corresponding process by browser internal needle, feed back browser information simultaneously, reach the purpose that input method UI interface is mutual with browser, thus the difficulty reducing transplanting to a great extent, developing once again.
Accompanying drawing explanation
Fig. 1 is the present invention flow chart based on the first embodiment of the input method of XMLHttpRequest;
Fig. 2 is the flow chart that in above-described embodiment, input method module generates input order;
Fig. 3 is the flow chart generating the input order corresponding with the button being positioned at described position in above-described embodiment;
Fig. 4 is that in above-described embodiment, browser module detects described URL request, and performs the flow chart of the order of corresponding described URL request;
Fig. 5 is the present invention high-level schematic functional block diagram based on the input equipment of XMLHttpRequest;
Fig. 6 is the present invention high-level schematic functional block diagram based on the input method module of the input equipment of XMLHttpRequest;
Fig. 7 is the present invention high-level schematic functional block diagram based on the input equipment processing unit of XMLHttpRequest;
Fig. 8 is the present invention high-level schematic functional block diagram based on the browser module of the input equipment of XMLHttpRequest.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing.
Detailed description of the invention
Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention.
The present invention provides a kind of input method based on XMLHttpRequest, and with reference to Fig. 1, the described input method based on XMLHttpRequest comprises the following steps:
Step S10, input method module generate input order.
Further, with reference to Fig. 2, described input method module generates the concrete steps of input order and includes:
Step S11, obtain current focus positional information.
Step S12, generate the input order corresponding with the button being positioned at described position.
Further, with reference to Fig. 3, the concrete steps of the input order that described generation is corresponding with the button being positioned at described position include:
Step S14, judging the type of button, described push-button type includes character input button, function button and logical buttons, and described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button.
If the described button of step S15 is character input button, then obtain the character of correspondence, by character assignment in corresponding global variable, and generate character input order.
If the described button of step S16 is function button, then obtain the key assignments of correspondence systematic function input order.
If the described button of step S17 is logical buttons, then calls the power function of correspondence, and generate logic input order.
Specifically, user is by by directionkeys moving focal point, acquiring unit in input method module obtains the positional information of current focus, simultaneously, logic judgment unit in input method module judges the push-button type being positioned on this position, described push-button type includes character input button, function button and logical buttons, and described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button.If belonging to special function keys, then special function keys list is gone to obtain corresponding key value structure;If belonging to general character input key, the coordinate position that current language is corresponding is then gone to obtain corresponding character, and the key assignments now obtained is assigned to a certain global variable keyval, when user presses acknowledgement key (OK key), logic judgment unit does corresponding operation according to current key assignments, if input method module internal logic button then calls corresponding power function and changes the display of the page, such as switch current language, switching capitalization is little, switching symbol/letter, language is configured and multiselect character shows, here multiselect character refers to the different display modes of same letter, such as French, character ' c' has four kinds of display modes, be respectively ' c', ''、''、'';If the function buttons such as submission or character display button are then processed by corresponding power function.
Step S20, XMLHttpRequest module detect input order, and carry out protocol conversion, generate URL request.
Specifically, XMLHttpRequest module is mainly the logic requests of input method module according to a certain agreement, it is organized as specific HTTP request by certain mode, form is as follows, protocol therein (agreement) can be any custom protocol word string, such as, webime: // etc..Cmd_name and arg is incoming order and parameter.
Such as can pass through such as the transmission input command information that gives an order:
Above-mentioned code represents and sends input command information by the OPEN function of XMLHttpRequest object, Send function, after browser module receives the request of this agreement, and resolve command and parameter, do corresponding action.XMLHttpRequest is to liking the page creation in input method module, and browser module itself is a container, it is possible to open the different pages.
Step S30, browser module detect described URL request, and perform the input order of corresponding described URL request.
Further, with reference to Fig. 4, described browser module detects described URL request, and the concrete steps performing the order of corresponding described URL request include:
Step S31, described URL request is carried out protocol filtering and command analysis.
The order that step S32, basis parse performs corresponding order with parameter, and described order is by browser inter-process the input frame being output as Web page.
Specifically, Browser processes custom protocol request according to event message type, and obtain request data, described data comprise URL information, described URL information is filtered processing by browser, if the protocol header of request comprises the custom protocol webime of input method: //, then forward corresponding flow processing to, parse order and parameter, and carry out corresponding action.Such as show/hide input method, input validation, return functions such as deleting.
Embodiments of the invention by XMLHttpRequest module by the order in input method through certain protocol conversion be URL request and browser intercommunication, different orders is done corresponding process by browser internal needle, reach the purpose that input method UI interface is mutual with browser, thus the difficulty reducing transplanting to a great extent, developing once again.
Embodiments of the invention by XMLHttpRequest module by the order in input method through certain protocol conversion be URL request and browser intercommunication, different orders is done corresponding process by browser internal needle, feed back browser information simultaneously, reach the purpose that input method UI interface is mutual with browser, thus the difficulty reducing transplanting to a great extent, developing once again.
The present invention provides a kind of input equipment based on XMLHttpRequest, and with reference to Fig. 5 to Fig. 8, described input equipment includes:
Input method module 100, is used for generating input order.
Further, with reference to Fig. 6, described input method module 100 includes: acquiring unit 120, for obtaining the positional information of current focus;Processing unit 160, for generating the input order corresponding with the button being positioned at described position.
Further, with reference to Fig. 7, described processing unit 160 includes: logic judgment unit 162, for judging the type of button, described push-button type includes character input button, function button and logical buttons, described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button;Character input order generates unit 164, for obtaining the character of corresponding character input button, by character assignment in corresponding global variable, and generates character input order;Function input order generates unit 166, for obtaining the key assignments of corresponding function button, and systematic function input order;Logic input order generates unit 168, for calling the power function of counterlogic button, and generates logic input order.
Specifically, user is by by directionkeys moving focal point, acquiring unit in input method module obtains the positional information of current focus, simultaneously, logic judgment unit in input method module judges the push-button type being positioned on this position, described push-button type includes character input button, function button and logical buttons, and described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button.If belonging to special function keys, then special function keys list is gone to obtain corresponding key value structure;If belonging to general character input key, the coordinate position that current language is corresponding is then gone to obtain corresponding character, and the key assignments now obtained is assigned to a certain global variable keyval, when user presses acknowledgement key (OK key), logic judgment unit does corresponding operation according to current key assignments, if input method module internal logic button then calls corresponding power function and changes the display of the page, such as switch current language, switching capitalization is little, switching symbol/letter, language is configured and multiselect character shows, here multiselect character refers to the different display modes of same letter, such as French, character ' c' has four kinds of display modes, be respectively ' c', ''、''、'';If the function buttons such as submission or character display button are then processed by corresponding power function.
XMLHttpRequest module 200, is used for detecting input order, and carries out protocol conversion, generate URL request.
Specifically, XMLHttpRequest module is mainly the logic requests of input method module according to a certain agreement, it is organized as specific HTTP request by certain mode, form is as follows, protocol therein (agreement) can be any custom protocol word string, such as, webime: // etc..Cmd_name and arg is incoming order and parameter.
Such as can pass through such as the transmission input command information that gives an order:
Above-mentioned code represents and sends input command information by the OPEN function of XMLHttpRequest object, Send function, after browser module receives the request of this agreement, and resolve command and parameter, do corresponding action.XMLHttpRequest is to liking the page creation in input method module, and browser module itself is a container, it is possible to open the different pages.
Browser module 300, is used for detecting described URL request, and performs the input order of corresponding described URL request.
Further, with reference to Fig. 8, described browser module 300 includes: filter element 310, for described URL request is carried out protocol filtering;Resolution unit 320, for carrying out command analysis to described URL request;Performance element 330, for performing corresponding order according to the order parsed and parameter are raw, described order is by browser inter-process the input frame being output as Web page.
Specifically, Browser processes custom protocol request according to event message type, and obtain request data, described data comprise URL information, described URL information is filtered processing by browser, if the protocol header of request comprises the custom protocol webime of input method: //, then forward corresponding flow processing to, parse order and parameter, and carry out corresponding action.Such as show/hide input method, input validation, return functions such as deleting.
Embodiments of the invention by XMLHttpRequest module by the order in input method through certain protocol conversion be URL request and browser intercommunication, different orders is done corresponding process by browser internal needle, reach the purpose that input method UI interface is mutual with browser, thus the difficulty reducing transplanting to a great extent, developing once again.
In sum, the input method based on XMLHttpRequest of the present invention and device, by XMLHttpRequest module by the order in input method through certain protocol conversion be URL request and browser intercommunication, different orders is done corresponding process by browser internal needle, feed back browser information simultaneously, reach the purpose that input method UI interface is mutual with browser, thus the difficulty reducing transplanting to a great extent, developing once again.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every equivalent structure utilizing description of the present invention and accompanying drawing content to make or equivalence flow process conversion; or directly or indirectly it is used in other relevant module fields, all in like manner include in the scope of patent protection of the present invention.

Claims (10)

1. the input method based on XMLHttpRequest, it is characterised in that the described input method based on XMLHttpRequest comprises the following steps:
Input method module generates input order;
XMLHttpRequest module detects input order, and carries out protocol conversion, generates URL request;
Browser module detects described URL request, and performs the input order of corresponding described URL request.
2. the input method based on XMLHttpRequest as claimed in claim 1, it is characterised in that described input method module generates the concrete steps of input order and includes:
Obtain the position of current focus;
Generate the input order corresponding with the button being positioned at described position.
3. the input method based on XMLHttpRequest as claimed in claim 2, it is characterised in that the concrete steps of the input order that described generation is corresponding with the button being positioned at described position include:
Judging that the type of button, described push-button type include character input button, function button and logical buttons, described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button;
If described button is character input button, then obtain the character of correspondence, by character assignment in corresponding global variable, and generate character input order;
If described button is function button, then obtain the key assignments of correspondence systematic function input order;
If described button is logical buttons, then calls the power function of correspondence, and generate logic input order.
4. the input method based on XMLHttpRequest as claimed in claim 1, it is characterised in that described browser module detects described URL request, and the concrete steps performing the order of corresponding described URL request include:
Described URL request is carried out protocol filtering and command analysis;
Corresponding order is performed with parameter according to the order parsed.
5. the input method based on XMLHttpRequest as described in power 1 to 4 any one, it is characterised in that described URL request is sent the request of input command information by the OPEN function of XMLHttpRequest object, Send function.
6. the input equipment based on XMLHttpRequest, it is characterised in that described input equipment includes:
Input method module, is used for generating input order;
XMLHttpRequest module, is used for detecting input order, and carries out protocol conversion, generate URL request;
Browser module, is used for detecting described URL request, and performs the input order of corresponding described URL request.
7. the input equipment based on XMLHttpRequest as claimed in claim 6, it is characterised in that described input method module includes:
Acquiring unit, for obtaining the positional information of current focus;
Processing unit, for generating the input order corresponding with the button being positioned at described position.
8. the input equipment based on XMLHttpRequest as claimed in claim 7, it is characterised in that described processing unit includes:
Logic judgment unit, for judging the type of button, described push-button type includes character input button, function button and logical buttons, and described character input button includes letter input key and numeric input keys, and described function button includes back deleting button and removing button;Described logical buttons includes capital and small letter switching key, language switching key, symbol/letter switching key and multiselect character display button;
Character input order generates unit, for obtaining the character of corresponding character input button, by character assignment in corresponding global variable, and generates character input order;
Function input order generates unit, for obtaining the key assignments of corresponding function button, and systematic function input order;
Logic input order generates unit, for calling the power function of counterlogic button, and generates logic input order.
9. the input equipment based on XMLHttpRequest as claimed in claim 8, it is characterised in that described browser module includes:
Filter element, for carrying out protocol filtering to described URL request;
Resolution unit, for carrying out command analysis to described URL request;
Performance element, for performing corresponding order according to the order parsed with parameter.
10. the input equipment based on XMLHttpRequest as described in claim 6 to 9, it is characterised in that
Described XMLHttpRequest module includes input content transport module, for sending input command information by the OPEN function of XMLHttpRequest object, Send function.
CN201410784882.5A 2014-12-16 2014-12-16 Input method and device based on XMLHttpRequest Pending CN105786454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410784882.5A CN105786454A (en) 2014-12-16 2014-12-16 Input method and device based on XMLHttpRequest

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410784882.5A CN105786454A (en) 2014-12-16 2014-12-16 Input method and device based on XMLHttpRequest

Publications (1)

Publication Number Publication Date
CN105786454A true CN105786454A (en) 2016-07-20

Family

ID=56373449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410784882.5A Pending CN105786454A (en) 2014-12-16 2014-12-16 Input method and device based on XMLHttpRequest

Country Status (1)

Country Link
CN (1) CN105786454A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947517A (en) * 2019-03-22 2019-06-28 青岛海信电器股份有限公司 A kind of method that the input method of UI is called in Web application in display equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398715B (en) * 2007-09-24 2010-06-02 普天信息技术研究院有限公司 Multi-type character mixing input method
CN103186429A (en) * 2011-12-29 2013-07-03 盛乐信息技术(上海)有限公司 WebAPP management system and application method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398715B (en) * 2007-09-24 2010-06-02 普天信息技术研究院有限公司 Multi-type character mixing input method
CN103186429A (en) * 2011-12-29 2013-07-03 盛乐信息技术(上海)有限公司 WebAPP management system and application method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947517A (en) * 2019-03-22 2019-06-28 青岛海信电器股份有限公司 A kind of method that the input method of UI is called in Web application in display equipment

Similar Documents

Publication Publication Date Title
CN101231636B (en) Convenient information search method, system and an input method system
CN103873918B (en) Image processing method, device and terminal
US11899710B2 (en) Image recognition method, electronic device and storage medium
KR101922037B1 (en) Page operation processing method and apparatus, and terminal
CN105447204A (en) Website recognition method and apparatus
JP2010123073A (en) Page access method and server
JP2009003930A (en) Method and system for providing navigable search result
US11055075B2 (en) User terminal device, server, and application execution method thereof
US10754628B2 (en) Extracting web API endpoint data from source code to identify potential security threats
CN102420813A (en) Method and device for providing target information according to terminal attributes of user equipment
CN109190006A (en) A kind of exchange method and device based on information search interface
CN110727417A (en) Data processing method and device
JP4460620B2 (en) Information service providing method and server
CN103164214A (en) Calling method and system of browser on camera in mobile terminal
CN103455602A (en) Video URL (Uniform Resource Locator) capturing method and device and terminal equipment
CN110825594B (en) Data reporting and issuing method, client and server
US20170169042A1 (en) Webpage display method, mobile terminal, intelligent terminal, computer program and storage medium
KR101744696B1 (en) Method, device, program and recording medium for filtering information
CN105959383A (en) Content subscription method and device
CN105786454A (en) Input method and device based on XMLHttpRequest
JP2016167156A (en) System, program, and control method
CN101897170A (en) Share web feeds through messaging
CN104239454A (en) Searching method and device
CN110399305B (en) BTT module testing method and device
CN104202348A (en) Method, device and system of pushing information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160720

RJ01 Rejection of invention patent application after publication