The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Update sceditor for moderator tables

3 posters

Go down

Solved Update sceditor for moderator tables

Post by Guest August 23rd 2023, 8:53 am

Forum: https://gothicpub.forumotion.com/
Version: phpBB3

I would like to add new "image" in sceditor only for selected users (I can deal with username check). After selected users click on the button, textarea will be updated with prepared BBcode. That will make moderation much easier. No need to c/p all the time this table..


Last edited by The Raven on August 23rd 2023, 11:02 am; edited 1 time in total
avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Razor12345 August 23rd 2023, 9:06 am

Good morning!

What about this tutorial:Warning button for Administrators and Moderators


Update sceditor for moderator tables Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 9:20 am

Razor12345 wrote:Good morning!

What about this tutorial:Warning button for Administrators and Moderators

I checked it out but that's not the one I am looking for. I actually need it inside the sceditor group. Is such thing possible? I tried to append for example:

Code:
<a class="sceditor-button sceditor-button-source hover" data-sceditor-command="source" unselectable="on" title="Switch Editor Mode"><div unselectable="on">Switch Editor Mode</div></a>

This already exists but for example purposes.
And it didn't add anything. I used this as base class:
Code:
div.sceditor-toolbar

avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Razor12345 August 23rd 2023, 9:24 am

I don't understand what the result should be.
Can you describe your idea in more detail and, if possible, provide screenshots?


Update sceditor for moderator tables Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 9:28 am

So, inside this sceditor (or it can make a new group (better)), I add this image and once clicked, the textarea is being filled with text you see in the image. Possible?

Update sceditor for moderator tables Screen55
avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Razor12345 August 23rd 2023, 9:48 am

And what's wrong with the tutorial I posted above? It performs exactly the same functionality you described.
The only difference is the location of the buttons and their styling.


Update sceditor for moderator tables Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 9:56 am

Well, in a way, but these are actually added as pseudo elements, and I need them inside scediotor to workout. That's probably the only issue I am having here. I've seen the tutorial you sent but it doesn't fit excatly as I need it to be. How can my idea be achieved?
avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by TheCrow August 23rd 2023, 10:04 am

You can style those buttons into smaller images if you want to and then place them after
Code:
.sceditor-group:last
instead of before
Code:
.before("<img src='"+modImage+"' title='Moderator warning' id='mod-b'/>");


Update sceditor for moderator tables Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6902
Reputation : 795
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 10:09 am

TheCrow wrote:You can style those buttons into smaller images if you want to and then place them after
Code:
.sceditor-group:last
instead of before
Code:
.before("<img src='"+modImage+"' title='Moderator warning' id='mod-b'/>");

Why is this not working:

Code:
$(function() {

    var username = _userdata.username;
    var usernames = ["The Raven", "mihai", "Unstopable Mind"];

    for (var i = 0; i < usernames.length; i++) {

        if (username == usernames[i]) {
            $(".sceditor-group:last").after("<img src='https://cdn3.iconfinder.com/data/icons/finance-152/64/26-256.png' width=20 height=20 title='Moderator tool' id='modT'/>");
        }
    }


});

avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by TheCrow August 23rd 2023, 10:14 am

Because the editor is a little bit weird when you try to apply something to it.
Try using this instead:
Code:
$(function() {
  $(function() {
    var username = _userdata.username;
    var usernames = ["The Raven", "mihai", "Unstopable Mind"];
 
    for (var i = 0; i < usernames.length; i++) {
 
        if (username == usernames[i]) {
            $(".sceditor-group:last").after("<div class="sceditor-group" id="modT"><a class="sceditor-button sceditor-button-modTool" unselectable="on" title="Moderator Tool"><img src='https://cdn3.iconfinder.com/data/icons/finance-152/64/26-256.png' width=20 height=20 /></a></div>");
        }
    }
 
  });
});
This should fix your issue.


Update sceditor for moderator tables Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6902
Reputation : 795
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 10:21 am

So, I managed to add the field, but there is not image. I had to change the code you gave me because the strings required \ to ignore end of the string.

Code:
$(function() {
  $(function() {
    var username = _userdata.username;
    var usernames = ["The Raven", "mihai", "Unstopable Mind"];
 
    for (var i = 0; i < usernames.length; i++) {
 
        if (username == usernames[i]) {
            $(".sceditor-group:last").after("<div class=\"sceditor-group\" id=\"modT\"><a class=\"sceditor-button sceditor-button-modTool\" unselectable=\"on\" title=\"Moderator Tool\"><img src='https://cdn3.iconfinder.com/data/icons/finance-152/64/26-256.png' width=20 height=20 /></a></div>");
        }
    }
 
  });
});

Update sceditor for moderator tables Screen56
avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by jucarese August 23rd 2023, 10:30 am

jucarese
jucarese
Hyperactive

Male Posts : 2487
Reputation : 117
Language : spanish
Location : SSF Admin

http://asistencia.foroactivo.com/u23082

TonnyKamper likes this post

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by TheCrow August 23rd 2023, 10:33 am

Then I think you should try and display the image through CSS instead.

Code:
.sceditor-button.sceditor-button-modTool {
  background-image: url('https://cdn3.iconfinder.com/data/icons/finance-152/64/26-256.png');
  background-repeat: no-repeat;
  height: 16px;
  width: 16px;
}


Update sceditor for moderator tables Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6902
Reputation : 795
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Guest August 23rd 2023, 10:40 am


Will check this out very soon. Thanks. It has to work. If it does, I will mark this as solved. Wink


Okay, it works. I will do the tweaks regarding styling. Thanks a lot, solved.
avatar
Guest
Guest


Back to top Go down

Solved Re: Update sceditor for moderator tables

Post by Razor12345 August 23rd 2023, 11:45 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


Update sceditor for moderator tables Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1542
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum