Select Content overriding Add a form Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Select Content overriding Add a form

    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Select Content overriding Add a form

    Post by Pizza Boi April 1st 2014, 7:20 pm

    Hi Very Happy

    Well, I'm really sorry for asking a lot of questions recently about scripting but I really don't know how to work around this one x.x... I've managed to fix some other scripts but not these two.

    Basically, I want these 2 scripts found here and here to work together and not cancel each other out.

    You see, I tried other things as well as changing some functions here and there but I can't manage to make it work x.x.

    Would it be possible to have those work together? Also, in the first link, would changing this portion:
    Code:
    mode=newtopic
    to something like "reply" or something may make it work that instead of posting a new topic, it can be in a reply?

    Regards,
    Pizza Boi


    Last edited by Pizza Boi on April 1st 2014, 8:49 pm; edited 1 time in total
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Select Content overriding Add a form

    Post by Ange Tuteur April 1st 2014, 7:54 pm

    Hello,

    They should work fine together since both of these are installed on the support. Post the exact code here you're trying to use. (the form)
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: Select Content overriding Add a form

    Post by Pizza Boi April 1st 2014, 8:11 pm

    Hi Very Happy

    This is for the select content:

    Code:
    function selectCode(a)
        {
          // Get ID of code block
          var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
        
          // Not IE
          if (window.getSelection)
          {
              var s = window.getSelection();
              // Safari
              if (s.setBaseAndExtent)
              {
                s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
              }
              // Firefox and Opera
              else
              {
                // workaround for bug # 42885
                if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
                {
                    e.innerHTML = e.innerHTML + ' ';
                }
        
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
              }
          }
          // Some older browsers
          else if (document.getSelection)
          {
              var s = document.getSelection();
              var r = document.createRange();
              r.selectNodeContents(e);
              s.removeAllRanges();
              s.addRange(r);
          }
          // IE
          else if (document.selection)
          {
              var r = document.body.createTextRange();
              r.moveToElementText(e);
              r.select();
          }
        }
        if(text){}else{ var text = 'Selecionar todos';}
        jQuery(document).ready(function(){
          jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });

    This is for the form:

    Code:
    $(function() {
        if (location.pathname == '/post' && location.search == '?f=25&mode=newtopic') {
           $('#text_editor_textarea').val('FORM');
        }
    });

    http://ygoda.forumtl.com/ my forum URL.

    Edit: Sorry I forgot I adjusted the value:

    Code:
    $(function() {
        if (location.pathname == '/post' && location.search == '?f=25&mode=newtopic') {
          $('#text_editor_textarea').val('[b]In-game name[/b]:\n[b]Item bought[/b]:\n[b]Paid[/b]:');
        }
    });

    Regards,
    Pizza Boi
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Select Content overriding Add a form

    Post by Ange Tuteur April 1st 2014, 8:22 pm

    I've tested both together and they're working fine. Do you have any other scripts on your forum ? If you do, I'd try disabling them one by one to see which is causing the two not to work.

    Select Content overriding Add a form Captu447
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: Select Content overriding Add a form

    Post by Pizza Boi April 1st 2014, 8:44 pm

    Hi Very Happy

    It worked! I actually had to re-do and re-paste all scripts... made a mistake at one of them and declared a wrong variable.

    Thanks, Ange!

    Regards,
    Pizza Boi
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    Solved Re: Select Content overriding Add a form

    Post by SLGray April 1st 2014, 8:51 pm

    Problem solved & topic archived.



    Select Content overriding Add a form Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.