commit
Showing
4 changed files
with
158 additions
and
5 deletions
| ... | @@ -94,7 +94,7 @@ class ApiController extends Controller | ... | @@ -94,7 +94,7 @@ class ApiController extends Controller |
| 94 | { | 94 | { |
| 95 | $rows = new pdfModel(); | 95 | $rows = new pdfModel(); |
| 96 | $rows = $rows->getList($json)->get(); | 96 | $rows = $rows->getList($json)->get(); |
| 97 | $response = json_encode($rows); | 97 | $response = $rows; |
| 98 | $statusCode = 200; | 98 | $statusCode = 200; |
| 99 | return Response::json($response, $statusCode); | 99 | return Response::json($response, $statusCode); |
| 100 | 100 | ||
| ... | @@ -103,7 +103,7 @@ class ApiController extends Controller | ... | @@ -103,7 +103,7 @@ class ApiController extends Controller |
| 103 | public function getApi($json) | 103 | public function getApi($json) |
| 104 | { | 104 | { |
| 105 | $statusCode = 200; | 105 | $statusCode = 200; |
| 106 | $response = URL::asset('js/interface.js'); | 106 | $response = include('js/interface.js'); |
| 107 | return Response::json($response, $statusCode); | 107 | return Response::json($response, $statusCode); |
| 108 | 108 | ||
| 109 | } | 109 | } |
| ... | @@ -112,7 +112,7 @@ class ApiController extends Controller | ... | @@ -112,7 +112,7 @@ class ApiController extends Controller |
| 112 | { | 112 | { |
| 113 | $rows = new pdfModel(); | 113 | $rows = new pdfModel(); |
| 114 | $rows = $rows->getpdf($json)->get(); | 114 | $rows = $rows->getpdf($json)->get(); |
| 115 | $response = json_encode($rows); | 115 | $response = $rows; |
| 116 | $statusCode = 200; | 116 | $statusCode = 200; |
| 117 | return Response::json($response, $statusCode); | 117 | return Response::json($response, $statusCode); |
| 118 | 118 | ... | ... |
| ... | @@ -18,6 +18,7 @@ Route::get('/', function () { | ... | @@ -18,6 +18,7 @@ Route::get('/', function () { |
| 18 | 18 | ||
| 19 | Route::get('pdf/{id}', 'PdfController@pdf'); | 19 | Route::get('pdf/{id}', 'PdfController@pdf'); |
| 20 | 20 | ||
| 21 | |||
| 21 | Route::group(array('prefix' => 'api/v1'), function($json) | 22 | Route::group(array('prefix' => 'api/v1'), function($json) |
| 22 | { | 23 | { |
| 23 | 24 | ||
| ... | @@ -26,4 +27,8 @@ Route::group(array('prefix' => 'api/v1'), function($json) | ... | @@ -26,4 +27,8 @@ Route::group(array('prefix' => 'api/v1'), function($json) |
| 26 | Route::resource('get-pdf', 'ApiController@getpdf'); | 27 | Route::resource('get-pdf', 'ApiController@getpdf'); |
| 27 | Route::resource('api', 'ApiController@getApi'); | 28 | Route::resource('api', 'ApiController@getApi'); |
| 28 | 29 | ||
| 29 | }); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 30 | }); | ||
| 31 | |||
| 32 | //Route::resource('js/interface.js', function () { | ||
| 33 | // return asset('js/interface.js'); | ||
| 34 | //}); | ... | ... |
public/js/interface.js
0 → 100644
| 1 | <script LANGUAGE="JavaScript"> | ||
| 2 | |||
| 3 | |||
| 4 | function pickPdfFromList(){ | ||
| 5 | |||
| 6 | var strVar=""; | ||
| 7 | strVar += "<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 8 | strVar += " <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"; | ||
| 9 | strVar += " <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"; | ||
| 10 | |||
| 11 | 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}]; | ||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | var i; | ||
| 16 | var pdflist =""; | ||
| 17 | for (i = 0; i < json.length; ++i) { | ||
| 18 | pdflist += "<div class=\"column\">"; | ||
| 19 | pdflist += ' <img class=\"thumbnail\" src="/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'+json[i].folder+'/'+json[i].image+'" height=\"270px\">'; | ||
| 20 | pdflist += " <h5>"+json[i].name+"<\/h5>"; | ||
| 21 | pdflist += "<\/div>"; | ||
| 22 | } | ||
| 23 | |||
| 24 | |||
| 25 | strVar += " <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 26 | strVar += "<div class=\"off-canvas-wrapper\">"; | ||
| 27 | strVar += " <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"; | ||
| 28 | strVar += " <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"; | ||
| 29 | strVar += " <div class=\"row column\">"; | ||
| 30 | strVar += " <br>"; | ||
| 31 | strVar += " <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"; | ||
| 32 | strVar += " <\/div>"; | ||
| 33 | strVar += " <\/div>"; | ||
| 34 | strVar += " <div class=\"off-canvas-content\" data-off-canvas-content>"; | ||
| 35 | strVar += " <div class=\"title-bar hide-for-large\">"; | ||
| 36 | strVar += " <div class=\"title-bar-left\">"; | ||
| 37 | strVar += " <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"; | ||
| 38 | strVar += " <span class=\"title-bar-title\">Synapsus<\/span>"; | ||
| 39 | strVar += " <\/div>"; | ||
| 40 | strVar += " <\/div>"; | ||
| 41 | strVar += " <div class=\"callout primary\">"; | ||
| 42 | strVar += " <div class=\"row column\">"; | ||
| 43 | strVar += " <h1>Welcome to Synapsus Online PDF Editor<\/h1>"; | ||
| 44 | strVar += " <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"; | ||
| 45 | strVar += " <\/div>"; | ||
| 46 | strVar += " <\/div>"; | ||
| 47 | strVar += " <div class=\"row small-up-2 medium-up-3 large-up-4\">"; | ||
| 48 | strVar += pdflist; | ||
| 49 | strVar += " <\/div>"; | ||
| 50 | strVar += " <hr>"; | ||
| 51 | strVar += ""; | ||
| 52 | strVar += " <\/div>"; | ||
| 53 | strVar += " <\/div>"; | ||
| 54 | strVar += " <\/div>"; | ||
| 55 | strVar += " <\/div>"; | ||
| 56 | strVar += "<\/div>"; | ||
| 57 | strVar += ""; | ||
| 58 | strVar += "<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"; | ||
| 59 | strVar += "<script>"; | ||
| 60 | strVar += " $(document).foundation();"; | ||
| 61 | strVar += "<\/script>"; | ||
| 62 | strVar += ""; | ||
| 63 | strVar += ""; | ||
| 64 | document.write(strVar); | ||
| 65 | |||
| 66 | } | ||
| 67 | |||
| 68 | function changePdfOptions(){ | ||
| 69 | |||
| 70 | var strVar2=""; | ||
| 71 | strVar2 += "<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 72 | strVar2 += " <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"; | ||
| 73 | strVar2 += " <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"; | ||
| 74 | |||
| 75 | 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"}]; | ||
| 76 | var pdflist =""; | ||
| 77 | |||
| 78 | pdflist += "<div class=\"column\">"; | ||
| 79 | pdflist += ' <img src=\"/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'+json[0].folder+'/'+json[0].image+'\" width=\"300px\">'; | ||
| 80 | pdflist += "<\/div>"; | ||
| 81 | var pdfChange="<br>"; | ||
| 82 | pdfChange += "<form id=\"changes\" action=\"\"><h4>" + json[0].name+"</h4>"; | ||
| 83 | for (i = 0; i < json.length; ++i) { | ||
| 84 | if(json[i].change_type == "text"){ | ||
| 85 | |||
| 86 | |||
| 87 | pdfChange += " Text: <input id=\"content"+i+"\" type=\"text\" name=\"content"+i+"\" value=\""+json[i].content+"\">"; | ||
| 88 | |||
| 89 | |||
| 90 | |||
| 91 | }if(json[i].change_type == "img"){ | ||
| 92 | pdfChange += " <input type=\"hidden\" id=\"content"+i+"\" name=\"content"+i+"\" value=\""+json[i].content+"\">"; | ||
| 93 | 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+"\">"; | ||
| 94 | } | ||
| 95 | |||
| 96 | } | ||
| 97 | pdfChange += " <input type=\"submit\" value=\"Submit\">"; | ||
| 98 | pdfChange += "<\/form>"; | ||
| 99 | |||
| 100 | strVar2 += " <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"; | ||
| 101 | strVar2 += "<div class=\"off-canvas-wrapper\">"; | ||
| 102 | strVar2 += " <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"; | ||
| 103 | strVar2 += " <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"; | ||
| 104 | strVar2 += " <div class=\"row column\">"; | ||
| 105 | strVar2 += " <br>"; | ||
| 106 | strVar2 += " <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"; | ||
| 107 | strVar2 += " <\/div>"; | ||
| 108 | strVar2 += " <\/div>"; | ||
| 109 | strVar2 += " <div class=\"off-canvas-content\" data-off-canvas-content>"; | ||
| 110 | strVar2 += " <div class=\"title-bar hide-for-large\">"; | ||
| 111 | strVar2 += " <div class=\"title-bar-left\">"; | ||
| 112 | strVar2 += " <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"; | ||
| 113 | strVar2 += " <span class=\"title-bar-title\">Synapsus<\/span>"; | ||
| 114 | strVar2 += " <\/div>"; | ||
| 115 | strVar2 += " <\/div>"; | ||
| 116 | strVar2 += " <div class=\"callout primary\">"; | ||
| 117 | strVar2 += " <div class=\"row column\">"; | ||
| 118 | strVar2 += " <h1>Welcome to Synapsus Online PDF Editor<\/h1>"; | ||
| 119 | strVar2 += " <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"; | ||
| 120 | strVar2 += " <\/div>"; | ||
| 121 | strVar2 += " <\/div>"; | ||
| 122 | strVar2 += " <div class=\"row small-up-2 medium-up-3 large-up-3\">"; | ||
| 123 | strVar2 += pdflist+"<div class=\"column\">"+pdfChange+"<\/div>"; | ||
| 124 | strVar2 += " <\/div>"; | ||
| 125 | strVar2 += " <hr>"; | ||
| 126 | strVar2 += ""; | ||
| 127 | strVar2 += " <\/div>"; | ||
| 128 | strVar2 += " <\/div>"; | ||
| 129 | strVar2 += " <\/div>"; | ||
| 130 | strVar2 += " <\/div>"; | ||
| 131 | strVar2 += "<\/div>"; | ||
| 132 | strVar2 += ""; | ||
| 133 | strVar2 += "<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"; | ||
| 134 | strVar2 += "<script>"; | ||
| 135 | strVar2 += " $(document).foundation();"; | ||
| 136 | strVar2 += "<\/script>"; | ||
| 137 | strVar2 += ""; | ||
| 138 | strVar2 += ""; | ||
| 139 | |||
| 140 | document.write(strVar2); | ||
| 141 | } | ||
| 142 | |||
| 143 | |||
| 144 | |||
| 145 | </script> | ||
| 146 | |||
| 147 | |||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -133,7 +133,8 @@ strVar2 += " $(document).foundation();"; | ... | @@ -133,7 +133,8 @@ strVar2 += " $(document).foundation();"; |
| 133 | strVar2 += "<\/script>"; | 133 | strVar2 += "<\/script>"; |
| 134 | strVar2 += ""; | 134 | strVar2 += ""; |
| 135 | strVar2 += ""; | 135 | strVar2 += ""; |
| 136 | } | 136 | |
| 137 | } | ||
| 137 | 138 | ||
| 138 | function returnOptions(){ | 139 | function returnOptions(){ |
| 139 | 140 | ... | ... |
-
Please register or sign in to post a comment