Responsive/Adaptive utilities for your Node.js application
npm install responderDISCLAIMER: In very early development! Do not use ... contribute.
Responsive/Adaptive utilities for your Node.js Application
The library provides the following:
* API wrapper for working with Device Description Repositories such as:
* WURFL (Local and WURFL Cloud Client)
* openDDR (W3C DDR Core Vocabulary)
* 51degrees.mobi Lite
* Device Atlas
* ApacheMap
* Redis Data cache and simple Data API
* Device Profile Mappings to Jade templates
* Profile-specific Jade mixins
* Intelligent UX via WebSockets and Modernizr (SPA application support)
npm install responder``javascript
var responder = require('responder');
responder.profile(); // "smartPhone"
responder.product('brand_name'); // "Nokia"
responder.product('has_qwerty_keyboard'); // "false"
responder.product('mobile_browser'); // "Opera"
responder.html_ui('html_preferred_dtd') // "html5"
responder.pdf('pdf_support'); // "true"
`$3
Clone the responderjs-client.js into your app's JavaScript directory.
$ cd
$ git clone git://github.com/jessecravens/responderjs-client.git
Add a script reference in your application pages. Most likely, your highest-level template.
#### HTML
`html`
#### Jade
`javascript`
script(src='js/responderjs-client.js')
The majority of web traffic through the traditional desktop web is divided among a manageable number of modern web browsers, most notably Google Chrome, Internet Explorer, Mozilla Firefox, Safari, and Opera. These browsers rely on HTML as its markup language, CSS for styling, and JavaScript for client-side scripting. Although cross-browser compliance continues to cause developer pain, it can generallly be expected that the content of most web applications will be visible to most users using modern web browsers. Futhermore, software updates for desktop browsers are frequent and widely distributed.
Unlike the desktop web, there is a significant amount of fragmentation on the mobile web. Markup can be WML, HTML, HDML, XHTML, or Mobile Profile. In addition, unlike the desktop web, a mobile web browser will vary on screen size, ability to support client side scripting, ability to support various image formats, and even color. Because the markup is generally sent directly to the phone, there is no opportunity for a central server to “fix” or adapt to browser limitations or defects. Furthermore, software updates for mobile browsers are rare.
ResponderJS helps bridge this gap with a simple to use API.
* WURFL (Local and WURFL Cloud Client)
* openDDR (W3C DDR Core Vocabulary)
* 51degrees.mobi Lite
* Device Atlas
* ApacheMap
#### WURFL Cloud
http://www.scientiamobile.com/wurflCloud/gettingStarted/
* responder.isSmartPhone {Bool}responder.isTablet
* {Bool}responder.isDesktop
* {Bool}responder.isLargeScreen
* {Bool}
* responder.profile();responder.is(profile)
* @return {String} current profile.
* profile
* @param {String} . Currently supports smartPhone, tablet,desktop and largeScreen.responder.test(ua)
* @return {Bool} Returns boolean of current device matching argument
you specify.
* ua`. User-agent string to test.
* @param {String}
@return {String} Returns string of profile that it matches.