Some firefox fixes
authorAlexander Ebert <ebert@woltlab.com>
Mon, 27 Oct 2014 21:30:25 +0000 (22:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 27 Oct 2014 21:30:25 +0000 (22:30 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wfontfamily.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wfontsize.js
wcfsetup/install/files/js/WCF.js

index 99b285c6b5583366fe6c45dd1ced3025bfeb43cb..d36d2a58b6f87326c7d3c277476b30518acf6450 100644 (file)
@@ -106,7 +106,7 @@ RedactorPlugins.wbbcode = function() {
                        // Chrome tends to insert pointless <span> elements in contenteditable areas
                        // see http://www.neotericdesign.com/blog/2013/3/working-around-chrome-s-contenteditable-span-bug
                        this.$editor.on('DOMNodeInserted.redactor', (function(e) {
-                               if (e.target.tagName === 'SPAN') {
+                               if (e.target.tagName === 'SPAN' && e.target.attributes.length === 1 && e.target.attributes[0].name === 'style') {
                                        var $helper = $('<b>helper</b>');
                                        $(e.target).before($helper);
                                        
index f758c63de572169063c055aef4b999922a7c95a5..127a426e7a537d022c1bc9bc396490c0a5e3b8f1 100644 (file)
@@ -40,7 +40,7 @@ RedactorPlugins.wfontfamily = function() {
                        $.each($fonts, function(title, fontFamily) {
                                var $listItem = $('<li><a href="#">' + title + '</a></li>').appendTo(dropdown);
                                var $item = $listItem.children('a').data('fontFamily', fontFamily).css('font-family', fontFamily);
-                               $item.click(function() {
+                               $item.click(function(event) {
                                        event.preventDefault();
                                        
                                        self.inline.format('span', 'style', 'font-family: ' + $(this).data('fontFamily') + ';');
@@ -49,7 +49,7 @@ RedactorPlugins.wfontfamily = function() {
                        
                        $('<li class="dropdownDivider" />').appendTo(dropdown);
                        var $listItem = $('<li><a href="#">None</a></li>').appendTo(dropdown);
-                       $listItem.children('a').click(function() {
+                       $listItem.children('a').click(function(event) {
                                event.preventDefault();
                                
                                self.inline.removeStyleRule('font-family');
index 48382b29a3da40a1f8b525b792d17e7212effb72..dceca0a5e7c67fc488b07be017f3380de76128f8 100644 (file)
@@ -35,7 +35,7 @@ RedactorPlugins.wfontsize = function() {
                                        $item.css('line-height', '1em');
                                }
                                
-                               $item.click(function() {
+                               $item.click(function(event) {
                                        event.preventDefault();
                                        
                                        self.inline.format('span', 'style', 'font-size: ' + $(this).data('fontSize') + 'pt;');
@@ -44,7 +44,7 @@ RedactorPlugins.wfontsize = function() {
                        
                        $('<li class="dropdownDivider" />').appendTo(dropdown);
                        var $listItem = $('<li><a href="#">None</a></li>').appendTo(dropdown);
-                       $listItem.children('a').click(function() {
+                       $listItem.children('a').click(function(event) {
                                event.preventDefault();
                                
                                self.inline.removeStyleRule('font-size');
index bafad97d76091b38b56ad146ac7578ee3a2daefb..ace5370eaa41db9e60ed92543646be85ff7cacc4 100755 (executable)
@@ -10149,9 +10149,13 @@ WCF.Style.Chooser = Class.extend({
        
        /**
         * Displays the style chooser dialog.
+        * 
+        * @param       object          event
         */
-       _showDialog: function() {
-               event.preventDefault();
+       _showDialog: function(event) {
+               if (event !== null) {
+                       event.preventDefault();
+               }
                
                if (this._dialog === null) {
                        this._dialog = $('<div id="styleChooser" />').hide().appendTo(document.body);
@@ -10191,7 +10195,7 @@ WCF.Style.Chooser = Class.extend({
                this._dialog.html(data.returnValues.template);
                this._dialog.find('li').addClass('pointer').click($.proxy(this._click, this));
                
-               this._showDialog();
+               this._showDialog(null);
        },
        
        /**