Skip to content

Commit

Permalink
feat: Switch out js-emoji for habtiica-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
crookedneighbor committed Apr 26, 2016
1 parent b86348d commit e731525
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 18 deletions.
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@
"jquery-colorbox": "1.4.36",
"jquery-ui": "1.10.3",
"jquery.cookie": "1.4.0",
"js-emoji": "snicker/js-emoji#f25d8a303f",
"ngInfiniteScroll": "1.0.0",
"pnotify": "1.3.1",
"sticky": "*",
"swagger-ui": "wordnik/swagger-ui#v2.0.24",
"habitica-markdown": "^1.0.0"
"habitica-markdown": "habitrpg/habitica-markdown#emoji"
},
"devDependencies": {
"angular-mocks": "1.3.9"
Expand Down
4 changes: 0 additions & 4 deletions common/script/public/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
var md = function () {
var mdown = window.habiticaMarkdown;

emoji.img_path = 'common/img/emoji/unicode/';

var toHtml = function (markdown) {
if (markdown == undefined)
return '';

markdown = mdown.render(markdown);
markdown = emoji.replace_colons(markdown);
markdown = emoji.replace_unified(markdown);

return markdown;
};
Expand Down
1 change: 0 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = function karmaConfig (config) {
'website/public/bower_components/select2/select2.js',
'website/public/bower_components/angular-ui-select2/src/select2.js',
'website/public/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
'website/public/bower_components/js-emoji/emoji.js',
'common/dist/scripts/habitrpg-shared.js',

'test/spec/mocks/**/*.js',
Expand Down
2 changes: 1 addition & 1 deletion test/spec/services/notificationServicesSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('notificationServices', function() {

expect($.pnotify).to.have.been.calledOnce;
expect(arg.type).to.eql('info');
expect(arg.text).to.eql('<p><span class="emoji" style="background-image:url(common/img/emoji/unicode/1f604.png)">:smile:</span> - task name</p>\n');
expect(arg.text).to.eql('<p><img class="habitica-emoji" style="height: 1.5em; width: 1.5em" src="https://s3.amazonaws.com/habitica-assets/cdn/emoji/smile.png" alt="smile"> - task name</p>\n');
expect(arg.icon).to.eql(false);
});

Expand Down
3 changes: 1 addition & 2 deletions website/public/css/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Import only styles that do not have urls to images! Include them directly in the page!
@import "../bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css"
@import "../bower_components/angular-loading-bar/build/loading-bar.css"
@import "../bower_components/js-emoji/emoji.css"
@import "../bower_components/select2/select2.css"

// Custom includes
Expand Down Expand Up @@ -201,5 +200,5 @@ a.label
*
image-rendering: pixelated

.img-rendering-auto, .img-rendering-auto *, .emoji
.img-rendering-auto, .img-rendering-auto *, .habitica-emoji
image-rendering: auto
6 changes: 0 additions & 6 deletions website/public/css/tasks.styl
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ for $stage in $stages
markdown > ul > li // Otherwise, + gets turned into a bullet and gets masked by buttons
margin-left:20px

span.emoji
width:1.5em
height:1.5em
background-size:1.5em
vertical-align: middle

// when a task is being dragged
.task.ui-sortable-helper
box-shadow: 0 0 3px rgba(0,0,0,0.15), 0 0 5px rgba(0,0,0,0.1)
Expand Down
1 change: 0 additions & 1 deletion website/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"bower_components/angular-loading-bar/build/loading-bar.js",
"bower_components/Angular-At-Directive/src/at.js",
"bower_components/Angular-At-Directive/src/caret.js",
"bower_components/js-emoji/emoji.js",
"bower_components/sticky/jquery.sticky.js",
"bower_components/ngInfiniteScroll/build/ng-infinite-scroll.min.js",
"bower_components/select2/select2.js",
Expand Down
1 change: 0 additions & 1 deletion website/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
oldApp.use(passport.session());

var maxAge = isProd ? 31536000000 : 0;
// Cache emojis without copying them to build, they are too many
oldApp.use(express['static'](path.join(__dirname, "/../build"), { maxAge: maxAge }));
oldApp.use('/common/dist', express['static'](publicDir + "/../../common/dist", { maxAge: maxAge }));
oldApp.use('/common/audio', express['static'](publicDir + "/../../common/audio", { maxAge: maxAge }));
Expand Down

0 comments on commit e731525

Please sign in to comment.