Neo

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Welcome Guest! We have moved our site to https://neclipse.jcink.net/index.php


    Misc Code

    Manji
    Manji



    Village : Kirigakure
    Rank : Jounin
    Clan : Kaguya
    Discord Tag : Manji

    Misc Code Empty Misc Code

    Post by Manji Mon Mar 30, 2020 4:02 pm

    Code:
    $(function(){
     
      /* --- CONFIGURATION --- */
      // Topic IDs where the signatures are hidden
      var topic_ids = [1, 2, 3];
      // Forum IDs where the signatures are hidden
      var forum_ids = [1];
      // Category IDs where the signatures are hidden
      var cat_ids = [1];
      /* --- CONFIGURATION --- */
     
      var topic_match = window.location.pathname.match(/\/t(\d+)/); if (!topic_match) return;
      var current_topic = topic_match[1];
      var navbar = document.querySelector('.pathname-box');
      if (!current_topic || !navbar) return;
      var forum_selector = navbar.querySelectorAll('.nav');
      var current_forum = forum_selector[forum_selector.length - 1]; if (!current_forum) return;
      var forum_match = current_forum.href.match(/\/f(\d+)/); if (!forum_match) return;
      current_forum = forum_match[1]; if (!current_forum) return;
      if (topic_ids.includes(parseInt(current_topic)) || forum_ids.includes(parseInt(current_forum))) {
        $('.signature_div').filter(function(){ this.style.display = "none" });
      }
      var cat_selector = navbar.querySelectorAll('.nav');
      var current_cat = cat_selector[cat_selector.length - 2]; if (!current_cat) return;
      var cat_match = current_cat.href.match(/\/c(\d+)/); if (!cat_match) return;
      current_cat = cat_match[1]; if (!current_cat) return;
      if (topic_ids.includes(parseInt(current_topic)) || cat_ids.includes(parseInt(current_cat))) {
        $('.signature_div').filter(function(){ this.style.display = "none" });
      }
    });
    Manji
    Manji



    Village : Kirigakure
    Rank : Jounin
    Clan : Kaguya
    Discord Tag : Manji

    Misc Code Empty Re: Misc Code

    Post by Manji Mon Mar 30, 2020 4:04 pm

    WC:
    Code:
    counter = function() {
        var value = $('#text').val();

        if (value.length == 0) {
            $('#wordCount').html(0);
            $('#totalChars').html(0);
            $('#charCount').html(0);
            $('#charCountNoSpace').html(0);
            return;
        }

        var regex = /\s+/gi;
        var wordCount = value.trim().replace(regex, ' ').split(' ').length;
        var totalChars = value.length;
        var charCount = value.trim().length;
        var charCountNoSpace = value.replace(regex, '').length;

        $('#wordCount').html(wordCount);
        $('#totalChars').html(totalChars);
        $('#charCount').html(charCount);
        $('#charCountNoSpace').html(charCountNoSpace);
    };

    $(document).ready(function() {
        $('#count').click(counter);
        $('#text').change(counter);
        $('#text').keydown(counter);
        $('#text').keypress(counter);
        $('#text').keyup(counter);
        $('#text').blur(counter);
        $('#text').focus(counter);
    });
    Manji
    Manji



    Village : Kirigakure
    Rank : Jounin
    Clan : Kaguya
    Discord Tag : Manji

    Misc Code Empty Re: Misc Code

    Post by Manji Mon Mar 30, 2020 4:05 pm

    CBs
    Code:
    function selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.selectNodeContents(a);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),
            c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())}
           
          $(function(){
                $("dl.codebox:not(.spoiler,.hidecode)  > dd.code, dl.codebox:not(.spoiler,.hidecode)  > dd > code").closest("dl").find('dt').append('<span onClick="selectCode(this)" class="selectCode">Select Content</span>');
            });

    Sponsored content


    Misc Code Empty Re: Misc Code

    Post by Sponsored content


      Current date/time is Sun May 19, 2024 1:23 am