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
691a4a88
Commit
691a4a88
authored
Mar 31, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for svg in comics (not working in IE11)
parent
8bfd3c7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
kthoom.js
cps/static/js/kthoom.js
+6
-1
No files found.
cps/static/js/kthoom.js
View file @
691a4a88
...
@@ -96,6 +96,11 @@ var createURLFromArray = function(array, mimeType) {
...
@@ -96,6 +96,11 @@ var createURLFromArray = function(array, mimeType) {
var
url
;
var
url
;
var
blob
;
var
blob
;
if
(
mimeType
===
'image/xml+svg'
)
{
const
xmlStr
=
new
TextDecoder
(
'utf-8'
).
decode
(
array
);
return
'data:image/svg+xml;UTF-8,'
+
encodeURIComponent
(
xmlStr
);
}
// TODO: Move all this browser support testing to a common place
// TODO: Move all this browser support testing to a common place
// and do it just once.
// and do it just once.
...
@@ -130,7 +135,7 @@ kthoom.ImageFile = function(file) {
...
@@ -130,7 +135,7 @@ kthoom.ImageFile = function(file) {
var
fileExtension
=
file
.
filename
.
split
(
"."
).
pop
().
toLowerCase
();
var
fileExtension
=
file
.
filename
.
split
(
"."
).
pop
().
toLowerCase
();
var
mimeType
=
fileExtension
===
"png"
?
"image/png"
:
var
mimeType
=
fileExtension
===
"png"
?
"image/png"
:
(
fileExtension
===
"jpg"
||
fileExtension
===
"jpeg"
)
?
"image/jpeg"
:
(
fileExtension
===
"jpg"
||
fileExtension
===
"jpeg"
)
?
"image/jpeg"
:
fileExtension
===
"gif"
?
"image/gif"
:
null
;
fileExtension
===
"gif"
?
"image/gif"
:
fileExtension
==
'svg'
?
'image/xml+svg'
:
undefined
;
this
.
dataURI
=
createURLFromArray
(
file
.
fileData
,
mimeType
);
this
.
dataURI
=
createURLFromArray
(
file
.
fileData
,
mimeType
);
this
.
data
=
file
;
this
.
data
=
file
;
};
};
...
...
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