/**
* Get a js representation of the current translations
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
+ * @throws \Exception
*/
public function getTranslations() {
$locale = app()->getLocale();
]);
}
+ /**
+ * Get custom head HTML, Used in ajax calls to show in editor.
+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ */
+ public function customHeadContent()
+ {
+ return view('partials/custom-head-content');
+ }
+
}
}
+/**
+ * Load custom HTML head content from the settings into the editor.
+ * @param editor
+ */
+function loadCustomHeadContent(editor) {
+ window.$http.get(window.baseUrl('/custom-head-content')).then(resp => {
+ if (!resp.data) return;
+ let head = editor.getDoc().querySelector('head');
+ head.innerHTML += resp.data;
+ });
+}
/**
* Create and enable our custom code plugin
args.content = '';
}
},
+ init_instance_callback: function(editor) {
+ loadCustomHeadContent(editor);
+ },
setup: function (editor) {
editor.on('init ExecCommand change input NodeChange ObjectResized', editorChange);
padding: 0 $-m 0;
margin-left: -1px;
overflow-y: scroll;
- .page-content {
- margin: 0 auto;
- }
+ }
+ .markdown-display.page-content {
+ margin: 0 auto;
+ max-width: 100%;
}
}
.editor-toolbar {
<div class="editor-toolbar">
<div class="">{{ trans('entities.pages_md_preview') }}</div>
</div>
- <div class="markdown-display">
- <div class="page-content"></div>
+ <div class="markdown-display page-content">
</div>
</div>
<input type="hidden" name="html"/>
--- /dev/null
+@if(setting('app-custom-head', false))
+ <!-- Custom user content -->
+ {!! setting('app-custom-head') !!}
+ <!-- End custom user content -->
+@endif
\ No newline at end of file
// Other Pages
Route::get('/', 'HomeController@index');
Route::get('/home', 'HomeController@index');
+ Route::get('/custom-head-content', 'HomeController@customHeadContent');
// Settings
Route::group(['prefix' => 'settings'], function() {