mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
* Add support to x vversion from npm * Add support to x vversion from npm * Add support to x vversion from npm * Add documentation for current repository
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
import axios from 'axios'
|
|
import dynamicLoadScript from './dynamic-load-script'
|
|
|
|
export function getCodefund(template = 'default') {
|
|
const codefundId = isGitee() ? '79' : '116'
|
|
axios
|
|
.get(
|
|
`https://codefund.io/properties/${codefundId}/funder.html?template=${template}`
|
|
)
|
|
.then(function(response) {
|
|
document.getElementById('codefund').innerHTML = response.data
|
|
})
|
|
}
|
|
|
|
export function isGitee() {
|
|
const origin = window.location.origin
|
|
if (origin.includes('gitee.io')) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
export function loadCarbon() {
|
|
const id = '_carbonads_js'
|
|
const existingScript = document.getElementById(id)
|
|
if (existingScript) return
|
|
const script = document.createElement('script')
|
|
|
|
document.body.appendChild(script)
|
|
dynamicLoadScript(
|
|
'https://cdn.carbonads.com/carbon.js?serve=CE7IK5QY&placement=panjiachengithubio',
|
|
() => {},
|
|
id
|
|
)
|
|
}
|
|
|
|
export function loadGitter() {
|
|
const id = 'adempiere-vue/discuss'
|
|
const existingScript = document.getElementById(id)
|
|
if (existingScript) return
|
|
const script = document.createElement('script')
|
|
script.id = id
|
|
script.text =
|
|
"((window.gitter = {}).chat = {}).options = {room: 'adempiere-vue/discuss'};"
|
|
document.body.appendChild(script)
|
|
dynamicLoadScript('https://sidecar.gitter.im/dist/sidecar.v1.js')
|
|
}
|