Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
pdf-customizer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ffe79caa
authored
2016-05-31 17:06:24 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
set var for url
1 parent
af414481
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
public/files/js/interfaceGdrive.js
public/files/js/interfaceGdrive.js
View file @
ffe79ca
var
pluginUrl
=
"http://localhost:8888/Forms/"
;
var
pluginUrl
=
"http://contact.gotenzing.com/"
;
var
pdf_customizer
=
"pdf-customizer.synapsus.co"
;
function
getAuth
(){
...
...
@@ -8,7 +9,7 @@
var
settings
=
{
"async"
:
true
,
"crossDomain"
:
true
,
"url"
:
"http://
localhost:8888/pdf-customizer/public
/api/authenticate"
,
"url"
:
"http://
"
+
pdf_customizer
+
"
/api/authenticate"
,
"method"
:
"POST"
,
"processData"
:
false
,
...
...
@@ -46,7 +47,7 @@ $.ajax(settings).done(function (response) {
jQuery
(
document
).
ready
(
function
(
$
)
{
$
.
getJSON
(
"http://
localhost:8888/pdf-customizer/public
/api/v1/get-list/"
+
user_id
,
function
(
data
)
{
$
.
getJSON
(
"http://
"
+
pdf_customizer
+
"
/api/v1/get-list/"
+
user_id
,
function
(
data
)
{
// Get the element with id summary and set the inner text to the result.
var
json
=
JSON
.
stringify
(
data
);
pickPdfFromList
(
json
);
...
...
@@ -62,7 +63,7 @@ $.ajax(settings).done(function (response) {
jQuery
(
document
).
ready
(
function
(
$
)
{
$
.
getJSON
(
"http://
localhost:8888/pdf-customizer/public
/api/v1/get-pdf-google/"
+
id
,
function
(
data
)
{
$
.
getJSON
(
"http://
"
+
pdf_customizer
+
"
/api/v1/get-pdf-google/"
+
id
,
function
(
data
)
{
// Get the element with id summary and set the inner text to the result.
var
json
=
JSON
.
stringify
(
data
);
...
...
@@ -88,7 +89,7 @@ $.ajax(settings).done(function (response) {
var
pdflist
=
""
;
for
(
i
=
0
;
i
<
json
.
length
;
++
i
)
{
pdflist
+=
"<div class=\"column\">"
;
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>'
;
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>'
;
pdflist
+=
" <h5>"
+
json
[
i
].
name
+
"<\/h5>"
;
pdflist
+=
"<\/div>"
;
}
...
...
@@ -121,7 +122,7 @@ function changePdfOptions(json){
var
pdflist
=
""
;
var
pdfChange
=
""
;
pdflist
+=
"<div class=\"column\">"
;
pdflist
+=
' <img src=\"http://
localhost:8888/pdf-customizer/public
/fileentry/getImage/'
+
json
[
0
].
folder
+
'/'
+
json
[
0
].
image
+
'\" width=\"300px\">'
;
pdflist
+=
' <img src=\"http://
'
+
pdf_customizer
+
'
/fileentry/getImage/'
+
json
[
0
].
folder
+
'/'
+
json
[
0
].
image
+
'\" width=\"300px\">'
;
pdflist
+=
"<\/div><br>"
;
pdfChange
+=
"<form id=\"changes\" name=\"changes\" enctype=\"multipart/form-data\" action=\"#\" METHOD=\"POST\"><h4>"
+
json
[
0
].
name
+
"</h4>"
;
pdfChange
+=
" <input type=\"hidden\" id=\"id\" name=\"id\" value=\""
+
json
[
0
].
idPDF
+
"\">"
;
...
...
@@ -181,7 +182,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
});
$
.
ajax
({
url
:
'http://
contact.gotenzing.com/wp-content/plugins/pdf-
customizer-plugin/admin/uploadfile.php?files'
,
url
:
'http://
'
+
pdf_customizer
+
'/wp-content/plugins/pdf_
customizer-plugin/admin/uploadfile.php?files'
,
type
:
'POST'
,
data
:
data
,
cache
:
false
,
...
...
@@ -224,7 +225,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
jQuery
(
function
(
$
)
{
$
.
getJSON
(
"http:/
/localhost:8888/pdf-customizer/public
/api/v1/get-pdf/"
+
id
.
value
,
function
(
dataReturnd
)
{
$
.
getJSON
(
"http:/
"
+
pdf_customizer
+
"
/api/v1/get-pdf/"
+
id
.
value
,
function
(
dataReturnd
)
{
// Get the element with id summary and set the inner text to the result.
var
json
=
dataReturnd
;
//console.log(json);
...
...
@@ -241,7 +242,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
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"}'
;
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"}'
;
if
(
i
<
json
.
length
-
1
){
...
...
@@ -256,7 +257,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
$
.
ajax
({
url
:
"http://
localhost:8888/pdf-customizer/public
/api/update"
,
url
:
"http://
"
+
pdf_customizer
+
"
/api/update"
,
type
:
"POST"
,
dataType
:
'json'
,
data
:
jsonReturn
,
...
...
@@ -270,7 +271,7 @@ strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div><\/div>";
async
:
true
,
success
:
function
(
data
)
{
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>'
;
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>'
;
},
error
:
function
(
xhr
,
ajaxOptions
,
thrownError
)
{
//Add these parameters to display the required response
alert
(
xhr
.
status
);
...
...
Please
register
or
sign in
to post a comment