ffe79caa by Jeff Balicki

set var for url

1 parent af414481
1 var pluginUrl = "http://localhost:8888/Forms/"; 1 var pluginUrl = "http://contact.gotenzing.com/";
2 var pdf_customizer = "pdf-customizer.synapsus.co";
2 3
3 4
4 function getAuth(){ 5 function getAuth(){
...@@ -8,7 +9,7 @@ ...@@ -8,7 +9,7 @@
8 var settings = { 9 var settings = {
9 "async": true, 10 "async": true,
10 "crossDomain": true, 11 "crossDomain": true,
11 "url": "http://localhost:8888/pdf-customizer/public/api/authenticate", 12 "url": "http://"+pdf_customizer+"/api/authenticate",
12 "method": "POST", 13 "method": "POST",
13 14
14 "processData": false, 15 "processData": false,
...@@ -46,7 +47,7 @@ $.ajax(settings).done(function (response) { ...@@ -46,7 +47,7 @@ $.ajax(settings).done(function (response) {
46 47
47 jQuery(document).ready(function($) { 48 jQuery(document).ready(function($) {
48 49
49 $.getJSON("http://localhost:8888/pdf-customizer/public/api/v1/get-list/"+user_id, function (data) { 50 $.getJSON("http://"+pdf_customizer+"/api/v1/get-list/"+user_id, function (data) {
50 // Get the element with id summary and set the inner text to the result. 51 // Get the element with id summary and set the inner text to the result.
51 var json = JSON.stringify(data); 52 var json = JSON.stringify(data);
52 pickPdfFromList(json); 53 pickPdfFromList(json);
...@@ -62,7 +63,7 @@ $.ajax(settings).done(function (response) { ...@@ -62,7 +63,7 @@ $.ajax(settings).done(function (response) {
62 63
63 jQuery(document).ready(function($) { 64 jQuery(document).ready(function($) {
64 65
65 $.getJSON("http://localhost:8888/pdf-customizer/public/api/v1/get-pdf-google/"+id, function (data) { 66 $.getJSON("http://"+pdf_customizer+"/api/v1/get-pdf-google/"+id, function (data) {
66 // Get the element with id summary and set the inner text to the result. 67 // Get the element with id summary and set the inner text to the result.
67 var json = JSON.stringify(data); 68 var json = JSON.stringify(data);
68 69
...@@ -88,7 +89,7 @@ $.ajax(settings).done(function (response) { ...@@ -88,7 +89,7 @@ $.ajax(settings).done(function (response) {
88 var pdflist = ""; 89 var pdflist = "";
89 for (i = 0; i < json.length; ++i) { 90 for (i = 0; i < json.length; ++i) {
90 pdflist += "<div class=\"column\">"; 91 pdflist += "<div class=\"column\">";
91 pdflist += '<a href=\"#\" onclick=\"getOneJson(' +json[i].idPDF+');\"> <img class=\"thumbnail\" src="http://localhost:8888/pdf-customizer/public///fileentry/getImage/' + json[i].folder + '/' + json[i].image + '" height=\"270px\"></a>'; 92 pdflist += '<a href=\"#\" onclick=\"getOneJson(' +json[i].idPDF+');\"> <img class=\"thumbnail\" src="http://'+pdf_customizer+'/fileentry/getImage/' + json[i].folder + '/' + json[i].image + '" height=\"270px\"></a>';
92 pdflist += " <h5>" + json[i].name + "<\/h5>"; 93 pdflist += " <h5>" + json[i].name + "<\/h5>";
93 pdflist += "<\/div>"; 94 pdflist += "<\/div>";
94 } 95 }
...@@ -121,7 +122,7 @@ function changePdfOptions(json){ ...@@ -121,7 +122,7 @@ function changePdfOptions(json){
121 var pdflist =""; 122 var pdflist ="";
122 var pdfChange =""; 123 var pdfChange ="";
123 pdflist += "<div class=\"column\">"; 124 pdflist += "<div class=\"column\">";
124 pdflist += ' <img src=\"http://localhost:8888/pdf-customizer/public/fileentry/getImage/' + json[0].folder + '/' + json[0].image + '\" width=\"300px\">'; 125 pdflist += ' <img src=\"http://'+pdf_customizer+'/fileentry/getImage/' + json[0].folder + '/' + json[0].image + '\" width=\"300px\">';
125 pdflist += "<\/div><br>"; 126 pdflist += "<\/div><br>";
126 pdfChange += "<form id=\"changes\" name=\"changes\" enctype=\"multipart/form-data\" action=\"#\" METHOD=\"POST\"><h4>" + json[0].name+"</h4>"; 127 pdfChange += "<form id=\"changes\" name=\"changes\" enctype=\"multipart/form-data\" action=\"#\" METHOD=\"POST\"><h4>" + json[0].name+"</h4>";
127 pdfChange += " <input type=\"hidden\" id=\"id\" name=\"id\" value=\""+json[0].idPDF+"\">"; 128 pdfChange += " <input type=\"hidden\" id=\"id\" name=\"id\" value=\""+json[0].idPDF+"\">";
...@@ -181,7 +182,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>"; ...@@ -181,7 +182,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
181 }); 182 });
182 183
183 $.ajax({ 184 $.ajax({
184 url: 'http://contact.gotenzing.com/wp-content/plugins/pdf-customizer-plugin/admin/uploadfile.php?files', 185 url: 'http://'+pdf_customizer+'/wp-content/plugins/pdf_customizer-plugin/admin/uploadfile.php?files',
185 type: 'POST', 186 type: 'POST',
186 data: data, 187 data: data,
187 cache: false, 188 cache: false,
...@@ -224,7 +225,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>"; ...@@ -224,7 +225,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
224 225
225 jQuery(function ($) { 226 jQuery(function ($) {
226 227
227 $.getJSON("http://localhost:8888/pdf-customizer/public/api/v1/get-pdf/" + id.value, function (dataReturnd) { 228 $.getJSON("http:/"+pdf_customizer+"/api/v1/get-pdf/" + id.value, function (dataReturnd) {
228 // Get the element with id summary and set the inner text to the result. 229 // Get the element with id summary and set the inner text to the result.
229 var json = dataReturnd; 230 var json = dataReturnd;
230 //console.log(json); 231 //console.log(json);
...@@ -241,7 +242,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>"; ...@@ -241,7 +242,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
241 242
242 243
243 244
244 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":"http://contact.gotenzing.com/wp-content/plugins/pdf-customizer-plugin/admin/images"}'; 245 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":"http://contact.gotenzing.com/wp-content/plugins/pdf_customizer-plugin/admin/images"}';
245 246
246 247
247 if (i < json.length - 1){ 248 if (i < json.length - 1){
...@@ -256,7 +257,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>"; ...@@ -256,7 +257,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
256 257
257 258
258 $.ajax({ 259 $.ajax({
259 url: "http://localhost:8888/pdf-customizer/public/api/update", 260 url: "http://"+pdf_customizer+"/api/update",
260 type: "POST", 261 type: "POST",
261 dataType: 'json', 262 dataType: 'json',
262 data: jsonReturn, 263 data: jsonReturn,
...@@ -270,7 +271,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>"; ...@@ -270,7 +271,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
270 271
271 async: true, 272 async: true,
272 success: function (data) { 273 success: function (data) {
273 document.getElementById('contentArea').innerHTML ='<a href="http://localhost:8888/pdf-customizer/public/fileentry/getPDF/'+json[0].folder+'/new_'+json[0].file+'" download="'+json[0].file+'" >Download Here</a>'; 274 document.getElementById('contentArea').innerHTML ='<a href="http://'+pdf_customizer+'/fileentry/getPDF/'+json[0].folder+'/new_'+json[0].file+'" download="'+json[0].file+'" >Download Here</a>';
274 }, 275 },
275 error: function (xhr, ajaxOptions, thrownError) { //Add these parameters to display the required response 276 error: function (xhr, ajaxOptions, thrownError) { //Add these parameters to display the required response
276 alert(xhr.status); 277 alert(xhr.status);
......