NerosTie / emojione

Add colorful emojis to your Shaarli (deprecated, use https://github.com/NerosTie/twemoji instead)
https://github.com/shaarli/Shaarli
MIT License
4 stars 3 forks source link

Next enhancement ? #2

Closed alexisju closed 8 years ago

alexisju commented 8 years ago

Maybe you need to add some CSS (to the object class .emojione): no problem to have unicode emoji (ie 🌴) converted into image (🌴), but if you use shortname (ie :palm_tree:), the emoji converted is very big (100% svg size).

Do you plan already some enhancements, like :

[Copy/pasted feedback from https://github.com/shaarli/Shaarli/issues/545#issuecomment-214775453 )

NerosTie commented 8 years ago

The issue with shortname is fixed, can you try?

alexisju commented 8 years ago

Right! Fixed :-)

NerosTie commented 8 years ago

ASCII conversion works. Can you try? But be aware, you can't have a smiley alone on a line.

To activate it, change false to true in emojione.js

alexisju commented 8 years ago

It work (but in dont understand your warning).

NerosTie commented 8 years ago

If you put a smiley alone, like this:

:)

It will not be converted.

alexisju commented 8 years ago

On my instance, both works

NerosTie commented 8 years ago

Not me, weird...

The autocomplete.js is huge! 250 Ko :worried:

alexisju commented 8 years ago

Maybe it is better to not include it into this plugin (for people like you using browser plugin), but create another plugin to load if people need it? (or make a custom version with less autocomplete sugestion) ?

You can also simple add in the readme some exemple to Firefox/Chrome addons...

NerosTie commented 8 years ago

It works! And I like it. Even on a smartphone, it's pretty cool.

But unfortunately, this is big! The autocomplete.js itself is big but you also need 2 external jquery javascripts as dependencies...

385 Ko for the all thing.

Also, it works only in the Description area. It could be nice to have it in the Tags area too.

Is it worth it to have a separate plugin? Or just one plugin but I comment the whole thing about autocomplete?

alexisju commented 8 years ago

Minified version of js can reduce size and improve loading time ?

alexisju commented 8 years ago

It seems autocomplete could also work with zepto.js (9 ko) instead jquery.

and jquery.textcomplete.min.js 18.4 KB

Minified version of autocomplete is around 230 ko

NerosTie commented 8 years ago

And around 50 Ko if gzipped (with closure)

Do you think it's better to have everything self-hosted? Or is it ok to call them from the outside?

alexisju commented 8 years ago

Personnaly i prefer to have all librairies self-hosted. It is not a performance matter but about privacy and tracking.

NerosTie commented 8 years ago

Well, it works even without jquery. So we can delete it.

So now the question is: 230ko, is it too big for this plugin?

alexisju commented 8 years ago

I don't know, i think it is not too much (if loadded in footer). The scripts just need to be loaded once, after the browser keep it in the cache.

NerosTie commented 8 years ago

Ok, let's try then. I will self-host emojione.min.js too (188ko). Gzipped, it should be ok. If people complain I will see. The only thin that I can't self-host are the svg and the png, this is way too big.

But I will comment the autocomplete, because maybe not everybody will like it.

Also, can you tell me what happen if you put a shortname as a tag?

alexisju commented 8 years ago

(By self hosting, i mean to included into this repository; each shaarli instance is self hosted)

NerosTie commented 8 years ago

Yes, this is my definition of self-hosting too.

NerosTie commented 8 years ago

New version is out!

Don't forget to edit emojione.php and js/emojione.js to activate all the functions.

Tell me what you think and can you tell me what happen if you put a shortname as a tag?

alexisju commented 8 years ago

Broken!

You need to put emojione.min.js before emojione.js to render emojis

I don't get autocomplete

Bonus: .dropdown-menu css alterate my shaarli's template (albinomouse). They use the same class' name.

NerosTie commented 8 years ago

Not broken anymore :wink:

NerosTie commented 8 years ago

For .dropdown-menu, I have to edit autocomplete.css and textcomplete.min.js. I don't like this idea for future updates (they are unmodified versions of the originals).

alexisju commented 8 years ago

Ok, not broken anymore, but autocomplete still not working.

NerosTie commented 8 years ago

It works for me. But I have jquery with my theme. Maybe it doesn't work with zepto.js.

Can you comment the line with zepto.js in emojione.php and add this instead: $data['js_files'][] = 'https://code.jquery.com/jquery-2.2.3.min.js';

And tell me if it works.

alexisju commented 8 years ago

I just tryed, but it didnt work.

However, in same time i have weird things. The plugin seems no work anymore on my instance..

I don't understand why. I cleared the tmp files.. and tryed on another test instance.. without better result.

NerosTie commented 8 years ago

You say it works with jquery but in the same time the plugin do no work anymore? I don't understand.

alexisju commented 8 years ago

Sorry it didnt.

alexisju commented 8 years ago

Ok i know why. I desactivated markdown plugin.

NerosTie commented 8 years ago

Well, autocomplete do not work with the default theme either... (I'm using the material theme)

alexisju commented 8 years ago

(i'm doing my test with default template ;) )

NerosTie commented 8 years ago

Ha! That's why! Unfortunately, I have no solution in mind :disappointed:

alexisju commented 8 years ago

Using awesomplete (shaarli's autocomplete js for tags) ?

NerosTie commented 8 years ago

I don't understand your question.

alexisju commented 8 years ago

Awesomplete (http://leaverou.github.io/awesomplete/) is the js library used by shaarli to suggest (and autocomplete) tags. Maybe it could be used also the the emoji's shortcode list ?

NerosTie commented 8 years ago

It would be more complicated to implement it, I think. Autocomplete seems to be more powerful for emojis than awesomplete would be. With autocomplete, you can search :food which is not an emoji but a tag for a family of emojis.

But there are other bugs: https://github.com/NerosTie/emojione/issues

alexisju commented 8 years ago

Ok, for now i can use browser addon :-) Its fine too

NerosTie commented 8 years ago

What do you call "browser addon"?

alexisju commented 8 years ago

However, if autocomplete is broken with defaut shaarli, maybe it is better to have a "clean" plugin which just enable emoji (and another plugin to enable autocomplete in your theme).

At least comment also $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/emojione/css/autocomplete.css'; by defaut

Browser addon: Firefox/Chrome extension

alexisju commented 8 years ago

Another thing, if you fix autocomplete : maybe it is better if the autocomplete can insert unicode emoji (not shortcode), it will fit better in RSS or if we disable the plugin.

NerosTie commented 8 years ago

Ok, for now i can use browser addon :-) Its fine too

Autocomplete do not work with the theme you use but it works with the browser addon? The extension on chrome is basically a page in html.

maybe it is better to have a "clean" plugin which just enable emoji (and another plugin to enable autocomplete in your theme).

It's not supposed to be broken forever :wink:. I will let the autocomplete and ASCII Smiley commented for now. To have them in option it's a good solution, I think.

Another thing, if you fix autocomplete : maybe it is better if the autocomplete can insert unicode emoji (not shortcode), it will fit better in RSS or if we disable the plugin.

Autocomplete is based on shortnames, so I don't think it will be easy to change it. But I agree, for RSS it would be better. That's why I'm reticent to use shortnames for now. (but a good RSS aggregator could have an addon for emojione too :smile: )

alexisju commented 8 years ago

Autocomplete do not work with the theme you use but it works with the browser addon?

This extension work very well : http://johannh.me/emoji-helper/

NerosTie commented 8 years ago

Use this: https://chrome.google.com/webstore/detail/emoji-keyboard-2016-by-em/ipdjnhgkpapgippgcgkfcbpdpcgifncb

This is better, and it's the official plugin for emojione :)

NerosTie commented 8 years ago

I'm closing this issue. The bug is fixed and all the enhancements are implemented even if some work is needed to have a full compatibility with the most famous themes. Feel free to open a new thread but only for specifics issues, please.