Hi,
there is nothing to adapt.
As you see the script contains a function to detect the different settings an returns the jscd object.
And the second part is how you use it.
You see there is one way to display in a question od type "long text".
The there is @Tammo's wish to show the settings separated, in a question of type "multiple short text"
In your case I'd recommend this, too.
You may use a "multiple short text" question (Q1) with two subquestions to store the detection of mobile and the viewport width.
Like
Code:
$(document).ready(function() {
// Hide this question (remove double slash below to hide)
//$('#question{QID}').hide();
var thisQuestion = $('#question{QID}');
// Fill the array
$('input[type=text]:eq(0)', thisQuestion).val( jscd.mobile );
$('input[type=text]:eq(1)', thisQuestion).val( jscd.vieww );
});
Here something more displayed.
Now you can show a text display depending on a relvanced equation either
Q1_SQ001=="true"
or
Q1_SQ002<600 (or whichever value you need)
Something like "Please, use a device with a minimum screen width of xxx Pixel."
In a following group you may test again and create an equation (eqQ1) like {if(Q2_SQ001=="true",1,0)}
and set a quota (limit 0) on this equation on value 1.
Up to you and the type of your survey (open, closed) you may use the question Q1 in the equation or test again (Q2) after the text display.
Joffm