Plugin Directory

Changeset 609296


Ignore:
Timestamp:
10/07/2012 10:24:18 PM (13 years ago)
Author:
daxitude
Message:

a few small bug fixes. see changelog.

Location:
ace-editor-for-wp
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ace-editor-for-wp/tags/0.7/ace4wp.php

    r609180 r609296  
    33Plugin Name: ACE Editor for WP
    44Description: Adds ACE Editor to the post content editor for syntax-highlighting and more
    5 Version: 0.6
     5Version: 0.7
    66Author: daxitude
    77Author URI: http://github.com/daxitude/
     
    1414        global $pagenow;
    1515       
    16         if ( 'post.php' == $pagenow ) {
     16        if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
    1717            add_action( 'admin_head', array($this, 'inline_css') );
    1818            add_action( 'admin_print_scripts-post.php', array($this, 'add_js') );
    19             add_action( 'admin_print_scripts-post-new.php', array($this, 'add_js') );
     19            add_action( 'admin_print_scripts-post-new.php', array($this, 'add_js') );           
    2020        }
    2121    }
     22
    2223    // silly jQuery ui-resizable sets the width on #wp-content-editor-container even though we
    2324    // aren't allow resize in that direction. ugh
  • ace-editor-for-wp/tags/0.7/aceinit.js

    r609180 r609296  
    11
    2 jQuery(document).ready(function ($) {
     2jQuery(document).ready(function ($) {   
    33   
    4     var AceSettings = AceSettings || {};
     4    var AceSettings = AceSettings || {};   
    55   
    66    // constructor function
     
    5151        insertEditor: function () {
    5252            $('<div id="' + this.aceId + '"></div>')
    53                 .css({left: 0, top: 0, bottom: 0, right: 0, zIndex: 999 })
     53                .css({left: 0, top: 0, bottom: 0, right: 0, zIndex: 1 })
    5454                .insertAfter(this.$elem);
    5555        },
     
    6969            var self = this;
    7070            this.$container
    71                 .resizable({handles: 'n,s'})
    72                 .css({position: 'relative', height: this.defaultHt})
     71                .resizable({handles: 's'})
     72                .css({position: 'relative', height: this.defaultHt, minHeight: '200px'})
    7373                .on('resize.aceEditorResize', function() {
    7474                    self.editor.resize(true);
     
    8686            this.$editor.remove();
    8787            this.editor.destroy();
    88             this.$container.resizable('destroy').off('resize.aceEditorResize').css({height: 'initial'});
     88            this.$container.resizable('destroy').off('resize.aceEditorResize').css({height: ''});
    8989            this.$elem.show();
    9090            this.loaded = false;
     
    129129            this.editor.getSession().setValue(value);           
    130130        },
    131         onInit: function () {
     131        onInit: function () {           
    132132            var self = this;
    133133            // if the user has visual disabled, the html tab isn't there
     
    140140                .on('click.toggleAce', function () {if (!self.loaded) self.load();});
    141141           
    142             $('#content-html, #content-tmce').on('click.destroyAce', function (e) {self.destroy(e);});
     142            $('#content-html, #content-tmce').on('click.destroyAce', function (e) {
     143                // quick fix to make sure that the right content area gets set to display
     144                // visible when its tab is clicked. for some reason the html textarea gets stuck on
     145                // display:none when going from load->ACE->Visual->HTML
     146                var clicked = $(e.currentTarget).attr('id').split('-')[1];
     147                switch (clicked) {
     148                    case 'tmce':
     149                        $('#content_parent').show();
     150                        break;
     151                    case 'html':
     152                        self.$elem.show();
     153                        break;
     154                }
     155                self.destroy(e);
     156            });
    143157           
    144158            if (getUserSetting('ace_editor') == 1) this.load();
     
    157171        onDestroy: function (e) {
    158172            var clicked = $(e.currentTarget).attr('id').split('-')[1];
     173            var check;
    159174            setUserSetting('ace_editor', 0);
     175            setUserSetting('editor', clicked);
    160176            $("#wp-content-media-buttons").show();
    161177            $('#wp-content-wrap').addClass(clicked + '-active').removeClass('ace-active');
    162178            switch (clicked) {
    163179                case 'tmce':
    164                     $('#content_parent').show();
    165180                    this.$elem.hide();
     181                    // the call to show() happens before tinymce has appended #content_parent
     182                    check = setInterval(function () {
     183                        $('#content_parent').show();
     184                        if ($('#content_parent').length > 0) clearInterval(check);
     185                    }, 100);                   
    166186                    break;
    167187                case 'html':
    168                     this.$elem.height('auto');
     188                    this.$elem.height('');
    169189                    break;
    170190            }
     
    173193    });
    174194
    175    
     195
    176196});
    177197   
  • ace-editor-for-wp/tags/0.7/readme.txt

    r609180 r609296  
    44Requires at least: 3.4
    55Tested up to: 3.4.2
    6 Stable tag: 0.6
     6Stable tag: 0.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515
    1616NOTE: Visual Mode tends to eat up most/all of any special formatting. If you want to use ACE I'd suggest disabling Visual mode completely. You can do this easily yourself under Users -> Your Profile -> 'Disable the visual editor when writing'. You can also do it for all users and for specific post types only. See the accompanying file no-visual.php for an example.
     17
     18Not all features work in Internet Explorer v8 and earlier.
    1719
    1820This does not work in full screen mode. Yet.
     
    4850* allow users to set their ACE preferences on their profile screen
    4951
     52== Changelog ==
     53
     54= 0.7 =
     55* bugfix - make sure ACE loads on post-new.php
     56* bugfix - adjust z-index on ACE Editor so wp nav menus stay on top
     57* bugfix - make ACE resizable only in south direction
     58
     59= 0.6 =
     60* bugfix - in JS, check to make sure tinymce is available
     61
     62= 0.5 =
     63* initial release
     64
  • ace-editor-for-wp/trunk/ace4wp.php

    r609180 r609296  
    33Plugin Name: ACE Editor for WP
    44Description: Adds ACE Editor to the post content editor for syntax-highlighting and more
    5 Version: 0.6
     5Version: 0.7
    66Author: daxitude
    77Author URI: http://github.com/daxitude/
     
    1414        global $pagenow;
    1515       
    16         if ( 'post.php' == $pagenow ) {
     16        if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
    1717            add_action( 'admin_head', array($this, 'inline_css') );
    1818            add_action( 'admin_print_scripts-post.php', array($this, 'add_js') );
    19             add_action( 'admin_print_scripts-post-new.php', array($this, 'add_js') );
     19            add_action( 'admin_print_scripts-post-new.php', array($this, 'add_js') );           
    2020        }
    2121    }
     22
    2223    // silly jQuery ui-resizable sets the width on #wp-content-editor-container even though we
    2324    // aren't allow resize in that direction. ugh
  • ace-editor-for-wp/trunk/aceinit.js

    r609180 r609296  
    11
    2 jQuery(document).ready(function ($) {
     2jQuery(document).ready(function ($) {   
    33   
    4     var AceSettings = AceSettings || {};
     4    var AceSettings = AceSettings || {};   
    55   
    66    // constructor function
     
    5151        insertEditor: function () {
    5252            $('<div id="' + this.aceId + '"></div>')
    53                 .css({left: 0, top: 0, bottom: 0, right: 0, zIndex: 999 })
     53                .css({left: 0, top: 0, bottom: 0, right: 0, zIndex: 1 })
    5454                .insertAfter(this.$elem);
    5555        },
     
    6969            var self = this;
    7070            this.$container
    71                 .resizable({handles: 'n,s'})
    72                 .css({position: 'relative', height: this.defaultHt})
     71                .resizable({handles: 's'})
     72                .css({position: 'relative', height: this.defaultHt, minHeight: '200px'})
    7373                .on('resize.aceEditorResize', function() {
    7474                    self.editor.resize(true);
     
    8686            this.$editor.remove();
    8787            this.editor.destroy();
    88             this.$container.resizable('destroy').off('resize.aceEditorResize').css({height: 'initial'});
     88            this.$container.resizable('destroy').off('resize.aceEditorResize').css({height: ''});
    8989            this.$elem.show();
    9090            this.loaded = false;
     
    129129            this.editor.getSession().setValue(value);           
    130130        },
    131         onInit: function () {
     131        onInit: function () {           
    132132            var self = this;
    133133            // if the user has visual disabled, the html tab isn't there
     
    140140                .on('click.toggleAce', function () {if (!self.loaded) self.load();});
    141141           
    142             $('#content-html, #content-tmce').on('click.destroyAce', function (e) {self.destroy(e);});
     142            $('#content-html, #content-tmce').on('click.destroyAce', function (e) {
     143                // quick fix to make sure that the right content area gets set to display
     144                // visible when its tab is clicked. for some reason the html textarea gets stuck on
     145                // display:none when going from load->ACE->Visual->HTML
     146                var clicked = $(e.currentTarget).attr('id').split('-')[1];
     147                switch (clicked) {
     148                    case 'tmce':
     149                        $('#content_parent').show();
     150                        break;
     151                    case 'html':
     152                        self.$elem.show();
     153                        break;
     154                }
     155                self.destroy(e);
     156            });
    143157           
    144158            if (getUserSetting('ace_editor') == 1) this.load();
     
    157171        onDestroy: function (e) {
    158172            var clicked = $(e.currentTarget).attr('id').split('-')[1];
     173            var check;
    159174            setUserSetting('ace_editor', 0);
     175            setUserSetting('editor', clicked);
    160176            $("#wp-content-media-buttons").show();
    161177            $('#wp-content-wrap').addClass(clicked + '-active').removeClass('ace-active');
    162178            switch (clicked) {
    163179                case 'tmce':
    164                     $('#content_parent').show();
    165180                    this.$elem.hide();
     181                    // the call to show() happens before tinymce has appended #content_parent
     182                    check = setInterval(function () {
     183                        $('#content_parent').show();
     184                        if ($('#content_parent').length > 0) clearInterval(check);
     185                    }, 100);                   
    166186                    break;
    167187                case 'html':
    168                     this.$elem.height('auto');
     188                    this.$elem.height('');
    169189                    break;
    170190            }
     
    173193    });
    174194
    175    
     195
    176196});
    177197   
  • ace-editor-for-wp/trunk/readme.txt

    r609180 r609296  
    44Requires at least: 3.4
    55Tested up to: 3.4.2
    6 Stable tag: 0.6
     6Stable tag: 0.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515
    1616NOTE: Visual Mode tends to eat up most/all of any special formatting. If you want to use ACE I'd suggest disabling Visual mode completely. You can do this easily yourself under Users -> Your Profile -> 'Disable the visual editor when writing'. You can also do it for all users and for specific post types only. See the accompanying file no-visual.php for an example.
     17
     18Not all features work in Internet Explorer v8 and earlier.
    1719
    1820This does not work in full screen mode. Yet.
     
    4850* allow users to set their ACE preferences on their profile screen
    4951
     52== Changelog ==
     53
     54= 0.7 =
     55* bugfix - make sure ACE loads on post-new.php
     56* bugfix - adjust z-index on ACE Editor so wp nav menus stay on top
     57* bugfix - make ACE resizable only in south direction
     58
     59= 0.6 =
     60* bugfix - in JS, check to make sure tinymce is available
     61
     62= 0.5 =
     63* initial release
     64
Note: See TracChangeset for help on using the changeset viewer.