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
0b793245
authored
2016-07-08 11:50:21 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
c67ac37d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
48 deletions
public/files/js/interfaceGdrive.js
public/files/js/interfaceGdrive.js
View file @
0b79324
//
var pluginUrl = "http://localhost:8888/Forms";
//
var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var
pluginUrl
=
"http://localhost:8888/Forms"
;
var
pdf_customizer
=
"http://localhost:8888/pdf-customizer/public"
;
var
pluginUrl
=
"http://contact.gotenzing.com"
;
var
pdf_customizer
=
"http://pdf-customizer.synapsus.co"
;
//
var pluginUrl = "http://contact.gotenzing.com";
//
var pdf_customizer = "http://pdf-customizer.synapsus.co";
function
getAuth
()
{
jQuery
(
document
).
ready
(
function
(
$
)
{
...
...
@@ -75,13 +75,13 @@ function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
var
scaleRight
=
right
*
scaleW
;
var
scalewidth
=
width
*
scaleW
;
var
scaleheight
=
height
*
scaleH
;
var
radius
=
'50'
;
var
c
=
document
.
getElementById
(
"Canvas"
);
var
ctx
=
c
.
getContext
(
"2d"
);
ctx
.
save
();
ctx
.
lineWidth
=
2
;
ctx
.
strokeStyle
=
"#F7A800"
;
ctx
.
roundRect
(
scaleRight
,
scaleDown
,
scalewidth
,
scaleheight
,
20
).
stroke
();
ctx
.
roundRect
(
scaleRight
,
scaleDown
,
scalewidth
,
scaleheight
,
5
).
stroke
();
//ctx.rect(scaleRight, scaleDown, scalewidth, scaleheight );
//console.log(scaleRight, scaleDown, scalewidth, scaleheight);
//console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH);
...
...
@@ -196,12 +196,12 @@ function changePdfOptions(json) {
var
scaleImage
=
400
/
json
[
0
].
pwidth
;
var
imageHeight
=
json
[
0
].
pheight
*
scaleImage
;
var
imageWidth
=
'400'
;
var
imageWidth
=
400
;
console
.
log
(
json
[
0
].
pheight
,
scaleImage
,
imageHeight
);
pdflist
+=
'<div id="pdfPreview" class="column">'
;
// pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">';
pdflist
+=
'<canvas id="Canvas" width="'
+
imageWidth
+
'" height="'
+
imageHeight
+
'" style=" margin-top:
60px;
border-style: solid; border-width:1px; background-image: url('
+
pdf_customizer
+
'/fileentry/getImage/'
+
json
[
0
].
folder
+
'/'
+
json
[
0
].
example
+
'); background-size:'
+
imageWidth
+
'px '
+
imageHeight
+
'px"></div>'
;
pdflist
+=
'<canvas id="Canvas" width="'
+
imageWidth
+
'" height="'
+
imageHeight
+
'" style=" margin-top:
30px;
border-style: solid; border-width:1px; background-image: url('
+
pdf_customizer
+
'/fileentry/getImage/'
+
json
[
0
].
folder
+
'/'
+
json
[
0
].
example
+
'); background-size:'
+
imageWidth
+
'px '
+
imageHeight
+
'px"></div>'
;
pdfChange
+=
'<form id="changes" name="changes" enctype="multipart/form-data" action="" METHOD="POST"></br><h4>'
+
json
[
0
].
name
+
'</h4>'
;
pdfChange
+=
'<input type="hidden" id="id" name="id" value="'
+
json
[
0
].
idPDF
+
'">'
;
for
(
i
=
0
;
i
<
json
.
length
;
++
i
)
{
...
...
@@ -233,48 +233,12 @@ function changePdfOptions(json) {
strVar2
+=
' <div class="callout primary"><div class="row column"><h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>'
;
strVar2
+=
''
;
strVar2
+=
' </div></div><div id="wrapper" class="black small-up-2 medium-up-3 large-up-3">'
;
strVar2
+=
pdflist
+
'<div id="changesColumn"
style="height:'
+
$
(
"#changes"
).
height
()
+
';"
class="column" >'
+
pdfChange
+
'<div id="tezingLogo"></div></div><div id="pdfFooter"></div></div>'
;
strVar2
+=
pdflist
+
'<div id="changesColumn" class="column" >'
+
pdfChange
+
'<div id="tezingLogo"></div></div><div id="pdfFooter"></div></div>'
;
document
.
getElementById
(
'contentArea'
).
innerHTML
=
strVar2
;
document
.
getElementById
(
'google_drive'
).
innerHTML
=
" "
;
if
(
$
(
window
).
width
()
>
700
)
{
$
(
'#pdfPreview'
).
css
(
'position'
,
'relative'
);
var
stickySidebar
=
$
(
'#pdfPreview'
);
if
(
stickySidebar
.
length
>
0
)
{
var
stickyHeight
=
stickySidebar
.
height
(),
sidebarTop
=
stickySidebar
.
offset
().
top
;
}
// on scroll move the sidebar
$
(
window
).
scroll
(
function
()
{
if
(
stickySidebar
.
length
>
0
)
{
var
scrollTop
=
$
(
window
).
scrollTop
();
if
(
sidebarTop
<
scrollTop
)
{
stickySidebar
.
css
(
'top'
,
scrollTop
-
sidebarTop
);
// stop the sticky sidebar at the footer to avoid overlapping
var
sidebarBottom
=
stickySidebar
.
offset
().
top
+
stickyHeight
,
stickyStop
=
$
(
'#changesColumn'
).
offset
().
top
+
$
(
'#changesColumn'
).
height
();
if
(
stickyStop
<
sidebarBottom
)
{
var
stopPosition
=
$
(
'#changesColumn'
).
height
()
-
stickyHeight
;
stickySidebar
.
css
(
'top'
,
stopPosition
);
}
}
else
{
stickySidebar
.
css
(
'top'
,
'0'
);
}
}
});
$
(
window
).
resize
(
function
()
{
if
(
stickySidebar
.
length
>
0
)
{
stickyHeight
=
stickySidebar
.
height
();
}
});
}
var
tinymces
=
tinymce
.
init
({
selector
:
'.textarea'
,
...
...
@@ -298,7 +262,7 @@ function changePdfOptions(json) {
var
editorDocContent
=
editorDoc
.
contentDocument
;
editorDoc
.
style
.
border
=
"2px solid #F7A800"
;
//$('#' + editor.id).trigger("
focus");
$
(
'#'
+
editor
.
id
).
trigger
(
"on
focus"
);
//$(this).css('border', '2px solid #F7A800 !important');
});
editor
.
on
(
'blur'
,
function
(
e
)
{
...
...
@@ -308,7 +272,7 @@ function changePdfOptions(json) {
editorDoc
.
style
.
border
=
"2px solid #131212"
;
//$(this).css('border', '0px solid #F7A800 !important');
//
HideBox();
HideBox
();
});
}
});
...
...
Please
register
or
sign in
to post a comment