'wcf.editor.spoiler.title': '{lang __literal=true}wcf.editor.spoiler.title{/lang}'
});
- var buttons = [], buttonOptions = [], customButtons = [];
+ var buttons = [], buttonMobile = [], buttonOptions = [], customButtons = [];
{include file='wysiwygToolbar'}
var highlighters = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} };
woltlab: {
autosave: autosave,
buttons: buttonOptions,
+ buttonMobile: buttonMobile,
customButtons: customButtons,
highlighters: highlighters
}
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabImage.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabInlineCode.js?v={@LAST_UPDATE_TIME}',
+ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabKeydown.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabLink.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMedia.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMention.js?v={@LAST_UPDATE_TIME}',
'wcf.editor.spoiler.title': '{lang __literal=true}wcf.editor.spoiler.title{/lang}'
});
- var buttons = [], buttonOptions = [], customButtons = [];
+ var buttons = [], buttonMobile = [], buttonOptions = [], customButtons = [];
{include file='wysiwygToolbar'}
var highlighters = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} };
lang: 'wsc', // fake language to offload phrases
langs: {
wsc: {
+ // general
+ edit: '{lang}wcf.global.button.edit{/lang}',
+
// formatting dropdown
heading2: '{lang}wcf.editor.format.heading2{/lang}',
heading3: '{lang}wcf.editor.format.heading3{/lang}',
heading4: '{lang}wcf.editor.format.heading4{/lang}',
paragraph: '{lang}wcf.editor.format.paragraph{/lang}',
+ // links
+ 'link-edit': '{lang}wcf.editor.link.edit{/lang}',
+ 'link-insert': '{lang}wcf.editor.link.add{/lang}',
+ unlink: '{lang}wcf.editor.link.unlink{/lang}',
+
+ // text alignment
'align-center': '{lang}wcf.editor.alignment.center{/lang}',
'align-justify': '{lang}wcf.editor.alignment.justify{/lang}',
'align-left': '{lang}wcf.editor.alignment.left{/lang}',
linkSize: 0xBADC0DED, // some random value to disable truncating
minHeight: 200,
plugins: [
+ // Imperavi
'alignment',
'source',
'table',
+
+ // WoltLab specials
+ 'WoltLabBlock',
+ 'WoltLabKeydown',
+
+ // WoltLab core
'WoltLabAlignment',
'WoltLabAttachment',
- 'WoltLabBlock',
'WoltLabCode',
'WoltLabColor',
'WoltLabDropdown',
woltlab: {
autosave: autosave,
buttons: buttonOptions,
+ buttonMobile: buttonMobile,
customButtons: customButtons,
highlighters: highlighters
}
}
}
+ // button mobile visibility
+ for (i = 0, length = toolbar.childElementCount; i < length; i++) {
+ listItem = toolbar.children[i];
+ button = listItem.children[0];
+
+ elData(listItem, 'show-on-mobile', (this.opts.woltlab.buttonMobile.indexOf(button.rel) !== -1));
+ }
+
// add remaining elements
toolbarOrder.forEach(function(buttonName) {
toolbar.appendChild(toolbarButtons[buttonName]);
flex: 0 0 auto;
margin-bottom: 1px;
- &.redactor-toolbar-separator {
- margin-left: 11px;
- position: relative;
-
- &::before {
- bottom: 7px;
- border-left: 1px solid $wcfHeaderMenuLink;
- content: "";
- left: -6px;
- opacity: .6;
- position: absolute;
- top: 7px;
- }
- }
-
> a {
color: $wcfHeaderMenuLink;
display: block;
cursor: inherit !important;
}
}
+
+ @include screen-sm-up {
+ &.redactor-toolbar-separator {
+ margin-left: 11px;
+ position: relative;
+
+ &::before {
+ bottom: 7px;
+ border-left: 1px solid $wcfHeaderMenuLink;
+ content: "";
+ left: -6px;
+ opacity: .6;
+ position: absolute;
+ top: 7px;
+ }
+ }
+ }
+
+ @include screen-xs {
+ &[data-show-on-mobile="false"] {
+ display: none;
+ }
+ }
}
}