X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/3c4367d8e03450e9a73e61f4247145d2b6c86a33..959d888c17d1403d2eeecc19bc4b5e2c8d1debf6:/Products/Plinn/skins/ajax_scripts/palette.js diff --git a/Products/Plinn/skins/ajax_scripts/palette.js b/Products/Plinn/skins/ajax_scripts/palette.js new file mode 100644 index 0000000..556d3f5 --- /dev/null +++ b/Products/Plinn/skins/ajax_scripts/palette.js @@ -0,0 +1,56 @@ +// (c) Benoît PIN 2006 +// http://plinn.org +// Licence GPL +// +// + + +function InspectorPalette(baseUrl, toggleButton, contentNode, onExpand, onCollapse) { + var thisInspector = this; + this._preloadImages(); + this.baseUrl = baseUrl; + this.toggleButton = toggleButton; + this.toggleButton.src = baseUrl + '/collapsedPalette.gif'; + this.contentNode = contentNode; + this.expanded = false; + this.onExpand = onExpand ? onExpand : function(){thisInspector.contentNode.innerHTML='expanded';}; + this.onCollapse = onCollapse ? onCollapse : function(){thisInspector.contentNode.innerHTML='collapsed';}; + + toggleButton.onclick = function(evt) { + if (thisInspector.expanded) + thisInspector.collapse(); + else + thisInspector.expand(); + disableDefault(evt); + disablePropagation(evt); + toggleButton.parentNode.blur(); + }; +} + +InspectorPalette.prototype._preloadImages = function() { + var images = ['expandPalette.gif', 'collapsePalette.gif', 'expandedPalette.gif', 'collapsedPalette.gif' ], img; + for (var i=0 ; i