diff options
author | wurblzap%gmail.com <> | 2007-08-03 03:38:37 +0000 |
---|---|---|
committer | wurblzap%gmail.com <> | 2007-08-03 03:38:37 +0000 |
commit | 6a58d3ebb9fc536ba8c16a374787077f21b94c89 (patch) | |
tree | f54f1d4bfe52985e56cae42860966bc3c7048edb /js | |
parent | 037a33e69b2d25f83d1fdd16bab2068a391205eb (diff) | |
download | bugs-6a58d3ebb9fc536ba8c16a374787077f21b94c89.tar bugs-6a58d3ebb9fc536ba8c16a374787077f21b94c89.tar.gz bugs-6a58d3ebb9fc536ba8c16a374787077f21b94c89.tar.bz2 bugs-6a58d3ebb9fc536ba8c16a374787077f21b94c89.tar.xz bugs-6a58d3ebb9fc536ba8c16a374787077f21b94c89.zip |
Bug 380187 â Bugzilla should support RADIUS authentication.
Patch by Marc Schumann <wurblzap@gmail.com>;
r=mkanat, a=mkanat
Diffstat (limited to 'js')
-rwxr-xr-x | js/params.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/js/params.js b/js/params.js new file mode 100755 index 000000000..453740799 --- /dev/null +++ b/js/params.js @@ -0,0 +1,61 @@ +/* The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Bugzilla Bug Tracking System. + * + * The Initial Developer of the Original Code is Marc Schumann. + * Portions created by Marc Schumann are Copyright (c) 2007 Marc Schumann. + * All rights reserved. + * + * Contributor(s): Marc Schumann <wurblzap@gmail.com> + */ + +function sortedList_moveItem(paramName, direction, separator) { + var select = document.getElementById('select_' + paramName); + var inputField = document.getElementById('input_' + paramName); + var currentIndex = select.selectedIndex; + var newIndex = currentIndex + direction; + var optionCurrentIndex; + var optionNewIndex; + + /* Return if no selection */ + if (currentIndex < 0) return; + /* Return if trying to move upward out of list */ + if (newIndex < 0) return; + /* Return if trying to move downward out of list */ + if (newIndex >= select.length) return; + + /* Move selection */ + optionNewIndex = select.options[newIndex]; + optionCurrentIndex = select.options[currentIndex]; + /* Because some browsers don't accept the same option object twice in a + * selection list, we need to put a blank option here first */ + select.options[newIndex] = new Option(); + select.options[currentIndex] = optionNewIndex; + select.options[newIndex] = optionCurrentIndex; + select.selectedIndex = newIndex; + populateInputField(select, inputField, separator); +} + +function populateInputField(select, inputField, separator) { + var i; + var stringRepresentation = ''; + + for (i = 0; i < select.length; i++) { + if (select.options[i].value == separator) { + break; + } + if (stringRepresentation != '') { + stringRepresentation += ','; + } + stringRepresentation += select.options[i].value; + } + inputField.value = stringRepresentation; +} |