first commit
This commit is contained in:
29
services/web/frontend/js/main/account-upgrade.ts
Normal file
29
services/web/frontend/js/main/account-upgrade.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as eventTracking from '../infrastructure/event-tracking'
|
||||
|
||||
export function startFreeTrial(source: string, variant?: string) {
|
||||
const eventSegmentation: Record<string, string> = { 'paywall-type': source }
|
||||
if (variant) {
|
||||
eventSegmentation.variant = variant
|
||||
}
|
||||
|
||||
eventTracking.send('subscription-funnel', 'upgraded-free-trial', source)
|
||||
eventTracking.sendMB('paywall-click', eventSegmentation)
|
||||
|
||||
const searchParams = new URLSearchParams({
|
||||
itm_campaign: source,
|
||||
})
|
||||
|
||||
window.open(`/user/subscription/choose-your-plan?${searchParams.toString()}`)
|
||||
}
|
||||
|
||||
export function upgradePlan(source: string) {
|
||||
const openedWindow = window.open()
|
||||
|
||||
if (typeof window.ga === 'function') {
|
||||
window.ga('send', 'event', 'subscription-funnel', 'upgraded-plan', source)
|
||||
}
|
||||
|
||||
if (openedWindow) {
|
||||
openedWindow.location = '/user/subscription'
|
||||
}
|
||||
}
|
10
services/web/frontend/js/main/is-valid-tex-file.ts
Normal file
10
services/web/frontend/js/main/is-valid-tex-file.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
export const isValidTeXFile = (filename: string) => {
|
||||
const validTeXFileRegExp = new RegExp(
|
||||
`\\.(${getMeta('ol-ExposedSettings').validRootDocExtensions.join('|')})$`,
|
||||
'i'
|
||||
)
|
||||
|
||||
return validTeXFileRegExp.test(filename)
|
||||
}
|
Reference in New Issue
Block a user