From ccdae4091366f6b1891c4c00418436891ba967d8 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 10 Dec 2014 13:33:17 +1100 Subject: [PATCH] show ungrouped emojis in tab, remove a few aliases (I dislike :shit: and :squirrel: made no sense) TODO: stop using symlinks for aliases --- .../emoji/assets/javascripts/emoji-toolbar.js | 26 +++++++++++++++++- plugins/emoji/assets/javascripts/emoji.js.erb | 8 ++++++ plugins/emoji/public/images/shit.png | 1 - plugins/emoji/public/images/squirrel.png | Bin 9351 -> 0 bytes plugins/emoji/public/images/uk.png | 1 - 5 files changed, 33 insertions(+), 3 deletions(-) delete mode 120000 plugins/emoji/public/images/shit.png delete mode 100755 plugins/emoji/public/images/squirrel.png delete mode 120000 plugins/emoji/public/images/uk.png diff --git a/plugins/emoji/assets/javascripts/emoji-toolbar.js b/plugins/emoji/assets/javascripts/emoji-toolbar.js index 3e0b624ce..1e3f3118d 100644 --- a/plugins/emoji/assets/javascripts/emoji-toolbar.js +++ b/plugins/emoji/assets/javascripts/emoji-toolbar.js @@ -40,7 +40,32 @@ var closeSelector = function(){ $('body, textarea').off('keydown.emoji'); }; +var ungroupedIcons; + var toolbar = function(selected){ + + if(!ungroupedIcons){ + ungroupedIcons = []; + var groupedIcons = {}; + + _.each(groups, function(group){ + _.each(group.icons, function(icon){ + groupedIcons[icon] = true; + }); + }); + + var emojis = Discourse.Emoji.list(); + _.each(emojis,function(emoji){ + if(groupedIcons[emoji] !== true){ + ungroupedIcons.push(emoji); + } + }); + + if(ungroupedIcons.length > 0){ + groups.push({name: 'ungrouped', icons: ungroupedIcons}); + } + } + return _.map(groups, function(g, i){ var row = {src: Discourse.Emoji.urlFor(g.icons[0]), groupId: i}; if(i===selected){ @@ -84,7 +109,6 @@ var bindEvents = function(page,offset){ }); }; - var render = function(page, offset){ var rows = []; var row = []; diff --git a/plugins/emoji/assets/javascripts/emoji.js.erb b/plugins/emoji/assets/javascripts/emoji.js.erb index 4e4fa6f9f..69fd5e34a 100644 --- a/plugins/emoji/assets/javascripts/emoji.js.erb +++ b/plugins/emoji/assets/javascripts/emoji.js.erb @@ -10,6 +10,14 @@ Discourse.Dialect.registerEmoji = function(code, url) { _extendedEmoji[code] = url; }; +Discourse.Emoji.list = function(){ + var copy = emoji.slice(0); + _.each(_extendedEmoji, function(v,k){ + copy.push(k); + }); + return copy; +}; + var toSearch; var search = function(term, options) { diff --git a/plugins/emoji/public/images/shit.png b/plugins/emoji/public/images/shit.png deleted file mode 120000 index c8c5a772b..000000000 --- a/plugins/emoji/public/images/shit.png +++ /dev/null @@ -1 +0,0 @@ -unicode/1f4a9.png \ No newline at end of file diff --git a/plugins/emoji/public/images/squirrel.png b/plugins/emoji/public/images/squirrel.png deleted file mode 100755 index a58a47f62f9ec4d8dba2ec2ff443ab984597d9ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9351 zcmV;2BzW72P)002t}1^@s6I8J)%001OTNklN-CAo7upZDTU;uZ$|ANxKg3T;t76q}ey}XG zr4(H@>b97r;1;_5QpA>0N?DhF2qq!vOO(cR!X(j}mq|J=_ujep&h`9H=FA)~W+_Y8 znL-adoXa_LF6aF2|9Q@H&M21Uyrk>uS43pfgR-1y%>JZ!o~PX%s0Y9T4?x|u*}*CT zP_A6L(mFai@~~l;O_pVaa%Mj0x-O~Ey%u&Ag$iwL4=uL0cl@+<>((EM$f+i+s=zvX z_H5VC(9n*FiCeEETAR9y#UcTc=Xsw7$v8h>GCc5YohpKq#*gl7|p#AGbq zVE+8`?ZnLOndbtk@=SAcGciz<%jGDYPE&n-9idKWRxPJYP%zXvx^y$-jGI{g0k*ilf!=f4+8~LJa+a{Dkp}<@!h()6vAW&oRFxFoY z2tbHh7(ivSS?-c`b#)xFWm&ZPiPaykeRksqn>TMZYaNyVr4A1dylYzKL8c}E67D0^ z0U*n|7>vjz6hJ|nzhp8Q^a%sBGJIWA-~8yKqkp?E0(>f!+-_RNK|m@Nv1qTP4uAjv z1#J>2l1=Utijsi|HP zfL2x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