diff options
author | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-29 14:37:58 +0200 |
---|---|---|
committer | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-29 14:37:58 +0200 |
commit | f4344aabd33e1f82093c25c22c224ca286112b41 (patch) | |
tree | 902af334cf07b757858994060db8e736b6ba660a /examples | |
parent | 40d851f42fad2d26414df39e680c5ce52f2d71a9 (diff) |
Support for <input type='SEARCH'>
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/data/scripts/formfiller.sh | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 86bb3bf..0b0d7e0 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -27,8 +27,6 @@ # or leave it blank, even without spaces # otherwise it will be considered as checked # -# All lines starting with '>' are ignored as comments -# # user arg 1: # edit: force editing the file (falls back to new if not found) # new: start with a new file. @@ -110,7 +108,7 @@ dumpFunction="function dump() { \ var input; \ while(input=xp_res.iterateNext()) { \ var type=(input.type?input.type:text); \ - if(type == 'text' || type == 'password') { \ + if(type == 'text' || type == 'password' || type == 'search') { \ rv += input.name + '(' + type + '):' + input.value + '\\\\n'; \ } \ else if(type == 'checkbox' || type == 'radio') { \ @@ -135,7 +133,7 @@ insertFunction="function insert(fname, ftype, fvalue, fchecked) { \ } \ for(j=0;j<allFrames.length;j=j+1) { \ try { \ - if(ftype == 'text' || ftype == 'password' || ftype == 'textarea') { \ + if(ftype == 'text' || ftype == 'password' || ftype == 'search' || ftype == 'textarea') { \ allFrames[j].document.getElementsByName(fname)[0].value = fvalue; \ } \ else if(ftype == 'checkbox') { \ @@ -168,12 +166,12 @@ then fields=`cat $keydir/$domain | \ sed -n "/^!profile=${option}/,/^!profile=/p" | \ sed '/^!profile=/d' | \ - sed 's/^\([^(]\+(\)\(radio\|checkbox\|text\|textarea\|password\)):/%{>\1\2):<}%/' | \ + sed 's/^\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):/%{>\1\2):<}%/' | \ sed 's/^\(.\+\)$/<{br}>\1/' | \ tr -d '\n' | \ - sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|textarea\|password\)):<}%/\\n\1\2):/g'` + sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g'` printf '%s\n' "${fields}" | \ - sed -n -e "s/\([^(]\+\)(\(password\|text\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ + sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' > $fifo printf '%s\n' "${fields}" | \ sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \ @@ -193,12 +191,12 @@ then sed '/^>/d' -i $tmpfile sed 's/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):\(off\|no\|false\|unchecked\|0\|$\)/\1{\2}(\3):0/I;s/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[^0]\+/\1{\2}(\3):1/I' -i $tmpfile fields=`cat $tmpfile | \ - sed 's/^\([^(]\+(\)\(radio\|checkbox\|text\|textarea\|password\)):/%{>\1\2):<}%/' | \ + sed 's/^\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):/%{>\1\2):<}%/' | \ sed 's/^\(.\+\)$/<{br}>\1/' | \ tr -d '\n' | \ - sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|textarea\|password\)):<}%/\\n\1\2):/g'` + sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g'` printf '%s\n' "${fields}" | \ - sed -n -e "s/\([^(]\+\)(\(password\|text\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ + sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' > $fifo printf '%s\n' "${fields}" | \ sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \ |