Re: [Hastymail-devel] HastyMail2 - Display Switching
Brought to you by:
sailfrog,
slushpupie
From: Jason M. <ja...@ha...> - 2012-01-17 00:33:07
|
On Fri, 13 Jan 2012 15:11:07 -0600 Jacob Fortune <jfo...@do...> wrote > Jason, > > I have created a plugin for use with HastyMail2 that enables quickly > switching between "Default" and "Simple" display modes. This was a > suggestion by Jesse Thompson for use with the WiscMail web client. It > is a very simple plugin that adds a "Simple Display" link to the end of > the menu that will change the display mode to "Simple" for the current > session only. The benefit of the plugin is to allow users on mobile > devices to quickly and easily switch from the default display to simple > display temporarily. It would also aid in accessibility for screen > readers to easily find and switch to a more comfortable view when first > accessing the client. > > In working on creating the plugin, I found that there is no hook to > change the menu in the simple display mode. To add a "Full Display" > link to switch back to the default display mode, I needed to directly > modify the theme template's /main.php/ file. This change would need to > be made to each template's /main.php/ file in order to include the > toggle link in each Theme. > > Jesse has suggested I contact you regarding this. We would prefer not > to have a fork of the main HastyMail2 source, since it would complicate > future updates. I have two potential requests for you to consider: > > My first solution is for you to consider modifying the source to include > a built-in display mode toggle similar to what I have done with this plugin. > > Second, you could alter the plugin architecture to include a display > hook for when a user is in simple display mode. In staying with the > goal of keeping simple display mode very light and minimal, this could > be an optional switch for plugins that is not utilized by default, thus > preventing modification of the simple display mode. The scope of this > change would allow others to create plugins that modified simple display > mode without modifying the source, which is preferable. Hooks are cheap by design and it should be trivial to add some simple mode specific hooks to the templates to provide simple mode only plugin modifications. I definitely don't want you to have to fork the main codebase so we will either use the plugin with the additional hooks or merge the feature into the base code. > Attached is the plugin for you to take a look at if you're interested. > In addition to including the "./plugin/display_switch/*" directory, I've > also included the "./themes/default/templates/main.php" file with the > added line required to add the link to full display at line 119 (as well > as a comment). This change would need to be made to other themes as > well, but I have not included them. I am interested and would like to include this either as a plugin or integrated. I'm leaning toward leaving it as a plugin and adding the requisite hooks to simple mode but I have not looked at the code yet :). If I get a chance I will review it tonight and let you know. Thanks very much! Jason Munro ja...@ha... http://www.hastymail.org |