Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Antechinus on February 13, 2020, 11:24:02 AM

Title: Dangerous Marsupial Page Index
Post by: Antechinus on February 13, 2020, 11:24:02 AM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4247)

This mod replaces the default page index with an HTML select (or dropdown, if you prefer).
It also has next page and previous page buttons built in, each side of the select.
The mod comes with CSS to support RTL languages.




Changelog

v.1.0.2 - 14/2/2020 - Incorporated Bugo's suggestions of cache cleaning code in install.xml, and removing fixed width from CSS for .subject .antPages_select (small selects on message index).
Title: Re: Dangerous Marsupial Page Index
Post by: -Rock Lee- on February 13, 2020, 12:13:18 PM
It seems very good I will try it on a test site I have, great job! :D


Regards!
Title: Re: Dangerous Marsupial Page Index
Post by: Antechinus on February 13, 2020, 03:31:09 PM
I thought it was a sensible idea. I actually coded the thing literally years ago, but for some reason had never got around to submitting it.
Title: Re: Dangerous Marsupial Page Index
Post by: Bugo on February 13, 2020, 03:36:31 PM
Please, add this line to <install> section in package-info.xml:

<code type="inline">clean_cache();</code>

It will help to clean cache after the mod installing (to avoid doing this manually).

In addition, on the topic list page (MessageIndex), I noticed that when long words are using (i.e., "Страница" instead of "Page"), the right page select is not displayed completely. See my screenshot below. Removing the "width" property (".subject .antPages_select" rule in index.css) fixes the problem.

In any case, this mod is classy. Big thanks :)
Title: Re: Dangerous Marsupial Page Index
Post by: vbgamer45 on February 13, 2020, 03:47:36 PM
Quote from: Bugo on February 13, 2020, 03:36:31 PM
Please, add this line to <install> section in package-info.xml:

<code type="inline">clean_cache();</code>

It will help to clean cache after the mod installing (to avoid doing this manually).

Wow that is a good idea. Should that be in SMF by default? every-time  a mod is installed?
Title: Re: Dangerous Marsupial Page Index
Post by: Antechinus on February 13, 2020, 03:57:07 PM
Quote from: Bugo on February 13, 2020, 03:36:31 PM
Please, add this line to <install> section in package-info.xml:

<code type="inline">clean_cache();</code>

It will help to clean cache after the mod installing (to avoid doing this manually).

You mean like this?

<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>Antechinus:Dangerous_Marsupial_Page_Index</id>
<name>Dangerous Marsupial Page Index</name>
<version>1.0.1</version>
<type>modification</type>
<install for="2.0, 2.0.1 -2.0.99">
<modification format="xml" type="file">Dangerous_Marsupial_Page_Index.xml</modification>
<readme parsebbc="true">readme.txt</readme>
<code type="inline">clean_cache();</code>
</install>


Ok, cool. will do.

QuoteIn addition, on the topic list page (MessageIndex), I noticed that when long words are using (i.e., "%u0421%u0442%u0440%u0430%u043D%u0438%u0446%u0430" instead of "Page"), the right page select is not displayed completely. See my screenshot below. Removing the "width" property (".subject .antPages_select" rule in index.css) fixes the problem.

Now there's a point. Come to think of it, I'm not sure why I set a fixed width there anyway. I'll change it now. :)

ETA: Aha! I just remembered. I was using the fixed width on local to hide the "of 26" text after the "Page 1", to make the default display more compact on the message index. I just thought it looked neater like that. But sure, I can see it causing problems with other languages.

What I'll do is remove the width in the default CSS, and add a comment there suggesting that people can tweak the display themselves for their preferred language if they want to. Which still won't be a perfect solution for multi-language sites, but anyone who is really keen can always run a browser extension like Stylem.

ETA: Ok, done. Version 1.0.2 uploaded. :)
Title: Re: Dangerous Marsupial Page Index
Post by: dan4ever on June 13, 2021, 05:59:05 AM
Hi

Is it possible to increase the width slightly?
The text becomes too long, see picture

/Dan


Edited to remove size restriction bbc ~ Steve
Title: Re: Dangerous Marsupial Page Index
Post by: landyvlad on June 14, 2021, 12:51:07 AM
Is this mod independent of theme in use?  (i.e. will it wok with any theme) ?

Do you plan to release a 2.1 compatible version in due course?


Also... which marsupials do you consider dangerous?
Title: Re: Dangerous Marsupial Page Index
Post by: Antechinus on July 16, 2021, 09:42:43 PM
Quote from: dan4ever on June 13, 2021, 05:59:05 AM
Hi

Is it possible to increase the width slightly?
The text becomes too long, see picture
Yes, it's easy enough to do. Will dig out the code later.


Quote from: landyvlad on June 14, 2021, 12:51:07 AM
Is this mod independent of theme in use?  (i.e. will it work with any theme) ?
Yes, but it may need CSS tweaks to look good with some themes.

QuoteDo you plan to release a 2.1 compatible version in due course?
Probably should. :P


QuoteAlso... which marsupials do you consider dangerous?
Drop bears.