toolbar.js

This is the Toolbar Class for the CNET History Toolbar.  I have not yet converted these docs to NaturalDocs format, so they are likely to be somewhat ugly.a.n.

initialize creates a new toolbar element

  • calls getCornerPosition to establish the upper left corner of the bar
  • calls repositionBar to set up bar
  • sets window.onresize to CTB resize event
  • unfreezes the bar on resize

rebuild rebuilds the icons in the toolbar

  • calls fadeIconDock
  • calls addIcons
  • calls repositionBar
  • calls fadeIconDock after a timeout to fade back in

onresize just calls repositionBar (for now; later it may also, for instance, hide any popups for any selected icon)

movebar moves the bar background to an offset (hide/unhide)

  • implodeIcons

repositionBar calls setDimensionsAndPositionBar after a timeout

offsetIconTops repositions all the icons in the bar based on their size

getCornerPosition gets the appropriate reference corner for the bar

  • based on $(this.iconDockId)

setDimensionsAndPositionBar repositions the bar to the appropriate location on the page

  • calls setWindowDimensions (forces)
  • calls offsetIconTops
  • calls fitListToWindow

fitListToWindow hides/unhides the appropriate number of icons on the page

  • calls calculateMaxIcons
  • calls fadeIcon to fade icons in

calculateMaxIcons figures out the maximum allowable number of icons for the page width

  • refers to this.frameWidth, set by setWindowDimensions

toggle hides/unhides the bar

  • calls moveBar

addIcons adds a group of icons to the bar in batch

  • calls addIcon for each icon passed in
  • calls offsetIconTops when it’s finished
  • calls fitListToWindow when it’s finished

addIcon creates a ICON object

  • optionally calls repositionBar
  • optionally calls fitListToWindow
  • calls reloadIcon on the icon to set the initial size

removeIcons removes Icons from the bar

  • calls implodeIcons
  • calls fitListToWindow
  • calls offsetIconTops

fadeIconDock fades the entire iconDock in and out

fadeIcons fades the icons in the bar in and out

  • calls fadeIcon

fadeIcon fades an individual icon in and out

toggleFreeze turns the animation of the bar on and off

  • calls explodeIcon

explodeIcon zooms in on an icon

  • calls itself
  • calls resizeSelectedAndNeighbors on each icon
  • calls offsetIconTops

implodeIcons shrinks an icon

  • calls itself
  • calls resizeSelectedAndNeighbors on each icon
  • calls offsetIconTops

imgOver evaluates any mouseover behavior and resizes the image

  • calls explodeIcon
  • calls evalEvent on the icon

imgOut evaluates any mouseout behavior and resizes the image

  • calls implodeIcons
  • calls evalEvent on the icon

imgClick evaluates any click behavior

  • calls evalEvent on the icon

setWindowDimensions figures the window width and height

Icon initialize creates an ICON, sets some css, sets up event handlers

  • calls sizeImg
  • if fading in, creates moo.fx and fades in
  • sets display = block

evalEvent evaluates code on an event fire replaces %thisIndex% w/ the icon’s index against the action

sizeImg sets the width and height of the icon based on the animation array

resizeSelectedAndNeightbors determines the proper index of the animation index for the image and then calls sizeImg to size it

  • calls sizeImg

reloadIcon if the icon isn’t loaded, makes the image visible and calls sizeImg to size the image

  • calls sizeImg
Summary
toolbar.js
Change Log$Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/layout.widgets/toolbar.js,v $ $Log: toolbar.js,v $ Revision 1.2 2007/02/21 00:29:25 newtona switched Class.create to Class.empty

Change Log

$Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/layout.widgets/toolbar.js,v $ $Log: toolbar.js,v $ Revision 1.2 2007/02/21 00:29:25 newtona switched Class.create to Class.empty

Revision 1.1 2007/01/09 02:39:35 newtona renamed addons directory to “common” directory

Revision 1.3 2006/11/21 23:55:42 newtona documentation update

Revision 1.2 2006/11/13 23:53:04 newtona added cvs footer