Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jerome Chauveau
zotero-vue-client
Commits
1cab3a66
Commit
1cab3a66
authored
Dec 11, 2020
by
Jerome Chauveau
Browse files
simplication du process + sélection émise au format JSON
parent
f64bd419
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
1cab3a66
...
@@ -36,14 +36,11 @@ Another example with custom options :
...
@@ -36,14 +36,11 @@ Another example with custom options :
default-id="475425"
default-id="475425"
:options="{
:options="{
pageLength: 10,
pageLength: 10,
editableConfig: false,
editableConfig: false
format: 'json'
}"
}"
@entry-selected="selectedEntryCallback"/>
@entry-selected="selectedEntryCallback"/>
```
```
`selectedEntryCallback`
will received the selected entry as argument (in JSON format)
available formats : https://www.zotero.org/support/dev/web_api/v3/basics#export_formats.
*zotero-vue-client*
uses 'tei'
as default one.
### Customize configuration
### Customize configuration
See
[
Configuration Reference
](
https://cli.vuejs.org/config/
)
.
See
[
Configuration Reference
](
https://cli.vuejs.org/config/
)
.
package.json
View file @
1cab3a66
{
{
"name"
:
"zotero-vue-client"
,
"name"
:
"zotero-vue-client"
,
"version"
:
"0.1.
2
"
,
"version"
:
"0.1.
3
"
,
"private"
:
true
,
"private"
:
true
,
"scripts"
:
{
"scripts"
:
{
"serve"
:
"vue-cli-service serve"
,
"serve"
:
"vue-cli-service serve"
,
...
...
src/App.vue
View file @
1cab3a66
...
@@ -19,8 +19,7 @@
...
@@ -19,8 +19,7 @@
methods
:
{
methods
:
{
selectedEntry
(
entry
){
selectedEntry
(
entry
){
console
.
log
(
"
entry key =
"
,
entry
.
key
)
alert
(
JSON
.
stringify
(
entry
))
alert
(
entry
.
serialized
)
}
}
}
}
}
}
...
...
src/components/ZoteroVueClient.vue
View file @
1cab3a66
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<ul>
<ul>
<li
class=
"zotero-entry"
<li
class=
"zotero-entry"
v-for=
"entry in entries"
v-for=
"entry in entries"
@
click=
"entrySelected(entry
.key
)"
@
click=
"entrySelected(entry)"
:key=
"'entry-' + entry.key"
>
:key=
"'entry-' + entry.key"
>
<ul>
<ul>
<li
class=
"zotero-title"
>
{{
entry
.
data
.
title
}}
</li>
<li
class=
"zotero-title"
>
{{
entry
.
data
.
title
}}
</li>
...
@@ -77,8 +77,7 @@
...
@@ -77,8 +77,7 @@
default
:
function
()
{
default
:
function
()
{
return
{
return
{
editableConfig
:
true
,
editableConfig
:
true
,
pageLength
:
5
,
pageLength
:
5
format
:
'
tei
'
}
}
}
}
}
}
...
@@ -135,20 +134,8 @@
...
@@ -135,20 +134,8 @@
this
.
doQuery
(
false
);
this
.
doQuery
(
false
);
},
},
entrySelected
(
entryKey
){
entrySelected
(
entry
){
let
suffix
=
this
.
type
+
'
s
'
+
'
/
'
+
this
.
groupOrUserId
+
'
/items/
'
+
entryKey
this
.
$emit
(
'
entry-selected
'
,
entry
)
fetch
(
'
https://api.zotero.org/
'
+
suffix
+
'
?format=
'
+
this
.
format
)
.
then
(
response
=>
response
.
text
()).
then
(
entry
=>
{
console
.
log
()
this
.
$emit
(
'
entry-selected
'
,
{
key
:
entryKey
,
url
:
'
http://zotero.org/
'
+
suffix
,
serialized
:
entry
})
})
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment