Loading js/select.css +3 −0 Original line number Diff line number Diff line div{ padding-bottom: 4px; } No newline at end of file js/select.js +11 −0 Original line number Diff line number Diff line Loading @@ -52,11 +52,22 @@ function parse_list(res){ function copy_models(){ // testing $.ajax({ url: "select.php?cmd=copy", success: function(response){ console.log(response); } }); $(".chkbox").each(function(){ if ($(this).prop("checked")){ $.ajax({ url: "select.php?cmd=copy&set="+$(this).attr('set')+"&model="+$(this).attr('model'), type:'post', data: $('#kml')[0].files[0], processData: false, success: function(response){ console.log(response); } Loading select.html +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ </head> <body> <div> KML template: <input id='kml' type='file' /> </div> <div> <button class='copy'>Copy checked to <i>models/</i></button> </div> Loading select.php +8 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ if (isset($_GET['showall'])){ if ($_GET['cmd']=='copy'){ $kml_template = file_get_contents('php://input'); $set = $_GET['set']; $model = $_GET['model']; Loading @@ -33,7 +35,12 @@ if ($_GET['cmd']=='copy'){ $kml = "$base0/$model/$model.kml"; if (!is_file($kml)){ file_put_contents($kml,generate_default_kml($model,$ts)); if ($kml_template==""){ $kml_data = generate_default_kml($model,$ts); }else{ $kml_data = $kml_template; } file_put_contents($kml,$kml_data); } //gen thumbnail Loading Loading
js/select.css +3 −0 Original line number Diff line number Diff line div{ padding-bottom: 4px; } No newline at end of file
js/select.js +11 −0 Original line number Diff line number Diff line Loading @@ -52,11 +52,22 @@ function parse_list(res){ function copy_models(){ // testing $.ajax({ url: "select.php?cmd=copy", success: function(response){ console.log(response); } }); $(".chkbox").each(function(){ if ($(this).prop("checked")){ $.ajax({ url: "select.php?cmd=copy&set="+$(this).attr('set')+"&model="+$(this).attr('model'), type:'post', data: $('#kml')[0].files[0], processData: false, success: function(response){ console.log(response); } Loading
select.html +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ </head> <body> <div> KML template: <input id='kml' type='file' /> </div> <div> <button class='copy'>Copy checked to <i>models/</i></button> </div> Loading
select.php +8 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ if (isset($_GET['showall'])){ if ($_GET['cmd']=='copy'){ $kml_template = file_get_contents('php://input'); $set = $_GET['set']; $model = $_GET['model']; Loading @@ -33,7 +35,12 @@ if ($_GET['cmd']=='copy'){ $kml = "$base0/$model/$model.kml"; if (!is_file($kml)){ file_put_contents($kml,generate_default_kml($model,$ts)); if ($kml_template==""){ $kml_data = generate_default_kml($model,$ts); }else{ $kml_data = $kml_template; } file_put_contents($kml,$kml_data); } //gen thumbnail Loading