aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/config/config6
-rw-r--r--examples/data/scripts/formfiller.js9
-rwxr-xr-xexamples/data/scripts/formfiller.sh20
3 files changed, 26 insertions, 9 deletions
diff --git a/examples/config/config b/examples/config/config
index 92606a2..389e7c6 100644
--- a/examples/config/config
+++ b/examples/config/config
@@ -239,6 +239,8 @@ set ebind = @mode_bind global,-insert
@cbind ^ = scroll horizontal begin
@cbind $ = scroll horizontal end
@cbind <Space> = scroll vertical end
+@cbind G<Go To:>_ = scroll vertical %r!
+@cbind _G<Go To:>_ = scroll horizontal %r!
# Navigation binds
@cbind b = back
@@ -250,12 +252,12 @@ set ebind = @mode_bind global,-insert
# Zoom binds
@cbind + = zoom_in
@cbind - = zoom_out
-@cbind T = toggle_zoom_type
+@cbind T = toggle zoom_type
@cbind 1 = set zoom_level = 1.0
@cbind 2 = set zoom_level = 2.0
# Appearance binds
-@cbind t = toggle_status
+@cbind t = toggle show_status
# Page searching binds
@cbind /* = search %s
diff --git a/examples/data/scripts/formfiller.js b/examples/data/scripts/formfiller.js
index 1b10db4..06db648 100644
--- a/examples/data/scripts/formfiller.js
+++ b/examples/data/scripts/formfiller.js
@@ -29,6 +29,9 @@ uzbl.formfiller = {
for( var k = 0; k < inputs.length; ++k ) {
var input = inputs[k];
+ if ( ! input.name ) {
+ continue
+ }
if ( uzbl.formfiller.inputTypeIsText(input.type) ) {
rv += '%' + escape(input.name) + '(' + input.type + '):' + input.value + '\n';
} else if ( input.type == 'checkbox' || input.type == 'radio' ) {
@@ -39,8 +42,10 @@ uzbl.formfiller = {
var textareas = allFrames[j].document.getElementsByTagName("textarea");
for( var k = 0; k < textareas.length; ++k ) {
var textarea = textareas[k];
- rv += '%' + escape(textarea.name) + '(textarea):\n' + textarea.value.replace(/\n%/g,"\n\\%") + '\n%\n';
- rv += '%' + escape(textarea.name) + '(textarea):\n' + textarea.value.replace(/\n\\/g,"\n\\\\").replace(/\n%/g,"\n\\%") + '%\n';
+ if ( ! textarea.name ) {
+ continue
+ }
+ rv += '%' + escape(textarea.name) + '(textarea):\n' + textarea.value.replace(/(^|\n)\\/g,"$1\\\\").replace(/(^|\n)%/g,"$1\\%") + '\n%\n';
}
}
catch (err) { }
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh
index 394bfbd..52d6ec6 100755
--- a/examples/data/scripts/formfiller.sh
+++ b/examples/data/scripts/formfiller.sh
@@ -63,6 +63,9 @@ ParseFields ()
awk '/^%/ {
sub ( /%/, "" )
+ gsub ( /\\/, "\\\\\\\\" )
+ gsub ( /@/, "\\@" )
+ gsub ( /"/, "\\\"" )
split( $0, parts, /\(|\)|\{|\}/ )
@@ -73,15 +76,24 @@ ParseFields ()
printf( "js uzbl.formfiller.insert(\"%s\",\"%s\",\"%s\",%s);\n",
parts[1], parts[2], parts[3], field )
- else if ( parts[2] ~ /^textarea$/ ) {
+ else if ( parts[2] == "textarea" ) {
field = ""
while (getline) {
if ( /^%/ ) break
sub ( /^\\/, "" )
+ # JavaScript escape
+ gsub ( /\\/, "\\\\\\\\" )
gsub ( /"/, "\\\"" )
- gsub ( /\\/, "\\\\" )
- field = field $0 "\\\\n"
+ # To support the possibility of the last line of the textarea
+ # not being terminated by a newline, we add the newline here.
+ # The "if (field)" is so that this does not happen in the first
+ # iteration.
+ if (field) field = field "\\n"
+ field = field $0
}
+ # Uzbl escape
+ gsub ( /\\/, "\\\\\\\\", field )
+ gsub ( /@/, "\\@", field )
printf( "js uzbl.formfiller.insert(\"%s\",\"%s\",\"%s\",0);\n",
parts[1], parts[2], field )
}
@@ -120,7 +132,6 @@ Load ()
ParseProfile $option < "$file" \
| ParseFields \
- | sed 's/@/\\@/g' \
> "$UZBL_FIFO"
}
@@ -136,7 +147,6 @@ Once ()
test -e "$tmpfile" &&
ParseFields < "$tmpfile" \
- | sed 's/@/\\@/g' \
> "$UZBL_FIFO"
}