WordPress.org

Plugin Directory

Changeset 631388


Ignore:
Timestamp:
11/28/12 16:51:53 (17 months ago)
Author:
TobiasBg
Message:

Fix "Horizontal scrolling" option that was broken during the development of 0.8-beta; Intermediate release without increasing the version number

Location:
tablepress/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • tablepress/trunk/admin/edit.js

    r629752 r631388  
    127127                    datatables_paginate_entries: $( '#option-datatables-paginate_entries' ).val(), 
    128128                    datatables_info: $( '#option-datatables-info' ).prop( 'checked' ), 
    129                     datatables_scrollX: $( '#option-datatables-scrollX' ).prop( 'checked' ), 
     129                    datatables_scrollx: $( '#option-datatables-scrollx' ).prop( 'checked' ), 
    130130                    datatables_custom_commands: $( '#option-datatables-custom-commands' ).val() 
    131131                }; 
  • tablepress/trunk/admin/edit.min.js

    r629752 r631388  
    66change_datatables_pagination:function(){var b=a("#option-datatables-paginate"),b=b.prop("checked")&&!b.prop("disabled");a("#option-datatables-lengthchange").prop("disabled",!b);a("#option-datatables-paginate_entries").prop("disabled",!b)},prepare_ajax_request:function(b,c){var d=a("#edit-form-body"),e=[],f,h={rows:tp.table.rows,columns:tp.table.columns,hidden_rows:0,hidden_columns:0},i={rows:[],columns:[]};d.children().each(function(b,c){e[b]=a(c).find("textarea").map(function(){return a(this).val()}).get()}); 
    77e=JSON.stringify(e);f={table_head:tp.table.head,table_foot:tp.table.foot,alternating_row_colors:a("#option-alternating-row-colors").prop("checked"),row_hover:a("#option-row-hover").prop("checked"),print_name:a("#option-print-name").prop("checked"),print_description:a("#option-print-description").prop("checked"),print_name_position:a("#option-print-name-position").val(),print_description_position:a("#option-print-description-position").val(),extra_css_classes:a("#option-extra-css-classes").val(),use_datatables:a("#option-use-datatables").prop("checked"), 
    8 datatables_sort:a("#option-datatables-sort").prop("checked"),datatables_filter:a("#option-datatables-filter").prop("checked"),datatables_paginate:a("#option-datatables-paginate").prop("checked"),datatables_lengthchange:a("#option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:a("#option-datatables-paginate_entries").val(),datatables_info:a("#option-datatables-info").prop("checked"),datatables_scrollX:a("#option-datatables-scrollX").prop("checked"),datatables_custom_commands:a("#option-datatables-custom-commands").val()}; 
     8datatables_sort:a("#option-datatables-sort").prop("checked"),datatables_filter:a("#option-datatables-filter").prop("checked"),datatables_paginate:a("#option-datatables-paginate").prop("checked"),datatables_lengthchange:a("#option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:a("#option-datatables-paginate_entries").val(),datatables_info:a("#option-datatables-info").prop("checked"),datatables_scrollx:a("#option-datatables-scrollx").prop("checked"),datatables_custom_commands:a("#option-datatables-custom-commands").val()}; 
    99f=JSON.stringify(f);i.rows=d.find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_rows+=1;return 0}).get();i.columns=a("#edit-form-foot").find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_columns+=1;return 0}).get();i=JSON.stringify(i);return{action:b,_ajax_nonce:a(c).val(),tablepress:{id:tp.table.id,new_id:tp.table.new_id,name:a("#table-name").val(),description:a("#table-description").val(),number:h,data:e,options:f,visibility:i}}}, 
    1010preview:{trigger:function(){if(!tp.made_changes)return tp.table.preview.show(a(this).attr("href")+"&TB_iframe=true"),!1;if(a("#option-datatables-paginate").prop("checked")&&!/^[1-9][0-9]{0,4}$/.test(a("#option-datatables-paginate_entries").val()))alert(tablepress_strings.num_pagination_entries_invalid),a("#option-datatables-paginate_entries").focus().select();else if(/[^A-Za-z0-9- _]/.test(a("#option-extra-css-classes").val()))alert(tablepress_strings.extra_css_classes_invalid),a("#option-extra-css-classes").focus().select(); 
  • tablepress/trunk/classes/class-controller.php

    r629752 r631388  
    113113        // Maybe update the table scheme in each existing table, independently from updating the plugin options 
    114114        if ( $this->model_options->get( 'table_scheme_db_version' ) < TablePress::table_scheme_version ) { 
     115            // Convert parameter "datatables_scrollX" to "datatables_scrollx", has to be done before merge_table_options_defaults() is called! 
     116            if ( $this->model_options->get( 'table_scheme_db_version' ) < 3 ) 
     117                $this->model_table->merge_table_options_tp09(); 
     118 
    115119            $this->model_table->merge_table_options_defaults(); 
    116120 
  • tablepress/trunk/classes/class-tablepress.php

    r629752 r631388  
    5151     * @const int 
    5252     */ 
    53     const table_scheme_version = 2; 
     53    const table_scheme_version = 3; 
    5454 
    5555    /** 
  • tablepress/trunk/controllers/controller-admin.php

    r629752 r631388  
    657657        $checkbox_options = array( 
    658658            'table_head', 'table_foot', 'alternating_row_colors', 'row_hover', 'print_name', 'print_description', // Table Options 
    659             'use_datatables', 'datatables_sort', 'datatables_filter', 'datatables_paginate', 'datatables_lengthchange', 'datatables_info', 'datatables_scrollX' // DataTables JS Features 
     659            'use_datatables', 'datatables_sort', 'datatables_filter', 'datatables_paginate', 'datatables_lengthchange', 'datatables_info', 'datatables_scrollx' // DataTables JS Features 
    660660        ); 
    661661        foreach ( $checkbox_options as $option ) { 
  • tablepress/trunk/models/model-table.php

    r629752 r631388  
    479479    /** 
    480480     * Get the template for an empty table 
     481     * 
     482     * Important: This scheme is versioned via TablePress::table_scheme_version; changes likely need a version update! 
    481483     * 
    482484     * @since 1.0.0 
     
    512514                'datatables_paginate_entries' => 10, 
    513515                'datatables_info' => true, 
    514                 'datatables_scrollX' => false, 
     516                'datatables_scrollx' => false, 
    515517                'datatables_custom_commands' => '' 
    516518            ), 
     
    764766     * @TODO: Remove in 1.0 
    765767     * 
    766      * @since 1.0.0 
     768     * @since 0.6-beta 
    767769     */ 
    768770    public function merge_table_options_tp06() { 
     
    792794    } 
    793795 
     796    /** 
     797     * Merge changes made for TablePress 0.9-RC: 
     798     * Conversion of parameter "datatables_scrollX" to "datatables_scrollx" 
     799     * 
     800     * @since 0.9-RC 
     801     */ 
     802    public function merge_table_options_tp09() { 
     803        $table_post = $this->tables->get( 'table_post' ); 
     804        if ( empty( $table_post ) ) 
     805            return; 
     806 
     807        $post_ids = array_values( $table_post ); 
     808 
     809        // go through all tables (this loop now uses the WP cache) 
     810        foreach ( $post_ids as $post_id ) { 
     811            $table_options = $this->_get_table_options( $post_id ); 
     812 
     813            // Convert parameter "datatables_scrollX" to "datatables_scrollx" 
     814            if ( isset( $table_options['datatables_scrollX'] ) && ! isset( $table_options['datatables_scrollx'] ) ) 
     815                $table_options['datatables_scrollx'] = $table_options['datatables_scrollX']; 
     816 
     817            $this->_update_table_options( $post_id, $table_options ); 
     818        } 
     819    } 
     820 
    794821} // class TablePress_Table_Model 
  • tablepress/trunk/views/view-edit.php

    r629752 r631388  
    521521    <tr class="bottom-border"> 
    522522        <th class="column-1" scope="row"><?php _e( 'Horizontal Scrolling', 'tablepress' ); ?>:</th> 
    523         <td class="column-2"><label for="option-datatables-scrollX"><input type="checkbox" id="option-datatables-scrollX" name="table[options][datatables_scrollX]" value="true"<?php checked( $options['datatables_scrollX'] ); ?> /> <?php _e( 'Enable horizontal scrolling, to make viewing tables with many columns easier.', 'tablepress' ); ?></label></td> 
     523        <td class="column-2"><label for="option-datatables-scrollx"><input type="checkbox" id="option-datatables-scrollx" name="table[options][datatables_scrollx]" value="true"<?php checked( $options['datatables_scrollx'] ); ?> /> <?php _e( 'Enable horizontal scrolling, to make viewing tables with many columns easier.', 'tablepress' ); ?></label></td> 
    524524    </tr> 
    525525    <tr class="top-border"> 
Note: See TracChangeset for help on using the changeset viewer.