Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="header">
  3. <!-- Left side of header -->
  4. <div class="left">
  5. <Button
  6. @click="onRouteChange('/')"
  7. class="p-button-primary"
  8. label="Search and Displace" />
  9. </div>
  10. <!-- Right side of header -->
  11. <div class="right">
  12. <Button
  13. @click="onRouteChange('/regex/create')"
  14. class="p-button-primary fc-button"
  15. label="Add regex" />
  16. <Button
  17. @click="onRouteChange('/searchers')"
  18. class="p-button-primary fc-button"
  19. label="Searchers" />
  20. </div>
  21. <ConfirmDialog :blockScroll="false"></ConfirmDialog>
  22. </div>
  23. </template>
  24. <script lang="ts">
  25. import Vue from 'vue';
  26. import Component from 'vue-class-component';
  27. @Component
  28. export default class AppHeader extends Vue {
  29. onHomeButtonClick() {
  30. window.location.href = '/';
  31. }
  32. onRouteChange(url: string) {
  33. const el = document.body;
  34. setTimeout(() => {
  35. el.classList.remove('p-overflow-hidden');
  36. }, 10);
  37. this.$confirm.require({
  38. message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
  39. header: 'Confirmation',
  40. icon: 'pi pi-exclamation-triangle',
  41. blockScroll: false,
  42. accept: () => {
  43. window.location.href = url;
  44. },
  45. reject: () => {
  46. // TODO: Show a message to the user that the action was cancelled.
  47. }
  48. });
  49. }
  50. }
  51. </script>