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
79d0cdbe
Commit
79d0cdbe
authored
Nov 07, 2014
by
Heinrich Fenkart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port #15031 over again
parent
19ca6389
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
assets/js/customize.min.js
assets/js/customize.min.js
+1
-1
assets/js/src/customizer.js
assets/js/src/customizer.js
+13
-19
No files found.
assets/js/customize.min.js
View file @
79d0cdbe
This diff is collapsed.
Click to expand it.
assets/js/src/customizer.js
View file @
79d0cdbe
...
@@ -359,32 +359,26 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -359,32 +359,26 @@ 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
]
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
()
var
reader
=
new
FileReader
()
reader
.
onload
=
(
function
()
{
reader
.
onload
=
function
(
e
)
{
return
function
(
e
)
{
var
text
=
e
.
target
.
result
var
text
=
e
.
target
.
result
try
{
try
{
var
json
=
JSON
.
parse
(
text
)
var
json
=
JSON
.
parse
(
text
)
if
(
typeof
json
!=
'
object
'
)
{
throw
new
Error
(
'
JSON data from config file is not an object.
'
)
}
updateCustomizerFromJson
(
json
)
if
(
!
$
.
isPlainObject
(
json
))
{
showAlert
(
'
success
'
,
'
<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.
'
,
importDropTarget
)
throw
new
Error
(
'
JSON data from config file is not an object.
'
)
}
catch
(
err
)
{
return
showAlert
(
'
danger
'
,
'
<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.
'
,
importDropTarget
)
}
}
updateCustomizerFromJson
(
json
)
showAlert
(
'
success
'
,
'
<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.
'
,
importDropTarget
)
}
catch
(
err
)
{
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
)
{
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