1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-17 01:16:16 -04:00
Commit Graph

336 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
6117f8a164 Name the exec_on_terminal() fg values. 2007-07-15 23:46:18 +03:00
Witold Filipczyk
7988a6ce2f onsubmit: Reverted commit fa93d05b7e.
I don't remember why I cleared "returns", but it doesn't work
with www.hypermedia.pl/altkom/ and probably with many more sites.

[ From commit e887efc611 on the witekfl
  branch.  --KON ]
2007-05-30 02:35:25 +03:00
Kalle Olavi Niemitalo
45d1750d03 Bug 914: Don't let UTF-8 I/O affect internal representations.
Use it for the actual I/O only.  Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option.  Now, those strings always
follow the terminal charset.  This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8.  This reduction in the effects of
UTF-8 I/O may also simplify future testing.
2007-05-20 15:31:02 +03:00
Kalle Olavi Niemitalo
5e83337d49 Bug 784: Keep form_control.default_value in the document charset.
Previously, html_special_form_control converted
form_control.default_value to the terminal charset, and init_form_state
then copied the value to form_state.value.  However, when CONFIG_UTF8
is defined and UTF-8 I/O is enabled, form_state.value is supposed to
be in UTF-8, rather than in the terminal charset.

This mismatch could not be conveniently fixed in
html_special_form_control because that does not know which terminal is
being used and whether UTF-8 I/O is enabled there.  Also, constructing
a conversion table from the document charset to form_state.value could
have ruined renderer_context.convert_table, because src/intl/charsets.c
does not support multiple concurrent conversion tables.

So instead, we now keep form_control.default_value in the document
charset, and convert it in the viewer each time it is needed.  Because
the result of the conversion is kept in form_state.value between
incremental renderings, this shouldn't even slow things down too much.

I am not implementing the proper charset conversions for the DOM
defaultValue property yet, because the current code doesn't have
them for other string properties either, and bug 805 is already open
for that.
2007-04-29 22:01:13 +03:00
Kalle Olavi Niemitalo
0df5b7fdf5 Apply form history to fs->value, not fc->default_value.
I am going make fc->default_value use the charset of the document, and
recoding the string from the form history to that might lose characters.

This change also affects what ECMAScript sees in the defaultValue property.
<http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-26091157>
says it should represent the HTML "value" attribute, so changing it
based on form history is not appropriate.
2007-04-29 21:39:28 +03:00
Kalle Olavi Niemitalo
69c185c34e Document the charset of form_state.value for FC_TEXTAREA. 2007-04-29 21:21:25 +03:00
Laurent MONIN
90980a944e Mark all module names for translation and include needed header files. 2007-03-21 11:01:06 +01:00
Witold Filipczyk
d2970e57af accesskey: start iterating with next link.
Rotating between links with the same accesskey works.

[ From commit c2d1952a08
  on the witekfl branch.  --KON ]
2007-03-18 12:55:56 +02:00
Witold Filipczyk
682ad62a97 Accesskey didn't work as it should.
[ From commit 5008fb697d
  on the witekfl branch.  --KON ]
2007-03-18 12:55:29 +02:00
Kalle Olavi Niemitalo
7645a836fc Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
22af2b22e2 Cast variadic arguments of add_to_ml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in
particular may have the wrong type.
2007-03-11 12:44:13 +02:00
Kalle Olavi Niemitalo
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +02:00
Kalle Olavi Niemitalo
0dfb88c802 textarea_edit: Cast size_t fx_maxlength to match "%u". 2007-03-11 00:25:42 +02:00
Laurent MONIN
86686983c0 save_textarea_file(): do not open file for writing if not needed. Patch
by Alexey Tourbin.
2007-03-05 21:48:42 +01:00
Laurent MONIN
ecce8bfa91 save_textarea_file(): handle return values of fwrite() and fclose(). Patch
by Alexey Tourbin.
2007-03-05 21:47:09 +01:00
Laurent MONIN
1e00f2d10d save_textarea_file(): cleanup handling of error, closing descriptors
and unlinking created file. Patch by Alexey Tourbin.
2007-03-05 21:44:58 +01:00
Laurent MONIN
12ec62810b save_textarea_file(): h -> fd, file -> fp. Idea by Alexey Tourbin. 2007-03-05 21:41:17 +01:00
Laurent MONIN
31865ef953 Fix gcc warning: value computed is not used. Patch by Alexey Tourbin. 2007-03-05 21:11:19 +01:00
Miciah Dashiel Butler Masters
93aea42b96 Unhighlight previously selected link when using goto-mark
In goto_mark, copy the current_link of the old view state to the
old_current_link of the new view state so that clear_link will properly
clear the highlight for that link.

This fixes a bug introduced with the removal of link_bg in commit
c91c763d49.
2007-02-04 23:13:39 +00:00
Kalle Olavi Niemitalo
2e5488ba3d option_changed: Merge the 2nd and 3rd parameter.
All callers were passing the same value for both.
2007-01-27 19:52:49 +02:00
Witold Filipczyk
1e8f8aa4a6 warning: ctext is used only with CONFIG_UTF8. 2007-01-03 21:55:39 +02:00
Kalle Olavi Niemitalo
ef96caad01 Make u2cp and u2cp_no_nbsp return a pointer to const. 2007-01-02 20:08:59 +02:00
Miciah Dashiel Butler Masters
896cdab771 Re-use @fs in activate_link instead of introducing a new local variable
This optimisation is made possible by commit
15dce57bc9.
2006-12-30 11:17:43 +00:00
Kalle Olavi Niemitalo
15dce57bc9 Bug 908, activate_link: Set fs->state before the fs pointer becomes invalid. 2006-12-23 02:11:01 +02:00
Miciah Dashiel Butler Masters
e523504424 Add .cached to struct document
This allows code to use document->cached instead of
find_in_cache(document->uri), thereby increasing the likelihood
of getting the correct cache entry.

This should fix Bug 756 - "assertion (cached)->object.refcount >= 0 failed"
after HTTP proxy was changed.

Patches for this were written by me and then later by Jonas.
This commit combines our independent implementations.
2006-12-10 03:11:04 +00:00
Miciah Dashiel Butler Masters
c22f38413e Decode the fragment identifier extracted from the URI when looking it up
This fixes a problem with fragment references that was reported
by Thomas Adam.
2006-12-05 18:06:47 +00:00
Miciah Dashiel Butler Masters
711ee0a33f Fix horizontal scrolling of textareas when UTF-8 I/O is enabled
As draw_textarea_utf8 loops over each character of the textarea content, it
checks whether the character is on the screen; draws it if so; increments
the screen co-ordinate; and updates the position in the textarea text.
The last step was being skipped when the character was not on the line,
so a line would be drawn from the beginning, even if the left edge of the
textarea is off the screen.

Closes: Bug 835 - Text in textarea is unaffected by horizontal scrolling of
document in UTF-8 mode
2006-12-02 16:35:51 +00:00
Miciah Dashiel Butler Masters
5537a3f977 Improve performance with textareas + UTF-8 I/O
If utf8_char2cells isn't told where the string that contains
the given UTF-8 character ends, it computes that itself. Two users
of utf8_char2cells, format_textutf8 and split_line, were calling
utf8_char2cells in a loop without providing the end of the string,
resulting in numerous calls by utf8_char2cells to strlen.
With this patch, format_textutf8 and split_line each find the end
of the string once and provide it to utf8_char2cells.

This particularly improves performance with textareas, since
format_textutf8 is called multiple times each time the user interacts
with the textarea and when it must be redrawn.

Closes: Bug 823 - Big textarea is too slow with CONFIG_UTF8
2006-12-02 14:48:48 +00:00
Kalle Olavi Niemitalo
8b8cd57941 Use new macro UCS_ORPHAN_CELL for broken double-cell characters.
UCS_ORPHAN_CELL is currently defined as U+0020 SPACE, which was
already used before this macro, so the behaviour does not change,
but the code seems clearer now.

I searched for ' ' and 32 and 0x20 and \x20, and replaced with
UCS_ORPHAN_CELL wherever UCS_NO_CHAR was involved.  However,
some BFU widgets first draw spaces and then overwrite with text;
those will require a more complex fix if UCS_ORPHAN_CELL is ever
changed to some other character.
2006-11-13 00:49:59 +02:00
Kalle Olavi Niemitalo
7809efa1b5 Names of enum constants should be in upper case.
Requested by Miciah.
2006-11-12 14:51:18 +02:00
Kalle Olavi Niemitalo
1c5db85b1a Bug 821: Document the charsets of buffers for BFU and form input fields. 2006-10-25 19:46:01 +03:00
Witold Filipczyk
f4e66f1fc6 ECMAScript: added writeonly property window.status 2006-10-24 20:41:25 +02:00
Kalle Olavi Niemitalo
4076759890 Bug 821: With CONFIG_UTF8 and UTF-8 I/O, form_state.value is in UTF-8.
That is even if the document and the terminal have some other charset.
2006-10-23 23:01:47 +03:00
Laurent MONIN
0b58b99d30 Use @current_tab for current tab. 2006-09-28 23:58:26 +02:00
Kalle Olavi Niemitalo
92cb452a9e Rename CONFIG_UTF_8 to CONFIG_UTF8.
The configure script no longer recognizes "CONFIG_UTF_8=yes" lines
in custom features.conf files.  They will have to be changed to
"CONFIG_UTF8=yes".  This incompatibility was deemed acceptable
because no released version of ELinks supports CONFIG_UTF_8.

The --enable-utf-8 option was not renamed.
2006-09-17 16:12:47 +03:00
Kalle Olavi Niemitalo
e8462980e5 Change "utf_8" to "utf8" in most identifiers.
Suggested by Miciah on #elinks.

What was renamed:
  add_utf_8                      => add_utf8
  cp2utf_8                       => cp2utf8
  encode_utf_8                   => encode_utf8
  get_translation_table_to_utf_8 => get_translation_table_to_utf8
  goto invalid_utf_8_start_byte  => goto invalid_utf8_start_byte
  goto utf_8                     => goto utf8
  goto utf_8_select              => goto utf8_select
  terminal_interlink.utf_8       => terminal_interlink.utf8
  utf_8_to_unicode               => utf8_to_unicode

What was not renamed:
  terminal._template_.utf_8_io option, TERM_OPT_UTF_8_IO
    Compatibility with existing elinks.conf files would require an alias.
  --enable-utf-8
    Because the name of the charset is UTF-8, --enable-utf-8 looks better
    than --enable-utf8.
  CONFIG_UTF_8
    Will be renamed in a later commit.
  Unicode/utf_8.cp, table_utf_8, aliases_utf_8
    Will be renamed in a later commit.
2006-09-17 16:06:22 +03:00
Kalle Olavi Niemitalo
cc6939b9f8 UTF-8: Don't update form_state.state_cell if it is not used.
FC_TEXT, FC_PASSWORD, and FC_FILE do not use state_cell.
FC_TEXTAREA does use it.
2006-09-02 23:16:32 +03:00
Kalle Olavi Niemitalo
8d77387f6f UTF-8: Fix scrolling of input fields.
form_state.state_cell is no longer used for FC_TEXT, FC_PASSWORD, nor FC_FILE.
Instead, get_link_cursor_offset() computes the cell with utf8_ptr2chars
(a new function) or utf8_ptr2cells.  This shouldn't slow down ELinks too
much, as it's done only for the selected link and only once per redraw.

The left side of a scrolled input field is always aligned at a
character boundary.  The right side might not be.
2006-09-02 23:03:45 +03:00
Kalle Olavi Niemitalo
92845d0b56 UTF-8: Reformat get_link_cursor_offset() a little. 2006-09-02 21:48:30 +03:00
Kalle Olavi Niemitalo
a8c573a174 viewer: Document some members of struct form_state.
The new comments describe how the members were apparently intended to
be used.  However, the implementation does not actually work when
CONFIG_UTF_8 is defined, and the current semantics do not even allow
an efficient implementation of long (mostly scrolled out) strings.
2006-09-02 21:17:05 +03:00
Miciah Dashiel Butler Masters
0cca8d4af0 Call set_screen_dirty in draw_link
I dropped this in c91c763d49, but it seems
necessary to fix some drawing artefacts exhibited with a local patch.
2006-08-14 07:59:10 +00:00
Jonas Fonseca
98e8ba781f Merge with http://www.iki.fi/kon/2006/elinks.git#ctrl-alt 2006-08-13 14:47:46 +02:00
Kalle Olavi Niemitalo
de93359a5a Support Ctrl-Alt-letter key combinations.
Actions can now be bound to e.g. Ctrl-Alt-A.  The keybinding code also
supports other combinations of modifiers, like Shift-Ctrl-Up, but the
escape sequence decoder doesn't yet.

Don't let Ctrl-Alt-letter combinations open menus.
2006-08-13 15:32:06 +03:00
Jonas Fonseca
edeb934cc3 try_mark_key: try to improve readability by using a local var and a cast
The cast is not necessary since we already check the bounds, but by using a
cast here, it hopefully makes it more obvious what the long comment above
is pointing out: namely that we put the value of a signed integer into an
unsigned char.
2006-08-13 13:27:16 +02:00
Jonas Fonseca
f24fa6ef63 search_dlg_do: Minor (questionable) cleanup 2006-08-13 13:20:32 +02:00
Kalle Olavi Niemitalo
a14074a763 try_document_key: Convert the key to UCS-4, resolving the FIXME.
This requires compiling cp2u() in even without CONFIG_UTF_8.
I also added an is_kbd_character macro to make try_document_key
more resilient to changes in the definition of term_event_key_T.
2006-08-12 16:04:21 +03:00
Kalle Olavi Niemitalo
f97a392c01 try_mark_key: Reject non-ASCII keys as mark characters.
The previous version used only the low 8 bits of the key code.
This one arranges for the whole key to be rejected if it's not ASCII.
Perhaps the modifiers should be checked too, but I'm not changing that now.
2006-08-12 15:07:07 +03:00
Kalle Olavi Niemitalo
2648fd57e4 UTF-8 doc: Clarify FIXME in try_document_key. 2006-08-12 15:00:44 +03:00
Kalle Olavi Niemitalo
f3b04b8645 terminal: Introduce term_event_key_T. 2006-08-12 14:48:08 +03:00
Kalle Olavi Niemitalo
a9da075eb5 terminal UTF-8: term_event_keyboard.key is UCS-4, #ifdef CONFIG_UTF_8.
Form fields and BFU text-input widgets then convert from UCS-4 to UTF-8.
If not all UTF-8 bytes fit, they don't insert anything.  Thus it is no
longer possible to get invalid UTF-8 by hitting the length limit.

It is unclear to me which charset is supposed to be used for strings
in internal buffers.  I made BFU insert UTF-8 whenever CONFIG_UTF_8,
but form fields use the charset of the terminal; that may have to be
changed.

As a side effect, this change should solve bug 782, because
term_send_ucs no longer encodes in UTF-8 if CONFIG_UTF_8 is defined.
I think the UTF-8 and codepage encoding calls I added are safe, too.
A similar bug may still surface somewhere else, but 782 could be
closed for now.

This change also lays the foundation for binding actions to non-ASCII
keys, but the keystroke name parser doesn't yet support that.
The CONFIG_UTF_8 mode does not currently support non-ASCII characters
in hot keys, either.
2006-08-06 20:02:43 +00:00
Kalle Olavi Niemitalo
7dcc6c9a19 viewer UTF-8: Correctly position cursor for ACT_EDIT_LEFT in text input field.
To reproduce the bug before this patch:
Enable CONFIG_UTF_8, UTF-8 I/O, and UTF-8 charset.
Go to www.google.com and type "abc" in the text input field.
Then press Left.  The cursor jumps to "a" when it should go to "c".
2006-07-31 21:46:36 +02:00
Laurent MONIN
1136aefb71 Trim trailing whitespaces. 2006-07-27 09:51:10 +02:00
Laurent MONIN
a897a95721 Compilation fixes (CONFIG_UTF_8): move variables declarations at start
of blocks. Old compilers do not support in-block declarations.
2006-07-27 09:49:49 +02:00
Witold Filipczyk
4263af97a9 The missing code, I suppose. Fixed moving right in textareas in UTF-8 mode.
First move was by two cells.
2006-07-23 15:23:19 +02:00
Jonas Fonseca
71e569c129 Move variable out of loop to fix uninitialized warning caused by goto label 2006-07-22 17:06:05 +02:00
Witold Filipczyk
7c7a0bb890 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-07-21 19:00:49 +02:00
Miciah Dashiel Butler Masters
97e2bc9365 Text type-ahead searching: don't follow current link on enter
When the user presses enter during a text type-ahead search, simply cancel
the search without additionally following the current link. Link type-ahead
searching still will follow the active link on enter.
2006-07-21 11:15:30 +00:00
Witold Filipczyk
2a6125e3d0 Merge with utf8. src/document/plain/renderer.c replaced by utf8 version 2006-07-21 13:12:06 +02:00
Witold Filipczyk
3126078f51 Rexgexp works but the accented letters. It's all I can do 2006-07-18 18:06:43 +02:00
Witold Filipczyk
b27667fcf7 Use already known document->options.utf8 instead of is_cp_utf8 2006-07-18 17:54:23 +02:00
Witold Filipczyk
44c74ac389 Refactor is_cp_special to is_cp_utf8 2006-07-18 17:51:03 +02:00
Witold Filipczyk
681cfc4ae5 Populate search function with utf8 indicating whether we really use UTF-8 2006-07-18 17:39:02 +02:00
Witold Filipczyk
02e098dc5a Case insensitive search works with accented letters. UTF-8 character set
is assummed for now
2006-07-18 12:31:30 +02:00
Witold Filipczyk
7dc2b5bf02 Case insensitive search works but accented letters 2006-07-18 00:44:08 +02:00
Witold Filipczyk
8052c74a03 Case sensitive searching works, but only in UTF-8 mode 2006-07-18 00:28:13 +02:00
Miciah Dashiel Butler Masters
76f3dc99b3 Fix refresh after move-page-up with a prefix
Make move_up and move_down return no value. Instead, save the old y value
and compare it to the new after calling move_up or move_down in
move_page_up or move_page_down, respectively.

This fixes a bug where if given a prefix, if that prefix specified a number
of pages greater than move-page-up actually scrolled, there would be no
screen update, because the last call to move_up would return FRAME_EVENT_OK
which would be returned from move_page_up, even tho move_page_up would have
previously returned FRAME_EVENT_REFRESH.
2006-06-24 07:39:23 +00:00
Miciah Dashiel Butler Masters
29ffe71bc1 New actions: kill-word-back, move-backward-word, move-forward-word 2006-06-23 04:07:52 +00:00
Miciah Dashiel Butler Masters
1bd498cde9 Fix accesskeys so that they work when priority is 0
Don't try the key as an accesskey if a menu was opened, whether it was just
the main menu or whether it was a submenu of the menu menu (we would try
the key as an accesskey in the latter case).

In send_kbd_event, replace the KBD_MOD_ALT modifier when trying the key as
an accesskey rather than when we don't.
2006-06-19 11:34:49 +00:00
Miciah Dashiel Butler Masters
588fa3ece8 Properly deselect the main menu instead of crashing
In send_kbd_event, use deselect_mainmenu to get rid of the main menu
instead of delete_window. This fixes bug 747.
2006-06-19 11:07:03 +00:00
Miciah Dashiel Butler Masters
a3d804540a Factor draw_link out of clear_link 2006-06-17 01:02:50 +00:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Miciah Dashiel Butler Masters
c91c763d49 Eliminate link_bg
Instead of saving the old link colours when selecting a link and using that
to restore them when unselecting it, just copy the data from the document.

 - Eliminate struct link_bg and the .link_bg and .link_bg_n members
   of struct document_view.

 - Eliminate the free_link routine and don't call it from draw_doc,
   clear_link, or detach_formatted.

 - Add a .old_current_link member to struct view_state and initialise it in
   init_vs.

 - Don't save link_bg in draw_current_link.

 - Rewrite clear_link to use the document data instead of link_bg.

 - Modify init_link_drawing not to allocate ling_bg and to return a pointer
   to a static variable for the template character.
2006-05-28 01:08:46 +00:00
Miciah Dashiel Butler Masters
e91b46de5f Modularise viewer/text/marks 2006-05-20 15:01:24 +00:00
Pavol Babincak
c0d20d8420 UTF-8 support for html form textarea. Changed displaying of textarea.
Including double-width glyph support.

Note: textarea is now drawn with blank collumn at end of lines. It seems
that this is more intuitive for users. It behaves similar as textareas in
graphical interfaces. I hope it will hold your interest.

+----+         +----+         +----+
|aaA | [right] |aaa_| [right] |aaa |
|aaa |         |aaa |         |Aaa |
|bb  |         |bb  |         |bb  |
+----+         +----+         +----+
+----+         +----+         +----+
|Aaa |  [end]  |aaa_|   [c]   |aaa |
|aaa |         |aaa |         |Caa |
|bb  |         |bb  |         |abb |
+----+         +----+         +----+
A, _, C - cursor positions.
[right] - right arrow
[end]   - ACT_END (End button)
[c]     - Letter c.

Now this code:
<textarea rows="3" cols="3">aaaaaabb</textarea>
represents textarea with 3x3 positions for chars.

Before this texteare behaved some kind of weirdly. That code above was
rendered like this:
+----+
|aaaa|
|aabb|
|_   |
+----+
2006-05-07 00:51:26 +02:00
Pavol Babincak
aedc5459ef UTF-8 support for html form elements: text, password, select and file.
Including double-width glyphs. Without support for textarea.
2006-05-07 00:51:26 +02:00
Pavol Babincak
546539b25e Changed type uint16_t to unicode_val_T.Changed var x and xi to xbase and x. 2006-05-07 00:51:25 +02:00
Pavol Babincak
f515f14e08 Renamed variables utf8_pos to state_cell and char_cnt to chars_cells. 2006-05-07 00:51:24 +02:00
Witold Filipczyk
c3f17eadeb Ecmascript: activate link only when onClick returns true 2006-05-02 13:47:16 +02:00
Witold Filipczyk
9f69170c2a fixup_select_state was unnecessary 2006-05-02 12:56:05 +02:00
Witold Filipczyk
cdd86d3c20 Ecmascript: write to the variable selectedIndex. Not tested 2006-05-02 11:28:41 +02:00
Witold Filipczyk
79a6fc1905 Pressing button caused not only onclick action, but also
"goto current page". See test/ecmascript/onclick.html.
Tell me if this breaks something
2006-04-30 17:02:48 +02:00
Miciah Dashiel Butler Masters
90f71fe6e4 Highlight links as one enters link prefixes. 2006-04-14 21:46:35 +00:00
Kalle Olavi Niemitalo
8fc8a00844 accel-check: add_uri_command_to_menu now wants the title as a parameter.
Thus, each caller must now choose the accelerator key and declare the
accelerator contexts (i.e. menus) to which it may add the command.

Also, use only one context for tab_menu.

These changes fix the following bugs in accelerator conflict detection:
* "~Pass frame URI to external command" may be displayed together
  with "Pass tab URI to e~xternal command", but that was not
  declared.
* "Pass link URI to e~xternal command" was declared as being in
  the tab menu, but it is actually displayed in the link menu.
2006-03-26 20:52:11 +00:00
Pavol Babincak
8b9d06c977 Convert link titles to correct codepage before displaying it on screen.
Don't replace UTF-8 bytes with '*'. Probably there is need to do better
check what will be displayed.

Also get_current_link_title is no longer pretty and trivial. (o:
2006-03-13 01:54:34 +01:00
witekfl
3f01c3d2fe Display optionally tabs bar at top like other browser do.
TODO: input_line_layouter, ACT_MAIN_TAB_MENU
2006-03-04 10:24:37 +01:00
Pavol Babincak
81778bc5d7 Correct computing of cursor position in UTF-8 textarea. 2006-02-18 20:28:00 +01:00
Pavol Babincak
f9d67aeb73 Added configure option --enable-utf-8
For enabling better UTF-8 support by Witek and Scrool.
2006-02-18 20:28:00 +01:00
Pavol Babincak
3ffa7cac91 Bug fix: formating error in UTF-8 textarea
When textarea contains UTF-8 characters they are not correctly wrapped.
2006-02-18 20:27:52 +01:00
Witold Filipczyk
44a1aa9c87 Witekfl's UTF-8 patch v5. 2006-02-18 20:27:46 +01:00
Kalle Olavi Niemitalo
4217f2c555 Merge with http://elinks.cz/elinks.git 2006-02-18 12:21:47 +02:00
Miciah Dashiel Butler Masters
190259ca22 mem_alloc_align: drop the obj type parameter
Instead use the object itself, i.e., replace typeof(obj) with
typeof(**ptr).
2006-02-17 17:32:59 +00:00
Miciah Dashiel Butler Masters
e6b9093f87 find_form_state: use mem_align_alloc to save some code 2006-02-17 16:52:38 +00:00
Kalle Olavi Niemitalo
0066214b47 Merge with http://elinks.cz/elinks.git 2006-02-10 09:15:12 +02:00
witekfl
6fe1a431f1 Sometimes scripts submit forms using buttons 2006-02-09 22:53:00 +01:00
Miciah Dashiel Butler Masters
ca56e3b185 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-02-08 14:12:13 +00:00
Kalle Olavi Niemitalo
262d592d23 Fix compile errors in call_onsubmit_or_submit #ifdef CONFIG_ECMASCRIPT.
The errors were caused by commit b623decfb5.
Also, rename call_onsubmit_or_submit to call_onsubmit_and_submit.
2006-02-06 23:06:35 +02:00
Kalle Olavi Niemitalo
b623decfb5 Tell the selected submit button to the server.
Commit 9cc9db4e24 broke submit buttons
on HTML forms, so that the server no longer knows which button was
actually pressed.

<kahmalo> The bug with forms seems to be that try_submit_given_form (in
          src/viewer/text/link.c) is the only function that runs "onsubmit"
          scripts, and it does not care which of the submit buttons was
          pressed; it calls submit_given_form which submits based on the first
          item of the form.                                             [20:57]
<kahmalo> or last, I don't know how the list works.
<kahmalo> try_submit_given_form could get the control via
          get_current_link(doc_view) but I suppose it'd be cleaner to provide
          that as a parameter.                                          [20:58]

Originally posted as:
<mid:87ek2heebh.fsf@Astalo.kon.iki.fi>
<nntp://news.gmane.org/87ek2heebh.fsf@Astalo.kon.iki.fi>
<http://permalink.gmane.org/gmane.comp.web.links/2745>
2006-02-06 20:57:08 +02:00
Kalle Olavi Niemitalo
b1f8756c59 Merge with http://elinks.cz/elinks.git 2006-02-05 17:48:43 +02:00
Miciah Dashiel Butler Masters
420f3072fb refresh_view: drop unnecessary call to redraw_from_window
print_screen_status calls redraw_from_window, so there is no need to
call both.
2006-02-05 01:03:24 +00:00
fa93d05b7e current_link_evhook: return effaced 2006-01-30 12:18:43 +01:00
1dae2926fd Neither SEE nor SpiderMonkey tolerate return outside functions 2006-01-30 11:52:58 +01:00
Jonas Fonseca
20f5b76bb2 ECMASCRIPT: Fix unused SEE specific variables when using spidermonkey 2006-01-28 18:26:45 +01:00
9cc9db4e24 Handling onsubmit 2006-01-28 11:17:22 +01:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Kalle Olavi Niemitalo
21f61c5c06 Specify accelerator contexts for "Form f~ields". 2006-01-01 23:31:41 +02:00
Kalle Olavi Niemitalo
345ba7afcd Merge with http://elinks.cz/elinks.git 2006-01-01 19:05:44 +02:00
Kalle Olavi Niemitalo
4c2831677a Here is a framework that detects cases where a PO file assigns
the same accelerator key to multiple buttons in a dialog box or
to multiple items in a menu.  ELinks already has some support for
this but it requires the translator to run ELinks and manually
scan through all menus and dialogs.  The attached changes make it
possible to quickly detect and list any conflicts, including ones
that can only occur on operating systems or configurations that
the translator is not currently using.

The changes have no immediate effect on the elinks executable or
the MO files.  PO files become larger, however.

The scheme works like this:

- Like before, accelerator keys in translatable strings are
  tagged with the tilde (~) character.

- Whenever a C source file defines an accelerator key, it must
  assign one or more named "contexts" to it.  The translations in
  the PO files inherit these contexts.  If multiple strings use
  the same accelerator (case insensitive) in the same context,
  that's a conflict and can be detected automatically.

- The contexts are defined with "gettext_accelerator_context"
  comments in source files.  These comments delimit regions where
  all translatable strings containing tildes are given the same
  contexts.  There must be one special comment at the top of the
  region; it lists the contexts assigned to that region.  The
  region automatically ends at the end of the function (found
  with regexp /^\}/), but it can also be closed explicitly with
  another special comment.  The comments are formatted like this:

    /* [gettext_accelerator_context(foo, bar, baz)]
         begins a region that uses the contexts "foo", "bar", and "baz".
         The comma is the delimiter; whitespace is optional.

       [gettext_accelerator_context()]
         ends the region.  */

  The scripts don't currently check whether this syntax occurs
  inside or outside comments.

- The names of contexts consist of C identifiers delimited with
  periods.  I typically used the name of a function that sets
  up a dialog, or the name of an array where the items of a
  menu are listed.  There is a special feature for static
  functions: if the name begins with a period, then the period
  will be replaced with the name of the source file and a colon.

- If a menu is programmatically generated from multiple parts,
  of which some are never used together, so that it is safe to
  use the same accelerators in them, then it is necessary to
  define multiple contexts for the same menu.  link_menu() in
  src/viewer/text/link.c is the most complex example of this.

- During make update-po:

  - A Perl script (po/gather-accelerator-contexts.pl) reads
    po/elinks.pot, scans the source files listed in it for
    "gettext_accelerator_context" comments, and rewrites
    po/elinks.pot with "accelerator_context" comments that
    indicate the contexts of each msgid: the union of all
    contexts of all of its uses in the source files.  It also
    removes any "gettext_accelerator_context" comments that
    xgettext --add-comments has copied to elinks.pot.

  - If po/gather-accelerator-contexts.pl does not find any
    contexts for some use of an msgid that seems to contain an
    accelerator (because it contains a tilde), it warns.  If the
    tilde refers to e.g. "~/.elinks" and does not actually mark
    an accelerator, the warning can be silenced by specifying the
    special context "IGNORE", which the script otherwise ignores.

  - msgmerge copies the "accelerator_context" comments from
    po/elinks.pot to po/*.po.  Translators do not edit those
    comments.

- During make check-po:

  - Another Perl script (po/check-accelerator-contexts.pl) reads
    po/*.po and keeps track of which accelerators have been bound
    in each context.  It warns about any conflicts it finds.
    This script does not access the C source files; thus it does
    not matter if the line numbers in "#:" lines are out of date.

This implementation is not perfect and I am not proposing to
add it to the main source tree at this time.  Specifically:

- It introduces compile-time dependencies on Perl and Locale::PO.
  There should be a configure-time or compile-time check so that
  the new features are skipped if the prerequisites are missing.

- When the scripts include msgstr strings in warnings, they
  should transcode them from the charset of the PO file to the
  one specified by the user's locale.

- It is not adequately documented (well, except perhaps here).

- po/check-accelerator-contexts.pl reports the same conflict
  multiple times if it occurs in multiple contexts.

- The warning messages should include line numbers, so that users
  of Emacs could conveniently edit the conflicting part of the PO
  file.  This is not feasible with the current version of
  Locale::PO.

- Locale::PO does not understand #~ lines and spews warnings
  about them.  There is an ugly hack to hide these warnings.

- Jonas Fonseca suggested the script could propose accelerators
  that are still available.  This has not been implemented.

There are three files attached:

- po/gather-accelerator-contexts.pl: Augments elinks.pot with
  context information.

- po/check-accelerator-contexts.pl: Checks conflicts.

- accelerator-contexts.diff: Makes po/Makefile run the scripts,
  and adds special comments to source files.
2006-01-01 18:55:18 +02:00
Jonas Fonseca
cef160d630 No need to have link_form_menu() be a menu function when it has an action 2005-12-26 22:28:38 +01:00
Miciah Dashiel Butler Masters
eeb51bffea Refresh the view after selecting a new form item with the form menu. 2005-12-26 11:31:05 +00:00
Miciah Dashiel Butler Masters
bcdc69e86a Use intdup for the new form menu because you can't just put an int in
a void * and expect it to work everywhere.
2005-12-26 11:25:03 +00:00
Jonas Fonseca
26b82953ce Add a "Form fields" entry to the link menu (if it is a form field)
The menu shows a list of all fields of a form, with the possibility to jump
right to that form field when selecting an entry. The menu text is the
basic form field label "Radio button", "Text field", etc. with the form
field name or alt text as the right menu text.

It introduces a new main action called link-form-menu with no default
binding.

Requested by Klaus Knopper, as a mean to improve accessibility for complex,
overloaded pages like ebay.com.
2005-12-26 01:27:44 +01:00
Miciah Dashiel Butler Masters
d11dc65320 If the user edits a textarea with an external editor but exceeds the
maximum length, do not simply drop the changes, but instead truncate them,
warn the user, and provide the user with the path to the temporary file
from which the full changes can be recovered.
2005-12-18 16:23:52 +00:00
Miciah Dashiel Butler Masters
69f38bcbcc After editing a textarea in an external editor, do not unlink the file
if it was too large to fit into the textarea.
2005-12-18 16:02:37 +00:00
Miciah Dashiel Butler Masters
9959f4d788 Fold load_textarea_file into textarea_edit. 2005-12-18 16:00:48 +00:00
Miciah Dashiel Butler Masters
517bb03da4 Add routine add_file_to_string and use it in load_textarea_file. 2005-12-18 15:56:59 +00:00
Miciah Dashiel Butler Masters
13f4464151 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-12-13 18:03:55 +00:00
Laurent MONIN
1ca88c9147 encode_multipart(): move @rd to inner scope. 2005-12-13 17:04:24 +01:00
Laurent MONIN
10aa67fb32 sort_submitted_values(): move @change abd @next to inner scope. 2005-12-13 17:01:45 +01:00
Laurent MONIN
dbcc033edb draw_frames(): move @more to inner scope. 2005-12-13 16:59:10 +01:00
Miciah Dashiel Butler Masters
db5b9be213 Convert the body of activate_link to a single switch statement. 2005-12-13 00:00:08 +00:00
Miciah Dashiel Butler Masters
b191247894 Reflow some code to reduce indentation in activate_link. 2005-12-12 23:57:37 +00:00
Miciah Dashiel Butler Masters
73e3cdecd0 Factor activate_link out of enter, which now just acquires the link
reference, calls activate_link, and triggers the onClick event.
2005-12-12 22:58:05 +00:00
Laurent MONIN
c769b81f93 send_event(): initialize @doc_view only when needed, and prevent a
useless test for mouse event when event is of keyboard type.
2005-12-12 17:11:28 +01:00
Laurent MONIN
59c8dcc473 get_current_link_info(): simplify code flow. 2005-12-12 17:05:43 +01:00
Petr Baudis
0281f732ab Fix broken onClick on checkboxes etc.
onClick on checkbox would get triggered before actually ticking the
checkbox, which is not the expected behaviour (apparently). This change
makes sure that we call the onClick event handler only after actually
doing our work with the checkbox/select widget (for the other widgets,
things should stay the same).
2005-12-10 03:48:42 +01:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Jonas Fonseca
c88afeb1c2 path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6 Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Jonas Fonseca
c6f6717a79 Re-commit the rest of the changes which was reverted in the recent 'funny merge' 2005-10-17 23:20:53 +02:00
Jonas Fonseca
94ed6fa754 Finalize and cleanup the denser Makefile format
Convert remaining conditional file building to use

	OBJS-$(CONFIG_FOO) += foo.o

one problem with reverse meaining (in util/) fixed with local 'hack'.

Cleanup and remove stuff which is now default targets.
2005-09-28 12:38:17 +02:00
Jonas Fonseca
1efab31581 Simplify building of and linking with directories
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.

Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0 Rename targets: *-l -> *-local 2005-09-27 21:11:28 +02:00
Petr Baudis
3e394f3367 ELBuildized viewer/. 2005-09-16 13:33:43 +02:00
Jonas Fonseca
7462f22635 Remove now obsolete .cvsignore files. 2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00