@everymatrix/blog-article-details
Advanced tools
Comparing version 1.14.0 to 1.14.2
@@ -1,1 +0,1 @@ | ||
import{p as e,b as t}from"./p-68e0210a.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((e=>t([["p-dff3451f",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postMessageEvent:[513,"post-message-event"],postId:[514,"post-id"],postSlug:[513,"post-slug"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]],e))); | ||
import{p as e,b as t}from"./p-68e0210a.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((e=>t([["p-f2e32398",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postMessageEvent:[513,"post-message-event"],postId:[514,"post-id"],postSlug:[513,"post-slug"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]],e))); |
@@ -28,19 +28,2 @@ 'use strict'; | ||
function checkDeviceType() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
const width = screen.availWidth; | ||
const height = screen.availHeight; | ||
if (userAgent.includes('iphone')) { | ||
return 'mobile'; | ||
} | ||
if (userAgent.includes('android')) { | ||
if (height > width && width < 800) { | ||
return 'mobile'; | ||
} | ||
if (width > height && height < 800) { | ||
return 'tablet'; | ||
} | ||
} | ||
return 'desktop'; | ||
} | ||
const getDevice = () => { | ||
@@ -59,2 +42,17 @@ let userAgent = window.navigator.userAgent; | ||
}; | ||
function checkCustomDeviceWidth() { | ||
const width = screen.availWidth; | ||
if (width < 600) { | ||
return 'mobile'; | ||
} | ||
else if (width >= 600 && width < 1100) { | ||
return 'tablet'; | ||
} | ||
} | ||
function getDeviceCustom() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
let source = ''; | ||
source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop'; | ||
return source; | ||
} | ||
const getDevicePlatform = () => { | ||
@@ -230,3 +228,3 @@ const device = getDevice(); | ||
detectAndAlertDeviceType() { | ||
this.device = checkDeviceType(); | ||
this.device = getDeviceCustom(); | ||
} | ||
@@ -233,0 +231,0 @@ formatDate(dateString) { |
import { Component, Prop, State, Watch, h, Listen } from '@stencil/core'; | ||
import { translate } from '../../utils/locale.utils'; | ||
import { checkDeviceType, getDevicePlatform } from '../../utils/utils'; | ||
import { getDevicePlatform, getDeviceCustom } from '../../utils/utils'; | ||
export class BlogArticleDetails { | ||
@@ -156,3 +156,3 @@ constructor() { | ||
detectAndAlertDeviceType() { | ||
this.device = checkDeviceType(); | ||
this.device = getDeviceCustom(); | ||
} | ||
@@ -159,0 +159,0 @@ formatDate(dateString) { |
@@ -31,2 +31,17 @@ export function checkDeviceType() { | ||
}; | ||
function checkCustomDeviceWidth() { | ||
const width = screen.availWidth; | ||
if (width < 600) { | ||
return 'mobile'; | ||
} | ||
else if (width >= 600 && width < 1100) { | ||
return 'tablet'; | ||
} | ||
} | ||
export function getDeviceCustom() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
let source = ''; | ||
source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop'; | ||
return source; | ||
} | ||
export const getDevicePlatform = () => { | ||
@@ -33,0 +48,0 @@ const device = getDevice(); |
@@ -24,19 +24,2 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client'; | ||
function checkDeviceType() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
const width = screen.availWidth; | ||
const height = screen.availHeight; | ||
if (userAgent.includes('iphone')) { | ||
return 'mobile'; | ||
} | ||
if (userAgent.includes('android')) { | ||
if (height > width && width < 800) { | ||
return 'mobile'; | ||
} | ||
if (width > height && height < 800) { | ||
return 'tablet'; | ||
} | ||
} | ||
return 'desktop'; | ||
} | ||
const getDevice = () => { | ||
@@ -55,2 +38,17 @@ let userAgent = window.navigator.userAgent; | ||
}; | ||
function checkCustomDeviceWidth() { | ||
const width = screen.availWidth; | ||
if (width < 600) { | ||
return 'mobile'; | ||
} | ||
else if (width >= 600 && width < 1100) { | ||
return 'tablet'; | ||
} | ||
} | ||
function getDeviceCustom() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
let source = ''; | ||
source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop'; | ||
return source; | ||
} | ||
const getDevicePlatform = () => { | ||
@@ -228,3 +226,3 @@ const device = getDevice(); | ||
detectAndAlertDeviceType() { | ||
this.device = checkDeviceType(); | ||
this.device = getDeviceCustom(); | ||
} | ||
@@ -231,0 +229,0 @@ formatDate(dateString) { |
@@ -24,19 +24,2 @@ import { r as registerInstance, h } from './index-a6d43dfd.js'; | ||
function checkDeviceType() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
const width = screen.availWidth; | ||
const height = screen.availHeight; | ||
if (userAgent.includes('iphone')) { | ||
return 'mobile'; | ||
} | ||
if (userAgent.includes('android')) { | ||
if (height > width && width < 800) { | ||
return 'mobile'; | ||
} | ||
if (width > height && height < 800) { | ||
return 'tablet'; | ||
} | ||
} | ||
return 'desktop'; | ||
} | ||
const getDevice = () => { | ||
@@ -55,2 +38,17 @@ let userAgent = window.navigator.userAgent; | ||
}; | ||
function checkCustomDeviceWidth() { | ||
const width = screen.availWidth; | ||
if (width < 600) { | ||
return 'mobile'; | ||
} | ||
else if (width >= 600 && width < 1100) { | ||
return 'tablet'; | ||
} | ||
} | ||
function getDeviceCustom() { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
let source = ''; | ||
source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop'; | ||
return source; | ||
} | ||
const getDevicePlatform = () => { | ||
@@ -226,3 +224,3 @@ const device = getDevice(); | ||
detectAndAlertDeviceType() { | ||
this.device = checkDeviceType(); | ||
this.device = getDeviceCustom(); | ||
} | ||
@@ -229,0 +227,0 @@ formatDate(dateString) { |
export declare function checkDeviceType(): 'mobile' | 'tablet' | 'desktop'; | ||
export declare const getDevice: () => "Android" | "iPhone" | "iPad" | "PC"; | ||
export declare function getDeviceCustom(): string; | ||
export declare const getDevicePlatform: () => "dk" | "mtWeb"; |
{ | ||
"name": "@everymatrix/blog-article-details", | ||
"version": "1.14.0", | ||
"version": "1.14.2", | ||
"main": "./dist/index.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.js", |
359740
6336