ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on July 21, 2014, 06:21:01 pm

Title: [ADDON] Tabbed smiley
Post by: emanuele on July 21, 2014, 06:21:01 pm
Tabbed Smiley v0.1.1
Introduction
Tabbed Smiley is the first mod I released for SMF and (at the time) the most tricky. Now I rewrote it to work with SCEditor and ElkArte in just few lines of code. :D
At the moment it's in the most basic form, it doesn't even have support for localization that will be added in the future.

Future development:


License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Credits
Thanks to Sam Clarke (http://www.sceditor.com/) for creating SCEditor! :D

Repository / Download



Change log

  • 0.1.0 - Complete rewrite for ElkArte and SCEditor - added only basic features
  • 0.1.1 - Added support for ElkArte 1.0.1 (ElkArte 1.0 is no more supported)
Title: Re: [ADDON] Tabbed smiley
Post by: Spuds on July 21, 2014, 06:40:21 pm
Coolness ... editor plugins :D

I think you are missing the modifications.xml file in the repo? (and your repo link above should have tree/elk  O:-) )
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on July 21, 2014, 06:57:03 pm
Well, the first time I missed the css and the js, then I forgot to actually modify the modification.xml, and finally I forgot to add the xml file... O:-)

It's too late. lol
Thanks! ;D

Yep! :D
For me it's always a bit difficult find out how to do any, because javascript is not my friend lol, but then copying what we already have around (drafts and mentions mainly) it's usually "easy".
And compared to the original SMF mod, it's a dream being able to just have two very minor file edits (actually one could be avoided using hooks, though it would require several hooks to catch all the actions where the editor is used, and it still wouldn't load on custom pages, so the file edit still make sense <= i.e. Elk needs a hook for the editor :P).
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on December 25, 2014, 02:34:44 pm
Quote from: Lars – Today I've installed the addon "Tabbed Smileys". There are three tabs now.
Where can I change the words Base, Tab 1 and Tab 2 in others?
As I wrote above it doesn't support localization yet, so the only thing you can do is replace it in tabbedSmiley.js:
Code: [Select]
'Base', 'active'));
and
Code: [Select]
'Tab ' + count
Title: Re: [ADDON] Tabbed smiley
Post by: Lars on December 25, 2014, 03:38:04 pm
Okay, thank you. I'll try this in the meantime. :)

Um, would it be possible to add border lines below the "inactive" tabs, like the red line on the example image?
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on December 26, 2014, 09:14:09 am
I think at the moment the html markup is not good enough to accommodate it...
I have to fix it.

ETA: memo http://css-tricks.com/css3-tabs/
Title: Re: [ADDON] Tabbed smiley
Post by: radu81 on January 01, 2015, 08:33:56 am
There is a small error when uninstalling this addon ;)
2.   Elimina File   ./themes/default/css/tabbedSmiley.js   Errore durante il parsing della modifica
it should be tabbedSmiley.css and not tabbedSmiley.js
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on January 01, 2015, 10:47:21 am
/me takes note.

Thanks. ;D
Title: Re: [ADDON] Tabbed smiley
Post by: inter on March 28, 2015, 04:57:32 am
How rename tabs?
Where "Tabs names and appearance" box?
I have not created after you drag a new tab

(ElkArte 1.0.3, Tabbed Smiley v0.1.1)
Title: Re: [ADDON] Tabbed smiley
Post by: Antechinus on June 02, 2016, 06:17:57 pm
Gonna start messing with this. You have been warned. :D

ETA: Just noticed that any smiley set to "Popup" in admin automatically goes to Tab 1 on the post form, which is cool. However, it does mean that the default "More" button becomes redundant, so ideally that would be hidden if this mod was enabled.
Title: Re: [ADDON] Tabbed smiley
Post by: Antechinus on June 02, 2016, 06:41:05 pm
Quote from: Lars – Okay, thank you. I'll try this in the meantime. :)

Um, would it be possible to add border lines below the "inactive" tabs, like the red line on the example image?
Quote from: emanuele – I think at the moment the html markup is not good enough to accommodate it...
I have to fix it.

ETA: memo http://css-tricks.com/css3-tabs/
Should be possible with the existing markup. You have a different class on the active tab anyway, so just targeting that should sort things out. I'll play around with it as soon as I have time.
Title: Re: [ADDON] Tabbed smiley
Post by: Antechinus on June 11, 2016, 01:56:21 pm
Aha. No can do with existing markup. It doesn't need more HTML elements added to the markup, but it does need a change to the way classes are added to the markup.

The problem is that if any tab other than the base tab is active, the base tab will still have the sceditor-tabs-active class assigned to it. That's definitely a bug, since only the currently selected tab should have that class.

If that bug gets fixed, then styling it up so the active tab was different to the others would be easy.

Taking things further, although this mod is basically a good one it would be better if the admin was able to create tabs, and then assign smileys to a chosen tab. At the moment you can't do this, which can be a PITA sometimes (depending on how daft and extensive your smiley collection is).
Title: Re: [ADDON] Tabbed smiley
Post by: oblivion on June 12, 2016, 12:48:35 pm
The images in the readme file that show how to create new tabs are dead links.

How do you create new tabs?
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 15, 2016, 11:06:39 am
Ops... sorry, that slipped through... :-[

In Elk you can put the smiley in the editor or in a popup. The popup can have lines of smiley.
This addon takes any line of smiley in the popup and converts it to a "tab", so you move the smiley to the popup and then to multiple lines and here you go with as many tabs as you want!
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 15, 2016, 02:26:13 pm
 O:-) It's me again...

I have installed this addon right now in my testforum.

Creating more tabs is working perfect, but the button "More" is still there in the editor and the smiley-popup. But both should disappaer, if tabs are there?

The tabs have just numbers? ("Tab 1", "Tab 2", and so on) I can't give them other names?

We need a lot of tabs for our smileys. :-[ 
People would not remind which smiley is in which tab, if the tabs have just numbers...
Title: Re: [ADDON] Tabbed smiley
Post by: oblivion on June 15, 2016, 03:43:54 pm
Quote from: emanuele – Ops... sorry, that slipped through... :-[

In Elk you can put the smiley in the editor or in a popup. The popup can have lines of smiley.
This addon takes any line of smiley in the popup and converts it to a "tab", so you move the smiley to the popup and then to multiple lines and here you go with as many tabs as you want!

I guess my problem is I don't know what makes a line of smilies a line.  I have 3 tabs right now.  Base, Tab 1 and Tab 2.  How do I start a new line?  I've tried selecting a smilie and clicking the various arrows that appear to be on their own separate line, but doing so doesn't put the selected smilie in a new tab.  It just moves the smilie to the bottom of the existing tab.

I thought I created tab 2 with a drag-and-drop to the bottom of tab 1, but I haven't been able to reproduce whatever I did the first time.
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 15, 2016, 11:35:53 pm
It is working with drag and drop, you don't need to use the arrows you can see there.

The smiley for a new tab has to be in the editor first.

Than you "fetch him with the mouse and pull him down to a new line in the smiley-pop-up-window". (I don't know how to say this in English) O:-)

There is always a warning-popup, that it did not work, but it is working. If I close this warnig-popup, the smiley will be there in his line and a new tab is created.



Edit: Maybe you or me are using the wrong version of this addon? I downloaded and installed this one yesterday: http://www.elkarte.net/community/index.php?topic=2117.msg25752#msg25752 Tabbed-Smileys-elk.zip

But here in this topic it is Tabbed-Smiley_0-1-1.zip
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 15, 2016, 11:43:22 pm
I added this in tabbedSmiley.css and now the "More-Button" has disappeared:

Code: [Select]
.sceditor-more {
    display: none;
}

Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 15, 2016, 11:52:32 pm
Where can I find this, to give the tabs other names? Is it possible?
Title: Re: [ADDON] Tabbed smiley
Post by: oblivion on June 17, 2016, 12:32:00 am
Ruth, I've installed tabbed smilies 1.1.  Thanks for pointing that out!  I'll try the one you installed.
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 17, 2016, 03:27:44 am
Quote from: Ruth – Where can I find this, to give the tabs other names? Is it possible?
Argh... I forgot to update the package in the first post of the topic...
Go to:
https://github.com/emanuele45/Tabbed-Smileys/tree/elk
click on the "clone or download" on the right and select "download zip". Use this package. ;)
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 17, 2016, 05:52:14 am
I have installed it now, but it seems to me the same as I used yesterday, emanuele, the same files.

I can't do this... :'(  there is nothing in the admin panel like this:

QuoteIt's also possible to define a custom name for each tab and change the css style directly in the admin panel, section "set smiley order

Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 17, 2016, 06:44:01 pm
Likely the old (in the sense before being ported to Elk) description.
In the current level, the text can be changed via language file (TabbedSmiley.english.php) with the string:
Code: [Select]
$txt['tabbedSmiley_tabs'] = 'Tab {%d}';
where {%d} represents the number (i.e. Tab 1, Tab 2, Tab 3, etc.).
I know it's limited, but for now it's better than nothing.
With some time I'll add back the full customization.
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 17, 2016, 07:02:53 pm
I don't understand this, sorry emanuele. O:-)

How can I change it? It is just one string for all the tabs, they will only have different numbers, not different names?

Can I add something like this with html in the tabbedSmiley.integration.php? One for each tab?

(http://www.elkarte.net/community/index.php?action=dlattach;topic=1749.0;attach=3798;image)
Title: Re: [ADDON] Tabbed smiley
Post by: oblivion on June 17, 2016, 11:35:08 pm
And, it works!  The previous install was apparently missing a .js file or the file didn't install for some reason.
Title: Re: [ADDON] Tabbed smiley
Post by: Antechinus on June 18, 2016, 03:11:44 am
Quote from: emanuele – Likely the old (in the sense before being ported to Elk) description.
In the current level, the text can be changed via language file (TabbedSmiley.english.php) with the string:
Code: [Select]
$txt['tabbedSmiley_tabs'] = 'Tab {%d}';
where {%d} represents the number (i.e. Tab 1, Tab 2, Tab 3, etc.).
I know it's limited, but for now it's better than nothing.
With some time I'll add back the full customization.
I was just saying to Oblivion that you could actually rename the tabs with CSS tweaks. Hide the default text in the tabs with text-indent, and use nth-child and a :before pseudo to put whatever visible names you want in each tab. Not that you'd use that method for a revamped version of the mod, but it would enable people to have custom names on their tabs with this version.

Just sayin' and all.
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 18, 2016, 03:49:27 am
Are you addressing me, Antechinus? ;D 

I have tried something like this in CSS, but I cannot figure it out. O:-)  I know nothing about coding.

I would be very glad, if someone can show or explain me this css-trick
Title: Re: [ADDON] Tabbed smiley
Post by: Antechinus on June 18, 2016, 06:36:40 am
Should be easy enough, although I haven't tested this yet. I'd start by changing the language file to this:

Code: [Select]
$txt['tabbedSmiley_tabs'] = '&nbsp;';

That's just to give it some content that won't be visible, which is easier than what I was thinking before.

Anyway, the important part is assigning a :before pseudo element in the CSS and putting text there. Something like this should work:

Code: [Select]
sceditor-emot-head-tabs>li:nth-child(2):before {
    content: "Any text you want";
}
sceditor-emot-head-tabs>li:nth-child(3):before {
    content: "Another tab title";
}
sceditor-emot-head-tabs>li:nth-child(4):before {
    content: "My penguin likes chocolate cake";
}
sceditor-emot-head-tabs>li:nth-child(5):before {
    content: "There is chewing gum stuck to my seat";
}

Etc.
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 18, 2016, 07:50:09 am
Quote from: Antechinus – I was just saying to Oblivion that you could actually rename the tabs with CSS tweaks. Hide the default text in the tabs with text-indent, and use nth-child and a :before pseudo to put whatever visible names you want in each tab. Not that you'd use that method for a revamped version of the mod, but it would enable people to have custom names on their tabs with this version.
Provided you don't need more than one language it would of course work. :)
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 18, 2016, 09:44:13 am
Thank you very much, Antechinus.

I have tried that one (and several other things, which did not work):

Code: [Select]
$txt['tabbedSmiley_tabs'] = '&nbsp;';

Code: [Select]
sceditor-emot-head-tabs>li:nth-child(2):before { content: "Any text you want";}

You will only see the &nbsp in all tabs.



With this one, it is working nearly...but the &nbsp is also there...

Code: [Select]
.sceditor-emot-head-tabs>li:nth-child(2):before {content: "Mehr";}



Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 18, 2016, 09:54:18 am
Oh!

It is working with this one:

Code: [Select]
$txt['tabbedSmiley_tabs'] = '';

Code: [Select]
.sceditor-emot-head-tabs>li:nth-child(2):before {content: "Mehr";}
.sceditor-emot-head-tabs>li:nth-child(3):before {content: "Typen";}
.sceditor-emot-head-tabs>li:nth-child(4):before {content: "Lustig";}
.sceditor-emot-head-tabs>li:nth-child(5):before {content: "Traurig";}

Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 18, 2016, 10:06:01 am
Quote from: emanuele – Provided you don't need more than one language it would of course work. :)

Emanuele, I did not change the english language file, it is still as before.

I made a  TabbedSmiley.german.php for the changing

And there are no errors in the log. ;D

You made my day, Antechinus! Thank you!

This will be enough for the moment.

Emanuele, are you sure, that you will complete this addon one day? It is a lot of work, to sort all our smileys into tabs. If you don't finish the work on this addon, I will sort them now that way.

But if you will finish it, I will wait until the addon is complete. O:-)
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 18, 2016, 10:28:49 am
Quote from: Ruth –
Quote from: emanuele – Provided you don't need more than one language it would of course work. :)

Emanuele, I did not change the english language file, it is still as before.

I made a  TabbedSmiley.german.php for the changing
You have the test in the css, so you have an empty string in the German file.
My comments means that if some any of your members is using another language (e.g. English) he will see the tabs in German anyway.
I guess it was mostly the same in the original mod as well, but it's such a long time ago I don't remember. LOL

Quote from: Ruth – Emanuele, are you sure, that you will complete this addon one day? It is a lot of work, to sort all our smileys into tabs. If you don't finish the work on this addon, I will sort them now that way.

But if you will finish it, I will wait until the addon is complete. O:-)
Who knows.
It all depends on the various priorities.
Anyway, it's not that the way smiley are put into tabs will change in the future, so sorting them now or later will not change anything.
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 18, 2016, 10:51:56 am
It is always difficult for me to understand proper, what I am reading here...sorry, Emanuele. O:-)

I know the words (well, most of them) ;)  but very often I don't understand the context of meaning.

The complete addon would be very comfortable to use, because you can also sort the smileys on the side "change smileys" by the checkboxes and the dropdown, which would show all the tabs, which are existing.

If I sort them now into the tabs, I have to take each single smiley by "drag and drop", to bring him into his tab. It will take much more time that way. (We have got a lot of smileys)

But it is fine for me, to do it that way... I just wanted to know, if maybe the addon would be finished some day... ;)
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 27, 2016, 04:22:02 am
My hoster deleted the database of my testforum yesterday, :(  where I had tested this addon.

I don't want to upload a lot of smileys again, just for testing. I would like to install the addon now in my real forum.

But I need to know this first... please tell me, Emanuele:

The number of tabs is not limited? O:-)  Can I be sure with this?
Title: Re: [ADDON] Tabbed smiley
Post by: ahrasis on June 27, 2016, 06:07:02 pm
I offered this few days back if you need it.
Quote from: ahrasis – Hi.

I am offering a free own private (home) hosting (ubuntu + ispconfig) for those who wish to test ElkArte.

I have been using this own private hosting for more than 2 years now.

This is definitely not the best hosting because I am using a dynamic ip but it is useful for those who have the above need (or for reasonable others).

You only need to point your domain or subdomain to ns1.sch.my and ns2.sch.my.

I can't give you the ip because it is changing from time to time but you can check on your own.

And if you don't have one (domain or subdomain), I can supply you with one.

You may reply here and I will pm you with the login details to access its ISPConfig 3 control panel.
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 28, 2016, 03:46:56 am
Quote from: Ruth – The number of tabs is not limited? O:-)  Can I be sure with this?
As long as you can add new lines of smiley there will be tabs.
TBH I don't remember the limit of the database (I'd guess at least 128), but I don't know either how would look many tabs.

Once upon a time I think I wrote a script to import bunches of smiley from a text fiel or maybe directly from the file names... I should search it or rewrite it.
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 28, 2016, 04:47:11 am
Thank you very much, Ahrasis...this is a great offer from you. :)  I read it here a few days ago. It is very kind of you, but I think , I will not need it. Yesterday my hoster prepared a new database for me and installed me a new ElkArte, so I have a testforum again. I have still all files on my pc, but a lot of tests, code-snippets, tests with color-combinations, etc. I had written there, have gone. :(

Emanuele, thank you very much.

We had about 50 O:-)  Smiley-Tabs, while we were using SMF.  The "Buttons" for the tabs, which took to much space in the first line in the editor, were automatically "jumping" into a new line. Maybe it will be the same now? I will try this addon today... ;)

 It was looking like this with SMF:
Title: Re: [ADDON] Tabbed smiley
Post by: Ruth on June 28, 2016, 07:06:16 am
 :D I can't believe it. This is absolutly fantastic!

The smileys were still "sorted in lines" in the smiley-popup after the migration. So I tried to left them there and installed the addon. O:-)  I need not to sort them all again, they are now in each tab to which they belong. (Normally it takes me a few weeks of work to sort them all). I am so glad! :)

 I just add a  margin-bottom: 2px; in tabbed.smiley.css to have a little space between the rows of tabs.

Emanuele , I will kiss your hands and feet for this addon! ;) (I don't know, if you can say so in English). It is really great! :)

Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on June 28, 2016, 07:41:00 am
That's luck for you! :P
Glad it worked so smooth. :)
Title: Re: [ADDON] Tabbed smiley
Post by: Allan on December 31, 2016, 10:09:25 am
Okay I have to ask this, but I installed this and I don't see any options about adding a tab or anything. All I see are the default settings for adding sets and smileys.
Title: Re: [ADDON] Tabbed smiley
Post by: emanuele on December 31, 2016, 06:27:50 pm
https://github.com/emanuele45/Tabbed-Smileys/tree/elk#configuration
Title: Re: [ADDON] Tabbed smiley
Post by: Spuds on March 02, 2023, 10:26:42 am
I needed a version that would work with ElkArte 1.1, so here it is for anyone else in need.  I made a PR to the official repo as well.  Note this version will only work with 1.1

As with the 1.0 version,  you need to use CSS to provide custom names your tabs, otherwise you will get the default Tab 1 ... Tab X.  See the css file for details, simply each defined smiley row in the popup window can be given a tab name.
Title: Re: [ADDON] Tabbed smiley
Post by: Spuds on March 05, 2023, 10:22:53 am
I've made another update to fix a performance issue.

The previous version waited for the editor to trigger a signalReady event to build the tabs.  For some reason there is a long delay on that happening.  The delay is not unique to Elk 1.1, which does use a newer version of the editor, as I noticed a similar delay on Elk 1.0, just not as long and annoying.

The updated version instead adds a DOM element watch, and as soon as the editor creates the needed smiley div, this runs and the tabs are created.  So really as soon as you see the editor window the tabs are created, vs the previous 5ish second delay.