Browse Source

set script, jsConstruct_getElementsByTagName()

master
Odilitime 1 year ago
parent
commit
4abef5e395
1 changed files with 13 additions and 4 deletions
  1. 13
    4
      src/parsers/scripting/javascript/BrowserJS.h

+ 13
- 4
src/parsers/scripting/javascript/BrowserJS.h View File

@@ -7,22 +7,31 @@

#include <vector>

std::vector<std::string> getConstructs();
bool isConstruct(std::string construct);
js_internal_storage *executeConstruct(std::string functionName, std::string params, js_function &scope);

class BrowserJavaScript : public JavaScript {
public:
BrowserJavaScript() {
this->setUpRoot();
std::cout << "Setting up BrowserJS\n";
this->rootScope.script = this;
// we can modify rootScope...
}
void clear() {
JavaScript::clear();
std::cout << "ReSetting up BrowserJS\n";
this->rootScope.script = this;
}
DocumentComponent *document;
Window *window;
};

std::vector<std::string> getConstructs();
bool isConstruct(std::string construct);
js_internal_storage *executeConstruct(std::string functionName, std::string params, js_function &scope);
DocumentComponent *getDocumentFromScope(js_function &scope);

// construct handlers
js_internal_storage *jsConstruct_querySelector(std::string params, js_function &scope);
js_internal_storage *jsConstruct_addEventListener(std::string params, js_function &scope);
js_internal_storage *jsConstruct_getElementsByTagName(std::string params, js_function &scope);

#endif

Loading…
Cancel
Save