diff -r 000000000000 -r 40c8f766c9b8 src/cm/media/js/lib/flexible-js-formatting/combo-box/combo-box.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/flexible-js-formatting/combo-box/combo-box.js Mon Nov 23 15:14:29 2009 +0100 @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2004 Baron Schwartz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, version 2.1. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +var key; +var combo; + +document.onkeydown = function(e) { + if (combo && combo.editing && window.event && window.event.keyCode == 8) { + window.event.cancelBubble = true; + window.event.returnValue = false; + if (combo.insertSpace) { + combo.insertSpace = false; + } + else { + with (combo.options[combo.options.length - 1]) { + text = text.substring(0, text.length - 1); + } + } + } +} + +function edit(e) { + if (window.event){ + key = window.event.keyCode; + combo = window.event.srcElement; + // Stop the browser from scrolling through