summaryrefslogtreecommitdiff
path: root/extensions/formfiller
diff options
context:
space:
mode:
authorportix <none@none>2012-09-25 11:28:42 +0200
committerportix <none@none>2012-09-25 11:28:42 +0200
commit3766f55ac54b228782f82e981416cc06f9b30bb8 (patch)
tree59a9556d6e3c24176f7525747bc6ed4bde772340 /extensions/formfiller
parentf0a3b9d7f5c3ed6cfc067ae7da8c35af334a7b47 (diff)
downloaddwb-3766f55ac54b228782f82e981416cc06f9b30bb8.zip
Optional argument for inject function
Diffstat (limited to 'extensions/formfiller')
-rw-r--r--extensions/formfiller10
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/formfiller b/extensions/formfiller
index 2782712d..2c25d9a0 100644
--- a/extensions/formfiller
+++ b/extensions/formfiller
@@ -175,8 +175,9 @@ var injectGetForm = function () {//{{{
return ret;
};//}}}
-var injectFillForm = function (data) {//{{{
+var injectFillForm = function () {//{{{
var key, i, forms, form = null, input;
+ var data = arguments[0];
function fillInput(input, key) {
var value = data.form[key].value;
@@ -216,12 +217,11 @@ var injectFillForm = function (data) {//{{{
return null;
return setValues(form);
}
-
if (data.hasIds) {
form = fillElementsById();
}
- if (form === null && data.id) {
- form = fillFormById();
+ if (form === null && data.id !== undefined && data.id !== null) {
+ form = fillFormById();
}
if (form === null) {
forms = document.forms;
@@ -388,7 +388,7 @@ function fillForm() {//{{{
for (i=0; i<frames.length; i++) {
host = frames[i].host;
if (data[host]) {
- frames[i].inject("(" + String(injectFillForm) + ")(" + JSON.stringify(data[host]) + ")");
+ frames[i].inject(util.getBody(injectFillForm), data[host]);
}
}
if (!config.keepPassword) {