Dołącz do zespołu ekspertów! Backend lub Frontend Developer?

Sprawdź najnowsze oferty pracy naszego partnera - 8lines.io!

Posypane jquery!

Błąd   Założony przez  CyCq97.

wersja skryptu MyBB: 1.6.9
adres forum: more-cs.pl
[b]na czym polega problem (screen, opis, komunikaty):

Witam, rozsypało mi się jquery i zracam się tu o pomoc czy mógłby mi ktoś podrzucić plik [b]headerinclude

znajdujący się w style i szablony/szablony/twoj styl/Niezgrupowane szablony

lub gdyby mi ktoś pomógł przerobić mi ten plik z tego poradnika. Próbowałem osobiście lecz nie wyszukuje mi kodów z poradnika w pliku.

https://webboard.pl/thread-36416.html

Mój plik headerinclude :
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pl_PL/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>





<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/tiptip.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/yetii.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
{$stylesheets}
<script>
jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery(function () {
        // scroll body to 0px on click
        jQuery('#back-top').click(function () {
            jQuery('body,html').animate({
                scrollTop: 0
            }, 800);
            return false;
        });
    });
        jQuery(".loginbutton").click(function(e) {
            e.preventDefault();
            jQuery(".loginbutton_menu").slideToggle("fast");
            jQuery(".loginbutton").toggleClass("loginbutton_menu_open");
        });
        jQuery(".loginbutton_menu").mouseup(function() {
            return false
        });
        jQuery(document).mouseup(function(e) {
            if(jQuery(e.target).parent("a.loginbutton").length==0) {
                jQuery(".loginbutton").removeClass("loginbutton_menu_open");
                jQuery(".loginbutton_menu").slideUp("fast",  function() {display: 'toggle'});;
            }
            
        });
jQuery(function(){
jQuery(".pmpopup").tipTip({defaultPosition: "top", fadeIn: 300});
});
});
</script>



<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/images/deflection/functions.js"></script>
<script type="text/javascript">
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>





<script>
jQuery.noConflict();
jQuery(document).ready(function() {    
    //select all the a tag with name equal to modal
    jQuery('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = jQuery(this).attr('href');
    
        //Get the screen height and width
        var maskHeight = jQuery(document).height();
        var maskWidth = jQuery(window).width();
    
        //Set height and width to mask to fill up the whole screen
        jQuery('#mask').css({'width':maskWidth,'height':maskHeight});
        
        //transition effect        
        jQuery('#mask').fadeIn("fast");
        jQuery('#mask').fadeTo("slow",0.5);    
    
        //Get the window height and width
        var winH = jQuery(window).height();
        var winW = jQuery(window).width();
              
    
        //transition effect
        jQuery(id).fadeIn("slow");
    
    });
    
    //if close button is clicked
    jQuery('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        jQuery('#mask, .window, #loginbox').fadeOut("slow");
    });        
    
    //if mask is clicked
    jQuery('#mask').click(function () {
        jQuery(this).fadeOut("slow");
        jQuery('.window').fadeOut("slow");
    });            
    
});
</script>




{$newpmmsg}
<script language="javascript" type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/custom_status.js"></script>


Byłbym bardzo wdzięczny pozdrawiam!
Matslom napisał 26.07.2013, 18:55:
Przenoszę do odpowiedniego działu.
Zamiana:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pl_PL/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/tiptip.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/yetii.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/images/deflection/functions.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
{$stylesheets}
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}

<script>
jQuery.noConflict();
jQuery(document).ready(function() {    
    //select all the a tag with name equal to modal
    jQuery('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = jQuery(this).attr('href');
    
        //Get the screen height and width
        var maskHeight = jQuery(document).height();
        var maskWidth = jQuery(window).width();
    
        //Set height and width to mask to fill up the whole screen
        jQuery('#mask').css({'width':maskWidth,'heigh​t':maskHeight});
        
        //transition effect        
        jQuery('#mask').fadeIn("fast");
        jQuery('#mask').fadeTo("slow",0.5);    
    
        //Get the window height and width
        var winH = jQuery(window).height();
        var winW = jQuery(window).width();
              
    
        //transition effect
        jQuery(id).fadeIn("slow");
    
    });
    
    //if close button is clicked
    jQuery('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        jQuery('#mask, .window, #loginbox').fadeOut("slow");
    });        
    
    //if mask is clicked
    jQuery('#mask').click(function () {
        jQuery(this).fadeOut("slow");
        jQuery('.window').fadeOut("slow");
    });            
    
});
</script>

<script>
jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery(function () {
        // scroll body to 0px on click
        jQuery('#back-top').click(function () {
            jQuery('body,html').animate({
                scrollTop: 0
            }, 800);
            return false;
        });
    });
        jQuery(".loginbutton").click(function(e) {
            e.preventDefault();
            jQuery(".loginbutton_menu").slideToggle("fast");
            jQuery(".loginbutton").toggleClass("loginbutton_menu_open");
        });
        jQuery(".loginbutton_menu").mouseup(function() {
            return false
        });
        jQuery(document).mouseup(function(e) {
            if(jQuery(e.target).parent("a.loginbutton").length==0) {
                jQuery(".loginbutton").removeClass("loginbutton_menu_open");
                jQuery(".loginbutton_menu").slideUp("fast",  function() {display: 'toggle'});;
            }
            
        });
jQuery(function(){
jQuery(".pmpopup").tipTip({defaultPosition: "top", fadeIn: 300});
});
});
</script>
Problem jest w tej linijce:
function () {
display: 'toggle'
};
taka składnia display: 'toggle' to obiekty z Javascripcie, a ty to wrzuciłeś do funkcji. Nie mam pojęcia co to miałoby robić, wrzucisz oryginalny skrypt?

Aktualnie poprawiony kod, wyrzuciłem ten callback.
jQuery.noConflict();
jQuery(document).ready(function () {
    // scroll body to 0px on click
    jQuery('#back-top').click(function () {
        jQuery('body,html').animate({
            scrollTop: 0
        }, 800);
        return false;
    });
    jQuery(".loginbutton").click(function (e) {
        e.preventDefault();
        jQuery(".loginbutton_menu").slideToggle("fast");
        jQuery(".loginbutton").toggleClass("loginbutton_menu_open");
    });
    jQuery(".loginbutton_menu").mouseup(function () {
        return false;
    });
    jQuery(document).mouseup(function (e) {
        if (jQuery(e.target).parent("a.loginbutton").length === 0) {
            jQuery(".loginbutton").removeClass("loginbutton_menu_open");
            jQuery(".loginbutton_menu").slideUp("fast");
        };
    });
    jQuery(".pmpopup").tipTip({
        defaultPosition: "top",
        fadeIn: 300
    });
});

// Edit
Jest jeszcze problem z TipTip, którego nie masz na serwerze - http://more-cs.pl/jscripts/tiptip.js
Naprawiło się tylko edycja tekstu w pisaniu postów lecz nadal nie można zamykać,przypisać itp. wątków .. ;/

Do tego padł chatbox..
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pl_PL/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/tiptip.js"></script>
<script>
jQuery.noConflict();
jQuery(document).ready(function() {    
    //select all the a tag with name equal to modal
    jQuery('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = jQuery(this).attr('href');
    
        //Get the screen height and width
        var maskHeight = jQuery(document).height();
        var maskWidth = jQuery(window).width();
    
        //Set height and width to mask to fill up the whole screen
        jQuery('#mask').css({'width':maskWidth,'heigh​​t':maskHeight});
        
        //transition effect        
        jQuery('#mask').fadeIn("fast");
        jQuery('#mask').fadeTo("slow",0.5);    
    
        //Get the window height and width
        var winH = jQuery(window).height();
        var winW = jQuery(window).width();
              
    
        //transition effect
        jQuery(id).fadeIn("slow");
    
    });
    
    //if close button is clicked
    jQuery('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        jQuery('#mask, .window, #loginbox').fadeOut("slow");
    });        
    
    //if mask is clicked
    jQuery('#mask').click(function () {
        jQuery(this).fadeOut("slow");
        jQuery('.window').fadeOut("slow");
    });            
    // scroll body to 0px on click
    jQuery('#back-top').click(function () {
        jQuery('body,html').animate({
            scrollTop: 0
        }, 800);
        return false;
    });
    jQuery(".loginbutton").click(function(e) {
        e.preventDefault();
        jQuery(".loginbutton_menu").slideToggle("fast");
        jQuery(".loginbutton").toggleClass("loginbutton_menu_open");
    });
    jQuery(".loginbutton_menu").mouseup(function() {
        return false
    });
    jQuery(document).mouseup(function(e) {
        if(jQuery(e.target).parent("a.loginbutton").length==0) {
            jQuery(".loginbutton").removeClass("loginbutton_menu_open");
            jQuery(".loginbutton_menu").slideUp("fast");;
        }
        
    });
    jQuery(".pmpopup").tipTip({defaultPosition: "top", fadeIn: 300});
});
</script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/yetii.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/images/deflection/functions.js"></script>
{$stylesheets}
<script type="text/javascript">
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}

Poprawiony headerinclude.
Dziękuje teraz działa
SLAVOO napisał 26.07.2013, 17:19:
[Obrazek: modnotice_thx.png]

Nie pisz zbędnych postów



Użytkownicy przeglądający ten wątek:

1 gości