This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
quick-event-media.js
executable file
·46 lines (46 loc) · 1.98 KB
/
quick-event-media.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
jQuery(document).ready(function ($) {
var custom_uploader;
$('#upload_media_button').click(function (e) {
e.preventDefault();
if (custom_uploader) {custom_uploader.open(); return; }
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Select Background Image', button: {text: 'Insert Image'}, multiple: false});
custom_uploader.on('select', function () {
attachment = custom_uploader.state().get('selection').first().toJSON();
$('#upload_image').val(attachment.url);
});
custom_uploader.open();
});
$('#upload_submit_button').click(function (e) {
e.preventDefault();
if (custom_uploader) {custom_uploader.open(); return; }
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Select Submit Button Image', button: {text: 'Insert Image'}, multiple: false });
custom_uploader.on('select', function () {
attachment = custom_uploader.state().get('selection').first().toJSON();
$('#submit_image').val(attachment.url);
});
custom_uploader.open();
});
$('#upload_event_image').click(function (e) {
e.preventDefault();
if (custom_uploader) {custom_uploader.open(); return; }
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Select Event Image', button: {text: 'Insert Image'}, multiple: false});
custom_uploader.on('select', function () {
attachment = custom_uploader.state().get('selection').first().toJSON();
$('#event_image').val(attachment.url);
});
custom_uploader.open();
});
$('.qem-color').wpColorPicker();
$("#yourplaces").keyup(function () {
var model= document.getElementById('yourplaces');
var number = $('#yourplaces').val()
if (number == 1)
$("#morenames").hide();
else {
$("#morenames").show();
}
});
});