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.

52 lines
1.5 KiB

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="Add regex" />
  20. </div>
  21. <ConfirmDialog></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. this.$confirm.require({
  34. message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
  35. header: 'Confirmation',
  36. icon: 'pi pi-exclamation-triangle',
  37. accept: () => {
  38. console.log("ACCEPT!");
  39. window.location.href = url;
  40. },
  41. reject: () => {
  42. // TODO: Show a message to the user that the action was cancelled.
  43. }
  44. });
  45. }
  46. }
  47. </script>