Dotclear

Vous n'êtes pas identifié(e).

Annonce

#1 2021-10-18 06:07:18

ijurisic
Membre
Inscription : 2021-10-14

Uncaught ReferenceError: dotclear is not defined

When open any post I got this error in debug console (any idea how to fix? - using theme dcResponsive mybe that is problem):

'use strict';if(typeof dotclear.post_remember_str==='undefined'&&typeof dotclear.getData!=='undefined'){dotclear.post_remember_str=dotclear.getData('dc_post_remember_str').post_remember_str;}
window.addEventListener('load',()=>{let bloc=new DOMParser().parseFromString(`<p class="remember"><input type="checkbox" id="c_remember" name="c_remember" /> <label for="c_remember">${dotclear.post_remember_str}</label></p>`,'text/html').body.firstChild;let point=document.querySelector('#comment-form input[type=submit][name=preview]');if(!point){point=document.querySelector('#comment-form button[type=submit][name=preview]');}
if(point){point=point.parentNode;point.parentNode.insertBefore(bloc,point);}else{return;}
const remember_me_name='comment_info';let info=readRememberInfo();if(info!==false){document.getElementById('c_name').setAttribute('value',info.name);document.getElementById('c_mail').setAttribute('value',info.mail);document.getElementById('c_site').setAttribute('value',info.site);document.getElementById('c_remember').setAttribute('checked','checked');}
document.getElementById('c_remember').onclick=function(e){if(e.target.checked){setRememberInfo();}else{dropRememberInfo();}};let copeWithModifiedInfo=function(){if(document.getElementById('c_remember').checked){setRememberInfo();}};document.getElementById('c_name').onchange=copeWithModifiedInfo;document.getElementById('c_mail').onchange=copeWithModifiedInfo;document.getElementById('c_site').onchange=copeWithModifiedInfo;function setRememberInfo(){localStorage.setItem(remember_me_name,JSON.stringify({name:document.getElementById('c_name').value,mail:document.getElementById('c_mail').value,site:document.getElementById('c_site').value,}));}
function dropRememberInfo(){localStorage.removeItem(remember_me_name);}
function readRememberInfo(){let info=localStorage.getItem(remember_me_name);if(info===null){return false;}
let result=JSON.parse(info);if(Object.keys(result).length!=3){dropRememberInfo();return false;}
return result;}});

Dernière modification par ijurisic (2021-10-18 06:13:18)

Hors ligne

#2 2021-10-18 07:18:56

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Uncaught ReferenceError: dotclear is not defined

Try replacing, in tpl/post.html

<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.js"></script>
<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.cookie.js"></script>

by

<tpl:SysIf jquery_needed="1">
  <script src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.js"></script>
</tpl:SysIf>
<script src="{{tpl:BlogQmarkURL}}pf=util.js"></script>

You may have to do the same with page.html...

Hors ligne

#3 2021-10-26 12:00:08

ijurisic
Membre
Inscription : 2021-10-14

Re : Uncaught ReferenceError: dotclear is not defined

Thanks on replay

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map