diff --git a/prefixCSS.py b/prefixCSS.py index 55ddd1b65e87b9773e2651a87fc026e8487223d5..b6b5e7128b5cdc4724d42bf40f7b1143e6fa7311 100644 --- a/prefixCSS.py +++ b/prefixCSS.py @@ -5,6 +5,7 @@ import subprocess import argparse + def find_nth(haystack, needle, n): start = haystack.find(needle) while start >= 0 and n > 1: @@ -31,15 +32,26 @@ class ParserHTML: def prefixNgClassStrings(self, line, classStart): start = False classIndices = [] + stringComparison = False + seenQuestionmark = False for i, c in enumerate(line[classStart:], classStart): - if c == "'": + if c == "'" and not stringComparison: if not start: classIndices.append(i+1) start = True else: start = False - elif c == '}': + elif c == '}' or c =='"': break + elif c == ':' and not seenQuestionmark: + stringComparison = True + elif c == ',': + stringComparison = False + seenQuestionmark = False + elif c == '?': + # if we see a ?, the following : does not implicate a string comparison but a case separation + seenQuestionmark = True + for i, start in enumerate(classIndices): start += i * len(self.PREFIX) line = line[:start] + self.PREFIX + line[start:] @@ -105,17 +117,24 @@ class ParserHTML: newLines = [] with open(path) as f: content = '' - iTagOpen = False # remove linebreaks in tags + stringOpen = False for line in f: if not len(line.strip()): continue # line.count('"') % 2 --> opened but not closed like [ngClass]=" if line.count('"') % 2 and not line.strip().endswith('>'): content += line.strip() + ' ' + stringOpen = not stringOpen else: - content += line + '\n' - + if stringOpen: + # no new line + content += line.strip() + ' ' + else: + # new line + content += line + '\n' + + iTagOpen = False for line in content.split('\n'): line = line.strip() if '<i' in line: @@ -174,12 +193,12 @@ class ParserJS: ELEMENTBYIDSTRING = 'document.getElementById(' - def findIdPos(self, line): + def findId(self, line): start = line.find(self.ELEMENTBYIDSTRING) + len(self.ELEMENTBYIDSTRING)+1 return start def replaceElementById(self, line): - start = self.findIdPos(line) + start = self.findId(line) line = line[:start] + self.PREFIX + line[start:] return line diff --git a/src/app/components/toast/toast.component.html b/src/app/components/toast/toast.component.html index d265f9dbe5240fccd39f27a8130563b1a3346c1f..f8f17fcaf0696e8e9b9734b7409bb359bd95428c 100644 --- a/src/app/components/toast/toast.component.html +++ b/src/app/components/toast/toast.component.html @@ -3,7 +3,7 @@ <div class="toast {{getDrugstoneClass(toast.value.type)}}"> <a (click)="close(toast.key)" aria-label="close" class="close"> <span class="icon" title="Close analysis"> - <i class="fas fa-times" aria-hidden="true"></i> + <i class="fas fa-times toast-times" aria-hidden="true"></i> </span> </a> <p>{{toast.value.message}}</p> diff --git a/src/app/services/toast/toast.service.ts b/src/app/services/toast/toast.service.ts index 7b79b48bc98f3ca27909c707222526ed9fd766c5..e53464e298184f41818812200f6fa23ea28c2b38 100644 --- a/src/app/services/toast/toast.service.ts +++ b/src/app/services/toast/toast.service.ts @@ -27,7 +27,7 @@ export class ToastService { public setTimer(id: number) { setTimeout(() => { this.deleteToast(id); - }, 10000); + }, 100000000); } public deleteToast(id: number) { diff --git a/src/stylesheets/theme-styles.scss b/src/stylesheets/theme-styles.scss index 62bdb4dcc8f6bac843bf55aa1f3c7a5275f0e8e2..1da0834c14566bd20a41035ba75fc4c4e7a7e711 100644 --- a/src/stylesheets/theme-styles.scss +++ b/src/stylesheets/theme-styles.scss @@ -200,7 +200,7 @@ } - .fa-exclamation-triangle, .color-danger, .help, .delete:after, .delete:before, .modal-close:after, .modal-close:before { + .fa-exclamation-triangle, .fa-times, .color-danger, .help, .delete:after, .delete:before, .modal-close:after, .modal-close:before { color: var(--drgstn-danger) !important; } @@ -289,6 +289,10 @@ ::-webkit-scrollbar-button:increment { width: 0px !important; } + + .toast-times { + color: var(--drgstn-text-secondary) !important; + } } // scrolllbar styles