ELinks 0.18.0
Functions | Variables
ecmascript-c.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "elinks.h"
#include "js/libdom/dom.h"
#include "dialogs/status.h"
#include "document/document.h"
#include "document/libdom/doc.h"
#include "document/libdom/mapa.h"
#include "document/libdom/renderer2.h"
#include "document/view.h"
#include "js/ecmascript.h"
#include "js/ecmascript-c.h"
#include "intl/libintl.h"
#include "protocol/uri.h"
#include "session/session.h"
#include "session/task.h"
#include "terminal/event.h"
#include "util/conv.h"
#include "util/memory.h"
#include "util/string.h"
#include "viewer/text/form.h"
#include "viewer/text/view.h"
Include dependency graph for ecmascript-c.c:

Functions

int ecmascript_get_interpreter_count (void)
 
void toggle_ecmascript (struct session *ses)
 
void ecmascript_protocol_handler (struct session *ses, struct uri *uri)
 
static void add_snippets (struct ecmascript_interpreter *interpreter, struct ecmascript_string_list_item list *doc_snippets, struct ecmascript_string_list_item list *queued_snippets)
 
static void process_snippets (struct ecmascript_interpreter *interpreter, struct ecmascript_string_list_item list *snippets, struct ecmascript_string_list_item **current)
 
void check_for_snippets (struct view_state *vs, struct document_options *options, struct document *document)
 
void ecmascript_put_interpreter (struct ecmascript_interpreter *interpreter)
 
void check_events_for_element (struct ecmascript_interpreter *ecmascript, dom_node *element, struct term_event *ev)
 
void ecmascript_reset_state (struct view_state *vs)
 
int ecmascript_eval_boolback (struct ecmascript_interpreter *interpreter, struct string *code)
 
int ecmascript_current_link_evhook (struct document_view *doc_view, enum script_event_hook_type type)
 
void ecmascript_detach_form_view (struct form_view *fv)
 
void ecmascript_detach_form_state (struct form_state *fs)
 
void ecmascript_moved_form_state (struct form_state *fs)
 
void * walk_tree_query (dom_node *node, const char *selector, int depth)
 
void walk_tree_query_append (dom_node *node, const char *selector, int depth, struct selector_node list *result_list)
 
static bool node_has_classes (struct dom_node *node, void *ctx)
 
static struct class_string list * prepare_strings (const char *text)
 
void free_el_dom_collection (void *ctx)
 
static dom_exception el_dom_html_collection_initialise (dom_html_document *doc, struct el_dom_html_collection *col, dom_node *root, dom_callback_is_in_collection ic, void *ctx)
 Intialiase a dom_html_collection.
 
static dom_exception el_dom_html_collection_create (dom_html_document *doc, dom_node *root, dom_callback_is_in_collection ic, void *ctx, struct el_dom_html_collection **col)
 
void * get_elements_by_class_name (dom_html_document *doc, dom_node *node, const char *classes)
 
void camel_to_html (const char *text, struct string *result)
 
static bool el_dump_node_element_attribute (struct string *buf, dom_node *node)
 
static bool el_dump_element (struct string *buf, dom_node *node, bool toSortAttrs)
 
void ecmascript_walk_tree (struct string *buf, void *nod, bool start, bool toSortAttrs)
 

Variables

int interpreter_count
 
int ecmascript_enabled
 

Function Documentation

◆ add_snippets()

static void add_snippets ( struct ecmascript_interpreter *  interpreter,
struct ecmascript_string_list_item list *  doc_snippets,
struct ecmascript_string_list_item list *  queued_snippets 
)
static

◆ camel_to_html()

void camel_to_html ( const char *  text,
struct string *  result 
)

◆ check_events_for_element()

void check_events_for_element ( struct ecmascript_interpreter *  ecmascript,
dom_node *  element,
struct term_event *  ev 
)

◆ check_for_snippets()

void check_for_snippets ( struct view_state *  vs,
struct document_options *  options,
struct document *  document 
)

◆ ecmascript_current_link_evhook()

int ecmascript_current_link_evhook ( struct document_view *  doc_view,
enum script_event_hook_type  type 
)

◆ ecmascript_detach_form_state()

void ecmascript_detach_form_state ( struct form_state *  fs)

◆ ecmascript_detach_form_view()

void ecmascript_detach_form_view ( struct form_view *  fv)

◆ ecmascript_eval_boolback()

int ecmascript_eval_boolback ( struct ecmascript_interpreter *  interpreter,
struct string *  code 
)

◆ ecmascript_get_interpreter_count()

int ecmascript_get_interpreter_count ( void  )

◆ ecmascript_moved_form_state()

void ecmascript_moved_form_state ( struct form_state *  fs)

◆ ecmascript_protocol_handler()

void ecmascript_protocol_handler ( struct session *  ses,
struct uri *  uri 
)

◆ ecmascript_put_interpreter()

void ecmascript_put_interpreter ( struct ecmascript_interpreter *  interpreter)

◆ ecmascript_reset_state()

void ecmascript_reset_state ( struct view_state *  vs)

◆ ecmascript_walk_tree()

void ecmascript_walk_tree ( struct string *  buf,
void *  nod,
bool  start,
bool  toSortAttrs 
)

◆ el_dom_html_collection_create()

static dom_exception el_dom_html_collection_create ( dom_html_document *  doc,
dom_node *  root,
dom_callback_is_in_collection  ic,
void *  ctx,
struct el_dom_html_collection **  col 
)
static

◆ el_dom_html_collection_initialise()

static dom_exception el_dom_html_collection_initialise ( dom_html_document *  doc,
struct el_dom_html_collection *  col,
dom_node *  root,
dom_callback_is_in_collection  ic,
void *  ctx 
)
static

Intialiase a dom_html_collection.

Parameters
docThe document
colThe collection object to be initialised
rootThe root element of the collection
icThe callback function used to determin whether certain node beint32_ts to the collection
Returns
DOM_NO_ERR on success.

◆ el_dump_element()

static bool el_dump_element ( struct string *  buf,
dom_node *  node,
bool  toSortAttrs 
)
static

◆ el_dump_node_element_attribute()

static bool el_dump_node_element_attribute ( struct string *  buf,
dom_node *  node 
)
static

◆ free_el_dom_collection()

void free_el_dom_collection ( void *  ctx)

◆ get_elements_by_class_name()

void * get_elements_by_class_name ( dom_html_document *  doc,
dom_node *  node,
const char *  classes 
)

◆ node_has_classes()

static bool node_has_classes ( struct dom_node *  node,
void *  ctx 
)
static

◆ prepare_strings()

static struct class_string list * prepare_strings ( const char *  text)
static

◆ process_snippets()

static void process_snippets ( struct ecmascript_interpreter *  interpreter,
struct ecmascript_string_list_item list *  snippets,
struct ecmascript_string_list_item **  current 
)
static

◆ toggle_ecmascript()

void toggle_ecmascript ( struct session *  ses)

◆ walk_tree_query()

void * walk_tree_query ( dom_node *  node,
const char *  selector,
int  depth 
)

◆ walk_tree_query_append()

void walk_tree_query_append ( dom_node *  node,
const char *  selector,
int  depth,
struct selector_node list *  result_list 
)

Variable Documentation

◆ ecmascript_enabled

int ecmascript_enabled
extern

◆ interpreter_count

int interpreter_count
extern