mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Proposals
This commit is contained in:
parent
3a32d03bea
commit
ff53cd62e6
@ -105,11 +105,20 @@ class DocumentController extends BaseController
|
|||||||
'code' => 400,
|
'code' => 400,
|
||||||
], 400);
|
], 400);
|
||||||
} else {
|
} else {
|
||||||
return Response::json([
|
if ($request->grapesjs) {
|
||||||
|
$response = [
|
||||||
|
'data' => [
|
||||||
|
$result->getUrl()
|
||||||
|
]
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$response = [
|
||||||
'error' => false,
|
'error' => false,
|
||||||
'document' => $doc_array,
|
'document' => $doc_array,
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
], 200);
|
];
|
||||||
|
}
|
||||||
|
return Response::json($response, 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,11 @@ class DocumentRepository extends BaseRepository
|
|||||||
|
|
||||||
public function upload($data, &$doc_array = null)
|
public function upload($data, &$doc_array = null)
|
||||||
{
|
{
|
||||||
|
if (! empty($data['files']) && is_array($data['files'])) {
|
||||||
|
$uploaded = $data['files'][0];
|
||||||
|
} else {
|
||||||
$uploaded = $data['file'];
|
$uploaded = $data['file'];
|
||||||
|
}
|
||||||
$extension = strtolower($uploaded->getClientOriginalExtension());
|
$extension = strtolower($uploaded->getClientOriginalExtension());
|
||||||
if (empty(Document::$types[$extension]) && ! empty(Document::$extraExtensions[$extension])) {
|
if (empty(Document::$types[$extension]) && ! empty(Document::$extraExtensions[$extension])) {
|
||||||
$documentType = Document::$extraExtensions[$extension];
|
$documentType = Document::$extraExtensions[$extension];
|
||||||
|
@ -14,7 +14,19 @@ $(function() {
|
|||||||
'categoryLabel': "{{ trans('texts.standard') }}"
|
'categoryLabel': "{{ trans('texts.standard') }}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
storageManager: {type: 'none'},
|
storageManager: {
|
||||||
|
type: 'none'
|
||||||
|
},
|
||||||
|
assetManager: {
|
||||||
|
assets: [],
|
||||||
|
noAssets: 'no assets TODO',
|
||||||
|
upload: {!! json_encode(url('/documents')) !!},
|
||||||
|
uploadName: 'files',
|
||||||
|
params: {
|
||||||
|
'_token': '{{ Session::getToken() }}',
|
||||||
|
'grapesjs': true,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var blockManager = grapesjsEditor.BlockManager;
|
var blockManager = grapesjsEditor.BlockManager;
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gjs-mdl-title {
|
||||||
|
font-size: 1em !important;
|
||||||
|
}
|
||||||
|
.gjs-mdl-dialog,
|
||||||
.gjs-toolbar-item {
|
.gjs-toolbar-item {
|
||||||
font-size: 2em !important;
|
font-size: 2em !important;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user