Sha256: cb97eb13769118f42618f76a3b23945952c334804a62f39eaca6c0a0e21804ea
Contents?: true
Size: 1.41 KB
Versions: 4
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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
galakei-0.3.2 | lib/galakei/input_mode.rb |
galakei-0.3.1 | lib/galakei/input_mode.rb |
galakei-0.3.0 | lib/galakei/input_mode.rb |
galakei-0.2.0 | lib/galakei/input_mode.rb |