PageSourceSearch

https://www.kanagawa-cci.or.jp/manage/wp-content/plugins/image-upl…/js/bbp-image-upload.js?ver=4.1.1

js kanagawa-cci.or.jp collected 2026-10-08 05:51:52 UTC 4,105 bytes, 111 lines download raw bytes

1/**
2 * Author: Potent Plugins
3 * License: GNU General Public License version 2 or later
4 * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
5 */
6function hm_bbpui_file_upload(field_id) {
7	jQuery('#hm_bbpui_file_form, #hm_bbpui_file_frame').remove();
8	jQuery('#' + field_id).parent().css('overflow', 'hidden')
9		.append('<br /><form id="hm_bbpui_file_form" action="?hm_bbpui_do_upload=1" method="post" target="hm_bbpui_file_frame" enctype="multipart/form-data" onsubmit="hm_bbpui_file_upload_submit();" data-field-id="' + field_id + '">' +
10		'<input type="file" name="hm_bbpui_file" id="hm_bbpui_file" tabindex="-1" onchange="jQuery(this).parent().submit();" />' +
11		'<iframe id="hm_bbpui_file_frame" name="hm_bbpui_file_frame" />');
12	jQuery('#hm_bbpui_file').trigger('click');
13}
14
15function hm_bbpui_file_upload_submit() {
16	jQuery('#hm_bbpui_file_frame').load(function() {
17		var response = jQuery('#hm_bbpui_file_frame').contents().find('body').text();
18		if (response == '' || response == 'Error') {
19			alert('The image could not be uploaded. Please check that it is a valid JPEG, PNG, or GIF file and that the file size is not too large.');
20			response = '';
21		}
22		jQuery('#' + jQuery('#hm_bbpui_file_form').data('field-id')).val(response).prop('disabled', false);
23		jQuery('#hm_bbpui_file_frame').off('load');
24	});
25	jQuery('#' + jQuery('#hm_bbpui_file_form').data('field-id')).prop('disabled', true).val('Please wait...');
26	
27	return true;
28}
29
30// Override addReply.moveForm function to re-initialize TinyMCE
31var moveFormDefault, cancelReplyDefault;
32jQuery(document).ready(function() {
33	if (typeof addReply != 'undefined' && typeof addReply.moveForm != 'undefined') {
34		//moveFormDefault = addReply.moveForm;
35		
36		
37		
38		/* This code copied from bbPress - https://bbpress.org/ - GNU GPL v2 */
39		/* Copied to fix bug in moveForm function */
40		moveFormDefault = function(replyId, parentId, respondId, postId) {
41			var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
42
43			if ( ! reply || ! respond || ! cancel || ! parent )
44				return;
45
46			t.respondId = respondId;
47			postId = postId || false;
48
49			if ( ! t.I('bbp-temp-form-div') ) {
50				div = document.createElement('div');
51				div.id = 'bbp-temp-form-div';
52				div.style.display = 'none';
53				respond.parentNode.insertBefore(div, respond);
54			}
55
56			reply.parentNode.insertBefore(respond, null); // Bugfix - provide second argument
57			if ( post && postId )
58				post.value = postId;
59			parent.value = parentId;
60			cancel.style.display = '';
61
62			cancel.onclick = function() {
63				var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
64
65				if ( ! temp || ! respond )
66					return;
67
68				t.I('bbp_reply_to').value = '0';
69				temp.parentNode.insertBefore(respond, temp);
70				temp.parentNode.removeChild(temp);
71				this.style.display = 'none';
72				this.onclick = null;
73				return false;
74			}
75
76			try { t.I('bbp_reply_content').focus(); }
77			catch(e) {}
78
79			return false;
80		}
81		/* End code copied from bbPress */
82		
83		
84		
85		addReply.moveForm = function(replyId, parentId, respondId, postId) {
86			var tA = jQuery('#' + respondId).find('textarea.wp-editor-area');
87			if (tA.length && typeof tinymce != 'undefined' && typeof tinyMCEPreInit != 'undefined'
88					&& typeof tinyMCEPreInit.mceInit[tA.attr('id')] != undefined) {
89				tinymce.get(tA.attr('id')).destroy();
90				var result = moveFormDefault.apply(this, arguments);
91				tinymce.init(tinyMCEPreInit.mceInit[tA.attr('id')]);
92				
93				
94				jQuery('#bbp-cancel-reply-to-link').click(function() {
95					var tA = jQuery(this).closest('form').find('textarea.wp-editor-area');
96					if (tA.length && typeof tinymce != 'undefined' && typeof tinyMCEPreInit != 'undefined'
97							&& typeof tinyMCEPreInit.mceInit[tA.attr('id')] != undefined) {
98						tinymce.get(tA.attr('id')).destroy();
99						tinymce.init(tinyMCEPreInit.mceInit[tA.attr('id')]);
100					}
101				});
102				
103				return result;
104			} else {
105				return moveFormDefault.apply(this, arguments);
106			}
107		}
108		
109		
110	}
111});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.