eff8dcd8 by Jeff Balicki

d

1 parent 47c23cc7
...@@ -226,14 +226,14 @@ ...@@ -226,14 +226,14 @@
226 var example = json[0].folder + '/' +json[i].example 226 var example = json[0].folder + '/' +json[i].example
227 227
228 if (json[i].change_type == "textflow") { 228 if (json[i].change_type == "textflow") {
229 pdfChange += json[i].names + ': <textarea onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" title="' + json[i].names + '" id="changescontent'+[f]+'" class="textarea" value="' + json[i].content + '" name="content">' + json[i].content + '</textarea>'; 229 pdfChange += json[i].names + ': <textarea onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" id="changescontent'+[f]+'" class="textarea required" value="' + json[i].content + '" name="content['+i+']">' + json[i].content + '</textarea>';
230 ++f 230 ++f
231 } 231 }
232 if (json[i].change_type == "text") { 232 if (json[i].change_type == "text") {
233 pdfChange += json[i].names + ': <input onfocusout="HideBox()" onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" title="' + json[i].names + '" id="changescontent" type="text" name="content" value="' + json[i].content + '"">'; 233 pdfChange += json[i].names + ': <input onfocusout="HideBox()" onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" id="changescontent" type="text" class="required" name="content['+i+']" value="' + json[i].content + '"">';
234 } 234 }
235 if (json[i].change_type == "img") { 235 if (json[i].change_type == "img") {
236 pdfChange += json[i].names + ': <input onfocusout="HideBox()" onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" title="' + json[i].names + '" class="fileupload" id="changescontent" style="display: block; box-sizing: border-box; width: 100%; height: 2.4375rem; padding: .5rem; border: 1px solid #cacaca; margin: 0 0 1rem; font-family: inherit; font-size: 1rem; color: #8a8a8a; background-color: #fefefe; box-shadow: inset 0 1px 2px rgba(10,10,10,.1); border-radius: 0; transition: box-shadow .5s,border-color .25s ease-in-out; -webkit-appearance: none; -moz-appearance: none;" type="file" name="content" >'; 236 pdfChange += json[i].names + ': <input onfocusout="HideBox()" onfocus="ShowBox('+json[0].pheight+','+json[0].pwidth+','+ json[i].locationUp+','+json[i].locationRight+','+json[i].height+','+json[i].width +','+ i + ',\''+ example + '\')" class="fileupload required" id="changescontent" style="display: block; box-sizing: border-box; width: 100%; height: 2.4375rem; padding: .5rem; border: 1px solid #cacaca; margin: 0 0 1rem; font-family: inherit; font-size: 1rem; color: #8a8a8a; background-color: #fefefe; box-shadow: inset 0 1px 2px rgba(10,10,10,.1); border-radius: 0; transition: box-shadow .5s,border-color .25s ease-in-out; -webkit-appearance: none; -moz-appearance: none;" type="file" name="content['+i+']" >';
237 } 237 }
238 pdfChange += '<span id="span'+i+'">'+json[i].tips+'</span><br/>'; 238 pdfChange += '<span id="span'+i+'">'+json[i].tips+'</span><br/>';
239 } 239 }
...@@ -250,6 +250,11 @@ ...@@ -250,6 +250,11 @@
250 document.getElementById('contentArea').innerHTML = strVar2; 250 document.getElementById('contentArea').innerHTML = strVar2;
251 document.getElementById('google_drive').innerHTML = " "; 251 document.getElementById('google_drive').innerHTML = " ";
252 252
253 $(document).ready(function() {
254 $("#changes").validate();
255 });
256
257
253 258
254 if($(window).width() > 700){ 259 if($(window).width() > 700){
255 260
...@@ -367,12 +372,16 @@ $(window).resize(function () { ...@@ -367,12 +372,16 @@ $(window).resize(function () {
367 for (var i = 0, file; file = files[i]; i++) { 372 for (var i = 0, file; file = files[i]; i++) {
368 console.log(file); 373 console.log(file);
369 imagefiles.push(file); 374 imagefiles.push(file);
370 console.log(imagefiles); 375 // console.log(imagefiles);
371 } 376 }
372 }); 377 });
373 378
374 379
375 $("#changes").submit(function(e) { 380 $("#changes").submit(function(e) {
381 e.preventDefault();
382
383 if($("#changes").valid()) {
384
376 $(tinymce.get()).each(function(i, el) { 385 $(tinymce.get()).each(function(i, el) {
377 386
378 if (el.id) 387 if (el.id)
...@@ -384,7 +393,7 @@ $(window).resize(function () { ...@@ -384,7 +393,7 @@ $(window).resize(function () {
384 }); 393 });
385 394
386 395
387 e.preventDefault(); 396
388 397
389 var form = $("#changes"); 398 var form = $("#changes");
390 399
...@@ -392,6 +401,7 @@ $(window).resize(function () { ...@@ -392,6 +401,7 @@ $(window).resize(function () {
392 401
393 returnfileOptions(imagefiles, form); 402 returnfileOptions(imagefiles, form);
394 return false; 403 return false;
404 }else{return false;}
395 }); 405 });
396 406
397 407
...@@ -465,7 +475,7 @@ $(window).resize(function () { ...@@ -465,7 +475,7 @@ $(window).resize(function () {
465 475
466 476
467 477
468 jsonReturn += '{"label":"' + json[i].label + '", "locationUp":"' + json[i].locationUp + '", "locationRight":"' + json[i].locationRight + '","width":"' + json[i].width + '","height":"' + json[i].height + '", "pages":"' + json[i].pages + '", "content":' + content + ', "z-index":null, "idstylesPDF":"' + json[i].idstylesPDF + '", "style":' + style + ', "order":"' + json[i].order + '", "idchange_typePDF":"' + json[i].idchange_typePDF + '", "change_type":"' + json[i].change_type + '", "fileLocation":"' + pluginUrl + '/wp-content/plugins/pdf-customizer-plugin/admin/images"}'; 478 jsonReturn += '{"label":"' + json[i].label + '", "locationUp":"' + json[i].locationUp + '", "locationRight":"' + json[i].locationRight + '","width":"' + json[i].width + '","height":"' + json[i].height + '", "pages":"' + json[i].pages + '", "content":' + content + ', "z-index":null, "idstylesPDF":"' + json[i].idstylesPDF + '", "style":' + style + ', "order":"' + json[i].order + '", "idchange_typePDF":"' + json[i].idchange_typePDF + '", "change_type":"' + json[i].change_type + '", "fileLocation":"' + pluginUrl + '/wp-content/uploads/pdf/"}';
469 479
470 480
471 if (i < json.length - 1) { 481 if (i < json.length - 1) {
......