Error while building an extension(lines removed and put as 1 line) Extn builder 5.5

This section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Forum rules
This forum section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Post Reply
User avatar
me.prosenjeet
 
 
Posts: 1267
Joined: Mon Dec 24, 2007 1:50 pm
Location: Lucknow
Contact:

Error while building an extension(lines removed and put as 1 line) Extn builder 5.5

Post by me.prosenjeet »

Errors while building an extension using Extn builder 5.5 (lines removed and put as 1 line)

I noticed this error and it is as under...


The ORIGINAL CODE I use in the extension builder in html tab is:
<script language="javascript" type="text/javascript">
var currentMonth;
var currentYear;
var pageX;
var pageY;
var today= new Date();
var recaptchaVersion = <?php echo $settingObj->getRecaptchaVersion(); ?>;
<?php if($settingObj->getShowFirstFilledMonth() == 0) {
?>
var newday= new Date();
<?php
} else {
?>
var newday = new Date(<?php echo $calendarObj->getFirstFilledMonth($calendarObj->getCalendarId()); ?>);
<?php
}
?>

var booking_day_white_bg = '<?php echo $settingObj->getDayWhiteBg(); ?>';
var booking_day_white_bg_hover = '<?php echo $settingObj->getDayWhiteBgHover(); ?>';
var booking_day_white_line1_color = '<?php echo $settingObj->getDayWhiteLine1Color(); ?>';
var booking_day_white_line1_color_hover = '<?php echo $settingObj->getDayWhiteLine1ColorHover(); ?>';
var booking_day_white_line2_color = '<?php echo $settingObj->getDayWhiteLine2Color(); ?>';
var booking_day_white_line2_color_hover = '<?php echo $settingObj->getDayWhiteLine2ColorHover(); ?>';
var booking_day_white_line2_bg = '<?php echo $settingObj->getDayWhiteLine2Bg(); ?>';
var booking_day_white_line2_bg_hover = '<?php echo $settingObj->getDayWhiteLine2BgHover(); ?>';
var booking_recaptcha_style = '<?php echo $settingObj->getRecaptchaStyle(); ?>';

$(function() {
$('#back_today').fadeOut(0);
getMonthCalendar((newday.getMonth()+1),newday.getFullYear(),'<?php echo $calendarObj->getCalendarId(); ?>','<?php echo $publickey; ?>');
But when the extension is published with a page and I view the page HTML code, it looks totally different and gives an error when viewing on a browser.

EXTENSION CHANGED CODE (error message: parse error: syntax error, unexpected '}' in /home1/lucknow/public_html/folder1name/folder2name/index.php on line 183)
<script language="javascript">
var currentMonth;var currentYear;var pageX;var pageY;var today=new Date();var recaptchaVersion=<?php echo $settingObj->getRecaptchaVersion();?>;<?phpif($settingObj->getShowFirstFilledMonth()==0){?>var newday=new Date();<?php}else{?>var newday=new Date(<?php echo $calendarObj->getFirstFilledMonth($calendarObj->getCalendarId());?>);<?php}?>var booking_day_white_bg='<?php echo $settingObj->getDayWhiteBg(); ?>';var booking_day_white_bg_hover='<?php echo $settingObj->getDayWhiteBgHover(); ?>';var booking_day_white_line1_color='<?php echo $settingObj->getDayWhiteLine1Color(); ?>';var booking_day_white_line1_color_hover='<?php echo $settingObj->getDayWhiteLine1ColorHover(); ?>';var booking_day_white_line2_color='<?php echo $settingObj->getDayWhiteLine2Color(); ?>';var booking_day_white_line2_color_hover='<?php echo $settingObj->getDayWhiteLine2ColorHover(); ?>';var booking_day_white_line2_bg='<?php echo $settingObj->getDayWhiteLine2Bg(); ?>';var booking_day_white_line2_bg_hover='<?php echo $settingObj->getDayWhiteLine2BgHover(); ?>';var booking_recaptcha_style='<?php echo $settingObj->getRecaptchaStyle(); ?>';$(function(){$('#back_today').fadeOut(0);getMonthCalendar((newday.getMonth()+1),newday.getFullYear(),'<?php echo $calendarObj->getCalendarId(); ?>','<?php echo $publickey; ?>');
How can this be solved so that the extension builder doent put all the code into 1 line?
Check the new Chat GPT and Malware detect extensions at the link below

Check my WB Extensions
Check my WB Templates
---------------------------------------------------------
www.Lucknowwebs.com
User avatar
Pablo
 
Posts: 22503
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Error while building an extension(lines removed and put as 1 line) Extn builder 5.5

Post by Pablo »

Maybe you have enabled HTML/JavaScript formatting in Tools->Options->HTML?
User avatar
me.prosenjeet
 
 
Posts: 1267
Joined: Mon Dec 24, 2007 1:50 pm
Location: Lucknow
Contact:

Re: Error while building an extension(lines removed and put as 1 line) Extn builder 5.5

Post by me.prosenjeet »

Let me kiss your hands...that sorted the issue! Yes, javascript was set to 'minify'!
Check the new Chat GPT and Malware detect extensions at the link below

Check my WB Extensions
Check my WB Templates
---------------------------------------------------------
www.Lucknowwebs.com
Post Reply