The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Need help Moving slect conent button

View previous topic View next topic Go down

Solved Need help Moving slect conent button

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

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 August 20th 2013, 9:35 pm; edited 1 time in total

Sir. Mayo
Forumember

Male Posts : 969
Reputation : 87
Language : English, Some french.
Location : Working 11Pm-7Am EST I will try to respond ASAP

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

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo on 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
Forumember

Male Posts : 969
Reputation : 87
Language : English, Some french.
Location : Working 11Pm-7Am EST I will try to respond ASAP

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

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by SLGray on 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.


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


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Need help Moving slect conent button

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

I added to the top and still nothing! Sad

Sir. Mayo
Forumember

Male Posts : 969
Reputation : 87
Language : English, Some french.
Location : Working 11Pm-7Am EST I will try to respond ASAP

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

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Sir. Mayo on 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
Forumember

Male Posts : 969
Reputation : 87
Language : English, Some french.
Location : Working 11Pm-7Am EST I will try to respond ASAP

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

Back to top Go down

Solved Re: Need help Moving slect conent button

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Need help Moving slect conent button

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

Thread Locked & Archived.

Sir Chivas™
Support Moderator
Support Moderator

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

Back to top Go down

View previous topic View next topic Back to top


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