Module z_user_agent

User agent classifications.

Copyright 2012 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

User agent classifications

Data Types

ua_template_class()

ua_template_class() = ua_classifier:device_type() | generic

Function Index

classes/0Return all possible UA classes.
classes_fallback/1Return all possible UA classes for a fallback from another class, including the given class.
filename_split_class/1Split a filename (with subdir) to a device class and a relative path.
get_class/1Get the user agent class.
get_props/1Get the user agent class.
order_class/2Ordering function for lists:sort/2.
set_class/1Classify the user agent in the wm_reqdata.
set_class/2Set the class in a context, useful for testing.
to_ua_class/1
ua_probe/2Handle the return value of the user-agent probe.
ua_select/2The user selects an user agent by hand.

Function Details

classes/0

classes() -> [ua_classifier:device_type()]

Return all possible UA classes

classes_fallback/1

classes_fallback(UAClass::ua_classifier:device_type()) -> [ua_classifier:device_type()]

Return all possible UA classes for a fallback from another class, including the given class. The returned list is ordered from the specific to less specific.

filename_split_class/1

filename_split_class(F::file:filename()) -> {ua_template_class(), file:filename()}

Split a filename (with subdir) to a device class and a relative path.

get_class/1

get_class(Context::#context{} | #wm_reqdata{} | undefined) -> ua_classifier:device_type()

Get the user agent class

get_props/1

get_props(Context::#context{} | #wm_reqdata{} | undefined) -> [{atom(), term()}]

Get the user agent class

order_class/2

order_class(A::ua_classifier:device_type(), X2::ua_classifier:device_type()) -> boolean()

Ordering function for lists:sort/2. Orders by genericity. Most specific first.

set_class/1

set_class(Wm_reqdata::#wm_reqdata{}) -> {ok, #wm_reqdata{}}

Classify the user agent in the wm_reqdata.

set_class/2

set_class(UAClass::ua_classifier:device_type(), Context::#context{}) -> #context{}

Set the class in a context, useful for testing. Doesn't change the reqdata or the session settings.

to_ua_class/1

to_ua_class(X1) -> any()

ua_probe/2

ua_probe(ProbePs, Context) -> any()

Handle the return value of the user-agent probe. When it comes back we know the user-agent has javascript, so we might want to upgrade from text to phone.

ua_select/2

ua_select(UAClass::ua_classifier:device_type() | automatic, Context::#context{}) -> #context{}

The user selects an user agent by hand. Update cookie and session.


Generated by EDoc, Oct 31 2014, 00:59:37.