Skip to content

Commit

Permalink
Merge pull request #857 from alpheios-project/i856-home-link
Browse files Browse the repository at this point in the history
Add to Home link
  • Loading branch information
irina060981 authored Jul 11, 2022
2 parents 737f180 + 6d623e7 commit 66d038e
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
5 changes: 5 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ body, html {
/* padding: 0 10px 0 35px;*/
}

.header-logo {
cursor: pointer;
}


.header-logo img {
display: block;
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</script>
<div class="container">
<div class="header alpheios-header">
<div class="header-logo">
<div class="header-logo" onclick="location.reload(true)" title="to Home">
<img src="images/alpheios-logo-only.png" class="logo-1">
<img src="images/alpheios-logo-black.png" class="logo-2">
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/controllers/texts-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ export default class TextsController {
const result = await StorageController.deleteMany(alData.alignmentID, 'fullAlignmentByID')

if (result) {
this.store.commit('incremetReloadAlignmentsList')
this.store.commit('incrementReloadAlignmentsList')
}
return result
}
Expand Down Expand Up @@ -643,7 +643,7 @@ export default class TextsController {
const result = await StorageController.clear()

if (result) {
this.store.commit('incremetReloadAlignmentsList')
this.store.commit('incrementReloadAlignmentsList')
}
return result
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/store/store-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class StoreDefinition {
incrementUploadPartNum (state) {
state.uploadPartNum++
},
incremetReloadAlignmentsList (state) {
incrementReloadAlignmentsList (state) {
state.reloadAlignmentsList++
},
incrementUpdateAnnotations (state) {
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en-us/messages-initial-screen.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"TO_HOME": {
"message": "Home",
"description": "Button in Main Menu",
"component": "Main Menu"
},
"INITIAL_NEW_ALIGNMENT": {
"message": "Begin new alignment",
"description": "Button on initial screen",
Expand Down
12 changes: 10 additions & 2 deletions src/vue/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@redo-action = "redoAction"
@undo-action = "undoAction"
@add-target = "addTarget"
@clear-all = "startOver"
@clear-all = "clearAll"
@new-initial-alignment = "startNewInitialAlignment"
@upload-data-from-db = "uploadDataFromDB"

Expand All @@ -26,7 +26,8 @@
<initial-screen v-show="showInitialScreenBlock"
@upload-data-from-file = "uploadDataFromFile" @upload-data-from-db = "uploadDataFromDB" @delete-data-from-db = "deleteDataFromDB"
@new-initial-alignment="startNewInitialAlignment" @clear-all-alignments="clearAllAlignmentsFromDB"/>
<text-editor v-show="showSourceTextEditorBlock" @add-translation="addTarget" @align-text="showSummaryPopup" @showAlignmentGroupsEditor = "showAlignmentGroupsEditor" @showTokensEditor = "showTokensEditor"
<text-editor v-show="showSourceTextEditorBlock" @add-translation="addTarget" @align-text="showSummaryPopup"
@showAlignmentGroupsEditor = "showAlignmentGroupsEditor" @showTokensEditor = "showTokensEditor"
/>
<align-editor v-show="showAlignmentGroupsEditorBlock" @showSourceTextEditor = "showSourceTextEditor" @showTokensEditor = "showTokensEditor"
/>
Expand Down Expand Up @@ -246,6 +247,7 @@ export default {
createANewAlignment (alTitle) {
this.$textC.createAlignment(alTitle)
this.$historyAGC.startTracking(this.$textC.alignment)
this.$textC.store.commit('incrementAlignmentRestarted')
this.showSourceTextEditor()
},
Expand Down Expand Up @@ -337,6 +339,12 @@ export default {
} else {
this.showSourceTextEditor()
}
},
clearAll () {
NotificationSingleton.clearNotifications()
this.$textC.store.commit('incrementReloadAlignmentsList')
this.showInitialScreen()
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/vue/initial-screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export default {
methods: {
startNewAlignment () {
this.$emit("new-initial-alignment")
this.showUploadBlock = false
this.showUploadFromDB = false
},
resumePrevAlignment () {
this.showUploadBlock = true
Expand Down Expand Up @@ -129,6 +131,7 @@ export default {
uploadDataFromDB (alData) {
this.$emit('upload-data-from-db', alData)
this.showUploadBlock = false
this.showUploadFromDB = false
},
deleteDataFromDB (alData) {
Expand Down
17 changes: 14 additions & 3 deletions src/vue/main-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
</span>
<div class="alpheios-alignment-app-menu__buttons">
<div class="alpheios-alignment-app-menu__buttons-actions">

<button class="alpheios-app-menu-link" id ="alpheios-main-menu-clear-all"
@click="clearAll">
@click="reloadPage">
{{ l10n.getMsgS('TO_HOME') }}
</button>
<button class="alpheios-app-menu-link" id ="alpheios-main-menu-clear-all"
@click="newInitialAlignment">
{{ l10n.getMsgS('INITIAL_NEW_ALIGNMENT') }}
</button>

Expand Down Expand Up @@ -174,6 +177,11 @@ export default {
return `alpheios-main-menu-download-block__radio_${dTypeName}`
},
newInitialAlignment () {
this.clearAll()
this.$emit("new-initial-alignment")
},
clearAll () {
this.$refs.alpheiosfileupload.value = ''
this.showUploadBlock = false
Expand All @@ -182,9 +190,12 @@ export default {
this.currentPage = 'initial-page'
this.closeMenu()
this.$emit("new-initial-alignment")
},
reloadPage () {
location.reload(true)
},
closeMenu () {
this.menuShown = false
},
Expand Down

0 comments on commit 66d038e

Please sign in to comment.