[go: up one dir, main page]

CN113377254A - Input text selection method and device - Google Patents

Input text selection method and device Download PDF

Info

Publication number
CN113377254A
CN113377254A CN202110701579.4A CN202110701579A CN113377254A CN 113377254 A CN113377254 A CN 113377254A CN 202110701579 A CN202110701579 A CN 202110701579A CN 113377254 A CN113377254 A CN 113377254A
Authority
CN
China
Prior art keywords
identifier
determining
text
text content
displaying
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.)
Granted
Application number
CN202110701579.4A
Other languages
Chinese (zh)
Other versions
CN113377254B (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 starting position of the text content, displaying a second identifier at an ending position of the text content, and displaying first length information of the text content; moving a position of at least one identifier in response to a drag operation on at least one of the first identifier and the second identifier; and determining the target text and 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 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.

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 a required text content by pressing a left mouse button and sliding a mouse, but the selected text content cannot be deleted or added, and only can be selected again if the selected text content needs to be modified; meanwhile, the user cannot conveniently know the initial and final positions of the selected text in the input text and the total length of the selected text, and visual feedback is lacked, so that errors are easily caused during 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.
Disclosure of Invention
The embodiment of the application provides an input text selection method and device, and the method and device at least solve the technical problems that when a browser carries out text input, the position and the length of a selected text cannot be conveniently determined, and the selected text cannot be conveniently changed.
According to an aspect of an embodiment 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 on the at least one identifier; and 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.
Optionally, a hypertext markup language file is created, and the interactive interface is defined in the hypertext markup language file, where the interactive interface includes an input box and a display box, the input box is configured to receive the input text content, and the display box is configured to display the text content, the first identifier, the second identifier, and the target text, where the input box and the display box have the same style and coincide in position, and the input box is hidden and the display box is displayed by default; defining a presentation 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 presented in the presentation 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 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, saving 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 ending position of the text content; and determining the character width of each character in the text content, and saving 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 numerical value corresponding to the first identifier of the first position and a second numerical 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 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 numerical value corresponding to the first identifier; and/or determining a fourth abscissa corresponding to the second identifier when the dragging is finished 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 numerical value corresponding to the second identifier.
Optionally, determining a first moving width of the first identifier according to the first abscissa and the third abscissa; sequentially accumulating the character width of each character in the target array until the obtained first accumulated character width is not less 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 the 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 moving 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 a reverse order until the obtained second accumulated character width is not less 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 the 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 the 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 at the third position, determining an end position of the target text according to the second identifier at the second position, determining the second length information according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at the second position, and displaying the second length information; when only the second identifier is moved, determining a starting position of the target text according to the first identifier at the first position, determining an ending position of the target text according to the second identifier at the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier at the first position and a second numerical value corresponding to the second identifier at 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 at the third position, determining the ending position of the target text according to the second identifier at the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at 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 the text content input in the interactive interface; the display module is used for displaying a first identifier at the starting position of the text content, displaying a second identifier at the ending position of the text content and displaying first length information of the text content; a moving module, configured to move a position of at least one identifier in response to a drag operation performed on the at least one identifier of the first identifier and the second 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 also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the apparatus where the non-volatile storage medium is located is controlled to execute the above-mentioned input text selection method.
In the embodiment of the application, after detecting the text content input by a user in an interactive interface, displaying the text content, a first identifier for identifying the initial position of the selected text and a second identifier for identifying the end position of the selected text, wherein the default input text content is all selected and the length of the text content is displayed; 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 re-determined, the target text is obtained, and the length information of the target text is obtained. 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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart diagram of a method for 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 diagram of an input text selection apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and any other variation 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 of the terms or expressions appearing in the course of describing the embodiments of the present application are to be interpreted as follows:
hypertext markup Language (Hyper Text Mark-up Language, abbreviated HTML): is a standard language for making web pages for use in browsers, which eliminates the barrier to information exchange between different computers. HTML allows embedding of images and objects and can be used to create interactive forms that are used to structure information such as titles, paragraphs, and lists, etc., and also to describe to some extent the appearance and semantics of a document. HTML elements are the cornerstone of building a web site, the language form of HTML elements (e.g., < HTML >) enclosed by angle brackets, which are used by browsers to interpret web page content, but do not display them on the page. HTML can be embedded in scripting languages such as JavaScript, which affect the behavior of HTML web pages; the browser may also refer to Cascading Style Sheets (CSS) to define the appearance and layout of text and other elements.
Example 1
In accordance with an embodiment of the present application, there is provided an embodiment of an input text selection method, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is an input text selection method according to an embodiment of the application, as shown in fig. 1, the method at least includes steps S102-S108, wherein:
and step S102, detecting the text content input in the interactive interface.
Because the method mainly solves the text selection problem in the text input scene of the PC browser, in some optional embodiments of the method, an HTML file which can be rendered by the browser is created firstly, an interactive interface is defined in the HTML file, the interactive interface comprises an input box and a display box, the input box and the display box are in the same style and are overlapped in position, and the input box is hidden and the display box is displayed by default. 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 selected to be displayed alternatively, and only the display frame is displayed by default and the input frame is hidden under the condition that a user does not operate.
In the related technology, when a user selects a text, the position of the selected text in the input text content and the length of the selected text cannot be directly known, so that the embodiment of the application can display the text content in the display box and simultaneously display identifiers for identifying the position of the selected text, wherein the identifiers comprise a first identifier for identifying the initial position of the selected text and a second identifier for identifying the end position of the selected text, and simultaneously can also display the length information of the selected text, 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 document, and at least a first numeric value corresponding to the first identifier and a second numeric value corresponding to the second identifier are presented in the presentation style, where the first numeric value indicates a number of characters before the first identifier, and the second numeric value indicates a number of characters before the second identifier. Wherein the default values of the first and second numerical values are set to 0, i.e. indicating that no text has been entered, and the default values are set to default hidden, i.e. the first and second identifiers are not presented when no text has been entered.
Optionally, the area between the first identifier and the second identifier is a selected area, and a presentation style of the selected area may be defined in the HTML file, and 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.
After the HTML file is defined, the input frame can be displayed and focused in response to the clicking 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 position of the first identifier and the second identifier, and the first abscissa of the first position is determined; detecting text content input by the target object in the input box, saving 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 ending position of the text content; determining the character width of each character in the text content, and saving the character width of each character as a target array.
Specifically, after the user clicks the display frame, the input frame is activated and focused, and the display frame is hidden, at this time, the initial position of an input cursor in the input frame is recorded as a first position, and the first position is the initial position of the first identifier and the initial position of the second identifier; after a user inputs any text content in the input box, the input text content can be obtained through a keyboard monitoring event and stored as a target variable through JavaScript; meanwhile, keeping the position of the first identifier unchanged, and moving the second identifier to the end position (second position) of the input text content, namely defaulting that all the input text content is selected; 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 characters can be accumulated and summed to obtain an accumulated character width, and a first abscissa corresponding to the first position is added to the accumulated character width to obtain a second abscissa corresponding to the second position, wherein the ordinates corresponding to the first position and the second position are the same.
And step S104, displaying the first identifier at the starting position of the text content, displaying the second identifier at the ending position of the text content, and displaying the first length information of the text content.
In some optional embodiments of the present application, after the input frame is out of focus, hiding the input frame and displaying a display frame, and displaying text content corresponding to the target variable in the display frame; displaying a first identifier of the first position in a display frame, wherein a first numerical 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 first 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 second position, and displaying the first length information.
Specifically, when the user has no other operation after inputting the text, the input box may be out of focus, and at this time, the input box is hidden, and the stored 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, which is an alternative display box interface, taking part a in fig. 2 as an example, wherein "ABCDEFGHIJKLMN" is text content input by a user, all of which are selected by default, and "a" is preceded by a first identifier, and a corresponding first numerical value is 0, which indicates that 0 character is preceded, that is, the selected content starts from the 1 st character; the 'N' is followed by a second identifier, the corresponding second numerical value of which is 14, and the front 14 characters are shown, namely the selected content is at the end of the 14 th character; according to the first numerical value and the second numerical value, the first length of all the input texts which are selected is 14-0-14 characters, and the first length corresponds to 14 displayed in the middle.
Step S106, in response to the dragging operation of at least one of the first identifier and the second identifier, the position of the at least one identifier is moved.
It is to be understood that the user may drag only the first identifier, may drag only the second identifier, and of course may drag both the first identifier and the second identifier to select the target text from the input text.
In some optional embodiments of the present application, in response to a drag operation of a target object on a first identifier, a third abscissa corresponding to the first identifier at the end of the drag may be determined; 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 a first numerical value corresponding to the first identifier. Specifically, a first moving width of the first identifier is determined according to the first abscissa and the third abscissa; sequentially accumulating the character width of each character in the target array until the obtained first accumulated character width is not less 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; a first number of the accumulated characters corresponding to the first accumulation width is determined, and a first numerical value corresponding to the first identifier is updated according to the first number.
Optionally, in response to a drag operation of the target object on the second identifier, determining a fourth abscissa corresponding to the second identifier at the end of the drag operation; 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 numerical value corresponding to the second identifier. Specifically, a second moving width of the second identifier is determined according to the second abscissa and the fourth abscissa; sequentially accumulating the character width of each character in the target array in a reverse order until the obtained second accumulated character width is not less than a 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 the 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 the characters of the text content.
Since the position where the user stays when dragging the identifier may be overlaid on the character, but the identifier is usually located between two characters when actually displayed, appropriate processing is required for the position where the identifier is dragged.
When a user drags a first identifier to adjust the initial position of the selected text, detecting a third abscissa of the position where the first identifier stays at the end of dragging, and subtracting the first abscissa from the third abscissa to obtain a first moving width actually dragged by the first identifier; 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 and comparing the first character width with the first moving width, and accumulating the character widths in the target array by parity of reasoning until the obtained accumulated character width is not smaller than the first moving width, recording the accumulated character width at the moment as the first accumulated character width, and recording the number of the accumulated characters at the moment as the first number; and adding the first accumulated character width to the first abscissa 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 number is the first numerical 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 at the end of dragging, and subtracting the second abscissa from the fourth abscissa to obtain a second movement width actually dragged by the second identifier; 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 second character width from the last to the last and comparing the last character width with the second moving width, and accumulating each character width in the target array by parity of reasoning until the obtained accumulated character width is not smaller than the second moving width, recording the accumulated character width at the moment as the second accumulated character width, and recording the number of the accumulated characters at the moment as the second number; and subtracting the second accumulated character width by 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 by the number of characters of the input text content to obtain a 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 at the third position, determining the ending position of the target text according to the second identifier at the second position, determining second length information according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at 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 at the first position, determining the ending position of the target text according to the second identifier at the fourth position, determining second length information according to a first numerical value corresponding to the first identifier at the first position and a second numerical value corresponding to the second identifier at the fourth position, and displaying the second length information;
when the first identifier and the second identifier are moved, the starting position of the target text is determined according to the first identifier at the third position, the ending position of the target text is determined according to the second identifier at the fourth position, second length information is determined according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at the fourth position, and the second length information is displayed.
Taking part b of fig. 2 as an example, it is a display box interface for determining the target text after simultaneously moving the first identifier and the second identifier, where "ABCDEFGHIJKLMN" is the text content input by the user, the first identifier is located before "E", and its corresponding first numerical value is 4, which indicates that there are 4 characters in front, that is, the selected content starts from the 5 th character; the second identifier is positioned after the J, the corresponding second value is 10, and the 10 characters are shown in the front, namely the content is selected to the end of the 10 th character; at this time, the 5 th to 10 th characters "EFGHIJ" are determined as the target text, and the second length of the target text is determined to be 10-4 to 6 characters corresponding to 6 characters displayed in the middle according to the first numerical value and the second numerical value.
It should be noted that, although the present application mainly solves the text selection problem in the text input scenario of the PC browser, the application scenario 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 can be applied to any platform having the functions of input content monitoring, element size acquisition, element positioning, and interactive positioning acquisition to achieve the corresponding effect.
In the embodiment of the application, text content input in an interactive interface is detected; displaying a first identifier at a starting position of the text content, displaying a second identifier at an ending position of the text content, and displaying first length information of the text content; moving a position of at least one identifier in response to a drag operation on at least one of the first identifier and the second identifier; and determining the target text and 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 re-determined, the target text is obtained, and 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 also provided an input text selection apparatus for implementing the input text selection method, as shown in fig. 3, the apparatus includes a detection module 30, a presentation module 32, a moving module 34, and a determination module 36, where:
the detection module 30 is used for detecting the text content input in the interactive interface;
in some optional embodiments of the present application, an HTML file that can be rendered by a browser is created first, and an interactive interface is defined in the HTML file, where the interactive interface includes an input box and a display box, the input box and the display box have the same style and coincide in position, and the input box is hidden and the display box is displayed by default; 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 before the first identifier, and the second numerical value indicates the number of characters before the second identifier.
Then, in response to the click 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 the target object in the input box, saving 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 ending position of the text content; determining the character width of each character in the text content, and saving the character width of each character as a target array.
And a presentation module 32, configured to present the first identifier at a start position of the text content, present the second identifier at an end position of the text content, and present the first length information of the text content.
In some optional embodiments of the present application, after the input box is out of focus, the input box is hidden and the display box is displayed, and the text content is displayed in the display box according to the target variable; displaying a first identifier of the first position in a display frame, wherein a first numerical 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 first 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 second position, and displaying the first length information.
And a moving module 34, configured to move a position of at least one identifier in response to a drag operation performed on at least one of the first identifier and the second identifier.
In some optional embodiments of the present application, in response to a drag operation of a target object on a first identifier, a third abscissa corresponding to the first identifier at the end of the drag may be determined; 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 numerical value corresponding to the first identifier; the fourth abscissa corresponding to the second identifier at the end of 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 numerical value corresponding to the second identifier.
And the determining module 36 is 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, a start position of the target text may be determined according to the first identifier of the final position, an end 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 to one, and since the detailed description is already performed in embodiment 1, some details that are not shown in this embodiment may refer to embodiment 1, and are not described herein again.
Example 3
According to an embodiment of the present application, there is also provided a non-volatile storage medium including a stored program, where the program controls a device in which the non-volatile storage medium is located to execute the above-mentioned input text selection method when the program is running.
Optionally, the apparatus in which the non-volatile storage medium is controlled when the program is running executes the following steps: detecting text content input in an interactive interface; displaying a first identifier at a starting position of the text content, displaying a second identifier at an ending position of the text content, and displaying first length information of the text content; moving a position of at least one identifier in response to a drag operation on at least one of the first identifier and the second identifier; and determining the target text and 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 above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit may be a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or may not be executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
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 on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method 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), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for selecting an input text, comprising:
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 on the at least one identifier;
and 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.
2. The method of claim 1, wherein prior to detecting text content entered in the interactive interface, the method further comprises:
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, the display box is used for displaying the text content, the first identifier, the second identifier and the target text, the input box and the display box have the same style and are overlapped in position, the input box is hidden by default, and the display box is displayed;
defining a presentation 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 presented in the presentation 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 the click 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, saving 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 ending position of the text content;
and determining the character width of each character in the text content, and saving the character width of each character as a target array.
4. The method of 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 and 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 numerical value corresponding to the first identifier of the first position and a second numerical value corresponding to the second identifier of the second position, and displaying the first length information.
5. The method of claim 3, wherein moving the position of at least one of the first identifier and the second identifier in response to a drag operation on the at least one of the first identifier and the second 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 operation 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 numerical value corresponding to the first identifier; and/or the presence of a gas in the gas,
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 operation 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 numerical value corresponding to the second identifier.
6. The method of claim 5, wherein determining a third location based on the first abscissa, the third abscissa, and the target array, and moving the first identifier to the third location comprises:
determining a first movement width of the first identifier from the first abscissa and the third abscissa;
sequentially accumulating the character width of each character in the target array until the obtained first accumulated character width is not less 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 the 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 based on the second abscissa, the fourth abscissa and the target array, and 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 a reverse order until the obtained second accumulated character width is not less 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 the 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 the characters of the text content.
8. The method of claim 5, wherein determining a target text and second length information of the target text from the text content according to the moved position of the at least one identifier, and presenting 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 at the third position, determining the ending position of the target text according to the second identifier at the second position, determining the second length information according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at the second position, and displaying the second length information;
when only the second identifier is moved, determining a starting position of the target text according to the first identifier at the first position, determining an ending position of the target text according to the second identifier at the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier at the first position and a second numerical value corresponding to the second identifier at 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 at the third position, determining the ending position of the target text according to the second identifier at the fourth position, determining the second length information according to a first numerical value corresponding to the first identifier at the third position and a second numerical value corresponding to the second identifier at the fourth position, and displaying the second length information.
9. An input text selection apparatus, comprising:
the detection module is used for detecting the text content input in the interactive interface;
the display module is used for displaying a first identifier at the starting position of the text content, displaying a second identifier at the ending position of the text content and displaying first length information of the text content;
a moving module, configured to move a position of at least one identifier in response to a drag operation performed on the at least one identifier of the first identifier and the second 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.
10. A non-volatile storage medium, comprising a stored program, wherein the program, when executed, controls a device in which the non-volatile storage medium is located to perform the method of selecting 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 true CN113377254A (en) 2021-09-10
CN113377254B 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 (7)

* 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
US20050257042A1 (en) * 1999-12-15 2005-11-17 Microsoft Corporation Methods and arrangements for providing a mark-up language based graphical user interface for user identification to an operating system
CN103324667A (en) * 2013-05-20 2013-09-25 吴涛军 Method for generating adaptively selected text on web page
CN103699292A (en) * 2013-11-29 2014-04-02 小米科技有限责任公司 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
US20160261818A1 (en) * 2013-10-31 2016-09-08 Le Shi Zhi Xin Electronic Technology (Tianjin) Limited Cursor control method and cursor control device of smart tv
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

Patent Citations (7)

* 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
US20050257042A1 (en) * 1999-12-15 2005-11-17 Microsoft Corporation Methods and arrangements for providing a mark-up language based graphical user interface for user identification to an operating system
CN103324667A (en) * 2013-05-20 2013-09-25 吴涛军 Method for generating adaptively selected text on web page
US20160261818A1 (en) * 2013-10-31 2016-09-08 Le Shi Zhi Xin Electronic Technology (Tianjin) Limited Cursor control method and cursor control device of smart tv
CN103699292A (en) * 2013-11-29 2014-04-02 小米科技有限责任公司 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
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SITI NORHUDHA SARIF ET AL.: "The design of blocks integration tool to support end-user programming", 《PROCEEDINGS OF THE 2011 INTERNATIONAL CONFERENCE ON ELECTRICAL ENGINEERING AND INFORMATICS》 *
刘娉婷: "自由选择字段的MARC数据提取工具开发实践", 《图书馆学刊》 *

Also Published As

Publication number Publication date
CN113377254B (en) 2023-07-11

Similar Documents

Publication Publication Date Title
EP3262497B1 (en) Contextual zoom
US9612715B2 (en) Real-time preview of uniform resource identifier addressable dynamic content
US9015144B2 (en) Configuring web crawler to extract web page information
JP5916866B2 (en) Visual representation of supplementary information for digital works
CN103984686B (en) page switching method and device
CN100592245C (en) Method and system for previewing files
US20080307308A1 (en) Creating Web Clips
US20090138810A1 (en) Web page editor with element selection mechanism
JP2011159284A (en) Website font previewing
US9886175B1 (en) Adaptive and special user interface modes
US9372843B2 (en) Document association device, document association method, and non-transitory computer readable medium
US10049095B2 (en) In-context editing of output presentations via automatic pattern detection
CN104423991B (en) Webpage, the method and device that web data is provided are loaded in mobile terminal
US20170269945A1 (en) Systems and methods for guided live help
US20140089787A1 (en) Information processing device, information processing method, information processing program, and recording medium in which information processing program is recorded
US9910835B2 (en) User interface for creation of content works
CN105242817A (en) Page element real-time highlighted display method and apparatus
US10204094B2 (en) Inserting new elements in a tabular data structure
KR20140132731A (en) Web page application controls
US7877700B2 (en) Adding accessibility to drag-and-drop web content
JP6563522B2 (en) Content display control method and user terminal performing content display control method
CN108595697A (en) Webpage integrated approach, apparatus and system
CN107797838A (en) A kind of screenshot method and device
CN111199005A (en) Webpage component processing method and device
CN103838709B (en) Composition method and typesetting engine

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