22 #ifndef EMBAJAXSCRIPTEDSPAN_H
23 #define EMBAJAXSCRIPTEDSPAN_H
54 _value = EmbAJAXBase::null_string;
56 _rec_buffer = rec_buffer;
57 _rec_buffer_size = rec_buffer_size;
59 void print()
const override {
62 "Object.defineProperty(spn, 'EmbAJAXValue', {\n"
63 " set: function(value) {\n"
64 " if (this.receiveValue) this.receiveValue(value);\n"
67 "spn.sendValue = function(value) {\n"
68 " doRequest(this.id, value);\n"
70 "spn.init=function() {\n",
75 "}</script></span>\n");
77 const char*
value(uint8_t which = EmbAJAXBase::Value)
const override {
78 if (which == EmbAJAXBase::Value)
return _value;
81 const char*
valueProperty(uint8_t which = EmbAJAXBase::Value)
const override {
82 if (which == EmbAJAXBase::Value)
return "EmbAJAXValue";
107 _driver->getArg(argname, _rec_buffer, _rec_buffer_size);
108 _value = _rec_buffer;
114 size_t _rec_buffer_size;
Abstract base class for modifiable elements.
Definition: EmbAJAX.h:296
virtual const char * value(uint8_t which=EmbAJAXBase::Value) const
Definition: EmbAJAX.h:309
virtual const char * valueProperty(uint8_t which=EmbAJAXBase::Value) const
Definition: EmbAJAX.h:324
A span element containing a custom javascript script, meant to creating custom dispays.
Definition: EmbAJAXScriptedSpan.h:43
void setValue(const char *value)
Definition: EmbAJAXScriptedSpan.h:100
void updateFromDriverArg(const char *argname) override
Definition: EmbAJAXScriptedSpan.h:106
const char * value(uint8_t which=EmbAJAXBase::Value) const override
Definition: EmbAJAXScriptedSpan.h:77
EmbAJAXScriptedSpan(const char *id, const char *script, char *rec_buffer=0, size_t rec_buffer_size=0)
Definition: EmbAJAXScriptedSpan.h:53
const char * valueProperty(uint8_t which=EmbAJAXBase::Value) const override
Definition: EmbAJAXScriptedSpan.h:81
#define PLAIN_STRING(X)
Definition: macro_definitions.h:54
#define HTML_QUOTED_STRING(X)
Definition: macro_definitions.h:49
#define JS_QUOTED_STRING(X)
Definition: macro_definitions.h:47