Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
0afc8f94
Commit
0afc8f94
authored
Jul 25, 2017
by
Jonathan Rehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use TinyMCE's API to update the description's content
parent
a95e6aab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
get_meta.js
cps/static/js/get_meta.js
+3
-3
No files found.
cps/static/js/get_meta.js
View file @
0afc8f94
...
...
@@ -4,7 +4,7 @@
* Google Books api document: https://developers.google.com/books/docs/v1/using
* Douban Books api document: https://developers.douban.com/wiki/?title=book_v2 (Chinese Only)
*/
/* global i18nMsg */
/* global i18nMsg
, tinymce
*/
var
dbResults
=
[];
var
ggResults
=
[];
...
...
@@ -158,7 +158,7 @@ function getMeta (source, id) {
var
tags
;
if
(
source
===
"google"
)
{
meta
=
ggResults
[
id
];
$
(
"#description"
).
val
(
meta
.
volumeInfo
.
description
);
tinymce
.
get
(
"description"
).
setContent
(
meta
.
volumeInfo
.
description
);
$
(
"#bookAuthor"
).
val
(
meta
.
volumeInfo
.
authors
.
join
(
" & "
));
$
(
"#book_title"
).
val
(
meta
.
volumeInfo
.
title
);
if
(
meta
.
volumeInfo
.
categories
)
{
...
...
@@ -172,7 +172,7 @@ function getMeta (source, id) {
}
if
(
source
===
"douban"
)
{
meta
=
dbResults
[
id
];
$
(
"#description"
).
val
(
meta
.
summary
);
tinymce
.
get
(
"description"
).
setContent
(
meta
.
summary
);
$
(
"#bookAuthor"
).
val
(
meta
.
author
.
join
(
" & "
));
$
(
"#book_title"
).
val
(
meta
.
title
);
tags
=
""
;
...
...
Write
Preview
Markdown
is supported
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