forked from XoopsModules25x/smartfaq
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
159 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,96 @@ | ||
function addSelectedItemsToParent() { | ||
self.opener.addToParentList(window.document.forms[0].destList); | ||
window.close(); | ||
self.opener.addToParentList(window.document.forms[0].destList); | ||
window.close(); | ||
} | ||
|
||
// Fill the selcted item list with the items already present in parent. | ||
function fillInitialDestList() { | ||
var destList = window.document.forms[0].destList; | ||
var srcList = self.opener.window.document.forms[0].elements['moderators[]']; | ||
for (var count = destList.options.length - 1; count >= 0; count--) { | ||
destList.options[count] = null; | ||
} | ||
for(var i = 0; i < srcList.options.length; i++) { | ||
if (srcList.options[i] != null) | ||
destList.options[i] = new Option(srcList.options[i].text); | ||
} | ||
var destList = window.document.forms[0].destList; | ||
var srcList = self.opener.window.document.forms[0].elements['moderators[]']; | ||
for (var count = destList.options.length - 1; count >= 0; count--) { | ||
destList.options[count] = null; | ||
} | ||
for (var i = 0; i < srcList.options.length; i++) { | ||
if (srcList.options[i] != null) | ||
destList.options[i] = new Option(srcList.options[i].text); | ||
} | ||
} | ||
|
||
// Add the selected items from the source to destination list | ||
function addSrcToDestList() { | ||
destList = window.document.forms[0].destList; | ||
srcList = window.document.forms[0].srcList; | ||
var len = destList.length; | ||
for(var i = 0; i < srcList.length; i++) { | ||
if ((srcList.options[i] != null) && (srcList.options[i].selected)) { | ||
//Check if this value already exist in the destList or not | ||
//if not then add it otherwise do not add it. | ||
var found = false; | ||
for(var count = 0; count < len; count++) { | ||
if (destList.options[count] != null) { | ||
if (srcList.options[i].text == destList.options[count].text) { | ||
found = true; | ||
break; | ||
} | ||
} | ||
} | ||
if (found != true) { | ||
destList.options[len] = new Option(srcList.options[i].text); | ||
len++; | ||
} | ||
} | ||
} | ||
destList = window.document.forms[0].destList; | ||
srcList = window.document.forms[0].srcList; | ||
var len = destList.length; | ||
for (var i = 0; i < srcList.length; i++) { | ||
if ((srcList.options[i] != null) && (srcList.options[i].selected)) { | ||
//Check if this value already exist in the destList or not | ||
//if not then add it otherwise do not add it. | ||
var found = false; | ||
for (var count = 0; count < len; count++) { | ||
if (destList.options[count] != null) { | ||
if (srcList.options[i].text == destList.options[count].text) { | ||
found = true; | ||
break; | ||
} | ||
} | ||
} | ||
if (found != true) { | ||
destList.options[len] = new Option(srcList.options[i].text); | ||
len++; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Deletes from the destination list. | ||
function deleteFromDestList() { | ||
var destList = window.document.forms[0].destList; | ||
var len = destList.options.length; | ||
for(var i = (len-1); i >= 0; i--) { | ||
if ((destList.options[i] != null) && (destList.options[i].selected == true)) { | ||
destList.options[i] = null; | ||
} | ||
} | ||
var destList = window.document.forms[0].destList; | ||
var len = destList.options.length; | ||
for (var i = (len - 1); i >= 0; i--) { | ||
if ((destList.options[i] != null) && (destList.options[i].selected == true)) { | ||
destList.options[i] = null; | ||
} | ||
} | ||
} | ||
|
||
|
||
function small_window(myurl, w, h) { | ||
// La ventana se llama "Add_from_Src_to_Dest" | ||
var newWindow; | ||
LeftPosition = (screen.width)? (screen.width-w)/2 : 0; | ||
TopPosition = (screen.height)? (screen.height-h)/2 : 0; | ||
newWindow = window.open(myurl, "Add_from_Src_to_Dest", 'left='+LeftPosition+',top='+TopPosition+',width='+w+', height='+h+',scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no'); | ||
// La ventana se llama "Add_from_Src_to_Dest" | ||
var newWindow; | ||
LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0; | ||
TopPosition = (screen.height) ? (screen.height - h) / 2 : 0; | ||
newWindow = window.open(myurl, "Add_from_Src_to_Dest", 'left=' + LeftPosition + ',top=' + TopPosition + ',width=' + w + ', height=' + h + ',scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no'); | ||
} | ||
|
||
// Adds the list of selected items selected in the child | ||
// window to its list. It is called by child window to do so. | ||
// window to its list. It is called by child window to do so. | ||
function addToParentList(sourceList) { | ||
destinationList = window.document.forms[0].elements['moderators[]']; | ||
for(var count = destinationList.options.length - 1; count >= 0; count--) { | ||
destinationList.options[count] = null; | ||
} | ||
for(var i = 0; i < sourceList.options.length; i++) { | ||
if (sourceList.options[i] != null) | ||
destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value ); | ||
} | ||
destinationList = window.document.forms[0].elements['moderators[]']; | ||
for (var count = destinationList.options.length - 1; count >= 0; count--) { | ||
destinationList.options[count] = null; | ||
} | ||
for (var i = 0; i < sourceList.options.length; i++) { | ||
if (sourceList.options[i] != null) | ||
destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value); | ||
} | ||
} | ||
|
||
// Marks all the items as selected for the submit button. | ||
// Marks all the items as selected for the submit button. | ||
function selectList(sourceList) { | ||
sourceList = window.document.forms[0].elements['moderators[]']; | ||
for(var i = 0; i < sourceList.options.length; i++) { | ||
if (sourceList.options[i] != null) | ||
sourceList.options[i].selected = true; | ||
} | ||
return true; | ||
sourceList = window.document.forms[0].elements['moderators[]']; | ||
for (var i = 0; i < sourceList.options.length; i++) { | ||
if (sourceList.options[i] != null) | ||
sourceList.options[i].selected = true; | ||
} | ||
return true; | ||
} | ||
|
||
// Deletes the selected items of supplied list. | ||
function deleteSelectedItemsFromList(sourceList) { | ||
var maxCnt = sourceList.options.length; | ||
for(var i = maxCnt - 1; i >= 0; i--) { | ||
if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) { | ||
sourceList.options[i] = null; | ||
} | ||
} | ||
var maxCnt = sourceList.options.length; | ||
for (var i = maxCnt - 1; i >= 0; i--) { | ||
if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) { | ||
sourceList.options[i] = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* | ||
* | ||
* Module: SmartFAQ | ||
* Author: The SmartFactory <www.smartfactory.ca> | ||
* Licence: GNU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.