js
Showing
1 changed file
with
156 additions
and
0 deletions
resources/assets/js/interface.js
0 → 100644
| 1 | <SCRIPT LANGUAGE="JavaScript"> | ||
| 2 | |||
| 3 | function pickPdfFromList(){ | ||
| 4 | |||
| 5 | var strVar=""; | ||
| 6 | strVar += "<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 7 | strVar += " <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"; | ||
| 8 | strVar += " <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"; | ||
| 9 | |||
| 10 | var json = [{"idPDF":14,"name":"SISKINDS_test file","folder":"SISKINDS_test","file":"SISKINDS_test_file.pdf","image":"SISKINDS_test_file.jpg","custId":1,"apiCallId":3},{"idPDF":27,"name":"test file","folder":"SISKINDStest-file","file":"pdf-sample.pdf","image":"pdf-sample.jpg","custId":1,"apiCallId":25}]; | ||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | var i; | ||
| 15 | var pdflist =""; | ||
| 16 | for (i = 0; i < json.length; ++i) { | ||
| 17 | pdflist += "<div class=\"column\">"; | ||
| 18 | pdflist += ' <img class=\"thumbnail\" src="/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'+json[i].folder+'/'+json[i].image+'" height=\"270px\">'; | ||
| 19 | pdflist += " <h5>"+json[i].name+"<\/h5>"; | ||
| 20 | pdflist += "<\/div>"; | ||
| 21 | } | ||
| 22 | |||
| 23 | |||
| 24 | strVar += " <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 25 | strVar += "<div class=\"off-canvas-wrapper\">"; | ||
| 26 | strVar += " <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"; | ||
| 27 | strVar += " <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"; | ||
| 28 | strVar += " <div class=\"row column\">"; | ||
| 29 | strVar += " <br>"; | ||
| 30 | strVar += " <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"; | ||
| 31 | strVar += " <\/div>"; | ||
| 32 | strVar += " <\/div>"; | ||
| 33 | strVar += " <div class=\"off-canvas-content\" data-off-canvas-content>"; | ||
| 34 | strVar += " <div class=\"title-bar hide-for-large\">"; | ||
| 35 | strVar += " <div class=\"title-bar-left\">"; | ||
| 36 | strVar += " <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"; | ||
| 37 | strVar += " <span class=\"title-bar-title\">Synapsus<\/span>"; | ||
| 38 | strVar += " <\/div>"; | ||
| 39 | strVar += " <\/div>"; | ||
| 40 | strVar += " <div class=\"callout primary\">"; | ||
| 41 | strVar += " <div class=\"row column\">"; | ||
| 42 | strVar += " <h1>Welcome to Synapsus Online PDF Editor<\/h1>"; | ||
| 43 | strVar += " <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"; | ||
| 44 | strVar += " <\/div>"; | ||
| 45 | strVar += " <\/div>"; | ||
| 46 | strVar += " <div class=\"row small-up-2 medium-up-3 large-up-4\">"; | ||
| 47 | strVar += pdflist; | ||
| 48 | strVar += " <\/div>"; | ||
| 49 | strVar += " <hr>"; | ||
| 50 | strVar += ""; | ||
| 51 | strVar += " <\/div>"; | ||
| 52 | strVar += " <\/div>"; | ||
| 53 | strVar += " <\/div>"; | ||
| 54 | strVar += " <\/div>"; | ||
| 55 | strVar += "<\/div>"; | ||
| 56 | strVar += ""; | ||
| 57 | strVar += "<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"; | ||
| 58 | strVar += "<script>"; | ||
| 59 | strVar += " $(document).foundation();"; | ||
| 60 | strVar += "<\/script>"; | ||
| 61 | strVar += ""; | ||
| 62 | strVar += ""; | ||
| 63 | } | ||
| 64 | |||
| 65 | function changePdfOptions(){ | ||
| 66 | |||
| 67 | var strVar2=""; | ||
| 68 | strVar2 += "<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 69 | strVar2 += " <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"; | ||
| 70 | strVar2 += " <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"; | ||
| 71 | |||
| 72 | var json = [{"idPDF":14,"name":"test file","folder":"SISKINDS_test","file":"SISKINDS_test_file.pdf","image":"SISKINDS_test_file.jpg","custId":1,"apiCallId":3,"idchangesPDF":18,"PDF_idPDF":14,"change_typePDF_idchange_typePDF":1,"stylesPDF_idstylesPDF":18,"locationUp":"60","locationRight":290,"pages":"1","content":"519.660.2121 siskinds.com\/change","z-index":0,"idstylesPDF":18,"order":"1","label":"Text","style":"a:3:{s:11:\"font-family\";s:11:\"TradeGothic\";s:9:\"font-size\";s:2:\"14\";s:10:\"font-color\";s:14:\"cmyk 0 0 0.5 0\";}","idchange_typePDF":1,"change_type":"text"},{"idPDF":14,"name":"test file","folder":"SISKINDS_test","file":"SISKINDS_test_file.pdf","image":"SISKINDS_test_file.jpg","custId":1,"apiCallId":3,"idchangesPDF":17,"PDF_idPDF":14,"change_typePDF_idchange_typePDF":2,"stylesPDF_idstylesPDF":17,"locationUp":"400","locationRight":90,"pages":"1","content":"siskins.png","z-index":0,"idstylesPDF":17,"order":"2","label":"Image","style":null,"idchange_typePDF":2,"change_type":"img"}]; | ||
| 73 | var pdflist =""; | ||
| 74 | |||
| 75 | pdflist += "<div class=\"column\">"; | ||
| 76 | pdflist += ' <img src=\"/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'+json[0].folder+'/'+json[0].image+'\" width=\"300px\">'; | ||
| 77 | pdflist += "<\/div>"; | ||
| 78 | var pdfChange="<br>"; | ||
| 79 | pdfChange += "<form id=\"changes\" action=\"\"><h4>" + json[0].name+"</h4>"; | ||
| 80 | for (i = 0; i < json.length; ++i) { | ||
| 81 | if(json[i].change_type == "text"){ | ||
| 82 | |||
| 83 | |||
| 84 | pdfChange += " Text: <input id=\"content"+i+"\" type=\"text\" name=\"content"+i+"\" value=\""+json[i].content+"\">"; | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | }if(json[i].change_type == "img"){ | ||
| 89 | pdfChange += " <input type=\"hidden\" id=\"content"+i+"\" name=\"content"+i+"\" value=\""+json[i].content+"\">"; | ||
| 90 | pdfChange += " Image: <input id=\"content"+i+"\" 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+"\" value=\""+json[i].content+"\">"; | ||
| 91 | } | ||
| 92 | |||
| 93 | } | ||
| 94 | pdfChange += " <input type=\"submit\" value=\"Submit\">"; | ||
| 95 | pdfChange += "<\/form>"; | ||
| 96 | |||
| 97 | strVar2 += " <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 98 | strVar2 += "<div class=\"off-canvas-wrapper\">"; | ||
| 99 | strVar2 += " <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"; | ||
| 100 | strVar2 += " <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"; | ||
| 101 | strVar2 += " <div class=\"row column\">"; | ||
| 102 | strVar2 += " <br>"; | ||
| 103 | strVar2 += " <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"; | ||
| 104 | strVar2 += " <\/div>"; | ||
| 105 | strVar2 += " <\/div>"; | ||
| 106 | strVar2 += " <div class=\"off-canvas-content\" data-off-canvas-content>"; | ||
| 107 | strVar2 += " <div class=\"title-bar hide-for-large\">"; | ||
| 108 | strVar2 += " <div class=\"title-bar-left\">"; | ||
| 109 | strVar2 += " <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"; | ||
| 110 | strVar2 += " <span class=\"title-bar-title\">Synapsus<\/span>"; | ||
| 111 | strVar2 += " <\/div>"; | ||
| 112 | strVar2 += " <\/div>"; | ||
| 113 | strVar2 += " <div class=\"callout primary\">"; | ||
| 114 | strVar2 += " <div class=\"row column\">"; | ||
| 115 | strVar2 += " <h1>Welcome to Synapsus Online PDF Editor<\/h1>"; | ||
| 116 | strVar2 += " <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"; | ||
| 117 | strVar2 += " <\/div>"; | ||
| 118 | strVar2 += " <\/div>"; | ||
| 119 | strVar2 += " <div class=\"row small-up-2 medium-up-3 large-up-3\">"; | ||
| 120 | strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div>"; | ||
| 121 | strVar2 += " <\/div>"; | ||
| 122 | strVar2 += " <hr>"; | ||
| 123 | strVar2 += ""; | ||
| 124 | strVar2 += " <\/div>"; | ||
| 125 | strVar2 += " <\/div>"; | ||
| 126 | strVar2 += " <\/div>"; | ||
| 127 | strVar2 += " <\/div>"; | ||
| 128 | strVar2 += "<\/div>"; | ||
| 129 | strVar2 += ""; | ||
| 130 | strVar2 += "<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"; | ||
| 131 | strVar2 += "<script>"; | ||
| 132 | strVar2 += " $(document).foundation();"; | ||
| 133 | strVar2 += "<\/script>"; | ||
| 134 | strVar2 += ""; | ||
| 135 | strVar2 += ""; | ||
| 136 | } | ||
| 137 | |||
| 138 | function returnOptions(){ | ||
| 139 | |||
| 140 | var jsonReturn = '{"pdf":[{"name":"'+json[0].name+'", "folder":"'+json[0].name+'", "pdfLocation":""}],"changes":[' | ||
| 141 | |||
| 142 | for (i = 0; i < json.length; ++i) { | ||
| 143 | |||
| 144 | jsonReturn +='{"label":"'+json[i].label+'", "locationUp":"'+json[i].locationUp+'", "locationRight":"'+json[i].locationRight+'", "pages":"'+json[i].pages+'", "content":"'+json[i].content+'", "z-index":null, "idstylesPDF":"'+json[i].idstylesPDF, "order":"'+json[i].order, "style":"'+json[i].style, "idchange_typePDF":"'+json[i].idchange_typePDF+'", "change_type":"'+json[i].change_type+'", "fileLocation":""}'; | ||
| 145 | |||
| 146 | |||
| 147 | } | ||
| 148 | jsonReturn +=' }]}'; | ||
| 149 | |||
| 150 | |||
| 151 | } | ||
| 152 | |||
| 153 | |||
| 154 | </script> | ||
| 155 | |||
| 156 | |||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment