1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-08-23 21:24:44 -04:00
Commit Graph

82 Commits

Author SHA1 Message Date
Witold Filipczyk
dc12c13244 [quickjs] Test commit. window.alert('Blabla') works. 2021-10-17 18:17:48 +02:00
Witold Filipczyk
30f7601650 [form] detach form view 2021-09-16 21:43:28 +02:00
Witold Filipczyk
66305fcb50 [gettext] try system gettext. Refs #62
Now, only meson was changed.
-Dnls=true -Dgettext=true
2021-08-08 21:25:08 +02:00
Witold Filipczyk
dfbd75c958 [select] off by two. Refs #88
Also changed a bit utf8_to_unicode.
2021-01-17 21:56:40 +01:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
Witold Filipczyk
d1ecd45828 [mozjs52] It compiles, but often segfaults. No idea yet how to fix it. 2020-10-27 14:53:24 +01:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Witold Filipczyk
6dfdd36398 form_control -> el_form_control 2018-09-09 19:18:53 +02:00
Witold Filipczyk
d8be2c505e Rename struct box to struct el_box.
In the future I want to copy some code from netsurf, so I'm preparing.
2018-09-09 19:14:56 +02:00
Yozo Hida
7e58737619 Make select forms look more like other forms.
Insert "[_" and "_]" as part of the form link, and
include it as part of the link.
2017-11-21 16:06:33 +01:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Petr Baudis
9a001f051a Remove variables that were set but not used
Required to make new gcc with default warning settings happy.
2011-09-24 02:25:51 +02:00
Miciah Dashiel Butler Masters
d17a632417 field_op: use goto_link (micro-optimisation)
Use the newly introduced goto_link instead of goto_current_link in field_op
since field_op already looks up the current link.
2009-05-22 20:05:16 +00:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bfu/dialog.c
	src/bfu/hotkey.c
	src/bfu/inpfield.c
	src/dialogs/options.c
	src/document/renderer.c
	src/intl/gettext/libintl.h
	src/protocol/http/codes.c
	src/session/task.c
	src/terminal/event.c
	src/terminal/terminal.h
	src/viewer/text/form.c
	src/viewer/text/link.c

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
ad45176dde Add get_terminal_codepage().
This simplifies the callers a little and may help implement
simultaneous support for different charsets on different terminals
of the same type (bug 1064).
2009-01-01 16:16:17 +00:00
Kalle Olavi Niemitalo
0ec4f380fa Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	AUTHORS
2008-11-10 00:07:20 +02:00
Peter Collingbourne
658b9cc70f Fixed bug relating to newlines in hidden input fields
This patch fixes an issue whereby a newline character appearing within
a hidden input field is incorrectly reinterpreted as a space character.
The patch handles almost all cases, and includes a test case.
15/18 tests pass, but the remainder currently fail due to the fact
that ELinks does not currently support textarea scripting.
2008-11-09 23:28:46 +02:00
Kalle Olavi Niemitalo
bbee237ff0 Merge branch 'elinks-0.12' into elinks-0.13 2008-07-20 14:47:40 +03:00
Kalle Olavi Niemitalo
759fbb1142 952, 954: Add ecmascript_detach_form_view stub
Anything that frees struct form_view must now call the new function
ecmascript_detach_form_view.  This function should then clear out any
dangling pointers, but that has not yet been implemented.
2008-07-18 20:00:16 +03:00
Kalle Olavi Niemitalo
bbadb99dd1 952, 954: Add ecmascript_{detach,moved}_form_state stubs
Anything that frees or reallocates struct form_state must now call the
new functions ecmascript_detach_form_state or ecmascript_moved_form_state.
These functions should then clear out any dangling pointers, but that has
not yet been implemented.
2008-07-18 19:56:49 +03:00
Kalle Olavi Niemitalo
42123dab87 1008: percent-encode file names in uri.post
In uri.post, each file name begins and ends with FILE_CHAR.
Previously, file names were not encoded, and names containing
FILE_CHAR could not be used.  Because FILE_CHAR is a control
character, the user cannot directly type it in a file input field,
so ELinks asserted that the field did not contain FILE_CHAR.
However, it is possible to get FILE_CHAR in a file input field
with file name completion (ACT_EDIT_AUTO_COMPLETE), causing the
assertion to fail.  Now, ELinks encodes FILE_CHAR as "%02", so it
is no longer ambiguous and the assertion is not needed.
2008-07-11 14:44:35 +03:00
Kalle Olavi Niemitalo
50a3244dfb 1008: document the format of uri.string and uri.post 2008-07-11 14:20:47 +03:00
Kalle Olavi Niemitalo
3e370677c4 1008: assert there's no FILE_CHAR in file names 2008-06-04 01:15:07 +03:00
Kalle Olavi Niemitalo
7a72a685e5 1008: Centralize random numbers.
If ELinks is being linked with SSL library, use its random number
generator.

Otherwise, try /dev/urandom and /dev/prandom.  If they do not work,
fall back to rand(), calling srand() only once.  This fallback is
mostly interesting for the Hurd and Microsoft Windows.

BitTorrent piece selection and dom/test/html-mangle.c still use rand()
(but not srand()) directly.  Those would not benefit from being
unpredictable, I think.
2008-05-25 18:44:21 +03:00
Witold Filipczyk
5c885def9b 1008: Do not check boundaries, use random ones. 2008-05-17 18:20:13 +02:00
Witold Filipczyk
ffcd91a30d 1008: Comments.
G: -----------------------------------------------------------------------
2008-05-12 13:01:51 +02:00
Witold Filipczyk
f09a5f235e 1008: s/big_file/file/g . 2008-05-12 12:51:53 +02:00
Witold Filipczyk
9f768354b9 1008: Moved the definition of the big_files_offset to the form.c. 2008-05-12 12:42:43 +02:00
Witold Filipczyk
5458346e6e 1008: Use the new code for all files, not only for bigger ones. 2008-05-12 12:37:00 +02:00
Witold Filipczyk
ec382345c8 1008: upload of big files.
Files bigger than 65536 bytes are loaded on "demand".
TODO: Add a progress bar of uploads.
2008-05-11 13:13:49 +02:00
Kalle Olavi Niemitalo
64102db7ae Bug 867: Don't consume KBD_MOD_PASTE to enter insert mode.
In the previous version, the first event that had KBD_MOD_PASTE
entered insert mode and was consumed for that; ELinks then inserted
the characters from the remaining events.  Now, to make ELinks insert
the first character too, I'm changing things so that KBD_MOD_PASTE
does not cause insert mode to be entered; instead, ELinks inserts
those characters regardless of whether insert mode is on.
2008-01-19 18:12:57 +02:00
Miciah Dashiel Butler Masters
0e0bacf0d3 Merge branch 'master' of ssh://pasky.or.cz/srv/git/elinks
Conflicts:

	src/document/options.c
2007-08-30 21:13:43 +00:00
Miciah Dashiel Butler Masters
91947860f2 Check session- and domain-specific settings for many options
Pass the session with some get_opt_* calls.  These are the low-hanging fruit.  Some places will be difficult because we don't have the session or for other reasons.
2007-08-30 21:11:51 +00:00
Petr Baudis
6b05ddb762 Remove unnecessary document/html/parser.h includes 2007-08-29 00:08:05 +02:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Miciah Dashiel Butler Masters
1fd2a77416 Update comment: html_form_control -> html_special_form_control
Update a comment in encode_multipart, which refers to html_form_control, which has since been renamed to html_special_form_control.

The comment was added with this commit:

   commit b4dee890a61a6c8a27a8e4cd1dc3b3b93f1cdb08
   Author: Petr Baudis <pasky@ucw.cz>
   Date:   Fri May 10 13:26:55 2002 +0000

       Don't decode and back encode hidden form items (by mikulas, from 0.97).

The function was renamed with this commit:

   commit c9d72739c715b3b0c7c6fec582780c1e8f444fc4
   Author: Petr Baudis <pasky@ucw.cz>
   Date:   Sat Dec 18 02:22:28 2004 +0000

       html_(tag|form*) -> html_special_\1, to naming prevent conflicts with HTML element handlers. As suggested by Jonas.
2007-08-12 11:23:49 +00:00
Kalle Olavi Niemitalo
b70aa312d0 Doxygenate src/viewer/text/ 2007-07-27 14:13:27 +03:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +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
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
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +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
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
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