Need help Moving slect conent button

Go down

Solved Need help Moving slect conent button

Post by Sir. Mayo on Tue 20 Aug 2013 - 16:39

So i followed this tutorial here
http://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)


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


Last edited by Sir. Mayo on Tue 20 Aug 2013 - 21:35; edited 1 time in total
avatar
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 on Tue 20 Aug 2013 - 19:16

Hi Sir. Mayo,

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

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo on Tue 20 Aug 2013 - 20:37

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!
avatar
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 on Tue 20 Aug 2013 - 20:41

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 43068
Reputation : 3047
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo on Tue 20 Aug 2013 - 21:02

I added to the top and still nothing! Sad
avatar
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 on Tue 20 Aug 2013 - 21:11

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)
avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo on Tue 20 Aug 2013 - 21:30

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
avatar
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 on Tue 20 Aug 2013 - 21:37

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
avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir Chivas™ on Wed 21 Aug 2013 - 1:22

Thread Locked & Archived.
avatar
Sir Chivas™
Support Moderator
Support Moderator

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

Back to top Go down

Back to top


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