1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
Commit Graph

298 Commits

Author SHA1 Message Date
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