Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NacoStubCreateModal from "@/components/panels/edit/modals/NacoStubCreateM
import ShelfListingModal from "@/components/panels/edit/modals/ShelfListing.vue";
import AutoDeweyModal from "./components/panels/edit/modals/AutoDeweyModal.vue";
import UpdateAvailableModal from "@/components/general/UpdateAvailableModal.vue";
import CipModal from "@/components/panels/edit/modals/CipModal.vue"



Expand Down Expand Up @@ -48,7 +49,8 @@ export default {
NonLatinAgentModal,
FieldColorsModal,
HubStubCreateModal,
NacoStubCreateModal
NacoStubCreateModal,
CipModal

},
data() {
Expand All @@ -63,7 +65,7 @@ export default {
...mapStores(useConfigStore, useProfileStore, usePreferenceStore),
// // gives read access to this.count and this.double
...mapState(useProfileStore, ['profilesLoaded', 'showValidateModal','profilesLoaded', 'showPostModal', 'showItemInstanceSelection', 'isTestEnv']),
...mapWritableState(useProfileStore, ['showShelfListingModal','showHubStubCreateModal', 'showAutoDeweyModal', 'showNacoStubCreateModal']),
...mapWritableState(useProfileStore, ['showShelfListingModal','showHubStubCreateModal', 'showAutoDeweyModal', 'showNacoStubCreateModal', 'showCipModal']),

...mapState(usePreferenceStore, ['showPrefModal','catCode']),
...mapWritableState(usePreferenceStore, ['showLoginModal','showScriptshifterConfigModal','showDiacriticConfigModal','showTextMacroModal','showFieldColorsModal']),
Expand Down Expand Up @@ -156,6 +158,10 @@ export default {
<TextMacroModal v-model="showTextMacroModal" />
</template>

<template v-if="showCipModal==true">
<CipModal v-model="showCipModal" />
</template>

<template v-if="showNonLatinBulkModal==true">
<NonLatinBulkModal v-model="showNonLatinBulkModal" />
</template>
Expand Down
18 changes: 9 additions & 9 deletions src/components/panels/edit/fields/Literal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ export default {
let useTextToTrans = fieldValue[0].value

// check if any text is highlighted in the textarea
let textarea = document.querySelector(`textarea[data-guid="${fieldValue[0]['@guid']}"]`)
let textarea = document.querySelector(`textarea[data-guid="${fieldValue[0]['@guid']}"]`)
let highlightTemplate = null
if (textarea && textarea.selectionStart !== textarea.selectionEnd) {
let highlightedText = textarea.value.substring(textarea.selectionStart, textarea.selectionEnd)
Expand All @@ -992,10 +992,10 @@ export default {
hasLatin=true
}else if (lv['@language'] && !lv['@language'].toLowerCase().includes('latn')){
hasNonLatin=true
}
}
}
if (hasLatin && hasNonLatin){

// get the script information from the other field that is not this one
let otherFieldValue = this.literalValues.filter((v)=>{ return (v['@guid'] != options.fieldGuid) })

Expand All @@ -1004,7 +1004,7 @@ export default {
// get the transliterated value from the highlited text

// let transValue = await utilsNetwork.scriptShifterRequestTrans(options.lang,highlightedText,null,options.dir)

// console

// loop through all of this.scriptShifterLangCodes and see if we can find the code == the other field
Expand All @@ -1014,11 +1014,11 @@ export default {
// console.log("codeObj", codeObj)
// console.log("otherFieldValue[0]['@language']", otherFieldValue[0]['@language'])
if (fieldValue[0]['@language'] && codeObj.code.toLowerCase() == fieldValue[0]['@language'].toLowerCase()){
otherScriptCodes.push(key)
otherScriptCodes.push(key)

}
}


// remove the current req from the otherScriptCodes
otherScriptCodes = otherScriptCodes.filter((code)=>{ return code != options.lang })
Expand All @@ -1030,7 +1030,7 @@ export default {

// see if we can find transValue text in the other field value
if (otherFieldValue[0].value.indexOf(transValue.output) > -1){

// okay we found it then do the transliteration for this value highleted text and get the results
let thisTransValue = await utilsNetwork.scriptShifterRequestTrans(options.lang,highlightedText,null,options.dir)
if (thisTransValue.warnings && thisTransValue.warnings.length > 0){
Expand All @@ -1040,7 +1040,7 @@ export default {
// and replce the transValue.output text in the other field with thisTransValue.output using this.profileStore.setValueLiteral
let newOtherValue = otherFieldValue[0].value.replace(transValue.output, thisTransValue.output)
this.profileStore.setValueLiteral(this.guid,otherFieldValue[0]['@guid'],this.propertyPath,newOtherValue,otherFieldValue[0]['@language'] )

didReplaceTransliteration = true
break

Expand All @@ -1055,7 +1055,7 @@ export default {
}else{
alert("Error: Could not find the other field value for this literal, cannot do transliteration overwrite.")
}
// and they are currently in the
// and they are currently in the

}
}
Expand Down
Loading