Fixed Point Dashboard
Pyry Ahlfors 2008-
pyry@kiinto.com
Table of contents
INTRODUCTION .......................................................... 1
Including dashboard to external site ........................... 1.1
COMPONENTS ............................................................ 2
kiintopiste_dashboard.js ....................................... 2.1
kiintopiste_ajax.js ............................................ 2.2
kiintopiste_cookies.js ......................................... 2.3
kiintopiste_dock.js ............................................ 2.4
kiintopiste_skins.js ........................................... 2.5
kiintopiste_uicontrol.js ....................................... 2.6
kiintopiste_windowcontrol.js ................................... 2.7
kiintopiste_windowdata.js ...................................... 2.8
FPTOOLS ............................................................... 3
fptools.js ..................................................... 3.1
animate.js ..................................................... 3.2
chrome.js ...................................................... 3.3
gradient.js .................................................... 3.4
linkparser.js .................................................. 3.5
Widgets ............................................................... 4
Ajax Chat ...................................................... 4.1
Google Weather ................................................. 4.2
Youtube ........................................................ 4.3
1. INTRODUCTION
-------------------------------------------------------------------------------
Fixed Point Dashboard is a javascript based widget platform. It allows you to
create sophisticated widgets easily. Built-in ajax routines make it easy to
download content (such as RSS-feeds) from other services.
1.1. INTRODUCTION - Including dashboard to external site
-------------------------------------------------------------------------------
It is possible to run dashboard on top of any page. Just include following code
inside HEAD -tag
<!-- Fixed Point Dashboard / -->
<link href="http://www.kiinto.com/experiments/javascript/dashboard/css/overlay.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var dashboardEnableDock = false;
var dashboardShowInitStatus = false;
var dashboardScriptPath = 'http://www.kiinto.com/experiments/javascript/dashboard/';
var fpToolsPath = 'http://www.kiinto.com/experiments/javascript/dashboard/';
</script>
<script src="http://www.kiinto.com/experiments/javascript/dashboard/lib/common.js" type="text/javascript"></script>
<script src="http://www.kiinto.com/experiments/javascript/dashboard/lib/tools/fptools.js" type="text/javascript"></script>
<script src="http://www.kiinto.com/experiments/javascript/dashboard/lib/kiintopiste_dashboard.js" type="text/javascript"></script>
<!-- / Fixed Point Dashboard -->
Variables:
dashboardEnableDock : Enable or disable dock.
Default false.
dashboardShowInitStatus : Show Fixed Point Dashboard initializing messages.
Default false.
dashboardDefaultWidgets : Use set of default widgets.
Default true.
2. COMPONENTS
-------------------------------------------------------------------------------
Fixed Point Dashboard is a collection of javascript functions for different use
binded together. There are script libraries for window handling, Ajax routines,
user interface and so on.
2.1. Components - kiintopiste_dashboard.js
-------------------------------------------------------------------------------
kiintopiste_dashboard.js is a object that loads and executes all needed
components.
fixedPointDashboard.init function is called when the file is loaded. The
function first waits that document.body is ready and FpTools are initialized.
More about FpTools in chapter 3.
When document.body and FpTools are ready the function will execute
fixedPointDashboard.include -function that will load all needed javascripts
that are defined in includeOrder array.
Principles of the function is simple: it checks of the pre-defined object exist
or not.
e.g. ["lib/kiintopiste_uicontrol.js", typeof(fixedPointUiControl)]
^ Javascript file ^ Object name
The function keep checking if fixedPointUiControl -object is different than
undefined. When fixedPointUiControl is something else than undefined the file
must be ready. After that it will move to the next file/object until the whole
array is done.
The inner order of includeOrder array is critical since there are
interactions between different scripts. If the order is wrong some components
may not work.
Back to TOC ^
2.2. Components - kiintopiste_ajax.js
-------------------------------------------------------------------------------
kiintopiste_ajax.js is an AJAX framework that handles all AJAX calls. It allows
you to load content from other web sites.
Since there can be only one ajax request at time fixedPointAjaxFramework uses
and array as an queue to line up the requests. When top of the stack is
processed it will remove the record from array and start with next one
Usage:
fixedPointAjaxFramework.addToLine(['xml_gateway.php', false, this.openFeed,
^1 ^2 ^3
false, 'file=http://domain.com/feed.rss','GET']);
^4 ^5 ^6
1) The actual file that is called
2) Element where the content should be loaded to
3) Function that is initialized after the content is loaded
4) Show loaded content on screen: true/false
5) Parameters
6) Method: POST / GET(default) (not mandatory)
example: fixedPointAjaxFramework.addToLine(['php_gateway.php',
exampleWidget.objectContainer, false, false, 'file=http://www.kiinto.com']);
Loads the content of http://www.kiinto.com (using php_gateway.php) and shows it
on element called exampleWidget.objectContainer
Back to TOC ^
2.3. Components - kiintopiste_cookies.js
-------------------------------------------------------------------------------
2.4. Components - kiintopiste_dock.js
-------------------------------------------------------------------------------
kiintopiste_dock.js creates the toolbar containing widget icons.
2.5. Components - kiintopiste_skins.js
-------------------------------------------------------------------------------
Here you can find definitions for diffent window skins. It helps
kiintopiste_windowcontrol.js to calculate window size and allows you to
create different looking ui windows.
2.6. Components - kiintopiste_uicontrol.js
-------------------------------------------------------------------------------
2.7. Components - kiintopiste_windowcontrol.js
-------------------------------------------------------------------------------
2.8. Components - kiintopiste_windowdata.js
-------------------------------------------------------------------------------
3. FPTOOLS
-------------------------------------------------------------------------------
FpTools or Fixed Point tools is also a collection of different scripts aimed
to make coding easier. It includes libraries for animation (animate.js)
, chromed interface object (chrome.js, gradient fills gradient.js etc.
3.1 FPTOOLS - fptools.js
-------------------------------------------------------------------------------
fptools.js containts the actual fpTools object definition. Besides that, it
includes the fpTools.include -function which allows you to include javascript
files.
e.g. fpTools.include('lib/tools/gradient.js');
3.2 FPTOOLS - animate.js
-------------------------------------------------------------------------------
This library allows you to animate HTML elements. Supported values are
_x, _y, _width, _height and _alpha. You will also need a starting and ending
points plus ratio.
e.g. fpTools.animate.init($("element"), animate._y, 10, 100, 8, 30);
This will animate object which ID is element. Element start position
(style.top) is 100px and end position 0px. Function will create an array
containing animation value for each step. In this case the array looks like
this: [100,87,76,66,57,49,42,36,31,27,20,17,14,12,10,8,7,6,5,4,3,2,1,0]