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.

Select Content Mess up [Help Needed]

3 posters

Go down

Solved Select Content Mess up [Help Needed]

Post by Khaoz July 23rd 2013, 4:44 pm

Select Content Mess up [Help Needed] CIXlO4w

As you can see the (code)(/code) is not working right in my posts. It carrys on to everything after and is also throwing in a border which shouldn't be there as its not even being placed around the code selection table.

Would be nice if someone had a theory of how to fix this.


Last edited by Khaoz on July 23rd 2013, 5:12 pm; edited 1 time in total
avatar
Khaoz
Forumember

Posts : 48
Reputation : 4
Language : English

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

Post by Ange Tuteur July 23rd 2013, 4:50 pm

Can you please post a link to a thread on your forum using the code tags, so I may have a look?
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: Select Content Mess up [Help Needed]

Post by Khaoz July 23rd 2013, 4:54 pm

*Removed to keep website off forums


Last edited by Khaoz on July 23rd 2013, 5:14 pm; edited 1 time in total
avatar
Khaoz
Forumember

Posts : 48
Reputation : 4
Language : English

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

Post by Ange Tuteur July 23rd 2013, 5:06 pm

Try replacing your current select content code with the one below.

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> Select Content </a>');
    });

Also if you wish to remove the borders use this:
Code:
.code {
  border: 0px;
}

Though It may be something in your CSS or templates that could be causing this. As I found 'span .postbody' where the border content is.
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: Select Content Mess up [Help Needed]

Post by Khaoz July 23rd 2013, 5:11 pm

I managed to fix it by removing this from my css but the code you gave .code didnt seem to work without having to remove v
Code:
.postbody {
    font-size: 12px;
    line-height: 18px;
  -moz-border-radius: 2px 2px 2px 2px; border: 2px solid rgb(24,24,24); outline: 1px solid rgb(17, 17, 17); padding: 5px; color: rgb(255, 255, 255);
}
 
this seemed to be the issue.^
avatar
Khaoz
Forumember

Posts : 48
Reputation : 4
Language : English

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

Post by Ange Tuteur July 23rd 2013, 5:20 pm

Very good that you removed the cause, I had doubts of the select code causing it after inspection.

from previous editing
https://i.servimg.com/u/f37/18/21/41/30/ex110.png

Code does not seem to be the problem at all which is good. Wink
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: Select Content Mess up [Help Needed]

Post by SLGray July 23rd 2013, 7:29 pm

Topic Solved & Locked


Select Content Mess up [Help Needed] 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 : 51482
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

Back to top

- Similar topics

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