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.

Change the topic title without editing with jQuery ?

View previous topic View next topic Go down

Solved Change the topic title without editing with jQuery ?

Post by Shek on April 6th 2014, 3:05 pm

Hello!

Can anyone tell me if it is possible to put a pencil next to the title, and when you click to change the title without changing the page?

Thanks. Very Happy


Last edited by Shek on April 7th 2014, 3:07 am; edited 1 time in total

Shek
Active Poster

Male Posts : 1092
Reputation : 31
Language : Portuguese and English
Location : Brazil

http://www.shiftactif.com/

Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Michael_vx on April 6th 2014, 3:45 pm

i think this wont be possible
t edit topic title you must take edit topic it self

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Guest on April 6th 2014, 5:48 pm

Hello,

This is NOT possible. For editing a post you must go to the editing mode, you can't edit the post like you say.

But you can suggest it: http://help.forumotion.com/f30-suggestions-for-your-forums

Guest
Guest


Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Ange Tuteur on April 6th 2014, 9:37 pm

Hi Shek,

Without using jQuery or JavaScript ? Unfortunately, that would not be possible. It is absolutely possible with using jQuery or JavaScript, though. It would just take a bit of work to setup. Wink

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Shek on April 7th 2014, 12:26 am

Yes, it would be with jQuery, if you can do it, I am completely grateful friend. Very Happy

Shek
Active Poster

Male Posts : 1092
Reputation : 31
Language : Portuguese and English
Location : Brazil

http://www.shiftactif.com/

Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Ange Tuteur on April 7th 2014, 2:21 am

You can consider this a rough draft :

* Placement in the sub forums
Code:
$(function() {
  if (_userdata.user_level == 0 || typeof _userdata === 'undefined') return;
  $('.topictitle').after('<img id="editTitle" src="http://illiweb.com/fa/prosilver/icon_post_edit_en.png" style="cursor:pointer;" /><div id="postData" style="display:none;"></div>');
  $(document).on('click', '#editTitle', function() {
  $(this).next().load($(this).prev().attr('href') + ' .post:first a[href$="mode=editpost"]', function() {
  var topictitle = $(this).prev().prev().text();
  $(this).prev().before('<div id="newTitle"><input class="inputbox medium" type="text" onkeypress="if (event.keyCode==13){return false}" title="The length of the title for this topic must be ranging between 3 and 255 characters" maxlength="255" value="' + topictitle + '" name="subject"><input class="button1" type="submit" accesskey="s" tabindex="6" value="Send" name="post"></div><div id="postDataFull"></div>');
  $(this).prev().remove();
 
  $(this).prev().load($(this).find('a').attr('href') + ' form[action="/post"]', function() {
  $(this).find('form').children().hide();
  $(this).find('form').append($(this).prev());
  });
  });
  });
});

It was developed on phpbb3, and uses the toolbar to check the user level. (only viewable to admin/mod)

So if You're not using phpbb3, or not using the toolbar you may experience a bug or it wont 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: Change the topic title without editing with jQuery ?

Post by Pizza Boi on April 7th 2014, 2:52 am

@Ange Tuteur wrote:You can consider this a rough draft :

* Placement in the sub forums
Code:
$(function() {
  if (_userdata.user_level == 0 || typeof _userdata === 'undefined') return;
  $('.topictitle').after('<img id="editTitle" src="http://illiweb.com/fa/prosilver/icon_post_edit_en.png" style="cursor:pointer;" /><div id="postData" style="display:none;"></div>');
  $(document).on('click', '#editTitle', function() {
  $(this).next().load($(this).prev().attr('href') + ' .post:first a[href$="mode=editpost"]', function() {
  var topictitle = $(this).prev().prev().text();
  $(this).prev().before('<div id="newTitle"><input class="inputbox medium" type="text" onkeypress="if (event.keyCode==13){return false}" title="The length of the title for this topic must be ranging between 3 and 255 characters" maxlength="255" value="' + topictitle + '" name="subject"><input class="button1" type="submit" accesskey="s" tabindex="6" value="Send" name="post"></div><div id="postDataFull"></div>');
  $(this).prev().remove();
 
  $(this).prev().load($(this).find('a').attr('href') + ' form[action="/post"]', function() {
  $(this).find('form').children().hide();
  $(this).find('form').append($(this).prev());
  });
  });
  });
});

It was developed on phpbb3, and uses the toolbar to check the user level. (only viewable to admin/mod)

So if You're not using phpbb3, or not using the toolbar you may experience a bug or it wont work.

Hi Very Happy

Can you please make one for punBB as well?

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: Change the topic title without editing with jQuery ?

Post by Shek on April 7th 2014, 3:06 am

MY GOD Ange Tuteur, you're the light at the end of the tunnel! I love You!!! :wouhou::wouhou::wouhou::wouhou::wouhou:For my part, is resolved dear, thank you for everything!

Shek
Active Poster

Male Posts : 1092
Reputation : 31
Language : Portuguese and English
Location : Brazil

http://www.shiftactif.com/

Back to top Go down

Solved Re: Change the topic title without editing with jQuery ?

Post by Ange Tuteur on April 7th 2014, 3:19 am

You're welcome, Shek Very Happy

I will play with the code more when I am free to see if I can improve it further. If I make any updates I'll notify you. :rose:

Topic solved and archived

Pizza boi,

It is working from what I tested on punbb. Wink

Ange Tuteur
Forumaster

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

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