mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[document] document.cpp -> document.c
Moved some code to ecmascript-c.cpp.
This commit is contained in:
parent
a07f339fd1
commit
bfd3f01d35
@ -7,6 +7,6 @@ SUBDIRS-$(CONFIG_LIBDOM) += libdom
|
||||
|
||||
SUBDIRS = gemini html plain
|
||||
|
||||
OBJS = docdata.o document.obj format.o forms.o options.o refresh.o renderer.o
|
||||
OBJS = docdata.o document.o format.o forms.o options.o refresh.o renderer.o
|
||||
|
||||
include $(top_srcdir)/Makefile.lib
|
||||
|
@ -63,10 +63,7 @@
|
||||
#include "document/renderer.h"
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
#include "ecmascript/ecmascript.h"
|
||||
#endif
|
||||
#ifdef CONFIG_ECMASCRIPT_SMJS
|
||||
#include "ecmascript/spidermonkey.h"
|
||||
#include "ecmascript/ecmascript-c.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LIBDOM
|
||||
@ -435,15 +432,7 @@ done_document(struct document *document)
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS)
|
||||
free_ecmascript_string_list(&document->onload_snippets);
|
||||
free_uri_list(&document->ecmascript_imports);
|
||||
|
||||
{
|
||||
struct ecmascript_timeout *t;
|
||||
|
||||
foreach(t, document->timeouts) {
|
||||
kill_timer(&t->tid);
|
||||
done_string(&t->code);
|
||||
}
|
||||
}
|
||||
kill_ecmascript_timeouts(document);
|
||||
free_list(document->timeouts);
|
||||
mem_free_if(document->body_onkeypress);
|
||||
#endif
|
||||
@ -486,14 +475,7 @@ release_document(struct document *document)
|
||||
|
||||
if (document->refresh) kill_document_refresh(document->refresh);
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
{
|
||||
struct ecmascript_timeout *t;
|
||||
|
||||
foreach(t, document->timeouts) {
|
||||
kill_timer(&t->tid);
|
||||
done_string(&t->code);
|
||||
}
|
||||
}
|
||||
kill_ecmascript_timeouts(document);
|
||||
free_list(document->timeouts);
|
||||
#endif
|
||||
object_unlock(document);
|
@ -10,4 +10,4 @@ endif
|
||||
subdir('gemini')
|
||||
subdir('html')
|
||||
subdir('plain')
|
||||
srcs += files('docdata.c', 'document.cpp', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.c')
|
||||
srcs += files('docdata.c', 'document.c', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.c')
|
||||
|
@ -278,3 +278,14 @@ check_for_snippets(struct view_state *vs, struct document_options *options, stru
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
kill_ecmascript_timeouts(struct document *document)
|
||||
{
|
||||
struct ecmascript_timeout *t;
|
||||
|
||||
foreach(t, document->timeouts) {
|
||||
kill_timer(&t->tid);
|
||||
done_string(&t->code);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct document_options;
|
||||
struct docuemnt;
|
||||
struct document;
|
||||
struct session;
|
||||
struct uri;
|
||||
struct view_state;
|
||||
@ -20,6 +20,7 @@ void toggle_ecmascript(struct session *ses);
|
||||
* follows a link with this synstax. */
|
||||
void ecmascript_protocol_handler(struct session *ses, struct uri *uri);
|
||||
void check_for_snippets(struct view_state *vs, struct document_options *options, struct document *document);
|
||||
void kill_ecmascript_timeouts(struct document *document);
|
||||
|
||||
extern struct module ecmascript_module;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user