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.

50 lines
1.4 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="Searchers" />
  20. </div>
  21. </div>
  22. </template>
  23. <script lang="ts">
  24. import Vue from 'vue';
  25. import Component from 'vue-class-component';
  26. @Component
  27. export default class AppHeader extends Vue {
  28. onHomeButtonClick() {
  29. window.location.href = '/';
  30. }
  31. onRouteChange(url: string) {
  32. this.$confirm.require({
  33. message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
  34. header: 'Confirmation',
  35. icon: 'pi pi-exclamation-triangle',
  36. accept: () => {
  37. console.log("ACCEPT!");
  38. window.location.href = url;
  39. },
  40. reject: () => {
  41. // TODO: Show a message to the user that the action was cancelled.
  42. }
  43. });
  44. }
  45. }
  46. </script>