var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
  let window = _____WB$wombat$assign$function_____("window");
  let self = _____WB$wombat$assign$function_____("self");
  let document = _____WB$wombat$assign$function_____("document");
  let location = _____WB$wombat$assign$function_____("location");
  let top = _____WB$wombat$assign$function_____("top");
  let parent = _____WB$wombat$assign$function_____("parent");
  let frames = _____WB$wombat$assign$function_____("frames");
  let opener = _____WB$wombat$assign$function_____("opener");

/*
 * quick-posts-controls.js
 * https://github.com/savetheinternet/Tinyboard/blob/master/js/quick-posts-controls.js
 *
 * Released under the MIT license
 * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
 * Copyright (c) 2013 undido <firekid109@hotmail.com>
 * Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
 *
 * Usage:
 *   $config['additional_javascript'][] = 'js/jquery.min.js';
 *   $config['additional_javascript'][] = 'js/quick-post-controls.js';
 *
 */

$(document).ready(function(){
	var open_form = function() {
		var thread = $(this).parent().parent().hasClass('op');
		var id = $(this).attr('name').match(/^delete_(\d+)$/)[1];
		var submitButton;
		
		if(this.checked) {
			var post_form = $('<form class="post-actions" method="post" style="margin:10px 0 0 0">' +
				'<div style="text-align:right">' +
					(!thread ? '<hr>' : '') +
					
					'<input type="hidden" name="delete_' + id + '">' +
					
					'<label for="password_' + id + '">'+_("Password")+'</label>: ' +
					'<input id="password_' + id + '" type="password" name="password" size="11" maxlength="18">' +
					'<input title="'+_('Delete file only')+'" type="checkbox" name="file" id="delete_file_' + id + '">' +
						'<label for="delete_file_' + id + '">'+_('File')+'</label>' +
					' <input type="submit" name="delete" value="'+_('Delete')+'">' +
				
					'<br>' +
				
					'<label for="reason_' + id + '">'+_('Reason')+'</label>: ' +
					'<input id="reason_' + id + '" type="text" name="reason" size="20" maxlength="100">' +
					' <input type="submit" name="report" value="'+_('Report')+'">' +
				'</div>' +
			'</form>');
			if($('form[name="post"]:first').size()){
				var board=$(this).parent().parent().parent().attr("data-board");
				post_form
				.attr('action', $('form[name="post"]:first').attr('action'))
				.append('<input type="hidden" value="'+board+'" name="board" />');
			}else{
				var board=$(this).parent().parent().parent().attr("data-board");
				if(board){
					post_form.attr('action', '/post.php'); //doesn't respect $config["root"] but...
					post_form.append('<input type="hidden" value="'+board+'" name="board" />');
				}else{
					return;//better not to show a form if it isn't going to work
				}
			}
			post_form.find('input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) {
					if(e.which == 13) {
						e.preventDefault();
						if($(this).attr('name') == 'password')  {
							post_form.find('input[name=delete]').click();
						} else if($(this).attr('name') == 'reason')  {
							post_form.find('input[name=report]').click();
						}
						
						return false;
					}
					
					return true;
				});
			
			post_form.find('input[type="password"]').val(localStorage.password);
			
			if(thread) {
				post_form.prependTo($(this).parent().parent().find('div.body'));
			} else {
				post_form.appendTo($(this).parent().parent());
				//post_form.insertBefore($(this));
			}
			
			$(window).trigger('quick-post-controls', post_form);
		} else {
			var elm = $(this).parent().parent().find('form');
			
			if(elm.attr('class') == 'post-actions')
				elm.remove();
		}
	};
	
	var init_qpc = function() {
		$(this).change(open_form);
		if(this.checked)
			$(this).trigger('change');
	};

	$('div.post input[type=checkbox].delete').each(init_qpc);

	$(document).on('new_post', function(e, post) {
		$(post).find('input[type=checkbox].delete').each(init_qpc);
	});
});



}
/*
     FILE ARCHIVED ON 19:08:44 Dec 01, 2020 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 04:07:41 Mar 03, 2024.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
/*
playback timings (ms):
  exclusion.robots: 0.067
  exclusion.robots.policy: 0.056
  cdx.remote: 0.094
  esindex: 0.009
  LoadShardBlock: 284.492 (6)
  PetaboxLoader3.datanode: 286.308 (8)
  load_resource: 207.651 (2)
  PetaboxLoader3.resolve: 116.785 (2)
*/