design changes
Showing
2 changed files
with
134 additions
and
136 deletions
| ... | @@ -181,6 +181,43 @@ try { | ... | @@ -181,6 +181,43 @@ try { |
| 181 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; | 181 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; |
| 182 | 182 | ||
| 183 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); | 183 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); |
| 184 | } else if ($row->change_type == 'date') { | ||
| 185 | $yoff = 50; | ||
| 186 | //Get font var from row | ||
| 187 | |||
| 188 | $textline = $row->content; | ||
| 189 | $textLUp = $row->locationUp; | ||
| 190 | $textwidth = $row->width; | ||
| 191 | $textheight = $row->height; | ||
| 192 | $textLRight = $row->locationRight; | ||
| 193 | $fontStyles = unserialize($row->style); | ||
| 194 | $fitmethod = $fontStyles["fitmethod"]; | ||
| 195 | |||
| 196 | $fontAlignment = $fontStyles["alignment"]; | ||
| 197 | $fontFamily = $fontStyles["font-family"]; | ||
| 198 | $fontSize = $fontStyles["font-size"]; | ||
| 199 | if(isset($fontStyles["font-color"])) { | ||
| 200 | $fontColor = $fontStyles["font-color"]; | ||
| 201 | }else{ | ||
| 202 | $fontColor = 'cmyk 0.75 0.68 0.67 0.90'; | ||
| 203 | |||
| 204 | } | ||
| 205 | /// Load and insert text and font | ||
| 206 | |||
| 207 | $p->set_option("FontOutline={" . $fontFamily . "=" . $storagePath . $folder . "/" . $fontFamily . ".otf}"); | ||
| 208 | /* For PDFlib Lite: change "unicode" to "winansi" */ | ||
| 209 | $font = $p->load_font($fontFamily, "unicode", "embedding"); | ||
| 210 | if ($font == 0) { | ||
| 211 | die("Error: " . $p->get_errmsg()); | ||
| 212 | } | ||
| 213 | $p->setfont($font, $fontSize); | ||
| 214 | //$num_optlist = "fontname=".$fontFamily." fontsize=".$fontSize." encoding=unicode alignment=".$fontAlignment." fillcolor={".$fontColor." }"; | ||
| 215 | if($fitmethod == ''){$fitm =""; | ||
| 216 | }else{ $fitm = "fitmethod=".$fitmethod;} | ||
| 217 | |||
| 218 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; | ||
| 219 | |||
| 220 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); | ||
| 184 | } | 221 | } |
| 185 | 222 | ||
| 186 | else if ($row->change_type == 'img') { | 223 | else if ($row->change_type == 'img') { | ... | ... |
| ... | @@ -8,15 +8,11 @@ | ... | @@ -8,15 +8,11 @@ |
| 8 | 8 | ||
| 9 | jQuery(document).ready(function($) { | 9 | jQuery(document).ready(function($) { |
| 10 | 10 | ||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | var settings = { | 11 | var settings = { |
| 15 | "async": true, | 12 | "async": true, |
| 16 | "crossDomain": true, | 13 | "crossDomain": true, |
| 17 | "url": "" + pdf_customizer + "/api/authenticate", | 14 | "url": "" + pdf_customizer + "/api/authenticate", |
| 18 | "method": "POST", | 15 | "method": "POST", |
| 19 | |||
| 20 | "processData": false, | 16 | "processData": false, |
| 21 | "contentType": false, | 17 | "contentType": false, |
| 22 | "mimeType": "multipart/form-data", | 18 | "mimeType": "multipart/form-data", |
| ... | @@ -34,12 +30,8 @@ | ... | @@ -34,12 +30,8 @@ |
| 34 | $.ajax(settings).done(function(response) { | 30 | $.ajax(settings).done(function(response) { |
| 35 | console.log(response); | 31 | console.log(response); |
| 36 | token = response; | 32 | token = response; |
| 37 | |||
| 38 | |||
| 39 | }); | 33 | }); |
| 40 | 34 | ||
| 41 | |||
| 42 | |||
| 43 | }); | 35 | }); |
| 44 | 36 | ||
| 45 | } | 37 | } |
| ... | @@ -57,20 +49,17 @@ | ... | @@ -57,20 +49,17 @@ |
| 57 | $(".entry_block").mouseleave(function() { | 49 | $(".entry_block").mouseleave(function() { |
| 58 | $("#select" + id + "").addClass("focus"); | 50 | $("#select" + id + "").addClass("focus"); |
| 59 | }); | 51 | }); |
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | }); | 52 | }); |
| 65 | } | 53 | } |
| 66 | 54 | ||
| 67 | function ShowBox(pheight, pwidth,up, right, height, width, count, example) { | 55 | |
| 56 | function ShowBox(pheight, pwidth, up, right, height, width, count, example) { | ||
| 68 | 57 | ||
| 69 | 58 | ||
| 70 | jQuery(document).ready(function($) { | 59 | jQuery(document).ready(function($) { |
| 71 | $('span').hide(); | 60 | $('span').hide(); |
| 72 | $('#span'+count).show(); | 61 | $('#span' + count).show(); |
| 73 | $('#Canvas').css("background-image", "url(" + pdf_customizer + '/fileentry/getImage/' +example+")"); | 62 | $('#Canvas').css("background-image", "url(" + pdf_customizer + '/fileentry/getImage/' + example + ")"); |
| 74 | 63 | ||
| 75 | var Qc = document.getElementById("Canvas"); | 64 | var Qc = document.getElementById("Canvas"); |
| 76 | var Qctx = Qc.getContext("2d"); | 65 | var Qctx = Qc.getContext("2d"); |
| ... | @@ -80,18 +69,18 @@ | ... | @@ -80,18 +69,18 @@ |
| 80 | 69 | ||
| 81 | 70 | ||
| 82 | var down = pheight - (up + height); | 71 | var down = pheight - (up + height); |
| 83 | var scaleH = $("Canvas").height() / pheight ; | 72 | var scaleH = $("Canvas").height() / pheight; |
| 84 | var scaleW = $("Canvas").width() / pwidth ; | 73 | var scaleW = $("Canvas").width() / pwidth; |
| 85 | var scaleDown = down * scaleH; | 74 | var scaleDown = down * scaleH; |
| 86 | var scaleRight = right* scaleW; | 75 | var scaleRight = right * scaleW; |
| 87 | var scalewidth = width * scaleW; | 76 | var scalewidth = width * scaleW; |
| 88 | var scaleheight = height * scaleH; | 77 | var scaleheight = height * scaleH; |
| 89 | 78 | ||
| 90 | var c = document.getElementById("Canvas"); | 79 | var c = document.getElementById("Canvas"); |
| 91 | var ctx = c.getContext("2d"); | 80 | var ctx = c.getContext("2d"); |
| 92 | ctx.save(); | 81 | ctx.save(); |
| 93 | ctx.rect(scaleRight, scaleDown , scalewidth, scaleheight); | 82 | ctx.rect(scaleRight, scaleDown, scalewidth, scaleheight); |
| 94 | console.log(scaleRight, scaleDown , scalewidth, scaleheight); | 83 | console.log(scaleRight, scaleDown, scalewidth, scaleheight); |
| 95 | console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH); | 84 | console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH); |
| 96 | ctx.stroke(); | 85 | ctx.stroke(); |
| 97 | //console.log(pheight, pwidth,up, right, height, width); | 86 | //console.log(pheight, pwidth,up, right, height, width); |
| ... | @@ -101,6 +90,15 @@ | ... | @@ -101,6 +90,15 @@ |
| 101 | 90 | ||
| 102 | }); | 91 | }); |
| 103 | 92 | ||
| 93 | } | ||
| 94 | |||
| 95 | |||
| 96 | function SetFocus(i) { | ||
| 97 | jQuery(document).ready(function($) { | ||
| 98 | $("label#focusButton"+i).css({"border": "2px solid #F7A800 !important"}); | ||
| 99 | console.log($("label#focusButton"+i)); | ||
| 100 | |||
| 101 | }); | ||
| 104 | } | 102 | } |
| 105 | 103 | ||
| 106 | 104 | ||
| ... | @@ -112,17 +110,19 @@ | ... | @@ -112,17 +110,19 @@ |
| 112 | var ctx = cnv.getContext('2d'); // gets reference to canvas context | 110 | var ctx = cnv.getContext('2d'); // gets reference to canvas context |
| 113 | ctx.beginPath(); // clear existing drawing paths | 111 | ctx.beginPath(); // clear existing drawing paths |
| 114 | ctx.save(); // store the current transformation matrix | 112 | ctx.save(); // store the current transformation matrix |
| 113 | }); | ||
| 115 | 114 | ||
| 115 | } | ||
| 116 | 116 | ||
| 117 | 117 | function HideBoxwithdate() { | |
| 118 | //console.log(0, 0, $("Canvas").width(), $("Canvas").height()); | 118 | jQuery(document).ready(function($) { |
| 119 | 119 | var cnv = document.getElementById("Canvas"); | |
| 120 | 120 | var ctx = cnv.getContext('2d'); // gets reference to canvas context | |
| 121 | 121 | ctx.beginPath(); // clear existing drawing paths | |
| 122 | 122 | ctx.save(); // store the current transformation matrix | |
| 123 | }); | 123 | }); |
| 124 | 124 | ||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | 128 | ||
| ... | @@ -178,9 +178,8 @@ | ... | @@ -178,9 +178,8 @@ |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | 180 | ||
| 181 | strVar += ' <div class="callout primary"><div class="row column"> <h1>Welcome to Synapsus Online PDF Editor</h1>'; | 181 | strVar += ' <div class="callout primary"><div class="row column"> <h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>'; |
| 182 | strVar += ' <p class="lead">Please pick a PDF</p> </div></div> <div class="row small-up-2 medium-up-3 large-up-4/>'; | 182 | strVar += ' '; |
| 183 | strVar += ' </div>'; | ||
| 184 | 183 | ||
| 185 | 184 | ||
| 186 | 185 | ||
| ... | @@ -196,6 +195,23 @@ | ... | @@ -196,6 +195,23 @@ |
| 196 | function changePdfOptions(json) { | 195 | function changePdfOptions(json) { |
| 197 | jQuery(function($) { | 196 | jQuery(function($) { |
| 198 | json = JSON.parse(json); | 197 | json = JSON.parse(json); |
| 198 | $(document).ready(function() { | ||
| 199 | |||
| 200 | $("#changescontentdate").datepicker({ | ||
| 201 | plugins: "tabfocus", | ||
| 202 | changeMonth: true, | ||
| 203 | changeYear: true, | ||
| 204 | yearRange: '2015:2025', | ||
| 205 | dateFormat: 'DD MM dd yy', | ||
| 206 | minDate: 0, | ||
| 207 | defaultDate: null | ||
| 208 | }).on('change', function() { | ||
| 209 | $(this).valid(); // triggers the validation test | ||
| 210 | // '$(this)' refers to '$("#datepicker")' | ||
| 211 | }); | ||
| 212 | |||
| 213 | $("#changes").validate(); | ||
| 214 | }); | ||
| 199 | 215 | ||
| 200 | 216 | ||
| 201 | 217 | ||
| ... | @@ -206,107 +222,69 @@ | ... | @@ -206,107 +222,69 @@ |
| 206 | var pdfChange = ""; | 222 | var pdfChange = ""; |
| 207 | var f = 0; | 223 | var f = 0; |
| 208 | 224 | ||
| 209 | if(json[0].pwidth > 300){ | 225 | |
| 210 | var scaleImage = 300 / json[0].pwidth; | 226 | var scaleImage = 400 / json[0].pwidth; |
| 211 | var imageHeight = json[0].pheight * scaleImage; | 227 | var imageHeight = json[0].pheight * scaleImage; |
| 212 | var imageWidth = '300'; | 228 | var imageWidth = '400'; |
| 213 | console.log(json[0].pheight , scaleImage, imageHeight); | 229 | console.log(json[0].pheight, scaleImage, imageHeight); |
| 214 | }else{ | 230 | |
| 215 | var imageWidth = json[0].pwidth; | ||
| 216 | var imageHeight = json[0].pheight; | ||
| 217 | console.log(json[0].pheight , scaleImage); | ||
| 218 | 231 | ||
| 219 | } | ||
| 220 | pdflist += '<div id="pdfPreview" class="column">'; | 232 | pdflist += '<div id="pdfPreview" class="column">'; |
| 221 | // pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">'; | 233 | // pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">'; |
| 222 | 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>'; | 234 | 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>'; |
| 223 | pdfChange += '<form id="changes" name="changes" enctype="multipart/form-data" action="" METHOD="POST"><h4>' + json[0].name + '</h4>'; | 235 | pdfChange += '<form id="changes" name="changes" enctype="multipart/form-data" action="" METHOD="POST"></br><h4>' + json[0].name + '</h4>'; |
| 224 | pdfChange += '<input type="hidden" id="id" name="id" value="' + json[0].idPDF + '">'; | 236 | pdfChange += '<input type="hidden" id="id" name="id" value="' + json[0].idPDF + '">'; |
| 225 | for (i = 0; i < json.length; ++i) { | 237 | for (i = 0; i < json.length; ++i) { |
| 226 | var example = json[0].folder + '/' +json[i].example | 238 | var example = json[0].folder + '/' + json[i].example |
| 227 | 239 | ||
| 228 | if (json[i].change_type == "textflow") { | 240 | 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 + '\')" id="changescontent'+[f]+'" class="textarea required" value="' + json[i].content + '" name="content['+i+']">' + json[i].content + '</textarea>'; | 241 | 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 | 242 | ++f |
| 243 | pdfChange += '<span id="span' + i + '">' + json[i].tips + '</span><br/>'; | ||
| 231 | } | 244 | } |
| 232 | if (json[i].change_type == "text") { | 245 | 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 + '\')" id="changescontent" type="text" class="required" name="content['+i+']" value="' + json[i].content + '"">'; | 246 | 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['+i+']" type="text" class="required" name="content[' + i + ']" value="' + json[i].content + '"">'; |
| 247 | pdfChange += '<span id="span' + i + '">' + json[i].tips + '</span><br/>'; | ||
| 234 | } | 248 | } |
| 235 | if (json[i].change_type == "img") { | 249 | 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 + '\')" 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+']" >'; | 250 | pdfChange += json[i].names + ':<label id="focusButton' + i + '" class="custom-file-input"><input onfocusout="HideBox()" onfocus="SetFocus('+i+'), ShowBox(' + json[0].pheight + ',' + json[0].pwidth + ',' + json[i].locationUp + ',' + json[i].locationRight + ',' + json[i].height + ',' + json[i].width + ',' + i + ',\'' + example + '\')" class="fileupload upload required" id="changescontent[' + i + ']" type="file" name="content[' + i + ']" ></label>'; |
| 251 | pdfChange += '<span id="span' + i + '">' + json[i].tips + '</span><br/>'; | ||
| 237 | } | 252 | } |
| 238 | pdfChange += '<span id="span'+i+'">'+json[i].tips+'</span><br/>'; | 253 | if (json[i].change_type == "date") { |
| 254 | pdfChange += json[i].names + ': <input onfocusout="HideBoxwithdate()" onfocus="ShowBox(' + json[0].pheight + ',' + json[0].pwidth + ',' + json[i].locationUp + ',' + json[i].locationRight + ',' + json[i].height + ',' + json[i].width + ',' + i + ',\'' + example + '\')" id="changescontentdate" type="text" class="required date" name="content[' + i + ']" value="' + json[i].content + '"">'; | ||
| 255 | |||
| 256 | } | ||
| 257 | |||
| 239 | } | 258 | } |
| 240 | pdfChange += '<input type="submit" value="Submit">'; | 259 | pdfChange += '<input type="submit" value="Save and download">'; |
| 241 | pdfChange += '</form>'; | 260 | pdfChange += '</form>'; |
| 242 | 261 | ||
| 243 | strVar2 += ' <div class="callout primary"><div class="row column"><h1>Welcome to Synapsus Online PDF Editor</h1>'; | 262 | strVar2 += ' <div class="callout primary"><div class="row column"><h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>'; |
| 244 | strVar2 += '<p class="lead">Please make your changes or return <a href="#" onclick="location.reload();">back to the list</a></p>'; | 263 | strVar2 += ''; |
| 245 | strVar2 += ' </div></div><div id="wrapper" class="row small-up-2 medium-up-3 large-up-3">'; | 264 | strVar2 += ' </div></div><div id="wrapper" class="black small-up-2 medium-up-3 large-up-3">'; |
| 246 | strVar2 += pdflist + '<div id="changesColumn" style="height:'+$("#changes").height()+';" class="column" >' + pdfChange + '</div><div id="pdfFooter"></div></div>'; | 265 | strVar2 += pdflist + '<div id="changesColumn" style="height:' + $("#changes").height() + ';" class="column" >' + pdfChange + '<div id="tezingLogo"></div></div><div id="pdfFooter"></div></div>'; |
| 247 | 266 | ||
| 248 | 267 | ||
| 249 | 268 | ||
| 250 | document.getElementById('contentArea').innerHTML = strVar2; | 269 | document.getElementById('contentArea').innerHTML = strVar2; |
| 251 | document.getElementById('google_drive').innerHTML = " "; | 270 | document.getElementById('google_drive').innerHTML = " "; |
| 252 | 271 | ||
| 253 | $(document).ready(function() { | ||
| 254 | $("#changes").validate(); | ||
| 255 | }); | ||
| 256 | 272 | ||
| 257 | 273 | ||
| 258 | 274 | ||
| 259 | if($(window).width() > 700){ | 275 | if ($(window).width() > 700) { |
| 260 | 276 | ||
| 261 | if($("#pdfPreview").height() > $("#changes").height()){ | ||
| 262 | $('#changesColumn').css('position' ,'relative'); | ||
| 263 | var stickySidebar = $('#changesColumn'); | ||
| 264 | 277 | ||
| 265 | if (stickySidebar.length > 0) { | 278 | $('#pdfPreview').css('position', 'relative'); |
| 266 | var stickyHeight = stickySidebar.height(), | 279 | var stickySidebar = $('#pdfPreview'); |
| 267 | sidebarTop = stickySidebar.offset().top; | ||
| 268 | } | ||
| 269 | 280 | ||
| 270 | // on scroll move the sidebar | ||
| 271 | $(window).scroll(function () { | ||
| 272 | if (stickySidebar.length > 0) { | 281 | if (stickySidebar.length > 0) { |
| 273 | var scrollTop = $(window).scrollTop(); | ||
| 274 | |||
| 275 | if (sidebarTop < scrollTop) { | ||
| 276 | stickySidebar.css('top', scrollTop - sidebarTop); | ||
| 277 | |||
| 278 | // stop the sticky sidebar at the footer to avoid overlapping | ||
| 279 | var sidebarBottom = stickySidebar.offset().top + stickyHeight, | ||
| 280 | stickyStop = $('#pdfPreview').offset().top + $('#pdfPreview').height(); | ||
| 281 | if (stickyStop < sidebarBottom) { | ||
| 282 | var stopPosition = $('#pdfPreview').height() - stickyHeight; | ||
| 283 | stickySidebar.css('top', stopPosition); | ||
| 284 | } | ||
| 285 | } | ||
| 286 | else { | ||
| 287 | stickySidebar.css('top', '0'); | ||
| 288 | } | ||
| 289 | } | ||
| 290 | }); | ||
| 291 | |||
| 292 | $(window).resize(function () { | ||
| 293 | if (stickySidebar.length > 0) { | ||
| 294 | stickyHeight = stickySidebar.height(); | ||
| 295 | } | ||
| 296 | }); | ||
| 297 | |||
| 298 | }else{ | ||
| 299 | |||
| 300 | console.log('false'); | ||
| 301 | var stickySidebar = $('#pdfPreview'); | ||
| 302 | |||
| 303 | if (stickySidebar.length > 0) { | ||
| 304 | var stickyHeight = stickySidebar.height(), | 282 | var stickyHeight = stickySidebar.height(), |
| 305 | sidebarTop = stickySidebar.offset().top; | 283 | sidebarTop = stickySidebar.offset().top; |
| 306 | } | 284 | } |
| 307 | 285 | ||
| 308 | // on scroll move the sidebar | 286 | // on scroll move the sidebar |
| 309 | $(window).scroll(function () { | 287 | $(window).scroll(function() { |
| 310 | if (stickySidebar.length > 0) { | 288 | if (stickySidebar.length > 0) { |
| 311 | var scrollTop = $(window).scrollTop(); | 289 | var scrollTop = $(window).scrollTop(); |
| 312 | 290 | ||
| ... | @@ -320,26 +298,20 @@ $(window).scroll(function () { | ... | @@ -320,26 +298,20 @@ $(window).scroll(function () { |
| 320 | var stopPosition = $('#changesColumn').height() - stickyHeight; | 298 | var stopPosition = $('#changesColumn').height() - stickyHeight; |
| 321 | stickySidebar.css('top', stopPosition); | 299 | stickySidebar.css('top', stopPosition); |
| 322 | } | 300 | } |
| 323 | } | 301 | } else { |
| 324 | else { | ||
| 325 | stickySidebar.css('top', '0'); | 302 | stickySidebar.css('top', '0'); |
| 326 | } | 303 | } |
| 327 | } | 304 | } |
| 328 | }); | 305 | }); |
| 329 | 306 | ||
| 330 | $(window).resize(function () { | 307 | $(window).resize(function() { |
| 331 | if (stickySidebar.length > 0) { | 308 | if (stickySidebar.length > 0) { |
| 332 | stickyHeight = stickySidebar.height(); | 309 | stickyHeight = stickySidebar.height(); |
| 333 | } | 310 | } |
| 334 | }); | 311 | }); |
| 335 | |||
| 336 | } | ||
| 337 | |||
| 338 | |||
| 339 | } | ||
| 340 | |||
| 341 | 312 | ||
| 342 | 313 | ||
| 314 | } | ||
| 343 | 315 | ||
| 344 | tinymce.init({ | 316 | tinymce.init({ |
| 345 | selector: '.textarea', | 317 | selector: '.textarea', |
| ... | @@ -348,13 +320,17 @@ $(window).resize(function () { | ... | @@ -348,13 +320,17 @@ $(window).resize(function () { |
| 348 | toolbar: ' bold italic', | 320 | toolbar: ' bold italic', |
| 349 | remove_linebreaks: false, | 321 | remove_linebreaks: false, |
| 350 | remove_trailing_brs: false, | 322 | remove_trailing_brs: false, |
| 323 | |||
| 324 | |||
| 351 | setup: function(editor) { | 325 | setup: function(editor) { |
| 352 | editor.on('focus', function(e) { | 326 | editor.on('focus', function(e) { |
| 353 | console.log(editor.id); | 327 | console.log(editor.id); |
| 354 | $('#' + editor.id).trigger("onfocus"); | 328 | $('#' + editor.id).trigger("onfocus"); |
| 329 | $(this).css('border', '2px solid #F7A800 !important'); | ||
| 355 | }); | 330 | }); |
| 356 | editor.on('focusout', function(e) { | 331 | editor.on('focusout', function(e) { |
| 357 | console.log('out'+editor.id); | 332 | // console.log('out'+editor.id); |
| 333 | $(this).css('border', '0px solid #F7A800 !important'); | ||
| 358 | HideBox(); | 334 | HideBox(); |
| 359 | }); | 335 | }); |
| 360 | } | 336 | } |
| ... | @@ -370,7 +346,7 @@ $(window).resize(function () { | ... | @@ -370,7 +346,7 @@ $(window).resize(function () { |
| 370 | $(".fileupload").change(function(e) { | 346 | $(".fileupload").change(function(e) { |
| 371 | files = e.target.files; | 347 | files = e.target.files; |
| 372 | for (var i = 0, file; file = files[i]; i++) { | 348 | for (var i = 0, file; file = files[i]; i++) { |
| 373 | console.log(file); | 349 | //console.log(file); |
| 374 | imagefiles.push(file); | 350 | imagefiles.push(file); |
| 375 | // console.log(imagefiles); | 351 | // console.log(imagefiles); |
| 376 | } | 352 | } |
| ... | @@ -380,35 +356,28 @@ $(window).resize(function () { | ... | @@ -380,35 +356,28 @@ $(window).resize(function () { |
| 380 | $("#changes").submit(function(e) { | 356 | $("#changes").submit(function(e) { |
| 381 | e.preventDefault(); | 357 | e.preventDefault(); |
| 382 | 358 | ||
| 383 | if($("#changes").valid()) { | 359 | if ($("#changes").valid()) { |
| 384 | 360 | ||
| 385 | $(tinymce.get()).each(function(i, el) { | 361 | $(tinymce.get()).each(function(i, el) { |
| 386 | 362 | ||
| 387 | if (el.id) | 363 | if (el.id) |
| 388 | document.getElementById(el.id).value = el.getContent(); | 364 | document.getElementById(el.id).value = el.getContent(); |
| 389 | ///console.log(el.id); | 365 | $('#changes').hide(); |
| 390 | tinymce.get(el.id).remove(); | 366 | tinymce.get(el.id).remove(); |
| 391 | |||
| 392 | |||
| 393 | }); | 367 | }); |
| 394 | 368 | ||
| 395 | |||
| 396 | |||
| 397 | |||
| 398 | var form = $("#changes"); | 369 | var form = $("#changes"); |
| 399 | 370 | ||
| 400 | |||
| 401 | |||
| 402 | returnfileOptions(imagefiles, form); | 371 | returnfileOptions(imagefiles, form); |
| 403 | return false; | 372 | return false; |
| 404 | }else{return false;} | 373 | } else { |
| 374 | return false; | ||
| 375 | } | ||
| 405 | }); | 376 | }); |
| 406 | 377 | ||
| 407 | |||
| 408 | |||
| 409 | }); | 378 | }); |
| 410 | 379 | ||
| 411 | } | 380 | } |
| 412 | 381 | ||
| 413 | 382 | ||
| 414 | function returnfileOptions(files, form) { | 383 | function returnfileOptions(files, form) { |
| ... | @@ -453,8 +422,6 @@ $(window).resize(function () { | ... | @@ -453,8 +422,6 @@ $(window).resize(function () { |
| 453 | 422 | ||
| 454 | 423 | ||
| 455 | 424 | ||
| 456 | |||
| 457 | |||
| 458 | jQuery(function($) { | 425 | jQuery(function($) { |
| 459 | 426 | ||
| 460 | $.getJSON("" + pdf_customizer + "/api/v1/get-pdf/" + id.value, function(dataReturnd) { | 427 | $.getJSON("" + pdf_customizer + "/api/v1/get-pdf/" + id.value, function(dataReturnd) { |
| ... | @@ -495,21 +462,15 @@ $(window).resize(function () { | ... | @@ -495,21 +462,15 @@ $(window).resize(function () { |
| 495 | dataType: 'json', | 462 | dataType: 'json', |
| 496 | data: jsonReturn, | 463 | data: jsonReturn, |
| 497 | processData: false, | 464 | processData: false, |
| 498 | |||
| 499 | contentType: "application/json", | 465 | contentType: "application/json", |
| 500 | CrossDomain: true, | 466 | CrossDomain: true, |
| 501 | |||
| 502 | |||
| 503 | |||
| 504 | |||
| 505 | async: true, | 467 | async: true, |
| 506 | success: function(data) { | 468 | success: function(data) { |
| 507 | var strVar2 = "" | 469 | var strVar2 = "" |
| 508 | strVar2 += " <div class=\"callout primary\"><div class=\"row column\"><h1>Welcome to Synapsus Online PDF Editor<\/h1>"; | 470 | strVar2 += ' <div class="callout primary"><div class="row column"><h1 class="pdfeditortitle">CUBOS COLLATERAL MATERIAL</h1>'; |
| 509 | strVar2 += "<p class=\"lead\">Please download your file below or return <a href=\"#\" onclick=\"location.reload();\">back to the list</a><\/p>"; | 471 | strVar2 += '</div></div><div class="row small-up-2 medium-up-3 large-up-3">'; |
| 510 | strVar2 += " <\/div><\/div><div class=\"row small-up-2 medium-up-3 large-up-3\">"; | 472 | strVar2 += '<br/><br/>' + '<a class="downloadpdf" href="' + pdf_customizer + '/fileentry/getPDF/' + json[0].folder + '/new_' + json[0].file + '" download="' + json[0].file + '" ><i class="fa fa-cloud-download fa-5x"></i></br>Download Here</a></div>'; |
| 511 | strVar2 += "<div class=\"column\">" + '<a href="' + pdf_customizer + '/fileentry/getPDF/' + json[0].folder + '/new_' + json[0].file + '" download="' + json[0].file + '" ><i class="fa fa-cloud-download fa-5x"></i></br>Download Here</a>'; + | 473 | |
| 512 | "<\/div><\/div>"; | ||
| 513 | 474 | ||
| 514 | document.getElementById('contentArea').innerHTML = strVar2 | 475 | document.getElementById('contentArea').innerHTML = strVar2 |
| 515 | }, | 476 | }, | ... | ... |
-
Please register or sign in to post a comment