Plugin Directory

Changeset 2265613


Ignore:
Timestamp:
03/23/2020 05:56:44 AM (6 years ago)
Author:
orangetoolz
Message:

optimized code

Location:
cf7-db-tool/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cf7-db-tool/trunk/assets/js/cf7-db-bulkmail.js

    r2265274 r2265613  
    3232
    3333var Totalusers = document.getElementById("dbtool-user-list");
    34 var resetButton = document.getElementById('ResetData')
     34var resetButton = document.getElementById('ResetData');
     35var TargetToInputForm = document.getElementById('dbtool-recipient-emails');
    3536
    3637function getSelectedOptions(sel, fn) {
    3738    var opts = [], opt;
    38 
    3939    // loop through options in select list
    4040    for (var i=0, len=sel.options.length; i<len; i++) {
    4141        opt = sel.options[i];
    42 
    4342        // check if selected
    44         if ( opt.selected ) {
     43        if ( opt.selected && !TargetToInputForm.value.includes(opt.value) ) {
    4544            // add to array of option elements to return from this function
    4645            opts.push(opt);
    47 
    4846            // invoke optional callback function if provided
    4947            if (fn) {
     
    6058    // display in textarea for this example
    6159    opt.setAttribute("disabled",'true')
    62     var display = document.getElementById('dbtool-recipient-emails');
    63     if(display.value == ''){
    64         display.value += opt.value;
     60    if(TargetToInputForm.value == ''){
     61        TargetToInputForm.value += opt.value;
    6562    }else{
    66         display.value += ',' + opt.value;
     63        TargetToInputForm.value += ',' + opt.value;
    6764    }
    6865}
     
    7067document.getElementById('dbtool-user-list').onchange = function(e) {
    7168    // get reference to display textarea
    72     var display = document.getElementById('dbtool-recipient-emails');
     69
    7370    // callback fn handles selected options
    7471    getSelectedOptions(this, callback);
    75 
    76 
    77 
    78 
    7972    if(resetButton.computedStyleMap().get('cursor').value=='not-allowed') {
    8073        resetButton.style.cssText = "opacity: 1;cursor: pointer;"
     
    8477// Funtion for select all email to receiver input
    8578document.getElementById('select_all').onclick = function(e) {
    86     var TargetToInputForm = document.getElementById('dbtool-recipient-emails');
    87 
    8879    TargetToInputForm.value = '';
    8980    var emailList = "";
     
    10091
    10192// Reset function for disable remove from mail list
    102 
    10393resetButton.onclick = function(e) {
    10494    for (var i = 0; i < Totalusers.length; i++) {
  • cf7-db-tool/trunk/cf7-db-tool.php

    r2265276 r2265613  
    88 * Text Domain: cf7-db-tool
    99 * Tags: contact, cf7, contact form 7, db, export, save, wpcf7, contact form 7 db,  contact form 7 database, contact form 7 data export, contact form 7 database addon
    10  * Version: 3.1.2
     10 * Version: 3.1.3
    1111 */
    1212
    13 define('CF7_DBT_VERSION', '3.1.2');
    14 define('CF7_DBT_DB_VERSION', '3.1.2');
     13define('CF7_DBT_VERSION', '3.1.3');
     14define('CF7_DBT_DB_VERSION', '3.1.3');
    1515define('CF7_DBT_PATH', __DIR__);
    1616define('CF7_DBT_URL', plugins_url(basename(CF7_DBT_PATH)));
  • cf7-db-tool/trunk/readme.txt

    r2265276 r2265613  
    44Requires at least: 4.8
    55Tested up to: 5.3
    6 Stable tag: 3.1.2
     6Stable tag: 3.1.3
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2828* Send individual reply email form admin (Available if form submission contains any email address)
    2929* Bulk email *
    30 * Choose users mail form specefic form
    3130
    3231Upcoming features:
  • cf7-db-tool/trunk/src/Plugin.php

    r2263980 r2265613  
    233233        foreach ($results as $mail){
    234234            $fields = unserialize($mail->fields);
    235 
    236235            if(!in_array($fields["your-email"],$usersEmail)){
    237236                array_push($usersEmail,$fields["your-email"]);
    238237            }
    239 
    240238        }
    241239        foreach ($usersEmail as $email){
Note: See TracChangeset for help on using the changeset viewer.