In order to make the website widgets work within the mobile webapp, it's been necessary to (in order):
- Remove some functions
- Fix links
- Make some fixes / JS events
- Make some elements responsive
All these steps are executed by the processWidgets method of the Widget View class.
- script elements - as they may cause errors that break the ajax navigation.
- Cytoscape Web components have been removed because they use flash.
- Sequence popups have been removed because at the time the processWidget function was written, there wasn't an easy way to implement them.
- Star icons in some widgets (such as references), as login / favorites functions are not present in the webapp
- Search count summary in the references widget
- Sequence download - removed both buttons and content from the DOM
- Google map removed from the Natural isolates widget
- Blast details popup
The URLs are fixed by the 'fixLinks' method of Widgets View.
This operation is done on all '<a>' tags. First, we check if the link is referring to an internal or an external resource by looking at the first part of the URL. If it is external, then the tag is modified to indicate the browser that it should be opened on a new tab. If it is internal, it might either be a link to another object or a link to a search. The URL is manipulated to be compatible with the format of the webapp (as described in the Router page). If a meaningful correspondence cannot be found, the link is very likely point at some resource that has not been implemented on this webapp (e.g. GBrowse) and so it gets treated as an external link.
To fix the images location, the first part of the URL in all the src attributes of img tags have been changed to the content of WBMobile.defaults.WEBSITE_URL