Plugin Directory

Changeset 3282901


Ignore:
Timestamp:
04/27/2025 08:43:19 PM (11 months ago)
Author:
Tkama
Message:

Update to version 6.0.4 from GitHub

Location:
democracy-poll
Files:
4 added
2 deleted
42 edited
1 copied

Legend:

Unmodified
Added
Removed
  • democracy-poll/tags/6.0.4/classes/Admin/Admin_Page.php

    r3056337 r3282901  
    5656    }
    5757
    58     public function admin_page_load() {
     58    public function admin_page_load(): void {
    5959
    6060        // datepicker
  • democracy-poll/tags/6.0.4/classes/Admin/Admin_Page_Settings.php

    r3057019 r3282901  
    179179                            <input type="checkbox" value="1"
    180180                                   name="dem[post_metabox_off]" <?php checked( options()->post_metabox_off, 1 ) ?> />
    181                             <?= esc_html__( 'Dasable post metabox.', 'democracy-poll' ) ?>
    182                         </label>
    183                         <em><?= esc_html__( 'Check this to dasable polls metabox functionality for posts where you can attached poll to a post...', 'democracy-poll' ) ?></em>
     181                            <?= esc_html__( 'Disable post metabox.', 'democracy-poll' ) ?>
     182                        </label>
     183                        <em><?= esc_html__( 'Check this to disable polls metabox functionality for posts where you can attached poll to a post...', 'democracy-poll' ) ?></em>
    184184                    </li>
    185185
  • democracy-poll/tags/6.0.4/classes/Admin/Admin_Page_l10n.php

    r3056337 r3282901  
    44
    55use function DemocracyPoll\plugin;
    6 use function DemocracyPoll\options;
    76
    87class Admin_Page_l10n implements Admin_Subpage_Interface {
     
    1514    }
    1615
    17     public function load(  ){
     16    public function load(): void {
    1817    }
    1918
    20     public function request_handler(  ){
     19    public function request_handler(): void {
    2120        if( ! plugin()->super_access || ! Admin_Page::check_nonce() ){
    2221            return;
     
    4342    }
    4443
    45     public function render() {
     44    public function render(): void {
    4645        if( ! plugin()->super_access ){
    4746            return;
     
    150149     * For front part localization and custom translation setup.
    151150     */
    152     public static function add_gettext_filter(){
     151    public static function add_gettext_filter(): void {
    153152        add_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10, 4 );
    154153    }
    155154
    156     public static function remove_gettext_filter(){
     155    public static function remove_gettext_filter(): void {
    157156        remove_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10 );
    158157    }
  • democracy-poll/tags/6.0.4/classes/DemPoll.php

    r3064229 r3282901  
    890890
    891891        if( $answers ){
    892             // не установлен порядок
    893             if( ! $answers[0]->aorder ){
    894                 $ord = $this->answers_order ?: options()->order_answers;
    895 
    896                 if( $ord === 'by_winner' || $ord == 1 ){
     892            $is_custom_order = (bool) reset( $answers )->aorder;
     893            if( $is_custom_order ){
     894                $answers = Helpers::objects_array_sort( $answers, [ 'aorder' => 'asc' ] );
     895            }
     896            else{
     897                $order = $this->answers_order ?: options()->order_answers;
     898
     899                if( $order === 'by_winner' || $order == 1 ){
    897900                    $answers = Helpers::objects_array_sort( $answers, [ 'votes' => 'desc' ] );
    898901                }
    899                 elseif( $ord === 'mix' ){
     902                elseif( $order === 'alphabet' ){
     903                    $answers = Helpers::objects_array_sort( $answers, [ 'answer' => 'asc' ] );
     904                }
     905                elseif( $order === 'mix' ){
    900906                    shuffle( $answers );
    901907                }
    902                 elseif( $ord === 'by_id' ){}
    903             }
    904             // по порядку
    905             else{
    906                 $answers = Helpers::objects_array_sort( $answers, [ 'aorder' => 'asc' ] );
    907             }
    908         }
    909         else {
    910             $answers = [];
     908                elseif( $order === 'by_id' ){}
     909            }
    911910        }
    912911
  • democracy-poll/tags/6.0.4/classes/Helpers/Helpers.php

    r3059285 r3282901  
    99            'by_id'     => __( 'As it was added (by ID)', 'democracy-poll' ),
    1010            'by_winner' => __( 'Winners at the top', 'democracy-poll' ),
     11            'alphabet'  => __( 'Alphabetically', 'democracy-poll' ),
    1112            'mix'       => __( 'Mix', 'democracy-poll' ),
    1213        ];
  • democracy-poll/tags/6.0.4/classes/Options.php

    r3057019 r3282901  
    143143    /**
    144144     * Sets $this->opt. Update options in DB if it's not set yet.
    145      *
    146      * @return void
    147145     */
    148     public function set_opt() {
     146    public function set_opt(): void {
    149147
    150148        if( ! $this->opt ){
     
    169167    public function update_single_option( $option_name, $value ): bool {
    170168
    171         $newopt = $this->opt;
    172         $newopt[ $option_name ] = $value;
    173 
    174169        if( $this->is_option_exists( $option_name ) ){
     170            $newopt = $this->opt;
     171            $newopt[ $option_name ] = $value;
     172
    175173            return (bool) update_option( self::OPT_NAME, $newopt );
    176174        }
     
    180178
    181179    /**
    182      * Updates options.
    183      *
    184180     * @param string $type  What group of option to update: main, design.
    185181     */
     
    228224
    229225    /**
    230      * Updates $this->opt based on request data.
    231      * Если опция не передана, то на её место будет записано 0.
     226     * Updates {@see self::$opt} based on request data.
     227     * If the option is not passed, 0 will be written in its place.
    232228     */
    233     private function sanitize_request_options( array $request_data, string $type ){
     229    private function sanitize_request_options( array $request_data, string $type ): void {
    234230
    235231        foreach( $this->default_options[ $type ] as $key => $v ){
     
    258254            $this->opt[ $key ] = $value;
    259255        }
    260 
    261     }
    262 
    263     /**
    264      * Checks if option name exists.
    265      */
     256    }
     257
    266258    private function is_option_exists( string $option_name ): bool {
    267259
  • democracy-poll/tags/6.0.4/classes/Options_CSS.php

    r3056337 r3282901  
    5858        $styledir = DEMOC_PATH . 'styles';
    5959
    60         $out .= $this->parse_cssimport( "$styledir/$tpl" );
     60        $out .= $this->parse_css_import( "$styledir/$tpl" );
    6161        $out .= $radios ? "\n" . file_get_contents( "$styledir/checkbox-radio/$radios" ) : '';
    6262        $out .= $button ? "\n" . file_get_contents( "$styledir/buttons/$button" ) : '';
     
    138138     * Imports @import in css.
    139139     */
    140     private function parse_cssimport( $css_filepath ) {
     140    private function parse_css_import( $css_filepath ) {
    141141        $filecode = file_get_contents( $css_filepath );
    142142
  • democracy-poll/tags/6.0.4/classes/Plugin.php

    r3057019 r3282901  
    3838    }
    3939
    40     public function basic_init() {
     40    public function basic_init(): void {
    4141        $this->opt->set_opt();
    4242
     
    5151    }
    5252
    53     public function init() {
     53    public function init(): void {
    5454        $this->basic_init();
    5555
    5656        $this->set_is_cachegear_on();
    5757
    58         // admin part
     58        $this->init_admin();
     59
     60        ( new Shortcodes() )->init();
     61        $this->poll_ajax = new Poll_Ajax();
     62        $this->poll_ajax->init();
     63
     64        // For front-end localization and custom translation
     65        Admin_Page_l10n::add_gettext_filter();
     66
     67        $this->menu_in_admin_bar();
     68        $this->hide_form_indexing();
     69
     70        $this->enable_widget();
     71    }
     72
     73    private function init_admin(): void {
    5974        if( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){
    6075            $this->admin = new Admin();
    6176            $this->admin->init();
    6277        }
    63 
    64         ( new Shortcodes() )->init();
    65         $this->poll_ajax = new Poll_Ajax();
    66         $this->poll_ajax->init();
    67 
    68         // For front-end localisation and custom translation
    69         Admin_Page_l10n::add_gettext_filter();
    70 
    71         // menu in the admin bar
     78    }
     79
     80    private function enable_widget(): void {
     81        if( options()->use_widget ){
     82            add_action( 'widgets_init', static function() {
     83                register_widget( Poll_Widget::class );
     84            } );
     85        }
     86    }
     87
     88    private function menu_in_admin_bar(): void {
    7289        if( $this->admin_access && $this->opt->toolbar_menu ){
    7390            add_action( 'admin_bar_menu', [ $this, 'add_toolbar_node' ], 99 );
    7491        }
    75 
    76         $this->hide_form_indexing();
    77     }
    78 
    79     // hide duplicate content. For 5+ versions it's no need
    80     private function hide_form_indexing() {
    81         // hide duplicate content. For 5+ versions it's no need
     92    }
     93
     94    /**
     95     * Hide duplicate content. For 5+ versions it's no need.
     96     */
     97    private function hide_form_indexing(): void {
     98        // Hide duplicate content. For 5+ versions it's no need
    8299        if(
    83100            isset( $_GET['dem_act'] )
     
    87104            || isset( $_GET['dem_add_user_answer'] )
    88105        ){
    89             add_action( 'wp', function() {
     106            add_action( 'wp', static function() {
    90107                status_header( 404 );
    91108            } );
    92109
    93             add_action( 'wp_head', function() {
     110            add_action( 'wp_head', static function() {
    94111                echo "\n<!--democracy-poll-->\n" . '<meta name="robots" content="noindex,nofollow">' . "\n";
    95112            } );
     
    97114    }
    98115
    99     private function set_access_caps() {
     116    private function set_access_caps(): void {
    100117        $is_adminor = current_user_can( 'manage_options' );
    101118
     
    117134    }
    118135
    119     private function set_is_cachegear_on() {
     136    private function set_is_cachegear_on(): void {
    120137
    121138        if( $this->opt->force_cachegear ){
     
    133150    }
    134151
    135     public function load_textdomain() {
     152    public function load_textdomain(): void {
    136153        load_plugin_textdomain( 'democracy-poll', false, basename( DEMOC_PATH ) . '/languages/' );
    137154    }
     
    140157     * @param \WP_Admin_Bar $toolbar
    141158     */
    142     public function add_toolbar_node( $toolbar ) {
     159    public function add_toolbar_node( $toolbar ): void {
    143160
    144161        $toolbar->add_node( [
     
    229246     * Adds scripts to the footer.
    230247     */
    231     public function add_js_once() {
     248    public function add_js_once(): void {
    232249        static $once = 0;
    233250        if( $once++ ){
     
    245262    }
    246263
    247     public static function _add_js_wp_footer() {
     264    public static function _add_js_wp_footer(): void {
    248265        echo "\n" . '<script id="democracy-poll">' . file_get_contents( DEMOC_PATH . 'js/democracy.min.js' ) . '</script>' . "\n";
    249266    }
  • democracy-poll/tags/6.0.4/classes/Poll_Ajax.php

    r3056337 r3282901  
    1717
    1818        // to work without AJAX
    19         if( isset( $_POST['dem_act'] ) &&
    20             ( ! isset( $_POST['action'] ) || 'dem_ajax' !== $_POST['action'] )
     19        if(
     20            isset( $_POST['dem_act'] )
     21            && ( ! isset( $_POST['action'] ) || 'dem_ajax' !== $_POST['action'] )
    2122        ){
    2223            add_action( 'init', [ $this, 'not_ajax_request_handler' ], 99 );
     
    2425    }
    2526
    26     # Делает предваритеьную проверку передавемых переменных запроса
     27    /**
     28     * Does a preliminary sanitization of the passed request variables.
     29     */
    2730    public function sanitize_request_vars(): array {
    28 
    2931        return [
    3032            'act'  => sanitize_text_field( $_POST['dem_act'] ?? '' ),
     
    3436    }
    3537
    36     # обрабатывает запрос AJAX
    3738    public function ajax_request_handler() {
    3839
     
    4950        $poll = new \DemPoll( $vars->pid );
    5051
    51         // switch
    52         // голосуем и выводим результаты
     52        // vote and display results
    5353        if( 'vote' === $vars->act && $vars->aids ){
    5454            $voted = $poll->vote( $vars->aids );
     
    6565            }
    6666        }
    67         // удаляем результаты
     67        // delete results
    6868        elseif( 'delVoted' === $vars->act ){
    6969            $poll->delete_vote();
    7070            echo $poll->get_vote_screen();
    7171        }
    72         // смотрим результаты
     72        // view results
    7373        elseif( 'view' === $vars->act ){
    7474            if( $poll->not_show_results ){
     
    7979            }
    8080        }
    81         // вернуться к голосованию
     81        // back to voting
    8282        elseif( 'vote_screen' === $vars->act ){
    8383            echo $poll->get_vote_screen();
    8484        }
     85        // get poll->votedFor value (from db)
    8586        elseif( 'getVotedIds' === $vars->act ){
    8687            if( $poll->votedFor ){
    87                 $poll->set_cookie(); // Установим куки, т.к. этот запрос делается только если куки не установлены
     88                $poll->set_cookie(); // Set cookies, since this request is only made if cookies are not set
    8889                echo $poll->votedFor;
    8990            }
    9091            elseif( $poll->blockForVisitor ){
    91                 echo 'blockForVisitor'; // чтобы вывести заметку
     92                echo 'blockForVisitor'; // to display a note
    9293            }
    9394            else{
    94                 // если не голосовал ставим куки на пол дня, чтобы не делать эту проверку каждый раз
     95                // If not voted, set a cookie for half a day to don't do this check every time.
    9596                $poll->set_cookie( 'notVote', ( time() + ( DAY_IN_SECONDS / 2 ) ) );
    9697            }
  • democracy-poll/tags/6.0.4/classes/Utils/Activator.php

    r3057019 r3282901  
    77class Activator {
    88
    9     public static function set_db_tables() {
     9    public static function set_db_tables(): void {
    1010        global $wpdb;
    1111        $wpdb->democracy_q   = $wpdb->prefix . 'democracy_q';
     
    1414    }
    1515
    16     public static function activate() {
     16    public static function activate(): void {
    1717        plugin()->basic_init();
    1818
     
    3030    }
    3131
    32     private static function _activate() {
     32    private static function _activate(): void {
    3333        // create tables
    3434        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     
    4040    }
    4141
    42     private static function add_sample_poll(){
     42    private static function add_sample_poll(): void {
    4343        global $wpdb;
    4444
  • democracy-poll/tags/6.0.4/classes/Utils/Migrator__WP_Polls.php

    r3056337 r3282901  
    6969
    7070use function DemocracyPoll\plugin;
    71 use function DemocracyPoll\options;
    7271
    7372class Migrator__WP_Polls {
    7473
    75     public function migrate() {
     74    public function migrate(): void {
    7675        global $wpdb;
    7776
  • democracy-poll/tags/6.0.4/democracy.php

    r3064229 r3282901  
    22/**
    33 * Plugin Name: Democracy Poll
    4  * Description: Allows to create democratic polls. Visitors can vote for more than one answer & add their own answers.
     4 * Description: Allows creation of democratic polls. Visitors can vote for multiple answers and add their own answers.
    55 *
    66 * Author: Kama
     
    1111 * Domain Path: /languages/
    1212 *
    13  * Requires at least: 4.7
    14  * Requires PHP: 7.0
     13 * Requires at least: 5.8
     14 * Requires PHP: 7.4
    1515 *
    16  * Version: 6.0.3
     16 * Version: 6.0.4
    1717 */
    1818
     
    3232register_activation_hook( __FILE__, [ \DemocracyPoll\Utils\Activator::class, 'activate' ] );
    3333
    34 add_action( 'plugins_loaded', '\DemocracyPoll\init' );
    35 function init() {
    36     plugin()->init();
    37 
    38     // enable widget
    39     if( options()->use_widget ){
    40         add_action( 'widgets_init', function() {
    41             register_widget( \DemocracyPoll\Poll_Widget::class );
    42         } );
    43     }
    44 }
    45 
    46 
     34/**
     35 * NOTE: Init the plugin later on the 'after_setup_theme' hook to
     36 * run current_user_can() later to avoid possible conflicts.
     37 */
     38add_action( 'after_setup_theme', [ plugin(), 'init' ] );
  • democracy-poll/tags/6.0.4/js/_js-cookie.js

    r2675427 r3282901  
    11// includes in democracy.js
    22
    3 /*!
    4  * JavaScript Cookie v2.2.0
    5  * https://github.com/js-cookie/js-cookie
    6  *
    7  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
    8  * Released under the MIT license
    9  */
    10 ;(function (factory) {
    11     var registeredInModuleLoader;
    12     if (typeof define === 'function' && define.amd) {
    13         define(factory);
    14         registeredInModuleLoader = true;
    15     }
    16     if (typeof exports === 'object') {
    17         module.exports = factory();
    18         registeredInModuleLoader = true;
    19     }
    20     if (!registeredInModuleLoader) {
    21         var OldCookies = window.Cookies;
    22         var api = window.Cookies = factory();
    23         api.noConflict = function () {
    24             window.Cookies = OldCookies;
    25             return api;
    26         };
    27     }
    28 }(function () {
    29     function extend () {
    30         var i = 0;
    31         var result = {};
    32         for (; i < arguments.length; i++) {
    33             var attributes = arguments[ i ];
    34             for (var key in attributes) {
    35                 result[key] = attributes[key];
     3// https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.js
     4// https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.js
     5
     6/*! js-cookie v3.0.5 | MIT */
     7;
     8(function (global, factory) {
     9    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
     10        typeof define === 'function' && define.amd ? define(factory) :
     11            (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
     12                var current = global.Cookies;
     13                var exports = global.Cookies = factory();
     14                exports.noConflict = function () { global.Cookies = current; return exports; };
     15            })());
     16})(this, (function () { 'use strict';
     17
     18    /* eslint-disable no-var */
     19    function assign (target) {
     20        for (var i = 1; i < arguments.length; i++) {
     21            var source = arguments[i];
     22            for (var key in source) {
     23                target[key] = source[key];
    3624            }
    3725        }
    38         return result;
     26        return target
    3927    }
     28    /* eslint-enable no-var */
    4029
    41     function decode (s) {
    42         return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
    43     }
     30    /* eslint-disable no-var */
     31    var defaultConverter = {
     32        read: function (value) {
     33            if (value[0] === '"') {
     34                value = value.slice(1, -1);
     35            }
     36            return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
     37        },
     38        write: function (value) {
     39            return encodeURIComponent(value).replace(
     40                /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
     41                decodeURIComponent
     42            )
     43        }
     44    };
     45    /* eslint-enable no-var */
    4446
    45     function init (converter) {
    46         function api() {}
     47    /* eslint-disable no-var */
    4748
    48         function set (key, value, attributes) {
     49    function init (converter, defaultAttributes) {
     50        function set (name, value, attributes) {
    4951            if (typeof document === 'undefined') {
    50                 return;
     52                return
    5153            }
    5254
    53             attributes = extend({
    54                 path: '/'
    55             }, api.defaults, attributes);
     55            attributes = assign({}, defaultAttributes, attributes);
    5656
    5757            if (typeof attributes.expires === 'number') {
    58                 attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
     58                attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
     59            }
     60            if (attributes.expires) {
     61                attributes.expires = attributes.expires.toUTCString();
    5962            }
    6063
    61             // We're using "expires" because "max-age" is not supported by IE
    62             attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
    63 
    64             try {
    65                 var result = JSON.stringify(value);
    66                 if (/^[\{\[]/.test(result)) {
    67                     value = result;
    68                 }
    69             } catch (e) {}
    70 
    71             value = converter.write ?
    72                 converter.write(value, key) :
    73                 encodeURIComponent(String(value))
    74                     .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
    75 
    76             key = encodeURIComponent(String(key))
    77                 .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
    78                 .replace(/[\(\)]/g, escape);
     64            name = encodeURIComponent(name)
     65                .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
     66                .replace(/[()]/g, escape);
    7967
    8068            var stringifiedAttributes = '';
    8169            for (var attributeName in attributes) {
    8270                if (!attributes[attributeName]) {
    83                     continue;
     71                    continue
    8472                }
     73
    8574                stringifiedAttributes += '; ' + attributeName;
     75
    8676                if (attributes[attributeName] === true) {
    87                     continue;
     77                    continue
    8878                }
    8979
     
    9888            }
    9989
    100             return (document.cookie = key + '=' + value + stringifiedAttributes);
     90            return (document.cookie =
     91                name + '=' + converter.write(value, name) + stringifiedAttributes)
    10192        }
    10293
    103         function get (key, json) {
    104             if (typeof document === 'undefined') {
    105                 return;
     94        function get (name) {
     95            if (typeof document === 'undefined' || (arguments.length && !name)) {
     96                return
    10697            }
    10798
    108             var jar = {};
    10999            // To prevent the for loop in the first place assign an empty array
    110100            // in case there are no cookies at all.
    111101            var cookies = document.cookie ? document.cookie.split('; ') : [];
    112             var i = 0;
    113 
    114             for (; i < cookies.length; i++) {
     102            var jar = {};
     103            for (var i = 0; i < cookies.length; i++) {
    115104                var parts = cookies[i].split('=');
    116                 var cookie = parts.slice(1).join('=');
    117 
    118                 if (!json && cookie.charAt(0) === '"') {
    119                     cookie = cookie.slice(1, -1);
    120                 }
     105                var value = parts.slice(1).join('=');
    121106
    122107                try {
    123                     var name = decode(parts[0]);
    124                     cookie = (converter.read || converter)(cookie, name) ||
    125                         decode(cookie);
     108                    var found = decodeURIComponent(parts[0]);
     109                    jar[found] = converter.read(value, found);
    126110
    127                     if (json) {
    128                         try {
    129                             cookie = JSON.parse(cookie);
    130                         } catch (e) {}
    131                     }
    132 
    133                     jar[name] = cookie;
    134 
    135                     if (key === name) {
    136                         break;
     111                    if (name === found) {
     112                        break
    137113                    }
    138114                } catch (e) {}
    139115            }
    140116
    141             return key ? jar[key] : jar;
     117            return name ? jar[name] : jar
    142118        }
    143119
    144         api.set = set;
    145         api.get = function (key) {
    146             return get(key, false /* read as raw */);
    147         };
    148         api.getJSON = function (key) {
    149             return get(key, true /* read as json */);
    150         };
    151         api.remove = function (key, attributes) {
    152             set(key, '', extend(attributes, {
    153                 expires: -1
    154             }));
    155         };
    156 
    157         api.defaults = {};
    158 
    159         api.withConverter = init;
    160 
    161         return api;
     120        return Object.create(
     121            {
     122                set,
     123                get,
     124                remove: function (name, attributes) {
     125                    set(
     126                        name,
     127                        '',
     128                        assign({}, attributes, {
     129                            expires: -1
     130                        })
     131                    );
     132                },
     133                withAttributes: function (attributes) {
     134                    return init(this.converter, assign({}, this.attributes, attributes))
     135                },
     136                withConverter: function (converter) {
     137                    return init(assign({}, this.converter, converter), this.attributes)
     138                }
     139            },
     140            {
     141                attributes: { value: Object.freeze(defaultAttributes) },
     142                converter: { value: Object.freeze(converter) }
     143            }
     144        )
    162145    }
    163146
    164     return init(function () {});
     147    var api = init(defaultConverter, { path: '/' });
     148    /* eslint-enable no-var */
     149
     150    return api;
     151
    165152}));
  • democracy-poll/tags/6.0.4/js/democracy.js

    r3056337 r3282901  
    1 
    21includefile = '_js-cookie.js'
    32
     3
    44// wait for jQuery
    5 let demwaitjquery = setInterval( function(){
    6 
    7     if( typeof jQuery !== 'undefined' ){
    8         clearInterval( demwaitjquery )
    9 
    10         jQuery( document ).ready( democracyInit )
    11     }
    12 }, 50 )
    13 
    14 function democracyInit( $ ){
     5document.addEventListener( 'DOMContentLoaded', democracyInit )
     6
     7function democracyInit(){
    158
    169    let demmainsel = '.democracy'
    17     let $dems = $( demmainsel )
    18 
    19     if( ! $dems.length )
     10    let $dems = jQuery( demmainsel )
     11
     12    if( ! $dems.length ){
    2013        return
    21 
    22     let demScreen = '.dem-screen' // селектор контейнера с результатами
    23     let userAnswer = '.dem-add-answer-txt' // класс поля free ответа
    24     let $demLoader = $( '.dem-loader:first' )
     14    }
     15
     16    let demScreen = '.dem-screen' // result container selector
     17    let userAnswer = '.dem-add-answer-txt' // "free" answer field class
     18    let $demLoader = jQuery( '.dem-loader:first' )
    2519    let loader
    2620    let Dem = {}
     
    3933        let demScreensSetHeight = function(){
    4034            $demScreens.each( function(){
    41                 Dem.setHeight( $( this ), 1 )
     35                Dem.setHeight( jQuery( this ), 1 )
    4236            } )
    4337        }
     
    4539        $demScreens.demInitActions( 1 )
    4640
    47         $( window ).on( 'resize.demsetheight', demScreensSetHeight ) // высота при ресайзе
    48 
    49         $( window ).on( 'load', demScreensSetHeight ) // высота еще раз
     41        jQuery( window ).on( 'resize.demsetheight', demScreensSetHeight ) // высота при ресайзе
     42
     43        jQuery( window ).on( 'load', demScreensSetHeight ) // высота еще раз
    5044
    5145        Dem.maxAnswLimitInit() // ограничение выбора мульти ответов
     
    5650         * и дополнительные js переменные и методы самого Democracy.
    5751         */
    58         var $cache = $( '.dem-cache-screens' )
     52        var $cache = jQuery( '.dem-cache-screens' )
    5953        if( $cache.length > 0 ){
    6054            //console.log('Democracy cache gear ON');
     
    6761    // Инициализация всех событий связаных с внутренней частью каждого опроса: клики, высота, скрытие кнопки
    6862    // применяется на '.dem-screen'
    69     $.fn.demInitActions = function( noanimation ){
     63    jQuery.fn.demInitActions = function( noanimation ){
    7064
    7165        return this.each( function(){
    7266            // Устанавливает события клика для всех помеченных элементов в переданом элементе:
    7367            // тут и AJAX запрос по клику и другие интерактивные события Democracy ----------
    74             var $this = $( this )
     68            var $this = jQuery( this )
    7569            var attr = 'data-dem-act'
    7670
    7771            $this.find( '[' + attr + ']' ).each( function(){
    78                 var $the = $( this )
     72                var $the = jQuery( this )
    7973                $the.attr( 'href', '' ) // удалим УРЛ чтобы не было видно УРЛ запроса
    8074
     
    9589            if( Dem.lineAnimSpeed ){
    9690                $this.find( '.dem-fill' ).each( function(){
    97                     var $fill = $( this )
     91                    var $fill = jQuery( this )
    9892                    //setTimeout(function(){ fill.style.width = was; }, Dem.animSpeed + 500); // на базе CSS transition - при сбросе тоже срабатывает и мешает...
    9993                    setTimeout( function(){
     
    111105                e.preventDefault()
    112106
    113                 var act = $( this ).find( 'input[name="dem_act"]' ).val()
     107                var act = jQuery( this ).find( 'input[name="dem_act"]' ).val()
    114108                if( act )
    115                     $( this ).demDoAction( $( this ).find( 'input[name="dem_act"]' ).val() )
     109                    jQuery( this ).demDoAction( jQuery( this ).find( 'input[name="dem_act"]' ).val() )
    116110            } )
    117111        } )
     
    119113
    120114    // Loader
    121     $.fn.demSetLoader = function(){
    122         var $the = this
    123 
    124         if( $demLoader.length )
     115    jQuery.fn.demSetLoader = function(){
     116        const $the = this
     117
     118        if( $demLoader.length ){
    125119            $the.closest( demScreen ).append( $demLoader.clone().css( 'display', 'table' ) )
    126         else
    127             loader = setTimeout( function(){
    128                 Dem.demLoadingDots( $the )
    129             }, 50 ) // dots
     120        }
     121        else {
     122            loader = setTimeout( () => Dem.demLoadingDots( $the[0] ), 50 )
     123        }
    130124
    131125        return this
    132126    }
    133127
    134     $.fn.demUnsetLoader = function(){
     128    jQuery.fn.demUnsetLoader = function(){
    135129
    136130        if( $demLoader.length )
     
    143137
    144138    // Добавить ответ пользователя (ссылка)
    145     $.fn.demAddAnswer = function(){
     139    jQuery.fn.demAddAnswer = function(){
    146140
    147141        var $the = this.first()
    148142        var $demScreen = $the.closest( demScreen )
    149143        var isMultiple = $demScreen.find( '[type=checkbox]' ).length > 0
    150         var $input = $( '<input type="text" class="' + userAnswer.replace( /\./, '' ) + '" value="">' ) // поле добавления ответа
     144        var $input = jQuery( '<input type="text" class="' + userAnswer.replace( /\./, '' ) + '" value="">' ) // поле добавления ответа
    151145
    152146        // покажем кнопку голосования
     
    156150        $demScreen.find( '[type=radio]' ).each( function(){
    157151
    158             $( this ).on( 'click', function(){
     152            jQuery( this ).on( 'click', function(){
    159153                $the.fadeIn( 300 )
    160                 $( userAnswer ).remove()
    161             } )
    162 
    163             if( 'radio' === $( this )[0].type )
     154                jQuery( userAnswer ).remove()
     155            } )
     156
     157            if( 'radio' === jQuery( this )[0].type )
    164158                this.checked = false // uncheck
    165159        } )
     
    173167            var $ua = $demScreen.find( userAnswer )
    174168
    175             $( '<span class="dem-add-answer-close">×</span>' )
     169            jQuery( '<span class="dem-add-answer-close">×</span>' )
    176170                .insertBefore( $ua )
    177171                .css( 'line-height', $ua.outerHeight() + 'px' )
    178172                .on( 'click', function(){
    179                     var $par = $( this ).parent( 'li' )
     173                    var $par = jQuery( this ).parent( 'li' )
    180174                    $par.find( 'input' ).remove()
    181175                    $par.find( 'a' ).fadeIn( 300 )
    182                     $( this ).remove()
     176                    jQuery( this ).remove()
    183177                } )
    184178        }
     
    188182
    189183    // Собирает ответы и возращает их в виде строки
    190     $.fn.demCollectAnsw = function(){
     184    jQuery.fn.demCollectAnsw = function(){
    191185        var $form = this.closest( 'form' )
    192186        var $answers = $form.find( '[type=checkbox],[type=radio],[type=text]' )
     
    198192        if( $checkbox.length > 0 ){
    199193            $checkbox.each( function(){
    200                 answ.push( $( this ).val() )
     194                answ.push( jQuery( this ).val() )
    201195            } )
    202196        }
     
    219213
    220214    // обрабатывает запросы при клике, вешается на событие клика
    221     $.fn.demDoAction = function( act ){
     215    jQuery.fn.demDoAction = function( action ){
    222216
    223217        var $the = this.first()
     
    225219        var data = {
    226220            dem_pid: $dem.data( 'opts' ).pid,
    227             dem_act: act,
     221            dem_act: action,
    228222            action : 'dem_ajax'
    229223        }
     
    235229
    236230        // Соберем ответы
    237         if( 'vote' === act ){
     231        if( 'vote' === action ){
    238232            data.answer_ids = $the.demCollectAnsw()
    239233            if( ! data.answer_ids ){
    240                 Dem.demShake( $the )
     234                Dem.demShake( $the[0] )
    241235                return false
    242236            }
     
    244238
    245239        // кнопка переголосовать, подтверждение
    246         if( 'delVoted' === act && !confirm( $the.data( 'confirm-text' ) ) )
     240        if( 'delVoted' === action && !confirm( $the.data( 'confirm-text' ) ) )
    247241            return false
    248242
    249243        // кнопка добавления ответа посетителя
    250         if( 'newAnswer' === act ){
     244        if( 'newAnswer' === action ){
    251245            $the.demAddAnswer()
    252246            return false
     
    255249        // AJAX
    256250        $the.demSetLoader()
    257         $.post( Dem.ajaxurl, data,
    258             function( respond ){
    259                 $the.demUnsetLoader()
    260 
    261                 // устанавливаем все события
    262                 $the.closest( demScreen ).html( respond ).demInitActions()
    263 
    264                 // прокрутим к началу блока опроса
    265                 setTimeout( function(){
    266                     $( 'html:first,body:first' ).animate( { scrollTop: $dem.offset().top - 70 }, 500 )
    267                 }, 200 )
    268             }
    269         )
     251        jQuery.post( Dem.ajaxurl, data, function( respond ){
     252            $the.demUnsetLoader()
     253
     254            // устанавливаем все события
     255            $the.closest( demScreen ).html( respond ).demInitActions()
     256
     257            // прокрутим к началу блока опроса
     258            setTimeout( function(){
     259                jQuery( 'html:first,body:first' ).animate( { scrollTop: $dem.offset().top - 70 }, 500 )
     260            }, 200 )
     261        } )
    270262
    271263        return false
     
    276268
    277269    // показывает заметку
    278     $.fn.demCacheShowNotice = function( type ){
     270    jQuery.fn.demCacheShowNotice = function( type ){
    279271
    280272        var $the = this.first(),
     
    307299                votedtxt = $dema.data( 'voted-txt' )
    308300
    309             $.each( aids, function( key, val ){
     301            jQuery.each( aids, function( key, val ){
    310302                $screen.find( '[data-aid="' + val + '"]' )
    311303                    .addClass( votedClass )
    312304                    .attr( 'title', function(){
    313                         return votedtxt + $( this ).attr( 'title' )
     305                        return votedtxt + jQuery( this ).attr( 'title' )
    314306                    } )
    315307            } )
     
    325317
    326318            // устанавливаем ответы
    327             $.each( aids, function( key, val ){
     319            jQuery.each( aids, function( key, val ){
    328320                $answs.filter( '[data-aid="' + val + '"]' ).find( 'input' ).prop( 'checked', 'checked' )
    329321            } )
     
    350342    }
    351343
    352     $.fn.demCacheInit = function(){
     344    jQuery.fn.demCacheInit = function(){
    353345
    354346        return this.each( function(){
    355347
    356             var $the = $( this )
     348            var $the = jQuery( this )
    357349
    358350            // ищем главный блок
    359351            var $dem = $the.prevAll( demmainsel + ':first' )
    360             if( !$dem.length )
     352            if( ! $dem.length )
    361353                $dem = $the.closest( demmainsel )
    362354
    363             if( !$dem.length ){
     355            if( ! $dem.length ){
    364356                console.warn( 'Democracy: Main dem div not found' )
    365357                return
     
    377369
    378370            // если опрос закрыт должны кэшироваться только результаты голосования. Просто выходим.
    379             if( !voteHTML )
     371            if( ! voteHTML ){
    380372                return
     373            }
    381374
    382375            // устанавливаем нужный кэш
     
    392385            $screen.demInitActions( 1 )
    393386
    394             if( notVoteFlag )
    395                 return // если уже проверялось, что пользователь не голосовал, выходим
    396 
    397             // Если голосов нет в куках и опция плагина keep_logs включена,
    398             // отправляем запрос в БД на проверку, по событию (наведение мышки на блок),
    399             if( !isAnswrs && $the.data( 'opt_logs' ) == 1 ){
     387            if( notVoteFlag ){
     388                return; // exit if it has already been checked that the user has not voted.
     389            }
     390
     391            // If there are no votes in cookies and the plugin option keep_logs is enabled,
     392            // send a request to the database for checking, by event (mouse over a block).
     393            if( ! isAnswrs && $the.data( 'opt_logs' ) == 1 ){
    400394                var tmout
    401395                var notcheck__fn = function(){
     
    413407                        $forDotsLoader.demSetLoader()
    414408
    415                         $.post( Dem.ajaxurl,
     409                        jQuery.post( Dem.ajaxurl,
    416410                            {
    417411                                dem_pid: $dem.data( 'opts' ).pid,
     
    421415                            function( reply ){
    422416                                $forDotsLoader.demUnsetLoader()
    423                                 if( !reply ) return // выходим если нет ответов
     417                                // exit if there are no answers
     418                                if( ! reply ){
     419                                    return;
     420                                }
    424421
    425422                                $screen.html( votedHTML )
     
    428425                                $screen.demInitActions()
    429426
    430                                 // сообщение, что голосовал или только для пользователей
     427                                // a message that you have voted or for users only
    431428                                $screen.demCacheShowNotice( reply )
    432429                            }
    433430                        )
    434431                    }, 700 )
    435                     // 700 для оптимизации, чтобы моментально не отправлялся запрос, если мышкой просто провели по опросу...
     432                    // 700 for optimization, so that the request is not sent instantly if you just swipe the mouse on the survey...
    436433                }
    437434
     
    471468            $that.css( { opacity: 0 } )
    472469                .animate( { height: newH }, Dem.animSpeed, function(){
    473                     $( this ).animate( { opacity: 1 }, Dem.animSpeed * 1.5 )
     470                    jQuery( this ).animate( { opacity: 1 }, Dem.animSpeed * 1.5 )
    474471                } )
    475472        }
     
    496493            $el.css( 'position', 'relative' )
    497494
    498             var $overlay = $( '<span class="dem__collapser"><span class="arr"></span></span>' ).appendTo( $el )
     495            var $overlay = jQuery( '<span class="dem__collapser"><span class="arr"></span></span>' ).appendTo( $el )
    499496            var fn__expand = function(){
    500497                $overlay.addClass( 'expanded' ).removeClass( 'collapsed' )
     
    565562        $dems.on( 'change', 'input[type="checkbox"]', function(){
    566563
    567             var maxAnsws = $( this ).closest( demmainsel ).data( 'opts' ).max_answs
    568             var $checkboxs = $( this ).closest( demScreen ).find( 'input[type="checkbox"]' )
     564            var maxAnsws = jQuery( this ).closest( demmainsel ).data( 'opts' ).max_answs
     565            var $checkboxs = jQuery( this ).closest( demScreen ).find( 'input[type="checkbox"]' )
    569566            var $checked = $checkboxs.filter( ':checked' ).length
    570567
    571568            if( $checked >= maxAnsws ){
    572569                $checkboxs.filter( ':not(:checked)' ).each( function(){
    573                     $( this ).prop( 'disabled', true ).closest( 'li' ).addClass( 'dem-disabled' )
     570                    jQuery( this ).prop( 'disabled', true ).closest( 'li' ).addClass( 'dem-disabled' )
    574571                } )
    575572            }
    576573            else {
    577574                $checkboxs.each( function(){
    578                     $( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )
     575                    jQuery( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )
    579576                } )
    580577            }
     
    582579    }
    583580
    584     Dem.demShake = function( $that ){
    585 
    586         var pos = $that.css( 'position' )
    587 
    588         pos && 'static' !== pos || $that.css( 'position', 'relative' )
    589 
    590         for( pos = 1; 2 >= pos; pos++ )
    591             $that.animate( { left: -10 }, 50 ).animate( { left: 10 }, 100 ).animate( { left: 0 }, 50 )
    592     }
    593 
    594     // dots loading animation - ...
    595     Dem.demLoadingDots = function( $el ){
    596         var $the = $el,
    597             isInput = $the.is( 'input' ),
    598             str = (isInput) ? $the.val() : $the.html()
    599 
    600         if( str.substring( str.length - 3 ) === '...' ){
    601             if( isInput )
    602                 $the[0].value = str.substring( 0, str.length - 3 )
    603             else
    604                 $the[0].innerHTML = str.substring( 0, str.length - 3 )
    605         }
    606         else {
    607             if( isInput )
    608                 $the[0].value += '.'
    609             else
    610                 $the[0].innerHTML += '.'
    611         }
    612 
    613         loader = setTimeout( function(){
    614             Dem.demLoadingDots( $the )
    615         }, 200 )
     581    Dem.demShake = function( el ){
     582        const position = window.getComputedStyle( el ).position
     583        if( ! position || position === 'static' ){
     584            el.style.position = 'relative'
     585        }
     586
     587        const keyframes = [
     588            { left: '0px' },
     589            { left: '-10px', offset: 0.2 },
     590            { left: '10px', offset: 0.40 },
     591            { left: '-10px', offset: 0.60 },
     592            { left: '10px', offset: 0.80 },
     593            { left: '0px', offset: 1 }
     594        ]
     595        const timing = { duration: 500, iterations: 1, easing: 'linear' }
     596        el.animate( keyframes, timing )
     597    }
     598
     599    // dots loading animation: ...
     600    Dem.demLoadingDots = function( el ){
     601        let isInput = (el.tagName.toLowerCase() === 'input')
     602        let str = isInput ? el.value : el.innerHTML
     603
     604        if( str.slice( -3 ) === '...' ){
     605            el[isInput ? 'value' : 'innerHTML'] = str.slice( 0, -3 )
     606        }
     607        else{
     608            el[isInput ? 'value' : 'innerHTML'] += '.'
     609        }
     610
     611        loader = setTimeout( () => Dem.demLoadingDots( el ), 200 )
    616612    }
    617613
    618614}
    619 
    620 
    621 
    622 
    623 
  • democracy-poll/tags/6.0.4/js/democracy.min.js

    r3056337 r3282901  
    1 /*!
    2  * JavaScript Cookie v2.2.0
    3  * https://github.com/js-cookie/js-cookie
    4  *
    5  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
    6  * Released under the MIT license
    7  */
    8 !function(e){var t;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,i=window.Cookies=e();i.noConflict=function(){return window.Cookies=n,i}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function o(){}function a(t,n,a){if("undefined"!=typeof document){"number"==typeof(a=e({path:"/"},o.defaults,a)).expires&&(a.expires=new Date(1*new Date+864e5*a.expires)),a.expires=a.expires?a.expires.toUTCString():"";try{var s=JSON.stringify(n);/^[\{\[]/.test(s)&&(n=s)}catch(e){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var d="";for(var r in a)a[r]&&(d+="; "+r,!0!==a[r]&&(d+="="+a[r].split(";")[0]));return document.cookie=t+"="+n+d}}function s(e,n){if("undefined"!=typeof document){for(var o={},a=document.cookie?document.cookie.split("; "):[],s=0;s<a.length;s++){var d=a[s].split("="),r=d.slice(1).join("=");n||'"'!==r.charAt(0)||(r=r.slice(1,-1));try{var c=t(d[0]);if(r=(i.read||i)(r,c)||t(r),n)try{r=JSON.parse(r)}catch(e){}if(o[c]=r,e===c)break}catch(e){}}return e?o[e]:o}}return o.set=a,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,n){a(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}));var demwaitjquery=setInterval((function(){"undefined"!=typeof jQuery&&(clearInterval(demwaitjquery),jQuery(document).ready(democracyInit))}),50);function democracyInit(e){var t=".democracy",n=e(t);if(n.length){var i,o=".dem-screen",a=".dem-add-answer-txt",s=e(".dem-loader:first"),d={};d.opts=n.first().data("opts"),d.ajaxurl=d.opts.ajax_url,d.answMaxHeight=d.opts.answs_max_height,d.animSpeed=parseInt(d.opts.anim_speed),d.lineAnimSpeed=parseInt(d.opts.line_anim_speed),setTimeout((function(){var t=n.find(o).filter(":visible"),i=function(){t.each((function(){d.setHeight(e(this),1)}))};t.demInitActions(1),e(window).on("resize.demsetheight",i),e(window).on("load",i),d.maxAnswLimitInit();var a=e(".dem-cache-screens");a.length>0&&a.demCacheInit()}),1),e.fn.demInitActions=function(t){return this.each((function(){var n=e(this),i="data-dem-act";n.find("["+i+"]").each((function(){var t=e(this);t.attr("href",""),t.on("click",(function(e){e.preventDefault(),t.blur().demDoAction(t.attr(i))}))})),!!n.find("input[type=radio][data-dem-act=vote]").first().length&&n.find(".dem-vote-button").hide(),d.setAnswsMaxHeight(n),d.lineAnimSpeed&&n.find(".dem-fill").each((function(){var t=e(this);setTimeout((function(){t.animate({width:t.data("width")},d.lineAnimSpeed)}),d.animSpeed,"linear")})),d.setHeight(n,t),n.find("form").on("submit",(function(t){t.preventDefault(),e(this).find('input[name="dem_act"]').val()&&e(this).demDoAction(e(this).find('input[name="dem_act"]').val())}))}))},e.fn.demSetLoader=function(){var e=this;return s.length?e.closest(o).append(s.clone().css("display","table")):i=setTimeout((function(){d.demLoadingDots(e)}),50),this},e.fn.demUnsetLoader=function(){return s.length?this.closest(o).find(".dem-loader").remove():clearTimeout(i),this},e.fn.demAddAnswer=function(){var t=this.first(),n=t.closest(o),i=n.find("[type=checkbox]").length>0,s=e('<input type="text" class="'+a.replace(/\./,"")+'" value="">');if(n.find(".dem-vote-button").show(),n.find("[type=radio]").each((function(){e(this).on("click",(function(){t.fadeIn(300),e(a).remove()})),"radio"===e(this)[0].type&&(this.checked=!1)})),t.hide().parent("li").append(s),s.hide().fadeIn(300).focus(),i){var d=n.find(a);e('<span class="dem-add-answer-close">×</span>').insertBefore(d).css("line-height",d.outerHeight()+"px").on("click",(function(){var t=e(this).parent("li");t.find("input").remove(),t.find("a").fadeIn(300),e(this).remove()}))}return!1},e.fn.demCollectAnsw=function(){var t=this.closest("form"),n=t.find("[type=checkbox],[type=radio],[type=text]"),i=t.find(a).val(),o=[],s=n.filter("[type=checkbox]:checked");if(s.length>0)s.each((function(){o.push(e(this).val())}));else{var d=n.filter("[type=radio]:checked");d.length&&o.push(d.val())}return i&&o.push(i),(o=o.join("~"))||""},e.fn.demDoAction=function(n){var i=this.first(),a=i.closest(t),s={dem_pid:a.data("opts").pid,dem_act:n,action:"dem_ajax"};return void 0===s.dem_pid?(console.log("Poll id is not defined!"),!1):"vote"!==n||(s.answer_ids=i.demCollectAnsw(),s.answer_ids)?!("delVoted"===n&&!confirm(i.data("confirm-text")))&&("newAnswer"===n?(i.demAddAnswer(),!1):(i.demSetLoader(),e.post(d.ajaxurl,s,(function(t){i.demUnsetLoader(),i.closest(o).html(t).demInitActions(),setTimeout((function(){e("html:first,body:first").animate({scrollTop:a.offset().top-70},500)}),200)})),!1)):(d.demShake(i),!1)},e.fn.demCacheShowNotice=function(e){var t=this.first(),n=t.find(".dem-youarevote").first();return"blockForVisitor"===e&&(t.find(".dem-revote-button").remove(),n=t.find(".dem-only-users").first()),t.prepend(n.show()),setTimeout((function(){n.slideUp("slow")}),1e4),this},d.cacheSetAnswrs=function(t,n){var i=n.split(/,/);if(t.hasClass("voted")){var o=t.find(".dem-answers"),a=o.data("voted-class"),s=o.data("voted-txt");e.each(i,(function(n,i){t.find('[data-aid="'+i+'"]').addClass(a).attr("title",(function(){return s+e(this).attr("title")}))})),t.find(".dem-vote-link").remove()}else{var d=t.find("[data-aid]"),r=t.find(".dem-voted-button");e.each(i,(function(e,t){d.filter('[data-aid="'+t+'"]').find("input").prop("checked","checked")})),d.find("input").prop("disabled","disabled"),t.find(".dem-vote-button").remove(),r.length?r.show():(t.find('input[value="vote"]').remove(),t.find(".dem-revote-button-wrap").show())}},e.fn.demCacheInit=function(){return this.each((function(){var n=e(this),i=n.prevAll(t+":first");if(i.length||(i=n.closest(t)),i.length){var a=i.find(o).first(),s=i.data("opts").pid,r=Cookies.get("demPoll_"+s),c="notVote"===r,f=!(void 0===r||c),l=n.find(o+"-cache.vote").html(),h=n.find(o+"-cache.voted").html();if(l){var u=f&&h;if(a.html((u?h:l)+"\x3c!--cache--\x3e").removeClass("vote voted").addClass(u?"voted":"vote"),f&&d.cacheSetAnswrs(a,r),a.demInitActions(1),!c&&!f&&1==n.data("opt_logs")){var m,p=function(){m=setTimeout((function(){if(!i.hasClass("checkAnswDone")){i.addClass("checkAnswDone");var t=i.find(".dem-link").first();t.demSetLoader(),e.post(d.ajaxurl,{dem_pid:i.data("opts").pid,dem_act:"getVotedIds",action:"dem_ajax"},(function(e){t.demUnsetLoader(),e&&(a.html(h),d.cacheSetAnswrs(a,e),a.demInitActions(),a.demCacheShowNotice(e))}))}}),700)};i.on("mouseenter",p).on("mouseleave",(function(){clearTimeout(m)})),i.on("click",p)}}}else console.warn("Democracy: Main dem div not found")}))},d.detectRealHeight=function(e){var t=e.clone().css({height:"auto"}).insertBefore(e),n="border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height();return t.remove(),n},d.setHeight=function(t,n){var i=d.detectRealHeight(t);n?t.css({height:i}):t.css({opacity:0}).animate({height:i},d.animSpeed,(function(){e(this).animate({opacity:1},1.5*d.animSpeed)}))},d.setAnswsMaxHeight=function(t){if("-1"!==d.answMaxHeight&&"0"!==d.answMaxHeight&&d.answMaxHeight){var n=t.find(".dem-vote, .dem-answers").first(),i=parseInt(d.answMaxHeight);if(n.css({"max-height":"none","overflow-y":"visible"}),("border-box"===n.css("box-sizing")?parseInt(n.css("height")):n.height())-i>100){n.css("position","relative");var o,a=e('<span class="dem__collapser"><span class="arr"></span></span>').appendTo(n),s=function(){a.addClass("expanded").removeClass("collapsed")},r=function(){a.addClass("collapsed").removeClass("expanded")};t.data("expanded")?s():(r(),n.height(i).css("overflow-y","hidden")),a.on("mouseenter",(function(){t.data("expanded")||(o=setTimeout((function(){a.trigger("click")}),1e3))})).on("mouseleave",(function(){clearTimeout(o)})),a.on("click",(function(){if(clearTimeout(o),t.data("expanded"))r(),t.data("expanded",!1),t.height("auto"),n.stop().css("overflow-y","hidden").animate({height:i},d.animSpeed,(function(){d.setHeight(t,!0)}));else{s();var e=d.detectRealHeight(n);e+=7,t.data("expanded",!0),t.height("auto"),n.stop().animate({height:e},d.animSpeed,(function(){d.setHeight(t,!0),n.css("overflow-y","visible")}))}}))}}},d.maxAnswLimitInit=function(){n.on("change",'input[type="checkbox"]',(function(){var n=e(this).closest(t).data("opts").max_answs,i=e(this).closest(o).find('input[type="checkbox"]');i.filter(":checked").length>=n?i.filter(":not(:checked)").each((function(){e(this).prop("disabled",!0).closest("li").addClass("dem-disabled")})):i.each((function(){e(this).prop("disabled",!1).closest("li").removeClass("dem-disabled")}))}))},d.demShake=function(e){var t=e.css("position");for(t&&"static"!==t||e.css("position","relative"),t=1;2>=t;t++)e.animate({left:-10},50).animate({left:10},100).animate({left:0},50)},d.demLoadingDots=function(e){var t=e,n=t.is("input"),o=n?t.val():t.html();"..."===o.substring(o.length-3)?n?t[0].value=o.substring(0,o.length-3):t[0].innerHTML=o.substring(0,o.length-3):n?t[0].value+=".":t[0].innerHTML+=".",i=setTimeout((function(){d.demLoadingDots(t)}),200)}}}
     1/*! js-cookie v3.0.5 | MIT */
     2function democracyInit(){var e=".democracy",t=jQuery(e);if(t.length){var n,i=".dem-screen",o=".dem-add-answer-txt",a=jQuery(".dem-loader:first"),s={};s.opts=t.first().data("opts"),s.ajaxurl=s.opts.ajax_url,s.answMaxHeight=s.opts.answs_max_height,s.animSpeed=parseInt(s.opts.anim_speed),s.lineAnimSpeed=parseInt(s.opts.line_anim_speed),setTimeout((function(){var e=t.find(i).filter(":visible"),n=function(){e.each((function(){s.setHeight(jQuery(this),1)}))};e.demInitActions(1),jQuery(window).on("resize.demsetheight",n),jQuery(window).on("load",n),s.maxAnswLimitInit();var o=jQuery(".dem-cache-screens");o.length>0&&o.demCacheInit()}),1),jQuery.fn.demInitActions=function(e){return this.each((function(){var t=jQuery(this),n="data-dem-act";t.find("["+n+"]").each((function(){var e=jQuery(this);e.attr("href",""),e.on("click",(function(t){t.preventDefault(),e.blur().demDoAction(e.attr(n))}))})),!!t.find("input[type=radio][data-dem-act=vote]").first().length&&t.find(".dem-vote-button").hide(),s.setAnswsMaxHeight(t),s.lineAnimSpeed&&t.find(".dem-fill").each((function(){var e=jQuery(this);setTimeout((function(){e.animate({width:e.data("width")},s.lineAnimSpeed)}),s.animSpeed,"linear")})),s.setHeight(t,e),t.find("form").on("submit",(function(e){e.preventDefault(),jQuery(this).find('input[name="dem_act"]').val()&&jQuery(this).demDoAction(jQuery(this).find('input[name="dem_act"]').val())}))}))},jQuery.fn.demSetLoader=function(){var e=this;return a.length?e.closest(i).append(a.clone().css("display","table")):n=setTimeout((function(){return s.demLoadingDots(e[0])}),50),this},jQuery.fn.demUnsetLoader=function(){return a.length?this.closest(i).find(".dem-loader").remove():clearTimeout(n),this},jQuery.fn.demAddAnswer=function(){var e=this.first(),t=e.closest(i),n=t.find("[type=checkbox]").length>0,a=jQuery('<input type="text" class="'+o.replace(/\./,"")+'" value="">');if(t.find(".dem-vote-button").show(),t.find("[type=radio]").each((function(){jQuery(this).on("click",(function(){e.fadeIn(300),jQuery(o).remove()})),"radio"===jQuery(this)[0].type&&(this.checked=!1)})),e.hide().parent("li").append(a),a.hide().fadeIn(300).focus(),n){var s=t.find(o);jQuery('<span class="dem-add-answer-close">×</span>').insertBefore(s).css("line-height",s.outerHeight()+"px").on("click",(function(){var e=jQuery(this).parent("li");e.find("input").remove(),e.find("a").fadeIn(300),jQuery(this).remove()}))}return!1},jQuery.fn.demCollectAnsw=function(){var e=this.closest("form"),t=e.find("[type=checkbox],[type=radio],[type=text]"),n=e.find(o).val(),i=[],a=t.filter("[type=checkbox]:checked");if(a.length>0)a.each((function(){i.push(jQuery(this).val())}));else{var s=t.filter("[type=radio]:checked");s.length&&i.push(s.val())}return n&&i.push(n),(i=i.join("~"))||""},jQuery.fn.demDoAction=function(t){var n=this.first(),o=n.closest(e),a={dem_pid:o.data("opts").pid,dem_act:t,action:"dem_ajax"};return void 0===a.dem_pid?(console.log("Poll id is not defined!"),!1):"vote"!==t||(a.answer_ids=n.demCollectAnsw(),a.answer_ids)?!("delVoted"===t&&!confirm(n.data("confirm-text")))&&("newAnswer"===t?(n.demAddAnswer(),!1):(n.demSetLoader(),jQuery.post(s.ajaxurl,a,(function(e){n.demUnsetLoader(),n.closest(i).html(e).demInitActions(),setTimeout((function(){jQuery("html:first,body:first").animate({scrollTop:o.offset().top-70},500)}),200)})),!1)):(s.demShake(n[0]),!1)},jQuery.fn.demCacheShowNotice=function(e){var t=this.first(),n=t.find(".dem-youarevote").first();return"blockForVisitor"===e&&(t.find(".dem-revote-button").remove(),n=t.find(".dem-only-users").first()),t.prepend(n.show()),setTimeout((function(){n.slideUp("slow")}),1e4),this},s.cacheSetAnswrs=function(e,t){var n=t.split(/,/);if(e.hasClass("voted")){var i=e.find(".dem-answers"),o=i.data("voted-class"),a=i.data("voted-txt");jQuery.each(n,(function(t,n){e.find('[data-aid="'+n+'"]').addClass(o).attr("title",(function(){return a+jQuery(this).attr("title")}))})),e.find(".dem-vote-link").remove()}else{var s=e.find("[data-aid]"),r=e.find(".dem-voted-button");jQuery.each(n,(function(e,t){s.filter('[data-aid="'+t+'"]').find("input").prop("checked","checked")})),s.find("input").prop("disabled","disabled"),e.find(".dem-vote-button").remove(),r.length?r.show():(e.find('input[value="vote"]').remove(),e.find(".dem-revote-button-wrap").show())}},jQuery.fn.demCacheInit=function(){return this.each((function(){var t=jQuery(this),n=t.prevAll(e+":first");if(n.length||(n=t.closest(e)),n.length){var o=n.find(i).first(),a=n.data("opts").pid,r=Cookies.get("demPoll_"+a),d="notVote"===r,c=!(void 0===r||d),u=t.find(i+"-cache.vote").html(),f=t.find(i+"-cache.voted").html();if(u){var l=c&&f;if(o.html((l?f:u)+"\x3c!--cache--\x3e").removeClass("vote voted").addClass(l?"voted":"vote"),c&&s.cacheSetAnswrs(o,r),o.demInitActions(1),!d&&!c&&1==t.data("opt_logs")){var h,m=function(){h=setTimeout((function(){if(!n.hasClass("checkAnswDone")){n.addClass("checkAnswDone");var e=n.find(".dem-link").first();e.demSetLoader(),jQuery.post(s.ajaxurl,{dem_pid:n.data("opts").pid,dem_act:"getVotedIds",action:"dem_ajax"},(function(t){e.demUnsetLoader(),t&&(o.html(f),s.cacheSetAnswrs(o,t),o.demInitActions(),o.demCacheShowNotice(t))}))}}),700)};n.on("mouseenter",m).on("mouseleave",(function(){clearTimeout(h)})),n.on("click",m)}}}else console.warn("Democracy: Main dem div not found")}))},s.detectRealHeight=function(e){var t=e.clone().css({height:"auto"}).insertBefore(e),n="border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height();return t.remove(),n},s.setHeight=function(e,t){var n=s.detectRealHeight(e);t?e.css({height:n}):e.css({opacity:0}).animate({height:n},s.animSpeed,(function(){jQuery(this).animate({opacity:1},1.5*s.animSpeed)}))},s.setAnswsMaxHeight=function(e){if("-1"!==s.answMaxHeight&&"0"!==s.answMaxHeight&&s.answMaxHeight){var t=e.find(".dem-vote, .dem-answers").first(),n=parseInt(s.answMaxHeight);if(t.css({"max-height":"none","overflow-y":"visible"}),("border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height())-n>100){t.css("position","relative");var i,o=jQuery('<span class="dem__collapser"><span class="arr"></span></span>').appendTo(t),a=function(){o.addClass("expanded").removeClass("collapsed")},r=function(){o.addClass("collapsed").removeClass("expanded")};e.data("expanded")?a():(r(),t.height(n).css("overflow-y","hidden")),o.on("mouseenter",(function(){e.data("expanded")||(i=setTimeout((function(){o.trigger("click")}),1e3))})).on("mouseleave",(function(){clearTimeout(i)})),o.on("click",(function(){if(clearTimeout(i),e.data("expanded"))r(),e.data("expanded",!1),e.height("auto"),t.stop().css("overflow-y","hidden").animate({height:n},s.animSpeed,(function(){s.setHeight(e,!0)}));else{a();var o=s.detectRealHeight(t);o+=7,e.data("expanded",!0),e.height("auto"),t.stop().animate({height:o},s.animSpeed,(function(){s.setHeight(e,!0),t.css("overflow-y","visible")}))}}))}}},s.maxAnswLimitInit=function(){t.on("change",'input[type="checkbox"]',(function(){var t=jQuery(this).closest(e).data("opts").max_answs,n=jQuery(this).closest(i).find('input[type="checkbox"]');n.filter(":checked").length>=t?n.filter(":not(:checked)").each((function(){jQuery(this).prop("disabled",!0).closest("li").addClass("dem-disabled")})):n.each((function(){jQuery(this).prop("disabled",!1).closest("li").removeClass("dem-disabled")}))}))},s.demShake=function(e){var t=window.getComputedStyle(e).position;t&&"static"!==t||(e.style.position="relative");e.animate([{left:"0px"},{left:"-10px",offset:.2},{left:"10px",offset:.4},{left:"-10px",offset:.6},{left:"10px",offset:.8},{left:"0px",offset:1}],{duration:500,iterations:1,easing:"linear"})},s.demLoadingDots=function(e){var t="input"===e.tagName.toLowerCase(),i=t?e.value:e.innerHTML;"..."===i.slice(-3)?e[t?"value":"innerHTML"]=i.slice(0,-3):e[t?"value":"innerHTML"]+=".",n=setTimeout((function(){return s.demLoadingDots(e)}),200)}}}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,i=e.Cookies=t();i.noConflict=function(){return e.Cookies=n,i}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}var t=function t(n,i){function o(t,o,a){if("undefined"!=typeof document){"number"==typeof(a=e({},i,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var r in a)a[r]&&(s+="; "+r,!0!==a[r]&&(s+="="+a[r].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},o=0;o<t.length;o++){var a=t[o].split("="),s=a.slice(1).join("=");try{var r=decodeURIComponent(a[0]);if(i[r]=n.read(s,r),e===r)break}catch(e){}}return e?i[e]:i}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t})),document.addEventListener("DOMContentLoaded",democracyInit);
  • democracy-poll/tags/6.0.4/languages/democracy-poll.pot

    r3056337 r3282901  
    33msgstr ""
    44"Project-Id-Version: Democracy\n"
    5 "POT-Creation-Date: 2024-03-22 00:55+0500\n"
     5"POT-Creation-Date: 2024-12-15 19:16+0500\n"
    66"PO-Revision-Date: 2017-03-12 15:02+0500\n"
    77"Last-Translator: \n"
     
    1313"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
    1414"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
    15 "X-Generator: Poedit 3.4.2\n"
     15"X-Generator: Poedit 3.5\n"
    1616"X-Poedit-Basepath: ..\n"
    1717"X-Poedit-SourceCharset: UTF-8\n"
     
    2020
    2121#: classes/Admin/Admin.php:42 classes/Admin/Admin_Page.php:205
    22 #: classes/Plugin.php:154
     22#: classes/Plugin.php:158
    2323msgid "Settings"
    2424msgstr ""
     
    3232msgstr ""
    3333
    34 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:151
     34#: classes/Admin/Admin_Page.php:191 classes/Plugin.php:155
    3535msgid "Polls List"
    3636msgstr ""
     
    4141
    4242#: classes/Admin/Admin_Page.php:199 classes/Admin/List_Table_Polls.php:136
    43 #: classes/Plugin.php:153
     43#: classes/Plugin.php:157
    4444msgid "Logs"
    4545msgstr ""
    4646
    47 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:155
     47#: classes/Admin/Admin_Page.php:210 classes/Plugin.php:159
    4848msgid "Theme Settings"
    4949msgstr ""
    5050
    51 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:156
     51#: classes/Admin/Admin_Page.php:215 classes/Plugin.php:160
    5252msgid "Texts changes"
    5353msgstr ""
     
    5757msgstr ""
    5858
    59 #: classes/Admin/Admin_Page_Design.php:508
     59#: classes/Admin/Admin_Page_Design.php:51
     60#: classes/Admin/Admin_Page_Settings.php:35
     61#: classes/Admin/Admin_Page_l10n.php:39
     62msgid "Updated"
     63msgstr ""
     64
     65#: classes/Admin/Admin_Page_Design.php:52
     66#: classes/Admin/Admin_Page_Settings.php:36
     67#: classes/Admin/Admin_Page_l10n.php:40
     68msgid "Nothing was updated"
     69msgstr ""
     70
     71#: classes/Admin/Admin_Page_Design.php:515
    6072msgid "Results view:"
    6173msgstr ""
    6274
    63 #: classes/Admin/Admin_Page_Design.php:510
     75#: classes/Admin/Admin_Page_Design.php:517
    6476msgid "Vote view:"
    6577msgstr ""
    6678
    67 #: classes/Admin/Admin_Page_Design.php:512
     79#: classes/Admin/Admin_Page_Design.php:519
    6880msgid "AJAX loader view:"
    6981msgstr ""
     
    114126msgstr ""
    115127
    116 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:152
     128#: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:156
    117129msgid "Add Poll"
    118130msgstr ""
     
    243255msgstr ""
    244256
    245 #: classes/Admin/Admin_Page_Settings.php:80
     257#: classes/Admin/Admin_Page_Settings.php:87
    246258msgid ""
    247259"Example: <code>&lt;h2&gt;</code> и <code>&lt;/h2&gt;</code>. Default: "
     
    250262msgstr ""
    251263
    252 #: classes/Admin/Admin_Page_Settings.php:92
     264#: classes/Admin/Admin_Page_Settings.php:99
    253265msgid "Go to archive page"
    254266msgstr ""
    255267
    256 #: classes/Admin/Admin_Page_Settings.php:98
     268#: classes/Admin/Admin_Page_Settings.php:105
    257269msgid "Create/find archive page"
    258270msgstr ""
    259271
    260 #: classes/Admin/Admin_Page_Settings.php:102
     272#: classes/Admin/Admin_Page_Settings.php:109
    261273msgid ""
    262274"Specify the poll archive link to be in the poll legend. Example: <code>25</"
     
    264276msgstr ""
    265277
    266 #: classes/Admin/Admin_Page_Settings.php:186
     278#: classes/Admin/Admin_Page_Settings.php:193
    267279msgid "ON"
    268280msgstr ""
    269281
    270 #: classes/Admin/Admin_Page_Settings.php:187
     282#: classes/Admin/Admin_Page_Settings.php:194
    271283msgid "OFF"
    272284msgstr ""
    273285
    274 #: classes/Admin/Admin_Page_Settings.php:189
     286#: classes/Admin/Admin_Page_Settings.php:196
    275287#, php-format
    276288msgid "Force enable gear to working with cache plugins. The condition: %s"
    277289msgstr ""
    278290
    279 #: classes/Admin/Admin_Page_Settings.php:260
     291#: classes/Admin/Admin_Page_Settings.php:267
    280292msgid ""
    281293"Role names, except 'administrator' which will have access to manage plugin."
    282294msgstr ""
    283295
    284 #: classes/Admin/Admin_Page_Settings.php:356
     296#: classes/Admin/Admin_Page_Settings.php:363
    285297msgid "Polls Archive"
    286 msgstr ""
    287 
    288 #: classes/Admin/Admin_Page_l10n.php:39 classes/Options.php:235
    289 msgid "Updated"
    290 msgstr ""
    291 
    292 #: classes/Admin/Admin_Page_l10n.php:40 classes/Options.php:236
    293 msgid "Nothing was updated"
    294298msgstr ""
    295299
     
    310314msgstr ""
    311315
    312 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:64
     316#: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:66
    313317msgid "Poll"
    314318msgstr ""
     
    343347
    344348#: classes/Admin/List_Table_Logs.php:185 classes/Admin/List_Table_Logs.php:271
    345 #: classes/DemPoll.php:203
     349#: classes/DemPoll.php:205
    346350msgid "Edit poll"
    347351msgstr ""
     
    436440msgstr ""
    437441
    438 #: classes/DemPoll.php:208
     442#: classes/DemPoll.php:210
    439443msgid "Download the Democracy Poll"
    440444msgstr ""
    441445
    442 #: classes/DemPoll.php:333
     446#: classes/DemPoll.php:335
    443447msgctxt "front"
    444448msgid "Add your answer"
    445449msgstr ""
    446450
    447 #: classes/DemPoll.php:341
     451#: classes/DemPoll.php:343
    448452msgctxt "front"
    449453msgid "Already voted..."
    450454msgstr ""
    451455
    452 #: classes/DemPoll.php:342 classes/DemPoll.php:502
     456#: classes/DemPoll.php:344 classes/DemPoll.php:504
    453457msgctxt "front"
    454458msgid "Vote"
    455459msgstr ""
    456460
    457 #: classes/DemPoll.php:384
     461#: classes/DemPoll.php:386
    458462msgctxt "front"
    459463msgid "Results"
    460464msgstr ""
    461465
    462 #: classes/DemPoll.php:420
     466#: classes/DemPoll.php:422
    463467msgctxt "front"
    464468msgid "This is Your vote."
    465469msgstr ""
    466470
    467 #: classes/DemPoll.php:446
     471#: classes/DemPoll.php:448
    468472msgctxt "front"
    469473msgid "The answer was added by a visitor"
    470474msgstr ""
    471475
    472 #: classes/DemPoll.php:449
     476#: classes/DemPoll.php:451
    473477#, php-format
    474478msgctxt "front"
     
    476480msgstr ""
    477481
    478 #: classes/DemPoll.php:449 classes/DemPoll.php:453
     482#: classes/DemPoll.php:451 classes/DemPoll.php:455
    479483msgctxt "front"
    480484msgid "vote,votes,votes"
    481485msgstr ""
    482486
    483 #: classes/DemPoll.php:483
     487#: classes/DemPoll.php:485
    484488#, php-format
    485489msgctxt "front"
     
    487491msgstr ""
    488492
    489 #: classes/DemPoll.php:484
     493#: classes/DemPoll.php:486
    490494#, php-format
    491495msgctxt "front"
     
    493497msgstr ""
    494498
    495 #: classes/DemPoll.php:486
     499#: classes/DemPoll.php:488
    496500msgctxt "front"
    497501msgid "Begin"
    498502msgstr ""
    499503
    500 #: classes/DemPoll.php:488
     504#: classes/DemPoll.php:490
    501505msgctxt "front"
    502506msgid "End"
    503507msgstr ""
    504508
    505 #: classes/DemPoll.php:490
     509#: classes/DemPoll.php:492
    506510msgctxt "front"
    507511msgid " - added by visitor"
    508512msgstr ""
    509513
    510 #: classes/DemPoll.php:491
     514#: classes/DemPoll.php:493
    511515msgctxt "front"
    512516msgid "Voting is closed"
    513517msgstr ""
    514518
    515 #: classes/DemPoll.php:493
     519#: classes/DemPoll.php:495
    516520msgctxt "front"
    517521msgid "Polls Archive"
    518522msgstr ""
    519523
    520 #: classes/DemPoll.php:549
     524#: classes/DemPoll.php:551
    521525msgctxt "front"
    522526msgid "Only registered users can vote. <a>Login</a> to vote."
    523527msgstr ""
    524528
    525 #: classes/DemPoll.php:559
     529#: classes/DemPoll.php:561
    526530msgctxt "front"
    527531msgid "Revote"
    528532msgstr ""
    529533
    530 #: classes/DemPoll.php:559
     534#: classes/DemPoll.php:561
    531535msgctxt "front"
    532536msgid "Are you sure you want cancel the votes?"
    533537msgstr ""
    534538
    535 #: classes/DemPoll.php:573
     539#: classes/DemPoll.php:575
    536540msgctxt "front"
    537541msgid "You or your IP had already vote."
    538542msgstr ""
    539543
    540 #: classes/DemPoll.php:620
     544#: classes/DemPoll.php:622
    541545msgid "ERROR: You select more number of answers than it is allowed..."
    542546msgstr ""
     
    551555
    552556#: classes/Helpers/Helpers.php:11
     557msgid "Alphabetically"
     558msgstr ""
     559
     560#: classes/Helpers/Helpers.php:12
    553561msgid "Mix"
    554562msgstr ""
     
    558566msgstr ""
    559567
    560 #: classes/Poll_Widget.php:89
     568#: classes/Poll_Widget.php:91
    561569msgid "- Active (random all active)"
    562570msgstr ""
    563571
    564 #: classes/Poll_Widget.php:90
     572#: classes/Poll_Widget.php:92
    565573msgid "- Last open poll"
    566574msgstr ""
    567575
    568 #: classes/Poll_Widget.php:105
     576#: classes/Poll_Widget.php:107
    569577msgid "Which poll to show?"
    570578msgstr ""
    571579
    572 #: classes/Utils/Activator.php:61
     580#: classes/Utils/Activator.php:51
    573581msgid "What is the capital city of France?"
    574582msgstr ""
    575583
    576 #: classes/Utils/Activator.php:73
     584#: classes/Utils/Activator.php:63
    577585msgid "Paris"
    578586msgstr ""
    579587
    580 #: classes/Utils/Activator.php:74
     588#: classes/Utils/Activator.php:64
    581589msgid "Rome"
    582590msgstr ""
    583591
    584 #: classes/Utils/Activator.php:75
     592#: classes/Utils/Activator.php:65
    585593msgid "Madrid"
    586594msgstr ""
    587595
    588 #: classes/Utils/Activator.php:76
     596#: classes/Utils/Activator.php:66
    589597msgid "Berlin"
    590598msgstr ""
    591599
    592 #: classes/Utils/Activator.php:77
     600#: classes/Utils/Activator.php:67
    593601msgid "London"
    594602msgstr ""
  • democracy-poll/tags/6.0.4/readme.txt

    r3064229 r3282901  
    1 
    2 === Plugin Name ===
    3 Stable tag: 6.0.3
    4 Tested up to: 6.5.0
    5 Requires at least: 4.7
     1=== Democracy Poll ===
     2Stable tag: 6.0.4
     3Tested up to: 6.8.0
    64Contributors: Tkama
    75License: GPLv2 or later
     
    97Tags: democracy, polls, vote, survey, review
    108
    11 WordPress Polls plugin with multiple choice and custom answers. Works with cache plugins. Includes widget and shortcodes for posts.
     9A WordPress polls plugin with multiple-choice options and custom answers. Works seamlessly with cache plugins. Includes widgets and shortcodes for posts.
    1210
    1311
    1412== Description ==
    1513
    16 The plugin adds a clever and convenient system to create various Polls with different features, such as:
    17 
    18 * Single and Multiple voting. Сustomizable.
    19 * Visitors can add new answers. Сustomizable.
    20 * Ability to set poll's end date.
    21 * Unregistered users can't vote. Сustomizable.
    22 * Different design of a poll.
    23 * And so on. See changelog.
    24 
    25 Democracy Poll works with all cache plugins like: WP Total Cache, WP Super Cache, WordFence, Quick Cache etc.
    26 
    27 I focus on easy-admin features and fast performance. So we have:
    28 
    29 * Quick Edit button for Admin, right above a poll
    30 * Plugin menu in toolbar
    31 * Inline css & js incuding
    32 * Css & js connection only where it's needed
    33 * and so on. See changelog
    34 
    35 
     14This plugin provides an intuitive and powerful system to create various polls with features like:
     15
     16* Single and multiple voting options (customizable).
     17* Allowing visitors to add new answers (customizable).
     18* Setting an end date for polls.
     19* Restricting voting to registered users (customizable).
     20* Multiple poll designs.
     21* And more! See the changelog for details.
     22
     23Democracy Poll is compatible with all major cache plugins, including WP Total Cache, WP Super Cache, WordFence, Quick Cache, etc.
     24
     25Designed for ease of use and performance, it offers:
     26
     27* A "Quick Edit" button for admins, directly above a poll.
     28* A plugin menu in the toolbar.
     29* Inline inclusion of CSS & JS.
     30* Loading CSS & JS only when necessary.
     31* And more! Check out the changelog for details.
    3632
    3733### More Info ###
    3834
    39 Democracy Poll is a reborn of once-has-been-famous plugin with the same name. Even if it hasn't been updated since far-far away 2006, it still has the great idea of adding users' own answers. So here's a completely new code. I have left only the idea and great name of the original DP by Andrew Sutherland.
    40 
    41 What can it perform?
    42 
    43 * adding new polls;
    44 * works with cache plugins: wp total cache, wp super cache, etc...
    45 * users may add their own answers (Democracy), the option may be disabled if necessary;
    46 * multi-voting: users may multiple answers instead of a single one (may be disabled on demand);
    47 * closing the poll after the date specified beforehand;
    48 * showing a random poll when some are available;
    49 * closing polls for still unregistered users;
    50 * a comfortable editing of a selected poll: 'Edit' key for administrators;
    51 * votes amount editing;
    52 * a user can change his opinion when re-vote option is enabled;
    53 * remember users by their IP, cookies, WP profiles (for authorized users). The vote history may be cleaned up;
    54 * inserting new polls to any posts: the [demоcracy] (shortcode). A key in visual editor is available for this function;
    55 * a widget (may be disabled);
    56 * convenient polls editing: the plugin's Panel is carried out to the WordPress toolbar; (may be disabled);
    57 * .css or .js files may be disabled or embedded to HTML code;
    58 * showing a note under the poll: a short text with any notes to the poll or anything around it;
    59 * changing the poll design (css themes);
    60 
    61 
    62 Multisite: support from version 5.2.4
    63 
     35Democracy Poll is a modernized version of an earlier, well-regarded plugin by the same name. Although the original plugin by Andrew Sutherland hadn't been updated since 2006, it introduced the innovative concept of allowing users to add their own answers. This version retains the core idea and name but features completely rewritten code.
     36
     37Key features include:
     38
     39* Creating new polls.
     40* Compatibility with cache plugins like WP Total Cache and WP Super Cache.
     41* Allowing users to add their own answers (optional).
     42* Multi-voting, enabling users to select multiple answers (optional).
     43* Automatically closing polls after a pre-set end date.
     44* Displaying random polls when multiple are available.
     45* Restricting polls to registered users (optional).
     46* Convenient admin tools, such as an "Edit" button for quick poll management.
     47* Editing the number of votes.
     48* Allowing users to change their votes when the re-vote option is enabled.
     49* Remembering voters via IP, cookies, or WordPress profiles. Optionally, vote history can be cleared.
     50* Embedding polls in posts with the `[democracy]` shortcode. A visual editor button is available for ease of use.
     51* Providing a widget (optional).
     52* Streamlined poll management through the WordPress toolbar (optional).
     53* Flexibility to disable or embed CSS/JS files into the HTML.
     54* Adding notes under polls for additional context.
     55* Customizing poll designs with CSS themes.
     56
     57Multisite support is available starting from version 5.2.4.
    6458
    6559Requires PHP 5.3 or later.
    6660
    6761
    68 
    69 
    7062== Usage ==
    7163
    7264### Usage (Widget) ###
    73 1. Go to `WP-Admin -> Appearance -> Widgets` and find `Democracy Poll` Widget.
    74 2. Add this widget to one of existing sidebar.
    75 3. Set Up added widget and press Save.
     651. Go to `WP-Admin -> Appearance -> Widgets` and select the `Democracy Poll` widget.
     662. Add the widget to an available sidebar.
     673. Configure the widget settings and save.
    76684. Done!
    7769
    78 
    7970### Usage (Without Widget) ###
    80 1. Open sidebar.php file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`
    81 2. Add such code in the place you want Poll is appeared:
    82 
    83 `
     711. Open the `sidebar.php` file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`.
     722. Insert the following code where you want the poll to appear:
     73
     74```php
    8475<?php if( function_exists('democracy_poll') ){ ?>
    8576    <li>
     
    9081    </li>
    9182<?php } ?>
    92 `
    93 
    94 * To show specific poll, use `<?php democracy_poll( 3 ); ?>` where 3 is your poll id.
    95 * To embed a specific poll in your post, use `[democracy id="2"]` where 2 is your poll id.
    96 * To embed a random poll in your post, use `[democracy]`
    97 
     83```
     84
     85* To display a specific poll, use `<?php democracy_poll( 3 ); ?>`, where 3 is your poll ID.
     86* To embed a specific poll in a post, use `[democracy id="2"]`, where 2 is your poll ID.
     87* To embed a random poll in a post, use `[democracy]`.
    9888
    9989#### Display Archive ####
    100 For display polls archive, use the function:
    101 
    102 `<?php democracy_archives( $hide_active, $before_title, $after_title ); ?>`
    103 
    104 
    105 
    106 
     90To display the polls archive, use the function:
     91```php
     92<?php democracy_archives( $hide_active, $before_title, $after_title ); ?>
     93```
    10794
    10895
    10996== Frequently Asked Questions ==
    11097
    111 ### Does this plugin clear yourself after uninstall?
    112 
    113 Yes it is! To completely uninstall the plugin, deactivate it and then press "delete" link in admin plugins page and ther plugin delete all it's options and so on...
    114 
    115 
    116 
     98### Does this plugin clear itself after uninstall? ###
     99
     100Yes! To completely uninstall the plugin, deactivate it and click the "delete" link on the admin plugins page. The plugin will remove all its options and data.
    117101
    118102== Screenshots ==
     
    1261107. General settings.
    1271118. Polls theme settings.
    128 9. Poll's texts changes.
     1129. Poll text customization.
    129113
    130114
     
    133117
    134118= 6.0.0 =
    135 * Minimal PHP version 7.0
    136 * If you used some plugin classes directly in your code it may need to be refactored to new class names.
    137 
     119* Minimum PHP version 7.0 required.
     120* If you directly used plugin classes in your code, you may need to refactor them to align with new class names.
    138121
    139122
     
    141124== Changelog ==
    142125
     126= 6.0.4 =
     127- FIX: Init moved to `after_setup_theme` hook.
     128- NEW: Alphabet answers order added.
     129- IMP: democracy.js minor improvements (part refactored to vanilla js).
     130- IMP: CSS minor refactor.
     131- IMP: Minor improvements.
     132- UPD: Tested up to: WP 6.8.0
     133- UPD: js-cookie 2.2.0 >> 3.0.5.
     134
     135= 6.0.3 =
     136* FIX: Poll widget did not work correctly if "select random poll" option was set.
     137
    143138= 6.0.2 =
    144 BUG: A fatal error occurred when using the "WordFence" plugin: "Failed opening ... /Helpers/wfConfig.php".
     139* FIX: Fatal error with "WordFence" plugin: "Failed opening .../Helpers/wfConfig.php".
    145140
    146141= 6.0.1 =
    147 * BUG: Fix v6.0.0 bug: short-circuit recursion on plugin object construct for the not logged-in users.
     142* FIX: Short-circuit recursion on plugin object construct for not logged-in users (v6.0.0 bug).
    148143* IMP: Minor improvements.
    149144
    150145= 6.0.0 =
    151 * BUG: It was impossible to delete all answers or create democracy poll with no starting answer.
    152 * CHG: Minimal PHP version 7.0
    153 * CHG: "Democracy_Poll" class renamed to "Plugin" and moved under namespace.
    154 * CHG: `democr()` and `demopt()` functions renamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.
    155 * CHG: Most of the classes moved under `DemocracyPoll` namespace.
     146* FIX: Unable to delete all answers or create a democracy poll without a starting answer.
     147* CHG: Minimal PHP version requirement set to 7.0.
     148* CHG: Class `Democracy_Poll` renamed to `Plugin` and moved under namespace.
     149* CHG: Functions `democr()` and `demopt()` renamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.
     150* CHG: Most classes moved under `DemocracyPoll` namespace.
    156151* CHG: DemPoll object improvements: magic properties replaced with real ones.
    157 * FIX: democracy_shortcode bugfix.
    158 * FIX: Not logged user logs now gets with user_id=0 AND ip. But not only by IP.
    159 * FIX: Regenerate_democracy_css fixes. Empty answer PHP notice fix.
    160 * IMP: "Admin" classes refactored. IMP: Admin Pages code refactored (improved).
     152* FIX: `democracy_shortcode` bug.
     153* FIX: Not logged-in user logs now get saved with user_id=0 and IP (not just IP).
     154* FIX: `Regenerate_democracy_css` fixes. Empty answer PHP notice fix.
     155* IMP: "Admin" classes refactored.
     156* IMP: Admin Pages code refactored.
    161157* IMP: Classes autoloader implemented.
    162 * IMP: Huge Refactoring, minor code improvements and decomposition.
    163 * UPD: democracy-poll.pot
     158* IMP: Huge refactoring, minor code improvements, and decomposition.
     159* UPD: Updated `democracy-poll.pot`.
    164160
    165161= 5.6.0 =
    166 * BUG: Pagination links on archive page.
     162* FIX: Pagination links on archive page.
    167163
    168164= 5.5.10 =
    169 * FIX: CSS radio,checkbox styles from px to em.
     165* FIX: CSS radio/checkbox styles changed from px to em.
    170166
    171167= 5.5.9 =
    172 * FIX: JS code fixes for jQuery 3.5.
     168* FIX: JS code fixes for jQuery 3.5 compatibility.
    173169
    174170= 5.5.8 =
    175 * NEW: `orderby` аргумент для функции `get_dem_polls()`.
     171* ADD: `orderby` argument for `get_dem_polls()` function.
    176172
    177173= 5.5.7 =
    178 * NEW: hook `get_dem_polls_sql_clauses`.
     174* ADD: Hook `get_dem_polls_sql_clauses`.
    179175
    180176= 5.5.6.3 =
    181 * FIX: `disabled` property for checkbox input sometimes not removed on uncheck for multianswers questions.
     177* FIX: `disabled` property not removed correctly on uncheck for multi-answer questions.
    182178
    183179= 5.5.6.2 =
    184 * NEW: Scroll to poll top when click on Resulsts, Vote etc.
     180* ADD: Scroll to poll top when clicking Results, Vote, etc.
    185181
    186182= 5.5.6.1 =
    187 * NEW: `target="_blank"` attribute for copyright link.
     183* ADD: `target="_blank"` attribute for copyright link.
    188184
    189185= 5.5.6 =
    190 * NEW: pagination links at the bottom of the archive page.
    191 * NEW: `[democracy_archives]` now can accept parameters: 'before_title', 'after_title', 'active', 'open', 'screen', 'per_page', 'add_from_posts'. `[democracy_archives screen="vote" active="1"]` will show only active poll with default vote screen.
    192 * NEW: function `get_dem_polls( $args )`
     186* ADD: Pagination links at the bottom of the archive page.
     187* ADD: `[democracy_archives]` shortcode now accepts parameters like 'before_title', 'after_title', 'active', 'open', 'screen', 'per_page', 'add_from_posts'.
     188* ADD: `get_dem_polls( $args )` function.
    193189
    194190= 5.5.5 =
    195 * CHANGE: ACE code editor to native WordPress CodeMirror.
     191* CHG: Replaced ACE code editor with native WordPress CodeMirror.
    196192
    197193= 5.5.4 =
    198 * ADD: 'dem_get_ip' filter and cloudflare IP support.
    199 * NEW: use float number in 'cookie_days' option.
    200 * FIX: expire time now sets in UTC time zone.
     194* ADD: `dem_get_ip` filter and Cloudflare IP support.
     195* ADD: Support for float numbers in the 'cookie_days' option.
     196* FIX: Expire time now set in UTC timezone.
    201197
    202198= 5.5.3 =
    203 * FIX: compatability with W3TC.
    204 * FIX: multiple voting limit check on back-end (AJAX request) - no more answers than allowed...
    205 * IMP: return WP_Error object on vote error and display it...
     199* FIX: Compatibility with W3TC.
     200* FIX: Multiple voting limit check on backend (AJAX) — no more answers than allowed.
     201* IMP: Return WP_Error object on vote error and display it.
    206202
    207203= 5.5.2 =
    208 * ADD: wrapper function for use in themes 'get_democracy_poll_results( $poll_id )' - Gets poll results screen.
    209 * ADD: allowed &lt;img&gt; tag in question and answers.
     204* ADD: `get_democracy_poll_results( $poll_id )` wrapper function to get poll results.
     205* ADD: Allow `<img>` tag in questions and answers.
    210206
    211207= 5.5.1 =
    212 * IMP: now design setting admin page is more clear and beautiful :)
     208* IMP: Admin design settings page improved.
    213209
    214210= 5.5.0 =
    215 * ADD: post metabox to attach poll to a post. To show attached poll in theme use `get_post_poll_id()` on is_singular() page. Thanks to heggi@fhead.org for idea.
    216 * ADD: voted screen progress line animation effect and option to set animation speed or disable animation...
    217 * IMP: now "height collapsing" not work if it intend to hide less then 100px...
    218 * FIX: now JS includes in_footer not right after poll. In some cases there was a bug - when poll added in content through shortcode.
    219 * IMP: buttons and other design on 'design settings' admin screen.
     211* ADD: Post metabox to attach poll to post; use `get_post_poll_id()` on `is_singular()` pages.
     212* ADD: Progress line animation effect for vote results with adjustable speed.
     213* IMP: "Height collapsing" now doesn't work if intended to hide less than 100px.
     214* FIX: JS now included in footer properly when poll added via shortcode.
     215* IMP: Improved buttons and design on admin design settings page.
    220216
    221217= 5.4.9 =
    222 * ADD: 'demadmin_sanitize_poll_data' filter second '$original_data' parameter
    223 * ADD: posts where a poll is ebedded block at the bottom of each poll on polls archive page.
    224 
    225 = 5.4.7 - 5.4.8 =
    226 * FIX: 'expire' parameter works incorrectly with logs written to DB.
    227 * FIX: 'wp_remote_get()' changed to 'file_get_contents()' bacause it works not correctly with geoplugin.net API.
    228 * FIX: 'jquery-ui.css' fix and needed images added.
     218* ADD: 'demadmin_sanitize_poll_data' filter with second `$original_data` parameter.
     219* ADD: Block showing posts where poll is embedded at bottom of polls archive page.
     220
     221= 5.4.8 =
     222* FIX: 'expire' parameter issue when logs written to DB.
     223* FIX: Replaced `wp_remote_get()` with `file_get_contents()` for geoplugin.net API.
     224* FIX: `jquery-ui.css` and images fix.
    229225
    230226= 5.4.6 =
    231 * FIX: Error with "load_textdomain" because of which it was impossible to activate the plugin
     227* FIX: "load_textdomain" error that blocked plugin activation.
    232228
    233229= 5.4.5 =
    234 * FIX: "Edit poll" link from front-end for users with access to edit single poll.
    235 * FIX: not correct use of $this for PHP 5.3 in class.Democracy_Poll_Admin.php
     230* FIX: "Edit poll" link from frontend for users with poll edit rights.
     231* FIX: Incorrect use of `$this` for PHP 5.3 in `Democracy_Poll_Admin` class.
    236232
    237233= 5.4.4 =
    238 * CHG: prepare to move all localisation to translate.wordpress.org in next release...
    239 * FIX: notice on MU activation - change `wp_get_sites()` to new from WP 4.6 `get_sites()`. Same fix on plugin Uninstall...
    240 * ADD: Hungarian translation (hu_HU). Thanks to Lesbat.
     234* CHG: Preparing to move all localization to translate.wordpress.org.
     235* FIX: MU activation notice: replaced `wp_get_sites()` with `get_sites()` (WP 4.6+).
     236* ADD: Hungarian translation (hu_HU) by Lesbat.
    241237
    242238= 5.4.3 =
    243 * ADD: disable user capability to edit poll of another user, when there is democracy admin access to other roles...
    244 * ADD: spain (es_ES) localisation file added.
    245 * IMP: improve accessibility protection in different parts of admin area for additional roles (edit,delete poll)...
    246 * IMP: hide & block any global plugin options updates for roles with not 'super_access' access level...
     239* ADD: Disable editing another user's poll if restricted by admin settings.
     240* ADD: Spanish (es_ES) localization.
     241* IMP: Improved accessibility protection in admin for additional roles.
     242* IMP: Block global plugin options updates for non-super_access roles.
    247243
    248244= 5.4.2 =
    249 * FIX: Some minor changes that do not change the plugin logic at all: change function names; block direct access to files with "active" PHP code.
    250 * CHG: Add `jquery-ui.css` to plugin files and now it loaded from inside it.
    251 * FIX: "wp total cache" support
    252 * ADD: second parametr to 'dem_sanitize_answer_data' filter - $filter_type
    253 * ADD: second parametr to 'dem_set_answers' filter - $poll
    254 * FIX: tinymce translation fix
    255 * CHG: rename main class `Dem` to `Democracy_Poll` for future no conflict. And rename some other internal functions/method names
     245* FIX: Minor fixes: function renaming and blocking direct file access.
     246* CHG: Added `jquery-ui.css` to plugin files.
     247* FIX: W3TC support fixes.
     248* ADD: Second parameter to 'dem_sanitize_answer_data' and 'dem_set_answers' filters.
     249* FIX: TinyMCE translation fix.
     250* CHG: Renamed main class `Dem` to `Democracy_Poll`.
    256251
    257252= 5.4.1 =
    258 * CHG: improve logic to work correctly with activate_plugin() function outside of wp-admin area (in front end). Thanks to J.D.Grimes
     253* CHG: Improve activation logic with `activate_plugin()` outside wp-admin. Thanks to J.D. Grimes.
    259254
    260255= 5.4 =
    261 * FIX: XSS Vulnerability. In some extraordinary case it could be possible to hack your site. Read here: http://pluginvulnerabilities.com/?p=2967
    262 * ADD: For additional protect I add nonce check for all requests in admin area.
    263 * CHG: move back Democracy_Poll_Admin::update_options() to its place - it's not good decision - I'm looking for a better one
     256* FIX: XSS vulnerability fix (security issue).
     257* ADD: Nonce checks for all admin requests.
     258* CHG: Moved back `Democracy_Poll_Admin::update_options()` method.
    264259
    265260= 5.3.6 =
    266 * FIX: delete `esc_sql()` from code, for protection. Thanks to J.D. Grimes
    267 * FIX: multi run of Democracy_Poll_Admin trigger error... (J.D. Grimes)
    268 * CHG: move Democracy_Poll_Admin::update_options() method to Democracy_Poll::update_options(), for possibility to activate plugin not only from admin area.
     261* FIX: Removed unsafe `esc_sql()` usage. Thanks to J.D. Grimes.
     262* FIX: Multiple runs of `Democracy_Poll_Admin` trigger error fix.
     263* CHG: Moved `update_options()` to `Democracy_Poll`.
    269264
    270265= 5.3.5 =
    271 * FIX: now user IP detects only with REMOTE_ADDR server variable to don't give possibility to cheat voice. You can change behavior in settings.
     266* FIX: User IP now detected only with `REMOTE_ADDR` (to avoid cheating).
    272267
    273268= 5.3.4.6 =
    274 * FIX: add 'dem_add_user_answer' query var param to set noindex for no duplicate content
    275 * ADD: actions `dem_voted` and `dem_vote_deleted`
     269* FIX: Added 'dem_add_user_answer' query var param to set `noindex`.
     270* ADD: Actions `dem_voted` and `dem_vote_deleted`.
    276271
    277272= 5.3.4.5 =
    278 * ADD: filters `dem_vote_screen` and `dem_result_screen`
     273* ADD: Filters `dem_vote_screen` and `dem_result_screen`.
    279274
    280275= 5.3.4 =
    281 * ADD: poll creation date change capability on edit poll page.
    282 * ADD: animation speed option on design settings.
    283 * ADD: "dont show results link" global option.
    284 * ADD: 'show last poll' option in widget
    285 * FIX: bug user cant add onw answer when vote button is hidden for not multiple poll
    286 * CHG: move the "dem__collapser" styles to all styles. Change the styles: now arrow has 150% font-size. Now you can set your own arrow simbols by changing it's style. EX:
    287     ```
    288     .dem__collapser.collapsed .arr:before{ content:"down"; }
    289     .dem__collapser.expanded  .arr:before{ content:"up"; }
    290     ```
     276* ADD: Poll creation date editing on poll edit page.
     277* ADD: Animation speed setting in design settings.
     278* ADD: "Don't show results link" global option.
     279* ADD: Show last poll option in widget.
     280* FIX: Bug where user couldn't add own answer if vote button hidden.
     281* CHG: Moved "dem__collapser" styles globally; customizable arrows via CSS.
    291282
    292283= 5.3.3.2 =
    293 * FIX: stability for adding "dem__collapser" style into document.
     284* FIX: Stability for injecting "dem__collapser" style.
    294285
    295286= 5.3.3.1 =
    296 * ADD: answers sort in admin by two fields - votes and then by ID - it's for no suffle new answers...
     287* ADD: Answer sorting in admin by votes and ID.
    297288
    298289= 5.3.3 =
    299 * FIX: minor: when work with cache plugin: now vote & revote buttons completely removes from DOM
     290* FIX: Vote and revote buttons now fully removed from DOM with caching plugins.
    300291
    301292= 5.3.2 =
    302 * FIX: minor: cookie stability fix when plugin works with page caching plugin
     293* FIX: Cookie stability fix with page caching plugins.
    303294
    304295= 5.3.1 =
    305 * ADD: filter: 'dem_poll_screen_choose'
    306 * FIX: now before do anything, js checks - is there any democracy element on page. It needs to prevent js errors.
    307 * CHG: now main js init action run on document.ready, but not on load. So democracy action begin to work earlier...
     296* ADD: Filter `dem_poll_screen_choose`.
     297* FIX: Prevent JS errors by checking democracy element presence before init.
     298* CHG: JS init moved to `document.ready` instead of `load`.
    308299
    309300= 5.3.0 =
    310 * CHG: All plugin code translated to english! Now there is NO russian text for unknown localisation strings.
     301* CHG: All plugin code translated to English (no hardcoded Russian text).
    311302
    312303= 5.2.9 =
    313 * FIX: add poll PHP syntax bug...
     304* FIX: PHP syntax bug in poll addition.
    314305
    315306= 5.2.8 =
    316 * ADD: new red button - pinterest style. default button styles changed. Some ugly buttons (3d, glass) was deleted.
    317 * ADD: filters: 'dem_vote_screen_answer', 'dem_result_screen_answer', 'demadmin_after_question', 'demadmin_after_answer', 'dem_sanitize_answer_data', 'demadmin_sanitize_poll_data'
     307* ADD: New red Pinterest-style button. Some old 3D/glass buttons removed.
     308* ADD: Filters: `dem_vote_screen_answer`, `dem_result_screen_answer`, `demadmin_after_question`, `demadmin_after_answer`, `dem_sanitize_answer_data`, `demadmin_sanitize_poll_data`.
    318309
    319310= 5.2.7 =
    320 * FIX: global option 'dont show results' not work properly
    321 * FIX: some little fix in code
     311* FIX: "Don't show results" global option fix.
     312* FIX: Minor code fixes.
    322313
    323314= 5.2.6 =
    324 * FIX: bug when new answer added: now "NEW" mark adds correctly
     315* FIX: "NEW" mark correctly added after adding a new answer.
    325316
    326317= 5.2.5 =
    327 * FIX: wp_json_encode() function was replaced, in order to support WP lower then 4.1
    328 * CHG: usability improvements
    329 * CHG: set 'max+1' order num for users added answers, if answers has order
     318* FIX: Replaced `wp_json_encode()` for WP < 4.1 support.
     319* CHG: Usability improvements.
     320* CHG: Set max+1 order number for user-added answers if answers have order.
    330321
    331322= 5.2.4 =
    332 * ADD: multisite support
    333 * ADD: migration from 'WP Polls' plugin mechanism
    334 * FIX: bug - was allowed set 1 answer for multiple answers
    335 * CHG: IP save to DB: now it saves as it is without ip2long()
    336 * CHG: EN translation is updated.
     323* ADD: Multisite support.
     324* ADD: Migration mechanism from "WP Polls" plugin.
     325* FIX: Bug where one answer allowed for multiple-answer polls.
     326* CHG: Save IP to DB as-is (no ip2long()).
     327* CHG: Updated English translation.
    337328
    338329= 5.2.3 =
    339 * ADD: on admin edit poll screen, posts list where poll shortcode uses
    340 * ADD: ability to set poll buttons css class on design settings page
    341 * ADD: filters: 'dem_super_access' (removed filter 'dem_admin_access'), 'dem_get_poll', 'dem_set_answers'
    342 * FIX: 'reset order' bug fix - button not work, when answers are ordered in edit poll screen and you wanted to reset the order - I missed one letter in the code during refactoring :)
    343 * FIX: 'additional css' update bug fix: you can't empty it...
    344 * FIX: some other minor fixes...
    345 * CHG: EN translation is updated.
     330* ADD: Show posts list using poll shortcode on poll edit page.
     331* ADD: Allow setting custom CSS class for poll buttons.
     332* ADD: Filters: `dem_super_access`, `dem_get_poll`, `dem_set_answers`.
     333* FIX: "Reset order" button bug fix on poll edit screen.
     334* FIX: "Additional CSS" emptying bug fix.
     335* FIX: Other minor fixes.
     336* CHG: Updated English translation.
    346337
    347338= 5.2.2 =
    348 * FIX: when click on 'close', 'open', 'activate', 'deactivate' buttons at polls list table, the action was applied not immediately
    349 * FIX: radio, checkbox styles fix
     339* FIX: Actions (close, open, activate, deactivate) in polls list table were not applied immediately.
     340* FIX: Radio and checkbox styles.
    350341
    351342= 5.2.1 =
    352 * ADD: 'in posts' column in admin polls list. In which posts the poll shortcode used.
     343* ADD: 'In posts' column in admin polls list to show where the poll shortcode is used.
    353344
    354345= 5.2.0 =
    355 * ADD: hooks: 'dem_poll_inserted', 'dem_before_insert_quest_data'
    356 * ADD: two variants to delete logs: only logs and logs with votes.
    357 * ADD: possibiliti to delete single answer log.
    358 * ADD: "all voters" at the bottom of a poll if the poll is multiple.
    359 * ADD: delete answer logs on answer deleting.
    360 * ADD: button to delete all logs of closed polls.
    361 * ADD: not show logs link in polls list table, when the poll don't have any log records.
    362 * ADD: collapse extremely height polls under 'max height' option. All answers expands when user click on answers area.
    363 * ADD: css themes for 'radio' and 'checkboks' inputs. Added special css classes and span after input element into the poll HTML code.
    364 * ADD: now you can set access to add, edit polls and logs to other wordpress roles (editor, author etc.).
    365 * ADD: mark 'NEW' for newely added answers by any user, except poll creator.
    366 * ADD: 'NEW' mark filter and 'NEW' mark clear button in plugin logs table.
    367 * ADD: country name and flag in logs table, parsed from voter IP.
    368 * ADD: ability to sort answers (set order) in edit/add poll admin page. In this case answers will showen by the order.
    369 * ADD: one more option to sort answers by random on display its in poll.
    370 * ADD: sort option for single poll. It will overtake global sort option.
    371 * FIX: fix admin css bug in firefox on design screen...
    372 * CHG: EN translation is updated.
     346* ADD: Hooks: `dem_poll_inserted`, `dem_before_insert_quest_data`.
     347* ADD: Two options to delete logs: only logs or logs with votes.
     348* ADD: Ability to delete a single answer log.
     349* ADD: "All voters" section at bottom of multiple polls.
     350* ADD: Delete answer logs when deleting an answer.
     351* ADD: Button to delete logs of closed polls.
     352* ADD: Hide "logs" link in polls list table if no log records exist.
     353* ADD: Collapse extremely tall polls with "max height" option; expand on answer click.
     354* ADD: CSS themes for radio and checkbox inputs; special classes and spans added.
     355* ADD: Ability to assign poll and log access to other WordPress roles.
     356* ADD: "NEW" mark for newly added answers (except by poll creator).
     357* ADD: "NEW" mark filter and clear button on logs table.
     358* ADD: Display country name and flag in logs table based on voter IP.
     359* ADD: Ability to sort answers manually in edit/add poll page.
     360* ADD: Option to randomize answer order.
     361* ADD: Single poll sort option to override global setting.
     362* FIX: Admin CSS bug on design screen in Firefox.
     363* CHG: Updated English translation.
    373364
    374365= 5.1.1 =
    375 * SEO Fix: Now sets 404 response and "noindex" head tag for duplicate pages with: $_GET['dem_act'] or $_GET['dem_pid'] or $_GET['show_addanswerfield']
     366* FIX: SEO - 404 response and "noindex" head tag for duplicate pages (`dem_act`, `dem_pid`, `show_addanswerfield` GET parameters).
    376367
    377368= 5.1.0 =
    378 * Fix: Change DB ip field from int(11) to bigint(20). Because of this some IP was writen wrong. Also, change some other DB fields types, but it's no so important.
     369* FIX: Changed DB IP field from `int(11)` to `bigint(20)` to fix wrong IP storage. Adjusted some other DB fields.
    379370
    380371= 5.0.3 =
    381 * Fix: Some bugs with variables and antivirus check.
     372* FIX: Bugs with variables and antivirus checks.
    382373
    383374= 5.0.2 =
    384 * FIX: not correctly set answers on cache mode, because couldn't detect current screen correctly.
     375* FIX: Incorrect answer setting in cache mode due to wrong screen detection.
    385376
    386377= 5.0.1 =
    387 * ADD: expand answers list on Polls list page by click on the block.
     378* ADD: Expand answers list by clicking on the block in Polls list page.
    388379
    389380= 5.0 =
    390 * FIX: replace VOTE button with REVOTE. On cache mode, after user voting he see backVOTE button (on result screen), but not "revote" or "nothing" (depence on poll options).
    391 * HUGE ADD: Don't show results until vote is closed. You can choose this option for single poll or for all polls (on settings page).
    392 * ADD: edit & view links on admin logs page.
    393 * ADD: Search poll field on admin polls list page.
    394 * ADD: All answers (not just win) in "Winner" column on polls list page. For usability answers are folds.
    395 * ADD: Poll shordcode on edit poll page. Auto select on its click.
    396 * CHG: sort answers by votes on edit poll page.
     381* FIX: Replaced VOTE button with REVOTE button in cache mode after voting.
     382* ADD: Option to hide results until poll is closed (global and per poll).
     383* ADD: Edit & view links on admin logs page.
     384* ADD: Search field on admin polls list page.
     385* ADD: Show all answers (not only winners) in "Winner" column.
     386* ADD: Poll shortcode shown on edit poll page (auto-select on click).
     387* CHG: Sort answers by votes on edit poll page.
    397388
    398389= 4.9.4 =
    399 * FIX: change default DB tables charset from utf8mb4 to utf8. Thanks to Nanotraktor
     390* FIX: Changed default DB charset from `utf8mb4` to `utf8`. Thanks to Nanotraktor.
    400391
    401392= 4.9.3 =
    402 * ADD: single poll option that allow set limit for max answers if there is multiple answers option.
    403 * ADD: global option that allow hide vote button on polls with no multiple answers and revote possibility. Users will vote by clicking on answer itself.
    404 * fix: disable cache on archive page.
     393* ADD: Single poll option to limit max answers in multiple-answer polls.
     394* ADD: Global option to hide vote button on non-multiple polls (click-to-vote).
     395* FIX: Disabled cache on archive page.
    405396
    406397= 4.9.2 =
    407 * FIX: bootstrap .label class conflict. Rename .label to .dem-label. If you discribe .label class in 'additional css' rename it to .dem-label please.
    408 * ADD: Now on new version css regenerated automaticaly when you enter any democracy admin page.
     398* FIX: Bootstrap `.label` class conflict; renamed to `.dem-label`.
     399* ADD: Auto-regenerate CSS on plugin admin page load.
    409400
    410401= 4.9.1 =
    411 * FIX: Polls admin table column order
     402* FIX: Polls admin table column order.
    412403
    413404= 4.9.0 =
    414 * ADD: Logs table in admin and capability to remove only logs of specific poll.
    415 * ADD: 'date' field to the democracy_log table.
     405* ADD: Logs table in admin with ability to remove logs of a specific poll.
     406* ADD: 'date' field to `democracy_log` table.
    416407
    417408= 4.8 =
    418 * Complatelly change polls list table output. Now it work under WP_List_Table and have sortable colums, pagination, search (in future) etc.
     409* CHG: Completely revamped polls list table using WP_List_Table: sortable columns, pagination, and search ready.
    419410
    420411= 4.7.8 =
    421 * ADD: en_US l10n if no l10n file.
     412* ADD: Default en_US localization if none available.
    422413
    423414= 4.7.7 =
    424 * ADD: de_DE localisation. Thanks to Matthias Siebler
     415* ADD: de_DE localization. Thanks to Matthias Siebler.
    425416
    426417= 4.7.6 =
    427 * DELETED: possibility to work without javascript. Now poll works only with enabled javascript in your browser. It's better because you don't have any additional URL with GET parametrs. It's no-need-URL in 99% cases..
     418* DEL: Removed no-JS support. Now poll requires JavaScript for better usability.
    428419
    429420= 4.7.5 =
    430 * CHG: Convert tables from utf8 to utf8mb4 charset. For emoji uses in polls
     421* CHG: Changed DB charset to `utf8mb4` to support emojis.
    431422
    432423= 4.7.4 =
    433 * CHG: Some css styles in admin
     424* CHG: Updated admin CSS styles.
    434425
    435426= 4.7.3 =
    436 * ADD: Custom front-end localisation - as single settings page. Now you can translate all phrases of Poll theme as you like.
     427* ADD: Custom frontend localization settings page to translate all poll phrases.
    437428
    438429= 4.7.2 =
    439 * CHG: in main js cache result/vote view was setted with animation. Now it sets without animation & so the view change invisible for users. Also, fix with democracy wrap block height set, now it's sets on "load" action, but not "document.ready".
    440 * CHG: "block.css" theme improvements for better design.
     430* CHG: JS result/vote view cache updated without animation for smoother UX.
     431* CHG: Democracy block height set on "load" instead of "document.ready".
     432* CHG: Minor improvements in `block.css` theme.
    441433
    442434= 4.7.1 =
    443 * ADD: "on general options page": global "revote" and "democratic" functionality disabling ability
    444 * ADD: localisation POT file & english transtation
     435* ADD: Global options to disable "revote" and "democratic" features.
     436* ADD: Localization POT file and English translation.
    445437
    446438= 4.7.0 =
    447 * CHG: "progress fill type" & "answers order" options now on "Design option page"
    448 * FIX: english localisation
     439* CHG: Moved "progress fill type" and "answers order" settings to Design options page.
     440* FIX: English localization fixes.
    449441
    450442= 4.6.9 =
    451 * CHG: delete "add new answer" button on Add new poll and now field for new answerr adds when you focus on last field.
     443* CHG: Reworked answer field adding on new poll creation (add on focus).
    452444
    453445= 4.6.8 =
    454 * FIX: options bug appers in 4.6.7
     446* FIX: Bug introduced in 4.6.7 affecting options.
    455447
    456448= 4.6.7 =
    457 * ADD: check for current user has an capability to edit polls. Now toolbar doesn't shown if user logged in but not have capability
     449* ADD: Capability check for editing polls. Toolbar hidden for unauthorized users.
    458450
    459451= 4.6.6 =
    460 * FIX: Huge bug about checking is user already vote or not. This is must have release!
    461 * CHG: a little changes in js code
    462 * 'notVote' cookie check set to 1 hour
     452* FIX: Major voting status check bug fixed (critical release).
     453* CHG: Minor JS code changes.
     454* CHG: `notVote` cookie lifespan set to 1 hour.
    463455
    464456= 4.6.5 =
    465 * ADD: New theme "block.css"
    466 * ADD: Preset theme (_preset.css) now visible and you can set it and wtite additional css styles to customize theme
     457* ADD: New theme `block.css`.
     458* ADD: Preset theme visibility and customization support.
    467459
    468460= 4.6.4 =
    469 * FIX: when user send democratic answer, new answer couldn't have comma
     461* FIX: New democratic answers couldn't contain commas.
    470462
    471463= 4.6.3 =
    472 * FIX: Widget showed screens uncorrectly because of some previous changes in code.
    473 * Improve: English localisation
     464* FIX: Widget display issues due to code changes.
     465* IMP: Improved English localization.
    474466
    475467= 4.6.2 =
    476 * FIX: great changes about polls themes and css structure.
    477 * ADD: "Ace" css editor. Now you can easely write your own themes by editing css in admin.
     468* FIX: Major updates to poll themes and CSS structure.
     469* ADD: "Ace" CSS editor for easier theme customization.
    478470
    479471= 4.6.1 =
    480 * FIX: some little changes about themes settings, translate, css.
    481 * ADD: screenshots to WP directory.
     472* FIX: Minor changes to themes, translations, and CSS.
     473* ADD: Added screenshots to WP directory.
    482474
    483475= 4.6.0 =
    484 * ADD: Poll themes management
    485 * FIX: some JS and CSS bugs
    486 * FIX: Unactivate pool when closing poll
     476* ADD: Poll themes management.
     477* FIX: JS and CSS bug fixes.
     478* FIX: Auto-deactivate polls when closed.
    487479
    488480= 4.5.9 =
    489 * FIX: CSS fixes, prepare to 4.6.0 version update
    490 * ADD: Cache working. Wright/check cookie "notVote" for cache gear optimisation
     481* FIX: CSS fixes; prep for 4.6.0 update.
     482* ADD: Cache handling and "notVote" cookie optimization.
    491483
    492484= 4.5.8 =
    493 * ADD: AJAX loader images SVG & css3 collection
    494 * ADD: Sets close date when closing poll
     485* ADD: AJAX loader images (SVG & CSS3 collection).
     486* ADD: Automatically set close date when poll closes.
    495487
    496488= 4.5.7 =
    497 * FIX: revote button didn't minus votes if "keep-logs" option was disabled
     489* FIX: Revote button did not deduct votes if "keep-logs" option was disabled.
    498490
    499491= 4.5.6 =
    500 * ADD: right working with cache plugins. Auto unable/dasable with wp total cache, wp super cache, WordFence, WP Rocket, Quick Cache. If you use the other plugin you can foorce enable this option.
    501 * ADD: add link to selected css file in settings page, to conviniently copy or view the css code
    502 * ADD: php 5.3+ needed check & notice if php unsuitable
    503 * Changed: archive page ID in option, but not link to the archive page
    504 * FIX: in_archive check... to not show archive link on archive page
    505 * FIX: many code improvements & some bug fix (hide archive page link if 0 set as ID, errors on activation, etc.)
     492* ADD: Cache plugin compatibility (W3TC, WP Super Cache, WordFence, WP Rocket, Quick Cache).
     493* ADD: Settings page link to selected CSS file for easier customization.
     494* ADD: PHP 5.3+ requirement notice.
     495* CHG: Archive page ID stored instead of link.
     496* FIX: Multiple small bugs and optimizations.
    506497
    507498= 4.5.5 =
    508 * CHG: Archive link detection by ID not by url
     499* CHG: Archive link detection now based on ID, not URL.
    509500
    510501= 4.5.4 =
    511 * FIX: js code. Now All with jQuery
    512 * FIX: Separate js and css connections: css connect on all pages into the head, but js connected into the bottom just for page where it need
     502* FIX: JS refactored: all scripts run via jQuery.
     503* FIX: Separated JS and CSS loading: CSS globally in head; JS only where needed.
    513504
    514505= 4.5.3 =
    515 * FIX: code fix, about $_POST[*] vars
     506* FIX: Code fixes for handling `$_POST` variables.
    516507
    517508= 4.5.2 =
    518 * FIX: Remove colling wp-load.php files directly on AJAX request. Now it works with wordpress environment - it's much more stable.
    519 * FIX: fixes about safe SQL calls. Correct escaping of passing variables. Now work with $wpdb->* functions where it posible
    520 * FIX: admin messages
     509* FIX: Removed direct `wp-load.php` calls on AJAX requests; now uses WordPress environment.
     510* FIX: Safe SQL call improvements using `$wpdb` functions.
     511* FIX: Admin message fixes.
    521512
    522513= 4.5.1 =
    523 * FIX: Localisation bug on activation.
     514* FIX: Localization bug on activation.
    524515
    525516= 4.5 =
    526 * ADD: css style themes support.
    527 * ADD: new flat (flat.css) theme.
    528 * FIX: Some bugs in code.
     517* ADD: CSS style themes support.
     518* ADD: New "flat.css" theme.
     519* FIX: Multiple bug fixes.
    529520
    530521= 4.4 =
    531 * ADD: All plugin functionality when javascript is disabled in browser.
    532 * FIX: Some bug.
     522* ADD: Full plugin functionality even with JavaScript disabled.
     523* FIX: Minor bug fixes.
    533524
    534525= 4.3.1 =
    535 * ADD: "add user answer text" field close button when on multiple vote. Now it's much more convenient.
    536 * FIX: Some bug.
     526* ADD: "Close" button for "add user answer text" field on multiple vote polls.
     527* FIX: Minor bug fix.
    537528
    538529= 4.3 =
    539 * ADD: TinyMCE button.
    540 * FIX: Some bug.
     530* ADD: TinyMCE button integration.
     531* FIX: Minor bug fix.
    541532
    542533= 4.2 =
     
    544535
    545536= 4.1 =
    546 * ADD: "only registered users can vote" functionality.
    547 * ADD: Minified versions of CSS (*.min.css) and .js (*.min.js) is loaded if they exists.
    548 * ADD: js/css inline including: Adding code of .css and .js files right into HTML. This must improve performance a little.
    549 * ADD: .js and .css files (or theirs code) loads only on the pages where polls is shown.
    550 * ADD: Toolbar menu for fast access. It help easily manage polls. The menu can be disabled.
     537* ADD: Restriction for "only registered users can vote".
     538* ADD: Minified versions of CSS and JS loaded automatically if available.
     539* ADD: Inline JS/CSS inclusion option for performance.
     540* ADD: Load scripts/styles only on pages with polls.
     541* ADD: Admin toolbar menu for faster poll management.
    551542
    552543= 4.0 =
    553 * ADD: Multiple voting functionality.
    554 * ADD: Opportunity to change answers votes in DataBase.
    555 * ADD: "Random show one of many active polls" functionality.
    556 * ADD: Poll expiration date functionality.
    557 * ADD: Poll expiration datepicker on jQuery.
     544* ADD: Multiple voting option.
     545* ADD: Ability to change vote counts manually.
     546* ADD: Random poll selection from active polls.
     547* ADD: Poll expiration date feature.
     548* ADD: jQuery datepicker for poll expiration.
    558549* ADD: Open/close polls functionality.
    559 * ADD: Localisation functionality. Translation to English.
    560 * ADD: Change {democracy}/{democracy:*} shortcode to standart WP [democracy]/[democracy id=*].
    561 * ADD: jQuery support and many features because of this.
    562 * ADD: Edit button for each poll (look at right top corner) to convenient edit poll when logged in.
     550* ADD: Localization functionality (English translation).
     551* ADD: Switched to standard WP shortcodes `[democracy]`.
     552* ADD: Full jQuery support.
     553* ADD: Edit button for each poll (visible when logged in).
    563554* ADD: Clear logs button.
    564 * ADD: Smart "create archive page" button on plugin's settings page.
    565 * FIX: Improve about 80% of plugin code and logic in order to easily expand the plugin functionality in the future.
    566 * FIX: Improve css output. Now it's more adaptive for different designs.
    567 
    568 
     555* ADD: Smart "create archive page" button.
     556* FIX: Major code refactoring for future expansions.
     557* FIX: Improved CSS output for adaptive design.
     558
     559
  • democracy-poll/tags/6.0.4/styles/alternate.css

    r1423733 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* default theme ------------------------------------------------------------- */
     
    1415
    1516/* results screen */
    16 .dem-graph{ font-family:Arial, sans-serif; background: #F7F7F7; background:linear-gradient( to bottom, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% ); background:-webkit-linear-gradient( top, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% ); }
     17.dem-graph{ background: #F7F7F7;
     18    background:linear-gradient( to bottom, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% );
     19}
    1720
    18 .dem-fill{ background-image:linear-gradient( to right, rgba(255,255,255,.3), transparent ); background-image:-webkit-linear-gradient( left, rgba(255,255,255,.3), transparent ); }
     21.dem-fill{ background-image:linear-gradient( to right, rgba(255,255,255,.3), transparent ); }
    1922
    2023.dem-answers .dem-label{ margin-bottom:.1em; }
  • democracy-poll/tags/6.0.4/styles/block.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* block theme -------------------------------------------------------------- */
    4 .democracy{ 
     5.democracy{
    56    border-color:#ccc; border: 1px solid rgba(0,0,0,.1); background-color:#eee; background-color:rgba(0,0,0,.1);
    67    background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.05), transparent);background-image: linear-gradient(to top, rgba(0,0,0,.05), transparent);
  • democracy-poll/tags/6.0.4/styles/inline.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* flat theme -------------------------------------------------------------- */
  • democracy-poll/tags/6.0.4/styles/minimal.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34
  • democracy-poll/trunk/classes/Admin/Admin_Page.php

    r3056337 r3282901  
    5656    }
    5757
    58     public function admin_page_load() {
     58    public function admin_page_load(): void {
    5959
    6060        // datepicker
  • democracy-poll/trunk/classes/Admin/Admin_Page_Settings.php

    r3057019 r3282901  
    179179                            <input type="checkbox" value="1"
    180180                                   name="dem[post_metabox_off]" <?php checked( options()->post_metabox_off, 1 ) ?> />
    181                             <?= esc_html__( 'Dasable post metabox.', 'democracy-poll' ) ?>
    182                         </label>
    183                         <em><?= esc_html__( 'Check this to dasable polls metabox functionality for posts where you can attached poll to a post...', 'democracy-poll' ) ?></em>
     181                            <?= esc_html__( 'Disable post metabox.', 'democracy-poll' ) ?>
     182                        </label>
     183                        <em><?= esc_html__( 'Check this to disable polls metabox functionality for posts where you can attached poll to a post...', 'democracy-poll' ) ?></em>
    184184                    </li>
    185185
  • democracy-poll/trunk/classes/Admin/Admin_Page_l10n.php

    r3056337 r3282901  
    44
    55use function DemocracyPoll\plugin;
    6 use function DemocracyPoll\options;
    76
    87class Admin_Page_l10n implements Admin_Subpage_Interface {
     
    1514    }
    1615
    17     public function load(  ){
     16    public function load(): void {
    1817    }
    1918
    20     public function request_handler(  ){
     19    public function request_handler(): void {
    2120        if( ! plugin()->super_access || ! Admin_Page::check_nonce() ){
    2221            return;
     
    4342    }
    4443
    45     public function render() {
     44    public function render(): void {
    4645        if( ! plugin()->super_access ){
    4746            return;
     
    150149     * For front part localization and custom translation setup.
    151150     */
    152     public static function add_gettext_filter(){
     151    public static function add_gettext_filter(): void {
    153152        add_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10, 4 );
    154153    }
    155154
    156     public static function remove_gettext_filter(){
     155    public static function remove_gettext_filter(): void {
    157156        remove_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10 );
    158157    }
  • democracy-poll/trunk/classes/DemPoll.php

    r3064229 r3282901  
    890890
    891891        if( $answers ){
    892             // не установлен порядок
    893             if( ! $answers[0]->aorder ){
    894                 $ord = $this->answers_order ?: options()->order_answers;
    895 
    896                 if( $ord === 'by_winner' || $ord == 1 ){
     892            $is_custom_order = (bool) reset( $answers )->aorder;
     893            if( $is_custom_order ){
     894                $answers = Helpers::objects_array_sort( $answers, [ 'aorder' => 'asc' ] );
     895            }
     896            else{
     897                $order = $this->answers_order ?: options()->order_answers;
     898
     899                if( $order === 'by_winner' || $order == 1 ){
    897900                    $answers = Helpers::objects_array_sort( $answers, [ 'votes' => 'desc' ] );
    898901                }
    899                 elseif( $ord === 'mix' ){
     902                elseif( $order === 'alphabet' ){
     903                    $answers = Helpers::objects_array_sort( $answers, [ 'answer' => 'asc' ] );
     904                }
     905                elseif( $order === 'mix' ){
    900906                    shuffle( $answers );
    901907                }
    902                 elseif( $ord === 'by_id' ){}
    903             }
    904             // по порядку
    905             else{
    906                 $answers = Helpers::objects_array_sort( $answers, [ 'aorder' => 'asc' ] );
    907             }
    908         }
    909         else {
    910             $answers = [];
     908                elseif( $order === 'by_id' ){}
     909            }
    911910        }
    912911
  • democracy-poll/trunk/classes/Helpers/Helpers.php

    r3059285 r3282901  
    99            'by_id'     => __( 'As it was added (by ID)', 'democracy-poll' ),
    1010            'by_winner' => __( 'Winners at the top', 'democracy-poll' ),
     11            'alphabet'  => __( 'Alphabetically', 'democracy-poll' ),
    1112            'mix'       => __( 'Mix', 'democracy-poll' ),
    1213        ];
  • democracy-poll/trunk/classes/Options.php

    r3057019 r3282901  
    143143    /**
    144144     * Sets $this->opt. Update options in DB if it's not set yet.
    145      *
    146      * @return void
    147145     */
    148     public function set_opt() {
     146    public function set_opt(): void {
    149147
    150148        if( ! $this->opt ){
     
    169167    public function update_single_option( $option_name, $value ): bool {
    170168
    171         $newopt = $this->opt;
    172         $newopt[ $option_name ] = $value;
    173 
    174169        if( $this->is_option_exists( $option_name ) ){
     170            $newopt = $this->opt;
     171            $newopt[ $option_name ] = $value;
     172
    175173            return (bool) update_option( self::OPT_NAME, $newopt );
    176174        }
     
    180178
    181179    /**
    182      * Updates options.
    183      *
    184180     * @param string $type  What group of option to update: main, design.
    185181     */
     
    228224
    229225    /**
    230      * Updates $this->opt based on request data.
    231      * Если опция не передана, то на её место будет записано 0.
     226     * Updates {@see self::$opt} based on request data.
     227     * If the option is not passed, 0 will be written in its place.
    232228     */
    233     private function sanitize_request_options( array $request_data, string $type ){
     229    private function sanitize_request_options( array $request_data, string $type ): void {
    234230
    235231        foreach( $this->default_options[ $type ] as $key => $v ){
     
    258254            $this->opt[ $key ] = $value;
    259255        }
    260 
    261     }
    262 
    263     /**
    264      * Checks if option name exists.
    265      */
     256    }
     257
    266258    private function is_option_exists( string $option_name ): bool {
    267259
  • democracy-poll/trunk/classes/Options_CSS.php

    r3056337 r3282901  
    5858        $styledir = DEMOC_PATH . 'styles';
    5959
    60         $out .= $this->parse_cssimport( "$styledir/$tpl" );
     60        $out .= $this->parse_css_import( "$styledir/$tpl" );
    6161        $out .= $radios ? "\n" . file_get_contents( "$styledir/checkbox-radio/$radios" ) : '';
    6262        $out .= $button ? "\n" . file_get_contents( "$styledir/buttons/$button" ) : '';
     
    138138     * Imports @import in css.
    139139     */
    140     private function parse_cssimport( $css_filepath ) {
     140    private function parse_css_import( $css_filepath ) {
    141141        $filecode = file_get_contents( $css_filepath );
    142142
  • democracy-poll/trunk/classes/Plugin.php

    r3057019 r3282901  
    3838    }
    3939
    40     public function basic_init() {
     40    public function basic_init(): void {
    4141        $this->opt->set_opt();
    4242
     
    5151    }
    5252
    53     public function init() {
     53    public function init(): void {
    5454        $this->basic_init();
    5555
    5656        $this->set_is_cachegear_on();
    5757
    58         // admin part
     58        $this->init_admin();
     59
     60        ( new Shortcodes() )->init();
     61        $this->poll_ajax = new Poll_Ajax();
     62        $this->poll_ajax->init();
     63
     64        // For front-end localization and custom translation
     65        Admin_Page_l10n::add_gettext_filter();
     66
     67        $this->menu_in_admin_bar();
     68        $this->hide_form_indexing();
     69
     70        $this->enable_widget();
     71    }
     72
     73    private function init_admin(): void {
    5974        if( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){
    6075            $this->admin = new Admin();
    6176            $this->admin->init();
    6277        }
    63 
    64         ( new Shortcodes() )->init();
    65         $this->poll_ajax = new Poll_Ajax();
    66         $this->poll_ajax->init();
    67 
    68         // For front-end localisation and custom translation
    69         Admin_Page_l10n::add_gettext_filter();
    70 
    71         // menu in the admin bar
     78    }
     79
     80    private function enable_widget(): void {
     81        if( options()->use_widget ){
     82            add_action( 'widgets_init', static function() {
     83                register_widget( Poll_Widget::class );
     84            } );
     85        }
     86    }
     87
     88    private function menu_in_admin_bar(): void {
    7289        if( $this->admin_access && $this->opt->toolbar_menu ){
    7390            add_action( 'admin_bar_menu', [ $this, 'add_toolbar_node' ], 99 );
    7491        }
    75 
    76         $this->hide_form_indexing();
    77     }
    78 
    79     // hide duplicate content. For 5+ versions it's no need
    80     private function hide_form_indexing() {
    81         // hide duplicate content. For 5+ versions it's no need
     92    }
     93
     94    /**
     95     * Hide duplicate content. For 5+ versions it's no need.
     96     */
     97    private function hide_form_indexing(): void {
     98        // Hide duplicate content. For 5+ versions it's no need
    8299        if(
    83100            isset( $_GET['dem_act'] )
     
    87104            || isset( $_GET['dem_add_user_answer'] )
    88105        ){
    89             add_action( 'wp', function() {
     106            add_action( 'wp', static function() {
    90107                status_header( 404 );
    91108            } );
    92109
    93             add_action( 'wp_head', function() {
     110            add_action( 'wp_head', static function() {
    94111                echo "\n<!--democracy-poll-->\n" . '<meta name="robots" content="noindex,nofollow">' . "\n";
    95112            } );
     
    97114    }
    98115
    99     private function set_access_caps() {
     116    private function set_access_caps(): void {
    100117        $is_adminor = current_user_can( 'manage_options' );
    101118
     
    117134    }
    118135
    119     private function set_is_cachegear_on() {
     136    private function set_is_cachegear_on(): void {
    120137
    121138        if( $this->opt->force_cachegear ){
     
    133150    }
    134151
    135     public function load_textdomain() {
     152    public function load_textdomain(): void {
    136153        load_plugin_textdomain( 'democracy-poll', false, basename( DEMOC_PATH ) . '/languages/' );
    137154    }
     
    140157     * @param \WP_Admin_Bar $toolbar
    141158     */
    142     public function add_toolbar_node( $toolbar ) {
     159    public function add_toolbar_node( $toolbar ): void {
    143160
    144161        $toolbar->add_node( [
     
    229246     * Adds scripts to the footer.
    230247     */
    231     public function add_js_once() {
     248    public function add_js_once(): void {
    232249        static $once = 0;
    233250        if( $once++ ){
     
    245262    }
    246263
    247     public static function _add_js_wp_footer() {
     264    public static function _add_js_wp_footer(): void {
    248265        echo "\n" . '<script id="democracy-poll">' . file_get_contents( DEMOC_PATH . 'js/democracy.min.js' ) . '</script>' . "\n";
    249266    }
  • democracy-poll/trunk/classes/Poll_Ajax.php

    r3056337 r3282901  
    1717
    1818        // to work without AJAX
    19         if( isset( $_POST['dem_act'] ) &&
    20             ( ! isset( $_POST['action'] ) || 'dem_ajax' !== $_POST['action'] )
     19        if(
     20            isset( $_POST['dem_act'] )
     21            && ( ! isset( $_POST['action'] ) || 'dem_ajax' !== $_POST['action'] )
    2122        ){
    2223            add_action( 'init', [ $this, 'not_ajax_request_handler' ], 99 );
     
    2425    }
    2526
    26     # Делает предваритеьную проверку передавемых переменных запроса
     27    /**
     28     * Does a preliminary sanitization of the passed request variables.
     29     */
    2730    public function sanitize_request_vars(): array {
    28 
    2931        return [
    3032            'act'  => sanitize_text_field( $_POST['dem_act'] ?? '' ),
     
    3436    }
    3537
    36     # обрабатывает запрос AJAX
    3738    public function ajax_request_handler() {
    3839
     
    4950        $poll = new \DemPoll( $vars->pid );
    5051
    51         // switch
    52         // голосуем и выводим результаты
     52        // vote and display results
    5353        if( 'vote' === $vars->act && $vars->aids ){
    5454            $voted = $poll->vote( $vars->aids );
     
    6565            }
    6666        }
    67         // удаляем результаты
     67        // delete results
    6868        elseif( 'delVoted' === $vars->act ){
    6969            $poll->delete_vote();
    7070            echo $poll->get_vote_screen();
    7171        }
    72         // смотрим результаты
     72        // view results
    7373        elseif( 'view' === $vars->act ){
    7474            if( $poll->not_show_results ){
     
    7979            }
    8080        }
    81         // вернуться к голосованию
     81        // back to voting
    8282        elseif( 'vote_screen' === $vars->act ){
    8383            echo $poll->get_vote_screen();
    8484        }
     85        // get poll->votedFor value (from db)
    8586        elseif( 'getVotedIds' === $vars->act ){
    8687            if( $poll->votedFor ){
    87                 $poll->set_cookie(); // Установим куки, т.к. этот запрос делается только если куки не установлены
     88                $poll->set_cookie(); // Set cookies, since this request is only made if cookies are not set
    8889                echo $poll->votedFor;
    8990            }
    9091            elseif( $poll->blockForVisitor ){
    91                 echo 'blockForVisitor'; // чтобы вывести заметку
     92                echo 'blockForVisitor'; // to display a note
    9293            }
    9394            else{
    94                 // если не голосовал ставим куки на пол дня, чтобы не делать эту проверку каждый раз
     95                // If not voted, set a cookie for half a day to don't do this check every time.
    9596                $poll->set_cookie( 'notVote', ( time() + ( DAY_IN_SECONDS / 2 ) ) );
    9697            }
  • democracy-poll/trunk/classes/Utils/Activator.php

    r3057019 r3282901  
    77class Activator {
    88
    9     public static function set_db_tables() {
     9    public static function set_db_tables(): void {
    1010        global $wpdb;
    1111        $wpdb->democracy_q   = $wpdb->prefix . 'democracy_q';
     
    1414    }
    1515
    16     public static function activate() {
     16    public static function activate(): void {
    1717        plugin()->basic_init();
    1818
     
    3030    }
    3131
    32     private static function _activate() {
     32    private static function _activate(): void {
    3333        // create tables
    3434        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     
    4040    }
    4141
    42     private static function add_sample_poll(){
     42    private static function add_sample_poll(): void {
    4343        global $wpdb;
    4444
  • democracy-poll/trunk/classes/Utils/Migrator__WP_Polls.php

    r3056337 r3282901  
    6969
    7070use function DemocracyPoll\plugin;
    71 use function DemocracyPoll\options;
    7271
    7372class Migrator__WP_Polls {
    7473
    75     public function migrate() {
     74    public function migrate(): void {
    7675        global $wpdb;
    7776
  • democracy-poll/trunk/democracy.php

    r3064229 r3282901  
    22/**
    33 * Plugin Name: Democracy Poll
    4  * Description: Allows to create democratic polls. Visitors can vote for more than one answer & add their own answers.
     4 * Description: Allows creation of democratic polls. Visitors can vote for multiple answers and add their own answers.
    55 *
    66 * Author: Kama
     
    1111 * Domain Path: /languages/
    1212 *
    13  * Requires at least: 4.7
    14  * Requires PHP: 7.0
     13 * Requires at least: 5.8
     14 * Requires PHP: 7.4
    1515 *
    16  * Version: 6.0.3
     16 * Version: 6.0.4
    1717 */
    1818
     
    3232register_activation_hook( __FILE__, [ \DemocracyPoll\Utils\Activator::class, 'activate' ] );
    3333
    34 add_action( 'plugins_loaded', '\DemocracyPoll\init' );
    35 function init() {
    36     plugin()->init();
    37 
    38     // enable widget
    39     if( options()->use_widget ){
    40         add_action( 'widgets_init', function() {
    41             register_widget( \DemocracyPoll\Poll_Widget::class );
    42         } );
    43     }
    44 }
    45 
    46 
     34/**
     35 * NOTE: Init the plugin later on the 'after_setup_theme' hook to
     36 * run current_user_can() later to avoid possible conflicts.
     37 */
     38add_action( 'after_setup_theme', [ plugin(), 'init' ] );
  • democracy-poll/trunk/js/_js-cookie.js

    r2675427 r3282901  
    11// includes in democracy.js
    22
    3 /*!
    4  * JavaScript Cookie v2.2.0
    5  * https://github.com/js-cookie/js-cookie
    6  *
    7  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
    8  * Released under the MIT license
    9  */
    10 ;(function (factory) {
    11     var registeredInModuleLoader;
    12     if (typeof define === 'function' && define.amd) {
    13         define(factory);
    14         registeredInModuleLoader = true;
    15     }
    16     if (typeof exports === 'object') {
    17         module.exports = factory();
    18         registeredInModuleLoader = true;
    19     }
    20     if (!registeredInModuleLoader) {
    21         var OldCookies = window.Cookies;
    22         var api = window.Cookies = factory();
    23         api.noConflict = function () {
    24             window.Cookies = OldCookies;
    25             return api;
    26         };
    27     }
    28 }(function () {
    29     function extend () {
    30         var i = 0;
    31         var result = {};
    32         for (; i < arguments.length; i++) {
    33             var attributes = arguments[ i ];
    34             for (var key in attributes) {
    35                 result[key] = attributes[key];
     3// https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.js
     4// https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.js
     5
     6/*! js-cookie v3.0.5 | MIT */
     7;
     8(function (global, factory) {
     9    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
     10        typeof define === 'function' && define.amd ? define(factory) :
     11            (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
     12                var current = global.Cookies;
     13                var exports = global.Cookies = factory();
     14                exports.noConflict = function () { global.Cookies = current; return exports; };
     15            })());
     16})(this, (function () { 'use strict';
     17
     18    /* eslint-disable no-var */
     19    function assign (target) {
     20        for (var i = 1; i < arguments.length; i++) {
     21            var source = arguments[i];
     22            for (var key in source) {
     23                target[key] = source[key];
    3624            }
    3725        }
    38         return result;
     26        return target
    3927    }
     28    /* eslint-enable no-var */
    4029
    41     function decode (s) {
    42         return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
    43     }
     30    /* eslint-disable no-var */
     31    var defaultConverter = {
     32        read: function (value) {
     33            if (value[0] === '"') {
     34                value = value.slice(1, -1);
     35            }
     36            return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
     37        },
     38        write: function (value) {
     39            return encodeURIComponent(value).replace(
     40                /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
     41                decodeURIComponent
     42            )
     43        }
     44    };
     45    /* eslint-enable no-var */
    4446
    45     function init (converter) {
    46         function api() {}
     47    /* eslint-disable no-var */
    4748
    48         function set (key, value, attributes) {
     49    function init (converter, defaultAttributes) {
     50        function set (name, value, attributes) {
    4951            if (typeof document === 'undefined') {
    50                 return;
     52                return
    5153            }
    5254
    53             attributes = extend({
    54                 path: '/'
    55             }, api.defaults, attributes);
     55            attributes = assign({}, defaultAttributes, attributes);
    5656
    5757            if (typeof attributes.expires === 'number') {
    58                 attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
     58                attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
     59            }
     60            if (attributes.expires) {
     61                attributes.expires = attributes.expires.toUTCString();
    5962            }
    6063
    61             // We're using "expires" because "max-age" is not supported by IE
    62             attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
    63 
    64             try {
    65                 var result = JSON.stringify(value);
    66                 if (/^[\{\[]/.test(result)) {
    67                     value = result;
    68                 }
    69             } catch (e) {}
    70 
    71             value = converter.write ?
    72                 converter.write(value, key) :
    73                 encodeURIComponent(String(value))
    74                     .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
    75 
    76             key = encodeURIComponent(String(key))
    77                 .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
    78                 .replace(/[\(\)]/g, escape);
     64            name = encodeURIComponent(name)
     65                .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
     66                .replace(/[()]/g, escape);
    7967
    8068            var stringifiedAttributes = '';
    8169            for (var attributeName in attributes) {
    8270                if (!attributes[attributeName]) {
    83                     continue;
     71                    continue
    8472                }
     73
    8574                stringifiedAttributes += '; ' + attributeName;
     75
    8676                if (attributes[attributeName] === true) {
    87                     continue;
     77                    continue
    8878                }
    8979
     
    9888            }
    9989
    100             return (document.cookie = key + '=' + value + stringifiedAttributes);
     90            return (document.cookie =
     91                name + '=' + converter.write(value, name) + stringifiedAttributes)
    10192        }
    10293
    103         function get (key, json) {
    104             if (typeof document === 'undefined') {
    105                 return;
     94        function get (name) {
     95            if (typeof document === 'undefined' || (arguments.length && !name)) {
     96                return
    10697            }
    10798
    108             var jar = {};
    10999            // To prevent the for loop in the first place assign an empty array
    110100            // in case there are no cookies at all.
    111101            var cookies = document.cookie ? document.cookie.split('; ') : [];
    112             var i = 0;
    113 
    114             for (; i < cookies.length; i++) {
     102            var jar = {};
     103            for (var i = 0; i < cookies.length; i++) {
    115104                var parts = cookies[i].split('=');
    116                 var cookie = parts.slice(1).join('=');
    117 
    118                 if (!json && cookie.charAt(0) === '"') {
    119                     cookie = cookie.slice(1, -1);
    120                 }
     105                var value = parts.slice(1).join('=');
    121106
    122107                try {
    123                     var name = decode(parts[0]);
    124                     cookie = (converter.read || converter)(cookie, name) ||
    125                         decode(cookie);
     108                    var found = decodeURIComponent(parts[0]);
     109                    jar[found] = converter.read(value, found);
    126110
    127                     if (json) {
    128                         try {
    129                             cookie = JSON.parse(cookie);
    130                         } catch (e) {}
    131                     }
    132 
    133                     jar[name] = cookie;
    134 
    135                     if (key === name) {
    136                         break;
     111                    if (name === found) {
     112                        break
    137113                    }
    138114                } catch (e) {}
    139115            }
    140116
    141             return key ? jar[key] : jar;
     117            return name ? jar[name] : jar
    142118        }
    143119
    144         api.set = set;
    145         api.get = function (key) {
    146             return get(key, false /* read as raw */);
    147         };
    148         api.getJSON = function (key) {
    149             return get(key, true /* read as json */);
    150         };
    151         api.remove = function (key, attributes) {
    152             set(key, '', extend(attributes, {
    153                 expires: -1
    154             }));
    155         };
    156 
    157         api.defaults = {};
    158 
    159         api.withConverter = init;
    160 
    161         return api;
     120        return Object.create(
     121            {
     122                set,
     123                get,
     124                remove: function (name, attributes) {
     125                    set(
     126                        name,
     127                        '',
     128                        assign({}, attributes, {
     129                            expires: -1
     130                        })
     131                    );
     132                },
     133                withAttributes: function (attributes) {
     134                    return init(this.converter, assign({}, this.attributes, attributes))
     135                },
     136                withConverter: function (converter) {
     137                    return init(assign({}, this.converter, converter), this.attributes)
     138                }
     139            },
     140            {
     141                attributes: { value: Object.freeze(defaultAttributes) },
     142                converter: { value: Object.freeze(converter) }
     143            }
     144        )
    162145    }
    163146
    164     return init(function () {});
     147    var api = init(defaultConverter, { path: '/' });
     148    /* eslint-enable no-var */
     149
     150    return api;
     151
    165152}));
  • democracy-poll/trunk/js/democracy.js

    r3056337 r3282901  
    1 
    21includefile = '_js-cookie.js'
    32
     3
    44// wait for jQuery
    5 let demwaitjquery = setInterval( function(){
    6 
    7     if( typeof jQuery !== 'undefined' ){
    8         clearInterval( demwaitjquery )
    9 
    10         jQuery( document ).ready( democracyInit )
    11     }
    12 }, 50 )
    13 
    14 function democracyInit( $ ){
     5document.addEventListener( 'DOMContentLoaded', democracyInit )
     6
     7function democracyInit(){
    158
    169    let demmainsel = '.democracy'
    17     let $dems = $( demmainsel )
    18 
    19     if( ! $dems.length )
     10    let $dems = jQuery( demmainsel )
     11
     12    if( ! $dems.length ){
    2013        return
    21 
    22     let demScreen = '.dem-screen' // селектор контейнера с результатами
    23     let userAnswer = '.dem-add-answer-txt' // класс поля free ответа
    24     let $demLoader = $( '.dem-loader:first' )
     14    }
     15
     16    let demScreen = '.dem-screen' // result container selector
     17    let userAnswer = '.dem-add-answer-txt' // "free" answer field class
     18    let $demLoader = jQuery( '.dem-loader:first' )
    2519    let loader
    2620    let Dem = {}
     
    3933        let demScreensSetHeight = function(){
    4034            $demScreens.each( function(){
    41                 Dem.setHeight( $( this ), 1 )
     35                Dem.setHeight( jQuery( this ), 1 )
    4236            } )
    4337        }
     
    4539        $demScreens.demInitActions( 1 )
    4640
    47         $( window ).on( 'resize.demsetheight', demScreensSetHeight ) // высота при ресайзе
    48 
    49         $( window ).on( 'load', demScreensSetHeight ) // высота еще раз
     41        jQuery( window ).on( 'resize.demsetheight', demScreensSetHeight ) // высота при ресайзе
     42
     43        jQuery( window ).on( 'load', demScreensSetHeight ) // высота еще раз
    5044
    5145        Dem.maxAnswLimitInit() // ограничение выбора мульти ответов
     
    5650         * и дополнительные js переменные и методы самого Democracy.
    5751         */
    58         var $cache = $( '.dem-cache-screens' )
     52        var $cache = jQuery( '.dem-cache-screens' )
    5953        if( $cache.length > 0 ){
    6054            //console.log('Democracy cache gear ON');
     
    6761    // Инициализация всех событий связаных с внутренней частью каждого опроса: клики, высота, скрытие кнопки
    6862    // применяется на '.dem-screen'
    69     $.fn.demInitActions = function( noanimation ){
     63    jQuery.fn.demInitActions = function( noanimation ){
    7064
    7165        return this.each( function(){
    7266            // Устанавливает события клика для всех помеченных элементов в переданом элементе:
    7367            // тут и AJAX запрос по клику и другие интерактивные события Democracy ----------
    74             var $this = $( this )
     68            var $this = jQuery( this )
    7569            var attr = 'data-dem-act'
    7670
    7771            $this.find( '[' + attr + ']' ).each( function(){
    78                 var $the = $( this )
     72                var $the = jQuery( this )
    7973                $the.attr( 'href', '' ) // удалим УРЛ чтобы не было видно УРЛ запроса
    8074
     
    9589            if( Dem.lineAnimSpeed ){
    9690                $this.find( '.dem-fill' ).each( function(){
    97                     var $fill = $( this )
     91                    var $fill = jQuery( this )
    9892                    //setTimeout(function(){ fill.style.width = was; }, Dem.animSpeed + 500); // на базе CSS transition - при сбросе тоже срабатывает и мешает...
    9993                    setTimeout( function(){
     
    111105                e.preventDefault()
    112106
    113                 var act = $( this ).find( 'input[name="dem_act"]' ).val()
     107                var act = jQuery( this ).find( 'input[name="dem_act"]' ).val()
    114108                if( act )
    115                     $( this ).demDoAction( $( this ).find( 'input[name="dem_act"]' ).val() )
     109                    jQuery( this ).demDoAction( jQuery( this ).find( 'input[name="dem_act"]' ).val() )
    116110            } )
    117111        } )
     
    119113
    120114    // Loader
    121     $.fn.demSetLoader = function(){
    122         var $the = this
    123 
    124         if( $demLoader.length )
     115    jQuery.fn.demSetLoader = function(){
     116        const $the = this
     117
     118        if( $demLoader.length ){
    125119            $the.closest( demScreen ).append( $demLoader.clone().css( 'display', 'table' ) )
    126         else
    127             loader = setTimeout( function(){
    128                 Dem.demLoadingDots( $the )
    129             }, 50 ) // dots
     120        }
     121        else {
     122            loader = setTimeout( () => Dem.demLoadingDots( $the[0] ), 50 )
     123        }
    130124
    131125        return this
    132126    }
    133127
    134     $.fn.demUnsetLoader = function(){
     128    jQuery.fn.demUnsetLoader = function(){
    135129
    136130        if( $demLoader.length )
     
    143137
    144138    // Добавить ответ пользователя (ссылка)
    145     $.fn.demAddAnswer = function(){
     139    jQuery.fn.demAddAnswer = function(){
    146140
    147141        var $the = this.first()
    148142        var $demScreen = $the.closest( demScreen )
    149143        var isMultiple = $demScreen.find( '[type=checkbox]' ).length > 0
    150         var $input = $( '<input type="text" class="' + userAnswer.replace( /\./, '' ) + '" value="">' ) // поле добавления ответа
     144        var $input = jQuery( '<input type="text" class="' + userAnswer.replace( /\./, '' ) + '" value="">' ) // поле добавления ответа
    151145
    152146        // покажем кнопку голосования
     
    156150        $demScreen.find( '[type=radio]' ).each( function(){
    157151
    158             $( this ).on( 'click', function(){
     152            jQuery( this ).on( 'click', function(){
    159153                $the.fadeIn( 300 )
    160                 $( userAnswer ).remove()
    161             } )
    162 
    163             if( 'radio' === $( this )[0].type )
     154                jQuery( userAnswer ).remove()
     155            } )
     156
     157            if( 'radio' === jQuery( this )[0].type )
    164158                this.checked = false // uncheck
    165159        } )
     
    173167            var $ua = $demScreen.find( userAnswer )
    174168
    175             $( '<span class="dem-add-answer-close">×</span>' )
     169            jQuery( '<span class="dem-add-answer-close">×</span>' )
    176170                .insertBefore( $ua )
    177171                .css( 'line-height', $ua.outerHeight() + 'px' )
    178172                .on( 'click', function(){
    179                     var $par = $( this ).parent( 'li' )
     173                    var $par = jQuery( this ).parent( 'li' )
    180174                    $par.find( 'input' ).remove()
    181175                    $par.find( 'a' ).fadeIn( 300 )
    182                     $( this ).remove()
     176                    jQuery( this ).remove()
    183177                } )
    184178        }
     
    188182
    189183    // Собирает ответы и возращает их в виде строки
    190     $.fn.demCollectAnsw = function(){
     184    jQuery.fn.demCollectAnsw = function(){
    191185        var $form = this.closest( 'form' )
    192186        var $answers = $form.find( '[type=checkbox],[type=radio],[type=text]' )
     
    198192        if( $checkbox.length > 0 ){
    199193            $checkbox.each( function(){
    200                 answ.push( $( this ).val() )
     194                answ.push( jQuery( this ).val() )
    201195            } )
    202196        }
     
    219213
    220214    // обрабатывает запросы при клике, вешается на событие клика
    221     $.fn.demDoAction = function( act ){
     215    jQuery.fn.demDoAction = function( action ){
    222216
    223217        var $the = this.first()
     
    225219        var data = {
    226220            dem_pid: $dem.data( 'opts' ).pid,
    227             dem_act: act,
     221            dem_act: action,
    228222            action : 'dem_ajax'
    229223        }
     
    235229
    236230        // Соберем ответы
    237         if( 'vote' === act ){
     231        if( 'vote' === action ){
    238232            data.answer_ids = $the.demCollectAnsw()
    239233            if( ! data.answer_ids ){
    240                 Dem.demShake( $the )
     234                Dem.demShake( $the[0] )
    241235                return false
    242236            }
     
    244238
    245239        // кнопка переголосовать, подтверждение
    246         if( 'delVoted' === act && !confirm( $the.data( 'confirm-text' ) ) )
     240        if( 'delVoted' === action && !confirm( $the.data( 'confirm-text' ) ) )
    247241            return false
    248242
    249243        // кнопка добавления ответа посетителя
    250         if( 'newAnswer' === act ){
     244        if( 'newAnswer' === action ){
    251245            $the.demAddAnswer()
    252246            return false
     
    255249        // AJAX
    256250        $the.demSetLoader()
    257         $.post( Dem.ajaxurl, data,
    258             function( respond ){
    259                 $the.demUnsetLoader()
    260 
    261                 // устанавливаем все события
    262                 $the.closest( demScreen ).html( respond ).demInitActions()
    263 
    264                 // прокрутим к началу блока опроса
    265                 setTimeout( function(){
    266                     $( 'html:first,body:first' ).animate( { scrollTop: $dem.offset().top - 70 }, 500 )
    267                 }, 200 )
    268             }
    269         )
     251        jQuery.post( Dem.ajaxurl, data, function( respond ){
     252            $the.demUnsetLoader()
     253
     254            // устанавливаем все события
     255            $the.closest( demScreen ).html( respond ).demInitActions()
     256
     257            // прокрутим к началу блока опроса
     258            setTimeout( function(){
     259                jQuery( 'html:first,body:first' ).animate( { scrollTop: $dem.offset().top - 70 }, 500 )
     260            }, 200 )
     261        } )
    270262
    271263        return false
     
    276268
    277269    // показывает заметку
    278     $.fn.demCacheShowNotice = function( type ){
     270    jQuery.fn.demCacheShowNotice = function( type ){
    279271
    280272        var $the = this.first(),
     
    307299                votedtxt = $dema.data( 'voted-txt' )
    308300
    309             $.each( aids, function( key, val ){
     301            jQuery.each( aids, function( key, val ){
    310302                $screen.find( '[data-aid="' + val + '"]' )
    311303                    .addClass( votedClass )
    312304                    .attr( 'title', function(){
    313                         return votedtxt + $( this ).attr( 'title' )
     305                        return votedtxt + jQuery( this ).attr( 'title' )
    314306                    } )
    315307            } )
     
    325317
    326318            // устанавливаем ответы
    327             $.each( aids, function( key, val ){
     319            jQuery.each( aids, function( key, val ){
    328320                $answs.filter( '[data-aid="' + val + '"]' ).find( 'input' ).prop( 'checked', 'checked' )
    329321            } )
     
    350342    }
    351343
    352     $.fn.demCacheInit = function(){
     344    jQuery.fn.demCacheInit = function(){
    353345
    354346        return this.each( function(){
    355347
    356             var $the = $( this )
     348            var $the = jQuery( this )
    357349
    358350            // ищем главный блок
    359351            var $dem = $the.prevAll( demmainsel + ':first' )
    360             if( !$dem.length )
     352            if( ! $dem.length )
    361353                $dem = $the.closest( demmainsel )
    362354
    363             if( !$dem.length ){
     355            if( ! $dem.length ){
    364356                console.warn( 'Democracy: Main dem div not found' )
    365357                return
     
    377369
    378370            // если опрос закрыт должны кэшироваться только результаты голосования. Просто выходим.
    379             if( !voteHTML )
     371            if( ! voteHTML ){
    380372                return
     373            }
    381374
    382375            // устанавливаем нужный кэш
     
    392385            $screen.demInitActions( 1 )
    393386
    394             if( notVoteFlag )
    395                 return // если уже проверялось, что пользователь не голосовал, выходим
    396 
    397             // Если голосов нет в куках и опция плагина keep_logs включена,
    398             // отправляем запрос в БД на проверку, по событию (наведение мышки на блок),
    399             if( !isAnswrs && $the.data( 'opt_logs' ) == 1 ){
     387            if( notVoteFlag ){
     388                return; // exit if it has already been checked that the user has not voted.
     389            }
     390
     391            // If there are no votes in cookies and the plugin option keep_logs is enabled,
     392            // send a request to the database for checking, by event (mouse over a block).
     393            if( ! isAnswrs && $the.data( 'opt_logs' ) == 1 ){
    400394                var tmout
    401395                var notcheck__fn = function(){
     
    413407                        $forDotsLoader.demSetLoader()
    414408
    415                         $.post( Dem.ajaxurl,
     409                        jQuery.post( Dem.ajaxurl,
    416410                            {
    417411                                dem_pid: $dem.data( 'opts' ).pid,
     
    421415                            function( reply ){
    422416                                $forDotsLoader.demUnsetLoader()
    423                                 if( !reply ) return // выходим если нет ответов
     417                                // exit if there are no answers
     418                                if( ! reply ){
     419                                    return;
     420                                }
    424421
    425422                                $screen.html( votedHTML )
     
    428425                                $screen.demInitActions()
    429426
    430                                 // сообщение, что голосовал или только для пользователей
     427                                // a message that you have voted or for users only
    431428                                $screen.demCacheShowNotice( reply )
    432429                            }
    433430                        )
    434431                    }, 700 )
    435                     // 700 для оптимизации, чтобы моментально не отправлялся запрос, если мышкой просто провели по опросу...
     432                    // 700 for optimization, so that the request is not sent instantly if you just swipe the mouse on the survey...
    436433                }
    437434
     
    471468            $that.css( { opacity: 0 } )
    472469                .animate( { height: newH }, Dem.animSpeed, function(){
    473                     $( this ).animate( { opacity: 1 }, Dem.animSpeed * 1.5 )
     470                    jQuery( this ).animate( { opacity: 1 }, Dem.animSpeed * 1.5 )
    474471                } )
    475472        }
     
    496493            $el.css( 'position', 'relative' )
    497494
    498             var $overlay = $( '<span class="dem__collapser"><span class="arr"></span></span>' ).appendTo( $el )
     495            var $overlay = jQuery( '<span class="dem__collapser"><span class="arr"></span></span>' ).appendTo( $el )
    499496            var fn__expand = function(){
    500497                $overlay.addClass( 'expanded' ).removeClass( 'collapsed' )
     
    565562        $dems.on( 'change', 'input[type="checkbox"]', function(){
    566563
    567             var maxAnsws = $( this ).closest( demmainsel ).data( 'opts' ).max_answs
    568             var $checkboxs = $( this ).closest( demScreen ).find( 'input[type="checkbox"]' )
     564            var maxAnsws = jQuery( this ).closest( demmainsel ).data( 'opts' ).max_answs
     565            var $checkboxs = jQuery( this ).closest( demScreen ).find( 'input[type="checkbox"]' )
    569566            var $checked = $checkboxs.filter( ':checked' ).length
    570567
    571568            if( $checked >= maxAnsws ){
    572569                $checkboxs.filter( ':not(:checked)' ).each( function(){
    573                     $( this ).prop( 'disabled', true ).closest( 'li' ).addClass( 'dem-disabled' )
     570                    jQuery( this ).prop( 'disabled', true ).closest( 'li' ).addClass( 'dem-disabled' )
    574571                } )
    575572            }
    576573            else {
    577574                $checkboxs.each( function(){
    578                     $( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )
     575                    jQuery( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )
    579576                } )
    580577            }
     
    582579    }
    583580
    584     Dem.demShake = function( $that ){
    585 
    586         var pos = $that.css( 'position' )
    587 
    588         pos && 'static' !== pos || $that.css( 'position', 'relative' )
    589 
    590         for( pos = 1; 2 >= pos; pos++ )
    591             $that.animate( { left: -10 }, 50 ).animate( { left: 10 }, 100 ).animate( { left: 0 }, 50 )
    592     }
    593 
    594     // dots loading animation - ...
    595     Dem.demLoadingDots = function( $el ){
    596         var $the = $el,
    597             isInput = $the.is( 'input' ),
    598             str = (isInput) ? $the.val() : $the.html()
    599 
    600         if( str.substring( str.length - 3 ) === '...' ){
    601             if( isInput )
    602                 $the[0].value = str.substring( 0, str.length - 3 )
    603             else
    604                 $the[0].innerHTML = str.substring( 0, str.length - 3 )
    605         }
    606         else {
    607             if( isInput )
    608                 $the[0].value += '.'
    609             else
    610                 $the[0].innerHTML += '.'
    611         }
    612 
    613         loader = setTimeout( function(){
    614             Dem.demLoadingDots( $the )
    615         }, 200 )
     581    Dem.demShake = function( el ){
     582        const position = window.getComputedStyle( el ).position
     583        if( ! position || position === 'static' ){
     584            el.style.position = 'relative'
     585        }
     586
     587        const keyframes = [
     588            { left: '0px' },
     589            { left: '-10px', offset: 0.2 },
     590            { left: '10px', offset: 0.40 },
     591            { left: '-10px', offset: 0.60 },
     592            { left: '10px', offset: 0.80 },
     593            { left: '0px', offset: 1 }
     594        ]
     595        const timing = { duration: 500, iterations: 1, easing: 'linear' }
     596        el.animate( keyframes, timing )
     597    }
     598
     599    // dots loading animation: ...
     600    Dem.demLoadingDots = function( el ){
     601        let isInput = (el.tagName.toLowerCase() === 'input')
     602        let str = isInput ? el.value : el.innerHTML
     603
     604        if( str.slice( -3 ) === '...' ){
     605            el[isInput ? 'value' : 'innerHTML'] = str.slice( 0, -3 )
     606        }
     607        else{
     608            el[isInput ? 'value' : 'innerHTML'] += '.'
     609        }
     610
     611        loader = setTimeout( () => Dem.demLoadingDots( el ), 200 )
    616612    }
    617613
    618614}
    619 
    620 
    621 
    622 
    623 
  • democracy-poll/trunk/js/democracy.min.js

    r3056337 r3282901  
    1 /*!
    2  * JavaScript Cookie v2.2.0
    3  * https://github.com/js-cookie/js-cookie
    4  *
    5  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
    6  * Released under the MIT license
    7  */
    8 !function(e){var t;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,i=window.Cookies=e();i.noConflict=function(){return window.Cookies=n,i}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function o(){}function a(t,n,a){if("undefined"!=typeof document){"number"==typeof(a=e({path:"/"},o.defaults,a)).expires&&(a.expires=new Date(1*new Date+864e5*a.expires)),a.expires=a.expires?a.expires.toUTCString():"";try{var s=JSON.stringify(n);/^[\{\[]/.test(s)&&(n=s)}catch(e){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var d="";for(var r in a)a[r]&&(d+="; "+r,!0!==a[r]&&(d+="="+a[r].split(";")[0]));return document.cookie=t+"="+n+d}}function s(e,n){if("undefined"!=typeof document){for(var o={},a=document.cookie?document.cookie.split("; "):[],s=0;s<a.length;s++){var d=a[s].split("="),r=d.slice(1).join("=");n||'"'!==r.charAt(0)||(r=r.slice(1,-1));try{var c=t(d[0]);if(r=(i.read||i)(r,c)||t(r),n)try{r=JSON.parse(r)}catch(e){}if(o[c]=r,e===c)break}catch(e){}}return e?o[e]:o}}return o.set=a,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,n){a(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}));var demwaitjquery=setInterval((function(){"undefined"!=typeof jQuery&&(clearInterval(demwaitjquery),jQuery(document).ready(democracyInit))}),50);function democracyInit(e){var t=".democracy",n=e(t);if(n.length){var i,o=".dem-screen",a=".dem-add-answer-txt",s=e(".dem-loader:first"),d={};d.opts=n.first().data("opts"),d.ajaxurl=d.opts.ajax_url,d.answMaxHeight=d.opts.answs_max_height,d.animSpeed=parseInt(d.opts.anim_speed),d.lineAnimSpeed=parseInt(d.opts.line_anim_speed),setTimeout((function(){var t=n.find(o).filter(":visible"),i=function(){t.each((function(){d.setHeight(e(this),1)}))};t.demInitActions(1),e(window).on("resize.demsetheight",i),e(window).on("load",i),d.maxAnswLimitInit();var a=e(".dem-cache-screens");a.length>0&&a.demCacheInit()}),1),e.fn.demInitActions=function(t){return this.each((function(){var n=e(this),i="data-dem-act";n.find("["+i+"]").each((function(){var t=e(this);t.attr("href",""),t.on("click",(function(e){e.preventDefault(),t.blur().demDoAction(t.attr(i))}))})),!!n.find("input[type=radio][data-dem-act=vote]").first().length&&n.find(".dem-vote-button").hide(),d.setAnswsMaxHeight(n),d.lineAnimSpeed&&n.find(".dem-fill").each((function(){var t=e(this);setTimeout((function(){t.animate({width:t.data("width")},d.lineAnimSpeed)}),d.animSpeed,"linear")})),d.setHeight(n,t),n.find("form").on("submit",(function(t){t.preventDefault(),e(this).find('input[name="dem_act"]').val()&&e(this).demDoAction(e(this).find('input[name="dem_act"]').val())}))}))},e.fn.demSetLoader=function(){var e=this;return s.length?e.closest(o).append(s.clone().css("display","table")):i=setTimeout((function(){d.demLoadingDots(e)}),50),this},e.fn.demUnsetLoader=function(){return s.length?this.closest(o).find(".dem-loader").remove():clearTimeout(i),this},e.fn.demAddAnswer=function(){var t=this.first(),n=t.closest(o),i=n.find("[type=checkbox]").length>0,s=e('<input type="text" class="'+a.replace(/\./,"")+'" value="">');if(n.find(".dem-vote-button").show(),n.find("[type=radio]").each((function(){e(this).on("click",(function(){t.fadeIn(300),e(a).remove()})),"radio"===e(this)[0].type&&(this.checked=!1)})),t.hide().parent("li").append(s),s.hide().fadeIn(300).focus(),i){var d=n.find(a);e('<span class="dem-add-answer-close">×</span>').insertBefore(d).css("line-height",d.outerHeight()+"px").on("click",(function(){var t=e(this).parent("li");t.find("input").remove(),t.find("a").fadeIn(300),e(this).remove()}))}return!1},e.fn.demCollectAnsw=function(){var t=this.closest("form"),n=t.find("[type=checkbox],[type=radio],[type=text]"),i=t.find(a).val(),o=[],s=n.filter("[type=checkbox]:checked");if(s.length>0)s.each((function(){o.push(e(this).val())}));else{var d=n.filter("[type=radio]:checked");d.length&&o.push(d.val())}return i&&o.push(i),(o=o.join("~"))||""},e.fn.demDoAction=function(n){var i=this.first(),a=i.closest(t),s={dem_pid:a.data("opts").pid,dem_act:n,action:"dem_ajax"};return void 0===s.dem_pid?(console.log("Poll id is not defined!"),!1):"vote"!==n||(s.answer_ids=i.demCollectAnsw(),s.answer_ids)?!("delVoted"===n&&!confirm(i.data("confirm-text")))&&("newAnswer"===n?(i.demAddAnswer(),!1):(i.demSetLoader(),e.post(d.ajaxurl,s,(function(t){i.demUnsetLoader(),i.closest(o).html(t).demInitActions(),setTimeout((function(){e("html:first,body:first").animate({scrollTop:a.offset().top-70},500)}),200)})),!1)):(d.demShake(i),!1)},e.fn.demCacheShowNotice=function(e){var t=this.first(),n=t.find(".dem-youarevote").first();return"blockForVisitor"===e&&(t.find(".dem-revote-button").remove(),n=t.find(".dem-only-users").first()),t.prepend(n.show()),setTimeout((function(){n.slideUp("slow")}),1e4),this},d.cacheSetAnswrs=function(t,n){var i=n.split(/,/);if(t.hasClass("voted")){var o=t.find(".dem-answers"),a=o.data("voted-class"),s=o.data("voted-txt");e.each(i,(function(n,i){t.find('[data-aid="'+i+'"]').addClass(a).attr("title",(function(){return s+e(this).attr("title")}))})),t.find(".dem-vote-link").remove()}else{var d=t.find("[data-aid]"),r=t.find(".dem-voted-button");e.each(i,(function(e,t){d.filter('[data-aid="'+t+'"]').find("input").prop("checked","checked")})),d.find("input").prop("disabled","disabled"),t.find(".dem-vote-button").remove(),r.length?r.show():(t.find('input[value="vote"]').remove(),t.find(".dem-revote-button-wrap").show())}},e.fn.demCacheInit=function(){return this.each((function(){var n=e(this),i=n.prevAll(t+":first");if(i.length||(i=n.closest(t)),i.length){var a=i.find(o).first(),s=i.data("opts").pid,r=Cookies.get("demPoll_"+s),c="notVote"===r,f=!(void 0===r||c),l=n.find(o+"-cache.vote").html(),h=n.find(o+"-cache.voted").html();if(l){var u=f&&h;if(a.html((u?h:l)+"\x3c!--cache--\x3e").removeClass("vote voted").addClass(u?"voted":"vote"),f&&d.cacheSetAnswrs(a,r),a.demInitActions(1),!c&&!f&&1==n.data("opt_logs")){var m,p=function(){m=setTimeout((function(){if(!i.hasClass("checkAnswDone")){i.addClass("checkAnswDone");var t=i.find(".dem-link").first();t.demSetLoader(),e.post(d.ajaxurl,{dem_pid:i.data("opts").pid,dem_act:"getVotedIds",action:"dem_ajax"},(function(e){t.demUnsetLoader(),e&&(a.html(h),d.cacheSetAnswrs(a,e),a.demInitActions(),a.demCacheShowNotice(e))}))}}),700)};i.on("mouseenter",p).on("mouseleave",(function(){clearTimeout(m)})),i.on("click",p)}}}else console.warn("Democracy: Main dem div not found")}))},d.detectRealHeight=function(e){var t=e.clone().css({height:"auto"}).insertBefore(e),n="border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height();return t.remove(),n},d.setHeight=function(t,n){var i=d.detectRealHeight(t);n?t.css({height:i}):t.css({opacity:0}).animate({height:i},d.animSpeed,(function(){e(this).animate({opacity:1},1.5*d.animSpeed)}))},d.setAnswsMaxHeight=function(t){if("-1"!==d.answMaxHeight&&"0"!==d.answMaxHeight&&d.answMaxHeight){var n=t.find(".dem-vote, .dem-answers").first(),i=parseInt(d.answMaxHeight);if(n.css({"max-height":"none","overflow-y":"visible"}),("border-box"===n.css("box-sizing")?parseInt(n.css("height")):n.height())-i>100){n.css("position","relative");var o,a=e('<span class="dem__collapser"><span class="arr"></span></span>').appendTo(n),s=function(){a.addClass("expanded").removeClass("collapsed")},r=function(){a.addClass("collapsed").removeClass("expanded")};t.data("expanded")?s():(r(),n.height(i).css("overflow-y","hidden")),a.on("mouseenter",(function(){t.data("expanded")||(o=setTimeout((function(){a.trigger("click")}),1e3))})).on("mouseleave",(function(){clearTimeout(o)})),a.on("click",(function(){if(clearTimeout(o),t.data("expanded"))r(),t.data("expanded",!1),t.height("auto"),n.stop().css("overflow-y","hidden").animate({height:i},d.animSpeed,(function(){d.setHeight(t,!0)}));else{s();var e=d.detectRealHeight(n);e+=7,t.data("expanded",!0),t.height("auto"),n.stop().animate({height:e},d.animSpeed,(function(){d.setHeight(t,!0),n.css("overflow-y","visible")}))}}))}}},d.maxAnswLimitInit=function(){n.on("change",'input[type="checkbox"]',(function(){var n=e(this).closest(t).data("opts").max_answs,i=e(this).closest(o).find('input[type="checkbox"]');i.filter(":checked").length>=n?i.filter(":not(:checked)").each((function(){e(this).prop("disabled",!0).closest("li").addClass("dem-disabled")})):i.each((function(){e(this).prop("disabled",!1).closest("li").removeClass("dem-disabled")}))}))},d.demShake=function(e){var t=e.css("position");for(t&&"static"!==t||e.css("position","relative"),t=1;2>=t;t++)e.animate({left:-10},50).animate({left:10},100).animate({left:0},50)},d.demLoadingDots=function(e){var t=e,n=t.is("input"),o=n?t.val():t.html();"..."===o.substring(o.length-3)?n?t[0].value=o.substring(0,o.length-3):t[0].innerHTML=o.substring(0,o.length-3):n?t[0].value+=".":t[0].innerHTML+=".",i=setTimeout((function(){d.demLoadingDots(t)}),200)}}}
     1/*! js-cookie v3.0.5 | MIT */
     2function democracyInit(){var e=".democracy",t=jQuery(e);if(t.length){var n,i=".dem-screen",o=".dem-add-answer-txt",a=jQuery(".dem-loader:first"),s={};s.opts=t.first().data("opts"),s.ajaxurl=s.opts.ajax_url,s.answMaxHeight=s.opts.answs_max_height,s.animSpeed=parseInt(s.opts.anim_speed),s.lineAnimSpeed=parseInt(s.opts.line_anim_speed),setTimeout((function(){var e=t.find(i).filter(":visible"),n=function(){e.each((function(){s.setHeight(jQuery(this),1)}))};e.demInitActions(1),jQuery(window).on("resize.demsetheight",n),jQuery(window).on("load",n),s.maxAnswLimitInit();var o=jQuery(".dem-cache-screens");o.length>0&&o.demCacheInit()}),1),jQuery.fn.demInitActions=function(e){return this.each((function(){var t=jQuery(this),n="data-dem-act";t.find("["+n+"]").each((function(){var e=jQuery(this);e.attr("href",""),e.on("click",(function(t){t.preventDefault(),e.blur().demDoAction(e.attr(n))}))})),!!t.find("input[type=radio][data-dem-act=vote]").first().length&&t.find(".dem-vote-button").hide(),s.setAnswsMaxHeight(t),s.lineAnimSpeed&&t.find(".dem-fill").each((function(){var e=jQuery(this);setTimeout((function(){e.animate({width:e.data("width")},s.lineAnimSpeed)}),s.animSpeed,"linear")})),s.setHeight(t,e),t.find("form").on("submit",(function(e){e.preventDefault(),jQuery(this).find('input[name="dem_act"]').val()&&jQuery(this).demDoAction(jQuery(this).find('input[name="dem_act"]').val())}))}))},jQuery.fn.demSetLoader=function(){var e=this;return a.length?e.closest(i).append(a.clone().css("display","table")):n=setTimeout((function(){return s.demLoadingDots(e[0])}),50),this},jQuery.fn.demUnsetLoader=function(){return a.length?this.closest(i).find(".dem-loader").remove():clearTimeout(n),this},jQuery.fn.demAddAnswer=function(){var e=this.first(),t=e.closest(i),n=t.find("[type=checkbox]").length>0,a=jQuery('<input type="text" class="'+o.replace(/\./,"")+'" value="">');if(t.find(".dem-vote-button").show(),t.find("[type=radio]").each((function(){jQuery(this).on("click",(function(){e.fadeIn(300),jQuery(o).remove()})),"radio"===jQuery(this)[0].type&&(this.checked=!1)})),e.hide().parent("li").append(a),a.hide().fadeIn(300).focus(),n){var s=t.find(o);jQuery('<span class="dem-add-answer-close">×</span>').insertBefore(s).css("line-height",s.outerHeight()+"px").on("click",(function(){var e=jQuery(this).parent("li");e.find("input").remove(),e.find("a").fadeIn(300),jQuery(this).remove()}))}return!1},jQuery.fn.demCollectAnsw=function(){var e=this.closest("form"),t=e.find("[type=checkbox],[type=radio],[type=text]"),n=e.find(o).val(),i=[],a=t.filter("[type=checkbox]:checked");if(a.length>0)a.each((function(){i.push(jQuery(this).val())}));else{var s=t.filter("[type=radio]:checked");s.length&&i.push(s.val())}return n&&i.push(n),(i=i.join("~"))||""},jQuery.fn.demDoAction=function(t){var n=this.first(),o=n.closest(e),a={dem_pid:o.data("opts").pid,dem_act:t,action:"dem_ajax"};return void 0===a.dem_pid?(console.log("Poll id is not defined!"),!1):"vote"!==t||(a.answer_ids=n.demCollectAnsw(),a.answer_ids)?!("delVoted"===t&&!confirm(n.data("confirm-text")))&&("newAnswer"===t?(n.demAddAnswer(),!1):(n.demSetLoader(),jQuery.post(s.ajaxurl,a,(function(e){n.demUnsetLoader(),n.closest(i).html(e).demInitActions(),setTimeout((function(){jQuery("html:first,body:first").animate({scrollTop:o.offset().top-70},500)}),200)})),!1)):(s.demShake(n[0]),!1)},jQuery.fn.demCacheShowNotice=function(e){var t=this.first(),n=t.find(".dem-youarevote").first();return"blockForVisitor"===e&&(t.find(".dem-revote-button").remove(),n=t.find(".dem-only-users").first()),t.prepend(n.show()),setTimeout((function(){n.slideUp("slow")}),1e4),this},s.cacheSetAnswrs=function(e,t){var n=t.split(/,/);if(e.hasClass("voted")){var i=e.find(".dem-answers"),o=i.data("voted-class"),a=i.data("voted-txt");jQuery.each(n,(function(t,n){e.find('[data-aid="'+n+'"]').addClass(o).attr("title",(function(){return a+jQuery(this).attr("title")}))})),e.find(".dem-vote-link").remove()}else{var s=e.find("[data-aid]"),r=e.find(".dem-voted-button");jQuery.each(n,(function(e,t){s.filter('[data-aid="'+t+'"]').find("input").prop("checked","checked")})),s.find("input").prop("disabled","disabled"),e.find(".dem-vote-button").remove(),r.length?r.show():(e.find('input[value="vote"]').remove(),e.find(".dem-revote-button-wrap").show())}},jQuery.fn.demCacheInit=function(){return this.each((function(){var t=jQuery(this),n=t.prevAll(e+":first");if(n.length||(n=t.closest(e)),n.length){var o=n.find(i).first(),a=n.data("opts").pid,r=Cookies.get("demPoll_"+a),d="notVote"===r,c=!(void 0===r||d),u=t.find(i+"-cache.vote").html(),f=t.find(i+"-cache.voted").html();if(u){var l=c&&f;if(o.html((l?f:u)+"\x3c!--cache--\x3e").removeClass("vote voted").addClass(l?"voted":"vote"),c&&s.cacheSetAnswrs(o,r),o.demInitActions(1),!d&&!c&&1==t.data("opt_logs")){var h,m=function(){h=setTimeout((function(){if(!n.hasClass("checkAnswDone")){n.addClass("checkAnswDone");var e=n.find(".dem-link").first();e.demSetLoader(),jQuery.post(s.ajaxurl,{dem_pid:n.data("opts").pid,dem_act:"getVotedIds",action:"dem_ajax"},(function(t){e.demUnsetLoader(),t&&(o.html(f),s.cacheSetAnswrs(o,t),o.demInitActions(),o.demCacheShowNotice(t))}))}}),700)};n.on("mouseenter",m).on("mouseleave",(function(){clearTimeout(h)})),n.on("click",m)}}}else console.warn("Democracy: Main dem div not found")}))},s.detectRealHeight=function(e){var t=e.clone().css({height:"auto"}).insertBefore(e),n="border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height();return t.remove(),n},s.setHeight=function(e,t){var n=s.detectRealHeight(e);t?e.css({height:n}):e.css({opacity:0}).animate({height:n},s.animSpeed,(function(){jQuery(this).animate({opacity:1},1.5*s.animSpeed)}))},s.setAnswsMaxHeight=function(e){if("-1"!==s.answMaxHeight&&"0"!==s.answMaxHeight&&s.answMaxHeight){var t=e.find(".dem-vote, .dem-answers").first(),n=parseInt(s.answMaxHeight);if(t.css({"max-height":"none","overflow-y":"visible"}),("border-box"===t.css("box-sizing")?parseInt(t.css("height")):t.height())-n>100){t.css("position","relative");var i,o=jQuery('<span class="dem__collapser"><span class="arr"></span></span>').appendTo(t),a=function(){o.addClass("expanded").removeClass("collapsed")},r=function(){o.addClass("collapsed").removeClass("expanded")};e.data("expanded")?a():(r(),t.height(n).css("overflow-y","hidden")),o.on("mouseenter",(function(){e.data("expanded")||(i=setTimeout((function(){o.trigger("click")}),1e3))})).on("mouseleave",(function(){clearTimeout(i)})),o.on("click",(function(){if(clearTimeout(i),e.data("expanded"))r(),e.data("expanded",!1),e.height("auto"),t.stop().css("overflow-y","hidden").animate({height:n},s.animSpeed,(function(){s.setHeight(e,!0)}));else{a();var o=s.detectRealHeight(t);o+=7,e.data("expanded",!0),e.height("auto"),t.stop().animate({height:o},s.animSpeed,(function(){s.setHeight(e,!0),t.css("overflow-y","visible")}))}}))}}},s.maxAnswLimitInit=function(){t.on("change",'input[type="checkbox"]',(function(){var t=jQuery(this).closest(e).data("opts").max_answs,n=jQuery(this).closest(i).find('input[type="checkbox"]');n.filter(":checked").length>=t?n.filter(":not(:checked)").each((function(){jQuery(this).prop("disabled",!0).closest("li").addClass("dem-disabled")})):n.each((function(){jQuery(this).prop("disabled",!1).closest("li").removeClass("dem-disabled")}))}))},s.demShake=function(e){var t=window.getComputedStyle(e).position;t&&"static"!==t||(e.style.position="relative");e.animate([{left:"0px"},{left:"-10px",offset:.2},{left:"10px",offset:.4},{left:"-10px",offset:.6},{left:"10px",offset:.8},{left:"0px",offset:1}],{duration:500,iterations:1,easing:"linear"})},s.demLoadingDots=function(e){var t="input"===e.tagName.toLowerCase(),i=t?e.value:e.innerHTML;"..."===i.slice(-3)?e[t?"value":"innerHTML"]=i.slice(0,-3):e[t?"value":"innerHTML"]+=".",n=setTimeout((function(){return s.demLoadingDots(e)}),200)}}}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,i=e.Cookies=t();i.noConflict=function(){return e.Cookies=n,i}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}var t=function t(n,i){function o(t,o,a){if("undefined"!=typeof document){"number"==typeof(a=e({},i,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var r in a)a[r]&&(s+="; "+r,!0!==a[r]&&(s+="="+a[r].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},o=0;o<t.length;o++){var a=t[o].split("="),s=a.slice(1).join("=");try{var r=decodeURIComponent(a[0]);if(i[r]=n.read(s,r),e===r)break}catch(e){}}return e?i[e]:i}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t})),document.addEventListener("DOMContentLoaded",democracyInit);
  • democracy-poll/trunk/languages/democracy-poll.pot

    r3056337 r3282901  
    33msgstr ""
    44"Project-Id-Version: Democracy\n"
    5 "POT-Creation-Date: 2024-03-22 00:55+0500\n"
     5"POT-Creation-Date: 2024-12-15 19:16+0500\n"
    66"PO-Revision-Date: 2017-03-12 15:02+0500\n"
    77"Last-Translator: \n"
     
    1313"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
    1414"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
    15 "X-Generator: Poedit 3.4.2\n"
     15"X-Generator: Poedit 3.5\n"
    1616"X-Poedit-Basepath: ..\n"
    1717"X-Poedit-SourceCharset: UTF-8\n"
     
    2020
    2121#: classes/Admin/Admin.php:42 classes/Admin/Admin_Page.php:205
    22 #: classes/Plugin.php:154
     22#: classes/Plugin.php:158
    2323msgid "Settings"
    2424msgstr ""
     
    3232msgstr ""
    3333
    34 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:151
     34#: classes/Admin/Admin_Page.php:191 classes/Plugin.php:155
    3535msgid "Polls List"
    3636msgstr ""
     
    4141
    4242#: classes/Admin/Admin_Page.php:199 classes/Admin/List_Table_Polls.php:136
    43 #: classes/Plugin.php:153
     43#: classes/Plugin.php:157
    4444msgid "Logs"
    4545msgstr ""
    4646
    47 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:155
     47#: classes/Admin/Admin_Page.php:210 classes/Plugin.php:159
    4848msgid "Theme Settings"
    4949msgstr ""
    5050
    51 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:156
     51#: classes/Admin/Admin_Page.php:215 classes/Plugin.php:160
    5252msgid "Texts changes"
    5353msgstr ""
     
    5757msgstr ""
    5858
    59 #: classes/Admin/Admin_Page_Design.php:508
     59#: classes/Admin/Admin_Page_Design.php:51
     60#: classes/Admin/Admin_Page_Settings.php:35
     61#: classes/Admin/Admin_Page_l10n.php:39
     62msgid "Updated"
     63msgstr ""
     64
     65#: classes/Admin/Admin_Page_Design.php:52
     66#: classes/Admin/Admin_Page_Settings.php:36
     67#: classes/Admin/Admin_Page_l10n.php:40
     68msgid "Nothing was updated"
     69msgstr ""
     70
     71#: classes/Admin/Admin_Page_Design.php:515
    6072msgid "Results view:"
    6173msgstr ""
    6274
    63 #: classes/Admin/Admin_Page_Design.php:510
     75#: classes/Admin/Admin_Page_Design.php:517
    6476msgid "Vote view:"
    6577msgstr ""
    6678
    67 #: classes/Admin/Admin_Page_Design.php:512
     79#: classes/Admin/Admin_Page_Design.php:519
    6880msgid "AJAX loader view:"
    6981msgstr ""
     
    114126msgstr ""
    115127
    116 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:152
     128#: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:156
    117129msgid "Add Poll"
    118130msgstr ""
     
    243255msgstr ""
    244256
    245 #: classes/Admin/Admin_Page_Settings.php:80
     257#: classes/Admin/Admin_Page_Settings.php:87
    246258msgid ""
    247259"Example: <code>&lt;h2&gt;</code> и <code>&lt;/h2&gt;</code>. Default: "
     
    250262msgstr ""
    251263
    252 #: classes/Admin/Admin_Page_Settings.php:92
     264#: classes/Admin/Admin_Page_Settings.php:99
    253265msgid "Go to archive page"
    254266msgstr ""
    255267
    256 #: classes/Admin/Admin_Page_Settings.php:98
     268#: classes/Admin/Admin_Page_Settings.php:105
    257269msgid "Create/find archive page"
    258270msgstr ""
    259271
    260 #: classes/Admin/Admin_Page_Settings.php:102
     272#: classes/Admin/Admin_Page_Settings.php:109
    261273msgid ""
    262274"Specify the poll archive link to be in the poll legend. Example: <code>25</"
     
    264276msgstr ""
    265277
    266 #: classes/Admin/Admin_Page_Settings.php:186
     278#: classes/Admin/Admin_Page_Settings.php:193
    267279msgid "ON"
    268280msgstr ""
    269281
    270 #: classes/Admin/Admin_Page_Settings.php:187
     282#: classes/Admin/Admin_Page_Settings.php:194
    271283msgid "OFF"
    272284msgstr ""
    273285
    274 #: classes/Admin/Admin_Page_Settings.php:189
     286#: classes/Admin/Admin_Page_Settings.php:196
    275287#, php-format
    276288msgid "Force enable gear to working with cache plugins. The condition: %s"
    277289msgstr ""
    278290
    279 #: classes/Admin/Admin_Page_Settings.php:260
     291#: classes/Admin/Admin_Page_Settings.php:267
    280292msgid ""
    281293"Role names, except 'administrator' which will have access to manage plugin."
    282294msgstr ""
    283295
    284 #: classes/Admin/Admin_Page_Settings.php:356
     296#: classes/Admin/Admin_Page_Settings.php:363
    285297msgid "Polls Archive"
    286 msgstr ""
    287 
    288 #: classes/Admin/Admin_Page_l10n.php:39 classes/Options.php:235
    289 msgid "Updated"
    290 msgstr ""
    291 
    292 #: classes/Admin/Admin_Page_l10n.php:40 classes/Options.php:236
    293 msgid "Nothing was updated"
    294298msgstr ""
    295299
     
    310314msgstr ""
    311315
    312 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:64
     316#: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:66
    313317msgid "Poll"
    314318msgstr ""
     
    343347
    344348#: classes/Admin/List_Table_Logs.php:185 classes/Admin/List_Table_Logs.php:271
    345 #: classes/DemPoll.php:203
     349#: classes/DemPoll.php:205
    346350msgid "Edit poll"
    347351msgstr ""
     
    436440msgstr ""
    437441
    438 #: classes/DemPoll.php:208
     442#: classes/DemPoll.php:210
    439443msgid "Download the Democracy Poll"
    440444msgstr ""
    441445
    442 #: classes/DemPoll.php:333
     446#: classes/DemPoll.php:335
    443447msgctxt "front"
    444448msgid "Add your answer"
    445449msgstr ""
    446450
    447 #: classes/DemPoll.php:341
     451#: classes/DemPoll.php:343
    448452msgctxt "front"
    449453msgid "Already voted..."
    450454msgstr ""
    451455
    452 #: classes/DemPoll.php:342 classes/DemPoll.php:502
     456#: classes/DemPoll.php:344 classes/DemPoll.php:504
    453457msgctxt "front"
    454458msgid "Vote"
    455459msgstr ""
    456460
    457 #: classes/DemPoll.php:384
     461#: classes/DemPoll.php:386
    458462msgctxt "front"
    459463msgid "Results"
    460464msgstr ""
    461465
    462 #: classes/DemPoll.php:420
     466#: classes/DemPoll.php:422
    463467msgctxt "front"
    464468msgid "This is Your vote."
    465469msgstr ""
    466470
    467 #: classes/DemPoll.php:446
     471#: classes/DemPoll.php:448
    468472msgctxt "front"
    469473msgid "The answer was added by a visitor"
    470474msgstr ""
    471475
    472 #: classes/DemPoll.php:449
     476#: classes/DemPoll.php:451
    473477#, php-format
    474478msgctxt "front"
     
    476480msgstr ""
    477481
    478 #: classes/DemPoll.php:449 classes/DemPoll.php:453
     482#: classes/DemPoll.php:451 classes/DemPoll.php:455
    479483msgctxt "front"
    480484msgid "vote,votes,votes"
    481485msgstr ""
    482486
    483 #: classes/DemPoll.php:483
     487#: classes/DemPoll.php:485
    484488#, php-format
    485489msgctxt "front"
     
    487491msgstr ""
    488492
    489 #: classes/DemPoll.php:484
     493#: classes/DemPoll.php:486
    490494#, php-format
    491495msgctxt "front"
     
    493497msgstr ""
    494498
    495 #: classes/DemPoll.php:486
     499#: classes/DemPoll.php:488
    496500msgctxt "front"
    497501msgid "Begin"
    498502msgstr ""
    499503
    500 #: classes/DemPoll.php:488
     504#: classes/DemPoll.php:490
    501505msgctxt "front"
    502506msgid "End"
    503507msgstr ""
    504508
    505 #: classes/DemPoll.php:490
     509#: classes/DemPoll.php:492
    506510msgctxt "front"
    507511msgid " - added by visitor"
    508512msgstr ""
    509513
    510 #: classes/DemPoll.php:491
     514#: classes/DemPoll.php:493
    511515msgctxt "front"
    512516msgid "Voting is closed"
    513517msgstr ""
    514518
    515 #: classes/DemPoll.php:493
     519#: classes/DemPoll.php:495
    516520msgctxt "front"
    517521msgid "Polls Archive"
    518522msgstr ""
    519523
    520 #: classes/DemPoll.php:549
     524#: classes/DemPoll.php:551
    521525msgctxt "front"
    522526msgid "Only registered users can vote. <a>Login</a> to vote."
    523527msgstr ""
    524528
    525 #: classes/DemPoll.php:559
     529#: classes/DemPoll.php:561
    526530msgctxt "front"
    527531msgid "Revote"
    528532msgstr ""
    529533
    530 #: classes/DemPoll.php:559
     534#: classes/DemPoll.php:561
    531535msgctxt "front"
    532536msgid "Are you sure you want cancel the votes?"
    533537msgstr ""
    534538
    535 #: classes/DemPoll.php:573
     539#: classes/DemPoll.php:575
    536540msgctxt "front"
    537541msgid "You or your IP had already vote."
    538542msgstr ""
    539543
    540 #: classes/DemPoll.php:620
     544#: classes/DemPoll.php:622
    541545msgid "ERROR: You select more number of answers than it is allowed..."
    542546msgstr ""
     
    551555
    552556#: classes/Helpers/Helpers.php:11
     557msgid "Alphabetically"
     558msgstr ""
     559
     560#: classes/Helpers/Helpers.php:12
    553561msgid "Mix"
    554562msgstr ""
     
    558566msgstr ""
    559567
    560 #: classes/Poll_Widget.php:89
     568#: classes/Poll_Widget.php:91
    561569msgid "- Active (random all active)"
    562570msgstr ""
    563571
    564 #: classes/Poll_Widget.php:90
     572#: classes/Poll_Widget.php:92
    565573msgid "- Last open poll"
    566574msgstr ""
    567575
    568 #: classes/Poll_Widget.php:105
     576#: classes/Poll_Widget.php:107
    569577msgid "Which poll to show?"
    570578msgstr ""
    571579
    572 #: classes/Utils/Activator.php:61
     580#: classes/Utils/Activator.php:51
    573581msgid "What is the capital city of France?"
    574582msgstr ""
    575583
    576 #: classes/Utils/Activator.php:73
     584#: classes/Utils/Activator.php:63
    577585msgid "Paris"
    578586msgstr ""
    579587
    580 #: classes/Utils/Activator.php:74
     588#: classes/Utils/Activator.php:64
    581589msgid "Rome"
    582590msgstr ""
    583591
    584 #: classes/Utils/Activator.php:75
     592#: classes/Utils/Activator.php:65
    585593msgid "Madrid"
    586594msgstr ""
    587595
    588 #: classes/Utils/Activator.php:76
     596#: classes/Utils/Activator.php:66
    589597msgid "Berlin"
    590598msgstr ""
    591599
    592 #: classes/Utils/Activator.php:77
     600#: classes/Utils/Activator.php:67
    593601msgid "London"
    594602msgstr ""
  • democracy-poll/trunk/readme.txt

    r3064229 r3282901  
    1 
    2 === Plugin Name ===
    3 Stable tag: 6.0.3
    4 Tested up to: 6.5.0
    5 Requires at least: 4.7
     1=== Democracy Poll ===
     2Stable tag: 6.0.4
     3Tested up to: 6.8.0
    64Contributors: Tkama
    75License: GPLv2 or later
     
    97Tags: democracy, polls, vote, survey, review
    108
    11 WordPress Polls plugin with multiple choice and custom answers. Works with cache plugins. Includes widget and shortcodes for posts.
     9A WordPress polls plugin with multiple-choice options and custom answers. Works seamlessly with cache plugins. Includes widgets and shortcodes for posts.
    1210
    1311
    1412== Description ==
    1513
    16 The plugin adds a clever and convenient system to create various Polls with different features, such as:
    17 
    18 * Single and Multiple voting. Сustomizable.
    19 * Visitors can add new answers. Сustomizable.
    20 * Ability to set poll's end date.
    21 * Unregistered users can't vote. Сustomizable.
    22 * Different design of a poll.
    23 * And so on. See changelog.
    24 
    25 Democracy Poll works with all cache plugins like: WP Total Cache, WP Super Cache, WordFence, Quick Cache etc.
    26 
    27 I focus on easy-admin features and fast performance. So we have:
    28 
    29 * Quick Edit button for Admin, right above a poll
    30 * Plugin menu in toolbar
    31 * Inline css & js incuding
    32 * Css & js connection only where it's needed
    33 * and so on. See changelog
    34 
    35 
     14This plugin provides an intuitive and powerful system to create various polls with features like:
     15
     16* Single and multiple voting options (customizable).
     17* Allowing visitors to add new answers (customizable).
     18* Setting an end date for polls.
     19* Restricting voting to registered users (customizable).
     20* Multiple poll designs.
     21* And more! See the changelog for details.
     22
     23Democracy Poll is compatible with all major cache plugins, including WP Total Cache, WP Super Cache, WordFence, Quick Cache, etc.
     24
     25Designed for ease of use and performance, it offers:
     26
     27* A "Quick Edit" button for admins, directly above a poll.
     28* A plugin menu in the toolbar.
     29* Inline inclusion of CSS & JS.
     30* Loading CSS & JS only when necessary.
     31* And more! Check out the changelog for details.
    3632
    3733### More Info ###
    3834
    39 Democracy Poll is a reborn of once-has-been-famous plugin with the same name. Even if it hasn't been updated since far-far away 2006, it still has the great idea of adding users' own answers. So here's a completely new code. I have left only the idea and great name of the original DP by Andrew Sutherland.
    40 
    41 What can it perform?
    42 
    43 * adding new polls;
    44 * works with cache plugins: wp total cache, wp super cache, etc...
    45 * users may add their own answers (Democracy), the option may be disabled if necessary;
    46 * multi-voting: users may multiple answers instead of a single one (may be disabled on demand);
    47 * closing the poll after the date specified beforehand;
    48 * showing a random poll when some are available;
    49 * closing polls for still unregistered users;
    50 * a comfortable editing of a selected poll: 'Edit' key for administrators;
    51 * votes amount editing;
    52 * a user can change his opinion when re-vote option is enabled;
    53 * remember users by their IP, cookies, WP profiles (for authorized users). The vote history may be cleaned up;
    54 * inserting new polls to any posts: the [demоcracy] (shortcode). A key in visual editor is available for this function;
    55 * a widget (may be disabled);
    56 * convenient polls editing: the plugin's Panel is carried out to the WordPress toolbar; (may be disabled);
    57 * .css or .js files may be disabled or embedded to HTML code;
    58 * showing a note under the poll: a short text with any notes to the poll or anything around it;
    59 * changing the poll design (css themes);
    60 
    61 
    62 Multisite: support from version 5.2.4
    63 
     35Democracy Poll is a modernized version of an earlier, well-regarded plugin by the same name. Although the original plugin by Andrew Sutherland hadn't been updated since 2006, it introduced the innovative concept of allowing users to add their own answers. This version retains the core idea and name but features completely rewritten code.
     36
     37Key features include:
     38
     39* Creating new polls.
     40* Compatibility with cache plugins like WP Total Cache and WP Super Cache.
     41* Allowing users to add their own answers (optional).
     42* Multi-voting, enabling users to select multiple answers (optional).
     43* Automatically closing polls after a pre-set end date.
     44* Displaying random polls when multiple are available.
     45* Restricting polls to registered users (optional).
     46* Convenient admin tools, such as an "Edit" button for quick poll management.
     47* Editing the number of votes.
     48* Allowing users to change their votes when the re-vote option is enabled.
     49* Remembering voters via IP, cookies, or WordPress profiles. Optionally, vote history can be cleared.
     50* Embedding polls in posts with the `[democracy]` shortcode. A visual editor button is available for ease of use.
     51* Providing a widget (optional).
     52* Streamlined poll management through the WordPress toolbar (optional).
     53* Flexibility to disable or embed CSS/JS files into the HTML.
     54* Adding notes under polls for additional context.
     55* Customizing poll designs with CSS themes.
     56
     57Multisite support is available starting from version 5.2.4.
    6458
    6559Requires PHP 5.3 or later.
    6660
    6761
    68 
    69 
    7062== Usage ==
    7163
    7264### Usage (Widget) ###
    73 1. Go to `WP-Admin -> Appearance -> Widgets` and find `Democracy Poll` Widget.
    74 2. Add this widget to one of existing sidebar.
    75 3. Set Up added widget and press Save.
     651. Go to `WP-Admin -> Appearance -> Widgets` and select the `Democracy Poll` widget.
     662. Add the widget to an available sidebar.
     673. Configure the widget settings and save.
    76684. Done!
    7769
    78 
    7970### Usage (Without Widget) ###
    80 1. Open sidebar.php file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`
    81 2. Add such code in the place you want Poll is appeared:
    82 
    83 `
     711. Open the `sidebar.php` file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`.
     722. Insert the following code where you want the poll to appear:
     73
     74```php
    8475<?php if( function_exists('democracy_poll') ){ ?>
    8576    <li>
     
    9081    </li>
    9182<?php } ?>
    92 `
    93 
    94 * To show specific poll, use `<?php democracy_poll( 3 ); ?>` where 3 is your poll id.
    95 * To embed a specific poll in your post, use `[democracy id="2"]` where 2 is your poll id.
    96 * To embed a random poll in your post, use `[democracy]`
    97 
     83```
     84
     85* To display a specific poll, use `<?php democracy_poll( 3 ); ?>`, where 3 is your poll ID.
     86* To embed a specific poll in a post, use `[democracy id="2"]`, where 2 is your poll ID.
     87* To embed a random poll in a post, use `[democracy]`.
    9888
    9989#### Display Archive ####
    100 For display polls archive, use the function:
    101 
    102 `<?php democracy_archives( $hide_active, $before_title, $after_title ); ?>`
    103 
    104 
    105 
    106 
     90To display the polls archive, use the function:
     91```php
     92<?php democracy_archives( $hide_active, $before_title, $after_title ); ?>
     93```
    10794
    10895
    10996== Frequently Asked Questions ==
    11097
    111 ### Does this plugin clear yourself after uninstall?
    112 
    113 Yes it is! To completely uninstall the plugin, deactivate it and then press "delete" link in admin plugins page and ther plugin delete all it's options and so on...
    114 
    115 
    116 
     98### Does this plugin clear itself after uninstall? ###
     99
     100Yes! To completely uninstall the plugin, deactivate it and click the "delete" link on the admin plugins page. The plugin will remove all its options and data.
    117101
    118102== Screenshots ==
     
    1261107. General settings.
    1271118. Polls theme settings.
    128 9. Poll's texts changes.
     1129. Poll text customization.
    129113
    130114
     
    133117
    134118= 6.0.0 =
    135 * Minimal PHP version 7.0
    136 * If you used some plugin classes directly in your code it may need to be refactored to new class names.
    137 
     119* Minimum PHP version 7.0 required.
     120* If you directly used plugin classes in your code, you may need to refactor them to align with new class names.
    138121
    139122
     
    141124== Changelog ==
    142125
     126= 6.0.4 =
     127- FIX: Init moved to `after_setup_theme` hook.
     128- NEW: Alphabet answers order added.
     129- IMP: democracy.js minor improvements (part refactored to vanilla js).
     130- IMP: CSS minor refactor.
     131- IMP: Minor improvements.
     132- UPD: Tested up to: WP 6.8.0
     133- UPD: js-cookie 2.2.0 >> 3.0.5.
     134
     135= 6.0.3 =
     136* FIX: Poll widget did not work correctly if "select random poll" option was set.
     137
    143138= 6.0.2 =
    144 BUG: A fatal error occurred when using the "WordFence" plugin: "Failed opening ... /Helpers/wfConfig.php".
     139* FIX: Fatal error with "WordFence" plugin: "Failed opening .../Helpers/wfConfig.php".
    145140
    146141= 6.0.1 =
    147 * BUG: Fix v6.0.0 bug: short-circuit recursion on plugin object construct for the not logged-in users.
     142* FIX: Short-circuit recursion on plugin object construct for not logged-in users (v6.0.0 bug).
    148143* IMP: Minor improvements.
    149144
    150145= 6.0.0 =
    151 * BUG: It was impossible to delete all answers or create democracy poll with no starting answer.
    152 * CHG: Minimal PHP version 7.0
    153 * CHG: "Democracy_Poll" class renamed to "Plugin" and moved under namespace.
    154 * CHG: `democr()` and `demopt()` functions renamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.
    155 * CHG: Most of the classes moved under `DemocracyPoll` namespace.
     146* FIX: Unable to delete all answers or create a democracy poll without a starting answer.
     147* CHG: Minimal PHP version requirement set to 7.0.
     148* CHG: Class `Democracy_Poll` renamed to `Plugin` and moved under namespace.
     149* CHG: Functions `democr()` and `demopt()` renamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.
     150* CHG: Most classes moved under `DemocracyPoll` namespace.
    156151* CHG: DemPoll object improvements: magic properties replaced with real ones.
    157 * FIX: democracy_shortcode bugfix.
    158 * FIX: Not logged user logs now gets with user_id=0 AND ip. But not only by IP.
    159 * FIX: Regenerate_democracy_css fixes. Empty answer PHP notice fix.
    160 * IMP: "Admin" classes refactored. IMP: Admin Pages code refactored (improved).
     152* FIX: `democracy_shortcode` bug.
     153* FIX: Not logged-in user logs now get saved with user_id=0 and IP (not just IP).
     154* FIX: `Regenerate_democracy_css` fixes. Empty answer PHP notice fix.
     155* IMP: "Admin" classes refactored.
     156* IMP: Admin Pages code refactored.
    161157* IMP: Classes autoloader implemented.
    162 * IMP: Huge Refactoring, minor code improvements and decomposition.
    163 * UPD: democracy-poll.pot
     158* IMP: Huge refactoring, minor code improvements, and decomposition.
     159* UPD: Updated `democracy-poll.pot`.
    164160
    165161= 5.6.0 =
    166 * BUG: Pagination links on archive page.
     162* FIX: Pagination links on archive page.
    167163
    168164= 5.5.10 =
    169 * FIX: CSS radio,checkbox styles from px to em.
     165* FIX: CSS radio/checkbox styles changed from px to em.
    170166
    171167= 5.5.9 =
    172 * FIX: JS code fixes for jQuery 3.5.
     168* FIX: JS code fixes for jQuery 3.5 compatibility.
    173169
    174170= 5.5.8 =
    175 * NEW: `orderby` аргумент для функции `get_dem_polls()`.
     171* ADD: `orderby` argument for `get_dem_polls()` function.
    176172
    177173= 5.5.7 =
    178 * NEW: hook `get_dem_polls_sql_clauses`.
     174* ADD: Hook `get_dem_polls_sql_clauses`.
    179175
    180176= 5.5.6.3 =
    181 * FIX: `disabled` property for checkbox input sometimes not removed on uncheck for multianswers questions.
     177* FIX: `disabled` property not removed correctly on uncheck for multi-answer questions.
    182178
    183179= 5.5.6.2 =
    184 * NEW: Scroll to poll top when click on Resulsts, Vote etc.
     180* ADD: Scroll to poll top when clicking Results, Vote, etc.
    185181
    186182= 5.5.6.1 =
    187 * NEW: `target="_blank"` attribute for copyright link.
     183* ADD: `target="_blank"` attribute for copyright link.
    188184
    189185= 5.5.6 =
    190 * NEW: pagination links at the bottom of the archive page.
    191 * NEW: `[democracy_archives]` now can accept parameters: 'before_title', 'after_title', 'active', 'open', 'screen', 'per_page', 'add_from_posts'. `[democracy_archives screen="vote" active="1"]` will show only active poll with default vote screen.
    192 * NEW: function `get_dem_polls( $args )`
     186* ADD: Pagination links at the bottom of the archive page.
     187* ADD: `[democracy_archives]` shortcode now accepts parameters like 'before_title', 'after_title', 'active', 'open', 'screen', 'per_page', 'add_from_posts'.
     188* ADD: `get_dem_polls( $args )` function.
    193189
    194190= 5.5.5 =
    195 * CHANGE: ACE code editor to native WordPress CodeMirror.
     191* CHG: Replaced ACE code editor with native WordPress CodeMirror.
    196192
    197193= 5.5.4 =
    198 * ADD: 'dem_get_ip' filter and cloudflare IP support.
    199 * NEW: use float number in 'cookie_days' option.
    200 * FIX: expire time now sets in UTC time zone.
     194* ADD: `dem_get_ip` filter and Cloudflare IP support.
     195* ADD: Support for float numbers in the 'cookie_days' option.
     196* FIX: Expire time now set in UTC timezone.
    201197
    202198= 5.5.3 =
    203 * FIX: compatability with W3TC.
    204 * FIX: multiple voting limit check on back-end (AJAX request) - no more answers than allowed...
    205 * IMP: return WP_Error object on vote error and display it...
     199* FIX: Compatibility with W3TC.
     200* FIX: Multiple voting limit check on backend (AJAX) — no more answers than allowed.
     201* IMP: Return WP_Error object on vote error and display it.
    206202
    207203= 5.5.2 =
    208 * ADD: wrapper function for use in themes 'get_democracy_poll_results( $poll_id )' - Gets poll results screen.
    209 * ADD: allowed &lt;img&gt; tag in question and answers.
     204* ADD: `get_democracy_poll_results( $poll_id )` wrapper function to get poll results.
     205* ADD: Allow `<img>` tag in questions and answers.
    210206
    211207= 5.5.1 =
    212 * IMP: now design setting admin page is more clear and beautiful :)
     208* IMP: Admin design settings page improved.
    213209
    214210= 5.5.0 =
    215 * ADD: post metabox to attach poll to a post. To show attached poll in theme use `get_post_poll_id()` on is_singular() page. Thanks to heggi@fhead.org for idea.
    216 * ADD: voted screen progress line animation effect and option to set animation speed or disable animation...
    217 * IMP: now "height collapsing" not work if it intend to hide less then 100px...
    218 * FIX: now JS includes in_footer not right after poll. In some cases there was a bug - when poll added in content through shortcode.
    219 * IMP: buttons and other design on 'design settings' admin screen.
     211* ADD: Post metabox to attach poll to post; use `get_post_poll_id()` on `is_singular()` pages.
     212* ADD: Progress line animation effect for vote results with adjustable speed.
     213* IMP: "Height collapsing" now doesn't work if intended to hide less than 100px.
     214* FIX: JS now included in footer properly when poll added via shortcode.
     215* IMP: Improved buttons and design on admin design settings page.
    220216
    221217= 5.4.9 =
    222 * ADD: 'demadmin_sanitize_poll_data' filter second '$original_data' parameter
    223 * ADD: posts where a poll is ebedded block at the bottom of each poll on polls archive page.
    224 
    225 = 5.4.7 - 5.4.8 =
    226 * FIX: 'expire' parameter works incorrectly with logs written to DB.
    227 * FIX: 'wp_remote_get()' changed to 'file_get_contents()' bacause it works not correctly with geoplugin.net API.
    228 * FIX: 'jquery-ui.css' fix and needed images added.
     218* ADD: 'demadmin_sanitize_poll_data' filter with second `$original_data` parameter.
     219* ADD: Block showing posts where poll is embedded at bottom of polls archive page.
     220
     221= 5.4.8 =
     222* FIX: 'expire' parameter issue when logs written to DB.
     223* FIX: Replaced `wp_remote_get()` with `file_get_contents()` for geoplugin.net API.
     224* FIX: `jquery-ui.css` and images fix.
    229225
    230226= 5.4.6 =
    231 * FIX: Error with "load_textdomain" because of which it was impossible to activate the plugin
     227* FIX: "load_textdomain" error that blocked plugin activation.
    232228
    233229= 5.4.5 =
    234 * FIX: "Edit poll" link from front-end for users with access to edit single poll.
    235 * FIX: not correct use of $this for PHP 5.3 in class.Democracy_Poll_Admin.php
     230* FIX: "Edit poll" link from frontend for users with poll edit rights.
     231* FIX: Incorrect use of `$this` for PHP 5.3 in `Democracy_Poll_Admin` class.
    236232
    237233= 5.4.4 =
    238 * CHG: prepare to move all localisation to translate.wordpress.org in next release...
    239 * FIX: notice on MU activation - change `wp_get_sites()` to new from WP 4.6 `get_sites()`. Same fix on plugin Uninstall...
    240 * ADD: Hungarian translation (hu_HU). Thanks to Lesbat.
     234* CHG: Preparing to move all localization to translate.wordpress.org.
     235* FIX: MU activation notice: replaced `wp_get_sites()` with `get_sites()` (WP 4.6+).
     236* ADD: Hungarian translation (hu_HU) by Lesbat.
    241237
    242238= 5.4.3 =
    243 * ADD: disable user capability to edit poll of another user, when there is democracy admin access to other roles...
    244 * ADD: spain (es_ES) localisation file added.
    245 * IMP: improve accessibility protection in different parts of admin area for additional roles (edit,delete poll)...
    246 * IMP: hide & block any global plugin options updates for roles with not 'super_access' access level...
     239* ADD: Disable editing another user's poll if restricted by admin settings.
     240* ADD: Spanish (es_ES) localization.
     241* IMP: Improved accessibility protection in admin for additional roles.
     242* IMP: Block global plugin options updates for non-super_access roles.
    247243
    248244= 5.4.2 =
    249 * FIX: Some minor changes that do not change the plugin logic at all: change function names; block direct access to files with "active" PHP code.
    250 * CHG: Add `jquery-ui.css` to plugin files and now it loaded from inside it.
    251 * FIX: "wp total cache" support
    252 * ADD: second parametr to 'dem_sanitize_answer_data' filter - $filter_type
    253 * ADD: second parametr to 'dem_set_answers' filter - $poll
    254 * FIX: tinymce translation fix
    255 * CHG: rename main class `Dem` to `Democracy_Poll` for future no conflict. And rename some other internal functions/method names
     245* FIX: Minor fixes: function renaming and blocking direct file access.
     246* CHG: Added `jquery-ui.css` to plugin files.
     247* FIX: W3TC support fixes.
     248* ADD: Second parameter to 'dem_sanitize_answer_data' and 'dem_set_answers' filters.
     249* FIX: TinyMCE translation fix.
     250* CHG: Renamed main class `Dem` to `Democracy_Poll`.
    256251
    257252= 5.4.1 =
    258 * CHG: improve logic to work correctly with activate_plugin() function outside of wp-admin area (in front end). Thanks to J.D.Grimes
     253* CHG: Improve activation logic with `activate_plugin()` outside wp-admin. Thanks to J.D. Grimes.
    259254
    260255= 5.4 =
    261 * FIX: XSS Vulnerability. In some extraordinary case it could be possible to hack your site. Read here: http://pluginvulnerabilities.com/?p=2967
    262 * ADD: For additional protect I add nonce check for all requests in admin area.
    263 * CHG: move back Democracy_Poll_Admin::update_options() to its place - it's not good decision - I'm looking for a better one
     256* FIX: XSS vulnerability fix (security issue).
     257* ADD: Nonce checks for all admin requests.
     258* CHG: Moved back `Democracy_Poll_Admin::update_options()` method.
    264259
    265260= 5.3.6 =
    266 * FIX: delete `esc_sql()` from code, for protection. Thanks to J.D. Grimes
    267 * FIX: multi run of Democracy_Poll_Admin trigger error... (J.D. Grimes)
    268 * CHG: move Democracy_Poll_Admin::update_options() method to Democracy_Poll::update_options(), for possibility to activate plugin not only from admin area.
     261* FIX: Removed unsafe `esc_sql()` usage. Thanks to J.D. Grimes.
     262* FIX: Multiple runs of `Democracy_Poll_Admin` trigger error fix.
     263* CHG: Moved `update_options()` to `Democracy_Poll`.
    269264
    270265= 5.3.5 =
    271 * FIX: now user IP detects only with REMOTE_ADDR server variable to don't give possibility to cheat voice. You can change behavior in settings.
     266* FIX: User IP now detected only with `REMOTE_ADDR` (to avoid cheating).
    272267
    273268= 5.3.4.6 =
    274 * FIX: add 'dem_add_user_answer' query var param to set noindex for no duplicate content
    275 * ADD: actions `dem_voted` and `dem_vote_deleted`
     269* FIX: Added 'dem_add_user_answer' query var param to set `noindex`.
     270* ADD: Actions `dem_voted` and `dem_vote_deleted`.
    276271
    277272= 5.3.4.5 =
    278 * ADD: filters `dem_vote_screen` and `dem_result_screen`
     273* ADD: Filters `dem_vote_screen` and `dem_result_screen`.
    279274
    280275= 5.3.4 =
    281 * ADD: poll creation date change capability on edit poll page.
    282 * ADD: animation speed option on design settings.
    283 * ADD: "dont show results link" global option.
    284 * ADD: 'show last poll' option in widget
    285 * FIX: bug user cant add onw answer when vote button is hidden for not multiple poll
    286 * CHG: move the "dem__collapser" styles to all styles. Change the styles: now arrow has 150% font-size. Now you can set your own arrow simbols by changing it's style. EX:
    287     ```
    288     .dem__collapser.collapsed .arr:before{ content:"down"; }
    289     .dem__collapser.expanded  .arr:before{ content:"up"; }
    290     ```
     276* ADD: Poll creation date editing on poll edit page.
     277* ADD: Animation speed setting in design settings.
     278* ADD: "Don't show results link" global option.
     279* ADD: Show last poll option in widget.
     280* FIX: Bug where user couldn't add own answer if vote button hidden.
     281* CHG: Moved "dem__collapser" styles globally; customizable arrows via CSS.
    291282
    292283= 5.3.3.2 =
    293 * FIX: stability for adding "dem__collapser" style into document.
     284* FIX: Stability for injecting "dem__collapser" style.
    294285
    295286= 5.3.3.1 =
    296 * ADD: answers sort in admin by two fields - votes and then by ID - it's for no suffle new answers...
     287* ADD: Answer sorting in admin by votes and ID.
    297288
    298289= 5.3.3 =
    299 * FIX: minor: when work with cache plugin: now vote & revote buttons completely removes from DOM
     290* FIX: Vote and revote buttons now fully removed from DOM with caching plugins.
    300291
    301292= 5.3.2 =
    302 * FIX: minor: cookie stability fix when plugin works with page caching plugin
     293* FIX: Cookie stability fix with page caching plugins.
    303294
    304295= 5.3.1 =
    305 * ADD: filter: 'dem_poll_screen_choose'
    306 * FIX: now before do anything, js checks - is there any democracy element on page. It needs to prevent js errors.
    307 * CHG: now main js init action run on document.ready, but not on load. So democracy action begin to work earlier...
     296* ADD: Filter `dem_poll_screen_choose`.
     297* FIX: Prevent JS errors by checking democracy element presence before init.
     298* CHG: JS init moved to `document.ready` instead of `load`.
    308299
    309300= 5.3.0 =
    310 * CHG: All plugin code translated to english! Now there is NO russian text for unknown localisation strings.
     301* CHG: All plugin code translated to English (no hardcoded Russian text).
    311302
    312303= 5.2.9 =
    313 * FIX: add poll PHP syntax bug...
     304* FIX: PHP syntax bug in poll addition.
    314305
    315306= 5.2.8 =
    316 * ADD: new red button - pinterest style. default button styles changed. Some ugly buttons (3d, glass) was deleted.
    317 * ADD: filters: 'dem_vote_screen_answer', 'dem_result_screen_answer', 'demadmin_after_question', 'demadmin_after_answer', 'dem_sanitize_answer_data', 'demadmin_sanitize_poll_data'
     307* ADD: New red Pinterest-style button. Some old 3D/glass buttons removed.
     308* ADD: Filters: `dem_vote_screen_answer`, `dem_result_screen_answer`, `demadmin_after_question`, `demadmin_after_answer`, `dem_sanitize_answer_data`, `demadmin_sanitize_poll_data`.
    318309
    319310= 5.2.7 =
    320 * FIX: global option 'dont show results' not work properly
    321 * FIX: some little fix in code
     311* FIX: "Don't show results" global option fix.
     312* FIX: Minor code fixes.
    322313
    323314= 5.2.6 =
    324 * FIX: bug when new answer added: now "NEW" mark adds correctly
     315* FIX: "NEW" mark correctly added after adding a new answer.
    325316
    326317= 5.2.5 =
    327 * FIX: wp_json_encode() function was replaced, in order to support WP lower then 4.1
    328 * CHG: usability improvements
    329 * CHG: set 'max+1' order num for users added answers, if answers has order
     318* FIX: Replaced `wp_json_encode()` for WP < 4.1 support.
     319* CHG: Usability improvements.
     320* CHG: Set max+1 order number for user-added answers if answers have order.
    330321
    331322= 5.2.4 =
    332 * ADD: multisite support
    333 * ADD: migration from 'WP Polls' plugin mechanism
    334 * FIX: bug - was allowed set 1 answer for multiple answers
    335 * CHG: IP save to DB: now it saves as it is without ip2long()
    336 * CHG: EN translation is updated.
     323* ADD: Multisite support.
     324* ADD: Migration mechanism from "WP Polls" plugin.
     325* FIX: Bug where one answer allowed for multiple-answer polls.
     326* CHG: Save IP to DB as-is (no ip2long()).
     327* CHG: Updated English translation.
    337328
    338329= 5.2.3 =
    339 * ADD: on admin edit poll screen, posts list where poll shortcode uses
    340 * ADD: ability to set poll buttons css class on design settings page
    341 * ADD: filters: 'dem_super_access' (removed filter 'dem_admin_access'), 'dem_get_poll', 'dem_set_answers'
    342 * FIX: 'reset order' bug fix - button not work, when answers are ordered in edit poll screen and you wanted to reset the order - I missed one letter in the code during refactoring :)
    343 * FIX: 'additional css' update bug fix: you can't empty it...
    344 * FIX: some other minor fixes...
    345 * CHG: EN translation is updated.
     330* ADD: Show posts list using poll shortcode on poll edit page.
     331* ADD: Allow setting custom CSS class for poll buttons.
     332* ADD: Filters: `dem_super_access`, `dem_get_poll`, `dem_set_answers`.
     333* FIX: "Reset order" button bug fix on poll edit screen.
     334* FIX: "Additional CSS" emptying bug fix.
     335* FIX: Other minor fixes.
     336* CHG: Updated English translation.
    346337
    347338= 5.2.2 =
    348 * FIX: when click on 'close', 'open', 'activate', 'deactivate' buttons at polls list table, the action was applied not immediately
    349 * FIX: radio, checkbox styles fix
     339* FIX: Actions (close, open, activate, deactivate) in polls list table were not applied immediately.
     340* FIX: Radio and checkbox styles.
    350341
    351342= 5.2.1 =
    352 * ADD: 'in posts' column in admin polls list. In which posts the poll shortcode used.
     343* ADD: 'In posts' column in admin polls list to show where the poll shortcode is used.
    353344
    354345= 5.2.0 =
    355 * ADD: hooks: 'dem_poll_inserted', 'dem_before_insert_quest_data'
    356 * ADD: two variants to delete logs: only logs and logs with votes.
    357 * ADD: possibiliti to delete single answer log.
    358 * ADD: "all voters" at the bottom of a poll if the poll is multiple.
    359 * ADD: delete answer logs on answer deleting.
    360 * ADD: button to delete all logs of closed polls.
    361 * ADD: not show logs link in polls list table, when the poll don't have any log records.
    362 * ADD: collapse extremely height polls under 'max height' option. All answers expands when user click on answers area.
    363 * ADD: css themes for 'radio' and 'checkboks' inputs. Added special css classes and span after input element into the poll HTML code.
    364 * ADD: now you can set access to add, edit polls and logs to other wordpress roles (editor, author etc.).
    365 * ADD: mark 'NEW' for newely added answers by any user, except poll creator.
    366 * ADD: 'NEW' mark filter and 'NEW' mark clear button in plugin logs table.
    367 * ADD: country name and flag in logs table, parsed from voter IP.
    368 * ADD: ability to sort answers (set order) in edit/add poll admin page. In this case answers will showen by the order.
    369 * ADD: one more option to sort answers by random on display its in poll.
    370 * ADD: sort option for single poll. It will overtake global sort option.
    371 * FIX: fix admin css bug in firefox on design screen...
    372 * CHG: EN translation is updated.
     346* ADD: Hooks: `dem_poll_inserted`, `dem_before_insert_quest_data`.
     347* ADD: Two options to delete logs: only logs or logs with votes.
     348* ADD: Ability to delete a single answer log.
     349* ADD: "All voters" section at bottom of multiple polls.
     350* ADD: Delete answer logs when deleting an answer.
     351* ADD: Button to delete logs of closed polls.
     352* ADD: Hide "logs" link in polls list table if no log records exist.
     353* ADD: Collapse extremely tall polls with "max height" option; expand on answer click.
     354* ADD: CSS themes for radio and checkbox inputs; special classes and spans added.
     355* ADD: Ability to assign poll and log access to other WordPress roles.
     356* ADD: "NEW" mark for newly added answers (except by poll creator).
     357* ADD: "NEW" mark filter and clear button on logs table.
     358* ADD: Display country name and flag in logs table based on voter IP.
     359* ADD: Ability to sort answers manually in edit/add poll page.
     360* ADD: Option to randomize answer order.
     361* ADD: Single poll sort option to override global setting.
     362* FIX: Admin CSS bug on design screen in Firefox.
     363* CHG: Updated English translation.
    373364
    374365= 5.1.1 =
    375 * SEO Fix: Now sets 404 response and "noindex" head tag for duplicate pages with: $_GET['dem_act'] or $_GET['dem_pid'] or $_GET['show_addanswerfield']
     366* FIX: SEO - 404 response and "noindex" head tag for duplicate pages (`dem_act`, `dem_pid`, `show_addanswerfield` GET parameters).
    376367
    377368= 5.1.0 =
    378 * Fix: Change DB ip field from int(11) to bigint(20). Because of this some IP was writen wrong. Also, change some other DB fields types, but it's no so important.
     369* FIX: Changed DB IP field from `int(11)` to `bigint(20)` to fix wrong IP storage. Adjusted some other DB fields.
    379370
    380371= 5.0.3 =
    381 * Fix: Some bugs with variables and antivirus check.
     372* FIX: Bugs with variables and antivirus checks.
    382373
    383374= 5.0.2 =
    384 * FIX: not correctly set answers on cache mode, because couldn't detect current screen correctly.
     375* FIX: Incorrect answer setting in cache mode due to wrong screen detection.
    385376
    386377= 5.0.1 =
    387 * ADD: expand answers list on Polls list page by click on the block.
     378* ADD: Expand answers list by clicking on the block in Polls list page.
    388379
    389380= 5.0 =
    390 * FIX: replace VOTE button with REVOTE. On cache mode, after user voting he see backVOTE button (on result screen), but not "revote" or "nothing" (depence on poll options).
    391 * HUGE ADD: Don't show results until vote is closed. You can choose this option for single poll or for all polls (on settings page).
    392 * ADD: edit & view links on admin logs page.
    393 * ADD: Search poll field on admin polls list page.
    394 * ADD: All answers (not just win) in "Winner" column on polls list page. For usability answers are folds.
    395 * ADD: Poll shordcode on edit poll page. Auto select on its click.
    396 * CHG: sort answers by votes on edit poll page.
     381* FIX: Replaced VOTE button with REVOTE button in cache mode after voting.
     382* ADD: Option to hide results until poll is closed (global and per poll).
     383* ADD: Edit & view links on admin logs page.
     384* ADD: Search field on admin polls list page.
     385* ADD: Show all answers (not only winners) in "Winner" column.
     386* ADD: Poll shortcode shown on edit poll page (auto-select on click).
     387* CHG: Sort answers by votes on edit poll page.
    397388
    398389= 4.9.4 =
    399 * FIX: change default DB tables charset from utf8mb4 to utf8. Thanks to Nanotraktor
     390* FIX: Changed default DB charset from `utf8mb4` to `utf8`. Thanks to Nanotraktor.
    400391
    401392= 4.9.3 =
    402 * ADD: single poll option that allow set limit for max answers if there is multiple answers option.
    403 * ADD: global option that allow hide vote button on polls with no multiple answers and revote possibility. Users will vote by clicking on answer itself.
    404 * fix: disable cache on archive page.
     393* ADD: Single poll option to limit max answers in multiple-answer polls.
     394* ADD: Global option to hide vote button on non-multiple polls (click-to-vote).
     395* FIX: Disabled cache on archive page.
    405396
    406397= 4.9.2 =
    407 * FIX: bootstrap .label class conflict. Rename .label to .dem-label. If you discribe .label class in 'additional css' rename it to .dem-label please.
    408 * ADD: Now on new version css regenerated automaticaly when you enter any democracy admin page.
     398* FIX: Bootstrap `.label` class conflict; renamed to `.dem-label`.
     399* ADD: Auto-regenerate CSS on plugin admin page load.
    409400
    410401= 4.9.1 =
    411 * FIX: Polls admin table column order
     402* FIX: Polls admin table column order.
    412403
    413404= 4.9.0 =
    414 * ADD: Logs table in admin and capability to remove only logs of specific poll.
    415 * ADD: 'date' field to the democracy_log table.
     405* ADD: Logs table in admin with ability to remove logs of a specific poll.
     406* ADD: 'date' field to `democracy_log` table.
    416407
    417408= 4.8 =
    418 * Complatelly change polls list table output. Now it work under WP_List_Table and have sortable colums, pagination, search (in future) etc.
     409* CHG: Completely revamped polls list table using WP_List_Table: sortable columns, pagination, and search ready.
    419410
    420411= 4.7.8 =
    421 * ADD: en_US l10n if no l10n file.
     412* ADD: Default en_US localization if none available.
    422413
    423414= 4.7.7 =
    424 * ADD: de_DE localisation. Thanks to Matthias Siebler
     415* ADD: de_DE localization. Thanks to Matthias Siebler.
    425416
    426417= 4.7.6 =
    427 * DELETED: possibility to work without javascript. Now poll works only with enabled javascript in your browser. It's better because you don't have any additional URL with GET parametrs. It's no-need-URL in 99% cases..
     418* DEL: Removed no-JS support. Now poll requires JavaScript for better usability.
    428419
    429420= 4.7.5 =
    430 * CHG: Convert tables from utf8 to utf8mb4 charset. For emoji uses in polls
     421* CHG: Changed DB charset to `utf8mb4` to support emojis.
    431422
    432423= 4.7.4 =
    433 * CHG: Some css styles in admin
     424* CHG: Updated admin CSS styles.
    434425
    435426= 4.7.3 =
    436 * ADD: Custom front-end localisation - as single settings page. Now you can translate all phrases of Poll theme as you like.
     427* ADD: Custom frontend localization settings page to translate all poll phrases.
    437428
    438429= 4.7.2 =
    439 * CHG: in main js cache result/vote view was setted with animation. Now it sets without animation & so the view change invisible for users. Also, fix with democracy wrap block height set, now it's sets on "load" action, but not "document.ready".
    440 * CHG: "block.css" theme improvements for better design.
     430* CHG: JS result/vote view cache updated without animation for smoother UX.
     431* CHG: Democracy block height set on "load" instead of "document.ready".
     432* CHG: Minor improvements in `block.css` theme.
    441433
    442434= 4.7.1 =
    443 * ADD: "on general options page": global "revote" and "democratic" functionality disabling ability
    444 * ADD: localisation POT file & english transtation
     435* ADD: Global options to disable "revote" and "democratic" features.
     436* ADD: Localization POT file and English translation.
    445437
    446438= 4.7.0 =
    447 * CHG: "progress fill type" & "answers order" options now on "Design option page"
    448 * FIX: english localisation
     439* CHG: Moved "progress fill type" and "answers order" settings to Design options page.
     440* FIX: English localization fixes.
    449441
    450442= 4.6.9 =
    451 * CHG: delete "add new answer" button on Add new poll and now field for new answerr adds when you focus on last field.
     443* CHG: Reworked answer field adding on new poll creation (add on focus).
    452444
    453445= 4.6.8 =
    454 * FIX: options bug appers in 4.6.7
     446* FIX: Bug introduced in 4.6.7 affecting options.
    455447
    456448= 4.6.7 =
    457 * ADD: check for current user has an capability to edit polls. Now toolbar doesn't shown if user logged in but not have capability
     449* ADD: Capability check for editing polls. Toolbar hidden for unauthorized users.
    458450
    459451= 4.6.6 =
    460 * FIX: Huge bug about checking is user already vote or not. This is must have release!
    461 * CHG: a little changes in js code
    462 * 'notVote' cookie check set to 1 hour
     452* FIX: Major voting status check bug fixed (critical release).
     453* CHG: Minor JS code changes.
     454* CHG: `notVote` cookie lifespan set to 1 hour.
    463455
    464456= 4.6.5 =
    465 * ADD: New theme "block.css"
    466 * ADD: Preset theme (_preset.css) now visible and you can set it and wtite additional css styles to customize theme
     457* ADD: New theme `block.css`.
     458* ADD: Preset theme visibility and customization support.
    467459
    468460= 4.6.4 =
    469 * FIX: when user send democratic answer, new answer couldn't have comma
     461* FIX: New democratic answers couldn't contain commas.
    470462
    471463= 4.6.3 =
    472 * FIX: Widget showed screens uncorrectly because of some previous changes in code.
    473 * Improve: English localisation
     464* FIX: Widget display issues due to code changes.
     465* IMP: Improved English localization.
    474466
    475467= 4.6.2 =
    476 * FIX: great changes about polls themes and css structure.
    477 * ADD: "Ace" css editor. Now you can easely write your own themes by editing css in admin.
     468* FIX: Major updates to poll themes and CSS structure.
     469* ADD: "Ace" CSS editor for easier theme customization.
    478470
    479471= 4.6.1 =
    480 * FIX: some little changes about themes settings, translate, css.
    481 * ADD: screenshots to WP directory.
     472* FIX: Minor changes to themes, translations, and CSS.
     473* ADD: Added screenshots to WP directory.
    482474
    483475= 4.6.0 =
    484 * ADD: Poll themes management
    485 * FIX: some JS and CSS bugs
    486 * FIX: Unactivate pool when closing poll
     476* ADD: Poll themes management.
     477* FIX: JS and CSS bug fixes.
     478* FIX: Auto-deactivate polls when closed.
    487479
    488480= 4.5.9 =
    489 * FIX: CSS fixes, prepare to 4.6.0 version update
    490 * ADD: Cache working. Wright/check cookie "notVote" for cache gear optimisation
     481* FIX: CSS fixes; prep for 4.6.0 update.
     482* ADD: Cache handling and "notVote" cookie optimization.
    491483
    492484= 4.5.8 =
    493 * ADD: AJAX loader images SVG & css3 collection
    494 * ADD: Sets close date when closing poll
     485* ADD: AJAX loader images (SVG & CSS3 collection).
     486* ADD: Automatically set close date when poll closes.
    495487
    496488= 4.5.7 =
    497 * FIX: revote button didn't minus votes if "keep-logs" option was disabled
     489* FIX: Revote button did not deduct votes if "keep-logs" option was disabled.
    498490
    499491= 4.5.6 =
    500 * ADD: right working with cache plugins. Auto unable/dasable with wp total cache, wp super cache, WordFence, WP Rocket, Quick Cache. If you use the other plugin you can foorce enable this option.
    501 * ADD: add link to selected css file in settings page, to conviniently copy or view the css code
    502 * ADD: php 5.3+ needed check & notice if php unsuitable
    503 * Changed: archive page ID in option, but not link to the archive page
    504 * FIX: in_archive check... to not show archive link on archive page
    505 * FIX: many code improvements & some bug fix (hide archive page link if 0 set as ID, errors on activation, etc.)
     492* ADD: Cache plugin compatibility (W3TC, WP Super Cache, WordFence, WP Rocket, Quick Cache).
     493* ADD: Settings page link to selected CSS file for easier customization.
     494* ADD: PHP 5.3+ requirement notice.
     495* CHG: Archive page ID stored instead of link.
     496* FIX: Multiple small bugs and optimizations.
    506497
    507498= 4.5.5 =
    508 * CHG: Archive link detection by ID not by url
     499* CHG: Archive link detection now based on ID, not URL.
    509500
    510501= 4.5.4 =
    511 * FIX: js code. Now All with jQuery
    512 * FIX: Separate js and css connections: css connect on all pages into the head, but js connected into the bottom just for page where it need
     502* FIX: JS refactored: all scripts run via jQuery.
     503* FIX: Separated JS and CSS loading: CSS globally in head; JS only where needed.
    513504
    514505= 4.5.3 =
    515 * FIX: code fix, about $_POST[*] vars
     506* FIX: Code fixes for handling `$_POST` variables.
    516507
    517508= 4.5.2 =
    518 * FIX: Remove colling wp-load.php files directly on AJAX request. Now it works with wordpress environment - it's much more stable.
    519 * FIX: fixes about safe SQL calls. Correct escaping of passing variables. Now work with $wpdb->* functions where it posible
    520 * FIX: admin messages
     509* FIX: Removed direct `wp-load.php` calls on AJAX requests; now uses WordPress environment.
     510* FIX: Safe SQL call improvements using `$wpdb` functions.
     511* FIX: Admin message fixes.
    521512
    522513= 4.5.1 =
    523 * FIX: Localisation bug on activation.
     514* FIX: Localization bug on activation.
    524515
    525516= 4.5 =
    526 * ADD: css style themes support.
    527 * ADD: new flat (flat.css) theme.
    528 * FIX: Some bugs in code.
     517* ADD: CSS style themes support.
     518* ADD: New "flat.css" theme.
     519* FIX: Multiple bug fixes.
    529520
    530521= 4.4 =
    531 * ADD: All plugin functionality when javascript is disabled in browser.
    532 * FIX: Some bug.
     522* ADD: Full plugin functionality even with JavaScript disabled.
     523* FIX: Minor bug fixes.
    533524
    534525= 4.3.1 =
    535 * ADD: "add user answer text" field close button when on multiple vote. Now it's much more convenient.
    536 * FIX: Some bug.
     526* ADD: "Close" button for "add user answer text" field on multiple vote polls.
     527* FIX: Minor bug fix.
    537528
    538529= 4.3 =
    539 * ADD: TinyMCE button.
    540 * FIX: Some bug.
     530* ADD: TinyMCE button integration.
     531* FIX: Minor bug fix.
    541532
    542533= 4.2 =
     
    544535
    545536= 4.1 =
    546 * ADD: "only registered users can vote" functionality.
    547 * ADD: Minified versions of CSS (*.min.css) and .js (*.min.js) is loaded if they exists.
    548 * ADD: js/css inline including: Adding code of .css and .js files right into HTML. This must improve performance a little.
    549 * ADD: .js and .css files (or theirs code) loads only on the pages where polls is shown.
    550 * ADD: Toolbar menu for fast access. It help easily manage polls. The menu can be disabled.
     537* ADD: Restriction for "only registered users can vote".
     538* ADD: Minified versions of CSS and JS loaded automatically if available.
     539* ADD: Inline JS/CSS inclusion option for performance.
     540* ADD: Load scripts/styles only on pages with polls.
     541* ADD: Admin toolbar menu for faster poll management.
    551542
    552543= 4.0 =
    553 * ADD: Multiple voting functionality.
    554 * ADD: Opportunity to change answers votes in DataBase.
    555 * ADD: "Random show one of many active polls" functionality.
    556 * ADD: Poll expiration date functionality.
    557 * ADD: Poll expiration datepicker on jQuery.
     544* ADD: Multiple voting option.
     545* ADD: Ability to change vote counts manually.
     546* ADD: Random poll selection from active polls.
     547* ADD: Poll expiration date feature.
     548* ADD: jQuery datepicker for poll expiration.
    558549* ADD: Open/close polls functionality.
    559 * ADD: Localisation functionality. Translation to English.
    560 * ADD: Change {democracy}/{democracy:*} shortcode to standart WP [democracy]/[democracy id=*].
    561 * ADD: jQuery support and many features because of this.
    562 * ADD: Edit button for each poll (look at right top corner) to convenient edit poll when logged in.
     550* ADD: Localization functionality (English translation).
     551* ADD: Switched to standard WP shortcodes `[democracy]`.
     552* ADD: Full jQuery support.
     553* ADD: Edit button for each poll (visible when logged in).
    563554* ADD: Clear logs button.
    564 * ADD: Smart "create archive page" button on plugin's settings page.
    565 * FIX: Improve about 80% of plugin code and logic in order to easily expand the plugin functionality in the future.
    566 * FIX: Improve css output. Now it's more adaptive for different designs.
    567 
    568 
     555* ADD: Smart "create archive page" button.
     556* FIX: Major code refactoring for future expansions.
     557* FIX: Improved CSS output for adaptive design.
     558
     559
  • democracy-poll/trunk/styles/alternate.css

    r1423733 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* default theme ------------------------------------------------------------- */
     
    1415
    1516/* results screen */
    16 .dem-graph{ font-family:Arial, sans-serif; background: #F7F7F7; background:linear-gradient( to bottom, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% ); background:-webkit-linear-gradient( top, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% ); }
     17.dem-graph{ background: #F7F7F7;
     18    background:linear-gradient( to bottom, rgba(0,0,0,.05) 50%, rgba(0, 0, 0, 0.1) 50% );
     19}
    1720
    18 .dem-fill{ background-image:linear-gradient( to right, rgba(255,255,255,.3), transparent ); background-image:-webkit-linear-gradient( left, rgba(255,255,255,.3), transparent ); }
     21.dem-fill{ background-image:linear-gradient( to right, rgba(255,255,255,.3), transparent ); }
    1922
    2023.dem-answers .dem-label{ margin-bottom:.1em; }
  • democracy-poll/trunk/styles/block.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* block theme -------------------------------------------------------------- */
    4 .democracy{ 
     5.democracy{
    56    border-color:#ccc; border: 1px solid rgba(0,0,0,.1); background-color:#eee; background-color:rgba(0,0,0,.1);
    67    background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.05), transparent);background-image: linear-gradient(to top, rgba(0,0,0,.05), transparent);
  • democracy-poll/trunk/styles/inline.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34/* flat theme -------------------------------------------------------------- */
  • democracy-poll/trunk/styles/minimal.css

    r2675427 r3282901  
    1 @import '_preset.css';
     1@import '_reset.css';
     2@import '_presets.css';
    23
    34
Note: See TracChangeset for help on using the changeset viewer.