mirror of
https://github.com/moodle/moodle.git
synced 2025-03-15 05:00:06 +01:00
fixed unterminated JS statements
This commit is contained in:
parent
fc0fcb27e2
commit
b532c911e8
@ -29,7 +29,7 @@ onload_class.prototype.add = function(script) {
|
||||
YAHOO.log("onloadobj.add - adding "+script, "junk");
|
||||
}
|
||||
this.scripts[this.scripts.length] = script;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onload_class.prototype.load = function() {
|
||||
@ -40,7 +40,7 @@ onload_class.prototype.load = function() {
|
||||
for (i=0; i<scriptcount; i++) {
|
||||
eval(this.scripts[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var onloadobj = new onload_class();
|
||||
@ -104,7 +104,7 @@ main_class.prototype.process_blocks = function() {
|
||||
this.blocks[i].toggle_hide(null, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.process_document = function() {
|
||||
@ -139,12 +139,12 @@ main_class.prototype.process_document = function() {
|
||||
|
||||
this.adminBlock = YAHOO.util.Dom.getElementsByClassName('block_adminblock')[0];
|
||||
this.tempBlock = YAHOO.util.Dom.getElementsByClassName('tempblockhandler')[0];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.mk_safe_for_transport = function(input) {
|
||||
return input.replace(/&/i, '_.amp._');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//return block by id
|
||||
@ -155,7 +155,7 @@ main_class.prototype.get_block_index = function(el) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.get_section_index = function(el) {
|
||||
@ -165,7 +165,7 @@ main_class.prototype.get_section_index = function(el) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
main_class.prototype.mk_button = function(tag, imgSrc, text, attributes, imgAttributes) {
|
||||
//Create button and return object.
|
||||
@ -197,7 +197,7 @@ main_class.prototype.mk_button = function(tag, imgSrc, text, attributes, imgAttr
|
||||
}
|
||||
image.setAttribute('hspace', '3');
|
||||
return container;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.connect = function(method, urlStub, callback, body) {
|
||||
@ -219,7 +219,7 @@ main_class.prototype.connect = function(method, urlStub, callback, body) {
|
||||
}
|
||||
}
|
||||
return YAHOO.util.Connect.asyncRequest(method, this.portal.strings['wwwroot']+"/course/rest.php?courseId="+main.portal.id+"&sesskey="+this.portal.strings['sesskey']+"&"+urlStub, callback, body);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.connectQueue_add = function(method, urlStub, callback, body) {
|
||||
@ -232,7 +232,7 @@ main_class.prototype.connectQueue_add = function(method, urlStub, callback, body
|
||||
if (main.connectQueueConnection == null || !YAHOO.util.Connect.isCallInProgress(main.connectQueueConnection)) {
|
||||
main.connectQueue_fireNext();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.connectQueue_fireNext = function() {
|
||||
@ -244,13 +244,13 @@ main_class.prototype.connectQueue_fireNext = function() {
|
||||
success: function(){
|
||||
main.connectQueue_fireNext();
|
||||
}
|
||||
}
|
||||
};
|
||||
main.connectQueueConnection = main.connect(main.connectQueue[head]['method'],
|
||||
main.connectQueue[head]['urlStub'],
|
||||
callback,
|
||||
main.connectQueue[head]['body']);
|
||||
main.connectQueueHead++;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.update_marker = function(newMarker) {
|
||||
@ -261,14 +261,14 @@ main_class.prototype.update_marker = function(newMarker) {
|
||||
this.marker.toggle_highlight();
|
||||
|
||||
this.connect('post', 'class=course&field=marker', null, 'value='+this.marker.sectionId);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
main_class.prototype.getString = function(identifier, variable) {
|
||||
if (this.portal.strings[identifier]) {
|
||||
return this.portal.strings[identifier].replace(/_var_/, variable);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
main_class.prototype.is_ie = function() {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
@ -276,7 +276,7 @@ main_class.prototype.is_ie = function() {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var main = new main_class();
|
||||
|
@ -54,7 +54,7 @@ block_class.prototype.init_block = function(id, sGroup, config) {
|
||||
this.originalClass = this.getEl().className;
|
||||
|
||||
this.init_buttons();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.startDrag = function(x, y) {
|
||||
@ -88,7 +88,7 @@ block_class.prototype.startDrag = function(x, y) {
|
||||
targetEl.opacity = .3;
|
||||
targetEl.filter = "alpha(opacity=30)";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
block_class.prototype.endDrag = function() {
|
||||
// reset the linked element styles
|
||||
@ -96,7 +96,7 @@ block_class.prototype.endDrag = function() {
|
||||
s.opacity = 1;
|
||||
s.filter = "alpha(opacity=100)";
|
||||
this.resetTargets();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.onDragDrop = function(e, id) {
|
||||
@ -120,7 +120,7 @@ block_class.prototype.onDragDrop = function(e, id) {
|
||||
//YAHOO.util.DDM.moveToEl(el, oDD.getEl());
|
||||
|
||||
this.resetTargets();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.find_target = function(column){
|
||||
@ -134,7 +134,7 @@ block_class.prototype.find_target = function(column){
|
||||
insertbefore = column.blocks[collisions[0][0]];
|
||||
|
||||
return insertbefore;
|
||||
}
|
||||
};
|
||||
|
||||
block_class.prototype.resetTargets = function() {
|
||||
// reset the target styles
|
||||
@ -145,7 +145,7 @@ block_class.prototype.resetTargets = function() {
|
||||
targetEl.opacity = 1;
|
||||
targetEl.filter = "alpha(opacity=100)";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
block_class.prototype.move_block = function(columnid){
|
||||
if(this.debug)YAHOO.log("Dropped on "+columnid[0]);
|
||||
@ -188,7 +188,7 @@ block_class.prototype.move_block = function(columnid){
|
||||
//insert into new array
|
||||
column.insert_block(this,inserttarget);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.reset_regions = function() {
|
||||
@ -196,7 +196,7 @@ block_class.prototype.reset_regions = function() {
|
||||
for (i=0; i<blockcount; i++) {
|
||||
main.blocks[i].region = YAHOO.util.Region.getRegion(main.blocks[i].getEl());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.init_buttons = function() {
|
||||
@ -214,7 +214,7 @@ block_class.prototype.init_buttons = function() {
|
||||
buttonCont.appendChild(viewbutton);
|
||||
buttonCont.appendChild(deletebutton);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.toggle_hide = function(e, target, isCosmetic) {
|
||||
@ -242,7 +242,7 @@ block_class.prototype.toggle_hide = function(e, target, isCosmetic) {
|
||||
'value=0&instanceId='+this.instanceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.delete_button = function() {
|
||||
@ -265,7 +265,7 @@ block_class.prototype.delete_button = function() {
|
||||
if (this.debug) {
|
||||
YAHOO.log("Deleting "+this.getEl().id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
block_class.prototype.updatePosition = function(index, columnId) {
|
||||
@ -276,7 +276,7 @@ block_class.prototype.updatePosition = function(index, columnId) {
|
||||
if (this.debug) {
|
||||
YAHOO.log("Updating position of "+this.getEl().id+" to index "+index+" on column "+columnId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@ -300,7 +300,7 @@ column_class.prototype.init_column = function(id, group,config,ident){
|
||||
// YAHOO.log("init_column "+id+"-"+el.id);
|
||||
this.region = YAHOO.util.Region.getRegion(id);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
column_class.prototype.find_sub_collision = function(dragRegion){
|
||||
@ -319,11 +319,11 @@ column_class.prototype.find_sub_collision = function(dragRegion){
|
||||
}
|
||||
}
|
||||
return collisions;
|
||||
}
|
||||
};
|
||||
|
||||
column_class.prototype.add_block = function(el){
|
||||
this.blocks[this.blocks.length] = el;
|
||||
}
|
||||
};
|
||||
|
||||
column_class.prototype.insert_block = function(el,targetel){
|
||||
var blockcount = this.blocks.length;
|
||||
@ -350,7 +350,7 @@ column_class.prototype.insert_block = function(el,targetel){
|
||||
}
|
||||
|
||||
el.updatePosition(found,this.ident);
|
||||
}
|
||||
};
|
||||
|
||||
column_class.prototype.has_block = function(el){
|
||||
var blockcount = this.blocks.length;
|
||||
@ -358,7 +358,7 @@ column_class.prototype.has_block = function(el){
|
||||
if(this.blocks[i]==el)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
column_class.prototype.remove_block = function(el){
|
||||
@ -377,7 +377,7 @@ column_class.prototype.remove_block = function(el){
|
||||
}
|
||||
}
|
||||
YAHOO.log("column "+this.indent+" has "+blockcount+"blocks");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -73,7 +73,7 @@ section_class.prototype.init_section = function(id, group, config, isDraggable)
|
||||
if (YAHOO.util.Dom.hasClass(this.getEl(),'hidden')) {
|
||||
this.toggle_hide(null,null,true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.init_buttons = function() {
|
||||
@ -99,7 +99,7 @@ section_class.prototype.init_buttons = function() {
|
||||
commandContainer.appendChild(viewbutton);
|
||||
this.viewButton = viewbutton;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.add_handle = function() {
|
||||
@ -112,7 +112,7 @@ section_class.prototype.add_handle = function() {
|
||||
|
||||
this.getEl().childNodes[0].appendChild(handleRef);
|
||||
this.setHandleElId(this.handle.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.process_section = function() {
|
||||
@ -151,7 +151,7 @@ section_class.prototype.process_section = function() {
|
||||
this.resources[this.resources.length] = new resource_class(resource.id, 'resources', null, this);
|
||||
}
|
||||
this.summary = YAHOO.util.Dom.getElementsByClassName('summary', null, this.getEl())[0].firstChild.data || '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.startDrag = function(x, y) {
|
||||
@ -169,7 +169,7 @@ section_class.prototype.startDrag = function(x, y) {
|
||||
if (this.debug) {
|
||||
YAHOO.log(this.id + " startDrag, "+targets.length + " targets");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.onDragDrop = function(e, id) {
|
||||
@ -184,7 +184,7 @@ section_class.prototype.onDragDrop = function(e, id) {
|
||||
|
||||
//add back to resources group
|
||||
this.addToGroup('resources');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.endDrag = function() {
|
||||
@ -192,7 +192,7 @@ section_class.prototype.endDrag = function() {
|
||||
|
||||
//add back to resources group
|
||||
this.addToGroup('resources');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.move_to_section = function(target) {
|
||||
@ -251,7 +251,7 @@ section_class.prototype.move_to_section = function(target) {
|
||||
main.sections[i].swap_dates(main.sections[eval(loopmodifier)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.swap_with_section = function(sectionIn) {
|
||||
@ -282,7 +282,7 @@ section_class.prototype.swap_with_section = function(sectionIn) {
|
||||
} else {
|
||||
YAHOO.log("Swapping sections: form not present in one or both sections", "warn");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.toggle_hide = function(e,target,superficial) {
|
||||
@ -320,7 +320,7 @@ section_class.prototype.toggle_hide = function(e,target,superficial) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.toggle_highlight = function() {
|
||||
@ -331,7 +331,7 @@ section_class.prototype.toggle_highlight = function() {
|
||||
YAHOO.util.Dom.addClass(this.getEl(), 'current');
|
||||
this.highlighted = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.mk_marker = function() {
|
||||
@ -344,7 +344,7 @@ section_class.prototype.mk_marker = function() {
|
||||
main.connect('POST', 'class=course&field=marker', null, 'value=0');
|
||||
this.toggle_highlight();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.changeId = function(newId) {
|
||||
@ -356,7 +356,7 @@ section_class.prototype.changeId = function(newId) {
|
||||
if (main.marker == this) {
|
||||
main.update_marker(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.get_resource_index = function(el) {
|
||||
@ -367,7 +367,7 @@ section_class.prototype.get_resource_index = function(el) {
|
||||
}
|
||||
YAHOO.log("Could not find resource to remove "+el.getEl().id, "error");
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.remove_resource = function(el) {
|
||||
@ -412,7 +412,7 @@ section_class.prototype.remove_resource = function(el) {
|
||||
|
||||
this.write_sequence_list();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.insert_resource = function(el, targetel) {
|
||||
@ -474,7 +474,7 @@ section_class.prototype.insert_resource = function(el, targetel) {
|
||||
//this.resources_ul.appendChild(document.createTextNode(' '));
|
||||
}
|
||||
el.parentObj = this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
section_class.prototype.write_sequence_list = function(toReturn) {
|
||||
@ -489,7 +489,7 @@ section_class.prototype.write_sequence_list = function(toReturn) {
|
||||
if (toReturn) {
|
||||
return listOutput;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -550,7 +550,7 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj)
|
||||
if (this.debug) {
|
||||
YAHOO.log("init_resource "+id+" parent = "+parentObj.getEl().id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@ -678,7 +678,7 @@ resource_class.prototype.init_buttons = function() {
|
||||
commandContainer.appendChild(button);
|
||||
this.groupButton = button;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.indent_left = function() {
|
||||
@ -707,7 +707,7 @@ resource_class.prototype.indent_left = function() {
|
||||
}
|
||||
main.connect('POST', 'class=resource&field=indentleft', null, 'id='+this.id);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.indent_right = function() {
|
||||
@ -744,7 +744,7 @@ resource_class.prototype.indent_right = function() {
|
||||
}
|
||||
main.connect('POST', 'class=resource&field=indentright', null, 'id='+this.id);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.toggle_hide = function(target, e, superficial, force) {
|
||||
@ -779,7 +779,7 @@ resource_class.prototype.toggle_hide = function(target, e, superficial, force) {
|
||||
main.connect('POST', 'class=resource&field=visible', null, 'value=0&id='+this.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.groupImages = ['groupn', 'groups', 'groupv'];
|
||||
@ -810,7 +810,7 @@ resource_class.prototype.toggle_groupmode = function() {
|
||||
|
||||
this.groupButton.getElementsByTagName('img')[0].src = main.portal.icons[this.groupImages[this.groupmode]];
|
||||
main.connect('POST', 'class=resource&field=groupmode', null, 'value='+this.groupmode+'&id='+this.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.delete_button = function() {
|
||||
@ -822,14 +822,14 @@ resource_class.prototype.delete_button = function() {
|
||||
}
|
||||
this.parentObj.remove_resource(this);
|
||||
main.connect('POST', 'class=resource&action=DELETE&id='+this.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.update_index = function(index) {
|
||||
if (this.debug) {
|
||||
YAHOO.log("Updating Index for resource "+this.getEl().id+" to "+index);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.startDrag = function(x, y) {
|
||||
@ -842,7 +842,7 @@ resource_class.prototype.startDrag = function(x, y) {
|
||||
if (this.debug) {
|
||||
YAHOO.log(this.id + " startDrag "+targets.length + " targets");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.clear_move_markers = function(target) {
|
||||
@ -856,7 +856,7 @@ resource_class.prototype.clear_move_markers = function(target) {
|
||||
YAHOO.util.Dom.setStyle(resources[i].getEl().id, 'border', 'none');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.onDragOver = function(e, ids) {
|
||||
@ -875,7 +875,7 @@ resource_class.prototype.onDragOver = function(e, ids) {
|
||||
'border-bottom', '1px solid #BBB');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.onDragOut = function(e, ids) {
|
||||
@ -883,7 +883,7 @@ resource_class.prototype.onDragOut = function(e, ids) {
|
||||
if (target) {
|
||||
this.clear_move_markers(target);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.onDragDrop = function(e, ids) {
|
||||
@ -906,12 +906,12 @@ resource_class.prototype.onDragDrop = function(e, ids) {
|
||||
}
|
||||
this.clear_move_markers(target);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
resource_class.prototype.endDrag = function() {
|
||||
// Eliminates default action
|
||||
}
|
||||
};
|
||||
|
||||
section_class.prototype.swap_dates = function(el){
|
||||
var i=1;
|
||||
@ -921,5 +921,5 @@ section_class.prototype.swap_dates = function(el){
|
||||
divs[div].innerHTML = main.sectiondates[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user