Mootools javascript library and tomahawk components

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2007 03:19 PM
Recently, I had a request to replace DatePicker control with some calendar control that would improve usability when it comes to handling date values. Since Alfresco is built on MyFaces implementation of JSF, logical choice was to use calendar component from tomahawk library . Unfortunately, it did not work due to the fact that page tag is creating a reference to Mootools, a javascript library which, from what I saw, is used for ajax enabled dashlets and document preview feature (anywhere else?). It is clearly stated on Mootools site that it simply does not work (neither it is their intention to make it work) with other javascript libraries namely prototype or dojo which are heavily used in tomahawk. This effectively prevents usage of tomahawk library of components.
After the above mentioned reference was removed, calendar component plugged into property sheet started to work nicely.
I am not a javascript expert, but I wonder how come that Mootools was chosen over scriptaculous web2.0 javascript library which would not prevent usage of tomahawk? is there a chance to revise this decision?
Kind regards,
Denis
After the above mentioned reference was removed, calendar component plugged into property sheet started to work nicely.
I am not a javascript expert, but I wonder how come that Mootools was chosen over scriptaculous web2.0 javascript library which would not prevent usage of tomahawk? is there a chance to revise this decision?
Kind regards,
Denis
Labels:
- Labels:
-
Archive
14 REPLIES 14
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2008 03:59 AM
Ok, so if we disable Mootools then "Web Forms" will no longer work. I am developing a custom web module (hence the use of Tomahawk) and I am trying to find out the implications of turning off MooTools. I have checked out http://wiki.alfresco.com/wiki/Forms_Developer_Guide but it does not reference this issue.
I only want to disable Mootools for a couple of pages that use some tomahawk components? So, can I remove Mootools for a single page?
I only want to disable Mootools for a couple of pages that use some tomahawk components? So, can I remove Mootools for a single page?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 07:28 AM
I guess turning of mootools for a particular page would involve using a custom <r
age> (on that page) which does not include the mootools javascript reference .
You'll want to avoid having this piece of code in the custom pageTag.
// mootools
// out.write("<script type=\"text/javascript\" src=\"");
// out.write(reqPath);
// out.write("/scripts/ajax/mootools.v1.11.js\"></script>");
I've just done the same and everything still seems to work.
But I am not sure which other parts of Alfresco I have now broken.
Can somebody from the development team eloborate on that ?
Question is : which alfresco functionalities will no longer work is we remove the above piece of code ?

You'll want to avoid having this piece of code in the custom pageTag.
// mootools
// out.write("<script type=\"text/javascript\" src=\"");
// out.write(reqPath);
// out.write("/scripts/ajax/mootools.v1.11.js\"></script>");
I've just done the same and everything still seems to work.
But I am not sure which other parts of Alfresco I have now broken.
Can somebody from the development team eloborate on that ?
Question is : which alfresco functionalities will no longer work is we remove the above piece of code ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 07:56 AM
After further testing I found some functionalities that no longer work after removing mootools (the preview of a document for one as dhalupa pointed out in the inital post)
MikeH : what do you mean when you say :
MikeH : what do you mean when you say :
stub-out the mootools javascript file itself (in scripts/ajax)Can you elaborate on that please ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 10:12 AM
That simply means replace the mootools.v1.11.js file with an empty file of the same name. Prevents a 404 error if you just delete the file.
Mike
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2008 04:59 AM
Well, I made some nasty trick - I put my own version of mootools.js file. It looks like this:
If on page is user richfaces calendar (which is one of first loaded scripts), then mootools is not loaded. I hope it will not destroy WC anywhere.
var scripts= document.getElementsByTagName('script');var calendarLoaded = false;for (var i=0;i<scripts.length;i++){ var script = scripts[i]; var file = script.src; var search = file.lastIndexOf('calendar.js'); if (search>0){ calendarLoaded = true; }}if (calendarLoaded){}else{ /*there is old code*/ }
If on page is user richfaces calendar (which is one of first loaded scripts), then mootools is not loaded. I hope it will not destroy WC anywhere.
