From 433a14e4d7089b4d47c9d6ab2867aeb5545ee0f9 Mon Sep 17 00:00:00 2001 From: Pawel Tomak Date: Tue, 15 Dec 2009 11:35:22 +0100 Subject: first commit --- README | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 02d0c07fea020601ad1865415158e3074ae07535 Mon Sep 17 00:00:00 2001 From: Pawel Tomak Date: Tue, 15 Dec 2009 11:58:20 +0100 Subject: README --- README | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'README') diff --git a/README b/README index e69de29..b96a003 100644 --- a/README +++ b/README @@ -0,0 +1,25 @@ +Copy the eFormFiller.sh to $XDG_DATA_HOME/uzbl/scripts/ +In the Uzbl config file add bindings(for example): + + set formfiller = spawn @scripts_dir/eFormFiller + @bind za = @{eFormFiller}.sh add + @bind ze = @{eFormFiller}.sh edit + @bind zn = @{eFormFiller}.sh new + @bind zl = @{eFormFiller}.sh load + +scripts_dir is set by default in uzbl config + +If NEW action is taken, then the script will generate +new file with formfields for current domain or will +overrite existing one. + +EDIT action will call an editor (configure it in the script) +with curent domain profiles + +ADD action add another profile to current domain. Remember to name +the profiles, by default the have a name with random numbers + +LOAD will load formfields or if there is more then one profile, it will +call dmenu first to choose the profile you want to fill in the form + +Enjoy -- cgit v1.2.3 From 9c69ee4e6f9a320a525eb8f968c017bdb1a5fd11 Mon Sep 17 00:00:00 2001 From: Pawel Tomak Date: Tue, 15 Dec 2009 12:13:46 +0100 Subject: README fixes --- README | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'README') diff --git a/README b/README index b96a003..8ec6298 100644 --- a/README +++ b/README @@ -1,11 +1,13 @@ Copy the eFormFiller.sh to $XDG_DATA_HOME/uzbl/scripts/ In the Uzbl config file add bindings(for example): - set formfiller = spawn @scripts_dir/eFormFiller - @bind za = @{eFormFiller}.sh add - @bind ze = @{eFormFiller}.sh edit - @bind zn = @{eFormFiller}.sh new - @bind zl = @{eFormFiller}.sh load + + set eFormFiller = spawn @scripts_dir/eFormFiller.sh + @bind za = @eFormFiller add + @bind ze = @eFormFiller edit + @bind zn = @eFormFiller new + @bind zl = @eFormFiller load + scripts_dir is set by default in uzbl config -- cgit v1.2.3 From fe4a7460cc8b11629cbea44fd7462b71e73b6f78 Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Wed, 17 Feb 2010 18:21:25 +0100 Subject: Prepare directories structure for merge with uzbl. --- README | 27 -------- eFormFiller.sh | 127 ----------------------------------- examples/data/scripts/README | 27 ++++++++ examples/data/scripts/eFormFiller.sh | 127 +++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+), 154 deletions(-) delete mode 100644 README delete mode 100755 eFormFiller.sh create mode 100644 examples/data/scripts/README create mode 100755 examples/data/scripts/eFormFiller.sh (limited to 'README') diff --git a/README b/README deleted file mode 100644 index 8ec6298..0000000 --- a/README +++ /dev/null @@ -1,27 +0,0 @@ -Copy the eFormFiller.sh to $XDG_DATA_HOME/uzbl/scripts/ -In the Uzbl config file add bindings(for example): - - - set eFormFiller = spawn @scripts_dir/eFormFiller.sh - @bind za = @eFormFiller add - @bind ze = @eFormFiller edit - @bind zn = @eFormFiller new - @bind zl = @eFormFiller load - - -scripts_dir is set by default in uzbl config - -If NEW action is taken, then the script will generate -new file with formfields for current domain or will -overrite existing one. - -EDIT action will call an editor (configure it in the script) -with curent domain profiles - -ADD action add another profile to current domain. Remember to name -the profiles, by default the have a name with random numbers - -LOAD will load formfields or if there is more then one profile, it will -call dmenu first to choose the profile you want to fill in the form - -Enjoy diff --git a/eFormFiller.sh b/eFormFiller.sh deleted file mode 100755 index 460a7b2..0000000 --- a/eFormFiller.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Based on script from Uzbl examples (anonymous author) -# Copyright (c) 2009 by Paweł Tomak -# -# -# Enhanced html form (eg for logins) filler (and manager) for uzbl. -# -# uses settings files like: $keydir/ -# files contain lines like: !profile= -# (fieldtype): -# profile_name should be replaced with a name that will tell sth about that profile -# fieldtype can be text or password - only for information pupropse (auto-generated) - don't change that -# -# user arg 1: -# edit: force editing the file (falls back to new if not found) -# new: start with a new file. -# load: try to load from file into form -# add: try to add another profile to an existing file -# -# something else (or empty): if file not available: new, otherwise load. - -# config dmenu colors and prompt -NB="#0f0f0f" -NF="#4e7093" -SB="#003d7c" -SF="#3a9bff" -PROMPT="Choose profile" - -keydir=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/dforms - -[ -d "`dirname $keydir`" ] || exit 1 -[ -d "$keydir" ] || mkdir "$keydir" - -editor=${VISUAL} -if [[ -z ${editor} ]]; then - if [[ -z ${EDITOR} ]]; then - editor='xterm -e vim' - else - editor="xterm -e ${EDITOR}" - fi -fi - -config=$1; shift -pid=$1; shift -xid=$1; shift -fifo=$1; shift -socket=$1; shift -url=$1; shift -title=$1; shift -action=$1 - -[ -d $keydir ] || mkdir $keydir || exit 1 - -if [ "$action" != 'edit' -a "$action" != 'new' -a "$action" != 'load' -a "$action" != 'add' ] -then - action=new - [[ -e $keydir/$domain ]] && action=load -elif [ "$action" == 'edit' ] && [[ ! -e $keydir/$domain ]] -then - action=new -fi -domain=$(echo $url | sed 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/') - -if [ "$action" = 'load' ] -then - [[ -e $keydir/$domain ]] || exit 2 - if [[ `cat $keydir/$domain|grep "!profile"|wc -l` -gt 1 ]] - then - menu=`cat $keydir/$domain| \ - sed -n 's/^!profile=\([^[:blank:]]\+\)/\1/p'` - option=`echo -e -n "$menu"| dmenu -nb "${NB}" -nf "${NF}" -sb "${SB}" -sf "${SF}" -p "${PROMPT}"` - fi - - cat $keydir/$domain | \ - sed -n -e "/^!profile=${option}/,/^!profile=/p" | \ - sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js document.getElementsByName("\1")[0].value="\2";/p' | \ - sed -e 's/@/\\@/p' >> $fifo -else - if [[ "$action" == 'new' || "$action" == 'add' ]] - then - if [ "$action" == 'new' ] - then - echo "!profile=NAME_THIS_PROFILE$RANDOM" > $keydir/$domain - else - echo "!profile=NAME_THIS_PROFILE$RANDOM" >> $keydir/$domain - fi - # - # 2. and 3. line (tr -d and sed) are because, on gmail login for example, - # tag is splited into lines - # ex: - # - # So, tr removes all new lines, and sed inserts new line after each > - # Next sed selects only tags and only with type == "text" or == "password" - # If type is first and name is second, then another sed will change their order - # so the last sed will make output - # text_from_the_name_attr(text or password): - # - # login(text): - # passwd(password): - # - curl -L "$url" | \ - tr -d '\n' | \ - sed 's/>/>\n/g' | \ - sed -n 's/.*\(]\+>\).*/\1/;/type="\(password\|text\)"/Ip' | \ - sed 's/\(.*\)\(type="[^"]\+"\)\(.*\)\(name="[^"]\+"\)\(.*\)/\1\4\3\2\5/I' | \ - sed 's/.*name="\([^"]\+\)".*type="\([^"]\+\)".*/\1(\2): /I' >> $keydir/$domain - fi - [[ -e $keydir/$domain ]] || exit 3 #this should never happen, but you never know. - $editor $keydir/$domain #TODO: if user aborts save in editor, the file is already overwritten -fi - -# vim:fileencoding=utf-8:sw=4 diff --git a/examples/data/scripts/README b/examples/data/scripts/README new file mode 100644 index 0000000..8ec6298 --- /dev/null +++ b/examples/data/scripts/README @@ -0,0 +1,27 @@ +Copy the eFormFiller.sh to $XDG_DATA_HOME/uzbl/scripts/ +In the Uzbl config file add bindings(for example): + + + set eFormFiller = spawn @scripts_dir/eFormFiller.sh + @bind za = @eFormFiller add + @bind ze = @eFormFiller edit + @bind zn = @eFormFiller new + @bind zl = @eFormFiller load + + +scripts_dir is set by default in uzbl config + +If NEW action is taken, then the script will generate +new file with formfields for current domain or will +overrite existing one. + +EDIT action will call an editor (configure it in the script) +with curent domain profiles + +ADD action add another profile to current domain. Remember to name +the profiles, by default the have a name with random numbers + +LOAD will load formfields or if there is more then one profile, it will +call dmenu first to choose the profile you want to fill in the form + +Enjoy diff --git a/examples/data/scripts/eFormFiller.sh b/examples/data/scripts/eFormFiller.sh new file mode 100755 index 0000000..460a7b2 --- /dev/null +++ b/examples/data/scripts/eFormFiller.sh @@ -0,0 +1,127 @@ +#!/bin/sh +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Based on script from Uzbl examples (anonymous author) +# Copyright (c) 2009 by Paweł Tomak +# +# +# Enhanced html form (eg for logins) filler (and manager) for uzbl. +# +# uses settings files like: $keydir/ +# files contain lines like: !profile= +# (fieldtype): +# profile_name should be replaced with a name that will tell sth about that profile +# fieldtype can be text or password - only for information pupropse (auto-generated) - don't change that +# +# user arg 1: +# edit: force editing the file (falls back to new if not found) +# new: start with a new file. +# load: try to load from file into form +# add: try to add another profile to an existing file +# +# something else (or empty): if file not available: new, otherwise load. + +# config dmenu colors and prompt +NB="#0f0f0f" +NF="#4e7093" +SB="#003d7c" +SF="#3a9bff" +PROMPT="Choose profile" + +keydir=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/dforms + +[ -d "`dirname $keydir`" ] || exit 1 +[ -d "$keydir" ] || mkdir "$keydir" + +editor=${VISUAL} +if [[ -z ${editor} ]]; then + if [[ -z ${EDITOR} ]]; then + editor='xterm -e vim' + else + editor="xterm -e ${EDITOR}" + fi +fi + +config=$1; shift +pid=$1; shift +xid=$1; shift +fifo=$1; shift +socket=$1; shift +url=$1; shift +title=$1; shift +action=$1 + +[ -d $keydir ] || mkdir $keydir || exit 1 + +if [ "$action" != 'edit' -a "$action" != 'new' -a "$action" != 'load' -a "$action" != 'add' ] +then + action=new + [[ -e $keydir/$domain ]] && action=load +elif [ "$action" == 'edit' ] && [[ ! -e $keydir/$domain ]] +then + action=new +fi +domain=$(echo $url | sed 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/') + +if [ "$action" = 'load' ] +then + [[ -e $keydir/$domain ]] || exit 2 + if [[ `cat $keydir/$domain|grep "!profile"|wc -l` -gt 1 ]] + then + menu=`cat $keydir/$domain| \ + sed -n 's/^!profile=\([^[:blank:]]\+\)/\1/p'` + option=`echo -e -n "$menu"| dmenu -nb "${NB}" -nf "${NF}" -sb "${SB}" -sf "${SF}" -p "${PROMPT}"` + fi + + cat $keydir/$domain | \ + sed -n -e "/^!profile=${option}/,/^!profile=/p" | \ + sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js document.getElementsByName("\1")[0].value="\2";/p' | \ + sed -e 's/@/\\@/p' >> $fifo +else + if [[ "$action" == 'new' || "$action" == 'add' ]] + then + if [ "$action" == 'new' ] + then + echo "!profile=NAME_THIS_PROFILE$RANDOM" > $keydir/$domain + else + echo "!profile=NAME_THIS_PROFILE$RANDOM" >> $keydir/$domain + fi + # + # 2. and 3. line (tr -d and sed) are because, on gmail login for example, + # tag is splited into lines + # ex: + # + # So, tr removes all new lines, and sed inserts new line after each > + # Next sed selects only tags and only with type == "text" or == "password" + # If type is first and name is second, then another sed will change their order + # so the last sed will make output + # text_from_the_name_attr(text or password): + # + # login(text): + # passwd(password): + # + curl -L "$url" | \ + tr -d '\n' | \ + sed 's/>/>\n/g' | \ + sed -n 's/.*\(]\+>\).*/\1/;/type="\(password\|text\)"/Ip' | \ + sed 's/\(.*\)\(type="[^"]\+"\)\(.*\)\(name="[^"]\+"\)\(.*\)/\1\4\3\2\5/I' | \ + sed 's/.*name="\([^"]\+\)".*type="\([^"]\+\)".*/\1(\2): /I' >> $keydir/$domain + fi + [[ -e $keydir/$domain ]] || exit 3 #this should never happen, but you never know. + $editor $keydir/$domain #TODO: if user aborts save in editor, the file is already overwritten +fi + +# vim:fileencoding=utf-8:sw=4 -- cgit v1.2.3 From 0aac1626e674378d59c0a7f59bae679af51dee0e Mon Sep 17 00:00:00 2001 From: Pawel Tomak Date: Thu, 11 Mar 2010 22:21:00 +0100 Subject: Added eFormFiller section in the readme --- README | 26 ++++++++++++++++++++++++++ examples/data/scripts/README | 20 -------------------- 2 files changed, 26 insertions(+), 20 deletions(-) delete mode 100644 examples/data/scripts/README (limited to 'README') diff --git a/README b/README index 11146ef..ddd4ddb 100644 --- a/README +++ b/README @@ -523,6 +523,32 @@ The script specific arguments are: Custom, userdefined scripts (`spawn foo bar`) get first the arguments as specified in the config and then the above 7 are added at the end. +### eFormFiller + +Example config entries for eFormFiller scripts + + set eFormFiller = spawn @scripts_dir/eFormFiller.sh + @cbind za = @eFormFiller add + @cbind ze = @eFormFiller edit + @cbind zn = @eFormFiller new + @cbind zl = @eFormFiller load + @cbind zo = @eFormFiller once + +NEW action generates new file with formfields for current domain. Note that it +will overwrite existing file. + +EDIT action calls an external editor with curent domain profiles. + +ADD action adds another profile to current domain. Remember to name the +profiles, by default the have a name with random numbers. + +LOAD action loads form data. If there is more then one profile, it will call +dmenu first to choose the profile you want to fill in the form. + +ONCE action generates a temp file with formfields including the textareas and +after closing the editor, it will load the data into the formfields. The temp +file is removed + ### HTTP/BASIC AUTHENTICATION You can use the authentication_handler variable to denote how http diff --git a/examples/data/scripts/README b/examples/data/scripts/README deleted file mode 100644 index 5cd72a4..0000000 --- a/examples/data/scripts/README +++ /dev/null @@ -1,20 +0,0 @@ -### eFormFiller - -Example config entries for eFormFiller scripts - - set eFormFiller = spawn @scripts_dir/eFormFiller.sh - @cbind ZA = @eFormFiller add - @cbind ZE = @eFormFiller edit - @cbind ZN = @eFormFiller new - @cbind ZL = @eFormFiller load - -NEW action generates new file with formfields for current domain. Note that it -will overwrite existing file. - -EDIT action calls an external editor with curent domain profiles. - -ADD action adds another profile to current domain. Remember to name the -profiles, by default the have a name with random numbers. - -LOAD action loads form data. If there is more then one profile, it will call -dmenu first to choose the profile you want to fill in the form. -- cgit v1.2.3 From 9565d9c6625cf403bbcaf5a19f9694bfa6da098e Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Mon, 22 Mar 2010 00:45:35 +0800 Subject: FS#57 Correct documentation on binds containing *'s --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index ddd4ddb..e26673c 100644 --- a/README +++ b/README @@ -533,7 +533,7 @@ Example config entries for eFormFiller scripts @cbind zn = @eFormFiller new @cbind zl = @eFormFiller load @cbind zo = @eFormFiller once - + NEW action generates new file with formfields for current domain. Note that it will overwrite existing file. @@ -715,8 +715,8 @@ Events/requests which the EM and its plugins listens for return/enter. If the user enters text where `` has the underscore, `%s` in the `` string will be replaced by this text (optional). - `` ends with a `*`: similar behavior as with an underscore, but also - makes the binding incremental (i.e. the command will be invoked on every - keystroke). + makes the binding incremental (i.e. the command will be invoked after + reaching the `*` point then on every subsequent keystroke). - `` ends with a `!`: the command will only be invoked after pressing return/enter, no replacement happens. this is useful for preventing `x` to match when you want to bind `xx` also. -- cgit v1.2.3