@saooti/octopus-sdk 33.0.3 → 33.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -690,3 +690,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
690
690
  * 32.0.40 Problème majeur !!!
691
691
 
692
692
  * 33.0.3 SpeechToText player octopus
693
+ * 33.0.4 Image webp
694
+ * 33.0.5 Change recaptcha
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "33.0.3",
3
+ "version": "33.0.5",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -37,7 +37,7 @@
37
37
  "vue": "^3.2.37",
38
38
  "vue-i18n": "^9.2.0-beta.40",
39
39
  "vue-multiselect": "^3.0.0-alpha.2",
40
- "vue-recaptcha-v3": "^2.0.1",
40
+ "vue-recaptcha": "^2.0.3",
41
41
  "vue-router": "^4.1.2",
42
42
  "vue3-lazyload": "^0.2.5-beta",
43
43
  "vue3-swatches": "^1.0.10",
Binary file
Binary file
Binary file
Binary file
@@ -45,11 +45,20 @@
45
45
  >
46
46
  {{ $t('Close') }}
47
47
  </button>
48
+ <vue-recaptcha
49
+ ref="invisibleRecaptcha"
50
+ :load-recaptcha-script="true"
51
+ @verify="handleSuccess"
52
+ @expired="handleError"
53
+ size="invisible"
54
+ sitekey="6LfyP_4ZAAAAAPODj8nov2LvosIwcX0GYeBSungh"
55
+ >
56
+ </vue-recaptcha>
48
57
  <button
49
58
  v-if="!sending"
50
59
  class="btn btn-primary m-1"
51
60
  :disabled="0 === countName || !validName"
52
- @click="validateName"
61
+ @click="submit"
53
62
  >
54
63
  {{ $t('Validate') }}
55
64
  </button>
@@ -63,9 +72,13 @@
63
72
  import Constants from '../../../../public/config';
64
73
  import { state } from '../../../store/paramStore';
65
74
  import api from '@/api/initialize';
66
- import { defineComponent } from 'vue'
75
+ import { VueRecaptcha } from 'vue-recaptcha';
76
+ import { defineComponent } from 'vue';
67
77
  export default defineComponent({
68
78
  name: 'AddCommentModal',
79
+ components:{
80
+ VueRecaptcha
81
+ },
69
82
 
70
83
  props: {},
71
84
  emits: ['close','validate'],
@@ -74,8 +87,8 @@ export default defineComponent({
74
87
  return {
75
88
  name: '' as string,
76
89
  sending: false as boolean,
77
- needVerify: true as boolean,
78
90
  sendError: false as boolean,
91
+ isVerify: false as boolean,
79
92
  maxName : Constants.MAX_COMMENT_NAME as number
80
93
  };
81
94
  },
@@ -97,34 +110,26 @@ export default defineComponent({
97
110
  },
98
111
  },
99
112
 
100
- mounted() {
101
- this.displayCaptcha('block');
113
+ created() {
102
114
  this.initAuthenticatedName();
103
115
  },
104
- unmounted() {
105
- this.displayCaptcha('none');
106
- },
107
116
  methods: {
108
117
  initAuthenticatedName():void{
109
118
  if (!state.generalParameters.authenticated) { return; }
110
119
  this.name = (`${this.$store.state.profile.firstname||''} ${this.$store.state.profile.lastname||''}`).trim();
111
- this.needVerify = false;
120
+ this.isVerify = true;
121
+ },
122
+ async handleSuccess(token: string) {
123
+ this.isVerify = await api.checkToken(token);
124
+ this.sendComment();
112
125
  },
113
- displayCaptcha(displayStyle: string): void{
114
- const captcha = document.getElementsByClassName('grecaptcha-badge')[0];
115
- if (!captcha) {return;}
116
- (captcha as HTMLElement).style.display = displayStyle;
126
+ handleError() {
127
+ this.isVerify = false;
128
+ this.sendError = true;
117
129
  },
118
- async validateName(): Promise<void> {
119
- if (this.needVerify && this.isCaptchaTest) {
120
- try {
121
- await this.$recaptchaLoaded()
122
- const token = await this.$recaptcha('login');
123
- this.sendError = !await api.checkToken(token);
124
- } catch {
125
- this.sendError = true;
126
- }
127
- if(this.sendError){return;}
130
+ async submit(): Promise<void> {
131
+ if (!this.isVerify && !this.isCaptchaTest) {
132
+ return (this.$refs.invisibleRecaptcha as InstanceType<typeof VueRecaptcha>).execute();
128
133
  }
129
134
  this.sendComment();
130
135
  },
@@ -119,7 +119,7 @@ import { Organisation } from '@/store/class/general/organisation';
119
119
 
120
120
  const ELEMENTS_COUNT = 50;
121
121
  const DEFAULT_ORGANISATION_ID = "";
122
- const DEFAULT_ORGANISATION_IMAGE = '/img/emptypodcast.png';
122
+ const DEFAULT_ORGANISATION_IMAGE = '/img/emptypodcast.webp';
123
123
 
124
124
  const getDefaultOrganistion = (defaultName: string) => {
125
125
  if(''===defaultName){
@@ -66,7 +66,7 @@
66
66
  >
67
67
  <img
68
68
  class="acpm_image"
69
- src="/img/ACPM.png"
69
+ src="/img/ACPM.webp"
70
70
  :title="$t('Octopus is ACPM Podcast accredited')"
71
71
  :alt="$t('Octopus is ACPM Podcast accredited')"
72
72
  >
@@ -117,7 +117,7 @@ export default defineComponent({
117
117
  return undefined;
118
118
  },
119
119
  logoUrl(): string {
120
- return this.isEducation ?'/img/logo_education.png': '/img/logo_octopus_final.svg';
120
+ return this.isEducation ?'/img/logo_education.webp': '/img/logo_octopus_final.svg';
121
121
  },
122
122
  isPodcastmaker(): boolean {
123
123
  return (state.generalParameters.podcastmaker as boolean);
@@ -60,12 +60,12 @@
60
60
  </div>
61
61
  <button
62
62
  :title="$t('Enlarge')"
63
- class="btn play-button-box primary-bg text-light saooti-up"
63
+ class="btn play-button-box saooti-up"
64
64
  @click="changePlayerLargeVersion"
65
65
  />
66
66
  <button
67
67
  :title="$t('Close')"
68
- class="btn play-button-box primary-bg text-light saooti-remove"
68
+ class="btn play-button-box saooti-remove"
69
69
  @click="stopPlayer"
70
70
  />
71
71
  <PlayerTimeline
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  <img
13
13
  class="stop-octopus-img"
14
- src="/img/403.jpeg"
14
+ src="/img/403.webp"
15
15
  :alt="$t('You do not have the right to access this page')"
16
16
  >
17
17
  </div>
package/src/main.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { createApp } from 'vue';
2
- import { VueReCaptcha } from 'vue-recaptcha-v3';
3
2
  import VueLazyLoad from 'vue3-lazyload';
4
3
  import App from './App.vue';
5
4
  import {setupI18n} from './i18n';
@@ -57,5 +56,4 @@ createApp(App)
57
56
  .use(store)
58
57
  .use(router)
59
58
  .use(VueLazyLoad)
60
- .use(VueReCaptcha, { siteKey: '6LfyP_4ZAAAAAPODj8nov2LvosIwcX0GYeBSungh' })
61
59
  .mount('#app');
@@ -78,15 +78,15 @@ const state:ParamStore = {
78
78
  contactLink: undefined,
79
79
  },
80
80
  organisation: {
81
- imageUrl: '/img/emptypodcast.png',
81
+ imageUrl: '/img/emptypodcast.webp',
82
82
  name: 'Saooti',
83
83
  userName: '',
84
84
  },
85
85
  octopusApi: {
86
- url: 'http://api.dev2.saooti.org/',
87
- commentsUrl: 'http://comments.dev2.saooti.org/',
88
- imageUrl:'http://imageproxy.dev2.saooti.org/',
89
- studioUrl: 'http://studio.dev2.saooti.org/',
86
+ url: 'https://api.dev2.saooti.org/',
87
+ commentsUrl: 'https://comments.dev2.saooti.org/',
88
+ imageUrl:'https://imageproxy.dev2.saooti.org/',
89
+ studioUrl: 'https://studio.dev2.saooti.org/',
90
90
  playerUrl: 'https://playerbeta.dev2.saooti.org/',
91
91
  speechToTextUrl:'https://speech2text.dev2.saooti.org/',
92
92
  recoUrl: 'https://reco.dev2.saooti.org/',
Binary file
Binary file
Binary file
Binary file