woltlabSize: { icon: 'fa-text-height', title: '{lang}wcf.editor.button.size{/lang}' }
};
-buttonMobile = ['format', 'bold', 'italic', 'underline', 'alignment', 'link', 'woltlabImage', 'woltlabMedia'];
+buttonMobile = ['format', 'bold', 'italic', 'underline', 'lists', 'link', 'woltlabImage'];
buttons.push('html');
buttons.push('undo');
var config = {
buttons: buttons,
- clipboardImageUpload: false,
+ clipboardImageUpload: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
direction: '{lang}wcf.global.pageDirection{/lang}',
formatting: ['p', 'h2', 'h3', 'h4'],
imageCaption: false,
+ imageUpload: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
lang: 'wsc', // fake language to offload phrases
langs: {
wsc: {
linkify: false,
linkSize: 0xBADC0DED, // some random value to disable truncating
minHeight: 200,
- pasteImages: false,
+ pasteImages: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
plugins: [
// Imperavi
'alignment',
woltlabSize: { icon: 'fa-text-height', title: '{lang}wcf.editor.button.size{/lang}' }
};
-buttonMobile = ['format', 'bold', 'italic', 'underline', 'alignment', 'link', 'woltlabImage', 'woltlabMedia'];
+buttonMobile = ['format', 'bold', 'italic', 'underline', 'lists', 'link', 'woltlabImage'];
buttons.push('html');
buttons.push('undo');
$.Redactor.prototype.WoltLabButton = function() {
"use strict";
+ var _toggleButton;
+
return {
init: function() {
// add custom buttons
});
WCF.DOMNodeInsertedHandler.execute();
+
+ require(['Ui/Screen'], (function (UiScreen) {
+ UiScreen.on('screen-xs', {
+ match: this.WoltLabButton._enableToggleButton.bind(this),
+ unmatch: this.WoltLabButton._disableToggleButton.bind(this),
+ setup: this.WoltLabButton._setupToggleButton.bind(this)
+ });
+ }).bind(this));
},
_handleCustomButton: function (bbcode) {
this.$editor[0].focus();
}
}).bind(this), 10);
+ },
+
+ _enableToggleButton: function () {
+ if (_toggleButton.parentNode === null) {
+ this.$toolbar[0].appendChild(_toggleButton);
+ }
+ },
+
+ _disableToggleButton: function () {
+ if (_toggleButton.parentNode !== null) {
+ this.$toolbar[0].removeChild(_toggleButton);
+ }
+ },
+
+ _setupToggleButton: function () {
+ _toggleButton = elCreate('li');
+ _toggleButton.className = 'redactorToolbarToggle';
+ _toggleButton.innerHTML = '<a href="#"><span class="icon icon16 fa-caret-down"></span></a>';
+ elData(_toggleButton, 'show-on-mobile', true);
+
+ var icon = _toggleButton.children[0].children[0];
+
+ _toggleButton.children[0].addEventListener('mousedown', (function (event) {
+ event.preventDefault();
+
+ this.$toolbar[0].classList.toggle('redactorToolbarOverride');
+
+ icon.classList.toggle('fa-caret-down');
+ icon.classList.toggle('fa-caret-up');
+ }).bind(this));
+
+ this.$toolbar[0].appendChild(_toggleButton);
}
};
};
}
}
}
-
- @include screen-xs {
+ }
+
+ @include screen-xs {
+ &:not(.redactorToolbarOverride) > li {
&[data-show-on-mobile="false"] {
display: none;
}
}
+
+ &.redactorToolbarOverride > .redactor-toolbar-separator {
+ position: relative;
+
+ &::before {
+ bottom: 7px;
+ border-left: 1px solid $wcfHeaderMenuLink;
+ content: "";
+ left: 0;
+ opacity: .6;
+ position: absolute;
+ top: 7px;
+ }
+ }
+
+ .redactorToolbarToggle {
+ position: relative;
+
+ &::before {
+ bottom: 7px;
+ border-left: 1px solid $wcfHeaderMenuLink;
+ content: "";
+ left: 0;
+ opacity: .6;
+ position: absolute;
+ top: 7px;
+ }
+ }
}
}