Plugin Directory

Changeset 505708


Ignore:
Timestamp:
02/16/2012 01:29:36 AM (14 years ago)
Author:
anaximander
Message:

check in 1.1

Location:
chessonline/trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • chessonline/trunk/chessonline.css

    r504272 r505708  
    6161#co_framebox div {
    6262    background: white;
    63         width: 930px;
     63        width: 930px;       /* change if you wish to resize the overlay iframe width */
    6464    border-radius: 5px 5px 5px 5px;
    6565    margin-left: auto;
     
    7878
    7979#co_framebox div div iframe {
    80     height: 650px;
     80    height: 650px;      /* change if you wish to resize the overlay iframe height */
    8181}
  • chessonline/trunk/chessonline.js

    r504272 r505708  
    11jQuery( document ).ready( function () {
    22
    3     var overlay = jQuery( "<div id=\"co_overlay\"></div>" );
     3    /* Link overlay */
     4
     5    /* Initiate */
     6    var overlay = jQuery( '<div id="co_overlay"></div>' );
    47    overlay.appendTo( document.body );
    5    
    6     var framebox = jQuery( "<div id=\"co_framebox\"><div><div id=\"co_closeoverlay\"><span>Close</span></div><div><iframe id=\"co_iframe\" frameborder=\"0\" scrolling=\"no\" name=\"co_inlineframe\" src=\"\" width=\"100%\" height=\"100%\"></div></iframe></div></div>" );
     8    var framebox = jQuery( '<div id="co_framebox"><div><div id="co_closeoverlay"><span>Close</span></div><div><iframe id="co_iframe" frameborder="0" scrolling="no" name="co_inlineframe" src="" width="100%" height="100%"></div></iframe></div></div>' );
    79    framebox.appendTo( document.body );
    8 
    9     jQuery( ".co_overlay" ).live( "click" , function() {
    10         var url = jQuery( this ).attr( "href" );
    11         jQuery( "#co_iframe" ).attr( "src" , url );
    12         jQuery( "#co_overlay" ).show();
    13         jQuery( "#co_framebox" ).show();
     10    jQuery( '.co_overlay' ).live( 'click' , function() {
     11        var url = jQuery( this ).attr( 'href' );
     12        jQuery( '#co_iframe' ).attr( 'src' , url );
     13        jQuery( '#co_overlay' ).show();
     14        jQuery( '#co_framebox' ).show();
    1415        return false;
    1516    } );
    16 
    17     jQuery( "#co_closeoverlay" ).live( "click" , function() {
    18         jQuery( "#co_framebox" ).hide();
    19                 jQuery( "#co_overlay" ).hide();
    20         jQuery( "#co_iframe" ).attr( "src" , "" );
     17    jQuery( '#co_closeoverlay' ).live( 'click' , function() {
     18        jQuery( '#co_framebox' ).hide();
     19                jQuery( '#co_overlay' ).hide();
     20        jQuery( '#co_iframe' ).attr( 'src' , '' );
    2121    } );
    2222
  • chessonline/trunk/chessonline.php

    r504272 r505708  
    44Text Domain: chessonline
    55Description: ChessOnline is a plugin that allows you to display a chessboard and to set up positions using the Forsyth-Edwards-Notation (FEN). You can specify an external URL for linking purposes.
    6 Version: 1.0
     6Version: 1.1
    77Author: Alexander Mainzer
    88Author URI: http://www.w3edv.de
     
    3333if( !class_exists( 'WP' ) || preg_match( "#" . basename( __FILE__ ) . "#" , $_SERVER[ "PHP_SELF" ] ) ) { die(); }
    3434
     35###############
     36### Globals ###
     37###############
     38
     39/* Encode user input to HTML entities */
     40function co__( $val ) {
     41    return htmlentities( __( $val , chessonline ) , ENT_QUOTES , get_bloginfo( 'charset' ) );
     42}
     43function co_htmlentities( $val ) {
     44    return htmlentities( $val , ENT_QUOTES , get_bloginfo( 'charset' ) );
     45}
     46
    3547############
    3648### Init ###
     
    4860    wp_enqueue_style( 'co_css' );
    4961       
     62    /* jQuery */
     63    wp_enqueue_script( 'jquery' , '' , '' , '' , true );
     64
    5065    /* Include JavaScript */
    5166    wp_register_script( 'co_js' , plugins_url( 'chessonline.js' , __FILE__ ) , array( 'jquery' ) );
     
    167182
    168183    /* Get link text */
    169     $linktext = get_option( 'co_link_text' ) ? get_option( 'co_link_text' ) : __( 'Analysis' , chessonline );
     184    $linktext = get_option( 'co_link_text' ) ? get_option( 'co_link_text' ) : co__( 'Analysis' );
    170185
    171186    /* Get link URL and complete params */
     
    182197        }
    183198    }
     199
     200    /* Get link target */
     201    $linktarget = get_option( 'co_link_target' ) ? get_option( 'co_link_target' ) : 'overlay';
    184202   
    185203    /* Generate string for output */
     
    190208
    191209    /* Include info */
    192     $strout .= ( strlen( $info ) > 0 ) ? '<div class="co_info">' . __( 'Info' , chessonline ) . ': ' . htmlentities( $info ) . '</div>' : '';
    193 
     210    $strout .= ( strlen( $info ) > 0 ) ? '<div class="co_info">' . co__( 'Info' ) . ': ' . co_htmlentities( $info ) . '</div>' : '';
    194211
    195212    /* Create and include chessboard with pieces */
     
    202219        }
    203220    $strout .= '</div>';
    204    
    205221
    206222    /* Include side to move */
    207223    $strout .= '<div class="co_sidetomove">'
    208224            . ( ( $fullmove  > 0 ) ? "#" . $fullmove   . " " : "" )
    209             .  ( ( $color == "w" ) ? __( 'White' , chessonline) : __( 'Black' , chessonline ) )
    210             . ' ' . __( 'to move' , chessonline ) . '</div>';
     225            .  ( ( $color == "w" ) ? co__( 'White' , chessonline) : co__( 'Black' ) )
     226            . ' ' . co__( 'to move' ) . '</div>';
    211227   
    212     /* Include link link */
    213     $strout .= ($link) ? "<div class=\"co_link\"><a class=\"co_overlay\" href=\"$link\">" . htmlentities( $linktext ) . '</a></div>' : '';
     228    /* Include link */
     229    $targetlist = array( 'new window' => '_blank' , 'same window' => '_top' );
     230    $hreftarget = ( $linktarget == 'overlay' ) ? 'class="co_overlay"' : 'target="' . $targetlist[ $linktarget ] .'"';
     231    $strout .= ($link) ? "<div class=\"co_link\"><a href=\"$link\" $hreftarget>" . co_htmlentities( $linktext ) . '</a></div>' : '';
    214232
    215233    /* Include white castling availability */
    216     $strout .= '<div class="co_castlingwhite">' . __( 'Castling' , chessonline ) . ' ' . __( 'white' , chessonline )
     234    $strout .= '<div class="co_castlingwhite">' . co__( 'Castling' ) . ' ' . co__( 'white' )
    217235            . ':' . ( preg_match( '/K/' ,  $castling ) ? ' O-O' : '' )
    218236            . ( preg_match( '/Q/' , $castling ) ? ' O-O-O' : '' )
    219             . ( !preg_match( '/[KW]/' , $castling ) ? ' ' . __( 'not allowed' , chessonline) : '' ) . '</div>';
     237            . ( !preg_match( '/[KW]/' , $castling ) ? ' ' . co__( 'not allowed' ) : '' ) . '</div>';
    220238
    221239    /* Include black castling availability */
    222     $strout .= '<div class="co_castlingblack">' . __( 'Castling' , chessonline ) . ' ' . __( 'black' , chessonline )
     240    $strout .= '<div class="co_castlingblack">' . co__( 'Castling' ) . ' ' . co__( 'black' )
    223241                        . ':' . ( preg_match( '/k/' ,  $castling ) ? ' O-O' : '' ) 
    224242                        . ( preg_match( '/q/' , $castling ) ? ' O-O-O' : '' )
    225                         . ( !preg_match( '/[kq]/' , $castling ) ? ' ' . __( 'not allowed' , chessonline) : '' ) . '</div>';
     243                        . ( !preg_match( '/[kq]/' , $castling ) ? ' ' . co__( 'not allowed' ) : '' ) . '</div>';
    226244
    227245    /* Include en passant target square */
    228     $strout .= '<div class="co_enpassant">' . __( 'En passant target square' , chessonline )
    229             . ': ' .  ( ( $ep != "-" ) ? htmlentities( $ep ) : __( 'none' , chessonline ) )  . '</div>';
     246    $strout .= '<div class="co_enpassant">' . co__( 'En passant target square' ) . ': ' .  ( ( $ep != "-" ) ? co_htmlentities( $ep ) : co__( 'none' ) ) . '</div>';
    230247
    231248    /* Close wrapping div */
     
    236253}
    237254
    238 #######################
    239 ### Options section ###
    240 #######################
     255#############################
     256### Admin options section ###
     257#############################
    241258
    242259/* Create custom plugin settings menu */
     
    244261
    245262function chessonline_menu() {
    246     add_options_page('ChessOnline Settings', 'ChessOnline', 'manage_options', 'co-settings', 'chessonline_settings_page');
    247     add_action( 'admin_init', 'co_register_settings' );
    248 }
    249 
    250 function co_register_settings() {
     263    add_options_page('ChessOnline Settings', 'ChessOnline', 'manage_options', 'co_settings', 'chessonline_settings_page');
     264    add_action( 'admin_init', 'co_admin_init' );
     265}
     266
     267function co_admin_init() {
     268
     269    /* Register settings */
    251270    register_setting( 'co-settings-group' , 'co_chessboard_size' , 'intval' );
    252271        register_setting( 'co-settings-group' , 'co_chessboard_alignment' , 'co_sani_alignment' );
     
    255274    register_setting( 'co-settings-group' , 'co_link_text' , 'trim' );
    256275    register_setting( 'co-settings-group' , 'co_link_url' , 'co_sani_url' );
    257 
    258     /* Sanitize option values */
     276    register_setting( 'co-settings-group' , 'co_link_target' , 'co_sani_target' );
     277
     278    /* Sanitize setting option values */
    259279    function co_sani_alignment( $val ) {
    260280        return preg_match( '/^(center|align left|align right|float left|float right)$/' , $val ) ? $val : 'center';
     
    270290        return ( preg_match( $urlregex , trim( $val ) ) ) ? trim( $val ) : '';
    271291    }
     292    function co_sani_target( $val ) {
     293                return preg_match( '/^(overlay|new window|same window)$/' , $val ) ? $val : 'overlay';
     294        }
    272295}
    273296
     
    275298?>
    276299    <div class="wrap">
    277     <h2>ChessOnline <?php _e( 'settings' , chessonline ); ?></h2>
     300
     301    <!-- Settings form -->
     302    <div id="icon-options-general" class="icon32"></div><h2>ChessOnline <?php echo co__( 'settings' ); ?></h2>
    278303    <form method="post" action="options.php">
    279304    <?php settings_fields( 'co-settings-group' ); ?>
    280305    <table class="form-table">
    281306    <tr valign="top">
    282     <th scope="row"><? _e( 'Chessboard size' , chessonline ); ?></th>
    283     <td><input type="text" name="co_chessboard_size" value="<?php echo get_option( 'co_chessboard_size' ); ?>" /> <?php _e( 'px' ); ?></td>
     307    <th scope="row"><? echo co__( 'Chessboard size' ); ?></th>
     308    <td><input type="text" name="co_chessboard_size" value="<?php echo get_option( 'co_chessboard_size' ); ?>" /> <?php echo co__( 'px' ); ?></td>
    284309    </tr>
    285310        <tr valign="top">
    286         <th scope="row"><? _e( 'Chessboard alignment' , chessonline ); ?></th>
     311        <th scope="row"><? echo co__( 'Chessboard alignment' ); ?></th>
    287312        <td><select name="co_chessboard_alignment">
    288313        <?php if( get_option( 'co_chessboard_alignment' ) ) { ?>
    289             <option value="<?php echo get_option( 'co_chessboard_alignment' ); ?>" /><?php _e( get_option( 'co_chessboard_alignment' ) , chessonline ); ?></option>
     314            <option value="<?php echo get_option( 'co_chessboard_alignment' ); ?>" /><?php echo co__( get_option( 'co_chessboard_alignment' ) ); ?></option>
    290315        <?php } ?>
    291         <option value="center"><?php _e( 'center' , chessonline ); ?></option>
    292         <option value="align left"><?php _e( 'align left' , chessonline ); ?></option>
    293         <option value="align right"><?php _e( 'align right' , chessonline ); ?></option>
    294         <option value="float left"><?php _e( 'float left' , chessonline ); ?></option>
    295         <option value="float right"><?php _e( 'float right' , chessonline ); ?></option>
     316        <option value="center"><?php echo co__( 'center' ); ?></option>
     317        <option value="align left"><?php echo co__( 'align left' ); ?></option>
     318        <option value="align right"><?php echo co__( 'align right' ); ?></option>
     319        <option value="float left"><?php echo co__( 'float left' ); ?></option>
     320        <option value="float right"><?php echo co__( 'float right' ); ?></option>
    296321    </select></td>
    297322        </tr>
    298323    <tr valign="top">
    299         <th scope="row"><? _e( 'Light square color' , chessonline ); ?></th>
    300     <td><input type="text" name="co_lightsquare_color" value="<?php echo get_option( 'co_lightsquare_color' ); ?>" /> <?php _e( 'HEX code or standard CSS color name' , chessonline ); ?></td>
     324        <th scope="row"><? echo co__( 'Light square color' ); ?></th>
     325    <td><input type="text" name="co_lightsquare_color" value="<?php echo get_option( 'co_lightsquare_color' ); ?>" /> <?php echo co__( 'HEX code or standard CSS color name' ); ?></td>
    301326        </tr>
    302327        <tr valign="top">
    303         <th scope="row"><? _e( 'Dark square color' , chessonline ); ?></th>
    304         <td><input type="text" name="co_darksquare_color" value="<?php echo get_option( 'co_darksquare_color' ); ?>" /> <?php _e( 'HEX code or standard CSS color name' , chessonline ); ?></td>
     328        <th scope="row"><? echo co__( 'Dark square color' ); ?></th>
     329        <td><input type="text" name="co_darksquare_color" value="<?php echo get_option( 'co_darksquare_color' ); ?>" /> <?php echo co__( 'HEX code or standard CSS color name' ); ?></td>
    305330        </tr>
    306331    <tr valign="top">
    307         <th scope="row"><? _e( 'Link text' , chessonline , chessonline ); ?></th>
     332        <th scope="row"><? echo co__( 'Link URL' ); ?></th>
     333        <td><input type="text" name="co_link_url" value="<?php echo get_option( 'co_link_url' ); ?>" /> <?php echo co__( 'Use {FEN} as placeholder to pass the FEN' ); ?></td>
     334        </tr>
     335    <tr valign="top">
     336        <th scope="row"><? echo co__( 'Link text' ); ?></th>
    308337        <td><input type="text" name="co_link_text" value="<?php echo get_option( 'co_link_text' ); ?>" /></td>
    309338        </tr>
    310339    <tr valign="top">
    311         <th scope="row"><? _e( 'Link URL' , chessonline , chessonline ); ?></th>
    312         <td><input type="text" name="co_link_url" value="<?php echo get_option( 'co_link_url' ); ?>" /> <?php _e( 'Use {FEN} as placeholder to pass the FEN' , chessonline ); ?></td>
     340        <th scope="row"><? echo co__( 'Link target' ); ?></th>
     341        <td><select name="co_link_target">
     342                <?php if( get_option( 'co_link_target' ) ) { ?>
     343                        <option value="<?php echo get_option( 'co_link_target' ); ?>" /><?php echo co__( get_option( 'co_link_target' ) ); ?></option>
     344                <?php } ?>
     345                <option value="overlay"><?php echo co__( 'overlay' ); ?></option>
     346                <option value="new window"><?php echo co__( 'new window' ); ?></option>
     347                <option value="same window"><?php echo co__( 'same window' ); ?></option>
     348        </select></td>
    313349        </tr>
    314350    </table>
    315351    <p class="submit">
    316     <input type="submit" class="button-primary" value="<?php _e('Save Changes' , chessonline ) ?>" />
     352    <input type="submit" class="button-primary" value="<?php echo co__('Save Changes' ); ?>" />
    317353    </p>
    318354    </form>
     355    <!-- Settings form end -->
     356        </div>
     357<?php
     358}
     359
     360#####################
     361### Tools section ###
     362#####################
     363
     364/* Create custom plugin tools menu */
     365add_action('admin_menu', 'chessonline_tools');
     366
     367function chessonline_tools() {
     368    add_submenu_page( 'tools.php', __( 'ChessOnline FEN Editor' , chessonline ) , __( 'ChessOnline FEN Editor' , chessonline ) , 'edit_posts', 'co_tools' , 'chessonline_tools_page');
     369        add_action( 'admin_init', 'co_tools_init' );
     370}
     371
     372function co_tools_init() {
     373
     374        /* Include CSS */
     375        wp_register_style( 'co_toolscss' , plugins_url( 'chessonline-tools.css' , __FILE__ ) );
     376        wp_enqueue_style( 'co_toolscss' );
     377
     378        /* jQuery */
     379        wp_enqueue_script( 'jquery' , '' , '' , '' , true );
     380        wp_enqueue_script( 'jquery-ui-core' , '' , '' , '' , true );
     381        wp_enqueue_script( 'jquery-ui-widget' , '' , '' , '' , true );
     382        wp_enqueue_script( 'jquery-ui-mouse' , '' , '' , '' , true );
     383        wp_enqueue_script( 'jquery-ui-draggeble' , '' , '' , '' , true );
     384        wp_enqueue_script( 'jquery-ui-droppable' , '' , '' , '' , true );
     385
     386    /* Include JavaScript */
     387        wp_register_script( 'co_toolsjs' , plugins_url( 'chessonline-tools.js' , __FILE__ ) , array( 'jquery' ) );
     388        wp_enqueue_script( 'co_toolsjs' );
     389}
     390
     391function chessonline_tools_page() {
     392?>
     393        <div class="wrap">
     394    <!--  FEN editor -->
     395    <div id="icon-tools" class="icon32"></div><h2><?php echo co__( 'ChessOnline FEN Editor' ); ?></h2>
     396    <div id="co_feneditor"><p><noscript><?php echo co__( 'To use this tool, you must enable JavaScript.' ); ?></noscript></p>
     397    <?php
     398
     399        /* Editor chessboard */
     400            $cols = Array( 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' );
     401            $strout = '<div class="co_editorboard">';
     402            for( $i = 9 ; $i >= 0 ; $i-- ) {
     403                   for( $j = 0 ; $j <= 9 ; $j++ ) {
     404                            if( $i != 0 && $i != 9 && ( $j == 0 || $j == 9 ) ) {
     405                                    $cssclass = 'co_square_rank';
     406                    $html = $i;
     407                            } elseif( $j != 0 && $j != 9 && ( $i == 0 || $i == 9 ) ) {
     408                                    $cssclass = 'co_square_col';
     409                                    $html = $cols[ $j - 1 ];
     410                            } elseif( $i != 0 && $i != 9 && $j != 0 && $j != 9 && ( $i + $j ) % 2 == 0 ) {
     411                                    $cssclass = 'co_square_drop co_square_dark';
     412                                    $html = '';
     413                            } elseif ( $i != 0 && $i != 9 && $j != 0 && $j != 9 ) {
     414                                    $cssclass = 'co_square_drop co_square_light';
     415                                    $html = '';
     416                            } else {
     417                                    $cssclass = 'co_square_corner';
     418                                    $html = '';
     419                            }
     420                            if( $i != 0 && $i != 9 && ( $j == 1 ) ) { $cssclass .= ' co_square_left'; }
     421                            if( $i != 0 && $i != 9 && ( $j == 8 ) ) { $cssclass .= ' co_square_right'; }
     422                            if( $j != 0 && $j != 9 && ( $i == 1 ) ) { $cssclass .= ' co_square_bottom'; }
     423                            if( $j != 0 && $j != 9 && ( $i == 8 ) ) { $cssclass .= ' co_square_top'; }
     424                            if( $i == 8 && $j == 1 ) { $cssclass .= ' co_square_topleft'; }
     425                            if( $i == 8 && $j == 8 ) { $cssclass .= ' co_square_topright'; }
     426                            if( $i == 1 && $j == 1 ) { $cssclass .= ' co_square_bottomleft'; }
     427                            if( $i == 1 && $j == 8 ) { $cssclass .= ' co_square_bottomright'; }
     428                            if( $i != 0 && $i != 9 && $j != 0 && $j != 9 ) { $html = '<div class="co_piece">' . $html . '</div>'; }
     429                $strout .= '<div id="co_square' . $i . $j . '" class="' . $cssclass . '">' . $html . '</div>';
     430                    }
     431            }
     432            $strout .= '</div>';
     433        echo $strout;
     434
     435            /* Editor pieces repository */
     436        $pieces = array( 'P' => '&#9817;' , 'p' => '&#9823;' , 'R' => '&#9814;' , 'r' => '&#9820;' ,
     437                    'N' => '&#9816;' , 'n' => '&#9822;' , 'B' => '&#9815;' , 'b' => '&#9821;' ,
     438                    'Q' => '&#9813;' , 'q' => '&#9819;' , 'K' => '&#9812;' ,  'k' => '&#9818;' );
     439            $strout = '<div class="co_repo">';
     440        foreach( $pieces as $value ) {
     441                    $strout .= '<div class="co_dragrepo"><div class="co_piecerepo">' . $value . '</div></div>';
     442            }
     443            $strout .= '</div>';
     444        echo $strout;
     445
     446        /* Editor FEN fields */
     447        $strout = '<div class="co_fenfields">';
     448        $strout .= '<span class="co_label">' . co__( 'Active color' ) . ':</span><span class="co_field"><select id="co_sidetomove"><option value="w">' . co__( 'white' ) . '</option><option value="b">' . co__( 'black' ) . '</option></select></span>';
     449        $strout .= '<span class="co_label">' . co__( 'Castling' ) . ' ' . co__( 'white' ) . ' O-O:</span><span class="co_field"><select id="co_castlingwk"><option value="-">' . co__( 'not allowed' ) . '</option><option value="K">' . co__( 'allowed' ) . '</option></select></span>';
     450        $strout .= '<span class="co_label">' . co__( 'Castling' ) . ' ' . co__( 'white' ) . ' O-O-O:</span><span class="co_field"><select id="co_castlingwq"><option value="-">' . co__( 'not allowed' ) . '</option><option value="Q">' . co__( 'allowed' ) . '</option></select></span>';
     451        $strout .= '<span class="co_label">' . co__( 'Castling' ) . ' ' . co__( 'black' ) . ' O-O:</span><span class="co_field"><select id="co_castlingbk"><option value="-">' . co__( 'not allowed' ) . '</option><option value="k">' . co__( 'allowed' ) . '</option></select></span>';
     452        $strout .= '<span class="co_label">' . co__( 'Castling' ) . ' ' . co__( 'black' ) . ' O-O-O:</span><span class="co_field"><select id="co_castlingbq"><option value="-">' . co__( 'not allowed' ) . '</option><option value="q">' . co__( 'allowed' ) . '</option></select></span>';
     453        $strout .= '<span class="co_label">' . co__( 'EP target square' ) . ':</span><span class="co_field"><select id="co_ep"><option value="-">' . co__( 'none' ) . '</option>';
     454        foreach( array( 'a3' , 'b3' , 'c3' , 'd3' , 'e3' , 'f3' , 'g3' , 'h3' , 'a6' , 'b6' , 'c6' , 'd6' , 'e6' , 'f6' , 'g6' , 'h6') as $value ) {
     455            $strout .= "<option value=\"$value\">$value</option>";
     456        }
     457        $strout .= '</select></span>';
     458        $strout .= '<span class="co_label">' . co__( 'Halfmove clock' ) . ':</span><span class="co_field"><input type="text" size="3" maxlength="3" id="co_halfmove" value="0"></span>';
     459        $strout .= '<span class="co_label">' . co__( 'Fullmove number' ) . ':</span><span class="co_field"><input type="text" size="3" maxlength="3" id="co_fullmove" value="1"></span>';
     460        $strout .= '</div>';
     461                echo $strout;
     462
     463        /* Editor FEN output */
     464        $strout = '<div class="co_fenoutput">';
     465        $strout .= '<h3>' . co__( 'Your FEN' ) . '</h3>';
     466        $strout .= '<input type="text" id="co_fen" value="8/8/8/8/8/8/8/8 w - - 0 1">';
     467        $strout .= '<button class="button-primary" id="co_loadfen">' . co__( 'FEN to board' ) . '</button>';
     468        $strout .= '<button class="button-primary" id="co_makefen">' . co__( 'Board to FEN' ) . '</button>';
     469        $strout .= '<button class="button-primary" id="co_resetfen">' . co__( 'Clear' ) . '</button>';
     470        $strout .= '<button class="button-primary" id="co_initfen">' . co__( 'Starting position' ) . '</button>';
     471        $strout .= '</div>';
     472        echo $strout;
     473    ?>
     474    </div>
     475    <!-- FEN editor end -->
     476
    319477    </div>
    320478<?php } ?>
  • chessonline/trunk/readme.txt

    r504291 r505708  
    44Requires at least: 2.7.0
    55Tested up to: 3.3.1
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77
    88The ChessOnline WordPress plugin allows you to display a chessboard and to set up positions using the Forsyth-Edwards-Notation (FEN).
     
    1212= English =
    1313
    14 The ChessOnline WordPress plugin allows you to display a chessboard and to set up positions using the Forsyth-Edwards-Notation (FEN). You can specify an external URL for linking purposes. Please use http://chessonline.w3edv.de/?fen={FEN} as URL if you want to set an analysis link to the ChessOnline-Plugin-Website. Board size and colors are configurable. The following languages are supported (i18n): Dutch, English and German. The client browser needs to be capable of displaying unicode characters. No browsers plugins are required, javascript doesn't need to be enabled.
     14The ChessOnline WordPress plugin allows you to display a chessboard and to set up positions using the Forsyth-Edwards-Notation (FEN). You can specify an external URL for linking purposes. Please use http://chessonline.w3edv.de/?fen={FEN} as URL if you want to set an analysis link to the ChessOnline-Plugin-Website. It comes up with an integrated FEN editor. Board size and colors are configurable. The following languages are supported (i18n): Dutch, English and German. The client browser needs to be capable of displaying unicode characters. No browsers plugins are required. JavaScript doesn't need to be enabled for displaying the chessboard but is required for using the overlay functionality and the FEN editor.
    1515
    1616The FEN has to be put in square brackets:
     
    2424= Deutsch =
    2525
    26 Das ChessOnline WordPress Plugin ermöglicht Ihnen das Einbinden eines Schachbrettes über eine Eingabe mittels Forsyth-Edwards-Notation (FEN). Es kann eine externe URL für Verlinungszwecke angegeben werden. Bitte setzen Sie die URL auf http://chessonline.w3edv.de/?fen={FEN} wenn Sie einen Analyse-Link auf die ChessOnline-Plugin-Webseite setzen möchten. Brettgröße und -farbe sind konfigurierbar. Die folgenden Sprachen werden unterstützt (i18n): Deutsch, Englisch und Niederländisch. Der Client-Browser muss Unicode-Zeichen darstellen können. Es wird kein Browser-Plugin benötigt, Javascript muss nicht eingeschaltet sein.
     26Das ChessOnline WordPress Plugin ermöglicht Ihnen das Einbinden eines Schachbrettes über eine Eingabe mittels Forsyth-Edwards-Notation (FEN). Es kann eine externe URL für Verlinungszwecke angegeben werden. Bitte setzen Sie die URL auf http://chessonline.w3edv.de/?fen={FEN} wenn Sie einen Analyse-Link auf die ChessOnline-Plugin-Webseite setzen möchten. Ein FEN-Editor ist integriert. Brettgröße und -farbe sind konfigurierbar. Die folgenden Sprachen werden unterstützt (i18n): Deutsch, Englisch und Niederländisch. Der Client-Browser muss Unicode-Zeichen darstellen können. Es wird kein Browser-Plugin benötigt. JavaScript muss nicht eingeschaltet sein um das Schachbrett darzustellen, wird jedoch für die Overlay-Funktionalität und den FEN-Editor benötigt.
    2727
    2828Die FEN muss in eckigen Klammern gesetzt werden:
     
    3636= Nederlands =
    3737
    38 Het ChessOnline-WordPress-plugin biedt u de mogelijkheid om in uw artikel een schaakbord te integreren door middel van een Forsyth-Edwards-notatie (FEN). Voor link doeleinden kan een externe URL worden opgegeven. Indien u de analyse-link naar de ChessOnline-Plugin-website wenst te plaatsen, gelieve dan http://chessonline.w3edv.de/?fen={FEN} als URL in te vullen. Grootte en kleur van het bord zijn configureerbaar. De volgende talen worden ondersteund (i18n): Duits, Engels en Nederlands. De client-browser moet unicode-tekens kunnen afbeelden. Er worden geen browser-plugins benodigd, javascript moet niet geactiveerd zijn.
     38De ChessOnline-WordPress-plugin biedt jou de mogelijkheid om in jouw artikels een schaakbord te integreren door middel van een Forsyth-Edwards-notatie (FEN) en bevat een FEN-editor. Voor link doeleinden kan een externe URL worden opgegeven. Indien je de analyse-link naar de ChessOnline-Plugin-website wenst te plaatsen, gelieve dan http://chessonline.w3edv.de/?fen={FEN} als URL in te vullen. Grootte en kleur van het bord zijn configureerbaar. De volgende talen worden ondersteund (i18n): Duits, Engels en Nederlands. De client-browser moet unicode-tekens kunnen afbeelden. Er worden geen browser-plugins benodigd. JavaScript moet niet geactiveerd zijn maar wordt wel benodigd voor de overlay-functie en de FEN-editor.
    3939
    4040De FEN moet tussen vierkante haakjes worden geplaatst:
     
    5454NL - Upload het ChessOnline-Plugin in uw blog en activeer het.
    5555 
     56== Frequently Asked Questions ==
     57
     58= How can I resize the overlay iframe? =
     59
     60Change the marked width and height in chessonline.css
     61
    5662== Screenshots ==
    5763
    58641. Chessboard
    59 2. Settings
     652. Admin Settings
     663. FEN Editor
    6067
    6168== Changelog ==
    6269
     70= 1.1 =
     71* FEN editor added
     72* Link target option added
     73
    6374= 1.0 =
    6475* Published
     76
     77== Upgrade Notice ==
     78
     79= 1.1 =
     80This version comes up with an integrated FEN editor.
Note: See TracChangeset for help on using the changeset viewer.