Add:Open/close RSS feed for library items

This commit is contained in:
advplyr 2023-06-24 14:45:25 -05:00
parent 1ddb6eca00
commit c8053355df
18 changed files with 1238 additions and 12 deletions

View file

@ -3,7 +3,8 @@ import vClickOutside from 'v-click-outside'
import { App } from '@capacitor/app'
import { Dialog } from '@capacitor/dialog'
import { AbsFileSystem } from '@/plugins/capacitor'
import { StatusBar, Style } from '@capacitor/status-bar';
import { StatusBar, Style } from '@capacitor/status-bar'
import { Clipboard } from '@capacitor/clipboard'
import { formatDistance, format, addDays, isDate } from 'date-fns'
import { Capacitor } from '@capacitor/core'
@ -191,14 +192,49 @@ Vue.prototype.$setOrientationLock = (orientationLockSetting) => {
if (!window.screen?.orientation) return
if (orientationLockSetting == 'PORTRAIT') {
window.screen.orientation.lock?.('portrait')
window.screen.orientation.lock?.('portrait').catch((error) => {
console.error(error)
})
} else if (orientationLockSetting == 'LANDSCAPE') {
window.screen.orientation.lock?.('landscape')
window.screen.orientation.lock?.('landscape').catch((error) => {
console.error(error)
})
} else {
window.screen.orientation.unlock?.()
}
}
Vue.prototype.$copyToClipboard = (str) => {
return Clipboard.write({
string: str
})
}
// SOURCE: https://gist.github.com/spyesx/561b1d65d4afb595f295
// modified: allowed underscores
Vue.prototype.$sanitizeSlug = (str) => {
if (!str) return ''
str = str.replace(/^\s+|\s+$/g, '') // trim
str = str.toLowerCase()
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/,:;"
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn-----"
for (var i = 0, l = from.length; i < l; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i))
}
str = str.replace('.', '-') // replace a dot by a dash
.replace(/[^a-z0-9 -_]/g, '') // remove invalid chars
.replace(/\s+/g, '-') // collapse whitespace and replace by a dash
.replace(/-+/g, '-') // collapse dashes
.replace(/\//g, '') // collapse all forward-slashes
return str
}
export default ({ store, app }, inject) => {
const eventBus = new Vue()
inject('eventBus', eventBus)