Select Content overriding Add a form
3 posters
Page 1 of 1
Select Content overriding Add a form
Hi
Well, I'm really sorry for asking a lot of questions recently about scripting but I really don't know how to work around this one x.x... I've managed to fix some other scripts but not these two.
Basically, I want these 2 scripts found here and here to work together and not cancel each other out.
You see, I tried other things as well as changing some functions here and there but I can't manage to make it work x.x.
Would it be possible to have those work together? Also, in the first link, would changing this portion:
Regards,
Pizza Boi
Well, I'm really sorry for asking a lot of questions recently about scripting but I really don't know how to work around this one x.x... I've managed to fix some other scripts but not these two.
Basically, I want these 2 scripts found here and here to work together and not cancel each other out.
You see, I tried other things as well as changing some functions here and there but I can't manage to make it work x.x.
Would it be possible to have those work together? Also, in the first link, would changing this portion:
- Code:
mode=newtopic
Regards,
Pizza Boi
Last edited by Pizza Boi on April 1st 2014, 8:49 pm; edited 1 time in total
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Select Content overriding Add a form
Hello,
They should work fine together since both of these are installed on the support. Post the exact code here you're trying to use. (the form)
They should work fine together since both of these are installed on the support. Post the exact code here you're trying to use. (the form)
Re: Select Content overriding Add a form
Hi
This is for the select content:
This is for the form:
http://ygoda.forumtl.com/ my forum URL.
Edit: Sorry I forgot I adjusted the value:
Regards,
Pizza Boi
This is for the select content:
- 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: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
});
This is for the form:
- Code:
$(function() {
if (location.pathname == '/post' && location.search == '?f=25&mode=newtopic') {
$('#text_editor_textarea').val('FORM');
}
});
http://ygoda.forumtl.com/ my forum URL.
Edit: Sorry I forgot I adjusted the value:
- Code:
$(function() {
if (location.pathname == '/post' && location.search == '?f=25&mode=newtopic') {
$('#text_editor_textarea').val('[b]In-game name[/b]:\n[b]Item bought[/b]:\n[b]Paid[/b]:');
}
});
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Select Content overriding Add a form
I've tested both together and they're working fine. Do you have any other scripts on your forum ? If you do, I'd try disabling them one by one to see which is causing the two not to work.
Re: Select Content overriding Add a form
Hi
It worked! I actually had to re-do and re-paste all scripts... made a mistake at one of them and declared a wrong variable.
Thanks, Ange!
Regards,
Pizza Boi
It worked! I actually had to re-do and re-paste all scripts... made a mistake at one of them and declared a wrong variable.
Thanks, Ange!
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Select Content overriding Add a form
Problem solved & topic archived.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum