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.

How to move the "select content" a little bit to the right?

View previous topic View next topic Go down

Solved How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 3rd 2012, 6:52 pm

How to move the "select content" a little bit to the right?


~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by Nera. on May 4th 2012, 9:22 am

Hi,

Please post a link to a topic on your forum that has a code box.

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 6th 2012, 4:59 am

Here's the link :
adikz.forumtl.com/t12-test-post-with-attachment

~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by Sir Chivas™ on May 6th 2012, 5:52 am

Can you provide me with the code, that you used?



Attention!
- Please provide your forum URL at all times.
- When the issue is solved, please mark it as solved.



Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6756
Reputation : 428
Language : English, Spanish, and French
Location : || CSS || HTML || Graphics Designs || Support ||

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 7th 2012, 6:11 am

Here sir:
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="red"></font><u>"Select Content"</u> </a>');
        });

~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 7th 2012, 7:23 pm

please help ...

~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by Nera. on May 8th 2012, 8:01 am

Add this to CSS. It will move the select content word:

Code:
.genmed b a u {
    padding-left: 20px;
}

Check will everything else stay in place.

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 8th 2012, 9:24 am

thanks it moved. But how to remove the line under it?


~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by Nera. on May 8th 2012, 10:01 am

You'll need to replace your Select code with mine since I added a class for it and your Font tags are not closed correctly.

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:
 <span class="kutijica"><a href="javascript:void()" onClick="selectCode(this)">"Select Content"</a></span>');
        });

Than you'll delete the first changes I told you to add to CSS for the movment.

You'll add this now to move it and remove underline:

Code:
span.kutijica a {
    text-decoration: none !important;
    margin-left: 20px;
}

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 8th 2012, 11:42 am

Nice, It works .
Can I have some more? How could I remove the link under links? All the links.

Can you give some links. Tnx.

~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by Nera. on May 10th 2012, 2:35 pm

You mean the underline?

Add this to the top of your CSS:

Code:
a:link {
    text-decoration: none !important;
}
a:visited {
    text-decoration: none !important;
}
a:active {
    text-decoration: none !important;
}
a:hover {
    text-decoration: none !important;
}

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by ~@dikz~ on May 11th 2012, 5:27 am

Solved. Thank you. :wouhou:

~@dikz~
Forumember

Male Posts : 363
Reputation : 4
Language : English & Tagalog
Location : Legazpi, Philippines - Bicol University

http://adikz.forumtl.com

Back to top Go down

Solved Re: How to move the "select content" a little bit to the right?

Post by SLGray on May 11th 2012, 6:01 am

Topic Solved & Locked


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


SLGray
Administrator
Administrator

Male Posts : 35665
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

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