diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index 1f2d7aa6a2..8da3e4d630 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -1773,16 +1773,7 @@ class calendar_uiviews extends calendar_ui } else { - if ($event['recur_type'] != MCAL_RECUR_NONE) - { - $popup = ' onclick="app.calendar.edit_series(event,'.$event['id'].','.$this->bo->date2string($event['start']).');"'; - } - else - { - $view_link = egw::link('/index.php',array('menuaction'=>'calendar.calendar_uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start']))); - - $popup = ' onclick="'.$this->popup($view_link).'; return false;"'; - } + // Replaced with jquery click handler due to CSP consern } //_debug_array($event); @@ -1799,24 +1790,6 @@ class calendar_uiviews extends calendar_ui $draggableID = $event['id'].'_O'.$event['owner'].'_C'.($owner<0?str_replace('-','group',$owner):$owner); - $ttip_options = array( - 'BorderWidth' => 0, // as we use our round borders - 'Padding' => 0, - 'Sticky' => true, // make long tooltips scrollable - 'ClickClose' => true, - 'FOLLOWMOUSE' => false, - 'DELAY' => 600, - //'FIX' => "['".$draggableID."',10,-5]", - 'SHADOW' => false, - 'WIDTH' => -400, - ); - $ie_fix = ''; - if (html::$user_agent == 'msie') // add a transparent image to make the event "opaque" to mouse events - { - $ie_fix = $indent."\t".html::image('calendar','transparent.gif','', - html::tooltip($tooltip,False,$ttip_options). - ' style="top:0px; left:0px; position:absolute; height:100%; width:100%; z-index:1"') . "\n"; - } if ($this->use_time_grid) { if($event['whole_day_on_top']) @@ -1854,18 +1827,13 @@ class calendar_uiviews extends calendar_ui { $draggableID = $event['id'].'_O'.$event['owner'].'_C'.($owner<0?str_replace('-','group',$owner):$owner); - // If a event isn't drag-dropable, the drag drop event handling has to be fully disabled - // for that object. Clicking on it - however - should still bring it to the foreground. - $dd_emulation = ' onmousedown="dd.z++; this.style.zIndex = dd.z; event.cancelBubble=true;"' - .'onmouseup="event.cancelBubble=true;"' - .'onmousemove="event.cancelBubble=true;"'; } } + $tooltip = html::htmlspecialchars(str_replace(array("\n","\r","'",'"'),array('','',"\\'",'"'),$tooltip)); $resizableHelper = $this->bo->date2string($event['start']). '|' .$this->bo->format_date($event['start'],false) . '|' . $this->cal_prefs['interval']; - $html = $indent.'
'.$prefix_icon."\n".$ie_fix.$html."\n". + '>'.$prefix_icon."\n".$html."\n". $indent."
"."\n"; return $html; diff --git a/calendar/js/app.js b/calendar/js/app.js index 7bfccb5730..9308c843d0 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -141,6 +141,7 @@ app.classes.calendar = AppJS.extend( }, }).resizable({ + //scroll:true, start:function(ui,event) { var resizeHelper = ui.target.getAttribute('data-resize'); @@ -227,6 +228,39 @@ app.classes.calendar = AppJS.extend( }); + //onClick Handler for calender entries + jQuery("div.calendar_calEvent").on({ + click:function(ev){ + var eventId = ev.currentTarget.id.replace(/drag_/g,'').split("_")[0]; + var startDate = ev.currentTarget.getAttribute('data-resize').split("|")[0]; + if (ev.currentTarget.id.match(/drag_/g)) + { + egw.open(eventId,'calendar','edit'); + } + else + { + that.edit_series(event,eventId,startDate); + } + }, + mouseover: function(){ + + var ttp = jQuery(this).tooltip({ + items: "[data-tooltip]", + content: function() + { + var elem = jQuery(this); + if (elem.is("[data-tooltip]")) + return this.getAttribute('data-tooltip') ; + }, + track:true, + + }); + ttp.tooltip("enable"); + }, + mousedown: function(){ + jQuery(this).tooltip("disable"); + } + }); //onClick Handler for calendar cells jQuery("div.calendar_calAddEvent").click(function(ev) {