/Positioner

Primary LanguageJavaScript

Positioner

Description: The foolish task for working with strings and pointers.

Task: create "Positioner" which provides the set of possibilities for working with given string. The positioner contains inner pointer. Operations are executed according to pointer position.

Required methods:

  • has("substring") - check if substring is present in the workspace.
  • next("substring") - returns position of the next substring. Pointer moves forward according to the search direction.
  • prev("substring") - returns position of the previous substring.
  • reset() - reset pointer position.
  • changeSearchDirection() - change direction of search to the opposite.
  • forward(N) - offsets pointer position forwards in appropriate direction by N characters.
  • backward(N) - offsets pointer position backwards in appropriate direction by N characters.
  • add("substring") - inserts substring at the current pointer position.
  • remove(N) - removes N characters in appropriate direction.
  • replace("from", "to") - replaces every entries.


Changelog:

UPDATE v.1.2

  • Added UI
  • Minor changes

UPDATE v.1.3

  • Added a lot more JS events
  • Fixed some problems

UPDATE v.2.0

  • Added Log-panel with possibility of rollback
  • Work with reverse direction have been fixed
  • Minor changes
  • Redesign UI