Changeset 35805
- Timestamp:
- 2021-12-13T13:36:30+13:00 (3 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/ocr/src/components
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/EditPage.vue
r35770 r35805 213 213 } 214 214 215 const that = this;216 217 215 ModalController.open( 218 216 this.translations.get("DiscardEditsModal_Title"), … … 222 220 this.translations.get("DiscardEditsModal_ButtonCancel") 223 221 ], 224 async function(buttonName){225 if (buttonName === th at.translations.get("DiscardEditsModal_ButtonContinue")) {226 th at.closeAndDiscard(true);222 (buttonName) => { 223 if (buttonName === this.translations.get("DiscardEditsModal_ButtonContinue")) { 224 this.closeAndDiscard(true); 227 225 } 228 226 } … … 233 231 234 232 const buffer = Buffer.from(this.imageBuffer); 235 const that = this;236 233 237 234 const modifiedBuffer = await Jimp.read(buffer) 238 235 .then(async image => { 239 if (th at.invert) {236 if (this.invert) { 240 237 image.invert(); 241 238 } 242 239 243 if (th at.rotation !== 0) {244 image.rotate(-th at.rotation);240 if (this.rotation !== 0) { 241 image.rotate(-this.rotation); 245 242 } 246 243 -
main/trunk/model-interfaces-dev/atea/ocr/src/components/MainPage.vue
r35800 r35805 79 79 } 80 80 81 const that = this;82 81 this.ocrInProgress = true; 83 const longTimeout = setTimeout(function() { 84 SnackController.addSnack(that.translations.get("MainPage_DelayedOcrMessage"), 8000); 85 }, 10000); 82 83 const longTimeout = setTimeout(() => { 84 SnackController.addSnack(this.translations.get("MainPage_DelayedOcrMessage"), 8000); 85 }, 10000) 86 86 87 87 const arrayView = new Uint8Array(this.imageBuffer); … … 118 118 }, 119 119 confirmOcr() { 120 const that = this;121 122 120 ModalController.open( 123 121 this.translations.get("OCREditedModal_Title"), … … 127 125 this.translations.get("OCREditedModal_ButtonCancel") 128 126 ], 129 async function(buttonName){130 if (buttonName === th at.translations.get("OCREditedModal_ButtonContinue")) {131 th at.ocrTextEdited = false;132 await th at.doOcr();127 async (buttonName) => { 128 if (buttonName === this.translations.get("OCREditedModal_ButtonContinue")) { 129 this.ocrTextEdited = false; 130 await this.doOcr(); 133 131 } 134 132 } … … 153 151 reset(hard) { 154 152 if (!hard) { 155 const that = this;156 157 153 ModalController.open( 158 154 this.translations.get("NewImageModal_Title"), … … 162 158 this.translations.get("NewImageModal_ButtonCancel") 163 159 ], 164 function(buttonName){165 if (buttonName === th at.translations.get("NewImageModal_ButtonContinue")) {166 th at.reset(true);160 (buttonName) => { 161 if (buttonName === this.translations.get("NewImageModal_ButtonContinue")) { 162 this.reset(true); 167 163 } 168 164 } -
main/trunk/model-interfaces-dev/atea/ocr/src/components/ModalDialog.vue
r35762 r35805 109 109 this.waitingOnClose = true; 110 110 const item = this.queue.shift(); 111 const that = this;112 111 113 112 this.modal.show( … … 115 114 item.description, 116 115 item.buttons, 117 function(buttonName, id){118 th at.waitingOnClose = false;119 th at.showModals();116 (buttonName, id) => { 117 this.waitingOnClose = false; 118 this.showModals(); 120 119 item.callback(buttonName, id); 121 120 }, -
main/trunk/model-interfaces-dev/atea/ocr/src/components/OcrImageDisplay.vue
r35793 r35805 53 53 e.preventDefault(); 54 54 55 const that = this;56 55 /** @type {DOMRect} */ 57 const magContainerBounds = th at.$refs.magContainer.getBoundingClientRect();56 const magContainerBounds = this.$refs.magContainer.getBoundingClientRect(); 58 57 /** @type {HTMLDivElement} */ 59 58 const magnifier = this.$refs.magnifier; … … 124 123 watch: { 125 124 imageUrl() { 126 const that = this; 127 setTimeout(function() { 128 that.updateMagnifier(that.$refs.ocrImage); 125 setTimeout(() => { 126 this.updateMagnifier(this.$refs.ocrImage); 129 127 }, 100); 130 128 }, … … 134 132 } 135 133 136 const that = this; 137 setTimeout(function() { 138 that.updateMagnifier(that.$refs.thresholdedImage); 134 setTimeout(() => { 135 this.updateMagnifier(this.$refs.thresholdedImage); 139 136 }, 100); 140 137 }, 141 138 showThresholdedImage(newValue) { 142 const that = this; 143 setTimeout(function() { 139 setTimeout(() => { 144 140 if (newValue) { 145 th at.updateMagnifier(that.$refs.thresholdedImage);141 this.updateMagnifier(this.$refs.thresholdedImage); 146 142 } 147 143 else { 148 th at.updateMagnifier(that.$refs.ocrImage);144 this.updateMagnifier(this.$refs.ocrImage); 149 145 } 150 146 }, 100); … … 160 156 }, 161 157 mounted() { 162 const that = this; 163 setTimeout(function() { 164 that.updateMagnifier(that.$refs.ocrImage); 158 setTimeout(() => { 159 this.updateMagnifier(this.$refs.ocrImage); 165 160 }, 100); 166 161 } -
main/trunk/model-interfaces-dev/atea/ocr/src/components/Snackbar.vue
r35785 r35805 40 40 setContent(content, timeout = 3000) { 41 41 this.content = content; 42 const that = this;43 42 44 setTimeout( function(){45 th at.content = null;43 setTimeout(() => { 44 this.content = null; 46 45 }, timeout); 47 46 }
Note:
See TracChangeset
for help on using the changeset viewer.