diff --git a/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.css b/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.js b/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.js new file mode 100644 index 000000000..b66b234e6 --- /dev/null +++ b/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.js @@ -0,0 +1,26 @@ +import Vue from 'vue' + +export default Vue.extend({ + name: 'FtTimestampCatcher', + props: { + inputHTML: { + type: String, + default: '' + } + }, + methods: { + catchTimestampClick: function(event) { + const match = event.detail.match(/(\d+):(\d+):?(\d+)?/) + if (match[3] !== undefined) { // HH:MM:SS + const seconds = 3600 * Number(match[1]) + 60 * Number(match[2]) + Number(match[3]) + this.$emit('timestampEvent', seconds) + } else { // MM:SS + const seconds = 60 * Number(match[1]) + Number(match[2]) + this.$emit('timestampEvent', seconds) + } + }, + detectTimestamps: function (input) { + return input.replaceAll(/(\d+(:\d+)+)/g, '$1') + } + } +}) diff --git a/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.vue b/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.vue new file mode 100644 index 000000000..034da7c83 --- /dev/null +++ b/src/renderer/components/ft-timestamp-catcher/ft-timestamp-catcher.vue @@ -0,0 +1,9 @@ + + +