by Ange Tuteur April 7th 2014, 4: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.