diff --git a/public/style/plugin.css b/public/style/plugin.css index a25365a..1980a26 100644 --- a/public/style/plugin.css +++ b/public/style/plugin.css @@ -142,7 +142,7 @@ top: 0; right: 0; line-height: normal; - font-size: 16px; + font-size: 12px; font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; background: #fff; z-index: 99999; diff --git a/src/app.js b/src/app.js index e37daa9..65914c1 100644 --- a/src/app.js +++ b/src/app.js @@ -311,8 +311,8 @@ function embedNbApp() { isSyncNotificationPopup: false, isSyncSpotlightNewThread: false, isNbLog: false, + nbLogEventsEnabled: [], syncSpotlightNewThreadConfig: {}, - isNbLogScroll: false, nbLogScrollSpoConfig: 2000, isShowQuickEditor: false, sortByConfig: 'init', @@ -554,8 +554,8 @@ function embedNbApp() { this.currentConfigs.isSyncNotificationPopup = configs['SYNC_NOTIFICATION_POPUP'] === 'true' ? true : false this.currentConfigs.isSyncSpotlightNewThread = configs['SYNC_SPOTLIGHT_NEW_THREAD'] === 'true' ? true : false this.currentConfigs.isNbLog = configs['NB_LOG'] === 'true' ? true : false + this.currentConfigs.nbLogEventsEnabled = configs['CONFIG_NB_LOG_EVENTS_ENABLED'] ? JSON.parse(configs['CONFIG_NB_LOG_EVENTS_ENABLED']) : [] this.currentConfigs.syncSpotlightNewThreadConfig = configs['CONFIG_SYNC_SPOTLIGHT_NEW_THREAD'] ? JSON.parse(configs['CONFIG_SYNC_SPOTLIGHT_NEW_THREAD']) : {} - this.currentConfigs.isNbLogScroll = configs['NB_LOG_SCROLL'] === 'true' ? true : false this.currentConfigs.nbLogScrollSpoConfig = configs['CONFIG_NB_LOG_SCROLL'] ? Number(configs['CONFIG_NB_LOG_SCROLL']) : 2000 this.currentConfigs.isShowQuickEditor = configs['SHOW_QUICK_EDITOR'] === 'true' ? true : false this.currentConfigs.sortByConfig = configs['CONFIG_SORT_BY'] ? configs['CONFIG_SORT_BY'] : 'recent' @@ -1277,7 +1277,7 @@ function embedNbApp() { window.removeEventListener('scroll', this.handleScroll) }, onLogNb: async function (event = 'NONE', initiator = 'NONE', spotlightType = 'NONE', isSyncAnnotation = false, hasSyncAnnotation = false, notificationTrigger = 'NONE', annotationId = null, countAnnotationReplies = 0) { - if (this.currentConfigs.isNbLog) { + if (this.currentConfigs.isNbLog && this.currentConfigs.nbLogEventsEnabled.includes(event)) { // console.log(`onLogNb \nevent: ${event} \ninitiator: ${initiator} \nspotlightType: ${spotlightType} \nisSyncAnnotation: ${isSyncAnnotation} \nhasSyncAnnotation: ${hasSyncAnnotation} \nnotificationTrigger: ${notificationTrigger} \nannotationId: ${annotationId} \nannotation_replies_count: ${countAnnotationReplies}`) const token = localStorage.getItem("nb.user"); const config = { headers: { Authorization: 'Bearer ' + token }, params: { url: this.sourceURL } } @@ -1327,7 +1327,7 @@ function embedNbApp() { return new Promise(resolve => setTimeout(resolve, ms)) }, handleScroll: function (e) { - if (this.currentConfigs.isNbLogScroll) { + if (this.currentConfigs.nbLogEventsEnabled.includes('SCROLL')) { clearTimeout(this.scrollLogTimer) this.scrollLogTimer = setTimeout(() => this.onLogNb('SCROLL'), this.currentConfigs.nbLogScrollSpoConfig) } diff --git a/src/components/list/ListView.vue b/src/components/list/ListView.vue index 3bdafaa..e2f25fe 100644 --- a/src/components/list/ListView.vue +++ b/src/components/list/ListView.vue @@ -10,7 +10,7 @@
- {{ threads.length }} of {{ totalLabel }} + {{ currentThreadsCount }} of {{ totalLabel }} @@ -146,6 +146,9 @@ export default { this.sortBy = this.currentConfigs.sortByConfig }, computed: { + currentThreadsCount: function () { + return this.threads.length + }, totalLabel: function () { if (this.totalCount === 1) { return '1 thread' @@ -216,3 +219,11 @@ export default { } } +