diff options
-rwxr-xr-x | Bonus/goodict.cgi | 34 | ||||
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | main.c | 2 |
3 files changed, 44 insertions, 12 deletions
diff --git a/Bonus/goodict.cgi b/Bonus/goodict.cgi index 8f443c1..5fb6581 100755 --- a/Bonus/goodict.cgi +++ b/Bonus/goodict.cgi @@ -1,14 +1,20 @@ #!/usr/bin/perl # ~/.w3m/urimethodmap -# e: file:/cgi-bin/goodict.cgi?%s -# w: file:/cgi-bin/goodict.cgi?%s -# j: file:/cgi-bin/goodict.cgi?%s +# e: file:/cgi-bin/goodict.cgi?%s Englich-Japanese +# w: file:/cgi-bin/goodict.cgi?%s Japanese-English +# j: file:/cgi-bin/goodict.cgi?%s Japanese +# a: file:/cgi-bin/goodict.cgi?%s All +# +# e:0:word start with word +# e:1:word perfect match +# e:2:word end with word +# e:3:word search body text +# e:6:word search title +# e:word perfect match -use NKF; -#$mode = 0; # substring -$mode = 1; # perfect match -#$mode = 3; # search body text +use Encode; +use Encode::Guess qw/euc-jp utf8/; $url = "http://dictionary.goo.ne.jp"; $_ = $ENV{"QUERY_STRING"}; if (/^e:/) { @@ -17,14 +23,22 @@ if (/^e:/) { $kind = 'je'; } elsif (/^j:/) { $kind = 'jn'; +} elsif (/^a:/) { + $kind = 'all' +} +s@^[ewja]:@@ && s@^//@@ && s@/$@@; +if (/^([01236]):/) { + $mode=$1; + s/^[01236]://; +}else{ + $mode="1"; } -s@^[ewjs]:@@ && s@^//@@ && s@/$@@; if ($_) { s/\+/ /g; s/%([\da-f][\da-f])/pack('C', hex($1))/egi; - $_ = nkf("-e", $_); + $_ = encode("utf8", decode("Guess", $_)); s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; - $url .= "/search.php?MT=$_&kind=$kind&mode=$mode"; + $url .= "/srch/$kind/$_/m$mode"."u/"; } else { $input = "w3m-control: GOTO_LINK"; } @@ -1,3 +1,18 @@ +2015-08-05 IWAMOTO Kouichi <sue@iwmt.org> + + * main.c: Fix that SGR style mouse handler has off-by-one problem. + cf. https://github.com/tats/w3m/issues/5 + Origin: https://gist.github.com/ttdoda/30c189a63d483beeb207 + Bug: https://sourceforge.net/p/w3m/patches/65/ + +2015-07-31 yshl <yshl@takechiyo.net> + + * Bonus/goodict.cgi: + - Use Encode.pm instead of NKF. + - Update to the current URL. + - Enable to select search mode. + Origin: https://github.com/tats/w3m/pull/4 + 2015-07-20 Tatsuya Kinoshita <tats@debian.org> * README: Add short description. @@ -593,8 +608,9 @@ * keybind.c, main.c, proto.h, terms.c: Support SGR 1006 mouse reporting. - Patch to support SGR 1006 mouse reporting, from [w3m-dev 04466] - on 2012-07-15. + cf. [w3m-dev 04466] on 2012-07-15 + Origin: https://gist.github.com/3114255 + Bug: https://sourceforge.net/p/w3m/patches/65/ 2012-05-19 Hilko Bengen <bengen@debian.org> @@ -5561,6 +5561,7 @@ DEFUN(sgrmouse, SGRMOUSE, "SGR 1006 mouse operation") else return; } while (1); + if (x>0) x--; do { c = getch(); @@ -5574,6 +5575,7 @@ DEFUN(sgrmouse, SGRMOUSE, "SGR 1006 mouse operation") } else return; } while (1); + if (y>0) y--; if (x < 0 || x >= COLS || y < 0 || y > LASTLINE) return; |