From d38daf2f342d23b56f6d896b58a6cf2fc579973d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imm=C3=A1nuel!?= <21174107+immanuelfodor@users.noreply.github.com> Date: Sun, 30 Aug 2020 11:50:08 +0200 Subject: [PATCH 1/5] Compatibility with latest Shaarli 0.12.0-beta --- emojione.php | 59 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/emojione.php b/emojione.php index 1a19892..4eac238 100644 --- a/emojione.php +++ b/emojione.php @@ -1,9 +1,52 @@ Date: Sun, 30 Aug 2020 12:00:23 +0200 Subject: [PATCH 2/5] Fix missing router call --- emojione.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emojione.php b/emojione.php index 4eac238..95f2847 100644 --- a/emojione.php +++ b/emojione.php @@ -44,6 +44,8 @@ function eo_get_router() function hook_emojione_render_includes($data) { + $router = eo_get_router(); + $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/emojione/assets/css/emojione.css'; if (eo_strip_underscores($data['_PAGE_']) == eo_strip_underscores($router::$PAGE_EDITLINK)) { @@ -55,6 +57,8 @@ function hook_emojione_render_includes($data) function hook_emojione_render_footer($data) { + $router = eo_get_router(); + /* * Comment the five lines below to disable the autocomplete function. * If your theme use jquery, you must comment the jquery.min.js line to avoid conflicts. From 74309b25f4d86235e4de11f5233be1dc48a5c344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imm=C3=A1nuel!?= <21174107+immanuelfodor@users.noreply.github.com> Date: Sun, 30 Aug 2020 12:05:34 +0200 Subject: [PATCH 3/5] Fix image paths in new Shaarli --- assets/js/emojione.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/emojione.js b/assets/js/emojione.js index b6909cf..4e5b2a1 100644 --- a/assets/js/emojione.js +++ b/assets/js/emojione.js @@ -1,8 +1,8 @@ var posts = document.querySelectorAll('.link-tag, .link-description, .link-title, a, p, .dailyEntryTags'); emojione.ascii = false; /* change to 'true' to have ASCII conversion */ emojione.imageType = 'svg'; /* change to 'png' to have emojis in PNG */ -emojione.imagePathSVG = "../plugins/emojione/assets/svg/"; -emojione.imagePathPNG = "../plugins/emojione/assets/png/"; +emojione.imagePathSVG = "/plugins/emojione/assets/svg/"; +emojione.imagePathPNG = "/plugins/emojione/assets/png/"; Array.prototype.forEach.call(posts, function(el, i){ var parsed = emojione.toImage(el.innerHTML); el.innerHTML = parsed; From 9bbe3c437c2f8ed0d84c2d0b6ee4401ce429c16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imm=C3=A1nuel!?= <21174107+immanuelfodor@users.noreply.github.com> Date: Sun, 30 Aug 2020 12:50:59 +0200 Subject: [PATCH 4/5] Fix image paths in new Shaarli --- assets/js/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/autocomplete.js b/assets/js/autocomplete.js index 95c1575..fda73fa 100644 --- a/assets/js/autocomplete.js +++ b/assets/js/autocomplete.js @@ -443,5 +443,5 @@ horse_racing_tone4:{unicode:"1f3c7-1f3fe",shortname:":horse_racing_tone4:",alias shortname:":spy_tone2:",aliases:":sleuth_or_spy_tone2:",keywords:"sleuth or spy tone 2 pi undercover investigator person"},spy_tone3:{unicode:"1f575-1f3fd",shortname:":spy_tone3:",aliases:":sleuth_or_spy_tone3:",keywords:"sleuth or spy tone 3 pi undercover investigator person"},spy_tone4:{unicode:"1f575-1f3fe",shortname:":spy_tone4:",aliases:":sleuth_or_spy_tone4:",keywords:"sleuth or spy tone 4 pi undercover investigator person"},spy_tone5:{unicode:"1f575-1f3ff",shortname:":spy_tone5:",aliases:":sleuth_or_spy_tone5:", keywords:"sleuth or spy tone 5 pi undercover investigator person"},tone1:{unicode:"1f3fb",shortname:":tone1:",aliases:"",keywords:"emoji modifier Fitzpatrick type-1-2"},tone2:{unicode:"1f3fc",shortname:":tone2:",aliases:"",keywords:"emoji modifier Fitzpatrick type-3"},tone3:{unicode:"1f3fd",shortname:":tone3:",aliases:"",keywords:"emoji modifier Fitzpatrick type-4"},tone4:{unicode:"1f3fe",shortname:":tone4:",aliases:"",keywords:"emoji modifier Fitzpatrick type-5"},tone5:{unicode:"1f3ff",shortname:":tone5:", aliases:"",keywords:"emoji modifier Fitzpatrick type-6"}}; -$(document).ready(function(){$("textarea").textcomplete([{match:/\B:([\-+\w]*)$/,search:function(a,g){var d=[],e=[],f=[];$.each(emojiStrategy,function(c,b){-1b.length}),e.sort(function(a,b){return a.length>b.length}),f.sort());var h=d.concat(e).concat(f);g(h)},template:function(a){return'b.length}),e.sort(function(a,b){return a.length>b.length}),f.sort());var h=d.concat(e).concat(f);g(h)},template:function(a){return' :'+a+":"},replace:function(a){return":"+a+": "},index:1,maxCount:10}],{footer:'Browse All\u00bb'})}); From b20ce521c6569a460a0062bbfa8852190f8296a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imm=C3=A1nuel!?= <21174107+immanuelfodor@users.noreply.github.com> Date: Sun, 30 Aug 2020 13:08:40 +0200 Subject: [PATCH 5/5] Update readme instructions on setup --- README.md | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1da79b1..0a9ebc8 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,53 @@ # Shaarli Plugin Emojione + Add colorful emojis to your Shaarli. -# Installation -``` +## Installation + +```bash cd plugins -git clone https://github.com/NerosTie/emojione +git clone https://github.com/immanuelfodor/emojione.git ``` -Or download [the zip archive](https://github.com/NerosTie/emojione/archive/master.zip) and extract it in `plugins/emojione`. +Or download the zip archive and extract it in `plugins/emojione`. Then activate the new plugin. -# Options +## Options + ASCII Smiley is deactivated by default. http://git.emojione.com/demos/latest/ascii-smileys.html To activate it, edit `assets/js/emojione.js`: -``` + +```javascript emojione.ascii = false; /* change to 'true' to have ASCII conversion */ ``` -SVG is the default format for emojis. -If you prefer PNG, edit `assets/js/emojione.js`: -``` + +SVG is the default format for emojis. If you prefer PNG, edit `assets/js/emojione.js`: + +```javascript emojione.imageType = 'svg'; /* change to 'png' to have emojis in PNG */ ``` -The autocomplete function is deactivated by default. +The autocomplete function is activated by default. http://git.emojione.com/demos/latest/autocomplete.html -To activate it, edit `emojione.php`: -``` +To deactivate it, edit `emojione.php`: + +```php /* - * Uncomment the five lines below to use the autocomplete function. - * If your theme use jquery, let the second line commented. + * Comment the five lines below to disable the autocomplete function. + * If your theme use jquery, you must comment the jquery.min.js line to avoid conflicts. */ -# if($data['_PAGE_'] === Router::$PAGE_EDITLINK){ +# if (eo_strip_underscores($data['_PAGE_']) == eo_strip_underscores($router::$PAGE_EDITLINK)) { # $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/emojione/assets/js/jquery.min.js'; # $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/emojione/assets/js/textcomplete.min.js'; # $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/emojione/assets/js/autocomplete.js'; # } ``` -# Compatibility +## Compatibility The plugin and the options are fully compatible with these themes: -* Default -* Material (https://github.com/kalvn/Shaarli-Material) -* AlbinoMouse (https://github.com/alexisju/albinomouse-template) +- Default +- Material (https://github.com/kalvn/Shaarli-Material) +- AlbinoMouse (https://github.com/alexisju/albinomouse-template) - Untested in this fork