Plugin Directory

Changeset 148021


Ignore:
Timestamp:
08/22/2009 04:54:12 AM (17 years ago)
Author:
082net
Message:
Location:
advanced-spoiler/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-spoiler/trunk/advanced-spoiler.php

    r113514 r148021  
    88Show or hide contents(text, image etc.) wrapped by spoiler markup tag([spoiler][/spoiler]). Requires WP 2.7 or greater.
    99
    10 Version: 2.01a
     10Version: 2.01b
    1111
    1212Author: Choen, Young-Min
     
    283283
    284284    function admin_style() {
    285         wp_enqueue_style('jquery-ui-lightness', $this->url . '/css/ui-lightness/ui.all.css', false, '1.5.2');
     285        wp_enqueue_style('jquery-ui-lightness-dialog', $this->url . '/css/ui-lightness/ui.dialog.css', false, '1.5.2');
    286286    }
    287287
    288288    function enqueue_script() {
    289         if ($this->op['plugin_mode'] == 'simple')
     289        global $wp_scripts;
     290        switch($this->op['plugin_mode']):
     291        case 'simple':
    290292            return;
    291         switch($this->js_library) {
    292             case 'prototype':
    293             wp_enqueue_script('adv-spoiler', $this->url.'/js/aj-spoiler.js', array('scriptaculous-effects'), $this->version);
    294             break;
    295             case 'mootools':
    296             $depth = false;
    297             wp_enqueue_script('adv-spoiler', $this->url.'/js/moo-spoiler.js', $depth, $this->version);
    298             break;
    299             case 'jquery': default:
     293        break;
     294        case 'prototype':
     295            wp_enqueue_script('adv-spoiler', $this->url.'/js/prototype-spoiler.js', array('scriptaculous-effects'), $this->version);
     296        break;
     297        case 'mootools':
     298            if (!in_array('mootools-Fx', $wp_scripts->registered))
     299                return;
     300            wp_enqueue_script('adv-spoiler', $this->url.'/js/moo-spoiler.js', array('mootools-Fx'), $this->version);
     301        break;
     302        case 'jquery': default:
    300303            wp_enqueue_script('adv-spoiler', $this->url.'/js/jquery-spoiler.js', array('jquery'), $this->version);
    301         }
     304        break;
     305        endswitch;
    302306    }
    303307
     
    313317        if ( get_user_option('rich_editing') == 'true') {
    314318            add_filter("mce_external_plugins", array(&$this, "add_mce_plugin"));
    315             add_filter('mce_buttons', array(&$this, 'register_mce_button'));
     319            add_filter('mce_buttons_2', array(&$this, 'register_mce_button'));
    316320            add_filter( 'tiny_mce_version', array(&$this, 'mce_version') );
    317321        }
     
    319323     
    320324    function register_mce_button($buttons) {
    321          array_push($buttons, "spoiler");
     325         array_push($buttons, "separator", "spoiler");
    322326         return $buttons;
    323327    }
     
    329333
    330334    function mce_version( $version ) {
    331         return $version . '-spl';
     335        return $version+6;
    332336    }
    333337
     
    365369    <td><select name="plugin_mode">
    366370    <option value="jquery"<?php selected($plugin_mode, 'jquery') ?>><?php _e('jQuery', $this->domain) ?></option>
     371    <!-- <option value="prototype"<?php selected($plugin_mode, 'prototype') ?>><?php _e('Prototype', $this->domain) ?></option>
     372    <option value="mootools"<?php selected($plugin_mode, 'mootools') ?>><?php _e('Mootools', $this->domain) ?></option> -->
    367373    <option value="simple"<?php selected($plugin_mode, 'simple') ?>><?php _e('Simple', $this->domain) ?></option>
    368374    </select>
  • advanced-spoiler/trunk/js/moo-spoiler.js

    r113514 r148021  
    1212        var newOptions = Object.extend(options||{}, arguments[1]||{});
    1313        return newOptions;
    14     },
    15     _start: function() {
    16         $$('div.spoiler-box').each(function(spl) {
    17             var c_tgl = $E('a.spoiler-tgl', spl);
    18             var c_body = $E('div.spoiler-body', spl);
    19             if(c_body && c_tgl) {
    20                 var opt = c_tgl.getAttribute('rev').split('||');
    21                 c_tgl.onclick = function(){Spoiler.plugin(c_body, c_tgl, opt); return false;};
    22                 if(c_body.style.display != 'none') {
    23                     var hider = function(){Spoiler.plugin(c_body, c_tgl, opt)};
    24                     this.timer += 60;
    25                     hider.delay(this.timer);
    26                 }
    27             }
    28         }, this);
    2914    },
    3015    start: function() {
Note: See TracChangeset for help on using the changeset viewer.