• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Editor Templates [Paid] [Deleted]

R

ragtek

Guest
#1
ragtek submitted a new resource:

Editor Templates (version 1.1) - Pre-save common used texts and insert them with only 2 clicks into your editor

This is useful for repetitive posts, such as common replies to commonly answered questions.

After you install this add-on and set the usergroup permissions,
View attachment 28190
you'll find in your Account Settings an link to create, edit and delete the post templates.

View attachment 28191

When making new topics, or replies, or anywhere with the...
Read more about this resource...
 
R

ragtek

Guest
#7
ragtek updated Editor Templates with a new update entry:

Editor Templates

Version 1.2 is now available:)

Changehistory:
Read the rest of this update entry...
 

Kintaro

Well-known member
#8
I want to use it in my market forum in this way users will have templates for their trades.
Is it possible to set templates per forum basis?
 
R

ragtek

Guest
#9
I want to use it in my market forum in this way users will have templates for their trades.
Is it possible to set templates per forum basis?
no, not atm, but i'm having something similar in the mind.

i want to include the criteria system to the templates ( i can't promise that it will be included soon )
something like:
e.g. => show to all mods
show to all users from usergroup x
show if in node x
show if not in node x
etc...
 
R

ragtek

Guest
#11
... would these criteria apply to public templates? I assume they would. that would be a great addition :)
yes, only to public templates.


then every user would have his own (if he's allowed to have them) AND then there would be the "public templates" with the criteria... if he's passing the criteria, he'll see it (which wouldn't be public anymore,... need to find a new title for this:D )
 

Arkshine

Active member
#12
It's an useful addon but If I understand, it's per user, right ? I would need it more something per group. Such addon, on my forum, would be used mainly as admin/moderator tool where for a specific group I pre-create texts. For example, for moderator group, some texts about rules or whatever. You would understand that's not convenient to ask to each person to add them manually.

Some ideas after seeing the demo on your forum :

- On the template list on a new post, it's a bit disturbing to no have a "selection effect" on the template name.
- Be able to create group would be welcomed. We can imagine that you could have a lot of templates at some point. Don't know what would be the best way to show on the new post ; maybe a dropdown-list to choose a groupe then a list appears below ; or showing a full list but seperated by the group name ; or both :p (letting the choice in the users' preferences)
 

DRE

Well-known member
#16
Can you add pagination or a scroll bar please? You have to scroll down the page after adding a lot of templates.
 
#18
A few suggestions and issues...

Suggestions:
  • Your template for editing templates under /ragtek-posttemplate/ is a bit messy and doesn't flow with the rest of XenForo's layouts. I'll likely tidy it up and see what I can do. It's mostly just the placement of the elements and buttons.
  • Change the URL to something a little more generic, such as account/editor-templates or account/canned-messages in order to be a little cleaner and flow with the rest of the site URLs.
Issues:
  • When clicking on the same template to edit multiple times, it displays a new copy in the edit box for each click. See attached image.
  • When clicking on the BBCode toolbar button multiple times, it displays a new selection box for each click. See attached image.
 

Attachments

R

ragtek

Guest
#19
When clicking on the BBCode toolbar button multiple times, it displays a new selection box for each click. See attached image.
thx:) and i've fixed it for the next release.

if you need to fix this asap:
open js/ragtek/editortemplates.js and replace it with
Code:
!function($, window, document, _undefined) {
    var $ragtek_editortemplates_container = null;
    var $ragtek_editortemplates_target = null;
    var $clicked = false;
 
    XenForo.RagtekEditorTemplate = function($button) {
        $button.live('click', function(e) {
            alert('clicked');
        });
        $ragtek_editortemplates_container = $("#ragtek_pt_container");
        $ragtek_editortemplates_target = $button.data('target');
        $button.click(function()
        {
            if ($clicked == false)
            {
                XenForo.ajax($ragtek_editortemplates_target + 'getTemplates',
                    {}, function(a) {
 
                        if (XenForo.hasTemplateHtml(a)) {
                          //  $button.xfRemove("xfFadeOut");
                            $(a.templateHtml).xfInsert("appendTo", $ragtek_editortemplates_container, "xfFadeIn");
                        }
                        else {
                            console.log("error");
                        }
                    });
                $clicked = true;
            }
        });
    }
 
    XenForo.RagtekEditorTemplate.add = function($text) {
        XenForo.ajax($ragtek_editortemplates_target + 'GetTemplate',
                {template_id : $text},
                function(a) {
 
                    if (XenForo.hasTemplateHtml(a, "text")) {
                        $text = a.textHtml;
 
                        var ed = XenForo.getEditorInForm($ragtek_editortemplates_container.closest("form"));
 
                        if (ed) {
                            if (ed.isIE) {
                                ed.execCommand("mceInsertContent", false, $text);
                            }
                            else {
                                ed.execCommand("insertHtml", false, $text);
                            }
 
                        }
                        else {
                            return false;
                        }
                    }
                    else {
                        console.log("error");
                    }
                }
        );
    }
    XenForo.register("#ragtek_editortemplate_button", "XenForo.RagtekEditorTemplate");
}
(jQuery, this, document);
When clicking on the same template to edit multiple times, it displays a new copy in the edit box for each click. See attached image.
That's as designed, because in some cases, the users want to include the same text more times.
 

Kintaro

Well-known member
#20
no, not atm, but i'm having something similar in the mind.

i want to include the criteria system to the templates ( i can't promise that it will be included soon )
something like:
e.g. => show to all mods
show to all users from usergroup x
show if in node x
show if not in node x
etc...
the last version have this?
there's a demo of the last version?