-
Notifications
You must be signed in to change notification settings - Fork 906
Emoji Replacer Widget #2590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SapphicFire
merged 8 commits into
ServiceNowDevProgram:main
from
NayeemKaka:hacktoberfest2025-emoji-widget
Oct 28, 2025
Merged
Emoji Replacer Widget #2590
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0beb0d1
Create README.md
NayeemKaka 9278906
Create HTML.html
NayeemKaka fab356e
Create CSS-SCSS.css
NayeemKaka d63616d
Create Client Script.cs
NayeemKaka 89122d2
Update README.md
NayeemKaka 009a22e
Update README.md
NayeemKaka 9d8c526
Add files via upload
NayeemKaka 73aa654
Merge branch 'main' into hacktoberfest2025-emoji-widget
NayeemKaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
Modern Development/Service Portal Widgets/Emoji Replacer Widget/CSS-SCSS.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .card{ | ||
| max-width:600px; | ||
| margin: auto; | ||
| box-shadow: 0 2px 6px rgba(0,0,0,0.1); | ||
| border-radius: 12px; | ||
| } | ||
| textarea{ | ||
| resize: none; | ||
| } |
25 changes: 25 additions & 0 deletions
25
Modern Development/Service Portal Widgets/Emoji Replacer Widget/Client Script.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| api.controller=function($scope,$sce) { | ||
| /* widget controller */ | ||
| var c = this; | ||
|
|
||
| c.emojiMap ={ | ||
| ':smile:' :'😊', | ||
| ':sad:':'😓', | ||
| ":heart:":'❤️', | ||
| ":thumbsup:":'👍', | ||
| ":laugh:":"😀", | ||
| ":wink:":"😉", | ||
| ":clap:":"👏", | ||
| ":party:" :"🥳" | ||
| }; | ||
|
|
||
| c.replaceEmojis = function(){ | ||
| var text = $scope.data.inputText || ''; | ||
|
|
||
| for(var key in c.emojiMap){ | ||
| var regex = new RegExp(key.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1"),'g'); | ||
| text = text.replace(regex,c.emojiMap[key]); | ||
| } | ||
| c.outputText= $sce.trustAsHtml(text); | ||
| } | ||
| }; | ||
18 changes: 18 additions & 0 deletions
18
Modern Development/Service Portal Widgets/Emoji Replacer Widget/HTML.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <div class="card p-3"> | ||
| <h4>😊 | ||
| Emoji Replacer | ||
| </h4> | ||
| <p class="text-muted"> | ||
| Type something using emoji shortcuts like <code>:smile:</code>,<code>:heart:</code>, or<code>:thumbsup:</code> | ||
| </p> | ||
| <textarea class="form-control" rows="4" ng-model="data.inputText" ng-change="c.replaceEmojis()" | ||
| placeholder="Type your message here..."></textarea> | ||
| <div class ="mt-3"> | ||
| <h5> | ||
| Ouput Preview: | ||
| </h5> | ||
| <div class="p-2 border rounded bg-light" ng-bind-html="c.outputText"> | ||
|
|
||
| </div> | ||
| </div> | ||
| </div> |
22 changes: 22 additions & 0 deletions
22
Modern Development/Service Portal Widgets/Emoji Replacer Widget/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ## Emoji Replacer Widget | ||
|
|
||
| This widget enhances the user experience by automatically converting emojis code into visual emojis while typing - adding personality and clarity to text communication. | ||
| ## How It works | ||
| - User types in a text box: | ||
| - "Great job team!:tada::thumbsup:" | ||
| - Script will detects matching emoji code using regex. | ||
| - The widget replaces them with real emojis: | ||
| - "Great job team!🎉👍 | ||
| ## Available Emoji in Widget | ||
| ":smile:" :😊, | ||
| ":sad:":😓, | ||
| ":heart:":❤️, | ||
| ":thumbsup:":👍, | ||
| ":laugh:":😀, | ||
| ":wink:":😉, | ||
| ":clap:":👏, | ||
| ":party:":🥳, | ||
| ":tada:":🎉 | ||
| ## Output | ||
|
|
||
|
|
Binary file added
BIN
+18.2 KB
Modern Development/Service Portal Widgets/Emoji Replacer Widget/emoji.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of
$sce.trustAsHtml()gives explicit trust to the input and makes this widget vulnerable - using the below input will allow XSS:<script>alert("XSS");</script>. I'll create an issue and quickly resolve this in a follow up