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.
The forum of the forums
4 posters

    Change the topic title without editing with jQuery ?

    Shek
    Shek
    Active Poster


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

    Solved Change the topic title without editing with jQuery ?

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

    Thanks. Very Happy


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


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

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

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

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


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

    Post by Guest 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: https://help.forumotion.com/f30-suggestions-for-your-forums
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur 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
    Shek
    Shek
    Active Poster


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

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

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

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


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

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

    Post by Ange Tuteur 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://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.
    Pizza Boi
    Pizza Boi
    Hyperactive


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

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

    Post by Pizza Boi 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://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
    Shek
    Shek
    Active Poster


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

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

    Post by Shek 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!
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur 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

      Current date/time is September 22nd 2024, 6:28 pm