Changeset 3237005
- Timestamp:
- 02/08/2025 03:02:51 PM (12 months ago)
- Location:
- db-website-settings
- Files:
-
- 17 added
- 5 edited
-
tags/2.10 (added)
-
tags/2.10/css (added)
-
tags/2.10/css/admin.css (added)
-
tags/2.10/css/admin.min.css (added)
-
tags/2.10/css/style.css (added)
-
tags/2.10/css/style.min.css (added)
-
tags/2.10/db-website-settings.php (added)
-
tags/2.10/img (added)
-
tags/2.10/img/icon.svg (added)
-
tags/2.10/inc (added)
-
tags/2.10/inc/admin.php (added)
-
tags/2.10/js (added)
-
tags/2.10/js/admin.js (added)
-
tags/2.10/js/admin.min.js (added)
-
tags/2.10/languages (added)
-
tags/2.10/languages/readme.txt (added)
-
tags/2.10/readme.txt (added)
-
trunk/db-website-settings.php (modified) (3 diffs)
-
trunk/inc/admin.php (modified) (2 diffs)
-
trunk/js/admin.js (modified) (1 diff)
-
trunk/js/admin.min.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
db-website-settings/trunk/db-website-settings.php
r3222527 r3237005 4 4 Plugin URI: https://github.com/bisteinoff/db-website-settings 5 5 Description: The plugin is used for the basic website settings 6 Version: 2. 96 Version: 2.10 7 7 Author: Denis Bisteinov 8 8 Author URI: https://bisteinoff.com … … 32 32 33 33 if ( !defined( 'DB_WEBSITE_SETTINGS_PLUGIN_VERSION' ) ) 34 define( 'DB_WEBSITE_SETTINGS_PLUGIN_VERSION', '2. 9' );34 define( 'DB_WEBSITE_SETTINGS_PLUGIN_VERSION', '2.10' ); 35 35 36 36 class DB_SETTINGS_WebsiteSettings … … 238 238 239 239 case "href" : 240 $html = " tg://resolve?domain={$telegram}";240 $html = "https://t.me/{$telegram}"; 241 241 break; 242 242 -
db-website-settings/trunk/inc/admin.php
r3222509 r3237005 119 119 ?> 120 120 <div class='wrap db-settings-admin'> 121 122 <?php 123 124 if ( isset( $_POST[ 'submit' ] ) ) : 125 126 ?> 127 128 <script> 129 (function() { 130 setTimeout(function() { 131 location.reload(); 132 }, 500); // Delay to ensure the save process completes. 133 })(); 134 </script> 135 136 <?php 137 138 else: 139 140 ?> 121 141 122 142 <h1><?php esc_html_e( 'Contact Settings' , 'db-website-settings' ) ?></h1> … … 359 379 </form> 360 380 381 <?php 382 383 endif; 384 385 ?> 386 361 387 </div> 362 388 -
db-website-settings/trunk/js/admin.js
r3152088 r3237005 267 267 numEmails++ 268 268 } 269 270 jQuery(document).ready(function($) { 271 272 let dbSettingsTypes = { 273 phone: { 274 protocol: 'tel:', 275 link: '', 276 reg: /[^+\d]/g 277 }, 278 whatsapp: { 279 protocol: '', 280 link: 'https://wa.me/', 281 reg: /\D/g 282 }, 283 telegram: { 284 protocol: '', 285 link: 'https://t.me/', 286 hashtag: '@' 287 }, 288 email: { 289 protocol: 'mailto:', 290 link: '' 291 } 292 }; 293 294 $(document).on('input', 'input[id^="db_settings_"]', function() { 295 296 let inputId = $(this).attr('id'); // Get the input ID 297 let type = inputId.split('_')[2]; // Extract type 298 299 if (dbSettingsTypes[type]) { 300 let index = inputId.split('_').pop(); // Extract the unique index from the input ID 301 let newValue = $(this).val(); // Get the input value 302 let cleanValue = dbSettingsTypes[type].reg ? newValue.replace(dbSettingsTypes[type].reg, '') : newValue; // Use regular expression if set 303 304 newValue = dbSettingsTypes[type].hashtag ? dbSettingsTypes[type].hashtag + newValue : newValue; // Add hashtag if set 305 306 // Build the HTML code for text, link, and href 307 let codeText = '<span class="db-wcs-contact db-wcs-contact-' + type + ' db-wcs-contact-' + type + '-' + index + '">' + newValue + '</span>'; 308 let codeLink = '<a href="' + dbSettingsTypes[type].protocol + dbSettingsTypes[type].link + cleanValue + '" class="db-wcs-contact db-wcs-contact-' + type + ' db-wcs-contact-' + type + '-' + index + '">' + newValue + '</a>'; 309 let codeHref = dbSettingsTypes[type].link + cleanValue; 310 311 // Update the table cells with new content 312 $('#' + type + '_' + index + '_1 td:last-child').html(codeText); 313 $('#' + type + '_' + index + '_2 td:last-child').html(codeLink); 314 $('#' + type + '_' + index + '_3 td:last-child').html(codeHref); 315 } 316 }); 317 318 }); -
db-website-settings/trunk/js/admin.min.js
r3152088 r3237005 1 let numPhones=1,numWhatsapps=1,numTelegram=1,numEmails=1;window.addEventListener("load",function(){let e,t,n, d,i;for(i=0;e=document.getElementById("phone_"+i+"_1");){let a=document.getElementById("phone_"+i+"_1_description"),r=document.getElementById("phone_"+i+"_2_description"),l=document.getElementById("phone_"+i+"_3_description");a.innerText=dbSettingsDescriptions.phone[1],r.innerText=dbSettingsDescriptions.phone[2],l.innerText=dbSettingsDescriptions.phone[3],numPhones=++i}for(i=0;t=document.getElementById("whatsapp_"+i+"_1");){let p=document.getElementById("whatsapp_"+i+"_1_description"),s=document.getElementById("whatsapp_"+i+"_2_description"),o=document.getElementById("whatsapp_"+i+"_3_description");p.innerText=dbSettingsDescriptions.whatsapp[1],s.innerText=dbSettingsDescriptions.whatsapp[2],o.innerText=dbSettingsDescriptions.whatsapp[3],numWhatsapps=++i}for(i=0;n=document.getElementById("telegram_"+i+"_1");){let m=document.getElementById("telegram_"+i+"_1_description"),g=document.getElementById("telegram_"+i+"_2_description"),h=document.getElementById("telegram_"+i+"_3_description");m.innerText=dbSettingsDescriptions.telegram[1],g.innerText=dbSettingsDescriptions.telegram[2],h.innerText=dbSettingsDescriptions.telegram[3],numTelegram=++i}for(i=0;d=document.getElementById("email_"+i+"_1");){let c=document.getElementById("email_"+i+"_1_description"),b=document.getElementById("email_"+i+"_2_description"),_=document.getElementById("email_"+i+"_3_description");c.innerText=dbSettingsDescriptions.email[1],b.innerText=dbSettingsDescriptions.email[2],_.innerText=dbSettingsDescriptions.email[3],numEmails=++i}});const buttons=document.getElementById("db_settings_add_buttons").getElementsByTagName("a"),dbButtonPressed=e=>{let t=e.target.id;switch(t){case"db_settings_add_phone":dbAddPhone();break;case"db_settings_add_whatsapp":dbAddWhatsapp();break;case"db_settings_add_telegram":dbAddTelegram();break;case"db_settings_add_email":dbAddEmail()}};for(let button of buttons)button.addEventListener("click",dbButtonPressed);function dbAddPhone(){let e=numPhones,t=document.getElementById("phone_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","phone_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.phone[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="phone_'+e+'" id="db_settings_phone_'+e+'" size="20" value="" /></td><td>[db-phone'+(e+1)+']</td><td id="phone_'+e+'_1_description">'+dbSettingsDescriptions.phone[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let d=document.getElementById("phone_"+e+"_1"),i=document.createElement("tr");i.setAttribute("id","phone_"+e+"_2"),i.style.verticalAlign="top",i.innerHTML="<td>[db-phone"+(e+1)+'-link]</td><td id="phone_'+e+'_2_description">'+dbSettingsDescriptions.phone[2]+"</td><td></td>",d.parentNode.insertBefore(i,d.nextSibling);let a=document.getElementById("phone_"+e+"_2"),r=document.createElement("tr");r.setAttribute("id","phone_"+e+"_3"),r.style.verticalAlign="top",r.innerHTML="<td>[db-phone"+(e+1)+'-href]</td><td id="phone_'+e+'_3_description">'+dbSettingsDescriptions.phone[3]+"</td><td></td>",a.parentNode.insertBefore(r,a.nextSibling),numPhones++}function dbAddWhatsapp(){let e=numWhatsapps,t=document.getElementById("whatsapp_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","whatsapp_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.whatsapp[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="whatsapp_'+e+'" id="db_settings_whatsapp_'+e+'" size="20" value="" /></td><td>[db-whatsapp'+(e+1)+']</td><td id="whatsapp_'+e+'_1_description">'+dbSettingsDescriptions.whatsapp[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let d=document.getElementById("whatsapp_"+e+"_1"),i=document.createElement("tr");i.setAttribute("id","whatsapp_"+e+"_2"),i.style.verticalAlign="top",i.innerHTML="<td>[db-whatsapp"+(e+1)+'-link]</td><td id="whatsapp_'+e+'_2_description">'+dbSettingsDescriptions.whatsapp[2]+"</td><td></td>",d.parentNode.insertBefore(i,d.nextSibling);let a=document.getElementById("whatsapp_"+e+"_2"),r=document.createElement("tr");r.setAttribute("id","whatsapp_"+e+"_3"),r.style.verticalAlign="top",r.innerHTML="<td>[db-whatsapp"+(e+1)+'-href]</td><td id="whatsapp_'+e+'_3_description">'+dbSettingsDescriptions.whatsapp[3]+"</td><td></td>",a.parentNode.insertBefore(r,a.nextSibling),numWhatsapps++}function dbAddTelegram(){let e=numTelegram,t=document.getElementById("telegram_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","telegram_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.telegram[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="telegram_'+e+'" id="db_settings_telegram_'+e+'" size="20" value="" /></td><td>[db-telegram'+(e+1)+']</td><td id="telegram_'+e+'_1_description">'+dbSettingsDescriptions.telegram[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let d=document.getElementById("telegram_"+e+"_1"),i=document.createElement("tr");i.setAttribute("id","telegram_"+e+"_2"),i.style.verticalAlign="top",i.innerHTML="<td>[db-telegram"+(e+1)+'-link]</td><td id="telegram_'+e+'_2_description">'+dbSettingsDescriptions.telegram[2]+"</td><td></td>",d.parentNode.insertBefore(i,d.nextSibling);let a=document.getElementById("telegram_"+e+"_2"),r=document.createElement("tr");r.setAttribute("id","telegram_"+e+"_3"),r.style.verticalAlign="top",r.innerHTML="<td>[db-telegram"+(e+1)+'-href]</td><td id="telegram_'+e+'_3_description">'+dbSettingsDescriptions.telegram[3]+"</td><td></td>",a.parentNode.insertBefore(r,a.nextSibling),numTelegram++}function dbAddEmail(){let e=numEmails,t=document.getElementById("email_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","email_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.email[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="email_'+e+'" id="db_settings_email_'+e+'" size="20" value="" /></td><td>[db-email'+(e+1)+']</td><td id="email_'+e+'_1_description">'+dbSettingsDescriptions.email[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let d=document.getElementById("email_"+e+"_1"),i=document.createElement("tr");i.setAttribute("id","email_"+e+"_2"),i.style.verticalAlign="top",i.innerHTML="<td>[db-email"+(e+1)+'-link]</td><td id="email_'+e+'_2_description">'+dbSettingsDescriptions.email[2]+"</td><td></td>",d.parentNode.insertBefore(i,d.nextSibling);let a=document.getElementById("email_"+e+"_2"),r=document.createElement("tr");r.setAttribute("id","email_"+e+"_3"),r.style.verticalAlign="top",r.innerHTML="<td>[db-email"+(e+1)+'-href]</td><td id="email_'+e+'_3_description">'+dbSettingsDescriptions.email[3]+"</td><td></td>",a.parentNode.insertBefore(r,a.nextSibling),numEmails++}1 let numPhones=1,numWhatsapps=1,numTelegram=1,numEmails=1;window.addEventListener("load",function(){let e,t,n,i,d;for(d=0;e=document.getElementById("phone_"+d+"_1");){let a=document.getElementById("phone_"+d+"_1_description"),l=document.getElementById("phone_"+d+"_2_description"),r=document.getElementById("phone_"+d+"_3_description");a.innerText=dbSettingsDescriptions.phone[1],l.innerText=dbSettingsDescriptions.phone[2],r.innerText=dbSettingsDescriptions.phone[3],numPhones=++d}for(d=0;t=document.getElementById("whatsapp_"+d+"_1");){let s=document.getElementById("whatsapp_"+d+"_1_description"),p=document.getElementById("whatsapp_"+d+"_2_description"),o=document.getElementById("whatsapp_"+d+"_3_description");s.innerText=dbSettingsDescriptions.whatsapp[1],p.innerText=dbSettingsDescriptions.whatsapp[2],o.innerText=dbSettingsDescriptions.whatsapp[3],numWhatsapps=++d}for(d=0;n=document.getElementById("telegram_"+d+"_1");){let m=document.getElementById("telegram_"+d+"_1_description"),g=document.getElementById("telegram_"+d+"_2_description"),c=document.getElementById("telegram_"+d+"_3_description");m.innerText=dbSettingsDescriptions.telegram[1],g.innerText=dbSettingsDescriptions.telegram[2],c.innerText=dbSettingsDescriptions.telegram[3],numTelegram=++d}for(d=0;i=document.getElementById("email_"+d+"_1");){let h=document.getElementById("email_"+d+"_1_description"),b=document.getElementById("email_"+d+"_2_description"),_=document.getElementById("email_"+d+"_3_description");h.innerText=dbSettingsDescriptions.email[1],b.innerText=dbSettingsDescriptions.email[2],_.innerText=dbSettingsDescriptions.email[3],numEmails=++d}});const buttons=document.getElementById("db_settings_add_buttons").getElementsByTagName("a"),dbButtonPressed=e=>{let t=e.target.id;switch(t){case"db_settings_add_phone":dbAddPhone();break;case"db_settings_add_whatsapp":dbAddWhatsapp();break;case"db_settings_add_telegram":dbAddTelegram();break;case"db_settings_add_email":dbAddEmail()}};for(let button of buttons)button.addEventListener("click",dbButtonPressed);function dbAddPhone(){let e=numPhones,t=document.getElementById("phone_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","phone_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.phone[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="phone_'+e+'" id="db_settings_phone_'+e+'" size="20" value="" /></td><td>[db-phone'+(e+1)+']</td><td id="phone_'+e+'_1_description">'+dbSettingsDescriptions.phone[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let i=document.getElementById("phone_"+e+"_1"),d=document.createElement("tr");d.setAttribute("id","phone_"+e+"_2"),d.style.verticalAlign="top",d.innerHTML="<td>[db-phone"+(e+1)+'-link]</td><td id="phone_'+e+'_2_description">'+dbSettingsDescriptions.phone[2]+"</td><td></td>",i.parentNode.insertBefore(d,i.nextSibling);let a=document.getElementById("phone_"+e+"_2"),l=document.createElement("tr");l.setAttribute("id","phone_"+e+"_3"),l.style.verticalAlign="top",l.innerHTML="<td>[db-phone"+(e+1)+'-href]</td><td id="phone_'+e+'_3_description">'+dbSettingsDescriptions.phone[3]+"</td><td></td>",a.parentNode.insertBefore(l,a.nextSibling),numPhones++}function dbAddWhatsapp(){let e=numWhatsapps,t=document.getElementById("whatsapp_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","whatsapp_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.whatsapp[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="whatsapp_'+e+'" id="db_settings_whatsapp_'+e+'" size="20" value="" /></td><td>[db-whatsapp'+(e+1)+']</td><td id="whatsapp_'+e+'_1_description">'+dbSettingsDescriptions.whatsapp[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let i=document.getElementById("whatsapp_"+e+"_1"),d=document.createElement("tr");d.setAttribute("id","whatsapp_"+e+"_2"),d.style.verticalAlign="top",d.innerHTML="<td>[db-whatsapp"+(e+1)+'-link]</td><td id="whatsapp_'+e+'_2_description">'+dbSettingsDescriptions.whatsapp[2]+"</td><td></td>",i.parentNode.insertBefore(d,i.nextSibling);let a=document.getElementById("whatsapp_"+e+"_2"),l=document.createElement("tr");l.setAttribute("id","whatsapp_"+e+"_3"),l.style.verticalAlign="top",l.innerHTML="<td>[db-whatsapp"+(e+1)+'-href]</td><td id="whatsapp_'+e+'_3_description">'+dbSettingsDescriptions.whatsapp[3]+"</td><td></td>",a.parentNode.insertBefore(l,a.nextSibling),numWhatsapps++}function dbAddTelegram(){let e=numTelegram,t=document.getElementById("telegram_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","telegram_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.telegram[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="telegram_'+e+'" id="db_settings_telegram_'+e+'" size="20" value="" /></td><td>[db-telegram'+(e+1)+']</td><td id="telegram_'+e+'_1_description">'+dbSettingsDescriptions.telegram[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let i=document.getElementById("telegram_"+e+"_1"),d=document.createElement("tr");d.setAttribute("id","telegram_"+e+"_2"),d.style.verticalAlign="top",d.innerHTML="<td>[db-telegram"+(e+1)+'-link]</td><td id="telegram_'+e+'_2_description">'+dbSettingsDescriptions.telegram[2]+"</td><td></td>",i.parentNode.insertBefore(d,i.nextSibling);let a=document.getElementById("telegram_"+e+"_2"),l=document.createElement("tr");l.setAttribute("id","telegram_"+e+"_3"),l.style.verticalAlign="top",l.innerHTML="<td>[db-telegram"+(e+1)+'-href]</td><td id="telegram_'+e+'_3_description">'+dbSettingsDescriptions.telegram[3]+"</td><td></td>",a.parentNode.insertBefore(l,a.nextSibling),numTelegram++}function dbAddEmail(){let e=numEmails,t=document.getElementById("email_"+(e-1)+"_3"),n=document.createElement("tr");n.setAttribute("id","email_"+e+"_1"),n.style.verticalAlign="top",n.innerHTML='<th scope="row" rowspan="3">'+dbSettingsDescriptions.email[0]+" "+(e+1)+'</th><td rowspan="3"><input type="text" name="email_'+e+'" id="db_settings_email_'+e+'" size="20" value="" /></td><td>[db-email'+(e+1)+']</td><td id="email_'+e+'_1_description">'+dbSettingsDescriptions.email[1]+"</td><td></td>",t.parentNode.insertBefore(n,t.nextSibling);let i=document.getElementById("email_"+e+"_1"),d=document.createElement("tr");d.setAttribute("id","email_"+e+"_2"),d.style.verticalAlign="top",d.innerHTML="<td>[db-email"+(e+1)+'-link]</td><td id="email_'+e+'_2_description">'+dbSettingsDescriptions.email[2]+"</td><td></td>",i.parentNode.insertBefore(d,i.nextSibling);let a=document.getElementById("email_"+e+"_2"),l=document.createElement("tr");l.setAttribute("id","email_"+e+"_3"),l.style.verticalAlign="top",l.innerHTML="<td>[db-email"+(e+1)+'-href]</td><td id="email_'+e+'_3_description">'+dbSettingsDescriptions.email[3]+"</td><td></td>",a.parentNode.insertBefore(l,a.nextSibling),numEmails++}jQuery(document).ready(function(e){let t={phone:{protocol:"tel:",link:"",reg:/[^+\d]/g},whatsapp:{protocol:"",link:"https://wa.me/",reg:/\D/g},telegram:{protocol:"",link:"https://t.me/",hashtag:"@"},email:{protocol:"mailto:",link:""}};e(document).on("input",'input[id^="db_settings_"]',function(){let n=e(this).attr("id"),i=n.split("_")[2];if(t[i]){let d=n.split("_").pop(),a=e(this).val(),l=t[i].reg?a.replace(t[i].reg,""):a;a=t[i].hashtag?t[i].hashtag+a:a;let r='<span class="db-wcs-contact db-wcs-contact-'+i+" db-wcs-contact-"+i+"-"+d+'">'+a+"</span>",s='<a href="'+t[i].protocol+t[i].link+l+'" class="db-wcs-contact db-wcs-contact-'+i+" db-wcs-contact-"+i+"-"+d+'">'+a+"</a>",p=t[i].link+l;e("#"+i+"_"+d+"_1 td:last-child").html(r),e("#"+i+"_"+d+"_2 td:last-child").html(s),e("#"+i+"_"+d+"_3 td:last-child").html(p)}})}); -
db-website-settings/trunk/readme.txt
r3222529 r3237005 5 5 Requires at least: 4.6 6 6 Tested up to: 6.7 7 Stable tag: 2. 97 Stable tag: 2.10 8 8 License: GPL2 9 9 … … 67 67 == Changelog == 68 68 69 = 2.10 = 70 * Feature: Add script to dynamically change shortcode preview in admin panel. 71 * Fix: Change the protocol of the Telegram link from tg:// to https:// and set the corresponding format. 72 * Fix: Reload page right after saving the data to display the new data while using the shortcodes. 73 69 74 = 2.9 = 70 75 * The plugin name is changed from 'DB Website Settings' to 'DB Edit All Contacts on 1 Settings Page'
Note: See TracChangeset
for help on using the changeset viewer.