Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Javascript path changes - works on paths other than /

commit fecfbf80166a5510c57adc8cccf4f93a2b3c3d17 1 parent 0a81214
Suman S authored

Showing 2 changed files with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 1 View/FullCalendar/index.ctp
  2. +3 3 webroot/js/ready.js
6 View/FullCalendar/index.ctp
@@ -9,7 +9,11 @@
9 9 * Licensed under MIT
10 10 * http://www.opensource.org/licenses/mit-license.php
11 11 */
12   -
  12 +?>
  13 +<script type="text/javascript">
  14 +plgFcRoot = '<?php echo $this->Html->url('/'); ?>' + "full_calendar";
  15 +</script>
  16 +<?php
13 17 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'));
14 18 echo $this->Html->css('/full_calendar/css/fullcalendar', null, array('inline' => false));
15 19 ?>
6 webroot/js/ready.js
@@ -25,7 +25,7 @@ $(document).ready(function() {
25 25 weekMode: 'variable',
26 26 aspectRatio: 2,
27 27 editable: true,
28   - events: "/full_calendar/events/feed",
  28 + events: plgFcRoot + "/events/feed",
29 29 eventRender: function(event, element) {
30 30 element.qtip({
31 31 content: event.details,
@@ -63,7 +63,7 @@ $(document).ready(function() {
63 63 } else {
64 64 var allday = 0;
65 65 }
66   - 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;
  66 + var url = plgFcRoot + "/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00&allday="+allday;
67 67 $.post(url, function(data){});
68 68 },
69 69 eventResizeStart: function(event) {
@@ -82,7 +82,7 @@ $(document).ready(function() {
82 82 var endmonth = enddate.getMonth()+1;
83 83 var endhour = enddate.getHours();
84 84 var endminute = enddate.getMinutes();
85   - var url = "/full_calendar/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00";
  85 + var url = plgFcRoot + "/events/update?id="+event.id+"&start="+startyear+"-"+startmonth+"-"+startday+" "+starthour+":"+startminute+":00&end="+endyear+"-"+endmonth+"-"+endday+" "+endhour+":"+endminute+":00";
86 86 $.post(url, function(data){});
87 87 }
88 88 })

0 comments on commit fecfbf8

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