Sha256: 18d8ed81ee81729e7f9887a7b67c2a7c98336ee0111ae8891f5a201ad27e05ea
Contents?: true
Size: 1.41 KB
Versions: 34
Compression:
Stored size: 1.41 KB
Contents
module Galakei module InputMode INPUT_MODES = { "alphabet" => { :docomo_wap_input_format => "en", :other_wap_input_format => 'm', :mode => 'alphabet', :istyle => '3' }, "hiragana" => { :docomo_wap_input_format => 'h', :other_wap_input_format => 'M', :mode => 'hiragana', :istyle => '1' }, "hankaku_kana" => { :docomo_wap_input_format => 'hk', :other_wap_input_format => 'M', :mode => 'hankakukana', :istyle => '2' }, "number" => { :docomo_wap_input_format => 'n', :other_wap_input_format => 'N', :mode => 'numeric', :istyle => '4' } } def text_field(object_name, method, options = {}) if request.galakei? inputmode = if options[:type] == "number" options.delete(:type) else options.delete(:inputmode) end if inputmode = INPUT_MODES[inputmode] if request.docomo? style = inputmode[:docomo_wap_input_format] options[:style] = %Q{-wap-input-format:"*<ja:#{style}>"} else options[:istyle] = inputmode[:istyle] options[:mode] = inputmode[:mode] options[:style] ||= %Q{-wap-input-format:*#{inputmode[:other_wap_input_format]}} end end end super(object_name, method, options) end end end
Version data entries
34 entries across 34 versions & 1 rubygems