mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Change eval() to JSON.parse() in filebox.js #2266
This commit is contained in:
parent
828aa04a22
commit
72b862c27e
1 changed files with 8 additions and 5 deletions
|
|
@ -86,8 +86,7 @@ function addRow(){
|
||||||
var $last = $attributes.last();
|
var $last = $attributes.last();
|
||||||
var count = $last.data('count') + 1;
|
var count = $last.data('count') + 1;
|
||||||
var $clone = $last.clone().data('count', count);
|
var $clone = $last.clone().data('count', count);
|
||||||
|
|
||||||
|
|
||||||
$last.find('.__addBtn').hide();
|
$last.find('.__addBtn').hide();
|
||||||
|
|
||||||
$clone.find('.__attribute_name').attr('value', '').attr("id", "attribute_name"+count);
|
$clone.find('.__attribute_name').attr('value', '').attr("id", "attribute_name"+count);
|
||||||
|
|
@ -103,7 +102,7 @@ function clearRow(target){
|
||||||
var $attributes = $('.__attribute');
|
var $attributes = $('.__attribute');
|
||||||
var $controlGroup = $(target).closest('.x_control-group');
|
var $controlGroup = $(target).closest('.x_control-group');
|
||||||
var count = $attributes.length;
|
var count = $attributes.length;
|
||||||
|
|
||||||
if (count <= 1){
|
if (count <= 1){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +122,7 @@ jQuery(document).ready(function($){
|
||||||
}
|
}
|
||||||
$('#new_filebox_upload').find('input[name^=attribute_name], input[name^=attribute_value], input[name=addfile]').val('');
|
$('#new_filebox_upload').find('input[name^=attribute_name], input[name^=attribute_value], input[name=addfile]').val('');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.filebox').click(function(){
|
$('.filebox').click(function(){
|
||||||
$current_filebox = $(this);
|
$current_filebox = $(this);
|
||||||
});
|
});
|
||||||
|
|
@ -140,8 +139,12 @@ jQuery(document).ready(function($){
|
||||||
if (!content) {
|
if (!content) {
|
||||||
content = window.iframeTarget.document.getElementsByTagName('body');
|
content = window.iframeTarget.document.getElementsByTagName('body');
|
||||||
}
|
}
|
||||||
var data = eval('(' + $(content).html() + ')');
|
if (!content) {
|
||||||
|
alert('Error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = JSON.parse($.trim($(content).html()));
|
||||||
if (data.error){
|
if (data.error){
|
||||||
alert(data.message);
|
alert(data.message);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue