Add special features to be enabled for Android browsers
authorJoey Schulze <joey@infodrom.org>
Sat, 8 Jun 2019 15:04:02 +0000 (17:04 +0200)
committerJoey Schulze <joey@infodrom.org>
Sat, 8 Jun 2019 15:04:02 +0000 (17:04 +0200)
src/Infodrom/calendar/index.wml

index cdf571b..07c8c85 100644 (file)
@@ -418,8 +418,15 @@ $(function(){
        }
     });
     if (document.location.href.indexOf('month=normal') == -1) {
-       $('#view').val('bimonth');
-       $.invoke('Calendar/BiMonth', {month: '<?=date('Y-m')?>'}, month_actions);
+       if (navigator.userAgent.indexOf('Android') > -1) {
+           $('<meta name="viewport" content="width=device-width, initial-scale=0.75" />').insertAfter('title');
+           $('#view').val('onemonth');
+           $.invoke('Calendar/OneMonth', {month: '<?=date('Y-m')?>'}, month_actions);
+           $('select#view').hide();
+       } else {
+           $('#view').val('bimonth');
+           $.invoke('Calendar/BiMonth', {month: '<?=date('Y-m')?>'}, month_actions);
+       }
     }
     $('#month,div.view button').show();
 });