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.

Change the topic title without editing with jQuery ?

4 posters

Go down

Solved Change the topic title without editing with jQuery ?

Post by Shek Sun Apr 06, 2014 8:05 am

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

Thanks. Very Happy


Last edited by Shek on Sun Apr 06, 2014 8:07 pm; edited 1 time in total
Shek
Shek
Active Poster

Male Posts : 1697
Reputation : 61
Language :  
Location : Brazil

https://publipos.net

Back to top Go down

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

Post by Michael_vx Sun Apr 06, 2014 8:45 am

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

Male Posts : 659
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 Sun Apr 06, 2014 10:48 am

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: https://help.forumotion.com/f30-suggestions-for-your-forums
avatar
Guest
Guest


Back to top Go down

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

Post by Ange Tuteur Sun Apr 06, 2014 2: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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Shek Sun Apr 06, 2014 5:26 pm

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

Male Posts : 1697
Reputation : 61
Language :  
Location : Brazil

https://publipos.net

Back to top Go down

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

Post by Ange Tuteur Sun Apr 06, 2014 7:21 pm

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://2img.net/i/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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Pizza Boi Sun Apr 06, 2014 7:52 pm

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://2img.net/i/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
Pizza Boi
Hyperactive

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

Back to top Go down

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

Post by Shek Sun Apr 06, 2014 8:06 pm

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
Shek
Active Poster

Male Posts : 1697
Reputation : 61
Language :  
Location : Brazil

https://publipos.net

Back to top Go down

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

Post by Ange Tuteur Sun Apr 06, 2014 8:19 pm

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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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