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.

Need help Moving slect conent button

4 posters

Go down

Solved Need help Moving slect conent button

Post by Sir. Mayo August 20th 2013, 4:39 pm

So i followed this tutorial here
https://help.forumotion.com/t93456-select-content-button
but the only issue is that the select content button is right next the the word code how can i move it (see pic to see where i want it moved)
Need help Moving slect conent button  Screen15

Can some one help me do that please and thank you!
Forum type is Phbb2


Last edited by Sir. Mayo on August 20th 2013, 9:35 pm; edited 1 time in total
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur August 20th 2013, 7:16 pm

Hi Sir. Mayo,

Try this in your CSS and see if it works:
Code:
.code-a{
float:right;
}
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo August 20th 2013, 8:37 pm

Nope nothing i installed it VIA Java script so yea i mean i tried lots of differnet things in CSS but nothing SO thanks but its not working :(BASE is the one who made the Tutorial so maybe he knows IDK though!
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by SLGray August 20th 2013, 8:41 pm

Code:
.code-a {
    float: right !important;
    }
If this does not work, add it to the top of your CSS Stylesheet.


Need help Moving slect conent button  Slgray10

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

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo August 20th 2013, 9:02 pm

I added to the top and still nothing! Sad
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur August 20th 2013, 9:11 pm

Since that doesn't work for you I've gone ahead and did what the support forum did; utilize dashes(-) to separate.
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: <font style="color:transparent;">----------</font><a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });


Edit the color and amount of dashes to fit what you want.

<font style="color:transparent;">----------</font> (its near the bottom of the script)
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo August 20th 2013, 9:30 pm

Seth your code did not work but i read over it and the one in the tutorial and came up with this one that does the trick:




Code:
function selectCode(a)


        {


        // Get ID of code block


        var e = jQuery(a).closest('tr').next().find('.cont_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();


        }


        }


        jQuery(function(){





        jQuery('div.postbody td.code').parent().prev().find('b').html('Code:


        <a href="javascript:void()" onClick="selectCode(this)"><font


        face="verdana" color="transparent">---------------</font>Select Content </a>');


        });

i changed the font color to transparent then added the dashed like they where in your Code thanks everyone! SOLVED
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur August 20th 2013, 9:37 pm

Ah, okay you're welcome. You might want to place the dashes before <a> so they will not be underlined when you hover over select if you want. Smile
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir Chivas™ August 21st 2013, 1:22 am

Thread Locked & Archived.
Sir Chivas™
Sir Chivas™
Helper
Helper

Male Posts : 6965
Reputation : 457
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum