Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/wotwizard-ui
  • manutopik/wotwizard-ui
  • wellno1/wotwizard-ui
3 results
Show changes
if (process.browser) {
require("bootstrap")
}
\ No newline at end of file
import Vue from "vue"
import Tooltip from "~/node_modules/bootstrap/js/dist/tooltip"
import Collapse from "~/node_modules/bootstrap/js/dist/collapse"
import Alert from "~/node_modules/bootstrap/js/dist/alert"
Vue.directive("tooltip-click", function (el, binding) {
let tooltip = new Tooltip(el, {
title: binding.value,
html: true,
trigger: "manual"
})
el.onclick = function () {
tooltip.show()
setTimeout(() => {
tooltip.hide()
}, 1000)
}
})
Vue.directive("tooltip", function (el, binding, vnode) {
if (binding.value.title != "") {
let tooltip = new Tooltip(el, {
title: binding.value.title,
html: true,
placement: binding.value.placement,
trigger: "hover"
})
// vnode.context.$nextTick(() => {
// var x = new MutationObserver(function (e) {
// if (e[0].removedNodes) tooltip.hide()
// })
// x.observe(el.parentNode, { childList: true })
// })
}
})
import Vue from "vue"
export default (context, inject) => {
let liste_favoris = localStorage.favourites
? JSON.parse(localStorage.favourites)
: []
let toggleFavourite = (uid, e) => {
e.stopPropagation()
if (!context.$favourites.list.includes(uid)) {
context.$favourites.list.push(uid)
} else {
context.$favourites.list = context.$favourites.list.filter(
(item) => item !== uid
)
}
localStorage.favourites = JSON.stringify(context.$favourites.list)
}
let addFavorisArray = (certs, e) => {
for (const cert in certs) {
toggleFavourite(certs[cert].uid, e)
}
}
let compileArrays = (allIO, actualIO) => {
let all = allIO.map(function (CertHist) {
return {
...CertHist.id,
dateout: CertHist.hist
.filter((CertEvent) => !CertEvent.in)
.reduce(
function (prev, current) {
return prev.block.utc0 > current.block.utc0 ? prev : current
},
{ block: { utc0: 0 } }
).block.utc0
}
})
all.forEach((certifier) => {
let isFound = false
for (const certif of actualIO) {
if (certifier.uid == certif.uid) {
isFound = true
break
}
}
if (!isFound && certifier.status != "REVOKED") {
actualIO.push({
__typename: "Certification",
expires_on: certifier.dateout,
...certifier,
expired: true
})
}
})
return actualIO
}
let fixColumns = () => {
let tables = document.querySelectorAll(".table-responsive table")
tables.forEach((table) => {
let colWidth = [...table.querySelectorAll("tbody tr:first-child td")].map(
function (el) {
return el.offsetWidth
}
)
table.querySelectorAll("thead tr th").forEach((el, i) => {
el.style.width = colWidth[i] - 0.5 + "px"
})
})
}
inject(
"favourites",
Vue.observable({
list: liste_favoris,
toggleFavourite: toggleFavourite,
addFavorisArray: addFavorisArray,
compileArrays: compileArrays,
fixColumns: fixColumns
})
)
}
import Vue from "vue"
Vue.filter("dateStatus", (val) => {
if (val == 0) return "info"
const diff = val - Date.now() / 1000
switch (true) {
case diff < 0:
return "danger"
case diff < 2635200:
return "warning"
case diff >= 2635200:
return "success"
}
})
export default ({ app }) => {
Vue.filter("dateStatus", (val) => {
if (val == 0) return "danger"
const diff = val - Date.now() / 1000
switch (true) {
case diff < 0:
return "danger"
case diff < 2635200:
return "warning"
case diff >= 2635200:
return "success"
}
})
}
export default (context, inject) => {
const isFavourite = (uid) => {
if (!localStorage.favourites) {
return false
} else if (JSON.parse(localStorage.favourites).includes(uid)) {
return true
}
return false
}
inject("isFavourite", isFavourite)
// For Nuxt <= 2.12, also add 👇
// context.$hello = hello
}
import Vue from "vue"
let mixin = {
computed: {
getApolloClient() {
return localStorage.getItem("apollo-client") || "trentesaux"
}
}
}
Vue.mixin(mixin)
source diff could not be displayed: it is too large. Options to address this: view the blob.
static/favicon-96x96.png

5.47 KiB

static/favicon.ico

8.43 KiB

static/icon.png

8.54 KiB | W: 0px | H: 0px

static/icon.png

33.9 KiB | W: 0px | H: 0px

static/icon.png
static/icon.png
static/icon.png
static/icon.png
  • 2-up
  • Swipe
  • Onion skin
#!/bin/bash
# Color for echo
RED='\e[31m'
GREEN='\e[32m'
NC='\e[0m'
TMP_FILE=temp
KEY_FILE=keysUsed
# Get all used keys in Vue files
grep --include=\*.vue --exclude=\*template.vue -roE -e "\\\$(t|tc)\((\"|')([a-zA-Z.]*)(\"|')(, [a-zA-Z._]*){0,1}\)" . > $TMP_FILE
sed -i -e "s/'/\"/" $TMP_FILE
sed -i -e "s/'/\"/" $TMP_FILE
sed -i -E -e 's/\..*:\$(t|tc)\("([a-zA-Z.]*).*$/\2/' $TMP_FILE
# Remove duplicates keys
sort $TMP_FILE | uniq > $KEY_FILE
# Verify all i18n files
FILES="i18n/locales/*.json"
RETURN_CODE=0
for f in $FILES
do
echo -e "Processing ${GREEN}$f${NC} file..."
tmp=$(mktemp)
while read key; do
# Verify if key exists
jq -e ".$key" $f > /dev/null
status=$?
# If not, create it
if [ $status -ne 0 ]
then
echo -e "create ${RED}$key${NC} in file ${GREEN}$f${NC}"
value=$(jq -e ".$key" i18n/locales/fr.json)
if [ $value = "null" ]
then
filter=".$key = \"TO_TRANSLATE\""
else
filter=".$key = $value"
fi
jq --sort-keys "$filter" $f > "$tmp" && mv "$tmp" $f
RETURN_CODE=$((RETURN_CODE+1))
fi
done < $KEY_FILE
done
rm $KEY_FILE $TMP_FILE
# Return 0 if no key was created, or number of keys added
exit $RETURN_CODE
function openPage() {
browser.tabs.create({
url: "/fr/index.html"
});
}
browser.browserAction.onClicked.addListener(openPage);
{
"manifest_version": 2,
"name": "Wotwizard UI",
"description": "Le magicien de la toile de confiance",
"version": "2.5.2",
"homepage_url": "https://wotwizard.axiom-team.fr",
"browser_action": {
"browser_style": true,
"default_icon": "/_nuxt/icons/icon_64x64.0424c5.png",
"default_title": "Wotwizard UI"
},
"background": {
"scripts": ["/launch-web-ext.js"]
},
"icons": {
"64": "/_nuxt/icons/icon_64x64.0424c5.png",
"120": "/_nuxt/icons/icon_120x120.0424c5.png"
}
}