cf17c7ab by Jeff Balicki

js changes

1 parent 7dbc1e0c
//var pluginUrl = "http://localhost:8888/Forms";
//var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var pluginUrl = window.location.protocol+'//'+window.location.host;
var pdf_customizer = "http://pdf-customizer.synapsus.co";
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";
var imageHeight="";
......@@ -87,7 +87,7 @@ function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
var ctx = c.getContext("2d");
ctx.save();
ctx.lineWidth=2;
ctx.strokeStyle="#F7A800";
ctx.strokeStyle= $('.callout').css("background-color")
ctx.roundRect(scaleRight, scaleDown, scalewidth, scaleheight, 5).stroke();
//ctx.rect(scaleRight, scaleDown, scalewidth, scaleheight );
//console.log(scaleRight, scaleDown, scalewidth, scaleheight);
......@@ -179,7 +179,7 @@ function pickPdfFromList(json) {
pdflist += "</div>";
}
strVar += ' <div class="callout primary"><div class="row column"> <h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>';
strVar += ' <div id="callout" class="callout primary"><div class="row column"> <h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>';
strVar += '</div></div></div><div id="contentAreaOver"></div> ';
document.getElementById('contentArea').innerHTML = strVar;
});
......@@ -230,20 +230,23 @@ function changePdfOptions(json, edit) {
var pdfChange = "";
var f = 0;
var windowWidth = 0.68 * $(window).width();
var windowHeight = 0.86 * $(window).height();
var windowWidth = 0.90 * $(".layout-grid").width();
var windowHeight = 0.90 * $(".layout-grid").height();
var windowHBG = 0.923 * $(window).height();
var pwidth = parseInt(json[0].pwidth);
var pheight = parseInt(json[0].pheight);
//console.log( windowWidth+' '+windowHeight);
//console.log( pwidth+' '+pheight);
if(pwidth > pheight){
//console.log('wide')
var scaleImage = windowWidth / pwidth;
var imageHeight = pheight * scaleImage;
var imageWidth = windowWidth;
var imgLeft = 0;
var imgTop = 25;
var imgTop = 40;
}else{
var scaleImage = windowHeight / pheight;
var imageHeight = windowHeight;
......@@ -317,13 +320,13 @@ function changePdfOptions(json, edit) {
init_instance_callback: function(editor) {
var editorDoc = document.getElementById(editor.id + '_ifr');
var editorDocContent = editorDoc.contentDocument;
editorDoc.style.border = "2px solid #131212";
editorDoc.style.border = "0px solid #131212";
editorDocContent.body.style.backgroundColor = "#131212";
editorDocContent.body.style.color = "#ccc";
},
setup: function(editor) {
editor.on('focus', function(e) {
console.log(editor.id);
//console.log(editor.id);
var editorDoc = document.getElementById(editor.id + '_ifr');
var editorDocContent = editorDoc.contentDocument;
......@@ -333,7 +336,7 @@ function changePdfOptions(json, edit) {
//$(this).css('border', '2px solid #F7A800 !important');
});
editor.on('blur', function(e) {
console.log('out' + editor.id);
//console.log('out' + editor.id);
var editorDoc = document.getElementById(editor.id + '_ifr');
var editorDocContent = editorDoc.contentDocument;
editorDoc.style.border = "2px solid #131212";
......@@ -358,7 +361,7 @@ function changePdfOptions(json, edit) {
$(".fileupload").change(function(e) {
var target = e.target;
files = e.target.files;
console.log(files);
// console.log(files);
if(files.length >= 1) {
for (var i = 0, file; file = files[i]; i++) {
......@@ -418,7 +421,7 @@ function changePdfOptions(json, edit) {
}
});}
var form = $("#changes");
console.log(form);
//console.log(form);
returnfileOptions(imagefiles, form);
return false;
......@@ -501,8 +504,8 @@ function returnOptions(form) {
}
jsonReturn += ' ]}';
var windowWidth = 0.68 * $(window).width();
var windowHeight = 0.86 * $(window).height();
var windowWidth = 0.75 * $("#wrapper").width();
var windowHeight = 0.75 * $("#wrapper").height();
var windowHBG = 0.923 * $(window).height();
var pwidth = parseInt(json[0].pwidth);
......@@ -554,7 +557,7 @@ function returnOptions(form) {
var strVar3 ='<div id="button"><input id="editMe" type="submit" value="Edit"><a href="' + pdf_customizer + '/fileentry/getPDF/' + json[0].folder + '/new_' + json[0].file + '" download="' + json[0].file + '" ><input id="downloadMe" type="submit" value="Download"></a> </div>';
document.getElementById('changes').innerHTML = strVar3;
//console.log(data);
// console.log(data);
// $('#changes').show();
......