Name: device-switcher
Owner: BBC
Description: :iphone: BBC Device Switcher
Created: 2015-12-09 11:39:37.0
Updated: 2018-05-05 11:51:02.0
Pushed: 2016-06-15 07:43:31.0
Homepage: http://bbc.github.io/device-switcher
Size: 489
Language: CSS
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
The BBC Device Switcher is an open-source web app that has been designed to allow editorial staff and developers to view the websites upon which they work in their mobile, tablet and desktop forms, with ease.
Clone the BBC Device Switcher via the following command:
clone git@github.com:bbc/device-switcher.git
BBC Device Switcher uses the jQuery and RequireJS JavaScript libraries, which you may download using the Bower dependency management system.
Once you have installed Bower, execute the following command within the BBC Device Switcher directory to install the necessary dependencies:
r install
As the BBC Device Switcher is solely comprised of a single static web page, it is possible to test the app by opening index.html
in a web browser.
However, if you would prefer to test the app on a server, you may instantiate one via the following Python command:
on -m SimpleHTTPServer 5705
and open the page via http://localhost:5705
.
Two parameters may be used to specify the state of the switcher:
device
, which specifies the type of device in which the edition will be displayed on the page and must be one of the following:mobile
tablet
desktop
url
, which may be used to specify (in URL-encoded form) the URL of a website that may be displayed within the switcherParameters should be specified after a hash (#
) that follows the base News Switcher URL, like so:
http://bbc.github.io/device-switcher/#device=mobile
, which will display the default web page in its mobile formhttp://bbc.github.io/device-switcher/#device=tablet&url=http%3A%2F%2Fwww.bbc.co.uk%2Fnews
, which will display the BBC News website in its tablet formPlease note: in order to avoid the app being used maliciously, the demo of the app has been set up to only allow URLs of BBC web-pages to be specified in the url
parameter; any other URLs will redirect to the BBC News website; to remove this behaviour on your own version of the Device Switcher, simply pass false
as the value of the aIsDemo
argument to the setUpSwitcher
function
The following font files have been used (and distributed under the SIL Open Font License, 1.1) to brand the BBC Device Switcher: