mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +09:00
- wp-admin assets refactoring (in process);
- partially frontend scripts review related to the form builder preview;
This commit is contained in:
@@ -1,314 +0,0 @@
|
||||
/*
|
||||
- Overlay
|
||||
*/
|
||||
|
||||
.um-admin-overlay {
|
||||
background: rgba(0,0,0, .7);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
/*
|
||||
- modal
|
||||
*/
|
||||
|
||||
.um-admin-modal input[type=submit].button-primary,
|
||||
.um-admin-modal a.button-primary,
|
||||
.um-admin-modal a.button {
|
||||
padding: 0 12px !important;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
.um-admin .um-admin-modal a.button i:before {
|
||||
display: block;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.um-admin-modal input[type=submit].button-primary {
|
||||
line-height: 24px !important;
|
||||
}
|
||||
|
||||
.um-admin-modal {
|
||||
border-radius: 3px;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
top: 50% !important;
|
||||
left: 50% !important;
|
||||
display: none;
|
||||
z-index: 10001;
|
||||
box-sizing: border-box;
|
||||
|
||||
width: 730px;
|
||||
margin-left: -365px;
|
||||
}
|
||||
|
||||
.um-admin-modal.normal {width: 730px;margin-left: -365px;}
|
||||
.um-admin-modal.smaller {width: 500px;margin-left: -250px;}
|
||||
.um-admin-modal.small {width: 400px;margin-left: -200px;}
|
||||
|
||||
.um-admin-modal-close {
|
||||
position: absolute;
|
||||
color: #fff !important;
|
||||
right: 16px;
|
||||
top: 14px;
|
||||
font-size: 22px;
|
||||
text-decoration: none;
|
||||
opacity: 0.4;
|
||||
}
|
||||
.um-admin-modal-close:hover{opacity:1}
|
||||
|
||||
.um-admin-modal-head {
|
||||
padding: 4px 20px;
|
||||
background: #0085ba;
|
||||
position: relative;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.um-admin-modal-body {
|
||||
padding: 10px 20px 10px 20px;
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.um-admin-modal-body.um-admin-metabox label {margin: 0!important}
|
||||
|
||||
.um-admin-modal.loading .um-admin-modal-body {
|
||||
height: 200px;
|
||||
background: url(../img/ajax-loader.gif) no-repeat center;
|
||||
}
|
||||
|
||||
.um-admin-modal-foot {
|
||||
padding: 20px 0 !important;
|
||||
border-top: 1px solid #ddd;
|
||||
text-align: center;
|
||||
background: #eee;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
|
||||
.um-admin-modal-foot a,
|
||||
.um-admin-modal-foot input{
|
||||
margin: 0 10px !important;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.um-admin-modal h3 {
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
font-weight: normal;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.um-admin-modal h4 {
|
||||
margin: 0 0 10px 0 !important;
|
||||
}
|
||||
|
||||
.um-admin-modal label,
|
||||
.um-admin-modal p {
|
||||
font-size: 13px;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.um-admin-infobox p,
|
||||
.um-admin-infobox label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.um-admin-infobox p {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.um-admin-infobox > p:not(:first-child) {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.um-admin-infobox > .um-row > p {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.um-admin-infobox > p:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.um-admin-infobox label {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
color: #333;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
- Conditional fields
|
||||
*/
|
||||
|
||||
.um-admin-btn-toggle {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.um-admin-btn-toggle p {
|
||||
margin: 0 5px 0 0 !important;
|
||||
}
|
||||
|
||||
.um-admin-btn-toggle p.um-admin-reset-conditions {
|
||||
margin: 0 0 5px 0 !important;
|
||||
}
|
||||
|
||||
.um-admin-btn-toggle a {
|
||||
text-decoration: none;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.um-admin-btn-toggle a.active, .um-admin-btn-toggle a.active:hover {
|
||||
color: #0085ba;
|
||||
}
|
||||
|
||||
.um-admin-btn-toggle i {
|
||||
margin: 0 5px 0 0 !important;
|
||||
height: 100%;
|
||||
color: #666;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.um-admin-btn-content {
|
||||
display: none;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
|
||||
.um-admin-btn-content p {
|
||||
float: left;
|
||||
margin-right: 10px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.um-admin-btn-content p.um-admin-conditions-notice {
|
||||
width: 100%;
|
||||
margin: 0 0 9px 0 !important;
|
||||
}
|
||||
|
||||
.um-admin-btn-content .um-admin-cur-condition:not(:last-child) {
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
.dynamic-mce-content {display: none}
|
||||
|
||||
/*
|
||||
- Buttons and Links
|
||||
*/
|
||||
|
||||
.um-admin-btns {
|
||||
line-height: 1.5em;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
.um-admin-btns a {
|
||||
margin: 0 3px 8px 0!important;
|
||||
font-size: 12px !important;
|
||||
display: inline-block !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.um-admin-btns a.button.with-icon {
|
||||
padding-right: 25px !important;
|
||||
}
|
||||
.um-admin-btns a span {
|
||||
color: #aaa;
|
||||
position: absolute !important;
|
||||
width: 25px;
|
||||
text-align: center;
|
||||
right: 0;
|
||||
top: 0;
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
||||
.um-admin-btns a span.remove:before{
|
||||
font-family: "Ionicons" !important;
|
||||
content: "\f128";
|
||||
}
|
||||
.um-admin-btns a span:hover{color: #cb3838}
|
||||
|
||||
/*
|
||||
- WP Editor
|
||||
*/
|
||||
|
||||
.um-admin-modal-body.um-admin-metabox .um-admin-editor-h {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.um-admin-modal-body.um-admin-metabox .um-admin-editor-h label,
|
||||
.um-admin-modal-body.um-admin-metabox .wp-editor-wrap
|
||||
{margin: 0 0 4px 0 !important}
|
||||
|
||||
.um-admin-modal-body.um-admin-metabox .wp-editor-wrap textarea {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
/*
|
||||
- Boxes / Icons
|
||||
*/
|
||||
|
||||
#UM_fonticons div.um-admin-metabox {
|
||||
padding-bottom: 22px !important;
|
||||
}
|
||||
|
||||
p._icon_search{
|
||||
position: relative;
|
||||
width: 85% !important;
|
||||
margin: 0 auto !important;
|
||||
padding: 12px 0 0 0 !important;
|
||||
}
|
||||
|
||||
p._icon_search:before {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 12px;
|
||||
font-size: 20px;
|
||||
content: "\f4a4";
|
||||
font-family: "Ionicons";
|
||||
color: #999;
|
||||
}
|
||||
p._icon_search input[type=text]{padding-right: 40px!important}
|
||||
|
||||
.um-admin-icons {
|
||||
padding: 0 0 15px 12px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.um-admin-icons span {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin: 5px;
|
||||
color: #777;
|
||||
border: 4px solid #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.um-admin-icons span:hover,
|
||||
.um-admin-icons span.highlighted
|
||||
{color: #0085ba;border-color: #0085ba}
|
||||
|
||||
.um-admin-icons i{vertical-align: middle !important;font-size: 24px;width: 24px;text-align: center;padding: 15px 20px;display: inline-block;}
|
||||
|
||||
span.um-admin-icon-value {
|
||||
margin: 0 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
span.um-admin-icon-value i {
|
||||
font-size: 28px;
|
||||
color: #0085ba;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
span.um-admin-icon-clear{
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
color: #ccc;
|
||||
}
|
||||
span.um-admin-icon-clear.show {display: inline-block}
|
||||
span.um-admin-icon-clear:hover {color: #777}
|
||||
span.um-admin-icon-clear i {font-size: 20px;vertical-align: middle;}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
File diff suppressed because it is too large
Load Diff
@@ -1,324 +0,0 @@
|
||||
var $um_tiny_editor = {};
|
||||
|
||||
|
||||
function um_admin_live_update_scripts() {
|
||||
jQuery('.um-adm-conditional').each( function() {
|
||||
jQuery(this).trigger('change');
|
||||
});
|
||||
|
||||
if ( jQuery('.um-admin-colorpicker').length ) {
|
||||
jQuery('.um-admin-colorpicker').wpColorPicker();
|
||||
}
|
||||
}
|
||||
|
||||
function um_admin_new_modal( id, ajax, size ) {
|
||||
var modal = jQuery('body').find('.um-admin-overlay');
|
||||
|
||||
UM.common.tipsy.hide();
|
||||
|
||||
um_admin_remove_modal();
|
||||
|
||||
jQuery('body').addClass('um-admin-modal-open').append('<div class="um-admin-overlay"></div><div class="um-admin-modal"></div>');
|
||||
jQuery('#' + id).prependTo('.um-admin-modal');
|
||||
jQuery('#' + id).show();
|
||||
jQuery('.um-admin-modal').show();
|
||||
|
||||
jQuery('.um-admin-modal-head').append('<a href="javascript:void(0);" data-action="UM_remove_modal" class="um-admin-modal-close"><i class="um-faicon-times"></i></a>');
|
||||
|
||||
if ( ajax == true ) {
|
||||
um_admin_modal_size( size );
|
||||
um_admin_modal_preload();
|
||||
um_admin_modal_responsive();
|
||||
} else {
|
||||
um_admin_modal_responsive();
|
||||
}
|
||||
}
|
||||
|
||||
function um_tinymce_init( id, content ) {
|
||||
var object = jQuery('#' + id);
|
||||
|
||||
if ( typeof( tinyMCE ) === 'object' && tinyMCE.get( id ) !== null ) {
|
||||
tinyMCE.triggerSave();
|
||||
tinyMCE.EditorManager.execCommand( 'mceRemoveEditor', true, id );
|
||||
"4" === tinyMCE.majorVersion ? window.tinyMCE.execCommand( "mceRemoveEditor", !0, id ) : window.tinyMCE.execCommand( "mceRemoveControl", !0, id );
|
||||
$um_tiny_editor = jQuery('<div>').append( object.parents( '#wp-' + id + '-wrap' ).clone() );
|
||||
object.parents('#wp-' + id + '-wrap').replaceWith('<div class="um_tiny_placeholder"></div>');
|
||||
jQuery('.um-admin-editor:visible').html( jQuery( $um_tiny_editor ).html() );
|
||||
|
||||
var init;
|
||||
if( typeof tinyMCEPreInit.mceInit[ id ] == 'undefined' ){
|
||||
init = tinyMCEPreInit.mceInit[ id ] = tinyMCE.extend( {}, tinyMCEPreInit.mceInit[ id ] );
|
||||
} else {
|
||||
init = tinyMCEPreInit.mceInit[ id ];
|
||||
}
|
||||
if ( typeof(QTags) == 'function' ) {
|
||||
QTags( tinyMCEPreInit.qtInit[ id ] );
|
||||
QTags._buttonsInit();
|
||||
}
|
||||
if ( typeof( window.switchEditors ) === 'object' ) {
|
||||
window.switchEditors.go( id );
|
||||
}
|
||||
tinyMCE.init( init );
|
||||
tinyMCE.get( id ).setContent( content );
|
||||
object.html( content );
|
||||
} else {
|
||||
$um_tiny_editor = jQuery('<div>').append( object.parents('#wp-' + id + '-wrap').clone() );
|
||||
object.parents('#wp-' + id + '-wrap').replaceWith('<div class="um_tiny_placeholder"></div>');
|
||||
|
||||
jQuery('.um-admin-editor:visible').html( jQuery( $um_tiny_editor ).html() );
|
||||
|
||||
if ( typeof(QTags) == 'function' ) {
|
||||
QTags( tinyMCEPreInit.qtInit[ id ] );
|
||||
QTags._buttonsInit();
|
||||
}
|
||||
|
||||
//use duplicate because it's new element
|
||||
jQuery('#' + id).html( content );
|
||||
}
|
||||
|
||||
jQuery( 'body' ).on( 'click', '.wp-switch-editor', function() {
|
||||
var target = jQuery(this);
|
||||
|
||||
if ( target.hasClass( 'wp-switch-editor' ) && typeof( window.switchEditors ) === 'object' ) {
|
||||
var mode = target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
|
||||
window.switchEditors.go( id, mode );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
|
||||
in_row = '';
|
||||
in_sub_row = '';
|
||||
in_column = '';
|
||||
in_group = '';
|
||||
|
||||
if ( jQuery('.um-col-demon-settings').data('in_column') ) {
|
||||
in_row = jQuery('.um-col-demon-settings').data('in_row');
|
||||
in_sub_row = jQuery('.um-col-demon-settings').data('in_sub_row');
|
||||
in_column = jQuery('.um-col-demon-settings').data('in_column');
|
||||
in_group = jQuery('.um-col-demon-settings').data('in_group');
|
||||
}
|
||||
|
||||
var form_mode = jQuery('input[type=hidden][id=form__um_mode]').val();
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_dynamic_modal_content',
|
||||
act_id: act_id,
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
arg3: arg3,
|
||||
in_row: in_row,
|
||||
in_sub_row: in_sub_row,
|
||||
in_column: in_column,
|
||||
in_group: in_group,
|
||||
nonce: um_admin_scripts.nonce,
|
||||
form_mode: form_mode
|
||||
},
|
||||
complete: function(){
|
||||
um_admin_modal_loaded();
|
||||
um_admin_modal_responsive();
|
||||
},
|
||||
success: function(data) {
|
||||
|
||||
jQuery('.um-admin-modal').find('.um-admin-modal-body').html( data );
|
||||
|
||||
um_responsive();
|
||||
um_admin_live_update_scripts();
|
||||
|
||||
jQuery( "#_custom_dropdown_options_source" ).trigger('blur');
|
||||
|
||||
if ( jQuery('.um-admin-editor:visible').length > 0 ) {
|
||||
|
||||
if ( act_id == 'um_admin_edit_field_popup' ) {
|
||||
um_tinymce_init( 'um_editor_edit', jQuery('.um-admin-modal:visible .dynamic-mce-content').html() );
|
||||
} else {
|
||||
um_tinymce_init( 'um_editor_new', '' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( act_id === 'um_admin_preview_form' ) {
|
||||
//fix for overlay in scrollable preview modal
|
||||
jQuery('.um-admin-preview-overlay').css('height', jQuery('.um-admin-preview-overlay').siblings('.um').outerHeight(true)*1 + 20 + 'px' );
|
||||
}
|
||||
|
||||
UM.admin.tooltip.init();
|
||||
UM.admin.datetimePicker.init();
|
||||
},
|
||||
error: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function um_admin_modal_responsive() {
|
||||
var required_margin = jQuery('.um-admin-modal:visible').innerHeight() / 2 + 'px';
|
||||
jQuery('.um-admin-modal:visible').css({'margin-top': '-' + required_margin });
|
||||
|
||||
if ( jQuery('#UM_preview_form .um-s1').length ) {
|
||||
jQuery("#UM_preview_form .um-s1").select2({
|
||||
allowClear: true
|
||||
});
|
||||
}
|
||||
|
||||
if ( jQuery('#UM_preview_form .um-s2').length ) {
|
||||
jQuery("#UM_preview_form .um-s2").select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function um_admin_remove_modal() {
|
||||
|
||||
if ( jQuery('.um-admin-editor:visible').length > 0 ) {
|
||||
tinyMCE.triggerSave();
|
||||
|
||||
if ( jQuery('.um-admin-modal:visible').find('form').parent().attr('id') == 'UM_edit_field' ) {
|
||||
jQuery('#wp-um_editor_edit-wrap').remove();
|
||||
|
||||
/*tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_edit');
|
||||
jQuery('.um-hidden-editor-edit').html( jQuery('.um-admin-editor:visible').contents() );
|
||||
tinyMCE.execCommand('mceAddEditor', true, 'um_editor_edit');*/
|
||||
|
||||
} else {
|
||||
jQuery('#wp-um_editor_new-wrap').remove();
|
||||
|
||||
/*tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_new');
|
||||
jQuery('.um-hidden-editor-new').html( jQuery('.um-admin-editor:visible').contents() );
|
||||
tinyMCE.execCommand('mceAddEditor', true, 'um_editor_new');*/
|
||||
|
||||
}
|
||||
|
||||
jQuery('.um_tiny_placeholder').replaceWith( jQuery( $um_tiny_editor ).html() );
|
||||
}
|
||||
|
||||
UM.admin.tooltip.close();
|
||||
UM.common.tipsy.hide();
|
||||
jQuery('body').removeClass('um-admin-modal-open');
|
||||
jQuery('.um-admin-modal div[id^="UM_"]').hide().appendTo('body');
|
||||
jQuery('.um-admin-modal,.um-admin-overlay').remove();
|
||||
}
|
||||
|
||||
function um_admin_modal_preload() {
|
||||
jQuery('.um-admin-modal:visible').addClass('loading');
|
||||
jQuery('.um-admin-modal-body:visible').empty();
|
||||
}
|
||||
|
||||
function um_admin_modal_loaded() {
|
||||
jQuery('.um-admin-modal:visible').removeClass('loading');
|
||||
}
|
||||
|
||||
function um_admin_modal_size( aclass ) {
|
||||
jQuery('.um-admin-modal:visible').addClass(aclass);
|
||||
}
|
||||
|
||||
function um_admin_modal_add_attr( id, value ) {
|
||||
jQuery('.um-admin-modal:visible').data( id, value );
|
||||
}
|
||||
|
||||
/**
|
||||
Custom modal scripting starts
|
||||
**/
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
remove modal via action
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-overlay, a[data-action="UM_remove_modal"]', function(){
|
||||
UM.common.tipsy.hide();
|
||||
um_admin_remove_modal();
|
||||
});
|
||||
|
||||
/**
|
||||
fire new modal
|
||||
**/
|
||||
jQuery(document.body).on('click', 'a[data-modal^="UM_"], span[data-modal^="UM_"]', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var modal_id = jQuery(this).attr('data-modal');
|
||||
|
||||
if ( jQuery(this).attr('data-back') ) {
|
||||
|
||||
jQuery('#UM_fonticons').find('a.um-admin-modal-back').attr("data-modal", jQuery(this).attr('data-back') );
|
||||
var current_icon = jQuery( '#' + jQuery(this).attr('data-back') ).find('input#_icon').val();
|
||||
if ( current_icon == '' ) {
|
||||
jQuery('#UM_fonticons').find('.um-admin-icons span').removeClass('highlighted');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( jQuery(this).data('dynamic-content') ) {
|
||||
um_admin_new_modal( modal_id, true, jQuery(this).data('modal-size') );
|
||||
um_admin_modal_ajaxcall( jQuery(this).data('dynamic-content'), jQuery(this).data('arg1'), jQuery(this).data('arg2'), jQuery(this).data('arg3') );
|
||||
} else {
|
||||
um_admin_new_modal( modal_id );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
submit font icon
|
||||
**/
|
||||
jQuery(document.body).on('click', '#UM_fonticons a.um-admin-modal-back:not(.um-admin-modal-cancel)', function(){
|
||||
var v_id = '';
|
||||
var icon_selected = jQuery(this).attr('data-code');
|
||||
if ( icon_selected != '' ) {
|
||||
if ( jQuery(this).attr('data-modal') ) {
|
||||
v_id = '#' + jQuery(this).attr('data-modal');
|
||||
} else {
|
||||
v_id = '.postbox';
|
||||
}
|
||||
jQuery( v_id ).find('input#_icon,input#_um_icon,input#notice__um_icon,input#um_profile_tab__icon').val( icon_selected );
|
||||
jQuery( v_id ).find('span.um-admin-icon-value').html('<i class="'+icon_selected+'"></i>');
|
||||
jQuery( v_id ).find('.um-admin-icon-clear').show();
|
||||
}
|
||||
jQuery(this).attr('data-code', '');
|
||||
if ( v_id == '.postbox' ) {
|
||||
UM.common.tipsy.hide();
|
||||
um_admin_remove_modal();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
restore font icon
|
||||
**/
|
||||
jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
||||
var element = jQuery(this).parents('p');
|
||||
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
|
||||
element = jQuery(this).parents('td');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
jQuery(this).hide();
|
||||
});
|
||||
|
||||
/**
|
||||
search font icons
|
||||
**/
|
||||
jQuery(document.body).on('keyup blur', '#_icon_search', function(){
|
||||
if ( jQuery(this).val().toLowerCase() !== '' ) {
|
||||
jQuery('.um-admin-icons span').hide();
|
||||
jQuery('.um-admin-icons span[data-code*="'+jQuery(this).val().toLowerCase()+'"]').show();
|
||||
} else {
|
||||
jQuery('.um-admin-icons span:hidden').show();
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
}); // end jQuery(document).ready
|
||||
|
||||
@@ -15,6 +15,7 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated 2.7.1
|
||||
*/
|
||||
public $js_url;
|
||||
|
||||
@@ -40,11 +41,12 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $um_cpt_form_screen;
|
||||
private static $um_cpt_form_screen = false;
|
||||
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
* @deprecated 2.7.1
|
||||
*/
|
||||
public $post_page;
|
||||
|
||||
@@ -55,14 +57,11 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->js_url = UM_URL . 'includes/admin/assets/js/';
|
||||
$this->css_url = UM_URL . 'includes/admin/assets/css/';
|
||||
|
||||
$this->front_js_baseurl = UM_URL . 'assets/js/';
|
||||
$this->front_css_baseurl = UM_URL . 'assets/css/';
|
||||
|
||||
$this->um_cpt_form_screen = false;
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
||||
@@ -210,37 +209,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_navmenu_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function posts_page() {
|
||||
if ( isset( $_GET['post_type'] ) && 'um_form' === sanitize_key( $_GET['post_type'] ) ) {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'forms_page_scripts' ) );
|
||||
} elseif ( isset( $_GET['post_type'] ) && 'um_directory' === sanitize_key( $_GET['post_type'] ) ) {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'directories_page_scripts' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function forms_page_scripts() {
|
||||
$suffix = self::get_suffix();
|
||||
$css_url = self::get_url( 'css' );
|
||||
wp_register_style( 'um_admin_forms-screen', $css_url . 'admin/forms-screen' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms-screen' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function directories_page_scripts() {
|
||||
$suffix = self::get_suffix();
|
||||
$css_url = self::get_url( 'css' );
|
||||
wp_register_style( 'um_admin_directories-screen', $css_url . 'admin/directories-screen' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_directories-screen' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
@@ -277,16 +245,36 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function enqueue_cpt_scripts() {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification
|
||||
if ( ( isset( $_GET['post_type'] ) && 'um_form' === sanitize_key( $_GET['post_type'] ) ) || ( isset( $_GET['post'] ) && 'um_form' === get_post_type( absint( $_GET['post'] ) ) ) ) {
|
||||
$this->um_cpt_form_screen = true;
|
||||
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ), 20 );
|
||||
public function posts_page() {
|
||||
if ( isset( $_GET['post_type'] ) && 'um_form' === sanitize_key( $_GET['post_type'] ) ) {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'forms_page_scripts' ) );
|
||||
} elseif ( isset( $_GET['post_type'] ) && 'um_directory' === sanitize_key( $_GET['post_type'] ) ) {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'directories_page_scripts' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function forms_page_scripts() {
|
||||
$suffix = self::get_suffix();
|
||||
$css_url = self::get_url( 'css' );
|
||||
wp_register_style( 'um_admin_forms-screen', $css_url . 'admin/forms-screen' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms-screen' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
*/
|
||||
public function directories_page_scripts() {
|
||||
$suffix = self::get_suffix();
|
||||
$css_url = self::get_url( 'css' );
|
||||
wp_register_style( 'um_admin_directories-screen', $css_url . 'admin/directories-screen' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_directories-screen' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets for FRONTEND PREVIEW.
|
||||
*/
|
||||
@@ -328,6 +316,7 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_register_script( 'um_functions', $js_url . 'um-functions' . $suffix . '.js', array( 'um_frontend_common', 'um_fileupload' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_functions' );
|
||||
|
||||
|
||||
wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', self::$select2_handle, 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), UM_VERSION, true );
|
||||
wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $suffix . '.js', array( 'um_scripts', 'um_crop' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $suffix . '.js', array( 'um_responsive' ), UM_VERSION, true );
|
||||
@@ -354,29 +343,28 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
* Load Forms
|
||||
*/
|
||||
public function load_forms() {
|
||||
$suffix = self::get_suffix();
|
||||
$suffix = self::get_suffix();
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery', 'wp-i18n', self::$select2_handle, 'jquery-ui-draggable', 'jquery-ui-sortable' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_admin_forms', $js_url . 'admin/forms' . $suffix . '.js', array( 'um_admin_common', self::$select2_handle, 'jquery-ui-draggable', 'jquery-ui-sortable', 'jquery-ui-slider' ), UM_VERSION, true );
|
||||
|
||||
wp_localize_script(
|
||||
'um_admin_forms',
|
||||
'um_forms_data',
|
||||
array(
|
||||
'successfully_redirect' => add_query_arg(
|
||||
array(
|
||||
'page' => 'um_options',
|
||||
'tab' => 'misc',
|
||||
'msg' => 'updated',
|
||||
),
|
||||
admin_url( 'admin.php' )
|
||||
$forms_data = array(
|
||||
'successfully_redirect' => add_query_arg(
|
||||
array(
|
||||
'page' => 'um_options',
|
||||
'tab' => 'misc',
|
||||
'msg' => 'updated',
|
||||
),
|
||||
'md_sorting_data_types' => UM()->member_directory()->sort_data_types,
|
||||
)
|
||||
admin_url( 'admin.php' )
|
||||
),
|
||||
);
|
||||
$forms_data = apply_filters( 'um_admin_forms_data_localize', $forms_data );
|
||||
|
||||
wp_localize_script( 'um_admin_forms', 'um_forms_data', $forms_data );
|
||||
wp_enqueue_script( 'um_admin_forms' );
|
||||
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
wp_register_style( 'um_admin_forms', $css_url . 'admin/forms' . $suffix . '.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
}
|
||||
|
||||
@@ -388,10 +376,10 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
wp_register_script( 'um_admin_modal', $js_url . 'admin/modal' . $suffix . '.js', array( 'jquery', 'editor', 'wp-util', 'wp-color-picker', 'wp-tinymce', 'wp-i18n', 'um_admin_common' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_admin_modal', $js_url . 'admin/modal' . $suffix . '.js', array( 'um_admin_common' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_modal' );
|
||||
|
||||
wp_register_style( 'um_admin_modal', $css_url . 'admin/modal' . $suffix . '.css', array( 'wp-color-picker' ), UM_VERSION );
|
||||
wp_register_style( 'um_admin_modal', $css_url . 'admin/modal' . $suffix . '.css', array( 'um_admin_common' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
}
|
||||
|
||||
@@ -405,10 +393,10 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
wp_register_script( 'um_admin_builder', $js_url . 'admin/builder' . $suffix . '.js', array( 'um_common', 'jquery-ui-draggable', 'jquery-ui-sortable' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_admin_builder', $js_url . 'admin/builder' . $suffix . '.js', array( 'um_admin_modal', 'jquery-ui-draggable', 'jquery-ui-sortable', 'editor', 'wp-tinymce' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_builder' );
|
||||
|
||||
wp_register_style( 'um_admin_builder', $css_url . 'admin/builder' . $suffix . '.css', array( 'um_ui' ), UM_VERSION );
|
||||
wp_register_style( 'um_admin_builder', $css_url . 'admin/builder' . $suffix . '.css', array( 'um_admin_modal' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_builder' );
|
||||
}
|
||||
|
||||
@@ -528,13 +516,13 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$this->load_global_scripts();
|
||||
|
||||
if ( UM()->admin()->screen()->is_own_screen() ) {
|
||||
wp_register_script( 'um_admin_common', $js_url . 'admin/common' . $suffix . '.js', array( 'jquery', 'wp-i18n', 'wp-color-picker', 'jquery-ui-tooltip', 'um_common', 'um_datetime', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_admin_common', $js_url . 'admin/common' . $suffix . '.js', array( 'wp-color-picker', 'jquery-ui-tooltip', 'um_common' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_common' );
|
||||
|
||||
wp_register_style( 'um_admin_common', $css_url . 'admin/common' . $suffix . '.css', array( 'um_common', 'um_ui', 'dashicons', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION );
|
||||
wp_register_style( 'um_admin_common', $css_url . 'admin/common' . $suffix . '.css', array( 'um_common', 'um_ui', 'dashicons' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_common' );
|
||||
|
||||
if ( $this->um_cpt_form_screen ) {
|
||||
if ( self::$um_cpt_form_screen ) {
|
||||
$this->load_builder();
|
||||
$this->load_modal();
|
||||
}
|
||||
@@ -581,6 +569,18 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function enqueue_cpt_scripts() {
|
||||
if ( ( isset( $_GET['post_type'] ) && 'um_form' === sanitize_key( $_GET['post_type'] ) ) || ( isset( $_GET['post'] ) && 'um_form' === get_post_type( absint( $_GET['post'] ) ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
||||
self::$um_cpt_form_screen = true;
|
||||
add_action( 'admin_footer', array( $this, 'admin_footer_scripts' ), 20 );
|
||||
} elseif ( ( isset( $_GET['post_type'] ) && 'um_directory' === sanitize_key( $_GET['post_type'] ) ) || ( isset( $_GET['post'] ) && 'um_directory' === get_post_type( absint( $_GET['post'] ) ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
||||
add_filter( 'um_admin_forms_data_localize', array( &$this, 'directory_forms_data_localize' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print editor scripts if they are not printed by default
|
||||
*/
|
||||
@@ -608,4 +608,15 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$class::enqueue_scripts();
|
||||
$class::editor_js();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.1
|
||||
* @param array $form_data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function directory_forms_data_localize( $form_data ) {
|
||||
$form_data['md_sorting_data_types'] = UM()->member_directory()->sort_data_types;
|
||||
return $form_data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user