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
436a7b40
authored
2016-04-22 14:31:48 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
7260c8aa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
3 deletions
app/Http/Controllers/ApiController.php
app/Http/routes.php
public/js/interface.js
resources/assets/js/interface.js
app/Http/Controllers/ApiController.php
View file @
436a7b4
...
...
@@ -94,7 +94,7 @@ class ApiController extends Controller
{
$rows
=
new
pdfModel
();
$rows
=
$rows
->
getList
(
$json
)
->
get
();
$response
=
json_encode
(
$rows
)
;
$response
=
$rows
;
$statusCode
=
200
;
return
Response
::
json
(
$response
,
$statusCode
);
...
...
@@ -103,7 +103,7 @@ class ApiController extends Controller
public
function
getApi
(
$json
)
{
$statusCode
=
200
;
$response
=
URL
::
asset
(
'js/interface.js'
);
$response
=
include
(
'js/interface.js'
);
return
Response
::
json
(
$response
,
$statusCode
);
}
...
...
@@ -112,7 +112,7 @@ class ApiController extends Controller
{
$rows
=
new
pdfModel
();
$rows
=
$rows
->
getpdf
(
$json
)
->
get
();
$response
=
json_encode
(
$rows
)
;
$response
=
$rows
;
$statusCode
=
200
;
return
Response
::
json
(
$response
,
$statusCode
);
...
...
app/Http/routes.php
View file @
436a7b4
...
...
@@ -18,6 +18,7 @@ Route::get('/', function () {
Route
::
get
(
'pdf/{id}'
,
'PdfController@pdf'
);
Route
::
group
(
array
(
'prefix'
=>
'api/v1'
),
function
(
$json
)
{
...
...
@@ -27,3 +28,7 @@ Route::group(array('prefix' => 'api/v1'), function($json)
Route
::
resource
(
'api'
,
'ApiController@getApi'
);
});
//Route::resource('js/interface.js', function () {
// return asset('js/interface.js');
//});
...
...
public/js/interface.js
0 → 100644
View file @
436a7b4
<
script
LANGUAGE
=
"JavaScript"
>
function
pickPdfFromList
(){
var
strVar
=
""
;
strVar
+=
"<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"
;
strVar
+=
" <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"
;
strVar
+=
" <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"
;
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
}];
var
i
;
var
pdflist
=
""
;
for
(
i
=
0
;
i
<
json
.
length
;
++
i
)
{
pdflist
+=
"<div class=\"column\">"
;
pdflist
+=
' <img class=\"thumbnail\" src="/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'
+
json
[
i
].
folder
+
'/'
+
json
[
i
].
image
+
'" height=\"270px\">'
;
pdflist
+=
" <h5>"
+
json
[
i
].
name
+
"<\/h5>"
;
pdflist
+=
"<\/div>"
;
}
strVar
+=
" <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"
;
strVar
+=
"<div class=\"off-canvas-wrapper\">"
;
strVar
+=
" <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"
;
strVar
+=
" <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"
;
strVar
+=
" <div class=\"row column\">"
;
strVar
+=
" <br>"
;
strVar
+=
" <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <div class=\"off-canvas-content\" data-off-canvas-content>"
;
strVar
+=
" <div class=\"title-bar hide-for-large\">"
;
strVar
+=
" <div class=\"title-bar-left\">"
;
strVar
+=
" <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"
;
strVar
+=
" <span class=\"title-bar-title\">Synapsus<\/span>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <div class=\"callout primary\">"
;
strVar
+=
" <div class=\"row column\">"
;
strVar
+=
" <h1>Welcome to Synapsus Online PDF Editor<\/h1>"
;
strVar
+=
" <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <div class=\"row small-up-2 medium-up-3 large-up-4\">"
;
strVar
+=
pdflist
;
strVar
+=
" <\/div>"
;
strVar
+=
" <hr>"
;
strVar
+=
""
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
" <\/div>"
;
strVar
+=
"<\/div>"
;
strVar
+=
""
;
strVar
+=
"<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"
;
strVar
+=
"<script>"
;
strVar
+=
" $(document).foundation();"
;
strVar
+=
"<\/script>"
;
strVar
+=
""
;
strVar
+=
""
;
document
.
write
(
strVar
);
}
function
changePdfOptions
(){
var
strVar2
=
""
;
strVar2
+=
"<link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"
;
strVar2
+=
" <link href=\"http:\/\/cdnjs.cloudflare.com\/ajax\/libs\/foundicons\/3.0.0\/foundation-icons.css\" rel=\"stylesheet\" type=\"text\/css\">"
;
strVar2
+=
" <script src=\"https:\/\/code.jquery.com\/jquery-2.2.3.min.js\" integrity=\"sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=\" crossorigin=\"anonymous\"><\/script>"
;
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"
}];
var
pdflist
=
""
;
pdflist
+=
"<div class=\"column\">"
;
pdflist
+=
' <img src=\"/Applications/MAMP/htdocs/pdfEdit/storage/app/public/'
+
json
[
0
].
folder
+
'/'
+
json
[
0
].
image
+
'\" width=\"300px\">'
;
pdflist
+=
"<\/div>"
;
var
pdfChange
=
"<br>"
;
pdfChange
+=
"<form id=\"changes\" action=\"\"><h4>"
+
json
[
0
].
name
+
"</h4>"
;
for
(
i
=
0
;
i
<
json
.
length
;
++
i
)
{
if
(
json
[
i
].
change_type
==
"text"
){
pdfChange
+=
" Text: <input id=\"content"
+
i
+
"\" type=\"text\" name=\"content"
+
i
+
"\" value=\""
+
json
[
i
].
content
+
"\">"
;
}
if
(
json
[
i
].
change_type
==
"img"
){
pdfChange
+=
" <input type=\"hidden\" id=\"content"
+
i
+
"\" name=\"content"
+
i
+
"\" value=\""
+
json
[
i
].
content
+
"\">"
;
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
+
"\">"
;
}
}
pdfChange
+=
" <input type=\"submit\" value=\"Submit\">"
;
pdfChange
+=
"<\/form>"
;
strVar2
+=
" <link rel=\"stylesheet\" href=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.min.css\">"
;
strVar2
+=
"<div class=\"off-canvas-wrapper\">"
;
strVar2
+=
" <div class=\"off-canvas-wrapper-inner\" data-off-canvas-wrapper>"
;
strVar2
+=
" <div class=\"off-canvas position-left reveal-for-large\" id=\"my-info\" data-off-canvas data-position=\"left\">"
;
strVar2
+=
" <div class=\"row column\">"
;
strVar2
+=
" <br>"
;
strVar2
+=
" <img class=\"thumbnail\" src=\"http:\/\/placehold.it\/550x350\">"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <div class=\"off-canvas-content\" data-off-canvas-content>"
;
strVar2
+=
" <div class=\"title-bar hide-for-large\">"
;
strVar2
+=
" <div class=\"title-bar-left\">"
;
strVar2
+=
" <button class=\"menu-icon\" type=\"button\" data-open=\"my-info\"><\/button>"
;
strVar2
+=
" <span class=\"title-bar-title\">Synapsus<\/span>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <div class=\"callout primary\">"
;
strVar2
+=
" <div class=\"row column\">"
;
strVar2
+=
" <h1>Welcome to Synapsus Online PDF Editor<\/h1>"
;
strVar2
+=
" <p class=\"lead\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\/p>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <div class=\"row small-up-2 medium-up-3 large-up-3\">"
;
strVar2
+=
pdflist
+
"<div class=\"column\">"
+
pdfChange
+
"<\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <hr>"
;
strVar2
+=
""
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
" <\/div>"
;
strVar2
+=
"<\/div>"
;
strVar2
+=
""
;
strVar2
+=
"<script src=\"http:\/\/dhbhdrzi4tiry.cloudfront.net\/cdn\/sites\/foundation.js\"><\/script>"
;
strVar2
+=
"<script>"
;
strVar2
+=
" $(document).foundation();"
;
strVar2
+=
"<\/script>"
;
strVar2
+=
""
;
strVar2
+=
""
;
document
.
write
(
strVar2
);
}
<
/script
>
\ No newline at end of file
resources/assets/js/interface.js
View file @
436a7b4
...
...
@@ -133,6 +133,7 @@ strVar2 += " $(document).foundation();";
strVar2
+=
"<\/script>"
;
strVar2
+=
""
;
strVar2
+=
""
;
}
function
returnOptions
(){
...
...
Please
register
or
sign in
to post a comment