Changeset 3282901
- Timestamp:
- 04/27/2025 08:43:19 PM (11 months ago)
- Location:
- democracy-poll
- Files:
-
- 4 added
- 2 deleted
- 42 edited
- 1 copied
-
tags/6.0.4 (copied) (copied from democracy-poll/trunk)
-
tags/6.0.4/classes/Admin/Admin_Page.php (modified) (1 diff)
-
tags/6.0.4/classes/Admin/Admin_Page_Settings.php (modified) (1 diff)
-
tags/6.0.4/classes/Admin/Admin_Page_l10n.php (modified) (4 diffs)
-
tags/6.0.4/classes/DemPoll.php (modified) (1 diff)
-
tags/6.0.4/classes/Helpers/Helpers.php (modified) (1 diff)
-
tags/6.0.4/classes/Options.php (modified) (5 diffs)
-
tags/6.0.4/classes/Options_CSS.php (modified) (2 diffs)
-
tags/6.0.4/classes/Plugin.php (modified) (9 diffs)
-
tags/6.0.4/classes/Poll_Ajax.php (modified) (6 diffs)
-
tags/6.0.4/classes/Utils/Activator.php (modified) (4 diffs)
-
tags/6.0.4/classes/Utils/Migrator__WP_Polls.php (modified) (1 diff)
-
tags/6.0.4/democracy.php (modified) (3 diffs)
-
tags/6.0.4/js/_js-cookie.js (modified) (2 diffs)
-
tags/6.0.4/js/democracy.js (modified) (31 diffs)
-
tags/6.0.4/js/democracy.min.js (modified) (1 diff)
-
tags/6.0.4/languages/democracy-poll.pot (modified) (18 diffs)
-
tags/6.0.4/readme.txt (modified) (7 diffs)
-
tags/6.0.4/styles/_preset.css (deleted)
-
tags/6.0.4/styles/_presets.css (added)
-
tags/6.0.4/styles/_reset.css (added)
-
tags/6.0.4/styles/alternate.css (modified) (2 diffs)
-
tags/6.0.4/styles/block.css (modified) (1 diff)
-
tags/6.0.4/styles/inline.css (modified) (1 diff)
-
tags/6.0.4/styles/minimal.css (modified) (1 diff)
-
trunk/classes/Admin/Admin_Page.php (modified) (1 diff)
-
trunk/classes/Admin/Admin_Page_Settings.php (modified) (1 diff)
-
trunk/classes/Admin/Admin_Page_l10n.php (modified) (4 diffs)
-
trunk/classes/DemPoll.php (modified) (1 diff)
-
trunk/classes/Helpers/Helpers.php (modified) (1 diff)
-
trunk/classes/Options.php (modified) (5 diffs)
-
trunk/classes/Options_CSS.php (modified) (2 diffs)
-
trunk/classes/Plugin.php (modified) (9 diffs)
-
trunk/classes/Poll_Ajax.php (modified) (6 diffs)
-
trunk/classes/Utils/Activator.php (modified) (4 diffs)
-
trunk/classes/Utils/Migrator__WP_Polls.php (modified) (1 diff)
-
trunk/democracy.php (modified) (3 diffs)
-
trunk/js/_js-cookie.js (modified) (2 diffs)
-
trunk/js/democracy.js (modified) (31 diffs)
-
trunk/js/democracy.min.js (modified) (1 diff)
-
trunk/languages/democracy-poll.pot (modified) (18 diffs)
-
trunk/readme.txt (modified) (7 diffs)
-
trunk/styles/_preset.css (deleted)
-
trunk/styles/_presets.css (added)
-
trunk/styles/_reset.css (added)
-
trunk/styles/alternate.css (modified) (2 diffs)
-
trunk/styles/block.css (modified) (1 diff)
-
trunk/styles/inline.css (modified) (1 diff)
-
trunk/styles/minimal.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
democracy-poll/tags/6.0.4/classes/Admin/Admin_Page.php
r3056337 r3282901 56 56 } 57 57 58 public function admin_page_load() {58 public function admin_page_load(): void { 59 59 60 60 // datepicker -
democracy-poll/tags/6.0.4/classes/Admin/Admin_Page_Settings.php
r3057019 r3282901 179 179 <input type="checkbox" value="1" 180 180 name="dem[post_metabox_off]" <?php checked( options()->post_metabox_off, 1 ) ?> /> 181 <?= esc_html__( 'D asable post metabox.', 'democracy-poll' ) ?>182 </label> 183 <em><?= esc_html__( 'Check this to d asable 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> 184 184 </li> 185 185 -
democracy-poll/tags/6.0.4/classes/Admin/Admin_Page_l10n.php
r3056337 r3282901 4 4 5 5 use function DemocracyPoll\plugin; 6 use function DemocracyPoll\options;7 6 8 7 class Admin_Page_l10n implements Admin_Subpage_Interface { … … 15 14 } 16 15 17 public function load( ){16 public function load(): void { 18 17 } 19 18 20 public function request_handler( ){19 public function request_handler(): void { 21 20 if( ! plugin()->super_access || ! Admin_Page::check_nonce() ){ 22 21 return; … … 43 42 } 44 43 45 public function render() {44 public function render(): void { 46 45 if( ! plugin()->super_access ){ 47 46 return; … … 150 149 * For front part localization and custom translation setup. 151 150 */ 152 public static function add_gettext_filter() {151 public static function add_gettext_filter(): void { 153 152 add_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10, 4 ); 154 153 } 155 154 156 public static function remove_gettext_filter() {155 public static function remove_gettext_filter(): void { 157 156 remove_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10 ); 158 157 } -
democracy-poll/tags/6.0.4/classes/DemPoll.php
r3064229 r3282901 890 890 891 891 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 ){ 897 900 $answers = Helpers::objects_array_sort( $answers, [ 'votes' => 'desc' ] ); 898 901 } 899 elseif( $ord === 'mix' ){ 902 elseif( $order === 'alphabet' ){ 903 $answers = Helpers::objects_array_sort( $answers, [ 'answer' => 'asc' ] ); 904 } 905 elseif( $order === 'mix' ){ 900 906 shuffle( $answers ); 901 907 } 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 } 911 910 } 912 911 -
democracy-poll/tags/6.0.4/classes/Helpers/Helpers.php
r3059285 r3282901 9 9 'by_id' => __( 'As it was added (by ID)', 'democracy-poll' ), 10 10 'by_winner' => __( 'Winners at the top', 'democracy-poll' ), 11 'alphabet' => __( 'Alphabetically', 'democracy-poll' ), 11 12 'mix' => __( 'Mix', 'democracy-poll' ), 12 13 ]; -
democracy-poll/tags/6.0.4/classes/Options.php
r3057019 r3282901 143 143 /** 144 144 * Sets $this->opt. Update options in DB if it's not set yet. 145 *146 * @return void147 145 */ 148 public function set_opt() {146 public function set_opt(): void { 149 147 150 148 if( ! $this->opt ){ … … 169 167 public function update_single_option( $option_name, $value ): bool { 170 168 171 $newopt = $this->opt;172 $newopt[ $option_name ] = $value;173 174 169 if( $this->is_option_exists( $option_name ) ){ 170 $newopt = $this->opt; 171 $newopt[ $option_name ] = $value; 172 175 173 return (bool) update_option( self::OPT_NAME, $newopt ); 176 174 } … … 180 178 181 179 /** 182 * Updates options.183 *184 180 * @param string $type What group of option to update: main, design. 185 181 */ … … 228 224 229 225 /** 230 * Updates $this->optbased 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. 232 228 */ 233 private function sanitize_request_options( array $request_data, string $type ) {229 private function sanitize_request_options( array $request_data, string $type ): void { 234 230 235 231 foreach( $this->default_options[ $type ] as $key => $v ){ … … 258 254 $this->opt[ $key ] = $value; 259 255 } 260 261 } 262 263 /** 264 * Checks if option name exists. 265 */ 256 } 257 266 258 private function is_option_exists( string $option_name ): bool { 267 259 -
democracy-poll/tags/6.0.4/classes/Options_CSS.php
r3056337 r3282901 58 58 $styledir = DEMOC_PATH . 'styles'; 59 59 60 $out .= $this->parse_css import( "$styledir/$tpl" );60 $out .= $this->parse_css_import( "$styledir/$tpl" ); 61 61 $out .= $radios ? "\n" . file_get_contents( "$styledir/checkbox-radio/$radios" ) : ''; 62 62 $out .= $button ? "\n" . file_get_contents( "$styledir/buttons/$button" ) : ''; … … 138 138 * Imports @import in css. 139 139 */ 140 private function parse_css import( $css_filepath ) {140 private function parse_css_import( $css_filepath ) { 141 141 $filecode = file_get_contents( $css_filepath ); 142 142 -
democracy-poll/tags/6.0.4/classes/Plugin.php
r3057019 r3282901 38 38 } 39 39 40 public function basic_init() {40 public function basic_init(): void { 41 41 $this->opt->set_opt(); 42 42 … … 51 51 } 52 52 53 public function init() {53 public function init(): void { 54 54 $this->basic_init(); 55 55 56 56 $this->set_is_cachegear_on(); 57 57 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 { 59 74 if( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){ 60 75 $this->admin = new Admin(); 61 76 $this->admin->init(); 62 77 } 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 { 72 89 if( $this->admin_access && $this->opt->toolbar_menu ){ 73 90 add_action( 'admin_bar_menu', [ $this, 'add_toolbar_node' ], 99 ); 74 91 } 75 76 $this->hide_form_indexing(); 77 }78 79 // hide duplicate content. For 5+ versions it's no need80 private function hide_form_indexing() {81 // hide duplicate content. For 5+ versions it's no need92 } 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 82 99 if( 83 100 isset( $_GET['dem_act'] ) … … 87 104 || isset( $_GET['dem_add_user_answer'] ) 88 105 ){ 89 add_action( 'wp', function() {106 add_action( 'wp', static function() { 90 107 status_header( 404 ); 91 108 } ); 92 109 93 add_action( 'wp_head', function() {110 add_action( 'wp_head', static function() { 94 111 echo "\n<!--democracy-poll-->\n" . '<meta name="robots" content="noindex,nofollow">' . "\n"; 95 112 } ); … … 97 114 } 98 115 99 private function set_access_caps() {116 private function set_access_caps(): void { 100 117 $is_adminor = current_user_can( 'manage_options' ); 101 118 … … 117 134 } 118 135 119 private function set_is_cachegear_on() {136 private function set_is_cachegear_on(): void { 120 137 121 138 if( $this->opt->force_cachegear ){ … … 133 150 } 134 151 135 public function load_textdomain() {152 public function load_textdomain(): void { 136 153 load_plugin_textdomain( 'democracy-poll', false, basename( DEMOC_PATH ) . '/languages/' ); 137 154 } … … 140 157 * @param \WP_Admin_Bar $toolbar 141 158 */ 142 public function add_toolbar_node( $toolbar ) {159 public function add_toolbar_node( $toolbar ): void { 143 160 144 161 $toolbar->add_node( [ … … 229 246 * Adds scripts to the footer. 230 247 */ 231 public function add_js_once() {248 public function add_js_once(): void { 232 249 static $once = 0; 233 250 if( $once++ ){ … … 245 262 } 246 263 247 public static function _add_js_wp_footer() {264 public static function _add_js_wp_footer(): void { 248 265 echo "\n" . '<script id="democracy-poll">' . file_get_contents( DEMOC_PATH . 'js/democracy.min.js' ) . '</script>' . "\n"; 249 266 } -
democracy-poll/tags/6.0.4/classes/Poll_Ajax.php
r3056337 r3282901 17 17 18 18 // 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'] ) 21 22 ){ 22 23 add_action( 'init', [ $this, 'not_ajax_request_handler' ], 99 ); … … 24 25 } 25 26 26 # Делает предваритеьную проверку передавемых переменных запроса 27 /** 28 * Does a preliminary sanitization of the passed request variables. 29 */ 27 30 public function sanitize_request_vars(): array { 28 29 31 return [ 30 32 'act' => sanitize_text_field( $_POST['dem_act'] ?? '' ), … … 34 36 } 35 37 36 # обрабатывает запрос AJAX37 38 public function ajax_request_handler() { 38 39 … … 49 50 $poll = new \DemPoll( $vars->pid ); 50 51 51 // switch 52 // голосуем и выводим результаты 52 // vote and display results 53 53 if( 'vote' === $vars->act && $vars->aids ){ 54 54 $voted = $poll->vote( $vars->aids ); … … 65 65 } 66 66 } 67 // удаляем результаты67 // delete results 68 68 elseif( 'delVoted' === $vars->act ){ 69 69 $poll->delete_vote(); 70 70 echo $poll->get_vote_screen(); 71 71 } 72 // смотрим результаты72 // view results 73 73 elseif( 'view' === $vars->act ){ 74 74 if( $poll->not_show_results ){ … … 79 79 } 80 80 } 81 // вернуться к голосованию81 // back to voting 82 82 elseif( 'vote_screen' === $vars->act ){ 83 83 echo $poll->get_vote_screen(); 84 84 } 85 // get poll->votedFor value (from db) 85 86 elseif( 'getVotedIds' === $vars->act ){ 86 87 if( $poll->votedFor ){ 87 $poll->set_cookie(); // Установим куки, т.к. этот запрос делается только если куки не установлены88 $poll->set_cookie(); // Set cookies, since this request is only made if cookies are not set 88 89 echo $poll->votedFor; 89 90 } 90 91 elseif( $poll->blockForVisitor ){ 91 echo 'blockForVisitor'; // чтобы вывести заметку92 echo 'blockForVisitor'; // to display a note 92 93 } 93 94 else{ 94 // если не голосовал ставим куки на пол дня, чтобы не делать эту проверку каждый раз95 // If not voted, set a cookie for half a day to don't do this check every time. 95 96 $poll->set_cookie( 'notVote', ( time() + ( DAY_IN_SECONDS / 2 ) ) ); 96 97 } -
democracy-poll/tags/6.0.4/classes/Utils/Activator.php
r3057019 r3282901 7 7 class Activator { 8 8 9 public static function set_db_tables() {9 public static function set_db_tables(): void { 10 10 global $wpdb; 11 11 $wpdb->democracy_q = $wpdb->prefix . 'democracy_q'; … … 14 14 } 15 15 16 public static function activate() {16 public static function activate(): void { 17 17 plugin()->basic_init(); 18 18 … … 30 30 } 31 31 32 private static function _activate() {32 private static function _activate(): void { 33 33 // create tables 34 34 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; … … 40 40 } 41 41 42 private static function add_sample_poll() {42 private static function add_sample_poll(): void { 43 43 global $wpdb; 44 44 -
democracy-poll/tags/6.0.4/classes/Utils/Migrator__WP_Polls.php
r3056337 r3282901 69 69 70 70 use function DemocracyPoll\plugin; 71 use function DemocracyPoll\options;72 71 73 72 class Migrator__WP_Polls { 74 73 75 public function migrate() {74 public function migrate(): void { 76 75 global $wpdb; 77 76 -
democracy-poll/tags/6.0.4/democracy.php
r3064229 r3282901 2 2 /** 3 3 * 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. 5 5 * 6 6 * Author: Kama … … 11 11 * Domain Path: /languages/ 12 12 * 13 * Requires at least: 4.714 * Requires PHP: 7. 013 * Requires at least: 5.8 14 * Requires PHP: 7.4 15 15 * 16 * Version: 6.0. 316 * Version: 6.0.4 17 17 */ 18 18 … … 32 32 register_activation_hook( __FILE__, [ \DemocracyPoll\Utils\Activator::class, 'activate' ] ); 33 33 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 */ 38 add_action( 'after_setup_theme', [ plugin(), 'init' ] ); -
democracy-poll/tags/6.0.4/js/_js-cookie.js
r2675427 r3282901 1 1 // includes in democracy.js 2 2 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]; 36 24 } 37 25 } 38 return result;26 return target 39 27 } 28 /* eslint-enable no-var */ 40 29 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 */ 44 46 45 function init (converter) { 46 function api() {} 47 /* eslint-disable no-var */ 47 48 48 function set (key, value, attributes) { 49 function init (converter, defaultAttributes) { 50 function set (name, value, attributes) { 49 51 if (typeof document === 'undefined') { 50 return ;52 return 51 53 } 52 54 53 attributes = extend({ 54 path: '/' 55 }, api.defaults, attributes); 55 attributes = assign({}, defaultAttributes, attributes); 56 56 57 57 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(); 59 62 } 60 63 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); 79 67 80 68 var stringifiedAttributes = ''; 81 69 for (var attributeName in attributes) { 82 70 if (!attributes[attributeName]) { 83 continue ;71 continue 84 72 } 73 85 74 stringifiedAttributes += '; ' + attributeName; 75 86 76 if (attributes[attributeName] === true) { 87 continue ;77 continue 88 78 } 89 79 … … 98 88 } 99 89 100 return (document.cookie = key + '=' + value + stringifiedAttributes); 90 return (document.cookie = 91 name + '=' + converter.write(value, name) + stringifiedAttributes) 101 92 } 102 93 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 106 97 } 107 98 108 var jar = {};109 99 // To prevent the for loop in the first place assign an empty array 110 100 // in case there are no cookies at all. 111 101 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++) { 115 104 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('='); 121 106 122 107 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); 126 110 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 137 113 } 138 114 } catch (e) {} 139 115 } 140 116 141 return key ? jar[key] : jar;117 return name ? jar[name] : jar 142 118 } 143 119 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 ) 162 145 } 163 146 164 return init(function () {}); 147 var api = init(defaultConverter, { path: '/' }); 148 /* eslint-enable no-var */ 149 150 return api; 151 165 152 })); -
democracy-poll/tags/6.0.4/js/democracy.js
r3056337 r3282901 1 2 1 includefile = '_js-cookie.js' 3 2 3 4 4 // 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( $ ){ 5 document.addEventListener( 'DOMContentLoaded', democracyInit ) 6 7 function democracyInit(){ 15 8 16 9 let demmainsel = '.democracy' 17 let $dems = $( demmainsel )18 19 if( ! $dems.length ) 10 let $dems = jQuery( demmainsel ) 11 12 if( ! $dems.length ){ 20 13 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' ) 25 19 let loader 26 20 let Dem = {} … … 39 33 let demScreensSetHeight = function(){ 40 34 $demScreens.each( function(){ 41 Dem.setHeight( $( this ), 1 )35 Dem.setHeight( jQuery( this ), 1 ) 42 36 } ) 43 37 } … … 45 39 $demScreens.demInitActions( 1 ) 46 40 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 ) // высота еще раз 50 44 51 45 Dem.maxAnswLimitInit() // ограничение выбора мульти ответов … … 56 50 * и дополнительные js переменные и методы самого Democracy. 57 51 */ 58 var $cache = $( '.dem-cache-screens' )52 var $cache = jQuery( '.dem-cache-screens' ) 59 53 if( $cache.length > 0 ){ 60 54 //console.log('Democracy cache gear ON'); … … 67 61 // Инициализация всех событий связаных с внутренней частью каждого опроса: клики, высота, скрытие кнопки 68 62 // применяется на '.dem-screen' 69 $.fn.demInitActions = function( noanimation ){63 jQuery.fn.demInitActions = function( noanimation ){ 70 64 71 65 return this.each( function(){ 72 66 // Устанавливает события клика для всех помеченных элементов в переданом элементе: 73 67 // тут и AJAX запрос по клику и другие интерактивные события Democracy ---------- 74 var $this = $( this )68 var $this = jQuery( this ) 75 69 var attr = 'data-dem-act' 76 70 77 71 $this.find( '[' + attr + ']' ).each( function(){ 78 var $the = $( this )72 var $the = jQuery( this ) 79 73 $the.attr( 'href', '' ) // удалим УРЛ чтобы не было видно УРЛ запроса 80 74 … … 95 89 if( Dem.lineAnimSpeed ){ 96 90 $this.find( '.dem-fill' ).each( function(){ 97 var $fill = $( this )91 var $fill = jQuery( this ) 98 92 //setTimeout(function(){ fill.style.width = was; }, Dem.animSpeed + 500); // на базе CSS transition - при сбросе тоже срабатывает и мешает... 99 93 setTimeout( function(){ … … 111 105 e.preventDefault() 112 106 113 var act = $( this ).find( 'input[name="dem_act"]' ).val()107 var act = jQuery( this ).find( 'input[name="dem_act"]' ).val() 114 108 if( act ) 115 $( this ).demDoAction( $( this ).find( 'input[name="dem_act"]' ).val() )109 jQuery( this ).demDoAction( jQuery( this ).find( 'input[name="dem_act"]' ).val() ) 116 110 } ) 117 111 } ) … … 119 113 120 114 // Loader 121 $.fn.demSetLoader = function(){122 var$the = this123 124 if( $demLoader.length ) 115 jQuery.fn.demSetLoader = function(){ 116 const $the = this 117 118 if( $demLoader.length ){ 125 119 $the.closest( demScreen ).append( $demLoader.clone().css( 'display', 'table' ) ) 126 else127 loader = setTimeout( function(){128 Dem.demLoadingDots( $the)129 }, 50 ) // dots120 } 121 else { 122 loader = setTimeout( () => Dem.demLoadingDots( $the[0] ), 50 ) 123 } 130 124 131 125 return this 132 126 } 133 127 134 $.fn.demUnsetLoader = function(){128 jQuery.fn.demUnsetLoader = function(){ 135 129 136 130 if( $demLoader.length ) … … 143 137 144 138 // Добавить ответ пользователя (ссылка) 145 $.fn.demAddAnswer = function(){139 jQuery.fn.demAddAnswer = function(){ 146 140 147 141 var $the = this.first() 148 142 var $demScreen = $the.closest( demScreen ) 149 143 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="">' ) // поле добавления ответа 151 145 152 146 // покажем кнопку голосования … … 156 150 $demScreen.find( '[type=radio]' ).each( function(){ 157 151 158 $( this ).on( 'click', function(){152 jQuery( this ).on( 'click', function(){ 159 153 $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 ) 164 158 this.checked = false // uncheck 165 159 } ) … … 173 167 var $ua = $demScreen.find( userAnswer ) 174 168 175 $( '<span class="dem-add-answer-close">×</span>' )169 jQuery( '<span class="dem-add-answer-close">×</span>' ) 176 170 .insertBefore( $ua ) 177 171 .css( 'line-height', $ua.outerHeight() + 'px' ) 178 172 .on( 'click', function(){ 179 var $par = $( this ).parent( 'li' )173 var $par = jQuery( this ).parent( 'li' ) 180 174 $par.find( 'input' ).remove() 181 175 $par.find( 'a' ).fadeIn( 300 ) 182 $( this ).remove()176 jQuery( this ).remove() 183 177 } ) 184 178 } … … 188 182 189 183 // Собирает ответы и возращает их в виде строки 190 $.fn.demCollectAnsw = function(){184 jQuery.fn.demCollectAnsw = function(){ 191 185 var $form = this.closest( 'form' ) 192 186 var $answers = $form.find( '[type=checkbox],[type=radio],[type=text]' ) … … 198 192 if( $checkbox.length > 0 ){ 199 193 $checkbox.each( function(){ 200 answ.push( $( this ).val() )194 answ.push( jQuery( this ).val() ) 201 195 } ) 202 196 } … … 219 213 220 214 // обрабатывает запросы при клике, вешается на событие клика 221 $.fn.demDoAction = function( act){215 jQuery.fn.demDoAction = function( action ){ 222 216 223 217 var $the = this.first() … … 225 219 var data = { 226 220 dem_pid: $dem.data( 'opts' ).pid, 227 dem_act: act ,221 dem_act: action, 228 222 action : 'dem_ajax' 229 223 } … … 235 229 236 230 // Соберем ответы 237 if( 'vote' === act ){231 if( 'vote' === action ){ 238 232 data.answer_ids = $the.demCollectAnsw() 239 233 if( ! data.answer_ids ){ 240 Dem.demShake( $the )234 Dem.demShake( $the[0] ) 241 235 return false 242 236 } … … 244 238 245 239 // кнопка переголосовать, подтверждение 246 if( 'delVoted' === act && !confirm( $the.data( 'confirm-text' ) ) )240 if( 'delVoted' === action && !confirm( $the.data( 'confirm-text' ) ) ) 247 241 return false 248 242 249 243 // кнопка добавления ответа посетителя 250 if( 'newAnswer' === act ){244 if( 'newAnswer' === action ){ 251 245 $the.demAddAnswer() 252 246 return false … … 255 249 // AJAX 256 250 $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 } ) 270 262 271 263 return false … … 276 268 277 269 // показывает заметку 278 $.fn.demCacheShowNotice = function( type ){270 jQuery.fn.demCacheShowNotice = function( type ){ 279 271 280 272 var $the = this.first(), … … 307 299 votedtxt = $dema.data( 'voted-txt' ) 308 300 309 $.each( aids, function( key, val ){301 jQuery.each( aids, function( key, val ){ 310 302 $screen.find( '[data-aid="' + val + '"]' ) 311 303 .addClass( votedClass ) 312 304 .attr( 'title', function(){ 313 return votedtxt + $( this ).attr( 'title' )305 return votedtxt + jQuery( this ).attr( 'title' ) 314 306 } ) 315 307 } ) … … 325 317 326 318 // устанавливаем ответы 327 $.each( aids, function( key, val ){319 jQuery.each( aids, function( key, val ){ 328 320 $answs.filter( '[data-aid="' + val + '"]' ).find( 'input' ).prop( 'checked', 'checked' ) 329 321 } ) … … 350 342 } 351 343 352 $.fn.demCacheInit = function(){344 jQuery.fn.demCacheInit = function(){ 353 345 354 346 return this.each( function(){ 355 347 356 var $the = $( this )348 var $the = jQuery( this ) 357 349 358 350 // ищем главный блок 359 351 var $dem = $the.prevAll( demmainsel + ':first' ) 360 if( ! $dem.length )352 if( ! $dem.length ) 361 353 $dem = $the.closest( demmainsel ) 362 354 363 if( ! $dem.length ){355 if( ! $dem.length ){ 364 356 console.warn( 'Democracy: Main dem div not found' ) 365 357 return … … 377 369 378 370 // если опрос закрыт должны кэшироваться только результаты голосования. Просто выходим. 379 if( ! voteHTML )371 if( ! voteHTML ){ 380 372 return 373 } 381 374 382 375 // устанавливаем нужный кэш … … 392 385 $screen.demInitActions( 1 ) 393 386 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 ){ 400 394 var tmout 401 395 var notcheck__fn = function(){ … … 413 407 $forDotsLoader.demSetLoader() 414 408 415 $.post( Dem.ajaxurl,409 jQuery.post( Dem.ajaxurl, 416 410 { 417 411 dem_pid: $dem.data( 'opts' ).pid, … … 421 415 function( reply ){ 422 416 $forDotsLoader.demUnsetLoader() 423 if( !reply ) return // выходим если нет ответов 417 // exit if there are no answers 418 if( ! reply ){ 419 return; 420 } 424 421 425 422 $screen.html( votedHTML ) … … 428 425 $screen.demInitActions() 429 426 430 // сообщение, что голосовал или только для пользователей427 // a message that you have voted or for users only 431 428 $screen.demCacheShowNotice( reply ) 432 429 } 433 430 ) 434 431 }, 700 ) 435 // 700 для оптимизации, чтобы моментально не отправлялся запрос, если мышкой просто провели по опросу...432 // 700 for optimization, so that the request is not sent instantly if you just swipe the mouse on the survey... 436 433 } 437 434 … … 471 468 $that.css( { opacity: 0 } ) 472 469 .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 ) 474 471 } ) 475 472 } … … 496 493 $el.css( 'position', 'relative' ) 497 494 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 ) 499 496 var fn__expand = function(){ 500 497 $overlay.addClass( 'expanded' ).removeClass( 'collapsed' ) … … 565 562 $dems.on( 'change', 'input[type="checkbox"]', function(){ 566 563 567 var maxAnsws = $( this ).closest( demmainsel ).data( 'opts' ).max_answs568 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"]' ) 569 566 var $checked = $checkboxs.filter( ':checked' ).length 570 567 571 568 if( $checked >= maxAnsws ){ 572 569 $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' ) 574 571 } ) 575 572 } 576 573 else { 577 574 $checkboxs.each( function(){ 578 $( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )575 jQuery( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' ) 579 576 } ) 580 577 } … … 582 579 } 583 580 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 ) 616 612 } 617 613 618 614 } 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 */ 2 function 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 3 3 msgstr "" 4 4 "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" 6 6 "PO-Revision-Date: 2017-03-12 15:02+0500\n" 7 7 "Last-Translator: \n" … … 13 13 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 14 14 "%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" 16 16 "X-Poedit-Basepath: ..\n" 17 17 "X-Poedit-SourceCharset: UTF-8\n" … … 20 20 21 21 #: classes/Admin/Admin.php:42 classes/Admin/Admin_Page.php:205 22 #: classes/Plugin.php:15 422 #: classes/Plugin.php:158 23 23 msgid "Settings" 24 24 msgstr "" … … 32 32 msgstr "" 33 33 34 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:15 134 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:155 35 35 msgid "Polls List" 36 36 msgstr "" … … 41 41 42 42 #: classes/Admin/Admin_Page.php:199 classes/Admin/List_Table_Polls.php:136 43 #: classes/Plugin.php:15 343 #: classes/Plugin.php:157 44 44 msgid "Logs" 45 45 msgstr "" 46 46 47 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:15 547 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:159 48 48 msgid "Theme Settings" 49 49 msgstr "" 50 50 51 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:1 5651 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:160 52 52 msgid "Texts changes" 53 53 msgstr "" … … 57 57 msgstr "" 58 58 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 62 msgid "Updated" 63 msgstr "" 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 68 msgid "Nothing was updated" 69 msgstr "" 70 71 #: classes/Admin/Admin_Page_Design.php:515 60 72 msgid "Results view:" 61 73 msgstr "" 62 74 63 #: classes/Admin/Admin_Page_Design.php:51 075 #: classes/Admin/Admin_Page_Design.php:517 64 76 msgid "Vote view:" 65 77 msgstr "" 66 78 67 #: classes/Admin/Admin_Page_Design.php:51 279 #: classes/Admin/Admin_Page_Design.php:519 68 80 msgid "AJAX loader view:" 69 81 msgstr "" … … 114 126 msgstr "" 115 127 116 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:15 2128 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:156 117 129 msgid "Add Poll" 118 130 msgstr "" … … 243 255 msgstr "" 244 256 245 #: classes/Admin/Admin_Page_Settings.php:8 0257 #: classes/Admin/Admin_Page_Settings.php:87 246 258 msgid "" 247 259 "Example: <code><h2></code> и <code></h2></code>. Default: " … … 250 262 msgstr "" 251 263 252 #: classes/Admin/Admin_Page_Settings.php:9 2264 #: classes/Admin/Admin_Page_Settings.php:99 253 265 msgid "Go to archive page" 254 266 msgstr "" 255 267 256 #: classes/Admin/Admin_Page_Settings.php: 98268 #: classes/Admin/Admin_Page_Settings.php:105 257 269 msgid "Create/find archive page" 258 270 msgstr "" 259 271 260 #: classes/Admin/Admin_Page_Settings.php:10 2272 #: classes/Admin/Admin_Page_Settings.php:109 261 273 msgid "" 262 274 "Specify the poll archive link to be in the poll legend. Example: <code>25</" … … 264 276 msgstr "" 265 277 266 #: classes/Admin/Admin_Page_Settings.php:1 86278 #: classes/Admin/Admin_Page_Settings.php:193 267 279 msgid "ON" 268 280 msgstr "" 269 281 270 #: classes/Admin/Admin_Page_Settings.php:1 87282 #: classes/Admin/Admin_Page_Settings.php:194 271 283 msgid "OFF" 272 284 msgstr "" 273 285 274 #: classes/Admin/Admin_Page_Settings.php:1 89286 #: classes/Admin/Admin_Page_Settings.php:196 275 287 #, php-format 276 288 msgid "Force enable gear to working with cache plugins. The condition: %s" 277 289 msgstr "" 278 290 279 #: classes/Admin/Admin_Page_Settings.php:26 0291 #: classes/Admin/Admin_Page_Settings.php:267 280 292 msgid "" 281 293 "Role names, except 'administrator' which will have access to manage plugin." 282 294 msgstr "" 283 295 284 #: classes/Admin/Admin_Page_Settings.php:3 56296 #: classes/Admin/Admin_Page_Settings.php:363 285 297 msgid "Polls Archive" 286 msgstr ""287 288 #: classes/Admin/Admin_Page_l10n.php:39 classes/Options.php:235289 msgid "Updated"290 msgstr ""291 292 #: classes/Admin/Admin_Page_l10n.php:40 classes/Options.php:236293 msgid "Nothing was updated"294 298 msgstr "" 295 299 … … 310 314 msgstr "" 311 315 312 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:6 4316 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:66 313 317 msgid "Poll" 314 318 msgstr "" … … 343 347 344 348 #: classes/Admin/List_Table_Logs.php:185 classes/Admin/List_Table_Logs.php:271 345 #: classes/DemPoll.php:20 3349 #: classes/DemPoll.php:205 346 350 msgid "Edit poll" 347 351 msgstr "" … … 436 440 msgstr "" 437 441 438 #: classes/DemPoll.php:2 08442 #: classes/DemPoll.php:210 439 443 msgid "Download the Democracy Poll" 440 444 msgstr "" 441 445 442 #: classes/DemPoll.php:33 3446 #: classes/DemPoll.php:335 443 447 msgctxt "front" 444 448 msgid "Add your answer" 445 449 msgstr "" 446 450 447 #: classes/DemPoll.php:34 1451 #: classes/DemPoll.php:343 448 452 msgctxt "front" 449 453 msgid "Already voted..." 450 454 msgstr "" 451 455 452 #: classes/DemPoll.php:34 2 classes/DemPoll.php:502456 #: classes/DemPoll.php:344 classes/DemPoll.php:504 453 457 msgctxt "front" 454 458 msgid "Vote" 455 459 msgstr "" 456 460 457 #: classes/DemPoll.php:38 4461 #: classes/DemPoll.php:386 458 462 msgctxt "front" 459 463 msgid "Results" 460 464 msgstr "" 461 465 462 #: classes/DemPoll.php:42 0466 #: classes/DemPoll.php:422 463 467 msgctxt "front" 464 468 msgid "This is Your vote." 465 469 msgstr "" 466 470 467 #: classes/DemPoll.php:44 6471 #: classes/DemPoll.php:448 468 472 msgctxt "front" 469 473 msgid "The answer was added by a visitor" 470 474 msgstr "" 471 475 472 #: classes/DemPoll.php:4 49476 #: classes/DemPoll.php:451 473 477 #, php-format 474 478 msgctxt "front" … … 476 480 msgstr "" 477 481 478 #: classes/DemPoll.php:4 49 classes/DemPoll.php:453482 #: classes/DemPoll.php:451 classes/DemPoll.php:455 479 483 msgctxt "front" 480 484 msgid "vote,votes,votes" 481 485 msgstr "" 482 486 483 #: classes/DemPoll.php:48 3487 #: classes/DemPoll.php:485 484 488 #, php-format 485 489 msgctxt "front" … … 487 491 msgstr "" 488 492 489 #: classes/DemPoll.php:48 4493 #: classes/DemPoll.php:486 490 494 #, php-format 491 495 msgctxt "front" … … 493 497 msgstr "" 494 498 495 #: classes/DemPoll.php:48 6499 #: classes/DemPoll.php:488 496 500 msgctxt "front" 497 501 msgid "Begin" 498 502 msgstr "" 499 503 500 #: classes/DemPoll.php:4 88504 #: classes/DemPoll.php:490 501 505 msgctxt "front" 502 506 msgid "End" 503 507 msgstr "" 504 508 505 #: classes/DemPoll.php:49 0509 #: classes/DemPoll.php:492 506 510 msgctxt "front" 507 511 msgid " - added by visitor" 508 512 msgstr "" 509 513 510 #: classes/DemPoll.php:49 1514 #: classes/DemPoll.php:493 511 515 msgctxt "front" 512 516 msgid "Voting is closed" 513 517 msgstr "" 514 518 515 #: classes/DemPoll.php:49 3519 #: classes/DemPoll.php:495 516 520 msgctxt "front" 517 521 msgid "Polls Archive" 518 522 msgstr "" 519 523 520 #: classes/DemPoll.php:5 49524 #: classes/DemPoll.php:551 521 525 msgctxt "front" 522 526 msgid "Only registered users can vote. <a>Login</a> to vote." 523 527 msgstr "" 524 528 525 #: classes/DemPoll.php:5 59529 #: classes/DemPoll.php:561 526 530 msgctxt "front" 527 531 msgid "Revote" 528 532 msgstr "" 529 533 530 #: classes/DemPoll.php:5 59534 #: classes/DemPoll.php:561 531 535 msgctxt "front" 532 536 msgid "Are you sure you want cancel the votes?" 533 537 msgstr "" 534 538 535 #: classes/DemPoll.php:57 3539 #: classes/DemPoll.php:575 536 540 msgctxt "front" 537 541 msgid "You or your IP had already vote." 538 542 msgstr "" 539 543 540 #: classes/DemPoll.php:62 0544 #: classes/DemPoll.php:622 541 545 msgid "ERROR: You select more number of answers than it is allowed..." 542 546 msgstr "" … … 551 555 552 556 #: classes/Helpers/Helpers.php:11 557 msgid "Alphabetically" 558 msgstr "" 559 560 #: classes/Helpers/Helpers.php:12 553 561 msgid "Mix" 554 562 msgstr "" … … 558 566 msgstr "" 559 567 560 #: classes/Poll_Widget.php: 89568 #: classes/Poll_Widget.php:91 561 569 msgid "- Active (random all active)" 562 570 msgstr "" 563 571 564 #: classes/Poll_Widget.php:9 0572 #: classes/Poll_Widget.php:92 565 573 msgid "- Last open poll" 566 574 msgstr "" 567 575 568 #: classes/Poll_Widget.php:10 5576 #: classes/Poll_Widget.php:107 569 577 msgid "Which poll to show?" 570 578 msgstr "" 571 579 572 #: classes/Utils/Activator.php: 61580 #: classes/Utils/Activator.php:51 573 581 msgid "What is the capital city of France?" 574 582 msgstr "" 575 583 576 #: classes/Utils/Activator.php: 73584 #: classes/Utils/Activator.php:63 577 585 msgid "Paris" 578 586 msgstr "" 579 587 580 #: classes/Utils/Activator.php: 74588 #: classes/Utils/Activator.php:64 581 589 msgid "Rome" 582 590 msgstr "" 583 591 584 #: classes/Utils/Activator.php: 75592 #: classes/Utils/Activator.php:65 585 593 msgid "Madrid" 586 594 msgstr "" 587 595 588 #: classes/Utils/Activator.php: 76596 #: classes/Utils/Activator.php:66 589 597 msgid "Berlin" 590 598 msgstr "" 591 599 592 #: classes/Utils/Activator.php: 77600 #: classes/Utils/Activator.php:67 593 601 msgid "London" 594 602 msgstr "" -
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 === 2 Stable tag: 6.0.4 3 Tested up to: 6.8.0 6 4 Contributors: Tkama 7 5 License: GPLv2 or later … … 9 7 Tags: democracy, polls, vote, survey, review 10 8 11 WordPress Polls plugin with multiple choice and custom answers. Works with cache plugins. Includes widgetand shortcodes for posts.9 A WordPress polls plugin with multiple-choice options and custom answers. Works seamlessly with cache plugins. Includes widgets and shortcodes for posts. 12 10 13 11 14 12 == Description == 15 13 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 14 This 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 23 Democracy Poll is compatible with all major cache plugins, including WP Total Cache, WP Super Cache, WordFence, Quick Cache, etc. 24 25 Designed 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. 36 32 37 33 ### More Info ### 38 34 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 35 Democracy 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 37 Key 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 57 Multisite support is available starting from version 5.2.4. 64 58 65 59 Requires PHP 5.3 or later. 66 60 67 61 68 69 70 62 == Usage == 71 63 72 64 ### Usage (Widget) ### 73 1. Go to `WP-Admin -> Appearance -> Widgets` and find `Democracy Poll` Widget.74 2. Add th is widget to one of existingsidebar.75 3. Set Up added widget and press Save.65 1. Go to `WP-Admin -> Appearance -> Widgets` and select the `Democracy Poll` widget. 66 2. Add the widget to an available sidebar. 67 3. Configure the widget settings and save. 76 68 4. Done! 77 69 78 79 70 ### 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 ` 71 1. Open the `sidebar.php` file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`. 72 2. Insert the following code where you want the poll to appear: 73 74 ```php 84 75 <?php if( function_exists('democracy_poll') ){ ?> 85 76 <li> … … 90 81 </li> 91 82 <?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]`. 98 88 99 89 #### 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 90 To display the polls archive, use the function: 91 ```php 92 <?php democracy_archives( $hide_active, $before_title, $after_title ); ?> 93 ``` 107 94 108 95 109 96 == Frequently Asked Questions == 110 97 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 100 Yes! 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. 117 101 118 102 == Screenshots == … … 126 110 7. General settings. 127 111 8. Polls theme settings. 128 9. Poll 's texts changes.112 9. Poll text customization. 129 113 130 114 … … 133 117 134 118 = 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. 138 121 139 122 … … 141 124 == Changelog == 142 125 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 143 138 = 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". 145 140 146 141 = 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). 148 143 * IMP: Minor improvements. 149 144 150 145 = 6.0.0 = 151 * BUG: It was impossible to delete all answers or create democracy poll with nostarting answer.152 * CHG: Minimal PHP version 7.0153 * CHG: "Democracy_Poll" class renamed to "Plugin"and moved under namespace.154 * CHG: `democr()` and `demopt()` functionsrenamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.155 * CHG: Most of theclasses 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. 156 151 * 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. 161 157 * IMP: Classes autoloader implemented. 162 * IMP: Huge Refactoring, minor code improvementsand decomposition.163 * UPD: democracy-poll.pot158 * IMP: Huge refactoring, minor code improvements, and decomposition. 159 * UPD: Updated `democracy-poll.pot`. 164 160 165 161 = 5.6.0 = 166 * BUG: Pagination links on archive page.162 * FIX: Pagination links on archive page. 167 163 168 164 = 5.5.10 = 169 * FIX: CSS radio ,checkbox stylesfrom px to em.165 * FIX: CSS radio/checkbox styles changed from px to em. 170 166 171 167 = 5.5.9 = 172 * FIX: JS code fixes for jQuery 3.5 .168 * FIX: JS code fixes for jQuery 3.5 compatibility. 173 169 174 170 = 5.5.8 = 175 * NEW: `orderby` аргумент для функции `get_dem_polls()`.171 * ADD: `orderby` argument for `get_dem_polls()` function. 176 172 177 173 = 5.5.7 = 178 * NEW: hook `get_dem_polls_sql_clauses`.174 * ADD: Hook `get_dem_polls_sql_clauses`. 179 175 180 176 = 5.5.6.3 = 181 * FIX: `disabled` property for checkbox input sometimes not removed on uncheck for multianswersquestions.177 * FIX: `disabled` property not removed correctly on uncheck for multi-answer questions. 182 178 183 179 = 5.5.6.2 = 184 * NEW: Scroll to poll top when click on Resulsts, Voteetc.180 * ADD: Scroll to poll top when clicking Results, Vote, etc. 185 181 186 182 = 5.5.6.1 = 187 * NEW: `target="_blank"` attribute for copyright link.183 * ADD: `target="_blank"` attribute for copyright link. 188 184 189 185 = 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. 193 189 194 190 = 5.5.5 = 195 * CH ANGE: ACE code editor tonative WordPress CodeMirror.191 * CHG: Replaced ACE code editor with native WordPress CodeMirror. 196 192 197 193 = 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 timezone.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. 201 197 202 198 = 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. 206 202 207 203 = 5.5.2 = 208 * ADD: wrapper function for use in themes 'get_democracy_poll_results( $poll_id )' - Gets poll results screen.209 * ADD: allowed <img> tag in questionand answers.204 * ADD: `get_democracy_poll_results( $poll_id )` wrapper function to get poll results. 205 * ADD: Allow `<img>` tag in questions and answers. 210 206 211 207 = 5.5.1 = 212 * IMP: now design setting admin page is more clear and beautiful :)208 * IMP: Admin design settings page improved. 213 209 214 210 = 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 throughshortcode.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. 220 216 221 217 = 5.4.9 = 222 * ADD: 'demadmin_sanitize_poll_data' filter second '$original_data' parameter223 * ADD: posts where a poll is ebedded block at the bottom of each poll onpolls archive page.224 225 = 5.4. 7 - 5.4.8 =226 * FIX: 'expire' parameter works incorrectly withlogs written to DB.227 * FIX: 'wp_remote_get()' changed to 'file_get_contents()' bacause it works not correctly withgeoplugin.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. 229 225 230 226 = 5.4.6 = 231 * FIX: Error with "load_textdomain" because of which it was impossible to activate the plugin227 * FIX: "load_textdomain" error that blocked plugin activation. 232 228 233 229 = 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.php230 * 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. 236 232 237 233 = 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 toLesbat.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. 241 237 242 238 = 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. 247 243 248 244 = 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`. 256 251 257 252 = 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.Grimes253 * CHG: Improve activation logic with `activate_plugin()` outside wp-admin. Thanks to J.D. Grimes. 259 254 260 255 = 5.4 = 261 * FIX: XSS Vulnerability. In some extraordinary case it could be possible to hack your site. Read here: http://pluginvulnerabilities.com/?p=2967262 * 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 one256 * FIX: XSS vulnerability fix (security issue). 257 * ADD: Nonce checks for all admin requests. 258 * CHG: Moved back `Democracy_Poll_Admin::update_options()` method. 264 259 265 260 = 5.3.6 = 266 * FIX: delete `esc_sql()` from code, for protection. Thanks to J.D. Grimes267 * 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`. 269 264 270 265 = 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). 272 267 273 268 = 5.3.4.6 = 274 * FIX: add 'dem_add_user_answer' query var param to set noindex for no duplicate content275 * 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`. 276 271 277 272 = 5.3.4.5 = 278 * ADD: filters `dem_vote_screen` and `dem_result_screen`273 * ADD: Filters `dem_vote_screen` and `dem_result_screen`. 279 274 280 275 = 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. 291 282 292 283 = 5.3.3.2 = 293 * FIX: stability for adding "dem__collapser" style into document.284 * FIX: Stability for injecting "dem__collapser" style. 294 285 295 286 = 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. 297 288 298 289 = 5.3.3 = 299 * FIX: minor: when work with cache plugin: now vote & revote buttons completely removes from DOM290 * FIX: Vote and revote buttons now fully removed from DOM with caching plugins. 300 291 301 292 = 5.3.2 = 302 * FIX: minor: cookie stability fix when plugin works with page caching plugin293 * FIX: Cookie stability fix with page caching plugins. 303 294 304 295 = 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`. 308 299 309 300 = 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). 311 302 312 303 = 5.2.9 = 313 * FIX: add poll PHP syntax bug...304 * FIX: PHP syntax bug in poll addition. 314 305 315 306 = 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`. 318 309 319 310 = 5.2.7 = 320 * FIX: global option 'dont show results' not work properly321 * FIX: some little fix in code311 * FIX: "Don't show results" global option fix. 312 * FIX: Minor code fixes. 322 313 323 314 = 5.2.6 = 324 * FIX: bug when new answer added: now "NEW" mark adds correctly315 * FIX: "NEW" mark correctly added after adding a new answer. 325 316 326 317 = 5.2.5 = 327 * FIX: wp_json_encode() function was replaced, in order to support WP lower then 4.1328 * CHG: usability improvements329 * CHG: set 'max+1' order num for users added answers, if answers has order318 * 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. 330 321 331 322 = 5.2.4 = 332 * ADD: multisite support333 * ADD: migration from 'WP Polls' plugin mechanism334 * FIX: bug - was allowed set 1 answer for multiple answers335 * 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. 337 328 338 329 = 5.2.3 = 339 * ADD: on admin edit poll screen, posts list where poll shortcode uses340 * ADD: ability to set poll buttons css class on design settings page341 * 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. 346 337 347 338 = 5.2.2 = 348 * FIX: when click on 'close', 'open', 'activate', 'deactivate' buttons at polls list table, the action was applied not immediately349 * FIX: radio, checkbox styles fix339 * FIX: Actions (close, open, activate, deactivate) in polls list table were not applied immediately. 340 * FIX: Radio and checkbox styles. 350 341 351 342 = 5.2.1 = 352 * ADD: ' in posts' column in admin polls list. In which posts the poll shortcodeused.343 * ADD: 'In posts' column in admin polls list to show where the poll shortcode is used. 353 344 354 345 = 5.2.0 = 355 * ADD: hooks: 'dem_poll_inserted', 'dem_before_insert_quest_data'356 * ADD: two variants to delete logs: only logs andlogs with votes.357 * ADD: possibiliti to deletesingle 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 alllogs 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 fromvoter 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. 373 364 374 365 = 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). 376 367 377 368 = 5.1.0 = 378 * F ix: 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. 379 370 380 371 = 5.0.3 = 381 * F ix: Some bugs with variables and antivirus check.372 * FIX: Bugs with variables and antivirus checks. 382 373 383 374 = 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. 385 376 386 377 = 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. 388 379 389 380 = 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 pollfield 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 shor dcode 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. 397 388 398 389 = 4.9.4 = 399 * FIX: change default DB tables charset from utf8mb4 to utf8. Thanks to Nanotraktor390 * FIX: Changed default DB charset from `utf8mb4` to `utf8`. Thanks to Nanotraktor. 400 391 401 392 = 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: disablecache 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. 405 396 406 397 = 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. 409 400 410 401 = 4.9.1 = 411 * FIX: Polls admin table column order 402 * FIX: Polls admin table column order. 412 403 413 404 = 4.9.0 = 414 * ADD: Logs table in admin and capability to remove only logs ofspecific poll.415 * ADD: 'date' field to the democracy_logtable.405 * ADD: Logs table in admin with ability to remove logs of a specific poll. 406 * ADD: 'date' field to `democracy_log` table. 416 407 417 408 = 4.8 = 418 * C omplatelly 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. 419 410 420 411 = 4.7.8 = 421 * ADD: en_US l10n if no l10n file.412 * ADD: Default en_US localization if none available. 422 413 423 414 = 4.7.7 = 424 * ADD: de_DE locali sation. Thanks to Matthias Siebler415 * ADD: de_DE localization. Thanks to Matthias Siebler. 425 416 426 417 = 4.7.6 = 427 * DEL ETED: 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. 428 419 429 420 = 4.7.5 = 430 * CHG: C onvert tables from utf8 to utf8mb4 charset. For emoji uses in polls421 * CHG: Changed DB charset to `utf8mb4` to support emojis. 431 422 432 423 = 4.7.4 = 433 * CHG: Some css styles in admin424 * CHG: Updated admin CSS styles. 434 425 435 426 = 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. 437 428 438 429 = 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. 441 433 442 434 = 4.7.1 = 443 * ADD: "on general options page": global "revote" and "democratic" functionality disabling ability444 * ADD: localisation POT file & english transtation435 * ADD: Global options to disable "revote" and "democratic" features. 436 * ADD: Localization POT file and English translation. 445 437 446 438 = 4.7.0 = 447 * CHG: "progress fill type" & "answers order" options now on "Design option page"448 * FIX: english localisation439 * CHG: Moved "progress fill type" and "answers order" settings to Design options page. 440 * FIX: English localization fixes. 449 441 450 442 = 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). 452 444 453 445 = 4.6.8 = 454 * FIX: options bug appers in 4.6.7446 * FIX: Bug introduced in 4.6.7 affecting options. 455 447 456 448 = 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 capability449 * ADD: Capability check for editing polls. Toolbar hidden for unauthorized users. 458 450 459 451 = 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 code462 * 'notVote' cookie check set to 1 hour452 * FIX: Major voting status check bug fixed (critical release). 453 * CHG: Minor JS code changes. 454 * CHG: `notVote` cookie lifespan set to 1 hour. 463 455 464 456 = 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 theme457 * ADD: New theme `block.css`. 458 * ADD: Preset theme visibility and customization support. 467 459 468 460 = 4.6.4 = 469 * FIX: when user send democratic answer, new answer couldn't have comma461 * FIX: New democratic answers couldn't contain commas. 470 462 471 463 = 4.6.3 = 472 * FIX: Widget showed screens uncorrectly because of some previous changes in code.473 * I mprove: English localisation464 * FIX: Widget display issues due to code changes. 465 * IMP: Improved English localization. 474 466 475 467 = 4.6.2 = 476 * FIX: great changes about polls themes and cssstructure.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. 478 470 479 471 = 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. 482 474 483 475 = 4.6.0 = 484 * ADD: Poll themes management 485 * FIX: some JS and CSS bugs486 * FIX: Unactivate pool when closing poll476 * ADD: Poll themes management. 477 * FIX: JS and CSS bug fixes. 478 * FIX: Auto-deactivate polls when closed. 487 479 488 480 = 4.5.9 = 489 * FIX: CSS fixes , prepare to 4.6.0 version update490 * ADD: Cache working. Wright/check cookie "notVote" for cache gear optimisation481 * FIX: CSS fixes; prep for 4.6.0 update. 482 * ADD: Cache handling and "notVote" cookie optimization. 491 483 492 484 = 4.5.8 = 493 * ADD: AJAX loader images SVG & css3 collection494 * ADD: Sets close date when closing poll485 * ADD: AJAX loader images (SVG & CSS3 collection). 486 * ADD: Automatically set close date when poll closes. 495 487 496 488 = 4.5.7 = 497 * FIX: revote button didn't minus votes if "keep-logs" option was disabled489 * FIX: Revote button did not deduct votes if "keep-logs" option was disabled. 498 490 499 491 = 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. 506 497 507 498 = 4.5.5 = 508 * CHG: Archive link detection by ID not by url499 * CHG: Archive link detection now based on ID, not URL. 509 500 510 501 = 4.5.4 = 511 * FIX: js code. Now All with jQuery512 * 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 need502 * FIX: JS refactored: all scripts run via jQuery. 503 * FIX: Separated JS and CSS loading: CSS globally in head; JS only where needed. 513 504 514 505 = 4.5.3 = 515 * FIX: code fix, about $_POST[*] vars506 * FIX: Code fixes for handling `$_POST` variables. 516 507 517 508 = 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 posible520 * FIX: admin messages509 * 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. 521 512 522 513 = 4.5.1 = 523 * FIX: Locali sation bug on activation.514 * FIX: Localization bug on activation. 524 515 525 516 = 4.5 = 526 * ADD: cssstyle 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. 529 520 530 521 = 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. 533 524 534 525 = 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. 537 528 538 529 = 4.3 = 539 * ADD: TinyMCE button .540 * FIX: Some bug.530 * ADD: TinyMCE button integration. 531 * FIX: Minor bug fix. 541 532 542 533 = 4.2 = … … 544 535 545 536 = 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. 551 542 552 543 = 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 f unctionality.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. 558 549 * ADD: Open/close polls functionality. 559 * ADD: Locali sation 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). 563 554 * 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'; 2 3 3 4 /* default theme ------------------------------------------------------------- */ … … 14 15 15 16 /* 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 } 17 20 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 ); } 19 22 20 23 .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'; 2 3 3 4 /* block theme -------------------------------------------------------------- */ 4 .democracy{ 5 .democracy{ 5 6 border-color:#ccc; border: 1px solid rgba(0,0,0,.1); background-color:#eee; background-color:rgba(0,0,0,.1); 6 7 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'; 2 3 3 4 /* 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'; 2 3 3 4 -
democracy-poll/trunk/classes/Admin/Admin_Page.php
r3056337 r3282901 56 56 } 57 57 58 public function admin_page_load() {58 public function admin_page_load(): void { 59 59 60 60 // datepicker -
democracy-poll/trunk/classes/Admin/Admin_Page_Settings.php
r3057019 r3282901 179 179 <input type="checkbox" value="1" 180 180 name="dem[post_metabox_off]" <?php checked( options()->post_metabox_off, 1 ) ?> /> 181 <?= esc_html__( 'D asable post metabox.', 'democracy-poll' ) ?>182 </label> 183 <em><?= esc_html__( 'Check this to d asable 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> 184 184 </li> 185 185 -
democracy-poll/trunk/classes/Admin/Admin_Page_l10n.php
r3056337 r3282901 4 4 5 5 use function DemocracyPoll\plugin; 6 use function DemocracyPoll\options;7 6 8 7 class Admin_Page_l10n implements Admin_Subpage_Interface { … … 15 14 } 16 15 17 public function load( ){16 public function load(): void { 18 17 } 19 18 20 public function request_handler( ){19 public function request_handler(): void { 21 20 if( ! plugin()->super_access || ! Admin_Page::check_nonce() ){ 22 21 return; … … 43 42 } 44 43 45 public function render() {44 public function render(): void { 46 45 if( ! plugin()->super_access ){ 47 46 return; … … 150 149 * For front part localization and custom translation setup. 151 150 */ 152 public static function add_gettext_filter() {151 public static function add_gettext_filter(): void { 153 152 add_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10, 4 ); 154 153 } 155 154 156 public static function remove_gettext_filter() {155 public static function remove_gettext_filter(): void { 157 156 remove_filter( 'gettext_with_context', [ __CLASS__, 'handle_front_l10n' ], 10 ); 158 157 } -
democracy-poll/trunk/classes/DemPoll.php
r3064229 r3282901 890 890 891 891 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 ){ 897 900 $answers = Helpers::objects_array_sort( $answers, [ 'votes' => 'desc' ] ); 898 901 } 899 elseif( $ord === 'mix' ){ 902 elseif( $order === 'alphabet' ){ 903 $answers = Helpers::objects_array_sort( $answers, [ 'answer' => 'asc' ] ); 904 } 905 elseif( $order === 'mix' ){ 900 906 shuffle( $answers ); 901 907 } 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 } 911 910 } 912 911 -
democracy-poll/trunk/classes/Helpers/Helpers.php
r3059285 r3282901 9 9 'by_id' => __( 'As it was added (by ID)', 'democracy-poll' ), 10 10 'by_winner' => __( 'Winners at the top', 'democracy-poll' ), 11 'alphabet' => __( 'Alphabetically', 'democracy-poll' ), 11 12 'mix' => __( 'Mix', 'democracy-poll' ), 12 13 ]; -
democracy-poll/trunk/classes/Options.php
r3057019 r3282901 143 143 /** 144 144 * Sets $this->opt. Update options in DB if it's not set yet. 145 *146 * @return void147 145 */ 148 public function set_opt() {146 public function set_opt(): void { 149 147 150 148 if( ! $this->opt ){ … … 169 167 public function update_single_option( $option_name, $value ): bool { 170 168 171 $newopt = $this->opt;172 $newopt[ $option_name ] = $value;173 174 169 if( $this->is_option_exists( $option_name ) ){ 170 $newopt = $this->opt; 171 $newopt[ $option_name ] = $value; 172 175 173 return (bool) update_option( self::OPT_NAME, $newopt ); 176 174 } … … 180 178 181 179 /** 182 * Updates options.183 *184 180 * @param string $type What group of option to update: main, design. 185 181 */ … … 228 224 229 225 /** 230 * Updates $this->optbased 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. 232 228 */ 233 private function sanitize_request_options( array $request_data, string $type ) {229 private function sanitize_request_options( array $request_data, string $type ): void { 234 230 235 231 foreach( $this->default_options[ $type ] as $key => $v ){ … … 258 254 $this->opt[ $key ] = $value; 259 255 } 260 261 } 262 263 /** 264 * Checks if option name exists. 265 */ 256 } 257 266 258 private function is_option_exists( string $option_name ): bool { 267 259 -
democracy-poll/trunk/classes/Options_CSS.php
r3056337 r3282901 58 58 $styledir = DEMOC_PATH . 'styles'; 59 59 60 $out .= $this->parse_css import( "$styledir/$tpl" );60 $out .= $this->parse_css_import( "$styledir/$tpl" ); 61 61 $out .= $radios ? "\n" . file_get_contents( "$styledir/checkbox-radio/$radios" ) : ''; 62 62 $out .= $button ? "\n" . file_get_contents( "$styledir/buttons/$button" ) : ''; … … 138 138 * Imports @import in css. 139 139 */ 140 private function parse_css import( $css_filepath ) {140 private function parse_css_import( $css_filepath ) { 141 141 $filecode = file_get_contents( $css_filepath ); 142 142 -
democracy-poll/trunk/classes/Plugin.php
r3057019 r3282901 38 38 } 39 39 40 public function basic_init() {40 public function basic_init(): void { 41 41 $this->opt->set_opt(); 42 42 … … 51 51 } 52 52 53 public function init() {53 public function init(): void { 54 54 $this->basic_init(); 55 55 56 56 $this->set_is_cachegear_on(); 57 57 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 { 59 74 if( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){ 60 75 $this->admin = new Admin(); 61 76 $this->admin->init(); 62 77 } 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 { 72 89 if( $this->admin_access && $this->opt->toolbar_menu ){ 73 90 add_action( 'admin_bar_menu', [ $this, 'add_toolbar_node' ], 99 ); 74 91 } 75 76 $this->hide_form_indexing(); 77 }78 79 // hide duplicate content. For 5+ versions it's no need80 private function hide_form_indexing() {81 // hide duplicate content. For 5+ versions it's no need92 } 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 82 99 if( 83 100 isset( $_GET['dem_act'] ) … … 87 104 || isset( $_GET['dem_add_user_answer'] ) 88 105 ){ 89 add_action( 'wp', function() {106 add_action( 'wp', static function() { 90 107 status_header( 404 ); 91 108 } ); 92 109 93 add_action( 'wp_head', function() {110 add_action( 'wp_head', static function() { 94 111 echo "\n<!--democracy-poll-->\n" . '<meta name="robots" content="noindex,nofollow">' . "\n"; 95 112 } ); … … 97 114 } 98 115 99 private function set_access_caps() {116 private function set_access_caps(): void { 100 117 $is_adminor = current_user_can( 'manage_options' ); 101 118 … … 117 134 } 118 135 119 private function set_is_cachegear_on() {136 private function set_is_cachegear_on(): void { 120 137 121 138 if( $this->opt->force_cachegear ){ … … 133 150 } 134 151 135 public function load_textdomain() {152 public function load_textdomain(): void { 136 153 load_plugin_textdomain( 'democracy-poll', false, basename( DEMOC_PATH ) . '/languages/' ); 137 154 } … … 140 157 * @param \WP_Admin_Bar $toolbar 141 158 */ 142 public function add_toolbar_node( $toolbar ) {159 public function add_toolbar_node( $toolbar ): void { 143 160 144 161 $toolbar->add_node( [ … … 229 246 * Adds scripts to the footer. 230 247 */ 231 public function add_js_once() {248 public function add_js_once(): void { 232 249 static $once = 0; 233 250 if( $once++ ){ … … 245 262 } 246 263 247 public static function _add_js_wp_footer() {264 public static function _add_js_wp_footer(): void { 248 265 echo "\n" . '<script id="democracy-poll">' . file_get_contents( DEMOC_PATH . 'js/democracy.min.js' ) . '</script>' . "\n"; 249 266 } -
democracy-poll/trunk/classes/Poll_Ajax.php
r3056337 r3282901 17 17 18 18 // 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'] ) 21 22 ){ 22 23 add_action( 'init', [ $this, 'not_ajax_request_handler' ], 99 ); … … 24 25 } 25 26 26 # Делает предваритеьную проверку передавемых переменных запроса 27 /** 28 * Does a preliminary sanitization of the passed request variables. 29 */ 27 30 public function sanitize_request_vars(): array { 28 29 31 return [ 30 32 'act' => sanitize_text_field( $_POST['dem_act'] ?? '' ), … … 34 36 } 35 37 36 # обрабатывает запрос AJAX37 38 public function ajax_request_handler() { 38 39 … … 49 50 $poll = new \DemPoll( $vars->pid ); 50 51 51 // switch 52 // голосуем и выводим результаты 52 // vote and display results 53 53 if( 'vote' === $vars->act && $vars->aids ){ 54 54 $voted = $poll->vote( $vars->aids ); … … 65 65 } 66 66 } 67 // удаляем результаты67 // delete results 68 68 elseif( 'delVoted' === $vars->act ){ 69 69 $poll->delete_vote(); 70 70 echo $poll->get_vote_screen(); 71 71 } 72 // смотрим результаты72 // view results 73 73 elseif( 'view' === $vars->act ){ 74 74 if( $poll->not_show_results ){ … … 79 79 } 80 80 } 81 // вернуться к голосованию81 // back to voting 82 82 elseif( 'vote_screen' === $vars->act ){ 83 83 echo $poll->get_vote_screen(); 84 84 } 85 // get poll->votedFor value (from db) 85 86 elseif( 'getVotedIds' === $vars->act ){ 86 87 if( $poll->votedFor ){ 87 $poll->set_cookie(); // Установим куки, т.к. этот запрос делается только если куки не установлены88 $poll->set_cookie(); // Set cookies, since this request is only made if cookies are not set 88 89 echo $poll->votedFor; 89 90 } 90 91 elseif( $poll->blockForVisitor ){ 91 echo 'blockForVisitor'; // чтобы вывести заметку92 echo 'blockForVisitor'; // to display a note 92 93 } 93 94 else{ 94 // если не голосовал ставим куки на пол дня, чтобы не делать эту проверку каждый раз95 // If not voted, set a cookie for half a day to don't do this check every time. 95 96 $poll->set_cookie( 'notVote', ( time() + ( DAY_IN_SECONDS / 2 ) ) ); 96 97 } -
democracy-poll/trunk/classes/Utils/Activator.php
r3057019 r3282901 7 7 class Activator { 8 8 9 public static function set_db_tables() {9 public static function set_db_tables(): void { 10 10 global $wpdb; 11 11 $wpdb->democracy_q = $wpdb->prefix . 'democracy_q'; … … 14 14 } 15 15 16 public static function activate() {16 public static function activate(): void { 17 17 plugin()->basic_init(); 18 18 … … 30 30 } 31 31 32 private static function _activate() {32 private static function _activate(): void { 33 33 // create tables 34 34 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; … … 40 40 } 41 41 42 private static function add_sample_poll() {42 private static function add_sample_poll(): void { 43 43 global $wpdb; 44 44 -
democracy-poll/trunk/classes/Utils/Migrator__WP_Polls.php
r3056337 r3282901 69 69 70 70 use function DemocracyPoll\plugin; 71 use function DemocracyPoll\options;72 71 73 72 class Migrator__WP_Polls { 74 73 75 public function migrate() {74 public function migrate(): void { 76 75 global $wpdb; 77 76 -
democracy-poll/trunk/democracy.php
r3064229 r3282901 2 2 /** 3 3 * 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. 5 5 * 6 6 * Author: Kama … … 11 11 * Domain Path: /languages/ 12 12 * 13 * Requires at least: 4.714 * Requires PHP: 7. 013 * Requires at least: 5.8 14 * Requires PHP: 7.4 15 15 * 16 * Version: 6.0. 316 * Version: 6.0.4 17 17 */ 18 18 … … 32 32 register_activation_hook( __FILE__, [ \DemocracyPoll\Utils\Activator::class, 'activate' ] ); 33 33 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 */ 38 add_action( 'after_setup_theme', [ plugin(), 'init' ] ); -
democracy-poll/trunk/js/_js-cookie.js
r2675427 r3282901 1 1 // includes in democracy.js 2 2 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]; 36 24 } 37 25 } 38 return result;26 return target 39 27 } 28 /* eslint-enable no-var */ 40 29 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 */ 44 46 45 function init (converter) { 46 function api() {} 47 /* eslint-disable no-var */ 47 48 48 function set (key, value, attributes) { 49 function init (converter, defaultAttributes) { 50 function set (name, value, attributes) { 49 51 if (typeof document === 'undefined') { 50 return ;52 return 51 53 } 52 54 53 attributes = extend({ 54 path: '/' 55 }, api.defaults, attributes); 55 attributes = assign({}, defaultAttributes, attributes); 56 56 57 57 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(); 59 62 } 60 63 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); 79 67 80 68 var stringifiedAttributes = ''; 81 69 for (var attributeName in attributes) { 82 70 if (!attributes[attributeName]) { 83 continue ;71 continue 84 72 } 73 85 74 stringifiedAttributes += '; ' + attributeName; 75 86 76 if (attributes[attributeName] === true) { 87 continue ;77 continue 88 78 } 89 79 … … 98 88 } 99 89 100 return (document.cookie = key + '=' + value + stringifiedAttributes); 90 return (document.cookie = 91 name + '=' + converter.write(value, name) + stringifiedAttributes) 101 92 } 102 93 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 106 97 } 107 98 108 var jar = {};109 99 // To prevent the for loop in the first place assign an empty array 110 100 // in case there are no cookies at all. 111 101 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++) { 115 104 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('='); 121 106 122 107 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); 126 110 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 137 113 } 138 114 } catch (e) {} 139 115 } 140 116 141 return key ? jar[key] : jar;117 return name ? jar[name] : jar 142 118 } 143 119 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 ) 162 145 } 163 146 164 return init(function () {}); 147 var api = init(defaultConverter, { path: '/' }); 148 /* eslint-enable no-var */ 149 150 return api; 151 165 152 })); -
democracy-poll/trunk/js/democracy.js
r3056337 r3282901 1 2 1 includefile = '_js-cookie.js' 3 2 3 4 4 // 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( $ ){ 5 document.addEventListener( 'DOMContentLoaded', democracyInit ) 6 7 function democracyInit(){ 15 8 16 9 let demmainsel = '.democracy' 17 let $dems = $( demmainsel )18 19 if( ! $dems.length ) 10 let $dems = jQuery( demmainsel ) 11 12 if( ! $dems.length ){ 20 13 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' ) 25 19 let loader 26 20 let Dem = {} … … 39 33 let demScreensSetHeight = function(){ 40 34 $demScreens.each( function(){ 41 Dem.setHeight( $( this ), 1 )35 Dem.setHeight( jQuery( this ), 1 ) 42 36 } ) 43 37 } … … 45 39 $demScreens.demInitActions( 1 ) 46 40 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 ) // высота еще раз 50 44 51 45 Dem.maxAnswLimitInit() // ограничение выбора мульти ответов … … 56 50 * и дополнительные js переменные и методы самого Democracy. 57 51 */ 58 var $cache = $( '.dem-cache-screens' )52 var $cache = jQuery( '.dem-cache-screens' ) 59 53 if( $cache.length > 0 ){ 60 54 //console.log('Democracy cache gear ON'); … … 67 61 // Инициализация всех событий связаных с внутренней частью каждого опроса: клики, высота, скрытие кнопки 68 62 // применяется на '.dem-screen' 69 $.fn.demInitActions = function( noanimation ){63 jQuery.fn.demInitActions = function( noanimation ){ 70 64 71 65 return this.each( function(){ 72 66 // Устанавливает события клика для всех помеченных элементов в переданом элементе: 73 67 // тут и AJAX запрос по клику и другие интерактивные события Democracy ---------- 74 var $this = $( this )68 var $this = jQuery( this ) 75 69 var attr = 'data-dem-act' 76 70 77 71 $this.find( '[' + attr + ']' ).each( function(){ 78 var $the = $( this )72 var $the = jQuery( this ) 79 73 $the.attr( 'href', '' ) // удалим УРЛ чтобы не было видно УРЛ запроса 80 74 … … 95 89 if( Dem.lineAnimSpeed ){ 96 90 $this.find( '.dem-fill' ).each( function(){ 97 var $fill = $( this )91 var $fill = jQuery( this ) 98 92 //setTimeout(function(){ fill.style.width = was; }, Dem.animSpeed + 500); // на базе CSS transition - при сбросе тоже срабатывает и мешает... 99 93 setTimeout( function(){ … … 111 105 e.preventDefault() 112 106 113 var act = $( this ).find( 'input[name="dem_act"]' ).val()107 var act = jQuery( this ).find( 'input[name="dem_act"]' ).val() 114 108 if( act ) 115 $( this ).demDoAction( $( this ).find( 'input[name="dem_act"]' ).val() )109 jQuery( this ).demDoAction( jQuery( this ).find( 'input[name="dem_act"]' ).val() ) 116 110 } ) 117 111 } ) … … 119 113 120 114 // Loader 121 $.fn.demSetLoader = function(){122 var$the = this123 124 if( $demLoader.length ) 115 jQuery.fn.demSetLoader = function(){ 116 const $the = this 117 118 if( $demLoader.length ){ 125 119 $the.closest( demScreen ).append( $demLoader.clone().css( 'display', 'table' ) ) 126 else127 loader = setTimeout( function(){128 Dem.demLoadingDots( $the)129 }, 50 ) // dots120 } 121 else { 122 loader = setTimeout( () => Dem.demLoadingDots( $the[0] ), 50 ) 123 } 130 124 131 125 return this 132 126 } 133 127 134 $.fn.demUnsetLoader = function(){128 jQuery.fn.demUnsetLoader = function(){ 135 129 136 130 if( $demLoader.length ) … … 143 137 144 138 // Добавить ответ пользователя (ссылка) 145 $.fn.demAddAnswer = function(){139 jQuery.fn.demAddAnswer = function(){ 146 140 147 141 var $the = this.first() 148 142 var $demScreen = $the.closest( demScreen ) 149 143 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="">' ) // поле добавления ответа 151 145 152 146 // покажем кнопку голосования … … 156 150 $demScreen.find( '[type=radio]' ).each( function(){ 157 151 158 $( this ).on( 'click', function(){152 jQuery( this ).on( 'click', function(){ 159 153 $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 ) 164 158 this.checked = false // uncheck 165 159 } ) … … 173 167 var $ua = $demScreen.find( userAnswer ) 174 168 175 $( '<span class="dem-add-answer-close">×</span>' )169 jQuery( '<span class="dem-add-answer-close">×</span>' ) 176 170 .insertBefore( $ua ) 177 171 .css( 'line-height', $ua.outerHeight() + 'px' ) 178 172 .on( 'click', function(){ 179 var $par = $( this ).parent( 'li' )173 var $par = jQuery( this ).parent( 'li' ) 180 174 $par.find( 'input' ).remove() 181 175 $par.find( 'a' ).fadeIn( 300 ) 182 $( this ).remove()176 jQuery( this ).remove() 183 177 } ) 184 178 } … … 188 182 189 183 // Собирает ответы и возращает их в виде строки 190 $.fn.demCollectAnsw = function(){184 jQuery.fn.demCollectAnsw = function(){ 191 185 var $form = this.closest( 'form' ) 192 186 var $answers = $form.find( '[type=checkbox],[type=radio],[type=text]' ) … … 198 192 if( $checkbox.length > 0 ){ 199 193 $checkbox.each( function(){ 200 answ.push( $( this ).val() )194 answ.push( jQuery( this ).val() ) 201 195 } ) 202 196 } … … 219 213 220 214 // обрабатывает запросы при клике, вешается на событие клика 221 $.fn.demDoAction = function( act){215 jQuery.fn.demDoAction = function( action ){ 222 216 223 217 var $the = this.first() … … 225 219 var data = { 226 220 dem_pid: $dem.data( 'opts' ).pid, 227 dem_act: act ,221 dem_act: action, 228 222 action : 'dem_ajax' 229 223 } … … 235 229 236 230 // Соберем ответы 237 if( 'vote' === act ){231 if( 'vote' === action ){ 238 232 data.answer_ids = $the.demCollectAnsw() 239 233 if( ! data.answer_ids ){ 240 Dem.demShake( $the )234 Dem.demShake( $the[0] ) 241 235 return false 242 236 } … … 244 238 245 239 // кнопка переголосовать, подтверждение 246 if( 'delVoted' === act && !confirm( $the.data( 'confirm-text' ) ) )240 if( 'delVoted' === action && !confirm( $the.data( 'confirm-text' ) ) ) 247 241 return false 248 242 249 243 // кнопка добавления ответа посетителя 250 if( 'newAnswer' === act ){244 if( 'newAnswer' === action ){ 251 245 $the.demAddAnswer() 252 246 return false … … 255 249 // AJAX 256 250 $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 } ) 270 262 271 263 return false … … 276 268 277 269 // показывает заметку 278 $.fn.demCacheShowNotice = function( type ){270 jQuery.fn.demCacheShowNotice = function( type ){ 279 271 280 272 var $the = this.first(), … … 307 299 votedtxt = $dema.data( 'voted-txt' ) 308 300 309 $.each( aids, function( key, val ){301 jQuery.each( aids, function( key, val ){ 310 302 $screen.find( '[data-aid="' + val + '"]' ) 311 303 .addClass( votedClass ) 312 304 .attr( 'title', function(){ 313 return votedtxt + $( this ).attr( 'title' )305 return votedtxt + jQuery( this ).attr( 'title' ) 314 306 } ) 315 307 } ) … … 325 317 326 318 // устанавливаем ответы 327 $.each( aids, function( key, val ){319 jQuery.each( aids, function( key, val ){ 328 320 $answs.filter( '[data-aid="' + val + '"]' ).find( 'input' ).prop( 'checked', 'checked' ) 329 321 } ) … … 350 342 } 351 343 352 $.fn.demCacheInit = function(){344 jQuery.fn.demCacheInit = function(){ 353 345 354 346 return this.each( function(){ 355 347 356 var $the = $( this )348 var $the = jQuery( this ) 357 349 358 350 // ищем главный блок 359 351 var $dem = $the.prevAll( demmainsel + ':first' ) 360 if( ! $dem.length )352 if( ! $dem.length ) 361 353 $dem = $the.closest( demmainsel ) 362 354 363 if( ! $dem.length ){355 if( ! $dem.length ){ 364 356 console.warn( 'Democracy: Main dem div not found' ) 365 357 return … … 377 369 378 370 // если опрос закрыт должны кэшироваться только результаты голосования. Просто выходим. 379 if( ! voteHTML )371 if( ! voteHTML ){ 380 372 return 373 } 381 374 382 375 // устанавливаем нужный кэш … … 392 385 $screen.demInitActions( 1 ) 393 386 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 ){ 400 394 var tmout 401 395 var notcheck__fn = function(){ … … 413 407 $forDotsLoader.demSetLoader() 414 408 415 $.post( Dem.ajaxurl,409 jQuery.post( Dem.ajaxurl, 416 410 { 417 411 dem_pid: $dem.data( 'opts' ).pid, … … 421 415 function( reply ){ 422 416 $forDotsLoader.demUnsetLoader() 423 if( !reply ) return // выходим если нет ответов 417 // exit if there are no answers 418 if( ! reply ){ 419 return; 420 } 424 421 425 422 $screen.html( votedHTML ) … … 428 425 $screen.demInitActions() 429 426 430 // сообщение, что голосовал или только для пользователей427 // a message that you have voted or for users only 431 428 $screen.demCacheShowNotice( reply ) 432 429 } 433 430 ) 434 431 }, 700 ) 435 // 700 для оптимизации, чтобы моментально не отправлялся запрос, если мышкой просто провели по опросу...432 // 700 for optimization, so that the request is not sent instantly if you just swipe the mouse on the survey... 436 433 } 437 434 … … 471 468 $that.css( { opacity: 0 } ) 472 469 .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 ) 474 471 } ) 475 472 } … … 496 493 $el.css( 'position', 'relative' ) 497 494 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 ) 499 496 var fn__expand = function(){ 500 497 $overlay.addClass( 'expanded' ).removeClass( 'collapsed' ) … … 565 562 $dems.on( 'change', 'input[type="checkbox"]', function(){ 566 563 567 var maxAnsws = $( this ).closest( demmainsel ).data( 'opts' ).max_answs568 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"]' ) 569 566 var $checked = $checkboxs.filter( ':checked' ).length 570 567 571 568 if( $checked >= maxAnsws ){ 572 569 $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' ) 574 571 } ) 575 572 } 576 573 else { 577 574 $checkboxs.each( function(){ 578 $( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' )575 jQuery( this ).prop( 'disabled', false ).closest( 'li' ).removeClass( 'dem-disabled' ) 579 576 } ) 580 577 } … … 582 579 } 583 580 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 ) 616 612 } 617 613 618 614 } 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 */ 2 function 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 3 3 msgstr "" 4 4 "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" 6 6 "PO-Revision-Date: 2017-03-12 15:02+0500\n" 7 7 "Last-Translator: \n" … … 13 13 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 14 14 "%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" 16 16 "X-Poedit-Basepath: ..\n" 17 17 "X-Poedit-SourceCharset: UTF-8\n" … … 20 20 21 21 #: classes/Admin/Admin.php:42 classes/Admin/Admin_Page.php:205 22 #: classes/Plugin.php:15 422 #: classes/Plugin.php:158 23 23 msgid "Settings" 24 24 msgstr "" … … 32 32 msgstr "" 33 33 34 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:15 134 #: classes/Admin/Admin_Page.php:191 classes/Plugin.php:155 35 35 msgid "Polls List" 36 36 msgstr "" … … 41 41 42 42 #: classes/Admin/Admin_Page.php:199 classes/Admin/List_Table_Polls.php:136 43 #: classes/Plugin.php:15 343 #: classes/Plugin.php:157 44 44 msgid "Logs" 45 45 msgstr "" 46 46 47 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:15 547 #: classes/Admin/Admin_Page.php:210 classes/Plugin.php:159 48 48 msgid "Theme Settings" 49 49 msgstr "" 50 50 51 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:1 5651 #: classes/Admin/Admin_Page.php:215 classes/Plugin.php:160 52 52 msgid "Texts changes" 53 53 msgstr "" … … 57 57 msgstr "" 58 58 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 62 msgid "Updated" 63 msgstr "" 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 68 msgid "Nothing was updated" 69 msgstr "" 70 71 #: classes/Admin/Admin_Page_Design.php:515 60 72 msgid "Results view:" 61 73 msgstr "" 62 74 63 #: classes/Admin/Admin_Page_Design.php:51 075 #: classes/Admin/Admin_Page_Design.php:517 64 76 msgid "Vote view:" 65 77 msgstr "" 66 78 67 #: classes/Admin/Admin_Page_Design.php:51 279 #: classes/Admin/Admin_Page_Design.php:519 68 80 msgid "AJAX loader view:" 69 81 msgstr "" … … 114 126 msgstr "" 115 127 116 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:15 2128 #: classes/Admin/Admin_Page_Edit_Poll.php:287 classes/Plugin.php:156 117 129 msgid "Add Poll" 118 130 msgstr "" … … 243 255 msgstr "" 244 256 245 #: classes/Admin/Admin_Page_Settings.php:8 0257 #: classes/Admin/Admin_Page_Settings.php:87 246 258 msgid "" 247 259 "Example: <code><h2></code> и <code></h2></code>. Default: " … … 250 262 msgstr "" 251 263 252 #: classes/Admin/Admin_Page_Settings.php:9 2264 #: classes/Admin/Admin_Page_Settings.php:99 253 265 msgid "Go to archive page" 254 266 msgstr "" 255 267 256 #: classes/Admin/Admin_Page_Settings.php: 98268 #: classes/Admin/Admin_Page_Settings.php:105 257 269 msgid "Create/find archive page" 258 270 msgstr "" 259 271 260 #: classes/Admin/Admin_Page_Settings.php:10 2272 #: classes/Admin/Admin_Page_Settings.php:109 261 273 msgid "" 262 274 "Specify the poll archive link to be in the poll legend. Example: <code>25</" … … 264 276 msgstr "" 265 277 266 #: classes/Admin/Admin_Page_Settings.php:1 86278 #: classes/Admin/Admin_Page_Settings.php:193 267 279 msgid "ON" 268 280 msgstr "" 269 281 270 #: classes/Admin/Admin_Page_Settings.php:1 87282 #: classes/Admin/Admin_Page_Settings.php:194 271 283 msgid "OFF" 272 284 msgstr "" 273 285 274 #: classes/Admin/Admin_Page_Settings.php:1 89286 #: classes/Admin/Admin_Page_Settings.php:196 275 287 #, php-format 276 288 msgid "Force enable gear to working with cache plugins. The condition: %s" 277 289 msgstr "" 278 290 279 #: classes/Admin/Admin_Page_Settings.php:26 0291 #: classes/Admin/Admin_Page_Settings.php:267 280 292 msgid "" 281 293 "Role names, except 'administrator' which will have access to manage plugin." 282 294 msgstr "" 283 295 284 #: classes/Admin/Admin_Page_Settings.php:3 56296 #: classes/Admin/Admin_Page_Settings.php:363 285 297 msgid "Polls Archive" 286 msgstr ""287 288 #: classes/Admin/Admin_Page_l10n.php:39 classes/Options.php:235289 msgid "Updated"290 msgstr ""291 292 #: classes/Admin/Admin_Page_l10n.php:40 classes/Options.php:236293 msgid "Nothing was updated"294 298 msgstr "" 295 299 … … 310 314 msgstr "" 311 315 312 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:6 4316 #: classes/Admin/List_Table_Logs.php:135 classes/Poll_Widget.php:66 313 317 msgid "Poll" 314 318 msgstr "" … … 343 347 344 348 #: classes/Admin/List_Table_Logs.php:185 classes/Admin/List_Table_Logs.php:271 345 #: classes/DemPoll.php:20 3349 #: classes/DemPoll.php:205 346 350 msgid "Edit poll" 347 351 msgstr "" … … 436 440 msgstr "" 437 441 438 #: classes/DemPoll.php:2 08442 #: classes/DemPoll.php:210 439 443 msgid "Download the Democracy Poll" 440 444 msgstr "" 441 445 442 #: classes/DemPoll.php:33 3446 #: classes/DemPoll.php:335 443 447 msgctxt "front" 444 448 msgid "Add your answer" 445 449 msgstr "" 446 450 447 #: classes/DemPoll.php:34 1451 #: classes/DemPoll.php:343 448 452 msgctxt "front" 449 453 msgid "Already voted..." 450 454 msgstr "" 451 455 452 #: classes/DemPoll.php:34 2 classes/DemPoll.php:502456 #: classes/DemPoll.php:344 classes/DemPoll.php:504 453 457 msgctxt "front" 454 458 msgid "Vote" 455 459 msgstr "" 456 460 457 #: classes/DemPoll.php:38 4461 #: classes/DemPoll.php:386 458 462 msgctxt "front" 459 463 msgid "Results" 460 464 msgstr "" 461 465 462 #: classes/DemPoll.php:42 0466 #: classes/DemPoll.php:422 463 467 msgctxt "front" 464 468 msgid "This is Your vote." 465 469 msgstr "" 466 470 467 #: classes/DemPoll.php:44 6471 #: classes/DemPoll.php:448 468 472 msgctxt "front" 469 473 msgid "The answer was added by a visitor" 470 474 msgstr "" 471 475 472 #: classes/DemPoll.php:4 49476 #: classes/DemPoll.php:451 473 477 #, php-format 474 478 msgctxt "front" … … 476 480 msgstr "" 477 481 478 #: classes/DemPoll.php:4 49 classes/DemPoll.php:453482 #: classes/DemPoll.php:451 classes/DemPoll.php:455 479 483 msgctxt "front" 480 484 msgid "vote,votes,votes" 481 485 msgstr "" 482 486 483 #: classes/DemPoll.php:48 3487 #: classes/DemPoll.php:485 484 488 #, php-format 485 489 msgctxt "front" … … 487 491 msgstr "" 488 492 489 #: classes/DemPoll.php:48 4493 #: classes/DemPoll.php:486 490 494 #, php-format 491 495 msgctxt "front" … … 493 497 msgstr "" 494 498 495 #: classes/DemPoll.php:48 6499 #: classes/DemPoll.php:488 496 500 msgctxt "front" 497 501 msgid "Begin" 498 502 msgstr "" 499 503 500 #: classes/DemPoll.php:4 88504 #: classes/DemPoll.php:490 501 505 msgctxt "front" 502 506 msgid "End" 503 507 msgstr "" 504 508 505 #: classes/DemPoll.php:49 0509 #: classes/DemPoll.php:492 506 510 msgctxt "front" 507 511 msgid " - added by visitor" 508 512 msgstr "" 509 513 510 #: classes/DemPoll.php:49 1514 #: classes/DemPoll.php:493 511 515 msgctxt "front" 512 516 msgid "Voting is closed" 513 517 msgstr "" 514 518 515 #: classes/DemPoll.php:49 3519 #: classes/DemPoll.php:495 516 520 msgctxt "front" 517 521 msgid "Polls Archive" 518 522 msgstr "" 519 523 520 #: classes/DemPoll.php:5 49524 #: classes/DemPoll.php:551 521 525 msgctxt "front" 522 526 msgid "Only registered users can vote. <a>Login</a> to vote." 523 527 msgstr "" 524 528 525 #: classes/DemPoll.php:5 59529 #: classes/DemPoll.php:561 526 530 msgctxt "front" 527 531 msgid "Revote" 528 532 msgstr "" 529 533 530 #: classes/DemPoll.php:5 59534 #: classes/DemPoll.php:561 531 535 msgctxt "front" 532 536 msgid "Are you sure you want cancel the votes?" 533 537 msgstr "" 534 538 535 #: classes/DemPoll.php:57 3539 #: classes/DemPoll.php:575 536 540 msgctxt "front" 537 541 msgid "You or your IP had already vote." 538 542 msgstr "" 539 543 540 #: classes/DemPoll.php:62 0544 #: classes/DemPoll.php:622 541 545 msgid "ERROR: You select more number of answers than it is allowed..." 542 546 msgstr "" … … 551 555 552 556 #: classes/Helpers/Helpers.php:11 557 msgid "Alphabetically" 558 msgstr "" 559 560 #: classes/Helpers/Helpers.php:12 553 561 msgid "Mix" 554 562 msgstr "" … … 558 566 msgstr "" 559 567 560 #: classes/Poll_Widget.php: 89568 #: classes/Poll_Widget.php:91 561 569 msgid "- Active (random all active)" 562 570 msgstr "" 563 571 564 #: classes/Poll_Widget.php:9 0572 #: classes/Poll_Widget.php:92 565 573 msgid "- Last open poll" 566 574 msgstr "" 567 575 568 #: classes/Poll_Widget.php:10 5576 #: classes/Poll_Widget.php:107 569 577 msgid "Which poll to show?" 570 578 msgstr "" 571 579 572 #: classes/Utils/Activator.php: 61580 #: classes/Utils/Activator.php:51 573 581 msgid "What is the capital city of France?" 574 582 msgstr "" 575 583 576 #: classes/Utils/Activator.php: 73584 #: classes/Utils/Activator.php:63 577 585 msgid "Paris" 578 586 msgstr "" 579 587 580 #: classes/Utils/Activator.php: 74588 #: classes/Utils/Activator.php:64 581 589 msgid "Rome" 582 590 msgstr "" 583 591 584 #: classes/Utils/Activator.php: 75592 #: classes/Utils/Activator.php:65 585 593 msgid "Madrid" 586 594 msgstr "" 587 595 588 #: classes/Utils/Activator.php: 76596 #: classes/Utils/Activator.php:66 589 597 msgid "Berlin" 590 598 msgstr "" 591 599 592 #: classes/Utils/Activator.php: 77600 #: classes/Utils/Activator.php:67 593 601 msgid "London" 594 602 msgstr "" -
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 === 2 Stable tag: 6.0.4 3 Tested up to: 6.8.0 6 4 Contributors: Tkama 7 5 License: GPLv2 or later … … 9 7 Tags: democracy, polls, vote, survey, review 10 8 11 WordPress Polls plugin with multiple choice and custom answers. Works with cache plugins. Includes widgetand shortcodes for posts.9 A WordPress polls plugin with multiple-choice options and custom answers. Works seamlessly with cache plugins. Includes widgets and shortcodes for posts. 12 10 13 11 14 12 == Description == 15 13 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 14 This 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 23 Democracy Poll is compatible with all major cache plugins, including WP Total Cache, WP Super Cache, WordFence, Quick Cache, etc. 24 25 Designed 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. 36 32 37 33 ### More Info ### 38 34 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 35 Democracy 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 37 Key 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 57 Multisite support is available starting from version 5.2.4. 64 58 65 59 Requires PHP 5.3 or later. 66 60 67 61 68 69 70 62 == Usage == 71 63 72 64 ### Usage (Widget) ### 73 1. Go to `WP-Admin -> Appearance -> Widgets` and find `Democracy Poll` Widget.74 2. Add th is widget to one of existingsidebar.75 3. Set Up added widget and press Save.65 1. Go to `WP-Admin -> Appearance -> Widgets` and select the `Democracy Poll` widget. 66 2. Add the widget to an available sidebar. 67 3. Configure the widget settings and save. 76 68 4. Done! 77 69 78 79 70 ### 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 ` 71 1. Open the `sidebar.php` file of your theme: `wp-content/themes/<YOUR THEME NAME>/sidebar.php`. 72 2. Insert the following code where you want the poll to appear: 73 74 ```php 84 75 <?php if( function_exists('democracy_poll') ){ ?> 85 76 <li> … … 90 81 </li> 91 82 <?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]`. 98 88 99 89 #### 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 90 To display the polls archive, use the function: 91 ```php 92 <?php democracy_archives( $hide_active, $before_title, $after_title ); ?> 93 ``` 107 94 108 95 109 96 == Frequently Asked Questions == 110 97 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 100 Yes! 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. 117 101 118 102 == Screenshots == … … 126 110 7. General settings. 127 111 8. Polls theme settings. 128 9. Poll 's texts changes.112 9. Poll text customization. 129 113 130 114 … … 133 117 134 118 = 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. 138 121 139 122 … … 141 124 == Changelog == 142 125 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 143 138 = 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". 145 140 146 141 = 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). 148 143 * IMP: Minor improvements. 149 144 150 145 = 6.0.0 = 151 * BUG: It was impossible to delete all answers or create democracy poll with nostarting answer.152 * CHG: Minimal PHP version 7.0153 * CHG: "Democracy_Poll" class renamed to "Plugin"and moved under namespace.154 * CHG: `democr()` and `demopt()` functionsrenamed to `\DemocracyPoll\plugin()` and `\DemocracyPoll\options()`.155 * CHG: Most of theclasses 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. 156 151 * 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. 161 157 * IMP: Classes autoloader implemented. 162 * IMP: Huge Refactoring, minor code improvementsand decomposition.163 * UPD: democracy-poll.pot158 * IMP: Huge refactoring, minor code improvements, and decomposition. 159 * UPD: Updated `democracy-poll.pot`. 164 160 165 161 = 5.6.0 = 166 * BUG: Pagination links on archive page.162 * FIX: Pagination links on archive page. 167 163 168 164 = 5.5.10 = 169 * FIX: CSS radio ,checkbox stylesfrom px to em.165 * FIX: CSS radio/checkbox styles changed from px to em. 170 166 171 167 = 5.5.9 = 172 * FIX: JS code fixes for jQuery 3.5 .168 * FIX: JS code fixes for jQuery 3.5 compatibility. 173 169 174 170 = 5.5.8 = 175 * NEW: `orderby` аргумент для функции `get_dem_polls()`.171 * ADD: `orderby` argument for `get_dem_polls()` function. 176 172 177 173 = 5.5.7 = 178 * NEW: hook `get_dem_polls_sql_clauses`.174 * ADD: Hook `get_dem_polls_sql_clauses`. 179 175 180 176 = 5.5.6.3 = 181 * FIX: `disabled` property for checkbox input sometimes not removed on uncheck for multianswersquestions.177 * FIX: `disabled` property not removed correctly on uncheck for multi-answer questions. 182 178 183 179 = 5.5.6.2 = 184 * NEW: Scroll to poll top when click on Resulsts, Voteetc.180 * ADD: Scroll to poll top when clicking Results, Vote, etc. 185 181 186 182 = 5.5.6.1 = 187 * NEW: `target="_blank"` attribute for copyright link.183 * ADD: `target="_blank"` attribute for copyright link. 188 184 189 185 = 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. 193 189 194 190 = 5.5.5 = 195 * CH ANGE: ACE code editor tonative WordPress CodeMirror.191 * CHG: Replaced ACE code editor with native WordPress CodeMirror. 196 192 197 193 = 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 timezone.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. 201 197 202 198 = 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. 206 202 207 203 = 5.5.2 = 208 * ADD: wrapper function for use in themes 'get_democracy_poll_results( $poll_id )' - Gets poll results screen.209 * ADD: allowed <img> tag in questionand answers.204 * ADD: `get_democracy_poll_results( $poll_id )` wrapper function to get poll results. 205 * ADD: Allow `<img>` tag in questions and answers. 210 206 211 207 = 5.5.1 = 212 * IMP: now design setting admin page is more clear and beautiful :)208 * IMP: Admin design settings page improved. 213 209 214 210 = 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 throughshortcode.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. 220 216 221 217 = 5.4.9 = 222 * ADD: 'demadmin_sanitize_poll_data' filter second '$original_data' parameter223 * ADD: posts where a poll is ebedded block at the bottom of each poll onpolls archive page.224 225 = 5.4. 7 - 5.4.8 =226 * FIX: 'expire' parameter works incorrectly withlogs written to DB.227 * FIX: 'wp_remote_get()' changed to 'file_get_contents()' bacause it works not correctly withgeoplugin.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. 229 225 230 226 = 5.4.6 = 231 * FIX: Error with "load_textdomain" because of which it was impossible to activate the plugin227 * FIX: "load_textdomain" error that blocked plugin activation. 232 228 233 229 = 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.php230 * 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. 236 232 237 233 = 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 toLesbat.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. 241 237 242 238 = 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. 247 243 248 244 = 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`. 256 251 257 252 = 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.Grimes253 * CHG: Improve activation logic with `activate_plugin()` outside wp-admin. Thanks to J.D. Grimes. 259 254 260 255 = 5.4 = 261 * FIX: XSS Vulnerability. In some extraordinary case it could be possible to hack your site. Read here: http://pluginvulnerabilities.com/?p=2967262 * 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 one256 * FIX: XSS vulnerability fix (security issue). 257 * ADD: Nonce checks for all admin requests. 258 * CHG: Moved back `Democracy_Poll_Admin::update_options()` method. 264 259 265 260 = 5.3.6 = 266 * FIX: delete `esc_sql()` from code, for protection. Thanks to J.D. Grimes267 * 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`. 269 264 270 265 = 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). 272 267 273 268 = 5.3.4.6 = 274 * FIX: add 'dem_add_user_answer' query var param to set noindex for no duplicate content275 * 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`. 276 271 277 272 = 5.3.4.5 = 278 * ADD: filters `dem_vote_screen` and `dem_result_screen`273 * ADD: Filters `dem_vote_screen` and `dem_result_screen`. 279 274 280 275 = 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. 291 282 292 283 = 5.3.3.2 = 293 * FIX: stability for adding "dem__collapser" style into document.284 * FIX: Stability for injecting "dem__collapser" style. 294 285 295 286 = 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. 297 288 298 289 = 5.3.3 = 299 * FIX: minor: when work with cache plugin: now vote & revote buttons completely removes from DOM290 * FIX: Vote and revote buttons now fully removed from DOM with caching plugins. 300 291 301 292 = 5.3.2 = 302 * FIX: minor: cookie stability fix when plugin works with page caching plugin293 * FIX: Cookie stability fix with page caching plugins. 303 294 304 295 = 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`. 308 299 309 300 = 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). 311 302 312 303 = 5.2.9 = 313 * FIX: add poll PHP syntax bug...304 * FIX: PHP syntax bug in poll addition. 314 305 315 306 = 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`. 318 309 319 310 = 5.2.7 = 320 * FIX: global option 'dont show results' not work properly321 * FIX: some little fix in code311 * FIX: "Don't show results" global option fix. 312 * FIX: Minor code fixes. 322 313 323 314 = 5.2.6 = 324 * FIX: bug when new answer added: now "NEW" mark adds correctly315 * FIX: "NEW" mark correctly added after adding a new answer. 325 316 326 317 = 5.2.5 = 327 * FIX: wp_json_encode() function was replaced, in order to support WP lower then 4.1328 * CHG: usability improvements329 * CHG: set 'max+1' order num for users added answers, if answers has order318 * 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. 330 321 331 322 = 5.2.4 = 332 * ADD: multisite support333 * ADD: migration from 'WP Polls' plugin mechanism334 * FIX: bug - was allowed set 1 answer for multiple answers335 * 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. 337 328 338 329 = 5.2.3 = 339 * ADD: on admin edit poll screen, posts list where poll shortcode uses340 * ADD: ability to set poll buttons css class on design settings page341 * 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. 346 337 347 338 = 5.2.2 = 348 * FIX: when click on 'close', 'open', 'activate', 'deactivate' buttons at polls list table, the action was applied not immediately349 * FIX: radio, checkbox styles fix339 * FIX: Actions (close, open, activate, deactivate) in polls list table were not applied immediately. 340 * FIX: Radio and checkbox styles. 350 341 351 342 = 5.2.1 = 352 * ADD: ' in posts' column in admin polls list. In which posts the poll shortcodeused.343 * ADD: 'In posts' column in admin polls list to show where the poll shortcode is used. 353 344 354 345 = 5.2.0 = 355 * ADD: hooks: 'dem_poll_inserted', 'dem_before_insert_quest_data'356 * ADD: two variants to delete logs: only logs andlogs with votes.357 * ADD: possibiliti to deletesingle 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 alllogs 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 fromvoter 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. 373 364 374 365 = 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). 376 367 377 368 = 5.1.0 = 378 * F ix: 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. 379 370 380 371 = 5.0.3 = 381 * F ix: Some bugs with variables and antivirus check.372 * FIX: Bugs with variables and antivirus checks. 382 373 383 374 = 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. 385 376 386 377 = 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. 388 379 389 380 = 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 pollfield 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 shor dcode 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. 397 388 398 389 = 4.9.4 = 399 * FIX: change default DB tables charset from utf8mb4 to utf8. Thanks to Nanotraktor390 * FIX: Changed default DB charset from `utf8mb4` to `utf8`. Thanks to Nanotraktor. 400 391 401 392 = 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: disablecache 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. 405 396 406 397 = 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. 409 400 410 401 = 4.9.1 = 411 * FIX: Polls admin table column order 402 * FIX: Polls admin table column order. 412 403 413 404 = 4.9.0 = 414 * ADD: Logs table in admin and capability to remove only logs ofspecific poll.415 * ADD: 'date' field to the democracy_logtable.405 * ADD: Logs table in admin with ability to remove logs of a specific poll. 406 * ADD: 'date' field to `democracy_log` table. 416 407 417 408 = 4.8 = 418 * C omplatelly 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. 419 410 420 411 = 4.7.8 = 421 * ADD: en_US l10n if no l10n file.412 * ADD: Default en_US localization if none available. 422 413 423 414 = 4.7.7 = 424 * ADD: de_DE locali sation. Thanks to Matthias Siebler415 * ADD: de_DE localization. Thanks to Matthias Siebler. 425 416 426 417 = 4.7.6 = 427 * DEL ETED: 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. 428 419 429 420 = 4.7.5 = 430 * CHG: C onvert tables from utf8 to utf8mb4 charset. For emoji uses in polls421 * CHG: Changed DB charset to `utf8mb4` to support emojis. 431 422 432 423 = 4.7.4 = 433 * CHG: Some css styles in admin424 * CHG: Updated admin CSS styles. 434 425 435 426 = 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. 437 428 438 429 = 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. 441 433 442 434 = 4.7.1 = 443 * ADD: "on general options page": global "revote" and "democratic" functionality disabling ability444 * ADD: localisation POT file & english transtation435 * ADD: Global options to disable "revote" and "democratic" features. 436 * ADD: Localization POT file and English translation. 445 437 446 438 = 4.7.0 = 447 * CHG: "progress fill type" & "answers order" options now on "Design option page"448 * FIX: english localisation439 * CHG: Moved "progress fill type" and "answers order" settings to Design options page. 440 * FIX: English localization fixes. 449 441 450 442 = 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). 452 444 453 445 = 4.6.8 = 454 * FIX: options bug appers in 4.6.7446 * FIX: Bug introduced in 4.6.7 affecting options. 455 447 456 448 = 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 capability449 * ADD: Capability check for editing polls. Toolbar hidden for unauthorized users. 458 450 459 451 = 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 code462 * 'notVote' cookie check set to 1 hour452 * FIX: Major voting status check bug fixed (critical release). 453 * CHG: Minor JS code changes. 454 * CHG: `notVote` cookie lifespan set to 1 hour. 463 455 464 456 = 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 theme457 * ADD: New theme `block.css`. 458 * ADD: Preset theme visibility and customization support. 467 459 468 460 = 4.6.4 = 469 * FIX: when user send democratic answer, new answer couldn't have comma461 * FIX: New democratic answers couldn't contain commas. 470 462 471 463 = 4.6.3 = 472 * FIX: Widget showed screens uncorrectly because of some previous changes in code.473 * I mprove: English localisation464 * FIX: Widget display issues due to code changes. 465 * IMP: Improved English localization. 474 466 475 467 = 4.6.2 = 476 * FIX: great changes about polls themes and cssstructure.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. 478 470 479 471 = 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. 482 474 483 475 = 4.6.0 = 484 * ADD: Poll themes management 485 * FIX: some JS and CSS bugs486 * FIX: Unactivate pool when closing poll476 * ADD: Poll themes management. 477 * FIX: JS and CSS bug fixes. 478 * FIX: Auto-deactivate polls when closed. 487 479 488 480 = 4.5.9 = 489 * FIX: CSS fixes , prepare to 4.6.0 version update490 * ADD: Cache working. Wright/check cookie "notVote" for cache gear optimisation481 * FIX: CSS fixes; prep for 4.6.0 update. 482 * ADD: Cache handling and "notVote" cookie optimization. 491 483 492 484 = 4.5.8 = 493 * ADD: AJAX loader images SVG & css3 collection494 * ADD: Sets close date when closing poll485 * ADD: AJAX loader images (SVG & CSS3 collection). 486 * ADD: Automatically set close date when poll closes. 495 487 496 488 = 4.5.7 = 497 * FIX: revote button didn't minus votes if "keep-logs" option was disabled489 * FIX: Revote button did not deduct votes if "keep-logs" option was disabled. 498 490 499 491 = 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. 506 497 507 498 = 4.5.5 = 508 * CHG: Archive link detection by ID not by url499 * CHG: Archive link detection now based on ID, not URL. 509 500 510 501 = 4.5.4 = 511 * FIX: js code. Now All with jQuery512 * 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 need502 * FIX: JS refactored: all scripts run via jQuery. 503 * FIX: Separated JS and CSS loading: CSS globally in head; JS only where needed. 513 504 514 505 = 4.5.3 = 515 * FIX: code fix, about $_POST[*] vars506 * FIX: Code fixes for handling `$_POST` variables. 516 507 517 508 = 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 posible520 * FIX: admin messages509 * 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. 521 512 522 513 = 4.5.1 = 523 * FIX: Locali sation bug on activation.514 * FIX: Localization bug on activation. 524 515 525 516 = 4.5 = 526 * ADD: cssstyle 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. 529 520 530 521 = 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. 533 524 534 525 = 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. 537 528 538 529 = 4.3 = 539 * ADD: TinyMCE button .540 * FIX: Some bug.530 * ADD: TinyMCE button integration. 531 * FIX: Minor bug fix. 541 532 542 533 = 4.2 = … … 544 535 545 536 = 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. 551 542 552 543 = 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 f unctionality.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. 558 549 * ADD: Open/close polls functionality. 559 * ADD: Locali sation 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). 563 554 * 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'; 2 3 3 4 /* default theme ------------------------------------------------------------- */ … … 14 15 15 16 /* 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 } 17 20 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 ); } 19 22 20 23 .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'; 2 3 3 4 /* block theme -------------------------------------------------------------- */ 4 .democracy{ 5 .democracy{ 5 6 border-color:#ccc; border: 1px solid rgba(0,0,0,.1); background-color:#eee; background-color:rgba(0,0,0,.1); 6 7 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'; 2 3 3 4 /* flat theme -------------------------------------------------------------- */ -
democracy-poll/trunk/styles/minimal.css
r2675427 r3282901 1 @import '_preset.css'; 1 @import '_reset.css'; 2 @import '_presets.css'; 2 3 3 4
Note: See TracChangeset
for help on using the changeset viewer.