Sunday, 28 July 2013

Week 6

For the sixth week of coding, I worked on the Full Page with Preview version of the UI Options. The Full Page with Preview version requires an iframe where users can preview the changes that they make to the website inside this iframe. I had to figure out a way to convert a Drupal php page into an html file and pass that to the Infusion settings to use inside the iframe. This blog post by Nick Lewis on how to convert a Drupal site to straight HTML was very useful. I've learned of a handy little Drupal function called drupal_http_request() from his blog post which allows you to perform an http request. From there, I just had to save it as an html file using another Drupal function.

There are still some stuff that needs to be resolved with the Fat Panel UI Options namely the custom template that I need to include with the module. I've figured out the best way to provide this and it is by using hook_menu() to register a separate page printing it out and just using drupal_exit() so that it doesn't get rendered with any theme and also the rest of the page like the sidebars and other regions won't be included.

Sunday, 21 July 2013

Week 5 Update


Today is Sunday and I wanted to write an update on my GSOC project. This past week was the fifth week of coding and I’ve had to rewrite a lot of the code that I wrote in the beginning when I started my project. The reason for this is that I had to switch to the latest version of the Infusion Fluid library, version 1.5, and the code that I’ve written when I started was for the current stable version 1.4 of the library. A lot of new files has been added to the latest version of the library, most of which are CSS files. There were also some changes to the API so I had to update my code to reflect these changes.  There will probably be more changes since they’re still continuing to work on it and this is one of the challenges of this project since I am working with a version of the Infusion that's still undergoing lots of changes.

Aside from these changes, I also have implemented some new settings to the module. I have added an option for admins to use a block for the link to the the Full Page and Full Page with Preview UIO so that they can have the option of changing where this link appears on their page by going to the Block configuration page.

My next task is to create a custom template file to replace the default template file for the Fat Panel Frame that comes with the library and include it with my module. I need to use my own template file since my module uses a custom build of the Infusion library and the default template file does not link to the proper js and css files.

Wednesday, 3 July 2013

GSOC Week 3

It's now the third week of coding and last week I've made considerable progress on my module but a lot of work still needs to be done. With the code I've written so far, the module now works with the Fat Panel version of the UI Options. It seems to work on Mac and Windows in IE 10 and 9, Firefox, Chrome, and Safari but for some reason when I tested the module in Ubuntu, it did not work.
 What's next? First I need to figure out what is causing it not to function in Ubuntu. At first I found that the main Infusion.js was not being loaded so I looked at the file permissions and I did find that I had to change some permissions on some of the file in order for it to load. Now that it seems to be properly loading the .js file, I now see some javascript error in the browser's console.
Also, I will need to start working on integrating the other two versions of the UI Options: Full Page and Full Page with Preview. Integrating the Full Page UI Options involves creating a separate page in plain html and integrating that into Drupal. I need to find out the "Drupal Way" of working with static html or if it would be possible to just use a node in Drupal.

Monday, 24 June 2013

The Infusion UI Options module

Last week was the first official week of coding for the GSOC. I've started writing code for the module and have written the module's help page using Drupal's hook_help() function which will probably be modified as I work on the module. I have also started working on the module's config page where the administrator can choose which version of the UIO will be displayed. The three options for this are 'Fat Panel UIO' which is the default, 'Full Page', and 'Full Page with Preview'. I've also added a setting for customizing the text for the "Show/Hide" button of the Fat Panel UIO. So far, the form for this configuration page is working properly and these settings are being saved but that's all they're doing right now.

This week, I plan to work on registering the necessary library files with the Libraries API. The Fluid Infusion Builder lets you download a package that contains all the necessary files including third party libraries that are needed for the Infusion UI Options to work. Three of these third party libraries, jQuery, jQuery UI Core, and jQuery Widgets are already included in the Drupal core. The Infusion package also includes several components and frameworks each contained in their own separate folder within this package, some of which include image files. There's also a directory that contains html files for the different UIO versions (Fat Panel, Full Page...), each of which will have to be conditionally loaded depending on the configuration the administrator has set in the config page. Also some files actually require some modification like changing the links for the script tag to point to the proper .js file. This will need to be done by the user downloading the module.

Best Practices for external libraries for Drupal dictate that users should download them and place them in the sites/all/libraries folder, a folder that is located outside of the module folder. Since the Fluid Infusion Builder downloads a package with all these different frameworks, components and libraries, the challenge here would be to come up with the most optimal way to load the necessary files for each page by using the proper Drupal hooks, figuring out which files should be defined using Libraries API's hook_libraries_info, possibly writing some custom callback functions, while making sure that setup and installation doesn't get too cumbersome for the user.

Monday, 17 June 2013

Google Summer of Code

I will be participating in Google Summer of Code this year. The project that I will be working on is the Drupal Plugins for Infusion Components Project with Inclusive Design Institute. This project aims to integrate Fluid Infusion's User Interface Options into Drupal.

The UI Options improves a site's accessibility by giving users an interface that allow them to control the font size, adjust the contrast and simplify the page's layout among other things.

My project consists of two parts; the first one is writing a module for Drupal that will integrate the Infusion's UIO component into Drupal and the second part will be the creation of a Drupal theme that is optimized for this module.

I'm going to be writing this module for Drupal 7 and I will be utilizing the Libraries API for the external libraries. I also plan to add a configuration page for this module which will give site administrators the option to either have the Fat Panel UI, Full Page UI, or Full Page with Preview UI as the default interface that their users see.

The module can be used with any Drupal theme but for the second part of this project, I will be building a Drupal theme that is optimized for this module. For this, I am planning to use Zen as my base theme because it supports a lot of accessibility features.

I will be writing a lot more about my GSOC project on this blog and I will be using this blog to document my progress.