Skip to content

Commit

Permalink
Merge pull request #38 from BhargavBhandari90/mention-by-name
Browse files Browse the repository at this point in the history
Update to v1.7.13
  • Loading branch information
BhargavBhandari90 authored Nov 3, 2024
2 parents 088799c + 94252bf commit dfeac36
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** comments, mention, email, user, bbpress
**Requires at least:** 4.6
**Tested up to:** 6.6.2
**Stable tag:** 1.7.12
**Stable tag:** 1.7.13
**Requires PHP:** 5.6
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -31,7 +31,7 @@ https://www.youtube.com/watch?v=Nz47aKJhsKQ
* Search by Display name while mention.
* Enable mentioning on Page comment.
* Added option to Turn off Email notification.
* Mention by First Name & Last Name.
* Mention by First Name & Last Name ( Under development... ).
* Go to wp-admin –> Comment Mention
* And you will see options to enable pro features https://prnt.sc/r5W2X4utYe3v

Expand Down Expand Up @@ -63,6 +63,9 @@ e.g.

## Changelog ##

### 1.7.13 ###
* Mention script improvisation for pro plugin.

### 1.7.12 ###
* Mention script improvisation.

Expand Down
4 changes: 2 additions & 2 deletions comment-mention.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author URI: https://bhargavb.com
* Text Domain: comment-mention
* Domain Path: /languages
* Version: 1.7.12
* Version: 1.7.13
*
* @package Comment_Mention
*/
Expand All @@ -21,7 +21,7 @@
/**
* The version of the plugin.
*/
define( 'CMT_MNTN_VERSION', '1.7.12' );
define( 'CMT_MNTN_VERSION', '1.7.13' );
}
if ( ! defined( 'CMT_MNTN_PATH' ) ) {
/**
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BnB90/50
Tags: comments, mention, email, user, bbpress
Requires at least: 4.6
Tested up to: 6.6.2
Stable tag: 1.7.12
Stable tag: 1.7.13
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -31,7 +31,7 @@ https://www.youtube.com/watch?v=Nz47aKJhsKQ
* Search by Display name while mention.
* Enable mentioning on Page comment.
* Added option to Turn off Email notification.
* Mention by First Name & Last Name.
* Mention by First Name & Last Name ( Under development... ).
* Go to wp-admin –> Comment Mention
* And you will see options to enable pro features https://prnt.sc/r5W2X4utYe3v

Expand Down Expand Up @@ -63,6 +63,9 @@ e.g.

== Changelog ==

= 1.7.13 =
* Mention script improvisation for pro plugin.

= 1.7.12 =
* Mention script improvisation.

Expand Down
10 changes: 9 additions & 1 deletion src/js/tribute-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ jQuery(

let content = $( '#comment' ).val();

let already_mentioned = localStorage.getItem('mentionMap');

if ( '' !== already_mentioned ) {
already_mentioned = JSON.parse(already_mentioned);
$.each(already_mentioned, function(key, value) {
mentionMap[key] = value;
});
}

Object.keys( mentionMap ).forEach(
name => {

const nameMention = '@' + mentionMap[name]; // Mention format in textarea1 (name)
const usernameMention = '@' + name; // Mention format in textarea2 (username)
content = content.split( nameMention ).join( usernameMention );
Expand Down

0 comments on commit dfeac36

Please sign in to comment.