1

hello people I have s problem with implementing Vista-Like Ajax Calendar to my website.

To header.tpl add this lines:

<link rel="stylesheet" media="screen" href="Includes/plugins/DatePicker/styles/vlaCal-v2.1.css" type="text/css" />
<link rel="stylesheet" media="screen" href="Includes/plugins/DatePicker/styles/vlaCal-v2.1-adobe_cs3.css" type="text/css" />
<script type="text/javascript" src="Includes/plugins/DatePicker/jslib/mootools-1.2-core-compressed.js"></script>
<script type="text/javascript" src="Includes/plugins/DatePicker/jslib/vlaCal-v2.1-compressed.js"></script>

and this code:

<script type="text/javascript">                                                      
    window.addEvent('domready', function() { 
        new vlaDatePicker('ptime', { style: 'adobe_cs3', offset: { y: 1 }, format: 'd.m.y', ieTransitionColor: '' }); 
    });  
</script>

Ajax calendar is not working in this format. Next I edit code to:

<script type="text/javascript">  
   {literal}                                                    
        window.addEvent('domready', function() { 
            new vlaDatePicker('ptime', { style: 'adobe_cs3', offset: { y: 1 }, format: 'd.m.y', ieTransitionColor: '' }); 
        }); 
   {/literal} 
</script>

Calendar is not working with {literal}{/literal}.

What I do wrong? Where is a problem??

Flambar
  • 11
  • 1
  • Have you checked the browser console / error log for javascript errors yet? – sofl Feb 05 '14 at 17:47
  • I have 2 errors: 1. Uncaught TypeError: Object [object Object] has no method 'fancybox' add.php?v=video:37 - Fancybox is working 2. Uncaught TypeError: Object function (e,t){return new x.fn.init(e,t,r)} has no method 'element' mootools-1.2-core.js:1205 - this js file is for this plugin whose not working And 1 warning: event.returnValue is deprecated. Please use the standard event.preventDefault() instead. What can I do with this problem?? – Flambar Feb 05 '14 at 19:19
  • I think there could be a problem with the mootools core file. I get an error in the example on IE9 but it works on chrome and opera. You could try to use another/newer mootools version. download here: http://mootools.net/download – sofl Feb 06 '14 at 10:54
  • There is the problem. I changed mootols file and now is working without errors :-) – Flambar Feb 06 '14 at 23:20

1 Answers1

0

Try doing your js code in the template files like this.

{literal}  
<script type="text/javascript">  

        window.addEvent('domready', function() { 
            new vlaDatePicker('ptime', { style: 'adobe_cs3', offset: { y: 1 }, format: 'd.m.y', ieTransitionColor: '' }); 
        }); 
</script>
{/literal} 

However I recommend putting Javascript in js files and then including them rather than using the code in the template itself.

Panama Jack
  • 24,158
  • 10
  • 63
  • 95