AJAX fixes.
This commit is contained in:
@@ -61,17 +61,6 @@
|
||||
$strmarkedthistopic = get_string('markedthistopic');
|
||||
$strmoveup = get_string('moveup');
|
||||
$strmovedown = get_string('movedown');
|
||||
|
||||
if (!empty($USER->ajax)){
|
||||
|
||||
// If user doesnt want AJAX, then they wont get it,
|
||||
// from here everything detects $COURSE->javascriptportal
|
||||
|
||||
$COURSE->javascriptportal = new jsportal();
|
||||
|
||||
print_require_js(array('yui_yahoo','yui_dom','yui_event','yui_dragdrop', 'yui_connection',
|
||||
'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,9 +270,4 @@
|
||||
|
||||
echo '</tr></table>';
|
||||
|
||||
//create javascript portal code
|
||||
if (!empty($COURSE->javascriptportal)) {
|
||||
$COURSE->javascriptportal->print_javascript($course->id);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -47,16 +47,6 @@
|
||||
$strweekshow = get_string('weekshow', '', $strstudents);
|
||||
$strmoveup = get_string('moveup');
|
||||
$strmovedown = get_string('movedown');
|
||||
|
||||
if (!empty($USER->ajax)) {
|
||||
|
||||
// If user doesnt want AJAX, then they wont get it,
|
||||
// from here everything detects $COURSE->javascriptportal
|
||||
$COURSE->javascriptportal = new jsportal();
|
||||
|
||||
print_require_js(array('yui_yahoo','yui_dom','yui_event','yui_dragdrop', 'yui_connection',
|
||||
'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse'));
|
||||
}
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
@@ -275,9 +265,4 @@
|
||||
|
||||
echo '</tr></table>';
|
||||
|
||||
//create javascript portal code
|
||||
if (!empty($COURSE->javascriptportal)) {
|
||||
$COURSE->javascriptportal->print_javascript($course->id);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
+1
-1
@@ -179,4 +179,4 @@ switch($_SERVER['REQUEST_METHOD']) {
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
+65
-9
@@ -5,6 +5,7 @@
|
||||
require_once('../config.php');
|
||||
require_once('lib.php');
|
||||
require_once($CFG->libdir.'/blocklib.php');
|
||||
require_once($CFG->libdir.'/ajax/ajaxlib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$name = optional_param('name', '', PARAM_RAW);
|
||||
@@ -74,12 +75,12 @@
|
||||
}
|
||||
|
||||
$PAGE = page_create_object(PAGE_COURSE_VIEW, $course->id);
|
||||
$pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
|
||||
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
|
||||
|
||||
|
||||
if (!isset($USER->editing)) {
|
||||
$USER->editing = 0;
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
if (($edit == 1) and confirm_sesskey()) {
|
||||
$USER->editing = 1;
|
||||
@@ -112,13 +113,53 @@
|
||||
|
||||
$SESSION->fromdiscussion = $CFG->wwwroot .'/course/view.php?id='. $course->id;
|
||||
|
||||
if ($course->id == SITEID) { // This course is not a real course.
|
||||
|
||||
if ($course->id == SITEID) {
|
||||
// This course is not a real course.
|
||||
redirect($CFG->wwwroot .'/');
|
||||
}
|
||||
|
||||
$PAGE->print_header(get_string('course').': %fullname%');
|
||||
|
||||
echo '<div class="course-content">'; // course wrapper start
|
||||
// AJAX-capable course format?
|
||||
$useajax = false;
|
||||
$ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php';
|
||||
|
||||
if (file_exists($ajaxformatfile)) {
|
||||
require_once($ajaxformatfile);
|
||||
if ($USER->editing && !empty($USER->ajax) && $CFG->ajaxcapable) {
|
||||
$useajax = true;
|
||||
}
|
||||
}
|
||||
$meta = '';
|
||||
$bodytags = '';
|
||||
|
||||
if ($useajax) {
|
||||
$meta = require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_dragdrop', 'yui_connection'));
|
||||
|
||||
if (debugging('', DEBUG_DEVELOPER)) { // Need to detect whether we're using ajax too.
|
||||
$meta .= require_js(array('yui_logger'));
|
||||
|
||||
$bodytags = 'onLoad = "javascript:
|
||||
show_logger = function() {
|
||||
var logreader = new YAHOO.widget.LogReader();
|
||||
logreader.newestOnTop = false;
|
||||
logreader.setTitle(\'Moodle Debug: YUI Log Console\');
|
||||
};
|
||||
show_logger();
|
||||
"';
|
||||
}
|
||||
// Okay, global variable alert. VERY UGLY. We need to create this object
|
||||
// here before the <blockname>_print_block() function is called, since
|
||||
// that function needs to set some stuff in the javascriptportal object.
|
||||
// Like I said... VERY UGLY.
|
||||
$COURSE->javascriptportal = new jsportal();
|
||||
}
|
||||
|
||||
|
||||
$PAGE->print_header(get_string('course').': %fullname%', NULL, $meta, $bodytags);
|
||||
// Course wrapper start.
|
||||
echo '<div class="course-content">';
|
||||
|
||||
|
||||
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||
|
||||
@@ -135,16 +176,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($course->modinfo)) { // Course cache was never made
|
||||
|
||||
if (empty($course->modinfo)) {
|
||||
// Course cache was never made.
|
||||
rebuild_course_cache($course->id);
|
||||
if (! $course = get_record('course', 'id', $course->id) ) {
|
||||
error("That's an invalid course id");
|
||||
}
|
||||
}
|
||||
|
||||
require($CFG->dirroot .'/course/format/'. $course->format .'/format.php'); // Include the actual course format
|
||||
|
||||
echo '</div>'; // content wrapper end
|
||||
// Include the actual course format.
|
||||
require($CFG->dirroot .'/course/format/'. $course->format .'/format.php');
|
||||
// Content wrapper end.
|
||||
echo '</div>';
|
||||
|
||||
|
||||
// Use AJAX?
|
||||
if ($useajax) {
|
||||
// At the bottom because we want to process sections and activities
|
||||
// after the relevant html has been generated.
|
||||
echo require_js(array('ajaxcourse_blocks', 'ajaxcourse_sections', 'ajaxcourse'));
|
||||
$COURSE->javascriptportal->print_javascript($course->id);
|
||||
}
|
||||
|
||||
|
||||
print_footer(NULL, $course);
|
||||
|
||||
?>
|
||||
?>
|
||||
+30
-28
@@ -6,65 +6,65 @@
|
||||
|
||||
|
||||
//hide content body until done loading (manipulation looks ugly elsewise)
|
||||
document.getElementById('content').style.display = 'none';
|
||||
//document.getElementById('content').style.display = 'none';
|
||||
|
||||
|
||||
//onload object for handling scripts on page load, this insurses they run in my order
|
||||
//onload object for handling scripts on page load, this insures they run in my order
|
||||
function onload_class() {
|
||||
this.scripts = new Array();
|
||||
this.debug = false;
|
||||
this.debug = true;
|
||||
}
|
||||
|
||||
|
||||
onload_class.prototype.add = function(script) {
|
||||
if(this.debug)YAHOO.log("onload.add - adding "+script, "junk");
|
||||
if (this.debug) {
|
||||
YAHOO.log("onloadobj.add - adding "+script, "junk");
|
||||
}
|
||||
this.scripts[this.scripts.length] = script;
|
||||
}
|
||||
|
||||
|
||||
onload_class.prototype.load = function() {
|
||||
var scriptcount = this.scripts.length;
|
||||
if(this.debug)YAHOO.log("onload.load - loading "+scriptcount+" scripts", "info");
|
||||
for (i=0;i<scriptcount;i++) {
|
||||
eval(this.scripts[i]);
|
||||
if (this.debug) {
|
||||
YAHOO.log("onloadobj.load - loading "+scriptcount+" scripts", "info");
|
||||
}
|
||||
for (i=0; i<scriptcount; i++) {
|
||||
eval(this.scripts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var onload = new onload_class();
|
||||
var onloadobj = new onload_class();
|
||||
|
||||
|
||||
//main page object
|
||||
function main_class() {
|
||||
this.debug = true;
|
||||
this.portal = new php_portal_class();
|
||||
|
||||
this.blocks = new Array();
|
||||
this.sections = new Array();
|
||||
|
||||
this.leftcolumn = null;
|
||||
this.rightcolumn = null;
|
||||
this.adminBlock = null;
|
||||
|
||||
//if you use firefox the firebug extension will show log contents otherwise uncomment to view
|
||||
//this.logview = new YAHOO.widget.LogReader('header');
|
||||
|
||||
this.rightcolumn = null;
|
||||
this.adminBlock = null;
|
||||
this.icons = [];
|
||||
this.marker = null;
|
||||
|
||||
//things to process onload
|
||||
onload.add('main.process_document();');
|
||||
onload.add("document.getElementById('content').style.display='block';");
|
||||
onloadobj.add('main.process_document();');
|
||||
onloadobj.add("document.getElementById('content').style.display='block';");
|
||||
|
||||
//connection queue allows xhttp requests to be sent in order
|
||||
this.connectQueue = [];
|
||||
this.connectQueueHead = 0;
|
||||
this.connectQueueConnection = null;
|
||||
|
||||
this.debug = true;
|
||||
}
|
||||
|
||||
|
||||
main_class.prototype.process_blocks = function() {
|
||||
//remove unneeded icons (old school position icons and delete/hide although they will be read)
|
||||
//remove unneeded icons (old school position icons and delete/hide
|
||||
//although they will be read)
|
||||
var rmIconClasses = ['icon up', 'icon down', 'icon right', 'icon left', 'icon delete', 'icon hide'];
|
||||
for (var c=0; c<rmIconClasses.length; c++) {
|
||||
els = YAHOO.util.Dom.getElementsByClassName(rmIconClasses[c]);
|
||||
@@ -77,7 +77,7 @@ main_class.prototype.process_blocks = function() {
|
||||
var blockcount = this.portal.blocks.length;
|
||||
YAHOO.log("main.processBlocks - processing "+blockcount+" blocks", "info");
|
||||
|
||||
for (i=0;i<blockcount;i++) {
|
||||
for (i=0; i<blockcount; i++) {
|
||||
this.blocks[i] = new block_class(this.portal.blocks[i][1], "blocks");
|
||||
|
||||
//put in correct side array also
|
||||
@@ -96,7 +96,7 @@ main_class.prototype.process_blocks = function() {
|
||||
|
||||
|
||||
main_class.prototype.process_document = function() {
|
||||
//process the document to get important containers0
|
||||
//process the document to get important containers
|
||||
YAHOO.log("Processing Document", "info");
|
||||
|
||||
//process columns for blocks
|
||||
@@ -106,11 +106,13 @@ main_class.prototype.process_document = function() {
|
||||
//process sections
|
||||
var ct = 0;
|
||||
while (document.getElementById('section-'+ct) != null) {
|
||||
this.sections[ct]=new section_class('section-'+ct, "sections", null, ct!=0?true:false);
|
||||
this.sections[ct] = new section_class('section-'+ct, "sections", null, ct!=0?true:false);
|
||||
this.sections[ct].addToGroup('resources');
|
||||
ct++;
|
||||
}
|
||||
if(this.debug)YAHOO.log("Processed "+ct+" sections");
|
||||
if (this.debug) {
|
||||
YAHOO.log("Processed "+ct+" sections");
|
||||
}
|
||||
|
||||
this.adminBlock = YAHOO.util.Dom.getElementsByClassName('block_adminblock')[0];
|
||||
YAHOO.log("admin - "+this.adminBlock.className);
|
||||
@@ -166,7 +168,7 @@ main_class.prototype.mk_button = function(tag, imgSrc, attributes, imgAttributes
|
||||
|
||||
|
||||
main_class.prototype.connect = function(method, urlStub, callback, body) {
|
||||
if(this.debug) {
|
||||
if (this.debug) {
|
||||
YAHOO.log("Making "+method+" connection to /course/rest.php?courseId="+main.portal.id+"&"+urlStub);
|
||||
}
|
||||
if (callback == null) {
|
||||
@@ -211,7 +213,6 @@ main_class.prototype.update_marker = function(newMarker) {
|
||||
if (this.marker != null) {
|
||||
this.marker.toggle_highlight();
|
||||
}
|
||||
|
||||
this.marker = newMarker;
|
||||
this.marker.toggle_highlight();
|
||||
|
||||
@@ -219,8 +220,8 @@ main_class.prototype.update_marker = function(newMarker) {
|
||||
}
|
||||
|
||||
|
||||
main_class.prototype.getString = function(title,variable) {
|
||||
if(this.portal.strings[title]) {
|
||||
main_class.prototype.getString = function(title, variable) {
|
||||
if (this.portal.strings[title]) {
|
||||
return this.portal.strings[title].replace(/_var_/, variable);
|
||||
}
|
||||
}
|
||||
@@ -232,6 +233,7 @@ var main = new main_class();
|
||||
function php_portal_class() {
|
||||
//portal to php data
|
||||
this.id = null;
|
||||
this.debug = null;
|
||||
|
||||
//array of id's of blocks set at end of page load by php
|
||||
this.blocks = new Array();
|
||||
|
||||
+34
-55
@@ -5,8 +5,9 @@
|
||||
* Takes in an array of either full paths or shortnames and it will translate
|
||||
* them to full paths.
|
||||
**/
|
||||
function print_require_js($list) {
|
||||
function require_js($list) {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
if (!check_browser_version('MSIE', 6.0) && !check_browser_version('Firefox', 1.5)) {
|
||||
// We still have issues with YUI in other browsers.
|
||||
@@ -29,64 +30,33 @@ function print_require_js($list) {
|
||||
|
||||
for ($i=0; $i<count($list); $i++) {
|
||||
if ($translatelist[$list[$i]]) {
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist[$list[$i]]."'></script>\n";
|
||||
$output .= "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist[$list[$i]]."'></script>\n";
|
||||
if ($translatelist[$list[$i]] == '/lib/yui/logger/logger.js') {
|
||||
// Special case. We need the css.
|
||||
$output .= "<link type='text/css' rel='stylesheet' href='{$CFG->wwwroot}/lib/yui/logger/assets/logger.css'>";
|
||||
}
|
||||
} else {
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$list[$i]."'></script>\n";
|
||||
$output .= "<script type='text/javascript' src='".$CFG->wwwroot.''.$list[$i]."'></script>\n";
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (debugging('', DEBUG_DEVELOPER)) {
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist['yui_logger']."'></script>\n";
|
||||
|
||||
// Dependencies for the logger.
|
||||
echo "<link type='text/css' rel='stylesheet' href='{$CFG->wwwroot}/lib/yui/logger/assets/logger.css'>";
|
||||
|
||||
// FIXME: Below might get included more than once.
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist['yui_yahoo']."'></script>\n";
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist['yui_dom']."'></script>\n";
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist['yui_event']."'></script>\n";
|
||||
echo "<script type='text/javascript' src='".$CFG->wwwroot.''.$translatelist['yui_dragdrop']."'></script>\n";
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
function showLogger() {
|
||||
var logcontainer = null;
|
||||
|
||||
var logconfig = {
|
||||
left: "60%",
|
||||
top: "40px"
|
||||
};
|
||||
var logreader = new YAHOO.widget.LogReader(logcontainer, logconfig);
|
||||
|
||||
logreader.newestOnTop = false;
|
||||
logreader.setTitle('Moodle Debug: YUI Log Console');
|
||||
}
|
||||
|
||||
setTimeout(showLogger, 1); // IE does not allow changing HTML
|
||||
// tables via DOM until they are
|
||||
// fully rendered.
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
*/
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used to create view of document to be passed to javascript on pageload.
|
||||
* Used to create view of document to be passed to JavaScript on pageload.
|
||||
* We use this class to pass data from PHP to JavaScript.
|
||||
*/
|
||||
class jsportal {
|
||||
|
||||
var $currentblocksection = null;
|
||||
var $blocks = array();
|
||||
var $blocksoutput = '';
|
||||
var $output = '';
|
||||
|
||||
|
||||
/**
|
||||
* Takes id of block and adds it
|
||||
*/
|
||||
function block_add($id, $hidden=false ){
|
||||
function block_add($id, $hidden=false){
|
||||
$hidden_binary = 0;
|
||||
|
||||
if ($hidden) {
|
||||
@@ -96,30 +66,39 @@ class jsportal {
|
||||
}
|
||||
|
||||
|
||||
function print_javascript($id) {
|
||||
/**
|
||||
* Prints the JavaScript code needed to set up AJAX for the course.
|
||||
*/
|
||||
function print_javascript($courseid, $return=false) {
|
||||
global $CFG;
|
||||
|
||||
$blocksoutput = $output = '';
|
||||
for ($i=0; $i<count($this->blocks); $i++) {
|
||||
$blocksoutput .= "['".$this->blocks[$i][0]."','".$this->blocks[$i][1]."','".$this->blocks[$i][2]."']";
|
||||
if ($i != (count($this->blocks)-1)) {
|
||||
$blocksoutput .= "['".$this->blocks[$i][0]."',
|
||||
'".$this->blocks[$i][1]."',
|
||||
'".$this->blocks[$i][2]."']";
|
||||
|
||||
if ($i != (count($this->blocks) - 1)) {
|
||||
$blocksoutput .= ',';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= "<script language='javascript'>\n";
|
||||
$output .= " main.portal.id = ".$id.";\n";
|
||||
$output .= " main.portal.blocks = new Array(".$blocksoutput.");\n";
|
||||
$output .= " main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n";
|
||||
$output .= " main.portal.id = ".$courseid.";\n";
|
||||
$output .= " main.portal.blocks = new Array(".$blocksoutput.");\n";
|
||||
$output .= " main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n";
|
||||
$output .= " main.portal.strings['update']='".get_string('update')."';\n";
|
||||
$output .= " main.portal.strings['deletecheck']='".get_string('deletecheck','','_var_')."';\n";
|
||||
$output .= " main.portal.strings['resource']='".get_string('resource')."';\n";
|
||||
$output .= " main.portal.strings['activity']='".get_string('activity')."';\n";
|
||||
$output .= " onload.load();\n";
|
||||
$output .= " main.portal.strings['deletecheck']='".get_string('deletecheck','','_var_')."';\n";
|
||||
$output .= " main.portal.strings['resource']='".get_string('resource')."';\n";
|
||||
$output .= " main.portal.strings['activity']='".get_string('activity')."';\n";
|
||||
$output .= " onloadobj.load();\n";
|
||||
$output .= " main.process_blocks();\n";
|
||||
$output .= "</script>";
|
||||
echo $output;
|
||||
if ($return) {
|
||||
return $output;
|
||||
} else {
|
||||
echo $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
/**
|
||||
* library for ajaxcourse formats, the classes and related functions for drag and drop blocks
|
||||
*
|
||||
* this library requires a 'main' object created in calling document
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
//set Drag and Drop to Intersect mode:
|
||||
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
|
||||
//set Drag and Drop to Intersect mode:
|
||||
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* class for draggable block, extends YAHOO.util.DDProxy
|
||||
*/
|
||||
function block_class(id,group,config){
|
||||
|
||||
+22
-11
@@ -212,7 +212,7 @@ section_class.prototype.move_to_section = function(target) {
|
||||
|
||||
//move on backend
|
||||
main.connect('post','class=section&field=move',null,'id='+this.sectionId+'&value='
|
||||
+(target.sectionId-this.sectionId));
|
||||
+(target.sectionId - this.sectionId));
|
||||
|
||||
//move on front end
|
||||
for (var i=loopStart; eval(loopCondition); eval(loopInc)) {
|
||||
@@ -375,14 +375,15 @@ section_class.prototype.insert_resource = function(el, targetel) {
|
||||
var tempStore = nextStore = null;
|
||||
|
||||
//update in backend
|
||||
targetId = '';
|
||||
var targetId = '';
|
||||
if (targetel) {
|
||||
targetId = targetel.id;
|
||||
}
|
||||
|
||||
if (this.debug) {
|
||||
YAHOO.log('id='+el.id+', beforeId='+targetId+', sectionId='+this.sectionId);
|
||||
}
|
||||
main.connect('post', 'class=resource&field=move', null,
|
||||
'id='+el.id+'&beforeId='+targetId
|
||||
+'§ionId='+this.sectionId);
|
||||
'id='+el.id+'&beforeId='+targetId+'§ionId='+this.sectionId);
|
||||
|
||||
//if inserting into a hidden resource hide
|
||||
if (this.hidden) {
|
||||
@@ -493,7 +494,7 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj)
|
||||
|
||||
resource_class.prototype.init_buttons = function() {
|
||||
var commandContainer = YAHOO.util.Dom.getElementsByClassName('commands', 'span', this.getEl())[0];
|
||||
if ( commandContainer == null) {
|
||||
if (commandContainer == null) {
|
||||
YAHOO.log('Cannot find command container for '+this.getEl().id, 'error');
|
||||
return;
|
||||
}
|
||||
@@ -588,7 +589,7 @@ resource_class.prototype.update_index = function(index) {
|
||||
}
|
||||
}
|
||||
|
||||
resource_class.prototype.startDrag = function(x, y) {
|
||||
resource_class.prototype.startDrag = function(x, y) {
|
||||
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
|
||||
|
||||
//reinitialize dd element
|
||||
@@ -597,6 +598,11 @@ resource_class.prototype.startDrag = function(x, y) {
|
||||
var targets = YAHOO.util.DDM.getRelated(this, true);
|
||||
if (this.debug) {
|
||||
YAHOO.log(this.id + " startDrag "+targets.length + " targets");
|
||||
/*
|
||||
for (var i=0; i<targets.length; i++) {
|
||||
YAHOO.log('target '+(i+1)+': '+targets[i].id);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -629,12 +635,17 @@ resource_class.prototype.onDragOver = function(e, ids) {
|
||||
|
||||
resource_class.prototype.onDragOut = function(e, ids) {
|
||||
var target = YAHOO.util.DDM.getBestMatch(ids);
|
||||
this.clear_move_markers(target);
|
||||
if (target) {
|
||||
this.clear_move_markers(target);
|
||||
}
|
||||
}
|
||||
|
||||
resource_class.prototype.onDragDrop = function(e, ids) {
|
||||
resource_class.prototype.onDragDrop = function(e, ids) {YAHOO.log('onDragDrop');
|
||||
var target = YAHOO.util.DDM.getBestMatch(ids);
|
||||
|
||||
if (!target) {
|
||||
YAHOO.log('onDragDrop: Target is not valid!', 'error');
|
||||
}
|
||||
|
||||
if (this.debug) {
|
||||
YAHOO.log("Dropped on section id="+target.sectionId
|
||||
+", el="+this.getEl().id
|
||||
@@ -668,7 +679,7 @@ YAHOO.extend(activity_class, resource_class);
|
||||
|
||||
activity_class.prototype.init_activity = function(id, group, config, parentObj) {
|
||||
if (!id) {
|
||||
YAHOO.log("Init activity, NO ID FOUND!",'error');
|
||||
YAHOO.log("Init activity, NO ID FOUND!", 'error');
|
||||
return;
|
||||
}
|
||||
this.is = 'activity';
|
||||
|
||||
Reference in New Issue
Block a user