Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to choose between citation.js and doi.org for citation format #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
14 changes: 13 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
<el-button @click="setSearch()" size="small">Set Search</el-button>
</el-row>
<el-row>
<el-col>
<el-switch
v-model="useDOIFormatter"
size="small"
active-text="Use DOI formatter"
inactive-text="Use citation.js formatter"
/>
</el-col>
</el-row>
</div>
<template #reference>

Expand All @@ -40,6 +50,7 @@
:shareLink="shareLink"
:useHelpModeDialog="true"
:connectivityInfoSidebar="true"
:useDOIFormatter="useDOIFormatter"
@updateShareLinkRequested="updateUUID"
@isReady="viewerIsReady"
@mapLoaded="mapIsLoaded"
Expand Down Expand Up @@ -77,7 +88,8 @@ export default {
api: import.meta.env.VITE_API_LOCATION,
mapSettings: [],
startingMap: "AC",
ElIconSetting: shallowRef(ElIconSetting)
ElIconSetting: shallowRef(ElIconSetting),
useDOIFormatter: true,
}
},
computed: {
Expand Down
10 changes: 10 additions & 0 deletions src/components/MapContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
v-if="isReady"
@onFullscreen="onFullscreen"
:state="stateToSet"
:useDOIFormatter="useDOIFormatter"
ref="flow"
@vue:mounted="flowMounted"
/>
Expand Down Expand Up @@ -99,6 +100,15 @@ export default {
type: Boolean,
default: true,
},
/**
* The option to use DOI.org as citation formatter in sidebar.
* If set to `false`, citation.js will be used.
* Default is `true`.
*/
useDOIFormatter: {
type: Boolean,
default: true,
},
},
data: function () {
return {
Expand Down
7 changes: 6 additions & 1 deletion src/components/SplitFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:annotationEntry="annotationEntry"
:createData="createData"
:connectivityInfo="connectivityInfo"
:useDOIFormatter="useDOIFormatter"
@tab-close="onSidebarTabClose"
@actionClick="actionClick"
@tabClicked="tabClicked"
Expand Down Expand Up @@ -109,7 +110,11 @@ export default {
state: {
type: Object,
default: undefined,
}
},
useDOIFormatter: {
type: Boolean,
default: true,
},
},
data: function () {
return {
Expand Down