Plugin Directory

Changeset 176250


Ignore:
Timestamp:
11/23/2009 06:59:16 PM (16 years ago)
Author:
082net
Message:
 
Location:
advanced-spoiler/trunk
Files:
3 edited

Legend:

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

    r148021 r176250  
    88Show or hide contents(text, image etc.) wrapped by spoiler markup tag([spoiler][/spoiler]). Requires WP 2.7 or greater.
    99
    10 Version: 2.01b
     10Version: 2.02
    1111
    1212Author: Choen, Young-Min
     
    5454    var $url, $hook, $folder, $admin_page;
    5555    var $sep = "||"; // old plugin support
    56     var $version = '2.01a';
     56    var $version = '2.02';
    5757    var $effects = array('appear', 'blind', 'apblind', 'phase', 'slide', 'simple');
    5858//  var $regex = '|\[spoiler\s+([^]]*)\]((?!\[/?spoiler.*?\]).*?)\[/spoiler\]|isme';
     
    169169            return $this->_spoiler_deep($content);
    170170
    171         $content = preg_replace_callback('/\[spoiler\b(.*?)\](.*?)\[\/spoiler\]/s', array(&$this, '_replace'), $content);
     171        $content = preg_replace_callback('/(<(p|div)>)?\[spoiler\b(.*?)\](.*?)\[\/spoiler\](<\/\2>)?/s', array(&$this, '_replace'), $content);
    172172        return $content;
    173173    }
     
    178178            return $content;
    179179        for ($i=1; $i<=$this->open; $i++) {
    180             $regex[] = '/\[spoiler'.$i.'\b(.*?)\](.*?)\[\/spoiler'.$i.'\]/s';
     180            $regex[] = '/(<(p|div)>)?\[spoiler'.$i.'\b(.*?)\](.*?)\[\/spoiler'.$i.'\](<\/\2>)?/s';
    181181        }
    182182        $temp_content = preg_replace_callback($regex, array(&$this, '_replace'), $temp_content);
    183183        return $temp_content;
    184184
    185         while(preg_match($this->regex, $content)) {
     185/*      while(preg_match($this->regex, $content)) {
    186186            $content = preg_replace($this->regex, '$this->_replace("\1", "\2");', $content);
    187187        }
    188         return $content;
     188        return $content;*/
    189189    }
    190190
     
    208208        global $post, $doing_rss, $comment;
    209209        $this->counts++;
    210         $op = stripslashes($m[1]);
    211         $text = stripslashes($m[2]);
     210        $op = stripslashes($m[3]);
     211        $text = stripslashes($m[4]);
    212212
    213213        $id = "SID".$post->ID."_".$this->counts;
  • advanced-spoiler/trunk/js/spoiler-admin.js

    r113514 r176250  
    6969            if (tinymce.isIE)
    7070                ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
    71             text += ed.selection.getRng();
    72             text += '[/spoiler]';
    73             ed.execCommand('mceInsertContent', false, text);
     71            text = '<div>'+text;
     72            text += ed.selection.getContent();// getRng() strips all blocks :(
     73            text += '[/spoiler]</div>';
     74            ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, text);
    7475        } else {
    7576            text += _spoiler.getRng(edCanvas);
     
    103104jQuery(document).ready( function() {
    104105    _spoiler.setup();
    105 })
     106});
  • advanced-spoiler/trunk/readme.txt

    r148024 r176250  
    33Tags: spoiler, advanced-spoiler, jquery
    44Requires at least: 2.7
    5 Tested up to: 2.8.4
    6 Stable tag: 2.01b
     5Tested up to: 2.8.6
     6Stable tag: 2.02
    77
    88Show or hide contents(text, image etc.) with animated effects wrapped by spoiler markup tag([spoiler][/spoiler]).
Note: See TracChangeset for help on using the changeset viewer.