mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[js] test commit. Scroll version 3
This commit is contained in:
parent
8be72ca243
commit
c3330e4452
@ -20,6 +20,7 @@
|
|||||||
#include "dialogs/menu.h"
|
#include "dialogs/menu.h"
|
||||||
#include "dialogs/status.h"
|
#include "dialogs/status.h"
|
||||||
#include "document/html/frames.h"
|
#include "document/html/frames.h"
|
||||||
|
#include "document/xml/renderer.h"
|
||||||
#include "document/document.h"
|
#include "document/document.h"
|
||||||
#include "document/forms.h"
|
#include "document/forms.h"
|
||||||
#include "document/renderer.h"
|
#include "document/renderer.h"
|
||||||
@ -443,8 +444,7 @@ delayed_reload(void *data)
|
|||||||
struct delayed_rel *rel = data;
|
struct delayed_rel *rel = data;
|
||||||
|
|
||||||
assert(rel);
|
assert(rel);
|
||||||
doc_rerender_after_document_update(rel->ses);
|
render_source_document_cxx(rel->cached, rel->document, NULL);
|
||||||
free_document(rel->doc);
|
|
||||||
mem_free(rel);
|
mem_free(rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,29 +460,14 @@ check_for_rerender(struct ecmascript_interpreter *interpreter, const char* text)
|
|||||||
|
|
||||||
//fprintf(stderr, "%s\n", text);
|
//fprintf(stderr, "%s\n", text);
|
||||||
|
|
||||||
if (document->dom && f && f->length) {
|
if (document->dom) {
|
||||||
xmlpp::Document *docu = (xmlpp::Document *)document->dom;
|
|
||||||
std::string doc1_string = docu->write_to_string_formatted();
|
|
||||||
//delete docu;
|
|
||||||
document->dom = NULL;
|
|
||||||
|
|
||||||
size_t fd_len=f->length;
|
|
||||||
delete_entry_content(cached);
|
|
||||||
/* This is very ugly, indeed. And Yes fd_len isn't
|
|
||||||
* logically correct. But using nu_len will cause
|
|
||||||
* the document to render improperly.
|
|
||||||
* TBD: somehow better rerender the document
|
|
||||||
* now it's places on the session level in doc_loading_callback */
|
|
||||||
int ret = add_fragment(cached, 0, doc1_string.c_str(), doc1_string.size());
|
|
||||||
normalize_cache_entry(cached, doc1_string.size());
|
|
||||||
document->ecmascript_counter++;
|
|
||||||
interpreter->changed = false;
|
interpreter->changed = false;
|
||||||
|
|
||||||
struct delayed_rel *rel = mem_calloc(1, sizeof(*rel));
|
struct delayed_rel *rel = mem_calloc(1, sizeof(*rel));
|
||||||
|
|
||||||
if (rel) {
|
if (rel) {
|
||||||
rel->ses = ses;
|
rel->cached = cached;
|
||||||
rel->doc = docu;
|
rel->document = document;
|
||||||
register_bottom_half(delayed_reload, rel);
|
register_bottom_half(delayed_reload, rel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct cache_entry;
|
||||||
|
struct document;
|
||||||
struct document_view;
|
struct document_view;
|
||||||
struct link;
|
struct link;
|
||||||
struct location;
|
struct location;
|
||||||
@ -32,8 +34,8 @@ struct delayed_open {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct delayed_rel {
|
struct delayed_rel {
|
||||||
struct session *ses;
|
struct cache_entry *cached;
|
||||||
void *doc;
|
struct document *document;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum remote_session_flags {
|
enum remote_session_flags {
|
||||||
|
17
test/ecmascript/scroll3.html
Normal file
17
test/ecmascript/scroll3.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
var tekst = 'ELinks scroll innerHTML part 3. 11.06.2021 EURO ';
|
||||||
|
function scrollText() {
|
||||||
|
var znak = tekst.charAt(0);
|
||||||
|
tekst = tekst.substring(1, tekst.length) + znak;
|
||||||
|
return tekst;
|
||||||
|
}
|
||||||
|
function scroll() {
|
||||||
|
document.getElementById('s').innerHTML = scrollText();
|
||||||
|
setTimeout(scroll, 1000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="scroll()">
|
||||||
|
<div id="s"></div>
|
||||||
|
</body>
|
Loading…
Reference in New Issue
Block a user