From 9d127a5e6b458f48b56097b2fabd787348b56293 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 21 Aug 2017 12:43:50 +0200 Subject: [PATCH] Upgraded to Redactor II 2.9.0 --- .../files/js/3rdParty/redactor2/redactor.js | 139 ++++++++++++------ .../js/3rdParty/redactor2/redactor.min.js | 2 +- 2 files changed, 91 insertions(+), 50 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js index 0b6c575b7c..265d6828b0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js @@ -1,7 +1,7 @@ /* Redactor II - Version 2.8.1 - Updated: July 4, 2017 + Version 2.9 + Updated: August 13, 2017 http://imperavi.com/redactor/ @@ -101,7 +101,7 @@ // Options $.Redactor = Redactor; - $.Redactor.VERSION = '2.8.1'; + $.Redactor.VERSION = '2.9'; $.Redactor.modules = ['air', 'autosave', 'block', 'buffer', 'build', 'button', 'caret', 'clean', 'code', 'core', 'detect', 'dropdown', 'events', 'file', 'focus', 'image', 'indent', 'inline', 'insert', 'keydown', 'keyup', 'lang', 'line', 'link', 'linkify', 'list', 'marker', 'modal', 'observe', 'offset', 'paragraphize', 'paste', 'placeholder', @@ -217,6 +217,7 @@ }, keepStyleAttr: [], // tag name array + keepInlineOnEnter: false, // shortcuts shortcuts: { @@ -1106,19 +1107,15 @@ var returned = []; $.each(block, function(i,s) { - if (typeof s.attributes === 'undefined') - { - returned.push(s); - } - - var $el = $(s); - var len = s.attributes.length; - for (var z = 0; z < len; z++) - { - $el.removeAttr(s.attributes[z].name); - } + if (typeof s.attributes !== 'undefined') + { + while (s.attributes.length) + { + s.removeAttribute(s.attributes[0].name); + } + } - returned.push($el[0]); + returned.push(s); }); return returned; @@ -1159,13 +1156,13 @@ this.sBuffer.push([current, saved]); } - //this.selection.restoreInstant(); + //this.selection.restore(); }, setRedo: function() { var saved = this.selection.saveInstant(); this.sRebuffer.push([this.core.editor().html(), saved]); - //this.selection.restoreInstant(); + //this.selection.restore(); }, add: function() { @@ -1184,6 +1181,7 @@ this.core.editor().html(buffer[0]); this.selection.restoreInstant(buffer[1]); + this.selection.restore(); this.observe.load(); }, redo: function() @@ -1199,6 +1197,7 @@ this.core.editor().html(buffer[0]); this.selection.restoreInstant(buffer[1]); + this.selection.restore(); this.observe.load(); }, clear: function() @@ -1826,7 +1825,11 @@ $tooltip.addClass('re-button-tooltip'); $tooltip.html(title); - $btn.append($tooltip); + var self = this; + var $toolbar = this.button.toolbar(); + var $box = $toolbar.closest('.redactor-toolbar-box'); + $box = ($box.length === 0) ? $toolbar : $box; + $box.prepend($tooltip); $btn.on('mouseover', function() { if ($(this).hasClass('redactor-button-disabled')) @@ -1834,8 +1837,21 @@ return; } + var pos = ($toolbar.hasClass('toolbar-fixed-box')) ? $btn.offset() : $btn.position(); + pos = (self.opts.toolbarFixedTarget !== document) ? $btn.position() : pos; + var top = ($toolbar.hasClass('toolbar-fixed-box')) ? $btn.position().top : pos.top; + var height = $btn.innerHeight(); + var width = $btn.innerWidth(); + var posBox = ($toolbar.hasClass('toolbar-fixed-box')) ? 'fixed' : 'absolute'; + posBox = (self.opts.toolbarFixedTarget !== document) ? 'absolute' : posBox; + var scrollFix = (self.opts.toolbarFixedTarget !== document) ? $toolbar.position().top : 0; + $tooltip.show(); - $tooltip.css('margin-left', -($tooltip.innerWidth()/2)); + $tooltip.css({ + top: (top + height + scrollFix) + 'px', + left: (pos.left + width/2 - $tooltip.innerWidth()/2) + 'px', + position: posBox + }); }).on('mouseout', function() { @@ -5314,10 +5330,13 @@ var $el = $(s); // remove style - $el.find(this.opts.inlineTags.join(',')).each(function() - { - $(this).removeAttr('style'); - }); + var filter = ''; + if (this.opts.keepStyleAttr.length !== 0) + { + filter = ',' + this.opts.keepStyleAttr.join(','); + } + + $el.find(this.opts.inlineTags.join(',')).not('img' + filter).removeAttr('style'); var $parent = $el.parent(); if ($parent.length !== 0 && $parent[0].tagName === 'LI') @@ -6182,6 +6201,7 @@ }); html = $div.html(); + endNode = $(html).last(); } @@ -6849,33 +6869,48 @@ return; } - // remove inline tags in new-empty paragraph - setTimeout($.proxy(function() - { - var inline = this.selection.inline(); - if (inline && this.utils.isEmpty(inline.innerHTML)) - { - var parent = this.selection.block(); - $(inline).remove(); - //this.caret.start(parent); + if (!this.opts.keepInlineOnEnter) + { + setTimeout($.proxy(function() + { + var inline = this.selection.inline(); + if (inline && this.utils.isEmpty(inline.innerHTML)) + { + var parent = this.selection.block(); + $(inline).remove(); + //this.caret.start(parent); - var range = document.createRange(); - range.setStart(parent, 0); + var range = document.createRange(); + range.setStart(parent, 0); - var textNode = document.createTextNode('\u200B'); + var textNode = document.createTextNode('\u200B'); - range.insertNode(textNode); - range.setStartAfter(textNode); - range.collapse(true); + range.insertNode(textNode); + range.setStartAfter(textNode); + range.collapse(true); - var sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - } + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + } - }, this), 1); + }, this), 1); + } + + // remove last br + setTimeout($.proxy(function() + { + var block = this.selection.block(); + var nodes = block.childNodes; + var last = nodes[nodes.length-1]; + if (last && last.nodeType !== 3 && last.tagName === 'BR') + { + $(last).remove(); + } + + }, this), 1); }, checkEvents: function(arrow, key) { @@ -7411,7 +7446,9 @@ // linkify if (this.linkify.isKey(key)) { + this.selection.save(); this.linkify.format(); + this.selection.restore(); } } @@ -7674,7 +7711,7 @@ }, cleanText: function(text) { - return (typeof text === 'undefined') ? '' :$.trim(text.replace(/(<([^>]+)>)/gi, '')); + return (typeof text === 'undefined') ? '' : $.trim(text.replace(/(<([^>]+)>)/gi, '')); }, getText: function(link) { @@ -7867,9 +7904,10 @@ this.core.editor().find(":not(iframe,img,a,pre,code,.redactor-unlink)").addBack().contents().filter($.proxy(this.linkify.isFiltered, this)).each($.proxy(this.linkify.handler, this)); // collect + var $el; var $objects = this.core.editor().find('.redactor-linkify-object').each($.proxy(function(i,s) { - var $el = $(s); + $el = $(s); $el.removeClass('redactor-linkify-object'); if ($el.attr('class') === '') { @@ -10210,7 +10248,9 @@ this.button.hideButtons(); this.button.hideButtonsOnMobile(); + this.$toolbarBox = $('
').addClass('redactor-toolbar-box'); this.$toolbar = this.toolbar.createContainer(); + this.$toolbarBox.append(this.$toolbar); this.toolbar.append(); this.button.$toolbar = this.$toolbar; @@ -10230,17 +10270,17 @@ if (this.opts.toolbarExternal) { this.$toolbar.addClass('redactor-toolbar-external'); - $(this.opts.toolbarExternal).html(this.$toolbar); + $(this.opts.toolbarExternal).html(this.$toolbarBox); } else { if (this.opts.type === 'textarea') { - this.$box.prepend(this.$toolbar); + this.$box.prepend(this.$toolbarBox); } else { - this.$element.before(this.$toolbar); + this.$element.before(this.$toolbarBox); } } @@ -10366,6 +10406,7 @@ var top = (this.detect.isDesktop()) ? this.opts.toolbarFixedTopOffset : ($(this.opts.toolbarFixedTarget).scrollTop() - boxTop + this.opts.toolbarFixedTopOffset); var left = (this.detect.isDesktop()) ? this.core.box().offset().left : 0; + if (this.opts.toolbarFixedTarget !== document) { position = 'absolute'; @@ -10623,7 +10664,7 @@ var stop = this.core.callback('uploadBeforeSend', xhr); if (stop !== false) { - xhr.send(formData); + xhr.send(formData); } }, onDrag: function(e) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.min.js b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.min.js index 82b2c6daf6..3addb91ab0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.min.js @@ -1 +1 @@ -!function(t){"use strict";function e(t,i){return new e.prototype.init(t,i)}Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;return function(){return e.apply(t)}});var i=0;t.fn.redactor=function(i){var r=[],o=Array.prototype.slice.call(arguments,1);return"string"==typeof i?this.each(function(){var e,s=t.data(this,"redactor");if("-1"!==i.search(/\./)?void 0!==s[(e=i.split("."))[0]]&&(e=s[e[0]][e[1]]):e=s[i],void 0!==s&&t.isFunction(e)){var n=e.apply(s,o);void 0!==n&&n!==s&&r.push(n)}else t.error('No such method "'+i+'" for Redactor')}):this.each(function(){t.data(this,"redactor",{}),t.data(this,"redactor",e(this,i))}),0===r.length?this:1===r.length?r[0]:r},t.Redactor=e,t.Redactor.VERSION="2.8.1",t.Redactor.modules=["air","autosave","block","buffer","build","button","caret","clean","code","core","detect","dropdown","events","file","focus","image","indent","inline","insert","keydown","keyup","lang","line","link","linkify","list","marker","modal","observe","offset","paragraphize","paste","placeholder","progress","selection","shortcuts","storage","toolbar","upload","uploads3","utils","browser"],t.Redactor.settings={},t.Redactor.opts={animation:!1,lang:"en",direction:"ltr",spellcheck:!0,overrideStyles:!0,scrollTarget:document,focus:!1,focusEnd:!1,clickToEdit:!1,structure:!1,tabindex:!1,minHeight:!1,maxHeight:!1,maxWidth:!1,plugins:!1,callbacks:{},placeholder:!1,linkify:!0,enterKey:!0,pastePlainText:!1,pasteImages:!0,pasteLinks:!0,pasteBlockTags:["pre","h1","h2","h3","h4","h5","h6","table","tbody","thead","tfoot","th","tr","td","ul","ol","li","blockquote","p","figure","figcaption"],pasteInlineTags:["br","strong","ins","code","del","span","samp","kbd","sup","sub","mark","var","cite","small","b","u","em","i"],preClass:!1,preSpaces:4,tabAsSpaces:!1,tabKey:!0,autosave:!1,autosaveName:!1,autosaveFields:!1,imageUpload:null,imageUploadParam:"file",imageUploadFields:!1,imageUploadForms:!1,imageTag:"figure",imageEditable:!0,imageCaption:!0,imagePosition:!1,imageResizable:!1,imageFloatMargin:"10px",dragImageUpload:!0,multipleImageUpload:!0,clipboardImageUpload:!0,fileUpload:null,fileUploadParam:"file",fileUploadFields:!1,fileUploadForms:!1,dragFileUpload:!0,s3:!1,linkNewTab:!1,linkTooltip:!0,linkNofollow:!1,linkSize:30,pasteLinkTarget:!1,videoContainerClass:"video-container",toolbar:!0,toolbarFixed:!0,toolbarFixedTarget:document,toolbarFixedTopOffset:0,toolbarExternal:!1,toolbarOverflow:!1,air:!1,airWidth:!1,formatting:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],formattingAdd:!1,buttons:["format","bold","italic","deleted","lists","image","file","link","horizontalrule"],buttonsTextLabeled:!1,buttonsHide:[],buttonsHideOnMobile:[],script:!0,removeNewlines:!1,removeComments:!0,replaceTags:{b:"strong",i:"em",strike:"del"},keepStyleAttr:[],shortcuts:{"ctrl+shift+m, meta+shift+m":{func:"inline.removeFormat"},"ctrl+b, meta+b":{func:"inline.format",params:["bold"]},"ctrl+i, meta+i":{func:"inline.format",params:["italic"]},"ctrl+h, meta+h":{func:"inline.format",params:["superscript"]},"ctrl+l, meta+l":{func:"inline.format",params:["subscript"]},"ctrl+k, meta+k":{func:"link.show"},"ctrl+shift+7":{func:"list.toggle",params:["orderedlist"]},"ctrl+shift+8":{func:"list.toggle",params:["unorderedlist"]}},shortcutsAdd:!1,activeButtons:["deleted","italic","bold"],activeButtonsStates:{b:"bold",strong:"bold",i:"italic",em:"italic",del:"deleted",strike:"deleted"},langs:{en:{format:"Format",image:"Image",file:"File",link:"Link",bold:"Bold",italic:"Italic",deleted:"Strikethrough",underline:"Underline","bold-abbr":"B","italic-abbr":"I","deleted-abbr":"S","underline-abbr":"U",lists:"Lists","link-insert":"Insert link","link-edit":"Edit link","link-in-new-tab":"Open link in new tab",unlink:"Unlink",cancel:"Cancel",close:"Close",insert:"Insert",save:"Save",delete:"Delete",text:"Text",edit:"Edit",title:"Title",paragraph:"Normal text",quote:"Quote",code:"Code",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",filename:"Name",optional:"optional",unorderedlist:"Unordered List",orderedlist:"Ordered List",outdent:"Outdent",indent:"Indent",horizontalrule:"Line","upload-label":"Drop file here or ",caption:"Caption",bulletslist:"Bullets",numberslist:"Numbers","image-position":"Position",none:"None",left:"Left",right:"Right",center:"Center","accessibility-help-label":"Rich text editor"}},type:"textarea",inline:!1,inlineTags:["a","span","strong","strike","b","u","em","i","code","del","ins","samp","kbd","sup","sub","mark","var","cite","small"],blockTags:["pre","ul","ol","li","p","h1","h2","h3","h4","h5","h6","dl","dt","dd","div","td","blockquote","output","figcaption","figure","address","section","header","footer","aside","article","iframe"],paragraphize:!0,paragraphizeBlocks:["table","div","pre","form","ul","ol","h1","h2","h3","h4","h5","h6","dl","blockquote","figcaption","address","section","header","footer","aside","article","object","style","script","iframe","select","input","textarea","button","option","map","area","math","hr","fieldset","legend","hgroup","nav","figure","details","menu","summary","p"],emptyHtml:"

",invisibleSpace:"​",emptyHtmlRendered:t("").html("​").html(),imageTypes:["image/png","image/jpeg","image/gif"],userAgent:navigator.userAgent.toLowerCase(),observe:{dropdowns:[]},regexps:{linkyoutube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.\-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi,linkvimeo:/https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,linkimage:/((https?|www)[^\s]+\.)(jpe?g|png|gif)(\?[^\s-]+)?/gi,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi}},e.fn=t.Redactor.prototype={keyCode:{BACKSPACE:8,DELETE:46,UP:38,DOWN:40,ENTER:13,SPACE:32,ESC:27,TAB:9,CTRL:17,META:91,SHIFT:16,ALT:18,RIGHT:39,LEFT:37,LEFT_WIN:91},init:function(e,r){if(this.$element=t(e),this.uuid=i++,this.sBuffer=[],this.sRebuffer=[],this.loadOptions(r),this.loadModules(),this.opts.clickToEdit&&!this.$element.hasClass("redactor-click-to-edit"))return this.loadToEdit(r);this.$element.hasClass("redactor-click-to-edit")&&this.$element.removeClass("redactor-click-to-edit"),this.reIsBlock=new RegExp("^("+this.opts.blockTags.join("|").toUpperCase()+")$","i"),this.reIsInline=new RegExp("^("+this.opts.inlineTags.join("|").toUpperCase()+")$","i"),this.opts.dragImageUpload=null!==this.opts.imageUpload&&this.opts.dragImageUpload,this.opts.dragFileUpload=null!==this.opts.fileUpload&&this.opts.dragFileUpload,this.formatting={},this.lang.load(),t.extend(this.opts.shortcuts,this.opts.shortcutsAdd),this.$editor=this.$element,this.detectType(),this.core.callback("start"),this.core.callback("startToEdit"),this.start=!0,this.build.start()},detectType:function(){this.build.isInline()||this.opts.inline?this.opts.type="inline":this.build.isTag("DIV")?this.opts.type="div":this.build.isTag("PRE")&&(this.opts.type="pre")},loadToEdit:function(e){this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},initToEdit:function(e){t.extend(e.callbacks,{startToEdit:function(){this.insert.node(this.marker.get(),!1)},initToEdit:function(){this.selection.restore(),this.clickToCancelStorage=this.code.get(),t(this.opts.clickToCancel).off(".redactor-click-to-edit"),t(this.opts.clickToCancel).show().on("click.redactor-click-to-edit",t.proxy(function(i){i.preventDefault(),this.core.destroy(),this.events.syncFire=!1,this.$element.html(this.clickToCancelStorage),this.core.callback("cancel",this.clickToCancelStorage),this.events.syncFire=!0,this.clickToCancelStorage="",t(this.opts.clickToCancel).hide(),t(this.opts.clickToSave).hide(),this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},this)),t(this.opts.clickToSave).off(".redactor-click-to-edit"),t(this.opts.clickToSave).show().on("click.redactor-click-to-edit",t.proxy(function(i){i.preventDefault(),this.core.destroy(),this.core.callback("save",this.code.get()),t(this.opts.clickToCancel).hide(),t(this.opts.clickToSave).hide(),this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},this))}}),this.$element.redactor(e),this.$element.off(".redactor-click-to-edit")},loadOptions:function(e){var i={};void 0!==t.Redactor.settings.namespace?this.$element.hasClass(t.Redactor.settings.namespace)&&(i=t.Redactor.settings):i=t.Redactor.settings,this.opts=t.extend({},t.Redactor.opts,this.$element.data(),e),this.opts=t.extend({},this.opts,i)},getModuleMethods:function(t){return Object.getOwnPropertyNames(t).filter(function(e){return"function"==typeof t[e]})},loadModules:function(){for(var e=t.Redactor.modules.length,i=0;i").addClass("redactor-air").attr({id:"redactor-air-"+this.uuid,role:"toolbar"}).hide()},show:function(e){this.selection.saveInstant(),t(".redactor-air").hide();var i=0,r=this.$air.innerWidth();t(window).width()')},setIn:function(){this.core.editor().addClass("redactor-in")},setId:function(){var t="textarea"===this.opts.type?"redactor-uuid-"+this.uuid:this.$element.attr("id");this.core.editor().attr("id",void 0===t?"redactor-uuid-"+this.uuid:t)},getName:function(){var t=this.$element.attr("name");return void 0===t?"content-"+this.uuid:t},loadFromTextarea:function(){this.$editor=t("
"),this.$textarea=this.$element,this.$element.attr("name",this.build.getName()),this.$box.insertAfter(this.$element).append(this.$editor).append(this.$element),this.$editor.addClass("redactor-layer"),this.opts.overrideStyles&&this.$editor.addClass("redactor-styles"),this.$element.hide(),this.$box.prepend(''+this.lang.get("accessibility-help-label")+""),this.$editor.attr({"aria-labelledby":"redactor-voice-"+this.uuid,role:"presentation"})},startTextarea:function(){this.build.createContainerBox(),this.build.loadFromTextarea(),this.code.start(this.core.textarea().val()),this.core.textarea().val(this.clean.onSync(this.$editor.html()))},isTag:function(t){return this.$element[0].tagName===t},isInline:function(){return!this.build.isTag("TEXTAREA")&&!this.build.isTag("DIV")&&!this.build.isTag("PRE")},enableEditor:function(){this.core.editor().attr({contenteditable:!0})},setOptions:function(){"inline"===this.opts.type&&(this.opts.enterKey=!1),"inline"!==this.opts.type&&"pre"!==this.opts.type||(this.opts.toolbarMobile=!1,this.opts.toolbar=!1,this.opts.air=!1,this.opts.linkify=!1),this.core.editor().attr("spellcheck",this.opts.spellcheck),this.opts.structure&&this.core.editor().addClass("redactor-structure"),"textarea"===this.opts.type&&(this.core.box().attr("dir",this.opts.direction),this.core.editor().attr("dir",this.opts.direction),this.opts.tabindex&&this.core.editor().attr("tabindex",this.opts.tabindex),this.opts.minHeight?this.core.editor().css("min-height",this.opts.minHeight):this.core.editor().css("min-height","40px"),this.opts.maxHeight&&this.core.editor().css("max-height",this.opts.maxHeight),this.opts.maxWidth&&this.core.editor().css({"max-width":this.opts.maxWidth,margin:"auto"}))},callEditor:function(){this.build.disableBrowsersEditing(),this.events.init(),this.build.setHelpers(),(this.opts.toolbar||this.opts.air)&&(this.toolbarsButtons=this.button.init()),this.opts.air?this.air.build():this.opts.toolbar&&this.toolbar.build(),this.detect.isMobile()&&this.opts.toolbarMobile&&this.opts.air&&(this.opts.toolbar=!0,this.toolbar.build()),(this.opts.air||this.opts.toolbar)&&(this.core.editor().on("mouseup.redactor-observe."+this.uuid+" keyup.redactor-observe."+this.uuid+" focus.redactor-observe."+this.uuid+" touchstart.redactor-observe."+this.uuid,t.proxy(this.observe.toolbar,this)),this.core.element().on("blur.callback.redactor",t.proxy(function(){this.button.setInactiveAll()},this))),this.modal.templates(),this.build.plugins(),this.autosave.init(),this.code.html=this.code.cleaned(this.core.editor().html()),this.core.callback("init"),this.core.callback("initToEdit"),this.storage.observe(),this.start=!1},setHelpers:function(){this.opts.linkify&&this.linkify.format(),this.placeholder.init(),this.opts.focus?setTimeout(this.focus.start,100):this.opts.focusEnd&&setTimeout(this.focus.end,100)},disableBrowsersEditing:function(){try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("enableInlineTableEditing",!1,!1),document.execCommand("AutoUrlDetect",!1,!1)}catch(t){}},plugins:function(){this.opts.plugins&&t.each(this.opts.plugins,t.proxy(function(i,r){var o="undefined"!=typeof RedactorPlugins&&void 0!==RedactorPlugins[r]?RedactorPlugins:e.fn;if(t.isFunction(o[r])){this[r]=o[r]();for(var s=this.getModuleMethods(this[r]),n=s.length,a=0;a "+this.lang.get("indent"),func:"indent.increase",observe:{element:"li",out:{attr:{class:"redactor-dropdown-link-inactive","aria-disabled":!0}}}}}},ul:{title:"• "+this.lang.get("bulletslist"),icon:!0,func:"list.toggle"},ol:{title:"1. "+this.lang.get("numberslist"),icon:!0,func:"list.toggle"},outdent:{title:this.lang.get("outdent"),icon:!0,func:"indent.decrease"},indent:{title:this.lang.get("indent"),icon:!0,func:"indent.increase"},image:{title:this.lang.get("image"),icon:!0,func:"image.show"},file:{title:this.lang.get("file"),icon:!0,func:"file.show"},link:{title:this.lang.get("link"),icon:!0,dropdown:{link:{title:this.lang.get("link-insert"),func:"link.show",observe:{element:"a",in:{title:this.lang.get("link-edit")},out:{title:this.lang.get("link-insert")}}},unlink:{title:this.lang.get("unlink"),func:"link.unlink",observe:{element:"a",out:{attr:{class:"redactor-dropdown-link-inactive","aria-disabled":!0}}}}}},horizontalrule:{title:this.lang.get("horizontalrule"),icon:!0,func:"line.insert"}}},setFormatting:function(){t.each(this.toolbarsButtons.format.dropdown,t.proxy(function(e,i){-1===t.inArray(e,this.opts.formatting)&&delete this.toolbarsButtons.format.dropdown[e]},this))},hideButtons:function(){0!==this.opts.buttonsHide.length&&this.button.hideButtonsSlicer(this.opts.buttonsHide)},hideButtonsOnMobile:function(){this.detect.isMobile()&&0!==this.opts.buttonsHideOnMobile.length&&this.button.hideButtonsSlicer(this.opts.buttonsHideOnMobile)},hideButtonsSlicer:function(e){t.each(e,t.proxy(function(t,e){var i=this.opts.buttons.indexOf(e);-1!==i&&this.opts.buttons.splice(i,1)},this))},load:function(e){this.button.buttons=[],t.each(this.opts.buttons,t.proxy(function(i,r){!this.toolbarsButtons[r]||"file"===r&&!this.file.is()||"image"===r&&!this.image.is()||e.append(t("
  • ").append(this.button.build(r,this.toolbarsButtons[r])))},this))},buildButtonTooltip:function(e,i){if(!this.opts.air&&!this.detect.isMobile()){var r=t("");r.addClass("re-button-tooltip"),r.html(i),e.append(r),e.on("mouseover",function(){t(this).hasClass("redactor-button-disabled")||(r.show(),r.css("margin-left",-r.innerWidth()/2))}).on("mouseout",function(){r.hide()})}},build:function(e,i){if(!1!==this.opts.toolbar){var r=void 0!==i.label?i.label:i.title,o=t('');if(o.addClass("re-button re-"+e),o.attr({role:"button","aria-label":r,tabindex:"-1"}),void 0===i.icon||this.opts.buttonsTextLabeled)o.html(i.title);else{var s=t("");s.addClass("re-icon-"+e),o.append(s),o.addClass("re-button-icon"),this.button.buildButtonTooltip(o,r)}if((i.func||i.command||i.dropdown)&&this.button.setEvent(o,e,i),i.dropdown){o.addClass("redactor-toolbar-link-dropdown").attr("aria-haspopup",!0);var n=t('