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 overriding Add a form

View previous topic View next topic Go down

Solved Select Content overriding Add a form

Post by Pizza Boi on April 1st 2014, 7:20 pm

Hi Very Happy

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
to something like "reply" or something may make it work that instead of posting a new topic, it can be in a reply?

Regards,
Pizza Boi


Last edited by Pizza Boi on April 1st 2014, 8:49 pm; edited 1 time in total

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: Select Content overriding Add a form

Post by Ange Tuteur on April 1st 2014, 7:54 pm

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)

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Select Content overriding Add a form

Post by Pizza Boi on April 1st 2014, 8:11 pm

Hi Very Happy

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

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: Select Content overriding Add a form

Post by Ange Tuteur on April 1st 2014, 8:22 pm

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.


Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Select Content overriding Add a form

Post by Pizza Boi on April 1st 2014, 8:44 pm

Hi Very Happy

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

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: Select Content overriding Add a form

Post by SLGray on April 1st 2014, 8:51 pm

Problem solved & topic archived.


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


SLGray
Administrator
Administrator

Male Posts : 35672
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