Skip to content
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

New emojis + update emoji keywords + different emoji categories + updated pot + update it language + new icons #57

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,901 changes: 1,648 additions & 253 deletions emojisCharacters.js

Large diffs are not rendered by default.

2,803 changes: 1,358 additions & 1,445 deletions emojisKeywords.js

Large diffs are not rendered by default.

54 changes: 28 additions & 26 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,26 +279,26 @@ const SkinTonesBar = new Lang.Class({
reactive: true,
can_focus: true,
track_hover: true,
width: 20,
width: 32,
accessible_name: _("Men"),
style: 'background-color: black;',
style: 'UnselectedGender',
label: '♀',
});
this._genderArray[2] = new St.Button({
reactive: true,
can_focus: true,
track_hover: true,
width: 20,
width: 32,
accessible_name: _("Women"),
style: 'background-color: black;',
style_class: 'UnselectedGender',
label: '♂',
});

this._genderArray[1].connect('clicked', Lang.bind(this, function(w){

if (SETTINGS.get_int('gender') != 1) {
this.clearGender();
w.style = 'background-color: blue;';
w.style_class = 'SelectedGender';
SETTINGS.set_int('gender', 1);
} else {
this.clearGender();
Expand All @@ -308,7 +308,7 @@ const SkinTonesBar = new Lang.Class({

if (SETTINGS.get_int('gender') != 2) {
this.clearGender();
w.style = 'background-color: blue;';
w.style_class = 'SelectedGender';
SETTINGS.set_int('gender', 2);
} else {
this.clearGender();
Expand All @@ -321,7 +321,7 @@ const SkinTonesBar = new Lang.Class({
clearGender: function() {
SETTINGS.set_int('gender', 0);
this._genderArray.forEach(function(b) {
b.style = 'background-color: black;';
b.style_class = 'UnselectedGender';
});
},

Expand All @@ -344,10 +344,10 @@ const SkinTonesBar = new Lang.Class({
this.removeCircle();
this._toneArray[SETTINGS.get_int('skin-tone')].style_class = 'SelectedTone';
this._genderArray.forEach(function(b) {
b.style = 'background-color: black;';
b.style_class = 'UnselectedGender';
});
if (this._genderArray.length != 0) {
this._genderArray[SETTINGS.get_int('gender')].style = 'background-color: blue;';
this._genderArray[SETTINGS.get_int('gender')].style_class = 'SelectedGender';
}
},

Expand All @@ -356,7 +356,7 @@ const SkinTonesBar = new Lang.Class({
reactive: true,
can_focus: true,
track_hover: true,
width: 20,
width: 32,
accessible_name: accessibleName,
style_class: 'UnselectedTone',
style: 'background-color: ' + color + ';',
Expand Down Expand Up @@ -388,14 +388,15 @@ const EmojiCategory = new Lang.Class({
this._triangleBin.visible = false;

// A bar is created for all categories to simplify the update method
if ((this.id == 1) || (this.id == 5)) {
// People Activities
if ((this.id == 2) || (this.id == 7)) {
this.skinTonesBar = new SkinTonesBar(true);
} else {
this.skinTonesBar = new SkinTonesBar(false);
}

// Smileys & body Peoples Activities
if ((this.id == 0) || (this.id == 1) || (this.id == 5)) {
// Smileys Body People Activities
if ((this.id == 0) || (this.id == 1) || (this.id == 2) || (this.id == 7)) {
this.skinTonesBar.addBar(this.actor);
}

Expand Down Expand Up @@ -508,7 +509,6 @@ const EmojiCategory = new Lang.Class({
this.build();
}
this.skinTonesBar.update();

this.categoryButton.style = 'background-color: rgba(0,0,200,0.2);';
this.actor.visible = true;
this.setSubmenuShown(true);
Expand Down Expand Up @@ -730,19 +730,21 @@ const EmojisMenu = new Lang.Class({
this.emojiCategories = [];

/* creating new categories with emojis loaded in EMOJIS_CHARACTERS */
this.emojiCategories[0] = new EmojiCategory( _('Smileys & Body'), 'face-smile-symbolic', 0 );
this.emojiCategories[1] = new EmojiCategory( _('Peoples & Clothing'), 'contact-new-symbolic', 1 );
this.emojiCategories[2] = new EmojiCategory( _('Animals & Nature'), 'face-monkey-symbolic', 2 );
this.emojiCategories[3] = new EmojiCategory( _('Food & Drink'), 'my-caffeine-on-symbolic', 3 );
this.emojiCategories[4] = new EmojiCategory( _('Travel & Places'), 'airplane-mode-symbolic', 4 );
this.emojiCategories[5] = new EmojiCategory( _('Activities & Sports'), 'applications-games-symbolic', 5 );
this.emojiCategories[6] = new EmojiCategory( _('Objects'), 'alarm-symbolic', 6 );
this.emojiCategories[7] = new EmojiCategory( _('Symbols'), 'emblem-default-symbolic', 7 );
this.emojiCategories[8] = new EmojiCategory( _('Flags'), 'flag-symbolic', 8 );
this.emojiCategories[0] = new EmojiCategory( _('Smileys'), 'face-smile-symbolic', 0);
this.emojiCategories[1] = new EmojiCategory( _('Body'), 'preferences-system-privacy-symbolic', 1);
this.emojiCategories[2] = new EmojiCategory( _('People'), 'avatar-default-symbolic', 2);
this.emojiCategories[3] = new EmojiCategory( _('Animals'), 'face-monkey-symbolic', 3);
this.emojiCategories[4] = new EmojiCategory( _('Nature'), 'preferences-desktop-screensaver-symbolic', 4);
this.emojiCategories[5] = new EmojiCategory( _('Food & Drink'), 'my-caffeine-on-symbolic', 5);
this.emojiCategories[6] = new EmojiCategory( _('Travel & Places'), 'airplane-mode-symbolic', 6);
this.emojiCategories[7] = new EmojiCategory( _('Activities & Sports'), 'emoji-activities-symbolic', 7);
this.emojiCategories[8] = new EmojiCategory( _('Objects'), 'alarm-symbolic', 8);
this.emojiCategories[9] = new EmojiCategory( _('Symbols'), 'emblem-default-symbolic', 9);
this.emojiCategories[10] = new EmojiCategory( _('Flags'), 'flag-symbolic', 10);
},

_addAllCategories: function() {
for (let i = 0; i< 9; i++) {
for (let i = 0; i< 11; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe < this.emojiCategories.length (or even a forEach, for this case) would be more appropriate here (so in the future people don't need to worry about modifying this. The same goes for line 758 below.
I'm new to the project though, I don't know if there is any limitation to do this.

this.menu.addMenuItem(this.emojiCategories[i]);
}
},
Expand All @@ -753,14 +755,14 @@ const EmojisMenu = new Lang.Class({
can_focus: false
});
this.categoryButton = [];
for (let i = 0; i< 9; i++) {
for (let i = 0; i< 11; i++) {
this._buttonMenuItem.actor.add(this.emojiCategories[i].getButton(), { expand: true, x_fill: false });
}
},

clearCategories: function(){
// removing the blue color of previously opened category's button
for (let i = 0; i< 9; i++) {
for (let i = 0; i< 11; i++) {
this.emojiCategories[i].getButton().style = 'background-color: transparent;';
}

Expand Down
3 changes: 3 additions & 0 deletions icons/emoji-activities-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/emoji-nature-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 6 additions & 90 deletions icons/flag-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading