Changeset 10637
- Timestamp:
- 04/28/08 13:35:55 (7 months ago)
- Location:
- lang/perl/Moxy/trunk
- Files:
-
- 2 modified
-
lib/Moxy/Plugin/DisplayWidth.pm (modified) (1 diff)
-
t/Plugins/DisplayWidth.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Moxy/trunk/lib/Moxy/Plugin/DisplayWidth.pm
r10623 r10637 7 7 sub response_filter:Hook('response_filter') { 8 8 my ($class, $context, $args) = @_; 9 return if $args->{mobile_attribute}->is_non_mobile;10 return if $a rgs->{mobile_attribute}->is_airh_phone;9 my $attr = $args->{mobile_attribute}; 10 return if $attr->is_non_mobile; 11 11 12 my $display = $args->{mobile_attribute}->display; 13 my $header = sprintf( 14 q{<div style="border: 1px black solid; width: %dpx; margin: 0 auto;float: left;">}, $display->width 15 ); 12 # HTTP::MobileAttribute::Plugin::Display は AirHPhone に対応していない。 13 # が、ディスプレイ幅の指定がないと利用に耐えないので、現行機種のほとんどが 320px であることが下記 URL より確認できるので 14 # http://www.willcom-inc.com/ja/lineup/spec/voice/index.html 15 # 320px 固定にしておく。だれか Willcom が大好きでたまらないような人があらわれたら対応してください。 16 my $width = $attr->is_airh_phone ? 320 : $attr->display->width; 17 18 my $header = qq!<div style="border: 1px black solid; width: ${width}px; margin: 0 auto;float: left;">!; 16 19 17 20 my $content = $args->{response}->content; -
lang/perl/Moxy/trunk/t/Plugins/DisplayWidth.pm
r10040 r10637 77 77 </html> 78 78 --- expected 79 <html><head></head><body><div style="border: 1px black solid; width: 240px "></div></body></html>79 <html><head></head><body><div style="border: 1px black solid; width: 240px; margin: 0 auto;float: left;"></div></body></html> 80 80 81 === wx310k(willcom) 82 --- input 83 ua: 'Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.1.5.15.000000/0.1/C100) Opera 7.0' 84 html: |+ 85 <html> 86 <head></head> 87 <body></body> 88 </html> 89 --- expected 90 <html><head></head><body><div style="border: 1px black solid; width: 320px; margin: 0 auto;float: left;"></div></body></html> 91
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)