Commit 96cec5e6 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

read data-attr for annotableImages config value

parent 11ec4659
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@

Instanciation de la lib [vue3-jama](https://git.unicaen.fr/pdn-certic/vue3-jama).

Pour désactiver les annotations, ajouter avant compilation dans un fichier .env de ce dossier:
Pour activer les annotations, ajouter aux variables d'env JAMA : 

```
VITE_ANNOTATIONS_ENABLED=0
JAMA_UI_ANNOTATIONS="1"
```
+7 −5
Original line number Diff line number Diff line
@@ -3,15 +3,17 @@ import "@pdn-certic/vue3-jama/dist/style.css";
import {VueJamaPlugin, VueJamaApp} from "@pdn-certic/vue3-jama";
import 'vuetify/styles'

const withAnnotations : boolean = Number(import.meta.env.VITE_ANNOTATIONS_ENABLED) != 0
const annotableImages = document.getElementById('app')?.dataset.annotations != undefined &&
    document.getElementById('app')?.dataset.annotations?.toLowerCase()!=='false';

let jamaOptions: any = {
    title: 'Jama UI',
    assetsPrefix:'/static/ui/assets/'
}
};

jamaOptions.annotableImages = withAnnotations
jamaOptions.annotableImages = annotableImages;
console.debug('Enabled annotations ?', jamaOptions.annotableImages);

const app = createApp(VueJamaApp, jamaOptions);
app.use(VueJamaPlugin, true)
app.mount('#app')
app.use(VueJamaPlugin, true);
app.mount('#app');
+4 −4
Original line number Diff line number Diff line
@@ -299,10 +299,10 @@
  resolved "https://registry.yarnpkg.com/@mdi/font/-/font-7.4.47.tgz#2ae522867da3a5c88b738d54b403eb91471903af"
  integrity sha512-43MtGpd585SNzHZPcYowu/84Vz2a2g31TvPMTm9uTiCSWzaheQySUcSyUH/46fPnuPQWof2yd0pGBtzee/IQWw==

"@pdn-certic/vue3-jama@0.7.4":
  version "0.7.4"
  resolved "https://git.unicaen.fr/api/v4/projects/855/packages/npm/@pdn-certic/vue3-jama/-/@pdn-certic/vue3-jama-0.7.4.tgz#59bbc92852c8c191345c07155e9b7dd463a7da5a"
  integrity sha1-WbvJKFLIwZE0XAcVXpt91GOn2lo=
"@pdn-certic/vue3-jama@0.7.5":
  version "0.7.5"
  resolved "https://git.unicaen.fr/api/v4/projects/855/packages/npm/@pdn-certic/vue3-jama/-/@pdn-certic/vue3-jama-0.7.5.tgz#9a0e765b6e4e737c65682cba2578c73e23f72122"
  integrity sha1-mg52W25Oc3xlaCy6JXjHPiP3ISI=
  dependencies:
    "@certic/certic-ouai" "0.0.26"
    "@mdi/font" "^7.4.47"