In order to make development of Widgets and development within flat easier we have selected/written a couple of JavaScript libraries. I will give a short explanation of all of them:
- SData.js
Our own JavaScript library which allows you to a number of useful things in a very easy way:
* sdata.Ajax.request(options)
A short function that handles your Ajax request and takes care of all cross browser issues
* sdata.Log.info(message)
Adds a message to the log window, if the current document has got a Log window defined
* sdata.Log.clear()
Clears the log window
* sdata.events.Listener.onLoad(function)
Adds an event to the onLoad event of the browser
* sdata.widgets.WidgetLoader
Private function that will look for widget definition inside the HTML document and will replace them by the real widget (inline or mountable)
* sdata.widgets.WidgetPreference.save(prefname, content, callback)
Will save a string against the currently logged in user that can be used to save preferences, save data, …
* sdata.widgets.WidgetPreference.get(prefname, callback)
Will retrieve a preference against the user.
- ExtJS 2.0 (http://extjs.com/)
Pretty good and pretty extensive JavaScript framework which allows us to have dragable windows, floating windows, resizable windows, … without having to reinvent anything and being cross-browser. Once you get used to its syntax, you can do quite a lot with it in a pretty short period of time. We will mainly use this for the iGoogle like portal page and floating widgets.
- SWFUpload (http://swfupload.org/)
SWFUpload is a Flash/JavaScript based library which allows you to upload (multiple) files. It is very easy to use and has got all of the functionality we wanted: doing more than one file at a time, showing upload progress, … This library will also be used by Fluid. We will mainly use this in the QuickFileUpload and QuickDropBox widgets, a filemanager, …
- Trimpath (http://code.google.com/p/trimpath/wiki/JavaScriptTemplates)
Amazingly quick and easy javascript library that allows template rendering based on a JavaScript/JSON object. You put a template in a hidden div or within a div within comments, and you can add fields, for loops, if loops, statements, functions, … to it. Our SData library allows you to call the functions of TrimPath. We use this library in nearly every widget to render data we received from the SData Web Services.
- QueryString
Very simple and small JavaScript library that just allows you to read the querystring from the page you are currently in. We mainly use this to extract the Site id from the site.html page.
- RSH or Really Simple History (http://code.google.com/p/reallysimplehistory/)
This very useful Ajax History library allows us to preserve the functionality of the browser’s Back button. We mainly use this within a worksite when you switch between tools. Because all of this is AJAX and doesn’t reload the page, normally the back button would loose its functionality. Now, when switching to another tool, you can still go back to the previous tool using the Back button.

No comments yet
Comments feed for this article