version 1.71, 2016/05/13 22:48:14
|
version 1.71.8.1, 2021/03/08 14:27:57
|
Line 440 function stringeval() {
|
Line 440 function stringeval() {
|
draw(); |
draw(); |
} |
} |
|
|
|
function ipstringeval() { |
|
var patternIp = /^([\[\]a-zA-Z\.\d\*\-]+)$/; |
|
var acctypes = new Array; |
|
acctypes = ['allow','deny']; |
|
svalue = ''; |
|
for (var i=0; i<acctypes.length; i++) { |
|
var items = choices.document.getElementsByName('setip'+acctypes[i]); |
|
if (items.length > 0) { |
|
for (var j=0; j<items.length; j++) { |
|
if (items[j].type == "text") { |
|
var possip = items[j].value; |
|
possip = possip.replace(/^\s+|\s+$/g,''); |
|
if (patternIp.test(possip)) { |
|
if (acctypes[i] == 'deny') { |
|
possip = '!'+possip; |
|
} |
|
if (svalue == '') { |
|
svalue = possip; |
|
} else { |
|
svalue += ','+possip; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
function addIpRule(iptype) { |
|
var frame = window.frames["choices"]; |
|
if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) { |
|
var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype); |
|
var count = innerDiv.childNodes.length |
|
var ipDiv = frame.document.createElement('div'); |
|
ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+ |
|
'<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>'; |
|
frame.document.getElementById('LC_string_ipacc_inner_'+iptype).appendChild(ipDiv); |
|
} |
|
return false; |
|
} |
|
|
|
function removeIpRule(iptype,num) { |
|
var frame = window.frames["choices"]; |
|
if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) { |
|
var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype); |
|
for (var i=0; i<innerDiv.childNodes.length; i++) { |
|
if (i==num) { |
|
innerDiv.removeChild(innerDiv.childNodes[i]); |
|
ipstringeval(); |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
|
function radiostringeval(newval) { |
function radiostringeval(newval) { |
svalue=newval; |
svalue=newval; |
draw(); |
draw(); |
Line 490 function draw() {
|
Line 545 function draw() {
|
choicewrite(' action="javascript:floateval();"'); |
choicewrite(' action="javascript:floateval();"'); |
} |
} |
if (ptype=='string') { |
if (ptype=='string') { |
choicewrite(' action="javascript:stringeval();"'); |
if (pscat == 'ip') { |
|
choicewrite(' action="javascript:ipstringeval();"'); |
|
} else { |
|
choicewrite(' action="javascript:stringeval();"'); |
|
} |
} |
} |
if (ptype != 'int' && ptype != 'float' && ptype != 'string') { |
if (ptype != 'int' && ptype != 'float' && ptype != 'string') { |
choicewrite(' action=""'); |
choicewrite(' action=""'); |
Line 705 function draw() {
|
Line 764 function draw() {
|
} |
} |
|
|
if (ptype=='string') { |
if (ptype=='string') { |
if ((pscat=='any') || (pscat=='') || (pscat=='default') || |
if ((pscat=='any') || (pscat=='') || (pscat=='default') || |
(typeof(pscat)=='undefined')) { |
(typeof(pscat)=='undefined')) { |
tablestart('Text'); |
tablestart('Text'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
Line 774 function draw() {
|
Line 833 function draw() {
|
choicewrite('<label><input name="stringval" value="exam"'+ |
choicewrite('<label><input name="stringval" value="exam"'+ |
' type="radio" '+callradiostringeval('exam')); |
' type="radio" '+callradiostringeval('exam')); |
if (svalue=='exam') { choicewrite(' checked="checked"'); } |
if (svalue=='exam') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Bubblesheet Exam</label><br />'); |
choicewrite(' /> Exam</label><br />'); |
// choicewrite('<label><input name="stringval" value="assess"'+ |
// choicewrite('<label><input name="stringval" value="assess"'+ |
// ' type="radio" '+callradiostringeval('assess')); |
// ' type="radio" '+callradiostringeval('assess')); |
// if (svalue=='assess') { choicewrite(' checked="checked"'); } |
// if (svalue=='assess') { choicewrite(' checked="checked"'); } |
Line 841 function draw() {
|
Line 900 function draw() {
|
choicewrite(' /> No</label><br />'); |
choicewrite(' /> No</label><br />'); |
} |
} |
if (pscat=='ip') { |
if (pscat=='ip') { |
tablestart('IP Number/Name'); |
var currallow = new Array; |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
var currdeny = new Array; |
choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+ |
if ((svalue != '') && (svalue != null)) { |
'" onchange="parent.stringeval()" />'); |
var patternComma = /,/; |
|
var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/; |
|
var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/; |
|
var current = new Array; |
|
if (patternComma.test(svalue)) { |
|
current = svalue.split(','); |
|
} else { |
|
current = [svalue]; |
|
} |
|
for (var i=0; i<current.length; i++) { |
|
if (patternDeny.test(current[i])) { |
|
var denied = current[i].replace(/^!/,''); |
|
currdeny.push(denied); |
|
} else { |
|
if (patternAllow.test(current[i])) { |
|
currallow.push(current[i]); |
|
} |
|
} |
|
} |
|
} |
|
if (currdeny.length == 0) { |
|
currdeny = (''); |
|
} |
|
if (currallow.length == 0) { |
|
currallow = (''); |
|
} |
|
var curripaccess = [currallow,currdeny]; |
|
tablestart('IP Number/Name'); |
|
choicewrite('<tr><th>Allow from</th><th>Deny from</th></tr><tr>'); |
|
var acctypes = ['allow','deny']; |
|
for (var i=0; i<acctypes.length; i++) { |
|
choicewrite('<td valign="top">'+ |
|
'<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+ |
|
'<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">'); |
|
for (var j=0; j<curripaccess[i].length; j++) { |
|
choicewrite('<div><input type="text" size="10" name="setip'+acctypes[i]+'" value="'+curripaccess[i][j]+'" onblur="parent.ipstringeval();" />'); |
|
choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>'); |
|
choicewrite('</div>'); |
|
} |
|
choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>'); |
|
} |
|
choicewrite('</div></td></tr></table>'); |
} |
} |
if (pscat=='fileext') { |
if (pscat=='fileext') { |
tablestart('Allowed File Extensions'); |
tablestart('Allowed File Extensions'); |
Line 875 function draw() {
|
Line 975 function draw() {
|
choicewrite('<label><input name="stringval" value="resource"'+ |
choicewrite('<label><input name="stringval" value="resource"'+ |
' type="radio" '+callradiostringeval('resource')); |
' type="radio" '+callradiostringeval('resource')); |
if (svalue=='resource') { choicewrite(' checked="checked"'); } |
if (svalue=='resource') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes, and the scope of student selected slot is a single resource.</label><br />'); |
choicewrite(' /> Yes, and the scope of the slot is a single resource.</label><br />'); |
choicewrite('<label><input name="stringval" value="map"'+ |
choicewrite('<label><input name="stringval" value="map"'+ |
' type="radio" '+callradiostringeval('map')); |
' type="radio" '+callradiostringeval('map')); |
if (svalue=='map') { choicewrite(' checked="checked"'); } |
if (svalue=='map') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />'); |
choicewrite(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, it applies to only one resource.</label><br />'); |
choicewrite('<label><input name="stringval" value="map_map"'+ |
choicewrite('<label><input name="stringval" value="map_map"'+ |
' type="radio" '+callradiostringeval('map_map')); |
' type="radio" '+callradiostringeval('map_map')); |
if (svalue=='map_map') { choicewrite(' checked="checked"'); } |
if (svalue=='map_map') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />'); |
choicewrite(' /> Yes, and the scope of the slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />'); |
choicewrite('</td></tr></table>'); |
choicewrite('</td></tr></table>'); |
} |
} |
} |
} |
Line 1202 function init() {
|
Line 1302 function init() {
|
selwrite('</body></html>'); |
selwrite('</body></html>'); |
this.window.selector.document.close(); |
this.window.selector.document.close(); |
draw(); |
draw(); |
|
|
} |
} |
|
|
// ]]> |
// ]]> |