Plugin Directory

Changeset 451687


Ignore:
Timestamp:
10/16/2011 06:31:32 PM (14 years ago)
Author:
squiter
Message:
  • Release a new version! 1.6;
  • i18n compatibility;
  • Some bug fixes;
Location:
spoiler-block
Files:
23 added
3 edited

Legend:

Unmodified
Added
Removed
  • spoiler-block/trunk/readme.txt

    r451498 r451687  
    4242== Changelog ==
    4343
     44= 1.6 =
     45* Resolve some bugs;
     46* Add i18n support;
     47* Include Brazilian Portugueses language;
     48
    4449= 1.5 =
    4550* Now you can clear spoiler block if you click in spoiler button! :)
     
    7378= How can I remove a spoiler of my post? =
    7479
    75 To remove a spoiler block, select HTML mode, and remove tags <span class="spoiler"> and </span> that are around your text. (the feature to automatize this function is under development)
     80To remove a spoiler block, just select the spoiler block then click in spoiler button.
     81
     82= How can I customize the spoilers blocks in my blog?
     83
     84To customize the blocks of spoilers, just add the follow selectors in your css file:
     85* .spoiler to spoilers closed blocks;
     86* .spoiler-open to spoilers already clicked by users;
  • spoiler-block/trunk/spoiler_block.php

    r451498 r451687  
    44Plugin URI: https://github.com/squiter85/Spoiler-Block
    55Description: Create spoiler's block in your posts to hide contents.
    6 Version: 1.5
     6Version: 1.6
    77Author: Brunno dos Santos
    88Author URI: http://brunno.abstraindo.com
     
    2828/* Let's code guys */
    2929
     30if (!defined('SPOILERBLOCK_PLUGIN_BASENAME')) {
     31  //spoiler-block/spoiler/block.php
     32  define('SPOILERBLOCK_PLUGIN_BASENAME', plugin_basename(__FILE__));
     33}
     34if (!defined('SPOILERBLOCK_PLUGIN_NAME')) {
     35  //spoiler-block
     36  define('SPOILERBLOCK_PLUGIN_NAME', trim(dirname(SPOILERBLOCK_PLUGIN_BASENAME), '/'));
     37}
     38if (!defined('SPOILERBLOCK_NAME')) {
     39  define('SPOILERBLOCK_NAME', 'Spoiler Block');
     40}
     41if (!defined('SPOILERBLOCK_TEXTDOMAIN')) {
     42  define('SPOILERBLOCK_TEXTDOMAIN', 'spoiler-block');
     43}
     44if (!defined('SPOILERBLOCK_PLUGIN_DIR')) {
     45  // /path/to/wordpress/wp-content/plugins/spoiler-block
     46  define('SPOILERBLOCK_PLUGIN_DIR', dirname(__FILE__));
     47}
     48if (!defined('SPOILERBLOCK_PLUGIN_URL')) {
     49  // http://www.domain.com/wordpress/wp-content/plugins/spoiler-block
     50  define('SPOILERBLOCK_PLUGIN_URL', WP_PLUGIN_URL . '/' . SPOILERBLOCK_PLUGIN_NAME);
     51}
     52if (!defined('SPOILERBLOCK_CONFIG_PAGE')) {
     53  define('SPOILERBLOCK_CONFIG_PAGE', "spoiler-block-config");
     54}
    3055
    3156add_action('wp_print_styles', 'add_sb_style');
    3257add_action('wp_enqueue_scripts', 'add_sb_scripts');
    3358
     59load_plugin_textdomain( SPOILERBLOCK_TEXTDOMAIN, false, "/spoiler-block/languages" );
     60
    3461/* enfileirando os marotos */
    3562
    3663function add_sb_style() {
    37     $myStyleUrl = plugins_url('css/style.css', __FILE__);
     64    $myStyleUrl = SPOILERBLOCK_PLUGIN_URL . 'css/style.css';
    3865
    3966    wp_register_style('spoiler_block', $myStyleUrl);
     
    4471    wp_enqueue_script("jquery");
    4572    wp_enqueue_script('scripts',
    46         plugins_url('/js/scripts.js', __FILE__),
     73        SPOILERBLOCK_PLUGIN_URL . '/js/scripts.js',
    4774        array('scriptaculous'),
    4875        '1.0', true );
     
    6693function spoiler_register($plugin_array){
    6794
    68     $url = plugins_url('/js/spoiler_plugin/spoiler_mce.js', __FILE__);
     95    $url = SPOILERBLOCK_PLUGIN_URL . '/js/spoiler_plugin/spoiler_mce.js';
    6996 
    7097    $plugin_array["spoiler"] = $url;
     
    80107        $url .= ',';
    81108
    82     $url .= plugins_url('/css/spoiler_admin_style.css', __FILE__);
     109    $url .= SPOILERBLOCK_PLUGIN_URL . '/css/spoiler_admin_style.css';
    83110
    84111  return $url;
     
    88115add_action('admin_menu', 'spoiler_config_menu');
    89116function spoiler_config_menu(){
    90     add_plugins_page( "Spoiler Block", "Spoiler Block Config", "activate_plugins", "spoiler-block-config", "spoiler_render_config");
     117    add_plugins_page( "Spoiler Block", __("Spoiler Block Config", SPOILERBLOCK_TEXTDOMAIN), "activate_plugins", SPOILERBLOCK_CONFIG_PAGE, "spoiler_render_config");
    91118}
    92 
     119   
    93120function spoiler_render_config(){
    94121    require("spoiler_render_config.php");
     
    101128add_action('wp_head', "spoiler_selected_message");
    102129
    103 add_option("spoiler_alert", "Warning! Spoiler area! To read click here!");
     130add_option("spoiler_alert", __("Warning! Spoiler area! To read click here!",SPOILERBLOCK_TEXTDOMAIN));
    104131
    105132function spoiler_selected_message(){
     
    107134}
    108135
    109 spoiler_selected_message($spoiler_alert);
    110 
    111 
     136add_action("wp_head","spoiler_selected_message");
    112137?>
  • spoiler-block/trunk/spoiler_render_config.php

    r450857 r451687  
    1515    <div id="message" class="updated">
    1616        <p>
    17             <strong>Congratulations! Your settings is updated! :D</strong>
     17            <strong><?php _e("Congratulations! Your settings is updated! :D",SPOILERBLOCK_TEXTDOMAIN);?></strong>
    1818        </p>
    1919    </div>
     
    2222?>
    2323<div class="wrap">
    24     <h2>Spoiler Block Configuration</h2>
    25     <p>This page is where you'll configure your plugin.<br />Let's go :)</p>
     24    <h2><?php _e("Spoiler Block Configuration",SPOILERBLOCK_TEXTDOMAIN);?></h2>
     25    <p><?php _e("This page is where you'll configure your plugin.<br />Let's go :)",SPOILERBLOCK_TEXTDOMAIN);?></p>
    2626   
    2727    <div class="wrap-config">
     
    2929            <table border="0">
    3030                <tr>
    31                     <td><label for="alert">Spoiler Alert:<span>This alert  message will replace your spoilers. You need let your visitors know that they need to click in this message.</span></label></td>
     31                    <td><label for="alert"><?php _e("Spoiler Alert:",SPOILERBLOCK_TEXTDOMAIN);?><span><?php _e("This alert  message will replace your spoilers. You need let your visitors know that they need to click in this message.",SPOILERBLOCK_TEXTDOMAIN);?></span></label></td>
    3232                    <td><input type="text" name="alert" value="<?php echo get_option("spoiler_alert");?>" id="alert" />
    3333                </tr>
     
    4141       
    4242    <div class="donate postbox">
    43         <p>If you like my plugin, please buy me a Coke</p>
     43        <p><?php _e("If you like my plugin, please buy me a Coke",SPOILERBLOCK_TEXTDOMAIN);?></p>
    4444        <div class="wrap-paypal">
    4545            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
Note: See TracChangeset for help on using the changeset viewer.