Skip to content

Instantly share code, notes, and snippets.

@JasonGhent
Created February 25, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasonGhent/2ac1670dbbc6ed39bca2 to your computer and use it in GitHub Desktop.
Save JasonGhent/2ac1670dbbc6ed39bca2 to your computer and use it in GitHub Desktop.
BrowserStack snippet
$('input[name="screenshots"]').val('http://staging.storydesk.com/case-studies/pharma');
$('.sel').removeClass('sel');
//Non-windows devices
var devices = ['iPad 2 (5.0)','iPad 3rd','iPad 3rd (6.0)','iPhone 5','iPad Mini','LG Nexus 4','Google Nexus 7'];
for(var i in devices) {
$('a[device="'+devices[i]+'"]').addClass('sel');
}
//Windows OSes
/*
var oses = [
{XP:[{firefox:['23.0']},{chrome:['28.0']},{safari:['5.1']}]},
{7:[{ie:['9.0','10.0','11.0']},{firefox:['22.0','23.0']},{chrome:['27.0','28.0']},{safari:['5.1']}]},
{8:[{ie:['10.0']},{firefox:['22.0','23.0']},{chrome:['27.0','28.0']},{safari:['5.1']}]},
];
*/
//Non-windows OSes
var oses = [
{'Snow Leopard':[{firefox:['22.0','23.0']},{chrome:['27.0','28.0']},{safari:['5.1']}]},
{'Lion':[{firefox:['22.0','23.0']},{chrome:['27.0','28.0']},{safari:['6.0','5.1']}]},
{'Mountain Lion':[{firefox:['22.0','23.0']},{chrome:['27.0','28.0']},{safari:['6.0','5.1']}]}
];
$.each(oses,function(os){
$.each(oses[os],function(os,vals){
$.each(vals,function(browsers,vals){
$.each(vals,function(browser,vals){
$.each(vals,function(versions,version){
$('a[os_version="'+os+'"][browser="'+browser+'"][browser_version="'+version+'"]').addClass('sel');
});
});
});
});
});
$('#btnSnapshot').click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment