diff --git a/nomadnet/examples/various/input_fields.py b/nomadnet/examples/various/input_fields.py index 2400b79..43d7e65 100644 --- a/nomadnet/examples/various/input_fields.py +++ b/nomadnet/examples/various/input_fields.py @@ -31,6 +31,12 @@ You can `!`[submit`:/page/input_fields.mu`one|password|small]`! other fields, or Or simply `!`[submit them all`:/page/input_fields.mu`*]`!. +Submission links can also `!`[include pre-configured variables`:/page/input_fields.mu`username|two|entitiy_id=4611|action=view]`!. + +Or take all fields and `!`[pre-configured variables`:/page/input_fields.mu`*|entitiy_id=4611|action=view]`!. + +Or only `!`[pre-configured variables`:/page/input_fields.mu`entitiy_id=4688|task=something]`! + -= """ diff --git a/nomadnet/ui/textui/MicronParser.py b/nomadnet/ui/textui/MicronParser.py index f6a82e8..f549509 100644 --- a/nomadnet/ui/textui/MicronParser.py +++ b/nomadnet/ui/textui/MicronParser.py @@ -158,6 +158,7 @@ def parse_line(line, state, url_delegate): if isinstance(o, tuple): if url_delegate != None: tw = LinkableText(o, align=state["align"], delegate=url_delegate) + tw.in_columns = True else: tw = urwid.Text(o, align=state["align"]) @@ -621,6 +622,7 @@ class LinkableText(urwid.Text): self.delegate = delegate self._cursor_position = 0 self.key_timeout = 3 + self.in_columns = False if self.delegate != None: self.delegate.last_keypress = 0 @@ -697,16 +699,23 @@ class LinkableText(urwid.Text): elif key == "right": old = self._cursor_position self._cursor_position = self.find_next_part_pos(self._cursor_position, part_positions) + if self._cursor_position == old: - self._cursor_position = 0 - return "down" + if self.in_columns: + return "right" + else: + self._cursor_position = 0 + return "down" self._invalidate() elif key == "left": if self._cursor_position > 0: - self._cursor_position = self.find_prev_part_pos(self._cursor_position, part_positions) - self._invalidate() + if self.in_columns: + return "left" + else: + self._cursor_position = self.find_prev_part_pos(self._cursor_position, part_positions) + self._invalidate() else: if self.delegate != None: