Commit | Line | Data |
---|---|---|
e5c01f51 AE |
1 | {assign var='__pageContentID' value='content'|concat:$languageID} |
2 | ||
e5c01f51 AE |
3 | {if $pageType == 'html' || $pageType == 'tpl'} |
4 | <ul class="codemirrorToolbar"> | |
5 | <li><a href="#" id="codemirror-{@$__pageContentID}-media" class="jsTooltip" title="{lang}wcf.editor.button.media{/lang}"><span class="icon icon16 fa-file-o"></span></a></li> | |
6 | <li><a href="#" id="codemirror-{@$__pageContentID}-page" class="jsTooltip" title="{lang}wcf.editor.button.page{/lang}"><span class="icon icon16 fa-file-text-o"></span></a></li> | |
7 | </ul> | |
8 | <script data-relocate="true"> | |
75541cb5 MW |
9 | {include file='mediaJavaScript'} |
10 | ||
c652ce68 MS |
11 | require([ |
12 | 'Language', | |
13 | 'WoltLabSuite/Core/Acp/Ui/CodeMirror/Media', | |
14 | 'WoltLabSuite/Core/Acp/Ui/CodeMirror/Page' | |
15 | ], function( | |
16 | Language, | |
17 | AcpUiCodeMirrorMedia, | |
18 | AcpUiCodeMirrorPage | |
19 | ) { | |
20 | Language.addObject({ | |
e2e8c155 MW |
21 | 'wcf.page.search': '{jslang}wcf.page.search{/jslang}', |
22 | 'wcf.page.search.error.tooShort': '{jslang}wcf.page.search.error.tooShort{/jslang}', | |
23 | 'wcf.page.search.error.noResults': '{jslang}wcf.page.search.error.noResults{/jslang}', | |
24 | 'wcf.page.search.name': '{jslang}wcf.page.search.name{/jslang}', | |
25 | 'wcf.page.search.results': '{jslang}wcf.page.search.results{/jslang}', | |
c652ce68 MS |
26 | }); |
27 | ||
e5c01f51 AE |
28 | new AcpUiCodeMirrorMedia('{@$__pageContentID}'); |
29 | new AcpUiCodeMirrorPage('{@$__pageContentID}'); | |
30 | }); | |
31 | </script> | |
32 | {/if} | |
33 | ||
e5c01f51 | 34 | {if $pageType == 'text'} |
5432b9ab MW |
35 | <textarea name="content[{@$languageID}]" id="{@$__pageContentID}" |
36 | {if $pageType == 'text'} | |
223f2245 | 37 | class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}" |
3c4b45a7 | 38 | {if $action === 'edit'}data-autosave-last-edit-time="{@$page->lastUpdateTime}"{/if} |
5432b9ab MW |
39 | {/if} |
40 | >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea> | |
41 | ||
87c807bb | 42 | {include file='__wysiwygCmsToolbar'} |
e5c01f51 | 43 | {include file='wysiwyg' wysiwygSelector=$__pageContentID} |
5432b9ab MW |
44 | {else} |
45 | <div dir="ltr"> | |
46 | <textarea name="content[{@$languageID}]" id="{@$__pageContentID}" | |
223f2245 AE |
47 | {if $pageType == 'text'} |
48 | class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}" | |
3c4b45a7 | 49 | {if $action === 'edit'}data-autosave-last-edit-time="{@$page->lastUpdateTime}"{/if} |
5432b9ab MW |
50 | {/if} |
51 | >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea> | |
52 | </div> | |
53 | {if $pageType == 'html'} | |
54 | {include file='codemirror' codemirrorMode='htmlmixed' codemirrorSelector='#content'|concat:$languageID} | |
55 | {elseif $pageType == 'tpl'} | |
56 | {include file='codemirror' codemirrorMode='smartymixed' codemirrorSelector='#content'|concat:$languageID} | |
57 | {/if} | |
849be203 | 58 | {/if} |