Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
bootstrap
Commits
d7754696
Commit
d7754696
authored
Nov 05, 2014
by
Heinrich Fenkart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Customizer: Remove file type check from config import
Fixes #14978.
parent
03834866
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
docs/assets/js/src/customizer.js
docs/assets/js/src/customizer.js
+13
-19
No files found.
docs/assets/js/src/customizer.js
View file @
d7754696
...
...
@@ -361,20 +361,15 @@ window.onload = function () { // wait for load in a dumb way because B-0
var
file
=
(
e
.
originalEvent
.
hasOwnProperty
(
'
dataTransfer
'
))
?
e
.
originalEvent
.
dataTransfer
.
files
[
0
]
:
e
.
originalEvent
.
target
.
files
[
0
]
if
(
!
file
.
type
.
match
(
'
application/json
'
))
{
return
showAlert
(
'
danger
'
,
'
<strong>Ruh roh.</strong> We can only read <code>.json</code> files. Please try again.
'
,
importDropTarget
)
}
var
reader
=
new
FileReader
()
reader
.
onload
=
(
function
()
{
return
function
(
e
)
{
reader
.
onload
=
function
(
e
)
{
var
text
=
e
.
target
.
result
try
{
var
json
=
JSON
.
parse
(
text
)
if
(
typeof
json
!=
'
object
'
)
{
if
(
!
$
.
isPlainObject
(
json
)
)
{
throw
new
Error
(
'
JSON data from config file is not an object.
'
)
}
...
...
@@ -384,9 +379,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
return
showAlert
(
'
danger
'
,
'
<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.
'
,
importDropTarget
)
}
}
})(
file
)
reader
.
readAsText
(
file
)
reader
.
readAsText
(
file
,
'
utf-8
'
)
}
function
handleConfigDragOver
(
e
)
{
...
...
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