1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-05 02:45:32 +00:00
Commit Graph

261 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
3581e2848e Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	doc/installation.txt
	src/protocol/http/http.c
2009-02-28 18:22:54 +02:00
Kalle Olavi Niemitalo
1487d206db Bug 1069: Revert "1031: JS_SetErrorReporter only once per JSRuntime."
This reverts commit b94657869b.
I don't know where I got the idea that JS_SetErrorReporter affects the
entire JSRuntime, rather than only the provided JSContext.  The people
on #jsapi say it has never worked that way.
2009-02-26 22:56:33 +02:00
Miciah Dashiel Butler Masters
e9370fe5b9 Comment the last change 2009-02-25 01:54:36 +00:00
Miciah Dashiel Butler Masters
44dc9a1f46 Comment the last change 2009-02-25 01:54:16 +00:00
Miciah Dashiel Butler Masters
f11b2a8f97 utf8_to_jsstring: Don't free mem handed over to JS
In utf8_to_jsstring, do not free the string that is passed to
JS_NewUCString if the latter is successful; if it is, SpiderMonkey
handles the memory from then on.

Use libc routines instead of ELinks's routines to allocate and free the
string so that ELinks's memory debugging code does not try to keep track
of it after it has been handed to SpiderMonkey.

This commit fixes a bug introdued in
97d72d15a0.
2009-02-25 01:45:56 +00:00
Miciah Dashiel Butler Masters
50ff8fd835 utf8_to_jsstring: Don't free mem handed over to JS
In utf8_to_jsstring, do not free the string that is passed to
JS_NewUCString if the latter is successful; if it is, SpiderMonkey
handles the memory from then on.

Use libc routines instead of ELinks's routines to allocate and free the
string so that ELinks's memory debugging code does not try to keep track
of it after it has been handed to SpiderMonkey.

This commit fixes a bug introdued in
97d72d15a0.
2009-02-25 01:37:13 +00:00
Witold Filipczyk
9054e57c55 Merge branch 'elinks-0.12'
Conflicts:
	src/document/dom/renderer.c
2009-02-12 10:01:57 +01:00
Kalle Olavi Niemitalo
7067fc7af9 Check for JS_ReportAllocationOverflow before using it.
Debian libmozjs-dev 1.9.0.4-2 has JS_ReportAllocationOverflow but
js-1.7.0 reportedly hasn't.  Check at configure time whether that
function is available.  If not, use JS_ReportOutOfMemory instead.

Reported by Witold Filipczyk.
2009-02-08 23:07:22 +02:00
Kalle Olavi Niemitalo
d2854dca8d Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bookmarks/backend/default.c
	src/bookmarks/bookmarks.c
	src/session/session.c
	src/terminal/event.c
	src/viewer/text/search.c
2009-02-08 22:02:57 +02:00
Kalle Olavi Niemitalo
11acd03eb2 Use update_bookmark() in SMJS bookmark object.
When setting the title or URL of a bookmark from SMJS user scripting,
use update_bookmark() instead of writing directly to struct bookmark.
It triggers the bookmark-update event and sets the bookmarks_dirty
flag.
2009-02-08 18:26:18 +02:00
Kalle Olavi Niemitalo
97d72d15a0 bug 153, 1066: Convert properties of SMJS bookmark to/from UTF-8.
SpiderMonkey uses UTF-16 and the strings in struct bookmark are in
UTF-8.  Previously, the conversions behaved as if the strings had been
in ISO-8859-1.

SpiderMonkey also supports JS_SetCStringsAreUTF8(), which would make
the existing functions convert between UTF-16 and UTF-8, but that
effect is global so I dare not enable it yet.  Besides, I don't know
if that function works in all the SpiderMonkey versions that ELinks
claims to work with.
2009-02-08 18:26:18 +02:00
Kalle Olavi Niemitalo
37de386051 bug 153, 1066: Document that bookmarks should be UTF-8.
Comment changes only.
2009-01-24 12:12:45 +02:00
Kalle Olavi Niemitalo
84e19d0e4e bug 1054: Don't abort downloads when closing a terminal.
Except if they have external handlers.

When ELinks receives an event from a terminal, move that terminal to
the beginning of the global "terminals" list, so that the terminals
are always sorted according to the time of the most recent use.  Note,
this affects the numbering of bookmark folders in session snapshots.

Add get_default_terminal(), which returns the most recently used
terminal that is still open.  Use that in various places that
previously used terminals.prev or terminals.next.  Four functions
fetch the size of the terminal for User-Agent headers, and
get_default_terminal() is not really right, but neither was the
original code; add TODO comments in those functions.

When the user chooses "Background and Notify", associate the download
with the terminal where the dialog box is.  So any later messages will
then appear in that terminal, if it is still open.  However, don't
change the terminal if the download has an external handler.

When a download gets some data, don't immediately check the associated
terminal.  Instead, wait for the download to end.  Then, if the
terminal of the download has been closed, use get_default_terminal()
instead.  If there is no default terminal either, just skip any
message boxes.
2008-10-15 23:29:25 +03:00
Kalle Olavi Niemitalo
b0ce4adcbe Let Perl scripts dynamically load libraries.
XML::LibXML::SAX appears to require this.
2008-09-27 21:58:08 +03:00
Kalle Olavi Niemitalo
b94657869b 1031: JS_SetErrorReporter only once per JSRuntime.
Previously, spidermonkey_get_interpreter() and init_smjs() each called
JS_SetErrorReporter on the JSContexts they created.  However,
JS_SetErrorReporter actually sets the error reporter of the JSRuntime
associated with the JSContext, and all of our JSContexts use the same
JSRuntime nowadays, so only the error_reporter() of
src/ecmascript/spidermonkey.c was left installed.  Because this
error_reporter() asserts that JS_GetContextPrivate(ctx) returns a
non-NULL pointer, and init_smjs() does not set a private pointer for
smjs_ctx, any error in smjs_ctx could cause an assertion failure, at
least in principle.

Fix this by making spidermonkey_runtime_addref() install a shared
error_reporter() when it creates the JSRuntime and the first JSContext.
The shared error_reporter() then checks the JSContext and calls the
appropriate function.

The two error reporters are quite similar with each other.  In the
future, we could move the common code into shared functions.  I'm not
doing that yet though, because fixing the bug doesn't require it.
2008-09-07 20:17:25 +03:00
Kalle Olavi Niemitalo
2024ea610b 1031: Replace smjs_rt with spidermonkey_runtime
src/scripting/smjs/ now uses a JSRuntime managed by spidermonkey-shared.c.
2008-07-16 14:28:22 +03:00
Kalle Olavi Niemitalo
32889bf908 1031: Add spidermonkey-shared.c used for both web and user scripts
Rename src/ecmascript/spidermonkey/util.c to
src/ecmascript/spidermonkey-shared.c and compile it also when
CONFIG_SCRIPTING_SMJS is enabled but CONFIG_ECMASCRIPT_SPIDERMONKEY is
not.  Then use its functions from src/scripting/smjs/ too.  Move the
corresponding declarations, as well as the inline functions needed by
src/scripting/smjs/, from src/ecmascript/spidermonkey/util.h to
src/ecmascript/spidermonkey-shared.h.

ELinks is nowadays using two JSRuntimes and SpiderMonkey has bugs that
make it crash in such use.  To work around them, ELinks will need to
be changed to use only one JSRuntime.  I am planning to define and
initialize that JSRuntime in src/ecmascript/spidermonkey-shared.c,
now that it's compiled whenever either of the modules is enabled.
2008-07-16 12:32:24 +03:00
Kalle Olavi Niemitalo
c5a012eca5 Bug 1029: Use JS_CallFunctionValue in keybinding.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["\""] = function() {
    elinks.keymaps.main["e"] = function() {
	elinks.alert("hello!");
    };
}
2008-07-12 01:54:49 +03:00
Kalle Olavi Niemitalo
e3830cfd67 Bug 1029: Use JS_CallFunctionValue in elinks_object.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

function set_suffix(suffix) {
    elinks.preformat_html = function(cached, vs) {
	cached.content += suffix;
    }
}
set_suffix("hello");
2008-07-12 01:49:08 +03:00
Kalle Olavi Niemitalo
079b97d21b Bug 1026: Protect callback of elinks.load_uri from GC 2008-07-12 01:37:51 +03:00
Kalle Olavi Niemitalo
b2c387f1f4 Bug 1029: Use JS_CallFunctionValue in load_uri.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["!"] = function() {
    elinks.load_uri("http://www.eldar.org/cgi-bin/fortune.pl?text_format=yes",
		    function (cached) { elinks.alert(cached.content); });
}
2008-07-12 01:24:51 +03:00
Kalle Olavi Niemitalo
fd27acf784 Bug 1027, SMJS: make null mean "none" in elinks.keymaps
elinks.keymaps.main["/"] = null;
used to crash ELinks with a segfault in JS_ObjectIsFunction.
Fix that by recognizing JSVAL_NULL explicitly and treating it as "none".
Likewise, if keymap_get_property would return "none" to ECMAScript,
return JSVAL_NULL instead.
2008-07-11 17:08:35 +03:00
Kalle Olavi Niemitalo
8ee5e8c4a1 Bug 951: Revert "Garbage-collect SMJS objects before flushing caches."
This reverts commit c33d195ff4.
ELinks no longer needs to collect garbage in this situation
because it can now free cache entries even if the corresponding
SMJS objects remain.
2008-07-08 15:21:07 +03:00
Kalle Olavi Niemitalo
06c39a8ac4 Bug 951: Lock the cache entry while the hook runs. 2008-07-08 15:20:38 +03:00
Kalle Olavi Niemitalo
314a41588c Bug 951: weaken pointer from JSObject to cache_entry
The SpiderMonkey scripting module handles the "pre-format-html" event
by constructing a JSObject for the struct cache_entry and then calling
elinks.preformat_html(cache_entry, view_state) if such a function
exists.  The problem with this was that each such JSObject kept the
struct cache_entry locked until SpiderMonkey garbage-collected the
JSObject, even if the user had not defined an elinks.preformat_html
function and the JSObject was thus never needed at all.  To work
around that, the SpiderMonkey scripting module ran a garbage
collection whenever the user told ELinks to flush caches.

Remove the SpiderMonkey scripting module's use of object_lock and
object_unlock on struct cache_entry, and instead make the pointers
weak so that ELinks can free the cache_entry whenever it wants even if
a JSObject is pointing to it.  Each cache_entry now has a pointer back
to the JSObject; done_cache_entry calls smjs_detach_cache_entry_object,
which follows the pointer and detaches the cache_entry and the JSObject
from each other.

This commit does not yet remove the workaround mentioned above.
2008-07-07 23:24:43 +03:00
Kalle Olavi Niemitalo
ed17eb18df Bug 1016: Avoid JSFunctionSpec.
(cherry picked from commit 6bfaa7ca8d)

Conflicts:

	src/ecmascript/spidermonkey/form.c
	src/scripting/smjs/elinks_object.c
2008-06-17 00:25:59 +03:00
Kalle Olavi Niemitalo
a833d6d093 Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
Kalle Olavi Niemitalo
5e4a565603 Bug 1014: Fix incompatible pointer type in init_perl.
The second argument of PERL_SYS_INIT3 should be a char ***
but ELinks was giving it a char *(*)[1].

Also, enlarge the array to 2 elements, so that my_argv[my_argc] == NULL
like in main().  PERL_SYS_INIT3 seems hardly documented at all so I'm
not sure this is necessary, but it shouldn't hurt.
(cherry picked from commit 8d0677e76a)
2008-06-08 20:40:17 +03:00
Kalle Olavi Niemitalo
e667c43cd3 Bug 975: Fix int/size_t pointer type mismatch.
On machines where sizeof(size_t) > sizeof(int), this could corrupt the stack.
I think -Wno-pointer-sign added by configure hid this bug until now.
STRLEN is correct in Perl 5.6.0 and later, perhaps earlier too.
2007-11-10 19:28:01 +02:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
Kalle Olavi Niemitalo
6117f8a164 Name the exec_on_terminal() fg values. 2007-07-15 23:46:18 +03:00
Kalle Olavi Niemitalo
9743729cb1 SMJS: comment changes 2007-05-27 18:36:31 +03:00
Kalle Olavi Niemitalo
99f648b911 SMJS: Use JS_GetInstancePrivate where applicable.
This is a further precaution against reading a pointer from the wrong
type of object.  All of the JS_GetPrivate calls were already protected
with JS_InstanceOf checks if assertions are enabled, and many of them
also if assertions are not enabled.
2007-05-27 18:32:53 +03:00
Kalle Olavi Niemitalo
699663614a l_pipe_read: Don't leak the old block if mem_realloc fails. 2007-04-19 00:15:30 +03:00
Kalle Olavi Niemitalo
c645ed7485 Bug 945: Don't crash if the error message is not a string. 2007-04-15 02:20:41 +03:00
Kalle Olavi Niemitalo
48fd725c40 report_scripting_error: Look up module names with gettext. 2007-03-22 07:55:59 +02:00
Kalle Olavi Niemitalo
2558688456 Merge with http://elinks.cz/elinks.git 2007-03-22 07:48:49 +02:00
Laurent MONIN
90980a944e Mark all module names for translation and include needed header files. 2007-03-21 11:01:06 +01:00
Kalle Olavi Niemitalo
8c66e34323 intl: Fork get_cp_config_name off get_cp_mime_name.
This may help with bug 914 but I'm not testing that yet.
2007-03-20 20:41:05 +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
a05f7203cd Cast variadic arguments of getml 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:41:17 +02:00
Kalle Olavi Niemitalo
2b7788614f Type-check button arguments of msg_box.
Don't cast function pointers; calling functions via pointers of
incorrect types is not guaranteed to work.  Instead, define the
functions with the desired types, and make them cast the incoming
parameters.  Or define wrapper functions if the return types don't
match.

really_exit_prog wasn't being used outside src/dialogs/menu.c,
and I had to change its parameter type, so it's now static.
2007-03-10 23:50:56 +02:00
Kalle Olavi Niemitalo
0484f68b69 get_color_string: Return a pointer to const. 2007-01-28 00:52:21 +02:00
Kalle Olavi Niemitalo
233c59b9c2 l_set_option: Correct the args to option_changed().
Should have been in commit 2e5488ba3d.
2007-01-27 22:31:47 +02:00
Kalle Olavi Niemitalo
ba5f683dcb l_set_option: Use option_changed() instead of inline code. 2007-01-27 18:41:57 +02:00
Kalle Olavi Niemitalo
01fdf6c4d3 Bug 923: Added comments about potential time_t truncation.
And removed Miciah's portability question; MSVC++2005 already
has a time_t longer than long, so assuming that time_t is long
is surely not portable.
2007-01-13 15:26:21 +02:00
M. Levinson
26473f72f5 Python: Give goto_url_hook only one argument, like follow_url_hook.
On Dec 31, 2006, at 11:30am, Kalle Olavi Niemitalo writes:
>src/scripting/python/hooks.c (script_hook_url) calls hooks as
>goto_url_hook(new-url, current-url) and follow_url_hook(new-url).
>It has a comment saying that the current-url parameter exists
>only for compatibility and that the script can instead use
>elinks.current_url().  However, the current-url parameter was
>added in commit 87e27b9b3e and is
>not in ELinks 0.11.2, so any compatibility problems would only
>hit people who have been using 0.12.GIT snapshots.  Can we remove
>the second parameter now before releasing ELinks 0.12pre1?

The decision isn't up to me, but I think this is a good idea. Here's a
patch that would update the documentation and hooks.py, as well as hooks.c.

FYI, if this patch is applied then anyone who's still trying to use a
goto_url_hook that expects a second argument will get a "Browser scripting
error" dialog box that says:

	An error occurred while running a Python script:

	TypeError: goto_url_hook() takes exactly 2 arguments (1 given)
2007-01-01 17:45:36 +02:00
M. Levinson
e978853f63 Use document->cached in the Python scripting backend
As commit 7db8abf6e7 does for Lua
and the document info box, change the Python scripting backend's
current_document and current_header APIs to use document->cached
instead of find_in_cached so the currently displayed document
will be used rather than the latest version of the document.
2006-12-30 11:20:30 +00:00
M. Levinson
f7be8f7dfc Python: Don't complain if hooks.py does not exist.
Nor if -no-home prevents it from being found.

This patch is from bug 880, comment 5, attachment 305.
http://bugzilla.elinks.cz/show_bug.cgi?id=880#c5
2006-12-17 16:10:55 +02:00
M. Levinson
b6d14e025c Reset PyObject pointers to NULL when deinitializing.
cleanup_python and python_done_keybinding_interface called by it
now reset the PyObject *python_hooks, *keybindings variables back
to NULL when they release the references.  Without this change,
dangling pointers left in those variables could cause problems
if the Python scripting module were deinitialized and reinitialized.
It looks like such reinitialization is not currently possible though,
because enhancement request 73 (plugins support) has not yet been
implemented.
2006-12-13 18:33:54 +02:00
Miciah Dashiel Butler Masters
7db8abf6e7 Use document->cached in document_info_dialog and l_current_document
Now the currently displayed version of the current document,
rather than the latest version of the current document, will be used
for the document info box and the current_document() Lua function.
2006-12-10 03:14:36 +00:00
Kalle Olavi Niemitalo
432969a3a9 Bug 788: Define n_a variables if the POPpx macro of Perl needs them.
The configure script checks whether it is possible to compile a use of
POPpx without an n_a variable; if not, the source code then defines
those variables.  This is slower than including Perl's patchlevel.h
and comparing the version numbers to 5.8.8 but I expect this to be
more reliable as well.
2006-12-09 20:26:06 +02:00
M. Levinson
78bd416dc0 Bug 880: Prevent SIGSEGV in init_python when -no-home is used.
Before this patch, init_python would crash trying to set up elinks.home
at the Python side.  Now it uses None as the value in that case.
Also, init_python no longer adds "(null)" to $PYTHONPATH.
2006-12-08 19:59:41 +02:00
Kalle Olavi Niemitalo
d731fe2db0 Renumber all tinyids of SMJS properties to negative integers.
This change does not fix any bug, but the SMJS builtin classes use
negative tinyids already, so I presume this is the preferred practice.
At least it means the tinyids won't have to be renumbered later if
some of these objects are changed to behave as arrays.
2006-12-06 23:09:14 +02:00
Thomas Adam
d90702aeca Fix crashes and problems with rerendering when preformatting with Ruby
This reverts baf7b0e91da55376968e99f42bf62f7091a2a4b4:

	Fix segfaults caused by ruby scripting (gentoo bug #121247).

which reverted 5145ae266a1a541fc26df046af65f7800c6e9b91:

	Change the Python, Ruby, and SEE hooks for pre-format-html to work
	properly now that they are given a non-NUL-terminated string.

and also makes the Ruby hooks interface generally use rb_str_new(str, len)
in favor of rb_str_new2(str) to avoid relying on NUL-terminated being
handled correctly by Ruby. Also, it was wrong for the preformat hook which
is not always handed a NUL-terminated string. Finally, the gentoo bug
(http://bugs.gentoo.org/show_bug.cgi?id=121247) is currently reopened which
suggests that the previous fix was not correct.
2006-12-04 23:45:40 +01:00
Kalle Olavi Niemitalo
7894e30ace Bug 870: Don't panic if an SMJS property ID is unrecognized.
If ECMAScript code does obj[42], then the getProperty or setProperty
function of the JSClass of obj gets 42 as the property ID and must not
treat that as an internal error.
2006-12-03 12:07:07 +02:00
Kalle Olavi Niemitalo
aa410301f1 Bug 846: {get,set}Property check JS_InstanceOf without asserting.
The getProperty and setProperty functions of a JSClass must not assume
that the obj parameter points to an instance of that class.  It might
instead point to another object that merely has an instance of the
class in its prototype chain.  Thus, do not assert that JS_InstanceOf
returns true there.  Instead, run the check even with CONFIG_FASTMEM,
and just return JS_FALSE if it fails.
2006-12-03 11:17:48 +02:00
Kalle Olavi Niemitalo
39e97921f7 smjs_action_fn_callback: Assert the type of the correct object.
We're calling JS_GetPrivate(ctx, fn_obj), so the JS_InstanceOf assertion
must also use fn_obj, rather than obj.

Reported by Miciah.
2006-12-02 01:15:07 +02:00
Kalle Olavi Niemitalo
d9604331b8 SMJS: keymap_get_property: fix build error
Fix an error in the order of variable initialisation that was introduced
in commit bbf0d478e9.
2006-11-26 15:37:24 +02:00
Miciah Dashiel Butler Masters
8617d69872 SMJS: keymap_set_property: fix build error
Fix an error in the order of variable initialisation that was introduced
in commit bbf0d478e9.
2006-11-26 12:43:45 +00:00
Kalle Olavi Niemitalo
15ea2b9b50 Bug 846: Add two more comments about how SMJS calls functions.
They should have been in commit 670ad939c3.
The corresponding commit fcebd6d111 in the
elinks-0.11 branch does include them.
2006-11-25 23:25:52 +02:00
Kalle Olavi Niemitalo
47dce0922b Bug 846: Add plenty of JS_InstanceOf assertions and checks. 2006-11-25 16:09:38 +02:00
Kalle Olavi Niemitalo
bbf0d478e9 Bug 846: Separate JS_GetParent & JS_GetPrivate calls from initializations.
This will allow the types of objects to be checked before those calls.
2006-11-25 15:55:25 +02:00
Kalle Olavi Niemitalo
356678dd80 Bug 846: Document the JSClass assumed in each JS_{Set,Get}Private call. 2006-11-25 14:52:58 +02:00
Kalle Olavi Niemitalo
670ad939c3 Bug 846: Comments on the relations between JSClasses and functions. 2006-11-25 13:36:28 +02:00
Kalle Olavi Niemitalo
d6ea143f36 Bug 846: Document the private data in each SMJS class. 2006-11-25 13:19:35 +02:00
Petr Baudis
5af21a8d29 Fix perl pre_format_html hook wrt. binary files
When trying to view a binary file, this hook would cut it at the first
'\0'.
2006-11-03 19:22:58 +01:00
M. Levinson
50b6a61f31 Another fix for Python backend. 2006-10-22 18:45:45 +02:00
Witold Filipczyk
68913c8c7d Oh, sorry. I forgot about these. 2006-10-19 16:20:26 +02:00
M. Levinson
ebadc9bf9e Additional functionality for Python backend. 2006-10-19 15:21:39 +02:00
Kalle Olavi Niemitalo
c33d195ff4 Garbage-collect SMJS objects before flushing caches. 2006-09-25 23:43:32 +03:00
Kalle Olavi Niemitalo
359b131c6b Bug 810: Add a few comments pointing to the bug. 2006-09-24 00:21:03 +03:00
Kalle Olavi Niemitalo
2eeb14f95c Key name strings are const in read_key() and in its (indirect) callers. 2006-08-13 14:44:01 +03:00
Witold Filipczyk
6c8f532692 Fixes to the Python scripting by M. Levinson 2006-07-24 18:52:25 +02:00
Petr Baudis
250669b0e9 Merge with /srv/git/elinks.git 2006-07-13 02:49:41 +02:00
Witold Filipczyk
d1e5e0b7d2 Introduced STRING_DIR_SEP for better portability 2006-07-02 08:44:52 +02:00
Petr Baudis
0f8ee055db Fix compilation of perl hooks
It complains here that n_a might be used uninitialized and POPpx doesn't
set anything like it.
2006-06-30 00:54:06 +02:00
Laurent MONIN
bd38ed5b17 LUA: use long instead of int with OPT_LONG. 2006-06-26 17:55:42 +02:00
Laurent MONIN
2454ceffb7 config/options: use struct option big_number field instead of number
field where OPT_LONG is used.
2006-06-26 17:49:59 +02:00
Miciah Dashiel Butler Masters
52bd1ea01b SMJS: Fix crash with elinks.vs and no document loaded
Make sure that there really is a view_state before creating a wrapper
object with a bad pointer for it.
2006-06-11 02:33:41 +00:00
Miciah Dashiel Butler Masters
5899c281ce SMJS: bookmark_folder_get_property: Reflow some code. 2006-06-11 00:37:31 +00:00
Miciah Dashiel Butler Masters
1a3b718f98 SMJS: bookmark_folder_get_property: Reflow some code.
Set the return value to JSVAL_NULL up front instead of in every error
handling block.
2006-06-11 00:33:19 +00:00
Miciah Dashiel Butler Masters
ec1ab9fbe9 SMJS: Better handle when the C code tries to call a badly defined method
Before, when one assigned a value other than a function to
elinks.preformat_html, elinks.goto_url_hook, or elinks.follow_url_hook,
an assertion failure was triggered (and probably worse happened in
non-DEBUG builds). Now just fail silently.
2006-06-10 18:11:37 +00:00
Miciah Dashiel Butler Masters
355cbebaad SMJS: Add elinks.vs
E.g., elinks.vs.plain = 0; elinks.action.rerender(); forces ELinks to
rerender the current document as HTML.
2006-06-10 18:11:37 +00:00
Miciah Dashiel Butler Masters
1df39d5068 SMJS: Add elinks.action
E.g., elinks.action.link_follow(20) follows the twentieth link.
The argument is optional.
2006-06-10 18:11:37 +00:00
Jonas Fonseca
4433438f92 SMJS: Add execute method to the elinks object
It is similar to lua's execute and let's you run a command line in
'non-blocking' mode. Example:

	elinks.keymaps.main["F"] = function () {
		elinks.execute("firefox " + elinks.location);
	};
2006-06-06 16:30:24 +02:00
Miciah Dashiel Butler Masters
6ab4eee456 SMJS: Introduce elinks.globhist.
Items can be accessed via elinks.globhist["http://www.foo.net/"]. The
resulting object has title, url, and last_visit properties. last_visit
is the seconds since the epoch. See comments in the code for why I don't
provide a nicer interface for last_visit.
2006-05-03 13:52:58 +00:00
Miciah Dashiel Butler Masters
e27596c5dc SMJS: Add the elinks.load_uri(uri, callback) interface.
|callback| will be applied to the cache object when the download of
|uri| completes.
2006-04-30 04:22:11 +00:00
Witold Filipczyk
4f15dd9a2d Python.h must be included as last to satisfy tcc, but Python redefines
_POSIX_C_SOURCE macro, so #undef here to avoid warnings
2006-04-06 00:52:17 +02:00
Kalle Olavi Niemitalo
3dcb386b81 Merge with http://elinks.cz/elinks.git 2006-02-12 23:42:05 +02:00
Miciah Dashiel Butler Masters
8ce8740359 SMJS: Return JS_FALSE if one specifies an invalid type of action for
a keybinding.
2006-02-12 21:20:36 +00:00
Kalle Olavi Niemitalo
e7dfe6d5da Merge with http://elinks.cz/elinks.git 2006-02-12 23:15:59 +02:00
Miciah Dashiel Butler Masters
3dfa237982 Include bfu/msgbox.h for info_box.
This is clearly unnecessary as the code already builds, but it is more
proper to include the header file explicitely.
2006-02-12 21:07:15 +00:00
Miciah Dashiel Butler Masters
3bd14d8392 SMJS: elinks.alert: drop the extra 'error' text
Use info_box directly instead of via report_scripting_error by way of
alert_smjs_error, thereby avoiding the addition of extra text saying
that an error has occurred.
2006-02-12 21:05:35 +00:00
Miciah Dashiel Butler Masters
d5fe12b5f4 Merge script_hook_goto_url and script_hook_follow_url
Combine the two into the new script_hook_url and use the hook data field
to store the name of the appropriate ECMAScript routine.
2006-02-12 20:55:25 +00:00
Kalle Olavi Niemitalo
37bea9cfdb Merge with /home/kalle/src/MIRROR/elinks/.git 2006-02-11 09:39:41 +02:00
Laurent MONIN
baf7b0e91d Fix segfaults caused by ruby scripting (gentoo bug #121247). Backported
from gentoo portage tree.
2006-02-10 21:28:50 +01:00
Kalle Olavi Niemitalo
b1f8756c59 Merge with http://elinks.cz/elinks.git 2006-02-05 17:48:43 +02:00
87e27b9b3e goto_url_hook takes 2 params not 1. Some dumbprefixes defined in hooks.py 2006-01-29 14:58:03 +01:00
8cc828bf7c Compilation fix 2006-01-29 12:28:05 +01:00