ToggleME

ToggleME 3.1.4

No permission to download
In debug mod:

Forum Home
-Page generation time is ~0.6 sec without your plugin
-Page generation time is ~1 sec with enabled your plugin

Why ?
 
In debug mod:

Forum Home
-Page generation time is ~0.6 sec without your plugin
-Page generation time is ~1 sec with enabled your plugin

Why ?
Reproduce the test several time (after the images have been loaded in the browser cache) and if you see any difference feel free to optimize the code and release your modifications on Github. On my websites, I don't see any difference.
 
Last edited:
Hello,


I tried to install it on my system and received this error message:

Callback Sedo_ToggleME_Listener::template_hook ist ungültig (Ungültige Klasse = invalid class).

Now I'm stuck a little bit ...
 
If anyone here is a fan of Fontawesome, I just replaced the standard ToggleMe sprite elements with Fontawesome icons.
Note that I only use Toggleme for the category and postbit. Anyone wanting to use it elsewhere will need to tweak the code.

Put this in your EXTRA.css:
Code:
/*  replace ToggleMe images with fontawesome    */
.tglWchild.active:before, .tglPosbit.active:before {
    content: "\f147 ";
    font-family: fontawesome;
    font-size: 18px;
    line-height: 18px;
    opacity: 0.3;
}
.tglWchild.inactive:before, .tglPosbit.inactive:before {
    content: "\f196 ";
    font-family: fontawesome;
    font-size: 18px;
    line-height: 18px;
    opacity: 0.3;
}
Edit toggleme_manual.css and remove the background, width and height elements. E.g.
Code:
    background-image: url('@imagePath/xenforo/widgets/toggle-sprite.png');
    background-position: 0px -16px;
    width: 16px;
    height: 16px;
^^^ remove.
And you will almost certainly need to tweak the margins.
Anyhow, here it is working on AVForums and I hope this is useful.
Category: http://www.avforums.com/forums/
Postbit: http://www.avforums.com/threads/the-amazing-spider-man-2-2014.1689688/
Please implement this on the next version: @cclaerhout
Thanks a lot!
 
@cclaerhout
There is a conflict with Vaultwiki which causes 3 toggleme buttons instead of 1.

@pegasus has given the following information:
This is a design flaw in the ToggleMe mod. If you want it to work correctly with VaultWiki sidebar blocks, it will need to be corrected from ToggleMe.

ToggleMe assumes that additional qualifying names in the class attribute for a sidebar block make that sidebar block's class name unique, and does a simple replace on divs with class attribute = X. This may be true and safe for many default-installed XenForo sidebar blocks, but it contradicts semantic usage of the class attribute, which is not meant to specify whether a div is unique. ToggleMe does a good job at handling this when class="section", so I don't know why the methodology was changed when class="section X Y etc". If you are using classes to generate ID attributes, you should always use an incremental counter, and if you are replacing based on non-unique attributes, you should either use offsets to specify the correct one, or you should use preg_replace(..., limit = 1) until all matches are resolved.
 
Thank you for sharing this add-on.
Is it possible to make any category opened/closed when a user clicks anywhere on the category ? (of course without category title)
 
@Alfa1
Sorry I don't understand clearly the given information and the mentioned addon is a paid one, so I can't test by myself and I don't have time to perform custom support.

@ThyPhon
No, it's not possible with the current JavaScript. You will have to customize the code.
 
@cclaerhout, regarding VaultWiki. You can download the free version to test it. It includes at least 1 sidebar block, and if you need to you can mess around to duplicate the HTML. But the problem doesn't need VaultWiki, it just needs two blocks with a class attribute like class="section myaddon-block". As you can guess, "myaddon-block" could be an important class to the addon and has a high likelihood of being reused.

But the problem is that the PHP that ToggleMe uses to enable "toggle" functionality on sidebar blocks uses a preg_replace on the class attribute of the sidebar blocks when the sidebar blocks have multiple class names, and it does so without including the limit argument on the call.

Since class attributes cannot be expected to be unique (only id attributes can be), this can result in multiple sidebar blocks being replaced. In this case, VaultWiki's blocks are all class="section vw-sidebar-block". The first class is a standard class used by XenForo, and the second is a class added to VaultWiki blocks so that VaultWiki knows which blocks it added.

But ToggleMe expects these blocks to all have unique class names, and cycles through the blocks one by one. As it does so, it executes the toggle button insert, but does so against the entire sidebar HTML, not just the HTML of the current found block. So it ends up adding the button to all VaultWiki blocks each time it only wants to add it to one. The result is that the toggle buttons appear many times on each block. I really don't know how to be clearer than that unless you try it for yourself.
 
Last edited:
@Alfa1 @pegasus
A new version of ToggleME (2.3.1) has been released on Github (ref). It fixes this "issue". About this issue, even if a css class name is not supposed to be an identifier, the XenForo default logic for widgets is to give a specific class name to the widget. Doing that would have been easier and cleaner than the new modification I've just submitted.
 
This version removes all toggle buttons from VW widgets and also from other addons like xenreviews, xf resource manager, xenmediagallery.
 
This version removes all toggle buttons from VW widgets and also from other addons like xenreviews, xf resource manager, xenmediagallery.
Everything is working fine for me with the RM. I haven't installed yet the Widget Framework on my test board to test with it.
 
Top Bottom