Changeset 10637

Show
Ignore:
Timestamp:
04/28/08 13:35:55 (7 months ago)
Author:
tokuhirom
Message:

AirHPhone のときは横幅320px固定でおねがいします。

Location:
lang/perl/Moxy/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Moxy/trunk/lib/Moxy/Plugin/DisplayWidth.pm

    r10623 r10637  
    77sub response_filter:Hook('response_filter') { 
    88    my ($class, $context, $args) = @_; 
    9     return if $args->{mobile_attribute}->is_non_mobile; 
    10     return if $args->{mobile_attribute}->is_airh_phone; 
     9    my $attr = $args->{mobile_attribute}; 
     10    return if $attr->is_non_mobile; 
    1111 
    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;">!; 
    1619 
    1720    my $content = $args->{response}->content; 
  • lang/perl/Moxy/trunk/t/Plugins/DisplayWidth.pm

    r10040 r10637  
    7777  </html> 
    7878--- 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> 
    8080 
     81=== wx310k(willcom) 
     82--- input 
     83ua: 'Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.1.5.15.000000/0.1/C100) Opera 7.0' 
     84html: |+ 
     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