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.

Select Content Mess up [Help Needed]

View previous topic View next topic Go down

Solved Select Content Mess up [Help Needed]

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



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

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 on 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
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

Post by Khaoz on 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

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 on 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
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

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

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 on 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://i37.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
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Select Content Mess up [Help Needed]

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

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 : 36673
Reputation : 2445
Language : English
Location : United States

http://ztwds.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