वर्णन
Detector is a simple, PHP- and JavaScript-based browser- and feature-detection library that can adapt to new devices & browsers on its own without the need to pull from a central database of browser information.
Also available on GitHub: https://github.com/SteveBarnett/Detector.
Full documentation is available at github / dmolsen / Detector.
To Do
- Add some useful responsive image handling, in the style of picturefill.js. Based on families at first?
- Add functions for conditional loading of content via JS, depending on screen size.
- wp_enqueue_script for Modernizr
- Check Modernizr version, custom
- Add option to add own feature tests from admin area?
- Add option to add own families from admin area?
- Add shortcodes?
स्थापना
- Go to Plugins > Add New, Upload and choose detector.zip.
- Activate the plugin.
नेहमी विचारले जाणारे प्रश्न
- How do I use Detector?
-
In order to access the features you need to use the
$ua
object that is automatically created with the inclusion of Detector in your application. Use the$ua
object in a similar way that you would have used theModernizr
object on the client-side:global $ua; // your script if ($ua->svg) { ... } elseif ($ua->canvas) { ... }
See the full list of browser features that are tested by Modernizr and available with Detector. All of the features tested with ua-parser-php are also available from the
$ua
variable (e.g.$ua->isMobile
or$ua->browserFull
)Some features, (in particular
video
,audio
,input
, andinputtypes
) have sub-features, so these are available as nested PHP objects:if ($ua->inputtypes->search) { print "<input type='search' ..."; } else { print "<input type='text' ..."; }
All features are returned as integer
1
or0
fortrue
orfalse
, so they can be used in logical evaluations in PHP. Sub-features can return1
,0
, or a real value (e.g. screen width).
समीक्षा
ह्या प्लगइनसाठी कोणतेही समीक्षण नाही.
योगदानकर्ते आणि विकसक
“Detector” हे मुक्त स्रोत सॉफ्टवेअर आहे. पुढील लोक या प्लगइनच्या निर्मितीत योगदान केले आहे.
योगदानकर्तेभाषांतर करा “Detector” तुमच्या भाषेत.
विकासातील आग्रह?
कोड ब्राउझ करा, SVN संग्रहालय तपासा, किंवा विकास लॉग च्या RSS द्वारे सदस्यता घ्या.
बदलांची यादी
0.9.5
Updated to match dmoslen’s current Detector
0.8.5
Updated to match dmoslen’s current Detector
0.8.2
Updated to match dmoslen’s current Detector
0.8.1
- Initial release. regexes.yaml from 2012/07/12: 303c8f9