Skip to content
Browse files

Javascript path changes - works on paths other than /

  • Loading branch information...
1 parent 0a81214 commit fecfbf80166a5510c57adc8cccf4f93a2b3c3d17 @srs81 committed Mar 19, 2012
Showing with 8 additions and 4 deletions.
  1. +5 −1 View/FullCalendar/index.ctp
  2. +3 −3 webroot/js/ready.js
View
6 View/FullCalendar/index.ctp
@@ -9,7 +9,11 @@
* Licensed under MIT
* http://www.opensource.org/licenses/mit-license.php
*/
-
+?>
+<script type="text/javascript">
+plgFcRoot = '<?php echo $this->Html->url('/'); ?>' + "full_calendar";
+</script>
+<?php
echo $this->Html->script(array('/full_calendar/js/jquery-1.5.min', '/full_calendar/js/jquery-ui-1.8.9.custom.min', '/full_calendar/js/fullcalendar.min', '/full_calendar/js/jquery.qtip-1.0.0-rc3.min', '/full_calendar/js/ready'), array('inline' => 'false'));
echo $this->Html->css('/full_calendar/css/fullcalendar', null, array('inline' => false));
?>
View
6 webroot/js/ready.js
@@ -25,7 +25,7 @@ $(document).ready(function() {
weekMode: 'variable',
aspectRatio: 2,
editable: true,
- events: "/full_calendar/events/feed",
+ events: plgFcRoot + "/events/feed",
eventRender: function(event, element) {
element.qtip({
content: event.details,
@@ -63,7 +63,7 @@ $(document).ready(function() {
} else {
var allday = 0;
}
- var url = "/full_calendar/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00&allday="+allday;
+ var url = plgFcRoot + "/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00&allday="+allday;
$.post(url, function(data){});
},
eventResizeStart: function(event) {
@@ -82,7 +82,7 @@ $(document).ready(function() {
var endmonth = enddate.getMonth()+1;
var endhour = enddate.getHours();
var endminute = enddate.getMinutes();
- var url = "/full_calendar/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00";
+ var url = plgFcRoot + "/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00";
$.post(url, function(data){});
}
})

0 comments on commit fecfbf8

Please sign in to comment.
Something went wrong with that request. Please try again.