Plugin Directory

Changeset 344571


Ignore:
Timestamp:
02/12/2011 04:35:14 PM (15 years ago)
Author:
digihero
Message:

upgrade to 2.0

Location:
auto-syntaxhighlighter/trunk
Files:
7 added
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • auto-syntaxhighlighter/trunk/auto-syntaxhighlighter.php

    r332024 r344571  
    33 Plugin Name: Auto SyntaxHighlighter
    44 Plugin URI: http://www.akii.org/auto-syntaxhighlighter.html
    5  Description: Autoload SyntaxHighlighter only requisite js files and display you code. Uses Alex Gorbatchev's SyntaxHighlighter: <a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/">SyntaxHighlighter Brushes</a>. Full Support for : AppleScript, ActionScript3, Bash/shell, C#, C++, CSS, Delphi, Diff, Groovy, JavaScript, Java, Perl, PHP, Plain Text, Python, Ruby, Sass, Scala, SQL, Visual Basic and XML.
    6  Version: 1.3.2
     5 Description: Autoload SyntaxHighlighter only requisite js files and display you code. Uses Alex Gorbatchev's SyntaxHighlighter: <a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/">SyntaxHighlighter Brushes</a>. Full Support for : AppleScript, ActionScript3, Bash/shell, C#, C++, CSS, Delphi, Diff, Groovy, JavaScript, Java, Perl, PHP, Plain Text, Python, Ruby, Sass, Scala, SQL, Visual Basic and XML/HTML...
     6 Version: 2.0
    77 Author: digihero
    88 Author URI: http://www.akii.org
     
    5757        wp_register_style(  'syntaxhighlighter-theme-midnight',     plugins_url('auto-syntaxhighlighter/styles/shThemeMidnight.css'),   array('syntaxhighlighter-core'), $this->_shlver );
    5858        wp_register_style(  'syntaxhighlighter-theme-rdark',        plugins_url('auto-syntaxhighlighter/styles/shThemeRDark.css'),      array('syntaxhighlighter-core'), $this->_shlver );
    59        
     59
    6060        $this->_brushes = apply_filters('syntaxhighlighter_brushes',array(
    6161            'applescript'   => 'applescript',
     
    122122        return $content;
    123123    }
    124    
     124
    125125    function outputScripts(){
    126126        global $wp_styles;
     
    133133        echo "<!-- Auto SyntaxHighlighter -->\n";
    134134        wp_print_scripts($this->_used_burshes);
    135        
    136 ?><script type='text/javascript'>
     135        ?>
     136<script type='text/javascript'>
    137137    (function(){
    138138        var corecss = document.createElement('link');
     
    144144        $core_css_url = apply_filters('syntaxhighlighter_corecssurl' , add_query_arg( 'ver', $this->_shlver, $wp_styles->registered['syntaxhighlighter-core']->src ));
    145145        $theme_css_url = apply_filters('syntaxhighlighter_cssthemeurl', add_query_arg( 'ver', $this->_shlver, $wp_styles->registered[$theme]->src ));
    146         ?>
     146?>
    147147        var corecssurl = "<?php echo esc_js( $core_css_url ); ?>";
    148148        if ( corecss.setAttribute ) {
     
    172172</script>
    173173<!-- /Auto SyntaxHighlighter -->
    174 <?php
    175     }
    176 
     174<?php
     175    }
    177176    // fix php4
    178177    function AutoSyntaxHighlighter() {
    179178        $this->__construct();
    180179    }
    181 
    182180}
    183181
     
    192190 *
    193191 */
    194 
    195192class wp_ash {
    196193    function wp_ash() {
    197194        global $wp_version;
    198        
     195
    199196        // The current version
    200         define('ash_VERSION', '1.0');
    201        
     197        define('ash_VERSION', '2.0');
     198
    202199        // Check for WP2.6 installation
    203200        if (!defined ('IS_WP26'))
    204             define('IS_WP26', version_compare($wp_version, '2.6', '>=') );
    205        
     201        define('IS_WP26', version_compare($wp_version, '2.6', '>=') );
     202
    206203        //This works only in WP2.6 or higher
    207204        if ( IS_WP26 == FALSE) {
    208             add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error fade"><p><strong>Sorry,Auto Syntax Highlighter works only under WordPress 2.6 or higher</strong></p></div>\';'));
     205            add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error fade"><p><strong>Sorry, The Wordpress Plugins "Auto Syntax Highlighter" works only under WordPress 2.6 or higher.</strong></p></div>\';'));
    209206            return;
    210207        } else {
    211       // define URL
    212       define('ash_ABSPATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
    213       define('ash_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
    214       include_once (dirname (__FILE__)."/tinymce/tinymce.php");
    215 
     208            // define URL
     209            define('ash_ABSPATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
     210            define('ash_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
     211            include_once (dirname (__FILE__)."/tinymce/tinymce.php");
    216212        }
    217213    }
  • auto-syntaxhighlighter/trunk/readme.txt

    r332024 r344571  
    44Tags: SyntaxHighlighter, code, sourcecode, syntax, highlighter
    55Requires at least: 2.6
    6 Tested up to: 3.0.4
     6Tested up to: 3.0.5
    77Stable tag: trunk
    88
     
    8888
    8989== Changelog ==
     90= 2.0 =
     91Full screen mode support. Apple script support.
     92
    9093= v1.3.2 =
    9194Fix js for delphi bug.
  • auto-syntaxhighlighter/trunk/tinymce/tinymce.php

    r259964 r344571  
    11<?php
     2class add_ash_button {
     3    var $pluginname = "ash";
    24
    3 class add_ash_button {
    4    
    5     var $pluginname = "ash";
    6    
    75    function add_ash_button()  {
    8         // Modify the version when tinyMCE plugins are changed.
    9         add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') );
    10        
    11         // init process for button control
    12         add_action('init', array (&$this, 'addbuttons') );
     6        add_action('init', $this->addbuttons() );
    137    }
    148
    159    function addbuttons() {
    16    
     10
    1711        // Don't bother doing this stuff if the current user lacks permissions
    18         if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
    19        
     12        if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
     13        return;
     14
    2015        // Add only in Rich Editor mode
    2116        if ( get_user_option('rich_editing') == 'true') {
    22          
    23         // add the button for wp2.5 in a new way
    24             add_filter("mce_external_plugins", array (&$this, "add_tinymce_plugin" ), 5);
    25             add_filter('mce_buttons', array (&$this, 'register_button' ), 5);
     17            // add the button for wp2.5 in a new way
     18            add_filter("mce_external_plugins", array ($this, 'add_tinymce_plugin' ));
     19            add_filter('mce_buttons', array ($this, 'register_button' ));
    2620        }
    2721    }
    28    
     22
    2923    // used to insert button in wordpress 2.5x editor
    3024    function register_button($buttons) {
    31    
    3225        array_push($buttons, "separator", $this->pluginname );
    33    
    3426        return $buttons;
    3527    }
    36    
     28
    3729    // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
    38     function add_tinymce_plugin($plugin_array) {   
    39    
    40         $plugin_array[$this->pluginname] =  ash_URLPATH.'tinymce/editor_plugin.js';
    41        
     30    function add_tinymce_plugin() {
     31        $plugin_array[$this->pluginname] =  ash_URLPATH.'tinymce/ash/editor_plugin.js';
    4232        return $plugin_array;
    4333    }
    44    
    45     function change_tinymce_version($version) {
    46         return ++$version;
    47     }
    48    
    4934}
    5035
    5136// Call it now
    5237$tinymce_button = new add_ash_button ();
    53 
    54 ?>
Note: See TracChangeset for help on using the changeset viewer.