This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
4726
Plugins / Re: Another quick plugin
« on February 28th, 2012, 12:02 AM »
That's the thing - assuming the browser is capable of handling it, you get email addresses being checked that they are at least legal email addresses, you get numbers validated to being integers (optionally conforming to steps, e.g. between 0 and 100, rounded to nearest 10), and the spec even allows for validating floats though I never got into that because I can't remember anywhere that actually uses it...
4727
Features / Re: Using HTML5 form inputs
« on February 27th, 2012, 11:51 PM »
Much as it pains me to admit it, I caught myself using http://www.w3schools.com/html5/html5_form_input_types.asp as a 'reference' earlier, lists all the types.
4728
Features / Re: Using HTML5 form inputs
« on February 27th, 2012, 11:41 PM »Smart, didn't even notice there was an int type
4729
Plugins / Re: Menu integration
« on February 27th, 2012, 11:40 PM »
Yup, regarding before.
And no, no equivalent for the enabled key, unless it's done based on a $settings entry (and only a settings entry) being empty or not, e.g. enabled="somesetting" becomes 'enabled' => !empty($settings['somesetting'])
That to me doesn't seem worth the effort - if it's controlled by anything other than a permission, it's probably going to want to put a notice value in too, which says to me that it wants to be running its own hooked function anyway.
And no, no equivalent for the enabled key, unless it's done based on a $settings entry (and only a settings entry) being empty or not, e.g. enabled="somesetting" becomes 'enabled' => !empty($settings['somesetting'])
That to me doesn't seem worth the effort - if it's controlled by anything other than a permission, it's probably going to want to put a notice value in too, which says to me that it wants to be running its own hooked function anyway.
4730
Plugins / Re: Another quick plugin
« on February 27th, 2012, 11:38 PM »Yup, the #1 reason for using these...
The question should be -- how many forums will do it once we start doing it?
Wedge is here to innovate, to do things that other forums don't. Not systematically, but it's nice to have a few ideas from time to time that we know others will start stealing from us.
Now you can get started on the calendar plugin......
4731
Plugins / Re: A project I started a while back
« on February 27th, 2012, 11:36 PM »
Yup, chess between forum members.
4732
Plugins / A project I started a while back
« on February 27th, 2012, 11:11 PM »
OK, so here's a project I started a while ago but put down due to so much other stuff going on. Now I'm dusting it off and trying to work on it, and I thought I might share a few pictures. ;)
I only really got as far as the admin area with a few very minor bits of UI foundation for the main area, but nonetheless...
Back in November when I first started on this before getting massively derailed, I had planned unreservedly to make it paid. Now, I'm a bit undecided on my plugins being free or paid, but it's likely that this one will be paid.[1]
I only really got as far as the admin area with a few very minor bits of UI foundation for the main area, but nonetheless...
Back in November when I first started on this before getting massively derailed, I had planned unreservedly to make it paid. Now, I'm a bit undecided on my plugins being free or paid, but it's likely that this one will be paid.[1]
| 1. | It has been suggested that I make all my plugins paid but pay a small one-time-only fee. I'm certainly more amenable to that than any kind of annual licensing deal. But there's a *lot* of stuff in this plugin so IMHO making it paid would be justified. |
4733
Plugins / Re: Readability
« on February 27th, 2012, 06:48 PM »
Eh, I wasn't exactly that clear either ;) Still a valid question you raised :)
4734
Plugins / Menu integration
« on February 27th, 2012, 06:48 PM »
Having now integrated the admin panel stuff for simple cases, I'm inclined to think I should add something similar for the main menu - much as it's already possible to add actions without any hooks being called. The idea isn't to remove those hooks but to take out the most common use cases from being required (to lower the barrier to entry for basic stuff, without compromising more powerful stuff should it be needed)
Main menu tabs are a bit more complex than actions, because they need to cover things like permissions, so here's what I'm thinking. There would be a single cache of all the items, which is a nicely serialized array.
The XML would look like:
Code: [Select]
This would create a new menu item, which would be highlighted on action=myplugin (due to the name), would use $txt['my_plugin'] as its caption (loaded from the plugin's MyPlugin.language.php file, and cached!), would have myicon.png as its icon, would only be visible if the user had some_perm permission, and when clicked would go to the given URL. Same deal for sub items.
As far as the caching goes, all that information would be cached, as well as - and this is the important part - when we created the cache and added an item, we'd also make sure to load all the different installed languages' files, to grab the entry/ies that we needed, and we'd cache them all in the menu. Since it's done at enable-plugin time, it should be relatively cheap to do.
The only problem I can imagine with that setup is that we might end up overflowing the serialize field if there's a lot of languages and a lot of menu entries added. Maybe this is a candidate for json_encode instead.
Also note we would definitely need to change the menu styling code as discussed before to create a single base class for each of the menu icons, such that each icon held to the same styling as far as padding etc. goes (and then this only has to worry about adding the icon itself, rather than having to worry about trying to add all the extra style code like padding)
Thoughts? (This one's primarily for plugin authors, though I'd appreciate your comments, Nao)
Main menu tabs are a bit more complex than actions, because they need to cover things like permissions, so here's what I'm thinking. There would be a single cache of all the items, which is a nicely serialized array.
The XML would look like:
<menu_items>
<language file="MyPlugin">
<item name="myplugin" caption="my_plugin" icon="$pluginurl/myicon.png" permission="some_perm" url="$scripturl?action=myplugin" after="search">
<item name="myplugin" caption="my_sub_plugin" url="$scripturl?action=myplugin;sa=blah">
</item>
</menu_items>This would create a new menu item, which would be highlighted on action=myplugin (due to the name), would use $txt['my_plugin'] as its caption (loaded from the plugin's MyPlugin.language.php file, and cached!), would have myicon.png as its icon, would only be visible if the user had some_perm permission, and when clicked would go to the given URL. Same deal for sub items.
As far as the caching goes, all that information would be cached, as well as - and this is the important part - when we created the cache and added an item, we'd also make sure to load all the different installed languages' files, to grab the entry/ies that we needed, and we'd cache them all in the menu. Since it's done at enable-plugin time, it should be relatively cheap to do.
The only problem I can imagine with that setup is that we might end up overflowing the serialize field if there's a lot of languages and a lot of menu entries added. Maybe this is a candidate for json_encode instead.
Also note we would definitely need to change the menu styling code as discussed before to create a single base class for each of the menu icons, such that each icon held to the same styling as far as padding etc. goes (and then this only has to worry about adding the icon itself, rather than having to worry about trying to add all the extra style code like padding)
Thoughts? (This one's primarily for plugin authors, though I'd appreciate your comments, Nao)
4735
Plugins / Re: Readability
« on February 27th, 2012, 06:45 PM »
Not really, no. I meant the actual font used in the Readability buttons - the buttons themselves use a serif font to display the letters - when everything else is sans-serif.
Though if there's an option to set fonts, that would be useful to know so that it can be added to the plugin.
Though if there's an option to set fonts, that would be useful to know so that it can be added to the plugin.
4736
Plugins / Re: Settings page integration
« on February 27th, 2012, 06:36 PM »
This is now in r1397.
And I've updated the contact page plugin in my repo to cover it too.
Posted: February 27th, 2012, 06:33 PM
And I've updated the contact page plugin in my repo to cover it too.
4737
Features / Re: New revs
« on February 27th, 2012, 06:32 PM »
(5 files, 21KB)
Revision: 1397
Author: arantor
Date: 27 February 2012 17:31:53
Message:
! Plugins now support the ability to specify a simple one-page options area directly from their plugin-info file, without the need to mess with hooks. This one-page admin area is also automatically added to the search subsystem and as such will turn up in searching the admin panel. (plugin-info.rng, Admin.php, ManagePlugins.php, ManageSettings.php)
! Pruning old code. (ManageBoards.template.php)
----
Modified : /trunk/Sources/Admin.php
Modified : /trunk/Sources/ManagePlugins.php
Modified : /trunk/Sources/ManageSettings.php
Modified : /trunk/Themes/default/ManageBoards.template.php
Modified : /trunk/other/plugin-info.rng
Revision: 1397
Author: arantor
Date: 27 February 2012 17:31:53
Message:
! Plugins now support the ability to specify a simple one-page options area directly from their plugin-info file, without the need to mess with hooks. This one-page admin area is also automatically added to the search subsystem and as such will turn up in searching the admin panel. (plugin-info.rng, Admin.php, ManagePlugins.php, ManageSettings.php)
! Pruning old code. (ManageBoards.template.php)
----
Modified : /trunk/Sources/Admin.php
Modified : /trunk/Sources/ManagePlugins.php
Modified : /trunk/Sources/ManageSettings.php
Modified : /trunk/Themes/default/ManageBoards.template.php
Modified : /trunk/other/plugin-info.rng
4738
Features / Re: Using HTML5 form inputs
« on February 27th, 2012, 04:14 PM »
Well, this stuff was primarily about putting it into the admin panel core templates, so it's available everywhere in the admin panel. That is, assuming we don't have stupid stuff where you have multiple numeric fields combined together to make a composite text field, grrr.
But all 'int' fields in the admin templates now use type="number" and I've added a few more min/max places locally and I'll commit them shortly.
Interesting thing to note, at least in Chrome, that the size attribute is no longer respected (though I've left it in for browsers who will fall back to text boxes as standard), and that the presence of min/max (or, just max, not sure) is required to actually set the size of the textbox.
(This, of course, is no way a prelude to functionality for the settings-page support in plugins, of course :whistle:)
But all 'int' fields in the admin templates now use type="number" and I've added a few more min/max places locally and I'll commit them shortly.
Interesting thing to note, at least in Chrome, that the size attribute is no longer respected (though I've left it in for browsers who will fall back to text boxes as standard), and that the presence of min/max (or, just max, not sure) is required to actually set the size of the textbox.
(This, of course, is no way a prelude to functionality for the settings-page support in plugins, of course :whistle:)
4739
Features / Using HTML5 form inputs
« on February 27th, 2012, 04:06 PM »
This was something Nao mentioned to me based on my contact form plugin, so I thought I'd run with it a bit more.
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)
4740
Features / Re: New revs
« on February 27th, 2012, 03:45 PM »
(3 files, 4KB)
Revision: 1396
Author: arantor
Date: 27 February 2012 14:45:00
Message:
+ Provide better support in the internal admin system for HTML5 types, such as a dedicated email field and being able to set min/max/step on numeric fields. Some of the fields, sadly, can't directly use the facilities for validation that are now present because they do implosion-of-multiple-items to a single text field. (ManageServer.php, ManageSettings.php, Admin.template.php)
----
Modified : /trunk/Sources/ManageServer.php
Modified : /trunk/Sources/ManageSettings.php
Modified : /trunk/Themes/default/Admin.template.php
Revision: 1396
Author: arantor
Date: 27 February 2012 14:45:00
Message:
+ Provide better support in the internal admin system for HTML5 types, such as a dedicated email field and being able to set min/max/step on numeric fields. Some of the fields, sadly, can't directly use the facilities for validation that are now present because they do implosion-of-multiple-items to a single text field. (ManageServer.php, ManageSettings.php, Admin.template.php)
----
Modified : /trunk/Sources/ManageServer.php
Modified : /trunk/Sources/ManageSettings.php
Modified : /trunk/Themes/default/Admin.template.php