2011-02-25 23:39:29 -05:00
|
|
|
#include "Node.h"
|
|
|
|
#include "WebPage.h"
|
2012-04-04 18:18:17 -04:00
|
|
|
#include "WebPageManager.h"
|
2013-01-20 18:57:04 -05:00
|
|
|
#include "InvocationResult.h"
|
2011-02-25 23:39:29 -05:00
|
|
|
|
2013-02-25 14:41:37 -05:00
|
|
|
Node::Node(WebPageManager *manager, QStringList &arguments, QObject *parent) : JavascriptCommand(manager, arguments, parent) {
|
2011-02-25 23:39:29 -05:00
|
|
|
}
|
|
|
|
|
2012-03-16 19:58:58 -04:00
|
|
|
void Node::start() {
|
|
|
|
QStringList functionArguments(arguments());
|
2011-02-25 23:39:29 -05:00
|
|
|
QString functionName = functionArguments.takeFirst();
|
2013-12-06 10:43:17 -05:00
|
|
|
QString allowUnattached = functionArguments.takeFirst();
|
|
|
|
InvocationResult result = page()->invokeCapybaraFunction(functionName, allowUnattached == "true", functionArguments);
|
2013-02-25 14:41:37 -05:00
|
|
|
finish(&result);
|
2011-02-25 23:39:29 -05:00
|
|
|
}
|
|
|
|
|
2012-06-29 12:14:22 -04:00
|
|
|
QString Node::toString() const {
|
|
|
|
QStringList functionArguments(arguments());
|
|
|
|
return QString("Node.") + functionArguments.takeFirst();
|
|
|
|
}
|