Actions

Widget

DeviceType: Difference between revisions

From OSE

No edit summary
Tag: Reverted
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>


function getDeviceType() {
<div id="device_sizing">
  const userAgent = navigator.userAgent.toLowerCase();
    <!-- Placeholder for the widget content -->
 
</div>
  if (userAgent.includes('mobile') || userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) {
    return 'mobile';
  } else if (userAgent.includes('tablet')) {
    return 'tablet';
  } else {
    return 'desktop';
  }
}
$(function() {
  // Document is ready
 
 
if (getDeviceType() === "desktop") {
        document.write("{{#widget:Iframe|url=https://bnbforms.com/103014/|width=600|height=700|border=0}}");
} else {
        document.write("{{#widget:Iframe|url=https://bnbforms.com/103014/|width=300|height=700|border=0}}");
}
});
 
</includeonly>
</includeonly>

Latest revision as of 00:37, 31 May 2025