benotman's blog

MDN 6/11/2015

I am working again on designing the MDN interface; I had some design options in my original plan which needed some assessment after gaining some experience in Drupal. I decided to include a thumbnail of each diagram to be used in browsing diagrams. In one side of the front page, I will show a a small MDN button(thumbnail) that includes thumbnails of some diagrams. When users click on the MDN button they expand the page side and see one or two diagrams. To do that I am trying to advance my knowledge about Drupal themes and css.

MDN 6/10/2015

Today I finsihed what I was trying to do last week. I was able to load a drupal node in a block generated by my module. Now when a user clicks on an element (shape) in a diagram related node(s) will show up in another block. I had two problems that I was able to solve. I had a "clean url" issue that prevented my menu_hook from working (clean url option is not enabled because I am hosting the site on the cat server). I was able to work around this issue. The second thing is that my ajax request was returning a full page (including footer and other sections) instead of only the requested node html. This issue was solved too.

Today also I attended the Drupal_Portland meeting downtown. I was able to get the contact info. of the drupal-frontend group organizer; I will probably email him for help and suggestions. Also, I found out that a weekly meeting is held on Saturdays for help and mentoring and that I can come and ask for help. Finally, one of the organizers who (I think) works for told me that I can get free(or discount) membership in the site since I work in GSoC.

MDN 6/7/2015

Not much done today. On Monday or Tuesday, I will ask a friend who has a drupal site with a similar functionality to the one I am trying to do. That will save me some time. The issue I am working on right now is where to show nodes (related nodes to selected elements in the diagrams). I am not sure whether to show these nodes in another block generated by my module or in the main content block that comes with Drupal. This week also I will be attending the Drupal-Portland group meeting.

MDN 6/5/2015

I am working on loading a specific Drupal node to display on the screen. In MDN, an end user can select (by clicking) some elements (shapes) on diagram(s) and retrieve a list of links to related pages; end users can then click on one of the links to display a page. I am investigating hook_menu and the use of ajax to figure out the best way to do this.

MDN 6/4/2015

Today I figured out how to add JS code to SVG image in my drupal module (PHP code). Now users (content authors) can load an SVG picture containing a diagram. The MDN back end (PHP code) will attach event listeners to specific SVG elements (such as shapes); those listeners will pass events such as clicks and mouseovers to my the MDN front-end (JavaScript code) so MDN can interact with users (end users). Most of the work in the last few days was about getting things to work in Drupal. As time passes I get more comfortable with Drupal and I get more MDN functionality done.

MDN 6/3/2015

Today I was trying to attach event listeners to SVG elements. I need that to pass events such as clicks and mouseovers from SVG elements (shapes) to my module javascript code. Attaching event listeners from javascript does not seem to work. SVG has some differences with HTML and therefore some functions including JQuery functions may not work properly with SVG. The approach I am thinking about right now is to attach event listeners to SVG elements in PHP using DOM; I am not sure if that is possible, but I will find out soon. I already tested passing events between the SVG and my module JS code in the parent document; it works :). I added the event listeners to SVG elements manually. The next step is to attach those event listeners automatically in PHP.

MDN 6/2/2015

Today I started working on attaching JavaScript code to Drupal pages. There are many ways to do that; I am trying to find the approach that works for me as I will be dealing with html and svg in the page. Currently the JavaScript code I attach to a drupal page works but it is not attaching event listeners to SVG elements. I hope to figure out the problem tomorrow since I will be working full time on the project; today I had other things to do!

MDN 5/31/2015

Because of an error in creating a drupal subtheme, my whole site crashed. I was not able to access drupal configuration to disable the subtheme so I had to reinstall drupal. Then I was able to create a subtheme and change the width of the left sidebar to display a large diagram in it. More work will be needed to adjust the CSS to extend the width of the page and to better display both MDN (diagrams) and the current page.

MDN 5/30/2015

I have been learning about Drupal themes. In order to display MDN, it looks that I will need to create my won subtheme to support wider regions (e.g., content or side regions in a page). I tried to create a subtheme but I had some Drupal php errors. I have to restore my site and try again. Probably I will have a subtheme ready by tomorrow and have a diagram or two displayed on my Drupal site.

MDN 5/28/2015

Multiple Diagram Navigation (MDN) 5/28/2015 I am currently looking for a way to display MDN widget in Drupal. I had a prototype of MDN where users could see two diagrams on one side of the screen and read a page on the other side. This layout is the typical way to use MDN since users can go back and forth between pages(details) to diagrams(overview). In Drupal, in order to do that I will probably have to find or create my own theme that allows me to have a wide page (wide resolution) to show both diagrams and a page together. Another alternative is to have a small button or thumbnail of MDN that can be displayed in a block; users can click on that button/thumbnail to open a the MDN window(div) on top of the main page. I am trying to choose the best approach and find out how to do it in Drupal. In the next few hours I will try to learn and experiment with Drupal themes to get some insight.

Syndicate content