1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-12 00:34:47 -04:00
Commit Graph

309 Commits

Author SHA1 Message Date
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
sgerwk
2f58dfce13 when searching in a node, only search within its box 2018-06-25 10:47:51 +02:00
Fabienne Ducroquet
3665ee2ef7 Move check on number of search points to move_search_do
If doc_view->document->number_of_search_points is 0, move_search_number
crashes at:

pt = doc_view->document->search_points;
x = pt[number].x;
y = pt[number].y;

so it is not sufficient to make find_first_search_in_view return
immediately in this case, move_search_do should return immediately.
2018-06-07 17:25:21 +02:00
Witold Filipczyk
f2c0a380ab Check if nothing has found. Refs #21 2018-04-15 18:08:54 +02:00
Witold Filipczyk
ad5f8165b2 Wraparound search 2018-04-15 16:45:23 +02:00
Witold Filipczyk
798a7cc4e6 Reuse existing functions to scroll. Added horizontal_scroll_extended. 2018-04-15 14:32:18 +02:00
Witold Filipczyk
7a006b6dd2 Rewritten searching. Refs #21
Before only visible part of screen was searched for pattern.
Now whole document is searched, and beginings of found text
is remembered in document->search_points.
2018-04-14 21:49:52 +02:00
Witold Filipczyk
fd1ae61131 Let search for more unbreakable spaces. Refs #20 2018-04-07 11:43:28 +02:00
Witold Filipczyk
fbfbe4013c Interpret 0xA0 (nbsp in UTF-8 mode) as space char for searches. Issue #20 2018-04-06 20:02:49 +02:00
rkd77
be719e1ac1
Merge pull request #10 from aelmahmoudy/select_forms
Make select forms look more like other forms.
2017-11-22 12:02:06 +01:00
rkd77
a6996b7d3a
Merge pull request #7 from aelmahmoudy/keep_forms_bold
Keep forms in bold even when active.
2017-11-22 11:55:40 +01:00
rkd77
f44fdc25ed
Merge pull request #5 from aelmahmoudy/dont_underline_active_textarea
Avoid underlining active text areas.
2017-11-22 11:53:32 +01: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
Yozo Hida
2a09148e5a Avoid underlining active text areas.
They already have underscores, so underlining them is redundant (and looks a
bit strange).
2017-11-21 16:04:27 +01:00
Yozo Hida
6ad3e541c8 Keep forms in bold even when active. 2017-11-21 16:02:26 +01:00
Yozo Hida
4ed958b067 Provide different color for text areas in insert mode.
The color is controlled by

  document.browse.links.active_link.insert_mode_colors.background
  document.browse.links.active_link.insert_mode_colors.text

Also avoid overloading local variable "i" in get_current_link().
2017-11-21 16:00:39 +01:00
Witold Filipczyk
0266633025 Fix issue with one char documents. Patch by Felix Janda 2017-11-14 09:54:05 +01:00
Witold Filipczyk
f3ab69bb13 Color trailing spaces with color of last non-space cell 2017-06-13 22:39:53 +02:00
Witold Filipczyk
c610fcf334 Off by one, also 200 instead of 30 2017-06-13 17:07:23 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
Witold Filipczyk
4efea7e314 Added support for label_key in references of dumps.
Added base parameter to dec2qwerty and qwerty2dec to avoid strlen calls
im dumps.
2016-02-07 11:51:17 +01:00
Witold Filipczyk
69986f1bd1 Multiplication instead of pow calls and minor style changes. 2016-01-31 12:38:18 +01:00
Martin Miller
28b7bd1ec2 Transfer changes for ascii link labeling 2016-01-31 10:23:08 +01:00
Fabienne Ducroquet
3379fc988c Respect alphabetical order for the actions
I didn’t respect the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 16:38:57 +01:00
Fabienne Ducroquet
60a5fce0f0 Add a function to put the current line at the top of the screen
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 10:01:34 +01:00
Witold Filipczyk
40fdc14012 30 instead of 10. Python tutorial looks better. 2013-12-16 17:04:59 +01:00
witekfl
ba9bbc9e46 draw_space: Check for a non-space only in first 10 chars of the line.
I know it is totally brainless, but buildlogs.pld-linux.org
looks good now.
2012-07-11 11:39:26 +02:00
witekfl
42d2433f4b Color leading spaces with the color of the first non-space character.
Also color trailing spaces with the color of the last character.

See for example gtk-doc.
2012-07-11 11:14:03 +02:00
witekfl
36070d3277 The union of the color and the node_number in the struct screen_char.
The long term goal is good looking of the Python docs in ELinks, especially
background colors. Every start tag and every text node would have associated
a natural number. Those numbers would be "drawn" in the document instead
of colors. Finally, the screen driver would change numbers into colors.

This will be done in small steps. The next step is to implement this change
in the screen driver.
2012-03-03 11:27:58 +01:00
Miciah Dashiel Butler Masters
3932af9b17 SMJS: handle view_state outliving wrapping object
Currently, it is possible for the JSObject that wraps a struct view_state
to outlive the view_state.  Using the properties of the JSObject wrapper
will then cause a crash.

This patch adds a smjs_detach_view_state_object function, which is called
in destroy_vs, to dissociate the struct view_state from the JSObject
wrapper.  To this end, the patch modifies the struct view_state to point
the JSObject wrapper.  smjs_get_view_state_object will use this pointer
if it is set, and copy_vs will copy this pointer to the new view_state.
The patch also modifies view_state_get_property and
view_state_set_property to return immediately if the view_state has been
destroyed.  Finally, the patch adds a finalizer (view_state_finalize)
that clears the pointer from the struct view_state to the JSObject.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
daa6f36e83 Perform the work of try_form_insert_mode in enter
Currently, the function try_form_insert_mode checks whether the current
link is a text area, insert mode is off, and the current action is enter,
and if so, it sets insert mode on.  Perform this work in enter instead,
and delete try_form_insert_mode.

The old code works as follows: send_kbd_event → send_to_frame
→ frame_ev → frame_ev_kbd → try_form_insert_mode.  The new code works
as follows: send_kbd_event → do_action → enter.
2011-11-14 04:34:50 +00:00
witekfl
3d4fe9c4d2 Always do reload after submitting forms.
In fact, it does reload after pressing any button, but it should not
hurt. To remember to press 'x' for submitting forms was too hard.
2011-11-12 15:17:53 +01: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
Kalle Olavi Niemitalo
715571a5d6 HTML bug 1114: Don't doubly decode entities in attributes
The HTML parser decoded SGML entity references and numeric character
references in the following attributes, and then the renderer did the
same again:

link/@title
link/@hreflang
link/@type
link/@media
img/@alt
area/@alt
input[@type="image"]/@alt
input[@type="image"]/@name
input[@type="button"]/@value

The result was that e.g. title="&amp;#65;" displayed as "A"
even though it was supposed to display as "&#65;".

Fix by making the HTML parser tell the renderer that the entities have
already been decoded.
2011-05-01 22:54:45 +03:00
Miciah Dashiel Butler Masters
dfc666dd75 Factor try_menu out of send_kbd_event
Try to make the code a little clearer by pulling try_menu out of
send_kbd_event.  try_menu calls the BFU code and tells send_kbd_event
whether the BFU code did something with the event (i.e. opened a menu)
or whether the event still needs to be handled.
2011-01-19 03:52:08 +00:00
Miciah Dashiel Butler Masters
af5e54d95f send_kbd_event: Fix accesskeys when priority = 0
With document.browse.accesskey.priority = 0, accesskeys were ignored if
the current tab was not the last (rightmost) tab.  This commit fixes the
problem.

Add a function tabs_are_on_top(struct terminal *) which returns
a Boolean value indicating whether the topmost window is a tab (as
opposed to, e.g., a menu).

This commit fixes commit 1bd498cde9.
2011-01-19 03:44:50 +00:00
Miciah Dashiel Butler Masters
00870bfe3d Delete unused variables after next to last commit
Delete some variables that are unused as of the next to last commit.

Thanks to Simon Ruderich for pointing out that those variables were
still there.
2010-09-16 20:57:34 +00:00
Miciah Dashiel Butler Masters
ece4d3dc2d fixup_typeahead_match: improve comment
Clarify the comment for fixup_typeahead_match and put it closer to the
relevant code.
2010-09-16 02:00:01 +00:00
Miciah Dashiel Butler Masters
b53e8450d1 fixup_typeahead_match: use check_vs
Use check_vs instead of set_pos_x and set_pos_y in fixup_typeahead_match.
This saves us a line of code, and in addition, check_vs does not needlessly
scroll when the link is already in view.
2010-09-16 01:56:45 +00:00
Miciah Dashiel Butler Masters
b1422adf20 Move screen update code into set_kbd_repeat_count
Make set_kbd_repeat_count update the status bar and link highlighting
iff the repeat count is changed to a different value.

Delete code to do the same updates from do_action and try_prefix_key.

Besides simplifying the code, this change also fixes some issues with
the status bar and link highlighting not being properly updated in some
situations.
2010-09-16 01:40:10 +00:00
Miciah Dashiel Butler Masters
d6bd7987d4 Introduce set_kbd_repeat_count
Introduce and use ses_kbd_repeat_count to change
ses->kbdprefix.repeat_count instead of setting it directly.

This change should not cause any change in behaviour.
2010-09-16 01:33:45 +00:00
Fabienne Ducroquet
83945b677c Add document.browse.scrolling.vertical_overlap
Add an option to specify the number of overlapping lines when scrolling
page by page (0 by default because this is ELinks' current behaviour).

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2010-09-14 20:42:32 +00:00
Fabienne Ducroquet
6211b8e725 Add half-page-down and half-page-up commands
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2010-09-14 20:42:32 +00:00
Witold Filipczyk
caaa7b3d13 Force tre-0.8.0 or higher.
Functions in the tre-0.8.0 have the "tre_" prefix.
They won't collide with Perl.
2009-11-28 15:45:24 +01:00