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