CN113377254B - Input text selection method and device - Google Patents

Input text selection method and device Download PDF

Info

Publication number
CN113377254B
CN113377254B CN202110701579.4A CN202110701579A CN113377254B CN 113377254 B CN113377254 B CN 113377254B CN 202110701579 A CN202110701579 A CN 202110701579A CN 113377254 B CN113377254 B CN 113377254B
Authority
CN
China
Prior art keywords
identifier
text
determining
text content
input
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.)
Active
Application number
CN202110701579.4A
Other languages
Chinese (zh)
Other versions
CN113377254A (en
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.)
Xian Novastar Electronic Technology Co Ltd
Original Assignee
Xian Novastar Electronic 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 Xian Novastar Electronic Technology Co Ltd filed Critical Xian Novastar Electronic Technology Co Ltd
Priority to CN202110701579.4A priority Critical patent/CN113377254B/en
Publication of CN113377254A publication Critical patent/CN113377254A/en
Application granted granted Critical
Publication of CN113377254B publication Critical patent/CN113377254B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an input text selection method and device. Wherein the method comprises the following steps: detecting text content input in an interactive interface; displaying a first identifier at a start position of the text content, displaying a second identifier at an end position of the text content, and displaying first length information of the text content; moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one of the identifiers; and determining the target text and the second length information of the target text from the text content according to the moved at least one identifier, and displaying the second length information. The method and the device solve the technical problems that when the browser inputs the text, the position and the length of the selected text cannot be conveniently determined, and the selected text cannot be conveniently changed.

Description

Input text selection method and device
Technical Field
The application relates to the technical field of input interaction, in particular to an input text selection method and device.
Background
At present, when a user inputs a text in an input box of a PC browser, the user can select the required text content by pressing a left button of the mouse and sliding the mouse, but the selected text content cannot be deleted or added, and if the selected text content needs to be modified, the user can only select the selected text content again; meanwhile, the user cannot conveniently know the starting and ending positions of the selected text in the input text and the total length of the selected text, visual feedback is lacked, so that errors are easy to occur in actual selection, time is wasted, and the input experience of the user is not facilitated.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides an input text selection method and device, which at least solve the technical problems that the position and the length of a selected text cannot be conveniently determined and the selected text cannot be conveniently changed when a browser performs text input.
According to an aspect of the embodiments of the present application, there is provided an input text selection method, including: detecting text content input in an interactive interface; displaying a first identifier at a start position of the text content, displaying a second identifier at an end position of the text content, and displaying first length information of the text content; moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one identifier; and determining target text and second length information of the target text from the text content according to the at least one identifier after the movement, and displaying the second length information.
Optionally, creating a hypertext markup language file, and defining the interactive interface in the hypertext markup language file, wherein the interactive interface comprises an input box and a display box, the input box is used for receiving the input text content, and the display box is used for displaying the text content, the first identifier, the second identifier and the target text, wherein the input box is identical to the display box in style and is overlapped in position, and the input box is hidden by default and is displayed; and defining a display style of the first identifier and the second identifier in the hypertext markup language file, wherein at least a first numerical value corresponding to the first identifier and a second numerical value corresponding to the second identifier are displayed in the display style, the first numerical value indicates the number of characters before the first identifier, and the second numerical value indicates the number of characters before the second identifier.
Optionally, in response to a click operation of the target object on the display frame, displaying and focusing the input frame, hiding the display frame, taking a first position of an input cursor in the input frame as an initial position of the first identifier and the second identifier, and determining a first abscissa of the first position; detecting text content input by the target object in the input box, storing the text content as a target variable, moving the second identifier to a second position, and determining a second abscissa of the second position, wherein the second position is an end position of the text content; and determining the character width of each character in the text content, and storing the character width of each character as a target array.
Optionally, after the input box is out of focus, hiding the input box and displaying the display box, and displaying the text content corresponding to the target variable in the display box; displaying a first identifier of the first position in the display frame, wherein a first numerical value corresponding to the first identifier of the first position is 0; displaying a second identifier of the second position in the display frame, wherein a second numerical value corresponding to the second identifier of the second position is the number of characters of the text content; and determining the first length information according to a first value corresponding to the first identifier of the first position and a second value corresponding to the second identifier of the second position, and displaying the first length information.
Optionally, in response to a drag operation of the target object on the first identifier, determining a third abscissa corresponding to the first identifier when drag is finished; determining a third position according to the first abscissa, the third abscissa and the target array, moving the first identifier to the third position, and updating a first value corresponding to the first identifier; and/or, responding to the drag operation of the target object on the second identifier, and determining a fourth abscissa corresponding to the second identifier when the drag is finished; and determining a fourth position according to the second abscissa, the fourth abscissa and the target array, moving the second identifier to the fourth position, and updating a second value corresponding to the second identifier.
Optionally, determining a first movement width of the first identifier according to the first abscissa and the third abscissa; sequentially accumulating the character widths of each character in the target array until the obtained first accumulated character width is not smaller than the first moving width; determining the third position according to the first abscissa and the first accumulated character width, and moving the first identifier to the third position; and determining a first number of accumulated characters corresponding to the first accumulation width, and updating a first numerical value corresponding to the first identifier according to the first number.
Optionally, determining a second movement width of the second identifier according to the second abscissa and the fourth abscissa; sequentially accumulating the character widths of each character in the target array in an inverse order until the obtained second accumulated character width is not smaller than the second moving width; determining the fourth position according to the second abscissa and the second accumulated character width, and moving the second identifier to the fourth position; and determining a second number of accumulated characters corresponding to the second accumulation width, and updating a second numerical value corresponding to the second identifier according to the second number and the number of characters of the text content.
Optionally, when only the first identifier is moved, determining a start position of the target text according to the first identifier of the third position, determining an end position of the target text according to the second identifier of the second position, determining the second length information according to a first value corresponding to the first identifier of the third position and a second value corresponding to the second identifier of the second position, and displaying the second length information; when only the second identifier is moved, determining the starting position of the target text according to the first identifier of the first position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier of the first position and a second numerical value corresponding to the second identifier of the fourth position, and displaying the second length information; when the first identifier and the second identifier are both moved, determining the starting position of the target text according to the first identifier of the third position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to the first value corresponding to the first identifier of the third position and the second value corresponding to the second identifier of the fourth position, and displaying the second length information.
According to another aspect of the embodiments of the present application, there is also provided an input text selection apparatus, including: the detection module is used for detecting text content input in the interactive interface; a display module, configured to display a first identifier at a start position of the text content, display a second identifier at an end position of the text content, and display first length information of the text content; a moving module for moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one identifier; and the determining module is used for determining a target text and second length information of the target text from the text content according to the at least one identifier after the movement and displaying the second length information.
According to another aspect of the embodiments of the present application, there is further provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the device where the non-volatile storage medium is controlled to execute the above-mentioned input text selection method.
In the embodiment of the application, after text content input by a user in an interactive interface is detected, displaying the text content, a first identifier for identifying a starting position of a selected text and a second identifier for identifying an ending position of the selected text, wherein all text content input by default is selected, and displaying the length of the text content; the user can move the first identifier and the second identifier through dragging, so that the starting position and the ending position of the selected text are determined again, the target text is obtained, and the length information of the target text is obtained. According to the method and the device, the technical problems that the position and the length of the selected text cannot be conveniently determined and the selected text cannot be conveniently changed when the browser inputs the text are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow diagram of a method of selecting input text according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an input text selection interface according to an embodiment of the present application;
fig. 3 is a schematic structural view of an input text selection apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For a better understanding of the embodiments of the present application, some nouns or translations of terms that appear during the description of the embodiments of the present application are explained as follows:
HyperText markup Language (HTML for short): is a standard language for making web pages, used in browsers, which eliminates the obstacle to information exchange between different computers. HTML allows for embedding images and objects and can be used to create interactive forms that are used to structure information such as titles, paragraphs, lists, etc., as well as to describe to some extent the appearance and semantics of documents. HTML elements are the keystone building a website, the language of HTML is in the form of HTML elements enclosed by brackets (e.g., < HTML >) and the browser uses HTML tags and scripts to interpret web page content but does not display them on the page. HTML can embed scripting languages such as JavaScript that affect the behavior of HTML web pages; the browser may also reference cascading style sheets (Cascading Style Sheets, abbreviated CSS) to define the appearance and layout of text and other elements.
Example 1
In accordance with the embodiments of the present application, there is provided an embodiment of a method of selecting input text, it being noted that the steps shown in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order other than that shown or described herein.
Fig. 1 is a method for selecting an input text according to an embodiment of the present application, as shown in fig. 1, the method at least includes steps S102-S108, wherein:
step S102, detecting text content input in an interactive interface.
Because the text selection problem under the text input scene of the PC browser is mainly solved, in some optional embodiments of the application, an HTML file which can be rendered by the browser is firstly created, an interactive interface is defined in the HTML file, the interactive interface comprises an input frame and a display frame, the input frame is identical in style and coincident in position with the display frame, and the input frame is hidden by default and the display frame is displayed. The input box is used for receiving text content input by a user; the display box is used for displaying the input text content and the selected target text. The input frame and the display frame are alternatively displayed, and under the condition that a user does not operate, only the display frame is displayed by default, and the input frame is hidden.
In the related art, the user cannot directly know the position of the selected text in the input text content and the length of the selected text when selecting the text, so that the embodiment of the application provides that the identifier for identifying the position of the selected text can be displayed while the text content is displayed in the display frame, the identifier comprises a first identifier for identifying the starting position of the selected text and a second identifier for identifying the ending position of the selected text, and meanwhile, the length information of the selected text can be displayed, and the length information can be the number of characters in the selected text.
In some optional embodiments of the present application, a presentation style of the first identifier and the second identifier may be defined in the HTML file, where at least a first value corresponding to the first identifier and a second value corresponding to the second identifier are presented in the presentation style, where the first value indicates a number of characters preceding the first identifier and the second value indicates a number of characters preceding the second identifier. The default values of the first and second values are set to 0, which indicates that no text has been input, and the default values are set to default hiding, which indicates that the first and second identifiers are not displayed when no text has been input.
Optionally, the area between the first identifier and the second identifier is a selected area, and the presentation style of the selected area may be defined in the HTML file, where the default value of the width of the selected area is set to 0, that is, the selected area indicates that no text has been input yet.
After the HTML file is defined, the input frame can be displayed and focused in response to the click operation of the target object on the display frame, the display frame is hidden, the first position of the input cursor in the input frame is used as the initial positions of the first identifier and the second identifier, and the first abscissa of the first position is determined; detecting text content input by a target object in an input box, storing the text content as a target variable, moving a second identifier to a second position, and determining a second abscissa of the second position, wherein the second position is the end position of the text content; and determining the character width of each character in the text content, and storing the character width of each character as a target array.
Specifically, after a user clicks the display frame, activating and focusing the input frame, and hiding the display frame at the same time, recording the initial position of the input cursor in the input frame as a first position, wherein the first position is the initial position of the first identifier and the second identifier; after a user inputs any text content in an input box, acquiring the input text content through a keyboard monitoring event and saving the input text content as a target variable through JavaScript; simultaneously, the position of the first identifier is kept unchanged, and the second identifier is moved to the end position (the second position) of the input text content, namely all input text contents are selected by default; the character width of each input character in the input text can be calculated through JavaScript and stored in a target array form; the character widths of all the characters can be accumulated and summed to obtain an accumulated character width, and a second abscissa corresponding to the second position can be obtained by adding the first abscissa corresponding to the first position to the accumulated character width, wherein the ordinate corresponding to the first position is the same as the ordinate corresponding to the second position.
Step S104, a first identifier is presented at a start position of the text content, a second identifier is presented at an end position of the text content, and first length information of the text content is presented.
In some optional embodiments of the present application, after the input box is out of focus, hiding the input box and displaying a display box, wherein text content corresponding to the target variable is displayed in the display box; displaying a first identifier of a first position in a display frame, wherein a first value corresponding to the first identifier of the first position is 0; displaying a second identifier of a second position in the display frame, wherein a second numerical value corresponding to the second identifier of the second position is the number of characters of the text content; and determining the first length information according to the first value corresponding to the first identifier of the first position and the second value corresponding to the second identifier of the second position, and displaying the first length information.
Specifically, when no other operation is performed after the user inputs the text, the input box is out of focus, the input box is hidden at this time, and the saved target variable is used as the display content in the display box and the display box is displayed. Fig. 2 is a schematic diagram of an alternative input text selection interface, taking part a in fig. 2 as an example, which is an alternative display frame interface, wherein "ABCDEFGHIJKLMN" is text content input by a user, and is selected by default, and "a" is preceded by a first identifier, and a corresponding first value is 0, which indicates that 0 characters are preceded by the first identifier, that is, the selected content starts from the 1 st character; the second identifier is arranged behind the 'N', and the corresponding second value is 14, which indicates that 14 characters are arranged in front, namely, the selected content ends at the 14 th character; and determining that the first length of all the selected input texts is 14-0=14 characters according to the first numerical value and the second numerical value, and corresponding to the intermediately displayed 14.
Step S106, responding to the drag operation of at least one of the first identifier and the second identifier, and moving the position of the at least one identifier.
It will be appreciated that the user may drag only the first identifier, or only the second identifier, although the first identifier and the second identifier may be dragged simultaneously to select the target text from the input text.
In some optional embodiments of the present application, a third abscissa corresponding to the first identifier at the end of the drag may be determined in response to a drag operation of the target object on the first identifier; and determining a third position according to the first abscissa, the third abscissa and the target array, moving the first identifier to the third position, and updating the first value corresponding to the first identifier. Specifically, determining a first movement width of the first identifier according to a first abscissa and a third abscissa; sequentially accumulating the character widths of each character in the target array until the obtained first accumulated character width is not smaller than the first moving width; determining a third position according to the first abscissa and the first accumulated character width, and moving the first identifier to the third position; and determining a first number of accumulated characters corresponding to the first accumulation width, and updating a first numerical value corresponding to the first identifier according to the first number.
Optionally, a fourth abscissa corresponding to the second identifier at the end of the dragging may be determined in response to the dragging operation of the target object on the second identifier; and determining a fourth position according to the second abscissa, the fourth abscissa and the target array, moving the second identifier to the fourth position, and updating a second value corresponding to the second identifier. Specifically, determining a second movement width of the second identifier according to a second abscissa and a fourth abscissa; sequentially accumulating the character widths of each character in the target array in an inverse order until the obtained second accumulated character width is not smaller than the second moving width; determining a fourth position according to the second abscissa and the second accumulated character width, and moving the second identifier to the fourth position; and determining a second number of accumulated characters corresponding to the second accumulation width, and updating a second numerical value corresponding to the second identifier according to the second number and the number of characters of the text content.
Since the position where the user stays when dragging the identifier may be overlaid on the characters, but the identifier is usually located between the two characters when actually displayed, the position of the dragging identifier needs to be appropriately processed.
When a user drags the first identifier to adjust the initial position of the selected text, detecting a third abscissa of the position where the first identifier stays when the dragging is finished, and subtracting the first abscissa from the third abscissa to obtain a first moving width of the first identifier actually dragged; comparing the first character width in the target array with the first moving width, if the first character width is smaller than the first moving width, adding the first character width and the second character width in the target array, comparing the first character width and the second character width with the first moving width, and similarly accumulating each character width in the target array in sequence until the obtained accumulated character width is not smaller than the first moving width, marking the accumulated character width at the moment as the first accumulated character width, and marking the accumulated character quantity at the moment as the first quantity; and adding the first abscissa to the first accumulated character width to obtain a new coordinate, wherein the coordinate is the abscissa of the third position to which the first identifier is to be moved, and the first quantity is the first value corresponding to the moved first identifier.
When the user drags the second identifier to adjust the end position of the selected text, detecting a fourth abscissa of the position where the second identifier stays when the dragging is finished, and subtracting the second abscissa from the fourth abscissa to obtain a second movement width of the second identifier actually dragged; comparing the last character width in the target array with the second moving width, if the last character width is smaller than the second moving width, adding the last character width in the target array with the penultimate character width and comparing the last character width with the second moving width, and similarly accumulating each character width in the target array in an inverse order until the obtained accumulated character width is not smaller than the second moving width, marking the accumulated character width at the moment as the second accumulated character width, and marking the accumulated character quantity at the moment as the second quantity; subtracting the second accumulated character width from the second abscissa to obtain a new coordinate, wherein the coordinate is the abscissa of the fourth position to which the second identifier is to be moved, and subtracting the second number from the number of characters of the input text content is the second numerical value corresponding to the moved second identifier.
Step S108, determining the target text and the second length information of the target text from the text content according to the moved at least one identifier, and displaying the second length information.
According to the situation that the user actually drags the first identifier and the second identifier, the following three schemes for determining the target text selected by the user are provided:
when only the first identifier is moved, determining the starting position of the target text according to the first identifier of the third position, determining the ending position of the target text according to the second identifier of the second position, determining the second length information according to the first value corresponding to the first identifier of the third position and the second value corresponding to the second identifier of the second position, and displaying the second length information;
when only the second identifier is moved, determining the starting position of the target text according to the first identifier of the first position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to the first value corresponding to the first identifier of the first position and the second value corresponding to the second identifier of the fourth position, and displaying the second length information;
when the first identifier and the second identifier move, determining the starting position of the target text according to the first identifier of the third position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to the first value corresponding to the first identifier of the third position and the second value corresponding to the second identifier of the fourth position, and displaying the second length information.
Taking part b in fig. 2 as an example, the first identifier and the second identifier are moved simultaneously to determine a display frame interface of the target text, wherein "ABCDEFGHIJKLMN" is text content input by a user, the first identifier is located before "E", and the corresponding first value is 4, which indicates that 4 characters are in front, that is, the selected content starts from the 5 th character; the second identifier is located after "J", and the corresponding second value is 10, which indicates that 10 characters are in front, namely, the selected content reaches the end of the 10 th character; at this time, the 5 th to 10 th characters of EFGHIJ are determined as target texts, and the second length of the target texts can be determined to be 10 < -4 > =6 characters according to the first numerical value and the second numerical value, and the second length corresponds to 6 in the middle display.
It should be noted that, although the text selection problem in the text input scene of the PC browser is mainly solved in the present application, the application scene of the input text selection method provided in the embodiment of the present application is not limited to the PC browser, and the input text selection method may be applied to any platform having functions of input content monitoring, element size acquisition, element positioning, and interactive positioning acquisition to achieve the corresponding effects.
In the embodiment of the application, text content input in an interactive interface is detected; displaying a first identifier at a start position of the text content, displaying a second identifier at an end position of the text content, and displaying first length information of the text content; moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one of the identifiers; and determining the target text and the second length information of the target text from the text content according to the moved at least one identifier, and displaying the second length information. The user can move the first identifier and the second identifier through dragging, so that the starting position and the ending position of the selected text are redetermined, the target text is obtained, meanwhile, the position of the target text in the input text content and the length of the target text are obtained through the first identifier and the second identifier.
Example 2
According to an embodiment of the present application, there is further provided an input text selecting device for implementing the above input text selecting method, as shown in fig. 3, where the device includes a detection module 30, a presentation module 32, a movement module 34, and a determination module 36, where:
The detection module 30 is used for detecting text content input in the interactive interface;
in some optional embodiments of the application, firstly, an HTML file which can be rendered by a browser is created, an interactive interface is defined in the HTML file, the interactive interface comprises an input frame and a display frame, the input frame is identical to the display frame in style and coincides in position, and the input frame is hidden by default and the display frame is displayed; and defining a display style of the first identifier and the second identifier in the HTML file, wherein at least a first numerical value corresponding to the first identifier and a second numerical value corresponding to the second identifier are displayed in the display style, the first numerical value indicates the number of characters positioned before the first identifier, and the second numerical value indicates the number of characters positioned before the second identifier.
Then, in response to clicking operation of the target object on the display frame, displaying and focusing the input frame, hiding the display frame, taking the first position of the input cursor in the input frame as the initial positions of the first identifier and the second identifier, and determining a first abscissa of the first position; detecting text content input by a target object in an input box, storing the text content as a target variable, moving a second identifier to a second position, and determining a second abscissa of the second position, wherein the second position is the end position of the text content; and determining the character width of each character in the text content, and storing the character width of each character as a target array.
A presentation module 32 for presenting a first identifier at a start position of the text content, presenting a second identifier at an end position of the text content, and presenting first length information of the text content.
In some optional embodiments of the present application, after the input box is out of focus, hiding the input box and displaying the display box, and displaying text content in the display box according to the target variable; displaying a first identifier of a first position in a display frame, wherein a first value corresponding to the first identifier of the first position is 0; displaying a second identifier of a second position in the display frame, wherein a second numerical value corresponding to the second identifier of the second position is the number of characters of the text content; and determining the first length information according to the first value corresponding to the first identifier of the first position and the second value corresponding to the second identifier of the second position, and displaying the first length information.
A movement module 34 for moving the position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one identifier.
In some optional embodiments of the present application, a third abscissa corresponding to the first identifier at the end of the drag may be determined in response to a drag operation of the target object on the first identifier; determining a third position according to the first abscissa, the third abscissa and the target array, moving the first identifier to the third position, and updating a first value corresponding to the first identifier; the fourth abscissa corresponding to the second identifier at the end of the dragging can also be determined in response to the dragging operation of the target object on the second identifier; and determining a fourth position according to the second abscissa, the fourth abscissa and the target array, moving the second identifier to the fourth position, and updating a second value corresponding to the second identifier.
A determining module 36, configured to determine the target text and the second length information of the target text from the text content according to the moved at least one identifier, and display the second length information.
In some optional embodiments of the present application, the starting position of the target text may be determined according to the first identifier of the final position, the ending position of the target text may be determined according to the second identifier of the final position, the second length information may be determined according to the first value corresponding to the first identifier of the final position and the second value corresponding to the second identifier of the final position, and the second length information may be displayed.
It should be noted that, each module in the input text selection apparatus in the embodiment of the present application corresponds to an implementation step of the input text selection method in embodiment 1 one by one, and since the detailed description has been already made in embodiment 1, details that are not partially shown in this embodiment may refer to embodiment 1, and will not be repeated here.
Example 3
According to an embodiment of the present application, there is further provided a non-volatile storage medium including a stored program, where the device in which the non-volatile storage medium is controlled to execute the above-described input text selection method when the program runs.
Optionally, the program controls the device in which the nonvolatile storage medium is located to execute the following steps when running: detecting text content input in an interactive interface; displaying a first identifier at a start position of the text content, displaying a second identifier at an end position of the text content, and displaying first length information of the text content; moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one of the identifiers; and determining the target text and the second length information of the target text from the text content according to the moved at least one identifier, and displaying the second length information.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution, in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method of selecting an input text, comprising:
detecting text content input in an interactive interface;
before detecting the text content input in the interactive interface, the method further comprises the following steps: creating a hypertext markup language file, defining the interactive interface in the hypertext markup language file, wherein the interactive interface comprises an input box and a display box, the input box is used for receiving the input text content, and the display box is used for displaying the text content, a first identifier, a second identifier and a target text, wherein the input box is identical to the display box in style and is overlapped in position, and hiding the input box by default and displaying the display box;
displaying the first identifier at a start position of the text content, displaying the second identifier at an end position of the text content, and displaying first length information of the text content;
Moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one identifier;
and determining the target text and second length information of the target text from the text content according to the at least one identifier after the movement, and displaying the second length information.
2. The method of claim 1, wherein prior to detecting text content entered in the interactive interface, the method further comprises:
and defining a display style of the first identifier and the second identifier in the hypertext markup language file, wherein at least a first numerical value corresponding to the first identifier and a second numerical value corresponding to the second identifier are displayed in the display style, the first numerical value indicates the number of characters before the first identifier, and the second numerical value indicates the number of characters before the second identifier.
3. The method of claim 2, wherein detecting text content entered in the interactive interface comprises:
responding to clicking operation of a target object on the display frame, displaying and focusing the input frame, hiding the display frame, taking a first position of an input cursor in the input frame as initial positions of the first identifier and the second identifier, and determining a first abscissa of the first position;
Detecting text content input by the target object in the input box, storing the text content as a target variable, moving the second identifier to a second position, and determining a second abscissa of the second position, wherein the second position is an end position of the text content;
and determining the character width of each character in the text content, and storing the character width of each character as a target array.
4. A method according to claim 3, wherein presenting a first identifier at a start position of the text content, presenting a second identifier at an end position of the text content, and presenting first length information of the text content, comprises:
after the input frame is out of focus, hiding the input frame, displaying the display frame, and displaying the text content corresponding to the target variable in the display frame;
displaying a first identifier of the first position in the display frame, wherein a first numerical value corresponding to the first identifier of the first position is 0;
displaying a second identifier of the second position in the display frame, wherein a second numerical value corresponding to the second identifier of the second position is the number of characters of the text content;
And determining the first length information according to a first value corresponding to the first identifier of the first position and a second value corresponding to the second identifier of the second position, and displaying the first length information.
5. A method according to claim 3, wherein moving the position of at least one of the first and second identifiers in response to a drag operation on the at least one identifier comprises:
responding to the drag operation of the target object on the first identifier, and determining a third abscissa corresponding to the first identifier when the drag is finished; determining a third position according to the first abscissa, the third abscissa and the target array, moving the first identifier to the third position, and updating a first value corresponding to the first identifier; and/or the number of the groups of groups,
responding to the drag operation of the target object on the second identifier, and determining a fourth abscissa corresponding to the second identifier when the drag is finished; and determining a fourth position according to the second abscissa, the fourth abscissa and the target array, moving the second identifier to the fourth position, and updating a second value corresponding to the second identifier.
6. The method of claim 5, wherein determining a third location from the first abscissa, the third abscissa, and the target array, moving the first identifier to the third location, comprises:
determining a first movement width of the first identifier according to the first abscissa and the third abscissa;
sequentially accumulating the character widths of each character in the target array until a first accumulated character width which is not smaller than the first moving width is obtained;
determining the third position according to the first abscissa and the first accumulated character width, and moving the first identifier to the third position;
and determining a first number of accumulated characters corresponding to the first accumulation width, and updating a first numerical value corresponding to the first identifier according to the first number.
7. The method of claim 5, wherein determining a fourth location from the second abscissa, the fourth abscissa, and the target array, moving the second identifier to the fourth location comprises:
determining a second movement width of the second identifier according to the second abscissa and the fourth abscissa;
Sequentially accumulating the character width of each character in the target array in an inverse order until a second accumulated character width which is not smaller than the second moving width is obtained;
determining the fourth position according to the second abscissa and the second accumulated character width, and moving the second identifier to the fourth position;
and determining a second number of accumulated characters corresponding to the second accumulation width, and updating a second numerical value corresponding to the second identifier according to the second number and the number of characters of the text content.
8. The method of claim 5, wherein determining target text and second length information of the target text from the text content based on the location of the at least one identifier after the moving, and displaying the second length information, comprises:
when only the first identifier is moved, determining the starting position of the target text according to the first identifier of the third position, determining the ending position of the target text according to the second identifier of the second position, determining the second length information according to the first value corresponding to the first identifier of the third position and the second value corresponding to the second identifier of the second position, and displaying the second length information;
When only the second identifier is moved, determining the starting position of the target text according to the first identifier of the first position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier of the first position and a second numerical value corresponding to the second identifier of the fourth position, and displaying the second length information;
when the first identifier and the second identifier are both moved, determining the starting position of the target text according to the first identifier of the third position, determining the ending position of the target text according to the second identifier of the fourth position, determining the second length information according to the first value corresponding to the first identifier of the third position and the second value corresponding to the second identifier of the fourth position, and displaying the second length information.
9. An input text selection apparatus, comprising:
the detection module is used for detecting text content input in the interactive interface;
before detecting the text content input in the interactive interface, the method further comprises the following steps: creating a hypertext markup language file, defining the interactive interface in the hypertext markup language file, wherein the interactive interface comprises an input box and a display box, the input box is used for receiving the input text content, and the display box is used for displaying the text content, a first identifier, a second identifier and a target text, wherein the input box is identical to the display box in style and is overlapped in position, and hiding the input box by default and displaying the display box;
A display module, configured to display the first identifier at a start position of the text content, display the second identifier at an end position of the text content, and display first length information of the text content;
a moving module for moving a position of at least one of the first identifier and the second identifier in response to a drag operation performed on the at least one identifier;
and the determining module is used for determining the target text and the second length information of the target text from the text content according to the at least one identifier after the movement and displaying the second length information.
10. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform the method of selecting an input text according to any one of claims 1 to 8.
CN202110701579.4A 2021-06-23 2021-06-23 Input text selection method and device Active CN113377254B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110701579.4A CN113377254B (en) 2021-06-23 2021-06-23 Input text selection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110701579.4A CN113377254B (en) 2021-06-23 2021-06-23 Input text selection method and device

Publications (2)

Publication Number Publication Date
CN113377254A CN113377254A (en) 2021-09-10
CN113377254B true CN113377254B (en) 2023-07-11

Family

ID=77578846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110701579.4A Active CN113377254B (en) 2021-06-23 2021-06-23 Input text selection method and device

Country Status (1)

Country Link
CN (1) CN113377254B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683889A (en) * 2018-12-26 2019-04-26 北京微播视界科技有限公司 Multiplexing method, device, electronic equipment and the readable storage medium storing program for executing of message display frame

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6085196A (en) * 1997-12-23 2000-07-04 Ricoh Company, Ltd. Object-oriented system and computer program product for mapping structured information to different structured information
US6968449B1 (en) * 1999-12-15 2005-11-22 Microsoft Corporation Methods and arrangements for providing a mark-up language based graphical user interface for user identification to an operating system
CN103324667B (en) * 2013-05-20 2016-08-17 吴涛军 A kind of method generating adaptively selected text on webpage
CN103533448B (en) * 2013-10-31 2017-12-08 乐视致新电子科技(天津)有限公司 The cursor control method and cursor control device of intelligent television
CN103699292B (en) * 2013-11-29 2017-02-15 小米科技有限责任公司 Method and device for entering into text selection mode
CN104102452A (en) * 2014-07-11 2014-10-15 厦门美图移动科技有限公司 Enhancement mode text selection method of touch screen

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683889A (en) * 2018-12-26 2019-04-26 北京微播视界科技有限公司 Multiplexing method, device, electronic equipment and the readable storage medium storing program for executing of message display frame

Also Published As

Publication number Publication date
CN113377254A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
US9330179B2 (en) Configuring web crawler to extract web page information
US10185782B2 (en) Mode identification for selective document content presentation
US9612715B2 (en) Real-time preview of uniform resource identifier addressable dynamic content
US9977768B2 (en) System for clipping webpages by traversing a dom, and highlighting a minimum number of words
US8065667B2 (en) Injecting content into third party documents for document processing
US10387535B2 (en) System and method for selectively displaying web page elements
CN105094804B (en) The method and apparatus of animation are added in the page
US20080307308A1 (en) Creating Web Clips
US20150213514A1 (en) Systems and methods for providing modular configurable creative units for delivery via intext advertising
US20140208199A1 (en) Visual designation of a zone in rendered code
US10049095B2 (en) In-context editing of output presentations via automatic pattern detection
JP2011159284A (en) Website font previewing
EP2186019A1 (en) Web widgets
US9886175B1 (en) Adaptive and special user interface modes
WO2009011837A1 (en) Extraction and reapplication of design information to existing websites
US11397970B2 (en) Visual designation of a zone in rendered code
CN108595697A (en) Webpage integrated approach, apparatus and system
US20150301993A1 (en) User interface for creation of content works
US10410257B1 (en) Native online ad creation
CN113377254B (en) Input text selection method and device
KR100697809B1 (en) The method making homepage with iframe and layer
US12019699B2 (en) Visual recorder for demonstrations of web-based software applications
US20230116021A1 (en) Visual recorder for demonstrations of web-based software applications
CA2631105A1 (en) System and method for creating and editing content on a webpage
Chan Mobi: automatic customization of the mobile Web

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
GR01 Patent grant
GR01 Patent grant