Plugin Directory

Changeset 2412325


Ignore:
Timestamp:
11/04/2020 10:01:40 AM (5 years ago)
Author:
telicom
Message:

Newsletter added

Location:
wp-simplemind-map/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wp-simplemind-map/trunk/app.php

    r2406247 r2412325  
    55Plugin URI: https://telicom.ca/
    66Author: Telicom Inc <mehedee@telicom.ca>
    7 Version: 1.1.3
     7Version: 1.1.4
    88Text Domain: wp-simplemind-map
    99*/
  • wp-simplemind-map/trunk/assets/css/admin-style.css

    r2353794 r2412325  
     1#windowLoadModal .message{
     2  color: limegreen;
     3  padding-top: 5px;
     4  font-size: 16px;
     5}
     6
     7#uploadModal .form-control {
     8  border-radius: 0 !important;
     9  border-color: #6d7bda !important; }
     10
     11.fa-trash {
     12  color: red;
     13  cursor: pointer; }
     14
     15.fa-edit {
     16  padding-right: 5px;
     17  color: #f39c11;
     18  cursor: pointer; }
     19
     20.showApiKey, .fa-copy {
     21  color: #f39c11;
     22  cursor: pointer;
     23  font-size: 18px; }
     24
     25.search-box {
     26  max-width: 300px; }
     27
     28.search-box input[type=text] {
     29  padding: 6px 12px;
     30  font-size: 14px;
     31  border: 1px solid #6d7bda;
     32  float: left;
     33  width: 80%;
     34  border-radius: 0; }
     35
     36.search-box input[type="text"]:focus {
     37  border: 1px solid #6d7bda;
     38  box-shadow: none;
     39  outline: 0; }
     40
     41.search-box button {
     42  float: left;
     43  width: 20%;
     44  padding: 6.5px 12px;
     45  background: #6d7bda;
     46  color: white;
     47  font-size: 14px;
     48  border: 1px solid #6d7bda;
     49  border-left: none;
     50  cursor: pointer; }
     51
     52.search-box button:hover {
     53  background: #6d7bda; }
     54
     55.search-box::after {
     56  content: "";
     57  clear: both;
     58  display: table; }
     59
     60.btn-cmn {
     61  background: #f39c11 !important;
     62  color: #fff !important;
     63  border-radius: 0 !important; }
     64  .btn-cmn:hover {
     65    color: #fff !important; }
     66
     67#uploadModal .modal-header {
     68  border-bottom: none !important;
     69  padding-bottom: 0 !important;
     70  position: relative; }
     71
     72#uploadModal .modal-title {
     73  color: #6d7bda !important;
     74  font-size: 22px !important;
     75  margin-bottom: 0 !important; }
     76
     77#uploadModal .modal {
     78  z-index: 99999 !important;
     79  background-color: rgba(0, 0, 0, 0.7) !important; }
     80
     81#uploadModal .modal-dialog {
     82  margin: 100px auto !important; }
     83
     84#uploadModal .modal-content {
     85  border: none !important;
     86  border-radius: 0 !important; }
     87
     88#uploadModal .dropzone {
     89  border: 2px dashed #6d7bda !important;
     90  border-radius: 5px !important;
     91  background: #eee !important; }
     92#parentMapModal .modal-dialog {
     93  margin: 100px auto !important;
     94}
     95#parentMapModal .modal-header {
     96  border-bottom: none !important;
     97  padding-bottom: 0 !important;
     98   }
     99
     100.showing_embeded_code .btn-wrap {
     101  margin-top: 15px; }
     102
     103.error-msg {
     104  color: red;
     105  font-size: 16px; }
     106
     107body.hide-title .main_title {
     108  display: none; }
     109
     110#uploadModal h4 {
     111  color: #6d7bda; }
     112
     113.custom-input-addon {
     114  background-color: #6d7bda !important;
     115  border: 1px solid #6d7bda !important;
     116  border-radius: 0px !important;
     117  color: #fff !important; }
     118
     119#uploadModal {
     120  overflow: scroll;
     121}
     122.bootstrap-wrapper .modal {
     123  background: rgba(0, 0, 0, 0.7);
     124}
     125
     126#viewMindModal .modal-dialog {
     127  margin: 100px auto !important; }
     128
     129#viewMindModal .modal-header {
     130  padding-bottom: 0 !important;
     131  border-bottom: none !important; }
     132
     133.modal_close_btn {
     134  position: absolute;
     135  right: -6px;
     136  top: -10px;
     137  width: 30px;
     138  height: 30px;
     139  line-height: 23px;
     140  font-size: 24px;
     141  background: orange !important;
     142  text-align: center;
     143  color: #fff;
     144  border-radius: 50%;
     145  cursor: pointer; }
     146
     147.simple-mind-map-wrapper table thead tr th {
     148  border-bottom-width: 1px;
     149  background: #6d7bda;
     150  color: #fff;
     151  text-align: center; }
     152  .simple-mind-map-wrapper table tbody tr td {
     153    text-align: center; }
     154    .simple-mind-map-wrapper table tbody tr td .view_child_map {
     155      vertical-align: middle;
     156      cursor: pointer;
     157      font-size: 22px;
     158      color: green; }
     159
     160.showing_embeded_code {
     161  display: none; }
     162
     163#viewMindModal {
     164  overflow-y: auto; }
     165  #viewMindModal table thead tr th {
     166    border-bottom-width: 1px;
     167    background: #6d7bda;
     168    color: #fff;
     169    text-align: center; }
     170li.toplevel_page_simplemind-map ul.wp-submenu li:last-child a {
     171  color: #f39c11 !important;
     172}
     173
     174.setting_content {
     175  max-width: 600px;
     176  padding-top: 10px;
     177}
     178
     179.setting_content p{
     180  font-size: 15px;
     181}
     182
     183.setting_content a {
     184  font-size: 16px;
     185  text-decoration: none;
     186}
     187
     188#windowLoadModal{
     189  background: rgba(0, 0, 0, 0.7);
     190}
     191#windowLoadModal .modal-dialog {
     192  margin: 100px auto !important;
     193}
     194.window_load_modal_content .ttl {
     195  font-size: 26px;
     196  line-height: 36px;
     197  font-weight: 600;
     198  margin-bottom: 20px;
     199  color: #000;
     200}
     201.window_load_modal_content .form-control {
     202  border: 1px solid #8c9298;
     203}
     204.window_load_modal_content .form-control:focus {
     205  border-color: #6d7bda;
     206  box-shadow: none;
     207}
     208.window_load_modal_content .btn_group {
     209  margin-top: 30px;
     210}
     211.window_modal_btn {
     212  display: inline-block;
     213  padding: 10px 20px;
     214  min-width: 130px;
     215  cursor: pointer;
     216  border-radius: 4px;
     217  font-size: 18px;
     218  color: #fff;
     219}
     220.no_tnx_btn{
     221  border: 1px solid #d54062;
     222  color:#d54062;
     223}
     224.subscribe_btn {
     225  background: #6d7bda;
     226  border: 1px solid #6d7bda;
     227}
     228.bootstrap-wrapper .window_load_modal_content .modal-content{
     229  border-radius: 0 !important;
     230}
     231/* Tooltip container */
     232.tooltip_copy_wrapper{
     233  position: relative;
     234}
     235.tooltiptext {
     236  display: none;
     237  position: absolute;
     238  left: -23px;
     239  top: -31px;
     240  width: 65px;
     241  background: #333;
     242  color: #fff;
     243  font-size: 12px;
     244  padding: 5px;
     245  border-radius: 4px;
     246  font-weight: 400;
     247}
     248.tooltiptext.active{
     249   display: inline-block;
     250}
     251.tooltiptext::after {
     252  content: "";
     253  position: absolute;
     254  top: 100%;
     255  left: 50%;
     256  margin-left: -5px;
     257  border-width: 5px;
     258  border-style: solid;
     259  border-color: #333 transparent transparent transparent;
     260}
  • wp-simplemind-map/trunk/assets/css/style.css

    r2361279 r2412325  
    1 #uploadModal .form-control {
    2   border-radius: 0 !important;
    3   border-color: #6d7bda !important; }
    4 
    5 .fa-trash {
    6   color: red;
    7   cursor: pointer; }
    8 
    9 .fa-edit {
    10   padding-right: 5px;
    11   color: #f39c11;
    12   cursor: pointer; }
    13 
    14 .showApiKey, .fa-copy {
    15   color: #f39c11;
    16   cursor: pointer;
    17   font-size: 18px; }
    18 
    19 .search-box {
    20   max-width: 300px; }
    21 
    22 .search-box input[type=text] {
    23   padding: 6px 12px;
    24   font-size: 14px;
    25   border: 1px solid #6d7bda;
    26   float: left;
    27   width: 80%;
    28   border-radius: 0; }
    29 
    30 .search-box input[type="text"]:focus {
    31   border: 1px solid #6d7bda;
    32   box-shadow: none;
    33   outline: 0; }
    34 
    35 .search-box button {
    36   float: left;
    37   width: 20%;
    38   padding: 6px 12px;
    39   background: #6d7bda;
    40   color: white;
    41   font-size: 14px;
    42   border: 1px solid #6d7bda;
    43   border-left: none;
    44   cursor: pointer; }
    45 
    46 .search-box button:hover {
    47   background: #6d7bda; }
    48 
    49 .search-box::after {
    50   content: "";
    51   clear: both;
    52   display: table; }
    53 
    54 .btn-cmn {
    55   background: #f39c11 !important;
    56   color: #fff !important;
    57   border-radius: 0 !important; }
    58   .btn-cmn:hover {
    59     color: #fff !important; }
    60 
    61 #uploadModal .modal-header {
    62   border-bottom: none !important;
    63   padding-bottom: 0 !important;
    64   position: relative; }
    65 
    66 #uploadModal .modal-title {
    67   color: #6d7bda !important;
    68   font-size: 22px !important;
    69   margin-bottom: 0 !important; }
    70 
    71 #uploadModal .modal {
    72   z-index: 99999 !important;
    73   background-color: rgba(0, 0, 0, 0.7) !important; }
    74 
    75 #uploadModal .modal-dialog {
    76   margin: 100px auto !important; }
    77 
    78 #uploadModal .modal-content {
    79   border: none !important;
    80   border-radius: 0 !important; }
    81 
    82 #uploadModal .dropzone {
    83   border: 2px dashed #6d7bda !important;
    84   border-radius: 5px !important;
    85   background: #eee !important; }
    86 #parentMapModal .modal-dialog {
    87   margin: 100px auto !important;
    88 }
    89 #parentMapModal .modal-header {
    90   border-bottom: none !important;
    91   padding-bottom: 0 !important;
    92    }
    93 
    94 .showing_embeded_code .btn-wrap {
    95   margin-top: 15px; }
    96 
    97 .error-msg {
    98   color: red;
    99   font-size: 16px; }
    100 
    101 body.hide-title .main_title {
    102   display: none; }
    103 
    104 #uploadModal h4 {
    105   color: #6d7bda; }
    106 
    107 .custom-input-addon {
    108   background-color: #6d7bda !important;
    109   border: 1px solid #6d7bda !important;
    110   border-radius: 0px !important;
    111   color: #fff !important; }
    112 
    113 #uploadModal {
    114   overflow: scroll;
    115   background: rgba(0, 0, 0, 0.7);
    116 }
    117 
    118 #viewMindModal .modal-dialog {
    119   margin: 100px auto !important; }
    120 
    121 #viewMindModal .modal-header {
    122   padding-bottom: 0 !important;
    123   border-bottom: none !important; }
    124 
    125 .modal_close_btn {
    126   position: absolute;
    127   right: -6px;
    128   top: -10px;
    129   width: 30px;
    130   height: 30px;
    131   line-height: 23px;
    132   font-size: 24px;
    133   background: orange !important;
    134   text-align: center;
    135   color: #fff;
    136   border-radius: 50%;
    137   cursor: pointer; }
    138 
    139 .simple-mind-map-wrapper table thead tr th {
    140   border-bottom-width: 1px;
    141   background: #6d7bda;
    142   color: #fff;
    143   text-align: center; }
    144   .simple-mind-map-wrapper table tbody tr td {
    145     text-align: center; }
    146     .simple-mind-map-wrapper table tbody tr td .view_child_map {
    147       vertical-align: middle;
    148       cursor: pointer;
    149       font-size: 22px;
    150       color: green; }
    151 
    152 .showing_embeded_code {
    153   display: none; }
    154 
    155 #viewMindModal {
    156   overflow-y: auto; }
    157   #viewMindModal table thead tr th {
    158     border-bottom-width: 1px;
    159     background: #6d7bda;
    160     color: #fff;
    161     text-align: center; }
    162 li.toplevel_page_simplemind-map ul.wp-submenu li:last-child a {
    163   color: #f39c11 !important;
    164 }
    165 
    166 .setting_content {
    167   max-width: 600px;
    168   padding-top: 10px;
    169 }
    170 
    171 .setting_content p{
    172   font-size: 15px;
    173 }
    174 
    175 .setting_content a {
    176   font-size: 16px;
    177   text-decoration: none;
    178 }
  • wp-simplemind-map/trunk/assets/js/admin-script.js

    r2353794 r2412325  
    11jQuery(function($){
     2    $('#windowLoadModal .no_tnx_btn').click(function(){
     3        $.ajax({
     4            url: frontend_form_object.ajaxurl,
     5            type: 'POST',
     6            data: {
     7                action: 'smdmap_newsletter_no_thanks',
     8                smdmap_mind_map: $('#smdmap_mind_map').val()
     9            },
     10        })
     11    })
     12
     13    $('#windowLoadModal .subscribe_btn').click(function(){
     14        let email = $('#windowLoadModal input');
     15        if(!email.val()){
     16            email.css('border-color', 'red');
     17            return false;
     18        }
     19
     20        $('#windowLoadModal .message').text('Thanks for your subscription');
     21
     22        setTimeout(function(){
     23            $('#windowLoadModal').modal('hide');
     24        }, 1000);
     25
     26        $.ajax({
     27            url: frontend_form_object.ajaxurl,
     28            type: 'POST',
     29            data: {
     30                action: 'smdmap_newsletter_subscription',
     31                email: $('#windowLoadModal input').val(),
     32                smdmap_mind_map: $('#smdmap_mind_map').val()
     33            },
     34        })
     35        .done(function (response) {
     36
     37        })
     38        .fail(function () {
     39            console.log("error");
     40        })
     41        .always(function () {
     42            console.log("complete");
     43        });
     44    });
    245
    346    $('#parentMapModal .parent-map-btn').click(function () {
     
    750            data: {
    851                action: 'save_parent_map',
    9                 map_id: $('#parentMapModal [name="map_id"]').val()
     52                map_id: $('#parentMapModal [name="map_id"]').val(),
     53                smdmap_mind_map: $('#smdmap_mind_map').val()
    1054            },
    1155        })
    12             .done(function (response) {
    13                 location.reload();
    14             })
    15             .fail(function () {
    16                 console.log("error");
    17             })
    18             .always(function () {
    19                 console.log("complete");
    20             });
     56        .done(function (response) {
     57            location.reload();
     58        })
     59        .fail(function () {
     60            console.log("error");
     61        })
     62        .always(function () {
     63            console.log("complete");
     64        });
    2165    });
    2266
     
    3680            }
    3781        })
    38             .done(function (response) {
    39                 if(response.success){
    40                     $('.message').html(`<span style="color: green">${response.data.message}</span>`);
    41                 }
    42                 else {
    43                     $('.message').html(`<span style="color: red;">${response.data.message}</span>`);
    44                 }
    45             })
     82        .done(function (response) {
     83            if(response.success){
     84                $('.message').html(`<span style="color: green">${response.data.message}</span>`);
     85            }
     86            else {
     87                $('.message').html(`<span style="color: red;">${response.data.message}</span>`);
     88            }
     89        })
    4690    });
    4791   
     
    5296            data: {
    5397                action: 'get_child_maps',
    54                 id: $(this).parents('tr').data('id')
    55             }
    56         })
    57             .done(function(response) {
     98                id: $(this).parents('tr').data('id'),
     99                smdmap_mind_map: $('#smdmap_mind_map').val()
     100            }
     101        })
     102        .done(function(response) {
    58103                // console.log(response);
    59104                let html = '';
     
    70115                child_maps.map(function (code) {
    71116                    html += `<tr>
    72                                 <td class="text-left">${code.title}</td>
    73                                 <td>
    74                                     <div class="copy_iframe_text" style="float:left;">[SimpleMind map=${code.id}]</div>
    75                                     <div style="float:right;">
    76                                         <i class="fa fa-copy copy_btn_modal"></i>
    77                                     </div>
    78                                 </td>
    79                             </tr>`;
     117                    <td class="text-left">${code.title}</td>
     118                    <td>
     119                    <div class="copy_iframe_text" style="float:left;">[SimpleMind map=${code.id}]</div>
     120                    <div style="float:right;">
     121                    <i class="fa fa-copy copy_btn_modal"></i>
     122                    </div>
     123                    </td>
     124                    </tr>`;
    80125                })
    81126                $('#viewMindModal table tbody').html(html);
     
    98143    Dropzone.autoDiscover = false;
    99144    $("#mydropzone").dropzone({
    100        url: "/wp-admin/admin-ajax.php?action=upload_simple_mind_map",
    101         timeout: 180000,
    102         dictDefaultMessage: "Drop file here to upload",
    103         success: function (file, response) {
    104            if(response.success){
    105                $('.error-msg').text('');
    106 
    107                let html = '';
    108                let parent_data = response.data.short_codes.filter(function (short_code) {
    109                     return short_code.is_parent == true;
    110                });
    111                 console.log(parent_data.length );
    112                if(parent_data.length === 0){
    113                    let options = '';
    114                    $('#uploadModal').modal('hide');
    115                    $('#parentMapModal').modal('show');
    116                    response.data.short_codes.map(short_code => {
    117                        options += `<option value="${short_code.id}">${short_code.title}</option>`;
    118                    });
    119                     $('[name="map_id"]').html(options);
    120                     return false;
    121                }
    122 
    123                parent_data.map(short_code => {
    124                    html += `<div class="form-group">
    125                             <label>${short_code.title}</label>
    126                             <div class="input-group custom-input-group">
    127                                 <input type="text" class="form-control" value="${short_code.code}">
    128                                 <span class="input-group-addon custom-input-addon">
    129                                     <i class="copyApiKey fa fa-copy" style="color:#fff; padding:0 3px;"></i>
    130                                 </span>
    131                             </div>
    132                         </div>`;
    133                });
    134                $('.showing_embeded_code').slideDown();
    135                $('.showing_embeded_code h4').after(html);
    136            }
    137            else {
    138                 $('.error-msg').text(response.data.message);
    139            }
     145     url: frontend_form_object.ajaxurl +"?action=upload_simple_mind_map&smdmap_mind_map="+ $('#smdmap_mind_map').val(),
     146     timeout: 180000,
     147     dictDefaultMessage: "Drop file here to upload",
     148     success: function (file, response) {
     149         if(response.success){
     150             $('.error-msg').text('');
     151
     152             let html = '';
     153             let parent_data = response.data.short_codes.filter(function (short_code) {
     154                return short_code.is_parent == true;
     155            });
     156
     157             if(parent_data.length === 0){
     158                 let options = '';
     159                 $('#uploadModal').modal('hide');
     160                 $('#parentMapModal').modal('show');
     161                 response.data.short_codes.map(short_code => {
     162                     options += `<option value="${short_code.id}">${short_code.title}</option>`;
     163                 });
     164                 $('[name="map_id"]').html(options);
     165                 return false;
     166             }
     167
     168             parent_data.map(short_code => {
     169                 html += `<div class="form-group">
     170                 <label>${short_code.title}</label>
     171                 <div class="input-group custom-input-group">
     172                 <input type="text" class="form-control" value="${short_code.code}">
     173                 <span class="input-group-addon custom-input-addon">
     174                 <i class="copyApiKey fa fa-copy" style="color:#fff; padding:0 3px;"></i>
     175                 </span>
     176                 </div>
     177                 </div>`;
     178             });
     179             $('.showing_embeded_code').slideDown();
     180             $('.showing_embeded_code h4').after(html);
     181         }
     182         else {
     183            $('.error-msg').text(response.data.message);
    140184        }
    141    });
     185    }
     186});
    142187
    143188    $('#uploadModal .close, #uploadModal .showing_embeded_code button').click(function () {
     
    149194
    150195       // let ret = copyToClipboard($(this).parents('.custom-input-group').find('input').val());
    151         let copyText = $(this).parents('.custom-input-group').find('input');
    152         /* Select the text field */
    153         copyText.select();
    154 
    155         /* Copy the text inside the text field */
    156         let ret = document.execCommand("copy");
    157 
    158         console.log(ret);
    159         if (ret) {
    160             _this
    161                 .tooltip({
    162                     title: "Copied!",
    163                     animated: "fade",
    164                     placement: "top",
    165                     trigger: "manual"
    166                 })
    167                 .tooltip("show");
    168 
    169             setTimeout(() => _this.tooltip("hide"), 1000, _this);
    170         }
    171     });
     196       let copyText = $(this).parents('.custom-input-group').find('input');
     197       /* Select the text field */
     198       copyText.select();
     199
     200       /* Copy the text inside the text field */
     201       let ret = document.execCommand("copy");
     202
     203       console.log(ret);
     204       if (ret) {
     205        _this
     206        .tooltip({
     207            title: "Copied!",
     208            animated: "fade",
     209            placement: "top",
     210            trigger: "manual"
     211        })
     212        .tooltip("show");
     213
     214        setTimeout(() => _this.tooltip("hide"), 1000, _this);
     215    }
     216});
    172217
    173218    $('.delete_row').on('click', function(e){
     
    190235                    data: {
    191236                        action: 'delete_mind_map',
    192                         id: id
     237                        id: id,
     238                        smdmap_mind_map: $('#smdmap_mind_map').val()
    193239                    }
    194240                })
     
    215261    $body.removeChild($tempInput);
    216262    return res;
    217   };
    218 
    219     $(".modal").on("shown.bs.modal", function() {
    220 
    221     })
     263};
     264
     265$(".modal").on("shown.bs.modal", function() {
     266
     267});
    222268
    223269$(document).on("click", ".copy_btn", function(e) {
    224270    let _this = $(this);
    225271    let ret = copyToClipboard(
    226       $.trim(
    227         _this
    228           .parents("td")
    229           .find(".copy_iframe_text")
    230           .text()
    231       ), false
    232     );
     272        $.trim(
     273            _this
     274            .parents("td")
     275            .find(".copy_iframe_text")
     276            .text()
     277            ), false
     278        );
    233279
    234280    if (ret) {
    235       _this
    236         .tooltip({
    237           title: "Copied!",
    238           animated: "fade",
    239           placement: "top",
    240           trigger: "manual"
    241         })
    242         .tooltip("show");
    243 
    244       setTimeout(() => _this.tooltip("hide"), 1000, _this);
    245     }
    246   });
    247 
    248     $(document).on("click", ".copy_btn_modal", function(e) {
    249         let _this = $(this);
    250         let ret = copyToClipboard(
    251             $.trim(
    252                 _this
    253                     .parents("td")
    254                     .find(".copy_iframe_text")
    255                     .text()
     281        _this.find('.tooltiptext').addClass('active');
     282        setTimeout(function(){
     283            _this.find('.tooltiptext').removeClass('active');
     284        }, 1000, _this);
     285        // _this
     286        // .tooltip({
     287        //  title: "Copied!",
     288        //  animated: "fade",
     289        //  placement: "top",
     290        //  trigger: "manual",
     291  //           container: "body"
     292        // })
     293        // .tooltip("show");
     294
     295        // setTimeout(() => _this.tooltip("hide"), 1000, _this);
     296    }
     297});
     298
     299// $(document).on("click", ".copy_btn", function(e) {
     300//     let _this = $(this);
     301//     let ret = copyToClipboard(
     302//       $.trim(
     303//         _this
     304//         .parents("td")
     305//         .find(".copy_iframe_text")
     306//         .text()
     307//         ), false
     308//       );
     309
     310//     if (ret) {
     311//       _this
     312//       .tooltip({
     313//           title: "Copied!",
     314//           animated: "fade",
     315//           placement: "top",
     316//           trigger: "manual"
     317//       })
     318//       .tooltip("show");
     319
     320//       setTimeout(() => _this.tooltip("hide"), 1000, _this);
     321//   }
     322// });
     323
     324$(document).on("click", ".copy_btn_modal", function(e) {
     325    let _this = $(this);
     326    let ret = copyToClipboard(
     327        $.trim(
     328            _this
     329            .parents("td")
     330            .find(".copy_iframe_text")
     331            .text()
    256332            ), true
    257333        );
    258334
    259         if (ret) {
    260             _this
    261                 .tooltip({
    262                     title: "Copied!",
    263                     animated: "fade",
    264                     placement: "top",
    265                     trigger: "manual"
    266                 })
    267                 .tooltip("show");
    268 
    269             setTimeout(() => _this.tooltip("hide"), 1000, _this);
    270         }
    271     });
     335    if (ret) {
     336        _this
     337        .tooltip({
     338            title: "Copied!",
     339            animated: "fade",
     340            placement: "top",
     341            trigger: "manual"
     342        })
     343        .tooltip("show");
     344
     345        setTimeout(() => _this.tooltip("hide"), 1000, _this);
     346    }
     347});
    272348});
    273349
     350jQuery(window).on('load',function(){
     351    jQuery('#windowLoadModal').modal('show');
     352});
  • wp-simplemind-map/trunk/readme.txt

    r2406247 r2412325  
    11=== WP SimpleMind Map ===
    22Contributors: telicom
    3 Tags: simplemind map, telicom, mind map
     3Tags: simplemind map, telicom, mind map, diagram, workflow
    44Requires at least: 5.4.0
    55Tested up to: 5.5.1
    66Requires PHP: 7.0
    7 Stable tag: 1.1.3
     7Stable tag: 1.1.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9292
    9393== Changelog ==
     94= 1.1.4 =
     95* Fix Security Issue
     96* Newsletter Subscription added
     97
     98= 1.1.3 =
     99* Documentation added
     100
    94101= 1.1.2 =
    95102* Bug Fixes - Username and api key auto save
  • wp-simplemind-map/trunk/src/SmdmapAjaxAction.php

    r2361279 r2412325  
    1717        add_action("wp_ajax_smdmap_check_subscription", array($self, 'check_subscription'));
    1818        add_action("wp_ajax_save_parent_map", array($self, 'save_parent_map'));
     19        add_action("wp_ajax_smdmap_newsletter_subscription", array($self, 'smdmap_newsletter_subscription'));
     20        add_action("wp_ajax_smdmap_newsletter_no_thanks", array($self, 'smdmap_newsletter_no_thanks'));
     21    }
     22
     23    public function security()
     24    {
     25        if ( ! isset( $_POST['smdmap_mind_map'] ) || ! wp_verify_nonce( $_POST['smdmap_mind_map'], 'smdmap_mind_map_nonce' ) ) {
     26            die("You are not allowed to submit data.");
     27        }
     28    }
     29
     30    public function smdmap_newsletter_no_thanks()
     31    {
     32        $this->security();
     33        update_option('smdmap_newsletter_hide', strtotime('+60 days'));
     34    }
     35
     36    public function smdmap_newsletter_subscription()
     37    {
     38        $this->security();
     39
     40        $email = sanitize_email( $_POST['email'] );
     41
     42        wp_remote_request( 'https://telicom.ca/newsletter-subscription/', ['method' => 'GET', 'body' => ['user_email' => $email]] );
     43
     44        update_option('smdmap_newsletter_hide', strtotime('+5 years'));
     45        // $code = wp_remote_retrieve_response_code( $response );
     46        wp_send_json_success( );
     47
    1948    }
    2049
    2150    public function save_parent_map()
    2251    {
     52        $this->security();
     53
    2354        $map_id = (int) $_POST['map_id'];
    2455        $SmdmapMindMap = new SmdmapMindMap();
     
    5586    public function get_child_maps()
    5687    {
     88        $this->security();
     89
    5790        $id = (int) $_POST['id'];
    5891
     
    75108    public function upload_simple_mind_map()
    76109    {
     110
     111        if ( ! isset( $_GET['smdmap_mind_map'] ) || ! wp_verify_nonce( $_GET['smdmap_mind_map'], 'smdmap_mind_map_nonce' ) ) {
     112            die("You are not allowed to submit data.");
     113        }
    77114
    78115        if (!function_exists('wp_handle_upload')) {
     
    141178    public function deleteMindMap()
    142179    {
     180
     181        $this->security();
     182       
    143183        $SmdmapMindMap = new SmdmapMindMap();
    144184        $id            = (int) $_POST['id'];
  • wp-simplemind-map/trunk/src/SmdmapEnqueue.php

    r2353794 r2412325  
    99class SmdmapEnqueue
    1010{
     11    protected $version = '1.1.4';
    1112
    1213    public static function init()
    1314    {
    1415        $self = new self;
     16       
    1517        add_action('wp_enqueue_scripts', array($self, 'wp_scripts'));
    1618        add_action('admin_enqueue_scripts', array($self, 'enqueue_admin_script' ));
     
    2123
    2224        wp_enqueue_script('drop-zone-js', SMM_ASSETSURL . "add-on/image-map-resizer/imageMapResizer.min.js", array(), '1.0.0', true);
    23         wp_enqueue_script('form-script', SMM_ASSETSURL . "js/script.js", array(),  time(), true);
     25        wp_enqueue_script('form-script', SMM_ASSETSURL . "js/script.js", array(),  $this->version, true);
    2426
    2527        wp_localize_script(
     
    4042        wp_enqueue_style('sweet-alert', SMM_ASSETSURL . "add-on/sweetalert2/sweetalert2.css", false, '1.0.0');
    4143
    42         wp_enqueue_style('form-style', SMM_ASSETSURL . "css/style.css", array(), time());
     44        wp_enqueue_style('form-style', SMM_ASSETSURL . "css/style.css", array(), $this->version);
     45        wp_enqueue_style('admin-style', SMM_ASSETSURL . "css/admin-style.css", array(), $this->version);
    4346
    4447        wp_enqueue_script('admin-sweet-alert-js', SMM_ASSETSURL . "add-on/sweetalert2/sweetalert2.js", array(), '1.0.0', true);
     
    4649        wp_enqueue_script('admin-popper-js', SMM_ASSETSURL . "add-on/bootstrap/popper.min.js", array(), '1.0.0', true);
    4750        wp_enqueue_script('admin-bootstrap-js', SMM_ASSETSURL . "add-on/bootstrap/bootstrap.min.js", array(), '1.0.0', true);
    48         wp_enqueue_script('smdmap-script', SMM_ASSETSURL . "js/admin-script.js", array(), '1.0.0', true);
     51        wp_enqueue_script('smdmap-script', SMM_ASSETSURL . "js/admin-script.js", array(), $this->version, true);
    4952        wp_localize_script(
    5053            'smdmap-script',
    5154            'frontend_form_object',
    5255            array(
    53                 'ajaxurl' => admin_url('admin-ajax.php')
     56                'ajaxurl' => admin_url('admin-ajax.php'),
     57                'smdmap_newsletter_hide' => get_option('smdmap_newsletter_hide')
    5458            )
    5559        );
  • wp-simplemind-map/trunk/view/admin_simple_mind_map.php

    r2358854 r2412325  
    1616
    1717$subscription = (bool)get_option('smdmap-subscription');
     18
     19wp_nonce_field( 'smdmap_mind_map_nonce', 'smdmap_mind_map' );
    1820?>
     21
    1922<h1>SimpleMind Map</h1>
    2023<div class="bootstrap-wrapper" style="overflow: hidden;">
     
    6265                                    </div>
    6366                                    <div style="float:right;">
    64                                         <i class="fa fa-copy copy_btn"></i>
     67                                        <i class="fa fa-copy copy_btn tooltip_copy_wrapper"><span class="tooltiptext">Copied!</span></i>
    6568                                    </div>
    6669                                </td>
     
    191194        </div>
    192195    </div>
    193 
     196    <?php
     197    $smdmap_newsletter_hide = get_option('smdmap_newsletter_hide');
     198    if(empty($smdmap_newsletter_hide) || $smdmap_newsletter_hide < time()):
     199    ?>
     200    <!-- Upload Modal -->
     201    <div class="modal fade" id="windowLoadModal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false">
     202        <div class="modal-dialog" role="document">
     203            <div class="modal-content">
     204                <div class="modal-body">
     205                    <div class="window_load_modal_content text-center">
     206                        <div class="ttl">Get latest offer and features</div>
     207                        <input type="email" class="modal_input_style form-control" placeholder="Please insert your valid email" value="<?= sanitize_email(get_option('admin_email')) ?>">
     208                        <p class="message"></p>
     209                        <div class="btn_group">
     210                            <div class="window_modal_btn no_tnx_btn" data-dismiss="modal">No Thanks</div>
     211                            <div class="window_modal_btn subscribe_btn">Subscribe Now</div>
     212                        </div>
     213                       
     214                    </div>
     215                </div>
     216            </div>
     217        </div>
     218    </div> 
     219    <?php endif ?>
    194220</div>
Note: See TracChangeset for help on using the changeset viewer.