|
|
|
@ -26,17 +26,6 @@ |
|
|
|
|
// See doc/COPYRIGHT.rdoc for more details.
|
|
|
|
|
//++
|
|
|
|
|
|
|
|
|
|
function swapOptions(theSel, index1, index2) |
|
|
|
|
{ |
|
|
|
|
var text, value; |
|
|
|
|
text = theSel.options[index1].text; |
|
|
|
|
value = theSel.options[index1].value; |
|
|
|
|
theSel.options[index1].text = theSel.options[index2].text; |
|
|
|
|
theSel.options[index1].value = theSel.options[index2].value; |
|
|
|
|
theSel.options[index2].text = text; |
|
|
|
|
theSel.options[index2].value = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function moveOptions(sourceId, destId) { |
|
|
|
|
var sourceSelection = jQuery('#' + sourceId); |
|
|
|
|
var destSelection = jQuery('#' + destId); |
|
|
|
@ -52,20 +41,24 @@ function moveOptions(sourceId, destId) { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function moveOptionUp(theSel) { |
|
|
|
|
var index = theSel.selectedIndex; |
|
|
|
|
if (index > 0) { |
|
|
|
|
swapOptions(theSel, index-1, index); |
|
|
|
|
theSel.selectedIndex = index-1; |
|
|
|
|
} |
|
|
|
|
function swapOptions(option1, option2) { |
|
|
|
|
if (option1.length == 1 && option2.length == 1) { |
|
|
|
|
option2.after(option1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function moveOptionDown(theSel) { |
|
|
|
|
var index = theSel.selectedIndex; |
|
|
|
|
if (index < theSel.length - 1) { |
|
|
|
|
swapOptions(theSel, index, index+1); |
|
|
|
|
theSel.selectedIndex = index+1; |
|
|
|
|
} |
|
|
|
|
function moveOptionUp(selectionId) { |
|
|
|
|
var selection = jQuery('#' + selectionId); |
|
|
|
|
var selectedOptions = selection.find('option:selected'); |
|
|
|
|
|
|
|
|
|
swapOptions(selectedOptions.prev(), selectedOptions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function moveOptionDown(selectionId) { |
|
|
|
|
var selection = jQuery('#' + selectionId); |
|
|
|
|
var selectedOptions = selection.find('option:selected'); |
|
|
|
|
|
|
|
|
|
swapOptions(selectedOptions, selectedOptions.next()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function selectAllOptions(id) |
|
|
|
|