Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Syntax error in calendar.js
(1 viewing) (1) Guest
Universal booking and reservations component for Joomla!.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Syntax error in calendar.js

Syntax error in calendar.js 11 years, 3 months ago #41002

Hi,
I have purchased the full version of this and it dosent work, you end up with a syntax error in calendar.js. I thought maybe a jquery conflict but I have installed jquery easy and no difference.

I need to get this to work for the client as he paid for it.

Its on the test resgisterd site at the moment under hub booking.

Also I need to get it operate exactly as you hall booking demo, where do I get the full set of instructions and settings to implement that's?

thanks

Tony
The topic has been locked.

Re: Syntax error in calendar.js 11 years, 3 months ago #41046

  • maju
  • OFFLINE
  • Posts: 1107
Hello,

Any information about syntax error can help us to find the problem.

I am not sure in which hall you are interested. But Hall 1 - 8900 seats has this settings:

Reservation Types:
set-rtypes.png


Prices:
set-prices.png


I will try to modify functionality on demo today, so you will be able to see settings with demo account.
ARTIO Support Team
The topic has been locked.

Re: Syntax error in calendar.js 11 years, 3 months ago #41047

  • maju
  • OFFLINE
  • Posts: 1107
You can check administration of demo now.

joomla25.demo.artio.cz/administrator
Use this login:
username: com_booking
password: demo
ARTIO Support Team
The topic has been locked.

Re: Syntax error in calendar.js 11 years, 3 months ago #41087

Hi,
we nearly have a working copy at last and with a lot of css changes however there is definitely a bug in your calendar.js file.
when you select a week in week mode you get a syntax error as below

SCRIPT1002: Syntax error
calendars.js, line 555 character 8
SCRIPT1002: Syntax error
calendars.js, line 555 character 8

This is eval(js);

www.battleva.co.uk/stall/index.php/home/.../SEOSubject/4-room-1

However it works ok in Chrome and Firefox the error is when using IE10 or Safari.
calendar.js on the latest joomla3 version seems different to your demo one

If you can fix this then I think I have a usable system

Please let me know asap.

Regards

Tony
The topic has been locked.

Re: Syntax error in calendar.js 11 years, 3 months ago #41098

  • maju
  • OFFLINE
  • Posts: 1107
Hello,

Many thanks for nice post. It was really easy to simulate your problem. But not so easy to solve it.
Finally there is no syntax error. Only IE and Safari browsers are trying to make a joke. But it is really not funny!

Try to modify the file: components/com_booking/assets/js/calendars.js - function requestNavigation
 
/**
* Calendar pagination via ajax
*/

requestNavigation : function() {
new Request({
url: location.href,
method: 'post',
data: $(Calendars.getForm()).toQueryString() + '&tmpl=component&ajax=1',
onRequest: function() {},
onSuccess: function(responseText) {
var beginMark = '<!-- Calendar HTML Begin -->'; // sign in html where changed content begins
var endMark = '<!-- Calendar HTML End -->'; // sign in html where changed content ends
 
var beginIndex = responseText.indexOf(beginMark); // changed content begin index
var endIndex = responseText.indexOf(endMark); // changed content end index
 
var length = endIndex - beginIndex + endMark.length; // changed content length
var html = responseText.substr(beginIndex, length); // parse changed content
 
$('bookingCalendar').set('html', html); // update current page
 
var beginMark = '<!-- Calendar JS Begin -->';
var endMark = '<!-- Calendar JS End -->';
 
var beginIndex = responseText.indexOf(beginMark);
var endIndex = responseText.indexOf(endMark);
 
var start = beginIndex + beginMark.length;
var length = endIndex - beginIndex;
var js = responseText.substr(start, length);
 
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
Calendars.boxes = new Array();
script.text = js;
$('bookingCalendar').appendChild(script);
 
Calendars.init(Calendars.multi);
},
onFailure: function() {}
}).send();
},


The most of the code is still same as before.
Tested on IE7 - 10, Safari, Google Chrome and Mozilla Firefox.

Please, also replace function showTotal in same file
 
/**
* Send whole reservation form to the server through AJAX to ge total price.
*/

showTotal : function() {
var form = $(this.getForm()).clone(); // copy of reservation form
// remove navigation parameters
$(form.task).dispose();
$(form.controller).dispose();
$(form.Itemid).dispose();
new Request({
url: juri + 'index.php?option=com_booking&controller=reservation&task=gettotal',
method: 'post',
data: $(form).toQueryString(),
onSuccess: function(responseText) {
responseText = JSON.decode(responseText);
if (responseText['status'] == 'FAIL') {
Calendars.unBookAbleInterval = true;
if (responseText['error'] != '') {
$('total').set('html', '<span class="unBookAbleInterval">' + responseText['error'] + '</span>');
} else {
$('total').set('html', '<span class="unBookAbleInterval">' + LGUnBookAbleInterval + '</span>');
}
} else if(responseText['status'] == 'OK') {
Calendars.unBookAbleInterval = false;
$('total').set('html', responseText['total'] == '' ? '&nbsp;' : responseText['total']); // show total price on page
}
}
}).send();
},

There was removed only comma ',' before this row: '}).send();'. It is repair for IE7.
ARTIO Support Team
Last Edit: 11 years, 3 months ago by maju.
The topic has been locked.

Re: Syntax error in calendar.js 11 years, 3 months ago #41105

Hi,
that certainly seems to have fixed the calendar problem on IE however there is definitely something wrong on the ipad (in safari and chrome). if you go to the website
www.battleva.co.uk/stall/index.php/home/...ing-and-availability

1. you can see the book a reservation button has jumped up.
2. when you go to reservation
a) if you select a date and hit bookit it says select from and to first
b) if you change week no days are listed

If you could look please

Thanks

Tony
The topic has been locked.
  • Page:
  • 1
User Login Empty