mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- wp-admin assets refactoring (in process);
- partially frontend scripts review related to the form builder preview;
This commit is contained in:
@@ -0,0 +1,548 @@
|
||||
.um-form-table.um-third-column .um-forms-line th {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.um-form-table.um-half-column .um-forms-line th {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.um-form-table.um-two-thirds-column .um-forms-line th {
|
||||
width: 83%;
|
||||
}
|
||||
|
||||
.um-form-table.um-top-label .um-forms-line td {
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.um-form-table.um-top-label .um-forms-line td label {
|
||||
margin: 0 0 5px 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.um-form-table.um-top-label .um-forms-line[data-field_type="icon"] td label {
|
||||
width: 100%;
|
||||
display: block;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
.um_admin_fonticon_wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.um-admin-icon-value {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.um_admin_fonticon_wrapper .um-admin-icon-value i {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
input[type=text].um-forms-field.um-long-field,
|
||||
select.um-forms-field.um-long-field,
|
||||
textarea.um-forms-field.um-long-field {
|
||||
width:100% !important;
|
||||
}
|
||||
|
||||
input[type=text].um-forms-field.um-medium-field,
|
||||
select.um-forms-field.um-medium-field,
|
||||
textarea.um-forms-field.um-medium-field {
|
||||
width:50% !important;
|
||||
}
|
||||
|
||||
input[type=text].um-forms-field.um-small-field,
|
||||
select.um-forms-field.um-small-field,
|
||||
textarea.um-forms-field.um-small-field {
|
||||
width:25% !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.um-multi-text-list,
|
||||
.um-multi-selects-list,
|
||||
.um-md-default-filters-list {
|
||||
float: left;
|
||||
width:100%;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.um-hidden-multi-text,
|
||||
.um-hidden-multi-selects,
|
||||
.um-hidden-md-default-filters {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.um-multi-text-option-line,
|
||||
.um-multi-selects-option-line,
|
||||
.um-md-default-filters-option-line {
|
||||
float:left;
|
||||
width:100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 0 0 5px 0;
|
||||
margin: 5px 0 0 0;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um.um-field-wrapper2 {
|
||||
margin: 5px 0 0 0;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line.um-admin-drag-fld {
|
||||
background: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line.um-admin-drag-fld .um-field-icon {
|
||||
float: left;
|
||||
width: 20px;
|
||||
text-align: left;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line .um-field-wrapper {
|
||||
float:left;
|
||||
width: calc( 100% - 60px );
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line .um-field-wrapper.um-custom-order-fields {
|
||||
margin: 5px 0 0 0;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line .um-field-wrapper.um-custom-order-fields label {
|
||||
float:left;
|
||||
width: 100%;
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line .um-field-wrapper.um-custom-order-fields label input[type="text"] {
|
||||
width: auto;
|
||||
display: inline;
|
||||
font-weight: normal;
|
||||
max-width: 70%;
|
||||
flex: 0.9;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line .um-field-wrapper.um-custom-order-fields label select{
|
||||
width: auto;
|
||||
display: inline;
|
||||
font-weight: normal;
|
||||
max-width: 70%;
|
||||
flex: 0.9;
|
||||
}
|
||||
|
||||
.um-multi-selects-option-line.um-admin-drag-fld .um-field-wrapper {
|
||||
width: calc( 100% - 90px );
|
||||
}
|
||||
|
||||
.um-multi-text-option-line .um-field-wrapper {
|
||||
float:left;
|
||||
width: calc( 100% - 90px );
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper {
|
||||
float:left;
|
||||
width: calc( 100% - 60px );
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 {
|
||||
float:left;
|
||||
width: calc( 100% - 60px );
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 .ui-slider-range.ui-widget-header {
|
||||
background: #44b0ec;
|
||||
border: 1px solid #44b0ec !important;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 select {
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input {
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-timepicker-filter,
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-datepicker-filter {
|
||||
width: calc( 50% - 7px ) !important;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 .um-slider {
|
||||
margin: 5px 9px 0 9px;
|
||||
width: calc( 100% - 18px );
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-timepicker-filter:first-child,
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-datepicker-filter:first-child {
|
||||
margin-right: 11px;
|
||||
}
|
||||
|
||||
.um-multi-text-option-line .um-field-wrapper input,
|
||||
.um-multi-selects-option-line .um-field-wrapper select {
|
||||
float:left;
|
||||
width: 100%;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
|
||||
.um-multi-text-option-line .um-field-control,
|
||||
.um-multi-selects-option-line .um-field-control,
|
||||
.um-md-default-filters-option-line .um-field-control {
|
||||
float:left;
|
||||
width: 60px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-form-table .description {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.um-form-field .description {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.um-form-fields-section {
|
||||
float:left;
|
||||
clear: none;
|
||||
margin:0;
|
||||
padding: 0 10px 0 0;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-form-fields-section label {
|
||||
float:left;
|
||||
width:100%;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.um-form-fields-section label input {
|
||||
float:left;
|
||||
margin-top:0;
|
||||
}
|
||||
|
||||
.um-form-fields-section label span {
|
||||
float:left;
|
||||
width:calc( 100% - 20px );
|
||||
}
|
||||
|
||||
.um-multi-text-option-line,
|
||||
.um-multi-selects-option-line {
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.um-form-fields-section {
|
||||
width:100% !important;
|
||||
}
|
||||
.um-admin-metabox .um-form-fields-section label {
|
||||
line-height: 22px !important;
|
||||
margin: 0 0 12px 0 !important;
|
||||
}
|
||||
.um-form-fields-section label span {
|
||||
width:calc( 100% - 30px );
|
||||
}
|
||||
|
||||
.um-multi-text-option-line,
|
||||
.um-multi-selects-option-line {
|
||||
margin: 0 0 6px 0;
|
||||
}
|
||||
|
||||
.um-forms-line label {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
.um-form-table.um-third-column .um-forms-line th,
|
||||
.um-form-table.um-half-column .um-forms-line th,
|
||||
.um-form-table.um-two-thirds-column .um-forms-line th {
|
||||
float:left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.um-form-table.um-third-column .um-forms-line td,
|
||||
.um-form-table.um-half-column .um-forms-line td,
|
||||
.um-form-table.um-two-thirds-column .um-forms-line td {
|
||||
float:left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.um-form-table.um-third-column .um-forms-line th label,
|
||||
.um-form-table.um-half-column .um-forms-line th label,
|
||||
.um-form-table.um-two-thirds-column .um-forms-line th label {
|
||||
float:left;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*Multi text filed */
|
||||
.um-forms-line .um-text-delete {
|
||||
color: #a00;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.um-forms-line .um-text-delete:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.um-forms-line .um-multi-text-add-option {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
|
||||
/* Media uploader */
|
||||
.um-forms-line .icon_preview {
|
||||
display: none;
|
||||
max-width: 200px;
|
||||
max-height: 200px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #e3e3e3;
|
||||
background: #f7f7f7;
|
||||
border-radius: 3px;
|
||||
height: auto;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
|
||||
.um-forms-line[data-conditional] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Same page update field */
|
||||
.um-forms-line td .um-same-page-update-wrapper {
|
||||
display: none;
|
||||
margin: 7px 0 0 0;
|
||||
}
|
||||
|
||||
.um-forms-line td .um-same-page-update-wrapper input.um-admin-form-same-page-update {
|
||||
margin: 7px 0 0 0;
|
||||
}
|
||||
|
||||
.um-forms-line td .um-same-page-update-wrapper .upgrade_log {
|
||||
margin: 7px 0 0 0;
|
||||
width:100%;
|
||||
height:150px;
|
||||
overflow: auto;
|
||||
border: 1px solid #a1a1a1;
|
||||
}
|
||||
|
||||
.um-forms-line[data-field_type="same_page_update"] {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.um-forms-line[data-field_type="same_page_update"] th,
|
||||
.um-forms-line[data-field_type="same_page_update"] td {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.um-sortable-items-field .um-sortable-item {
|
||||
cursor: move !important;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
border: 1px solid #7e8993;
|
||||
border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
background: #f1f1f1;
|
||||
height: 42px;
|
||||
line-height: 28px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.um-sortable-items-field .um-sortable-item.um-hidden-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.um-sortable-items-field .um-sortable-item .um-field-icon {
|
||||
font-size: 18px;
|
||||
width: 20px;
|
||||
text-align: left;
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
|
||||
.um-form-table span.um-req {
|
||||
margin: 0 0 0 4px;
|
||||
color: #a00;
|
||||
}
|
||||
|
||||
.wp-picker-container input.wp-color-picker[type="text"] {
|
||||
width: 68px !important;
|
||||
float: left !important;
|
||||
padding: 2px 4px !important;
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
/* Select2 4.0*/
|
||||
body.um-admin .select2.select2-container .select2-selection{
|
||||
display: block !important;
|
||||
height: 28px !important;
|
||||
padding: 0 0 0 12px !important;
|
||||
overflow: hidden !important;
|
||||
position: relative !important;
|
||||
white-space: nowrap !important;
|
||||
line-height: 25px !important;
|
||||
color: #666 !important;
|
||||
font-size: 13px !important;
|
||||
text-align: left !important;
|
||||
text-decoration: none !important;
|
||||
-moz-border-radius: 2px !important;
|
||||
-webkit-border-radius: 2px !important;
|
||||
border-radius: 2px !important;
|
||||
background-clip: padding-box !important;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background: none !important;
|
||||
background-color: #fff !important;
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow b[role=presentation]{
|
||||
display:none;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow:before{
|
||||
content: "\f3d0" !important;
|
||||
font-size: 27px !important;
|
||||
font-family: "Ionicons" !important;
|
||||
width: 100% !important;
|
||||
display: block;
|
||||
height: 100%;
|
||||
line-height: 28px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow {
|
||||
display: inline-block !important;
|
||||
width: 34px !important;
|
||||
height: 100% !important;
|
||||
position: absolute !important;
|
||||
right: 0 !important;
|
||||
top: 0 !important;
|
||||
-moz-border-radius: 0 2px 2px 0 !important;
|
||||
-webkit-border-radius: 0 2px 2px 0 !important;
|
||||
border-radius: 0 2px 2px 0 !important;
|
||||
background-clip: padding-box !important;
|
||||
text-align: center !important;
|
||||
background: transparent !important;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
body.um-admin .select2-container.select2-container--open .select2-dropdown{
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2-results li{
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
font-size: 13px;
|
||||
margin: 5px !important;
|
||||
padding: 3px 0 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-results li {
|
||||
padding: 3px 7px 4px !important;
|
||||
cursor: pointer;
|
||||
min-height: 1em !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 25px;
|
||||
}
|
||||
body.um-admin .select2-results li.select2-results__option.select2-results__option--highlighted{
|
||||
background: none !important;
|
||||
background: #f4f4f4 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background: transparent !important;
|
||||
}
|
||||
body.um-admin .select2-selection__clear {
|
||||
right: 10px;
|
||||
font-size: 25px;
|
||||
color: #aaaaaa !important;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body.um-admin .select2.select2-container .select2-selection.select2-selection--multiple {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
margin-top: 0px;
|
||||
margin-right: 5px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-search--inline {
|
||||
line-height: 37px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop-active {
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
+114
-11
@@ -9,8 +9,111 @@ if ( typeof (window.UM.admin) !== 'object' ) {
|
||||
UM.admin.builder = {
|
||||
deleteProcess: [],
|
||||
fieldsToDelete: [],
|
||||
fieldConditions: {
|
||||
refresh: function() {
|
||||
let $conditionalRows = jQuery('.um-adm-conditional');
|
||||
if ( $conditionalRows.length > 0 ) {
|
||||
$conditionalRows.each( function() {
|
||||
jQuery(this).trigger('change');
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
tinyMCE: {
|
||||
editor: {},
|
||||
init: function ( 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.admin.builder.tinyMCE.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.admin.builder.tinyMCE.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.admin.builder.tinyMCE.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.admin.builder.tinyMCE.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 );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wp.hooks.addAction( 'um_admin_modal_success_result', 'um_admin_builder', function( $adminModal, act_id ) {
|
||||
UM.admin.builder.fieldConditions.refresh();
|
||||
|
||||
jQuery( "#_custom_dropdown_options_source" ).trigger('blur');
|
||||
|
||||
if ( jQuery('.um-admin-editor:visible').length > 0 ) {
|
||||
|
||||
if ( 'um_admin_edit_field_popup' === act_id ) {
|
||||
UM.admin.builder.tinyMCE.init( 'um_editor_edit', jQuery('.um-admin-modal:visible .dynamic-mce-content').html() );
|
||||
} else {
|
||||
UM.admin.builder.tinyMCE.init( 'um_editor_new', '' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( 'um_admin_preview_form' === act_id ) {
|
||||
// Fix for overlay in scrollable preview modal.
|
||||
let $previewOverlay = jQuery('.um-admin-preview-overlay');
|
||||
$previewOverlay.css('height', $previewOverlay.siblings('.um').outerHeight(true)*1 + 20 + 'px' );
|
||||
}
|
||||
|
||||
UM.admin.colorPicker.init();
|
||||
UM.common.datetimePicker.init();
|
||||
});
|
||||
|
||||
wp.hooks.addAction( 'um_admin_modal_remove', 'um_admin_builder', function() {
|
||||
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();
|
||||
} else {
|
||||
jQuery('#wp-um_editor_new-wrap').remove();
|
||||
}
|
||||
|
||||
jQuery('.um_tiny_placeholder').replaceWith( jQuery( UM.admin.builder.tinyMCE.editor ).html() );
|
||||
}
|
||||
});
|
||||
|
||||
function UM_Drag_and_Drop() {
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
||||
items: '.um-admin-drag-fld',
|
||||
@@ -467,7 +570,7 @@ jQuery( document ).ready( function() {
|
||||
in_group = demon_settings.data('in_group');
|
||||
}
|
||||
|
||||
um_admin_remove_modal();
|
||||
UM.admin.modal.remove();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
@@ -484,7 +587,7 @@ jQuery( document ).ready( function() {
|
||||
},
|
||||
success: function( data ) {
|
||||
demon_settings.data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.resize();
|
||||
um_admin_update_builder();
|
||||
},
|
||||
error: function( data ) {
|
||||
@@ -583,11 +686,11 @@ jQuery( document ).ready( function() {
|
||||
}
|
||||
});
|
||||
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.resize();
|
||||
} else {
|
||||
jQuery('.um-col-demon-settings').data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
UM.common.tipsy.hide();
|
||||
um_admin_remove_modal();
|
||||
UM.admin.modal.remove();
|
||||
um_admin_update_builder();
|
||||
}
|
||||
} else {
|
||||
@@ -624,7 +727,7 @@ jQuery( document ).ready( function() {
|
||||
link.find('i').removeClass().addClass('um-icon-plus');
|
||||
link.removeClass('active');
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.resize();
|
||||
});
|
||||
|
||||
|
||||
@@ -651,8 +754,8 @@ jQuery( document ).ready( function() {
|
||||
jQuery(template).removeClass("um-admin-cur-condition-template");
|
||||
jQuery(template).addClass("um-admin-cur-condition");
|
||||
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.builder.fieldConditions.refresh();
|
||||
UM.admin.modal.resize();
|
||||
} else {
|
||||
jQuery(this).addClass('disabled');
|
||||
alert( 'You already have 5 rules' );
|
||||
@@ -682,8 +785,8 @@ jQuery( document ).ready( function() {
|
||||
content.find('input[type=text]').val('');
|
||||
content.find('select').val('');
|
||||
jQuery('.um-admin-new-condition').removeClass('disabled');
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.builder.fieldConditions.refresh();
|
||||
UM.admin.modal.resize();
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -707,8 +810,8 @@ jQuery( document ).ready( function() {
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.builder.fieldConditions.refresh();
|
||||
UM.admin.modal.resize();
|
||||
});
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -33,91 +33,10 @@ UM.admin = {
|
||||
$colorPicker.wpColorPicker();
|
||||
}
|
||||
}
|
||||
},
|
||||
datetimePicker: {
|
||||
init: function () {
|
||||
jQuery('.um-datepicker:not(.picker__input)').each(function(){
|
||||
elem = jQuery(this);
|
||||
|
||||
if ( typeof elem.attr('data-disabled_weekdays') != 'undefined' && elem.attr('data-disabled_weekdays') != '' ) {
|
||||
var disable = JSON.parse( elem.attr('data-disabled_weekdays') );
|
||||
} else {
|
||||
var disable = false;
|
||||
}
|
||||
|
||||
var years_n = null;
|
||||
if ( typeof elem.attr('data-years') != 'undefined' ) {
|
||||
years_n = elem.attr('data-years');
|
||||
}
|
||||
|
||||
var minRange = elem.attr('data-date_min');
|
||||
var maxRange = elem.attr('data-date_max');
|
||||
|
||||
var minSplit = [], maxSplit = [];
|
||||
if ( typeof minRange != 'undefined' ) {
|
||||
minSplit = minRange.split(",");
|
||||
}
|
||||
if ( typeof maxRange != 'undefined' ) {
|
||||
maxSplit = maxRange.split(",");
|
||||
}
|
||||
|
||||
var min = minSplit.length ? new Date(minSplit) : null;
|
||||
var max = minSplit.length ? new Date(maxSplit) : null;
|
||||
|
||||
// fix min date for safari
|
||||
if ( min && min.toString() == 'Invalid Date' && minSplit.length == 3 ) {
|
||||
var minDateString = minSplit[1] + '/' + minSplit[2] + '/' + minSplit[0];
|
||||
min = new Date(Date.parse(minDateString));
|
||||
}
|
||||
|
||||
// fix max date for safari
|
||||
if ( max && max.toString() == 'Invalid Date' && maxSplit.length == 3 ) {
|
||||
var maxDateString = maxSplit[1] + '/' + maxSplit[2] + '/' + maxSplit[0];
|
||||
max = new Date(Date.parse(maxDateString));
|
||||
}
|
||||
|
||||
var data = {
|
||||
disable: disable,
|
||||
format: elem.attr( 'data-format' ),
|
||||
formatSubmit: 'yyyy/mm/dd',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
};
|
||||
|
||||
if ( years_n !== null ) {
|
||||
data.selectYears = years_n;
|
||||
}
|
||||
|
||||
if ( min !== null ) {
|
||||
data.min = min;
|
||||
}
|
||||
|
||||
if ( max !== null ) {
|
||||
data.max = max;
|
||||
}
|
||||
|
||||
elem.pickadate( data );
|
||||
});
|
||||
|
||||
jQuery('.um-timepicker:not(.picker__input)').each(function(){
|
||||
elem = jQuery(this);
|
||||
|
||||
elem.pickatime({
|
||||
format: elem.attr('data-format'),
|
||||
interval: parseInt( elem.attr('data-intervals') ),
|
||||
formatSubmit: 'HH:i',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
UM.admin.tooltip.init();
|
||||
UM.admin.colorPicker.init();
|
||||
UM.admin.datetimePicker.init();
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var t=jQuery(".um_tooltip");0<t.length&&(UM.admin.tooltip.all=t.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var t=jQuery(".um-admin-colorpicker");t.length&&t.wpColorPicker()}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){t=void 0!==(elem=jQuery(this)).attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var t,e=null,a=(void 0!==elem.attr("data-years")&&(e=elem.attr("data-years")),elem.attr("data-date_min")),i=elem.attr("data-date_max"),n=[],l=[],a=(void 0!==a&&(n=a.split(",")),void 0!==i&&(l=i.split(",")),n.length?new Date(n):null),i=n.length?new Date(l):null,l=(a&&"Invalid Date"==a.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],a=new Date(Date.parse(n))),i&&"Invalid Date"==i.toString()&&3==l.length&&(n=l[1]+"/"+l[2]+"/"+l[0],i=new Date(Date.parse(n))),{disable:t,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}});null!==e&&(l.selectYears=e),null!==a&&(l.min=a),null!==i&&(l.max=i),elem.pickadate(l)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){(elem=jQuery(this)).pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init(),UM.admin.datetimePicker.init()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var o=jQuery(".um_tooltip");0<o.length&&(UM.admin.tooltip.all=o.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var o=jQuery(".um-admin-colorpicker");o.length&&o.wpColorPicker()}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init()});
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
+71
-177
@@ -1,13 +1,50 @@
|
||||
var $um_tiny_editor = {};
|
||||
if ( typeof (window.UM) !== 'object' ) {
|
||||
window.UM = {};
|
||||
}
|
||||
|
||||
if ( typeof (window.UM.admin) !== 'object' ) {
|
||||
window.UM.admin = {};
|
||||
}
|
||||
|
||||
function um_admin_live_update_scripts() {
|
||||
jQuery('.um-adm-conditional').each( function() {
|
||||
jQuery(this).trigger('change');
|
||||
});
|
||||
UM.admin.modal = {
|
||||
preload: function () {
|
||||
jQuery('.um-admin-modal:visible').addClass('loading');
|
||||
jQuery('.um-admin-modal-body:visible').empty();
|
||||
},
|
||||
loaded: function() {
|
||||
jQuery('.um-admin-modal:visible').removeClass('loading');
|
||||
},
|
||||
setSize: function ( size ) {
|
||||
jQuery('.um-admin-modal:visible').addClass( size );
|
||||
},
|
||||
setAttr: function( id, value ) {
|
||||
jQuery('.um-admin-modal:visible').data( id, value );
|
||||
},
|
||||
remove: function () {
|
||||
wp.hooks.doAction( 'um_admin_modal_remove' );
|
||||
|
||||
if ( jQuery('.um-admin-colorpicker').length ) {
|
||||
jQuery('.um-admin-colorpicker').wpColorPicker();
|
||||
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();
|
||||
},
|
||||
resize: function () {
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +53,7 @@ function um_admin_new_modal( id, ajax, size ) {
|
||||
|
||||
UM.common.tipsy.hide();
|
||||
|
||||
um_admin_remove_modal();
|
||||
UM.admin.modal.remove();
|
||||
|
||||
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');
|
||||
@@ -26,81 +63,30 @@ function um_admin_new_modal( id, ajax, size ) {
|
||||
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();
|
||||
UM.admin.modal.setSize( size );
|
||||
UM.admin.modal.preload();
|
||||
UM.admin.modal.resize();
|
||||
} else {
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.resize();
|
||||
}
|
||||
}
|
||||
|
||||
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 = '';
|
||||
let in_row = '';
|
||||
let in_sub_row = '';
|
||||
let in_column = '';
|
||||
let 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');
|
||||
let $hiddenModalData = jQuery('.um-col-demon-settings');
|
||||
|
||||
if ( $hiddenModalData.data('in_column') ) {
|
||||
in_row = $hiddenModalData.data('in_row');
|
||||
in_sub_row = $hiddenModalData.data('in_sub_row');
|
||||
in_column = $hiddenModalData.data('in_column');
|
||||
in_group = $hiddenModalData.data('in_group');
|
||||
}
|
||||
|
||||
var form_mode = jQuery('input[type=hidden][id=form__um_mode]').val();
|
||||
let form_mode = jQuery('input[type="hidden"][id="form__um_mode"]').val();
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
@@ -119,36 +105,16 @@ function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
|
||||
form_mode: form_mode
|
||||
},
|
||||
complete: function(){
|
||||
um_admin_modal_loaded();
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.loaded();
|
||||
UM.admin.modal.resize();
|
||||
},
|
||||
success: function(data) {
|
||||
let $adminModal = jQuery('.um-admin-modal');
|
||||
$adminModal.find('.um-admin-modal-body').html( data );
|
||||
|
||||
jQuery('.um-admin-modal').find('.um-admin-modal-body').html( data );
|
||||
wp.hooks.doAction( 'um_admin_modal_success_result', $adminModal, act_id );
|
||||
|
||||
wp.hooks.doAction( 'um_admin_modal_success_result', jQuery('.um-admin-modal') );
|
||||
|
||||
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();
|
||||
UM.admin.tooltip.init();
|
||||
},
|
||||
error: function(data) {
|
||||
|
||||
@@ -157,86 +123,18 @@ function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
|
||||
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();
|
||||
UM.admin.modal.remove();
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -268,8 +166,6 @@ jQuery(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
submit font icon
|
||||
**/
|
||||
@@ -289,7 +185,7 @@ jQuery(document).ready(function() {
|
||||
jQuery(this).attr('data-code', '');
|
||||
if ( v_id == '.postbox' ) {
|
||||
UM.common.tipsy.hide();
|
||||
um_admin_remove_modal();
|
||||
UM.admin.modal.remove();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -318,8 +214,6 @@ jQuery(document).ready(function() {
|
||||
} else {
|
||||
jQuery('.um-admin-icons span:hidden').show();
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
UM.admin.modal.resize();
|
||||
});
|
||||
|
||||
}); // end jQuery(document).ready
|
||||
|
||||
});
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -25,6 +25,86 @@ UM.common = {
|
||||
jQuery('.um .tipsy').remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
datetimePicker: {
|
||||
init: function () {
|
||||
jQuery('.um-datepicker:not(.picker__input)').each(function(){
|
||||
elem = jQuery(this);
|
||||
|
||||
if ( typeof elem.attr('data-disabled_weekdays') != 'undefined' && elem.attr('data-disabled_weekdays') != '' ) {
|
||||
var disable = JSON.parse( elem.attr('data-disabled_weekdays') );
|
||||
} else {
|
||||
var disable = false;
|
||||
}
|
||||
|
||||
var years_n = null;
|
||||
if ( typeof elem.attr('data-years') != 'undefined' ) {
|
||||
years_n = elem.attr('data-years');
|
||||
}
|
||||
|
||||
var minRange = elem.attr('data-date_min');
|
||||
var maxRange = elem.attr('data-date_max');
|
||||
|
||||
var minSplit = [], maxSplit = [];
|
||||
if ( typeof minRange != 'undefined' ) {
|
||||
minSplit = minRange.split(",");
|
||||
}
|
||||
if ( typeof maxRange != 'undefined' ) {
|
||||
maxSplit = maxRange.split(",");
|
||||
}
|
||||
|
||||
var min = minSplit.length ? new Date(minSplit) : null;
|
||||
var max = minSplit.length ? new Date(maxSplit) : null;
|
||||
|
||||
// fix min date for safari
|
||||
if ( min && min.toString() == 'Invalid Date' && minSplit.length == 3 ) {
|
||||
var minDateString = minSplit[1] + '/' + minSplit[2] + '/' + minSplit[0];
|
||||
min = new Date(Date.parse(minDateString));
|
||||
}
|
||||
|
||||
// fix max date for safari
|
||||
if ( max && max.toString() == 'Invalid Date' && maxSplit.length == 3 ) {
|
||||
var maxDateString = maxSplit[1] + '/' + maxSplit[2] + '/' + maxSplit[0];
|
||||
max = new Date(Date.parse(maxDateString));
|
||||
}
|
||||
|
||||
var data = {
|
||||
disable: disable,
|
||||
format: elem.attr( 'data-format' ),
|
||||
formatSubmit: 'yyyy/mm/dd',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
};
|
||||
|
||||
if ( years_n !== null ) {
|
||||
data.selectYears = years_n;
|
||||
}
|
||||
|
||||
if ( min !== null ) {
|
||||
data.min = min;
|
||||
}
|
||||
|
||||
if ( max !== null ) {
|
||||
data.max = max;
|
||||
}
|
||||
|
||||
elem.pickadate( data );
|
||||
});
|
||||
|
||||
jQuery('.um-timepicker:not(.picker__input)').each(function(){
|
||||
elem = jQuery(this);
|
||||
|
||||
elem.pickatime({
|
||||
format: elem.attr('data-format'),
|
||||
interval: parseInt( elem.attr('data-intervals') ),
|
||||
formatSubmit: 'HH:i',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +139,5 @@ jQuery(document).on( 'ajaxSuccess', function() {
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
UM.common.tipsy.init();
|
||||
UM.common.datetimePicker.init();
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}}},jQuery.ajaxSetup({beforeSend:function(e,t){return t.processData?""!==t.data?t.data+="&um_current_locale="+um_common_variables.locale:t.data="um_current_locale="+um_common_variables.locale:t.data=jQuery.extend(t.data,{um_current_locale:um_common_variables.locale}),!0}}),jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){e=void 0!==(elem=jQuery(this)).attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var e,t=null,a=(void 0!==elem.attr("data-years")&&(t=elem.attr("data-years")),elem.attr("data-date_min")),i=elem.attr("data-date_max"),n=[],o=[],a=(void 0!==a&&(n=a.split(",")),void 0!==i&&(o=i.split(",")),n.length?new Date(n):null),i=n.length?new Date(o):null,o=(a&&"Invalid Date"==a.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],a=new Date(Date.parse(n))),i&&"Invalid Date"==i.toString()&&3==o.length&&(n=o[1]+"/"+o[2]+"/"+o[0],i=new Date(Date.parse(n))),{disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}});null!==t&&(o.selectYears=t),null!==a&&(o.min=a),null!==i&&(o.max=i),elem.pickadate(o)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){(elem=jQuery(this)).pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}}},jQuery.ajaxSetup({beforeSend:function(e,t){return t.processData?""!==t.data?t.data+="&um_current_locale="+um_common_variables.locale:t.data="um_current_locale="+um_common_variables.locale:t.data=jQuery.extend(t.data,{um_current_locale:um_common_variables.locale}),!0}}),jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init(),UM.common.datetimePicker.init()});
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()}),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){console.log(123131232),o.find(".um-admin-modal-body").find(".um").length&&um_responsive()});
|
||||
jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()}),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){o.find(".um-admin-modal-body").find(".um").length&&um_responsive()});
|
||||
@@ -16,85 +16,6 @@ function um_unsanitize_value( input ) {
|
||||
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
|
||||
}
|
||||
|
||||
|
||||
function um_init_datetimepicker() {
|
||||
jQuery('.um-datepicker:not(.picker__input)').each(function(){
|
||||
var elem = jQuery(this);
|
||||
|
||||
var disable = false;
|
||||
if ( typeof elem.attr('data-disabled_weekdays') != 'undefined' && elem.attr('data-disabled_weekdays') !== '' ) {
|
||||
disable = JSON.parse( elem.attr('data-disabled_weekdays') );
|
||||
}
|
||||
|
||||
var years_n = null;
|
||||
if ( typeof elem.attr('data-years') != 'undefined' ) {
|
||||
years_n = elem.attr('data-years');
|
||||
}
|
||||
|
||||
var minRange = elem.attr('data-date_min');
|
||||
var maxRange = elem.attr('data-date_max');
|
||||
|
||||
var minSplit = [], maxSplit = [];
|
||||
if ( typeof minRange != 'undefined' ) {
|
||||
minSplit = minRange.split(",");
|
||||
}
|
||||
if ( typeof maxRange != 'undefined' ) {
|
||||
maxSplit = maxRange.split(",");
|
||||
}
|
||||
|
||||
var min = minSplit.length ? new Date(minSplit) : null;
|
||||
var max = minSplit.length ? new Date(maxSplit) : null;
|
||||
|
||||
// fix min date for safari
|
||||
if ( min && min.toString() == 'Invalid Date' && minSplit.length == 3 ) {
|
||||
var minDateString = minSplit[1] + '/' + minSplit[2] + '/' + minSplit[0];
|
||||
min = new Date(Date.parse(minDateString));
|
||||
}
|
||||
|
||||
// fix max date for safari
|
||||
if ( max && max.toString() == 'Invalid Date' && maxSplit.length == 3 ) {
|
||||
var maxDateString = maxSplit[1] + '/' + maxSplit[2] + '/' + maxSplit[0];
|
||||
max = new Date(Date.parse(maxDateString));
|
||||
}
|
||||
|
||||
var data = {
|
||||
disable: disable,
|
||||
format: elem.attr( 'data-format' ),
|
||||
formatSubmit: 'yyyy/mm/dd',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
};
|
||||
|
||||
if ( years_n !== null ) {
|
||||
data.selectYears = years_n;
|
||||
}
|
||||
|
||||
if ( min !== null ) {
|
||||
data.min = min;
|
||||
}
|
||||
|
||||
if ( max !== null ) {
|
||||
data.max = max;
|
||||
}
|
||||
|
||||
elem.pickadate( data );
|
||||
});
|
||||
|
||||
jQuery('.um-timepicker:not(.picker__input)').each(function(){
|
||||
var elem = jQuery(this);
|
||||
|
||||
elem.pickatime({
|
||||
format: elem.attr('data-format'),
|
||||
interval: parseInt( elem.attr('data-intervals') ),
|
||||
formatSubmit: 'HH:i',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onClose: function() { elem.blur(); }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery( document.body ).on('click', '.um-dropdown a.real_url', function() {
|
||||
@@ -242,9 +163,6 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
um_init_datetimepicker();
|
||||
|
||||
jQuery(document.body).on('click', '.um-single-image-preview a.cancel', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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 |
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ class Enqueue {
|
||||
wp_register_style( 'um_datetime_date', $libs_url . 'pickadate/default.date' . $suffix . '.css', array( 'um_datetime' ), UM_VERSION );
|
||||
wp_register_style( 'um_datetime_time', $libs_url . 'pickadate/default.time' . $suffix . '.css', array( 'um_datetime' ), UM_VERSION );
|
||||
|
||||
wp_register_script( 'um_common', $js_url . 'common' . $suffix . '.js', array( 'jquery', 'wp-util', 'wp-hooks', 'um_tipsy' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_common', $js_url . 'common' . $suffix . '.js', array( 'jquery', 'wp-util', 'wp-hooks', 'wp-i18n', 'um_tipsy', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION, true );
|
||||
$um_common_variables = array(
|
||||
'locale' => get_locale(),
|
||||
);
|
||||
@@ -168,6 +168,6 @@ class Enqueue {
|
||||
$um_common_variables = apply_filters( 'um_common_js_variables', $um_common_variables );
|
||||
wp_localize_script( 'um_common', 'um_common_variables', $um_common_variables );
|
||||
|
||||
wp_register_style( 'um_common', $css_url . 'common' . $suffix . '.css', array( 'um_tipsy' ), UM_VERSION );
|
||||
wp_register_style( 'um_common', $css_url . 'common' . $suffix . '.css', array( 'um_tipsy', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$suffix = self::get_suffix();
|
||||
$libs_url = self::get_url( 'libs' );
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
// Cropper.js
|
||||
wp_register_script( 'um_crop', $libs_url . 'cropper/cropper' . $suffix . '.js', array( 'jquery' ), '1.6.1', true );
|
||||
@@ -101,8 +102,10 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$um_common_variables = apply_filters( 'um_frontend_common_js_variables', $um_common_variables );
|
||||
wp_localize_script( 'um_frontend_common', 'um_frontend_common_variables', $um_common_variables );
|
||||
|
||||
// uploadFiles scripts + UM custom styles for uploader.
|
||||
wp_register_script( 'um_jquery_form', $libs_url . 'jquery-form/jquery-form' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_fileupload', $libs_url . 'fileupload/fileupload.js', array( 'jquery', 'um_jquery_form' ), UM_VERSION, true );
|
||||
wp_register_style( 'um_fileupload', $css_url . 'um-fileupload' . $suffix . '.css', array(), UM_VERSION );
|
||||
|
||||
wp_register_script( 'um_functions', $js_url . 'um-functions' . $suffix . '.js', array( 'um_frontend_common', 'um_fileupload' ), UM_VERSION, true );
|
||||
|
||||
@@ -153,24 +156,19 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
$account_deps = apply_filters( 'um_account_scripts_dependencies', array( 'jquery', 'wp-hooks' ) );
|
||||
wp_register_script('um_account', $this->js_baseurl . 'um-account' . $suffix . '.js', $account_deps, UM_VERSION, true );
|
||||
|
||||
wp_register_script( 'um_gchart', 'https://www.google.com/jsapi', array(), UM_VERSION, true );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register styles
|
||||
*/
|
||||
public function register_styles() {
|
||||
//FontAwesome and FontIcons styles
|
||||
wp_register_style( 'um_fileupload', $this->css_baseurl . 'um-fileupload.css', array(), UM_VERSION );
|
||||
|
||||
wp_register_style( 'um_rtl', $this->css_baseurl . 'um.rtl.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_default_css', $this->css_baseurl . 'um-old-default.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_modal', $this->css_baseurl . 'um-modal.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_responsive', $this->css_baseurl . 'um-responsive.css', array( 'um_profile' ), UM_VERSION );
|
||||
|
||||
wp_register_style( 'um_styles', $this->css_baseurl . 'um-styles.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2' ), UM_VERSION );
|
||||
wp_register_style( 'um_styles', $this->css_baseurl . 'um-styles.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2', 'um_fileupload' ), UM_VERSION );
|
||||
|
||||
wp_register_style( 'um_members', $this->css_baseurl . 'um-members.css', array( 'um_styles' ), UM_VERSION );
|
||||
if ( is_rtl() ) {
|
||||
@@ -228,9 +226,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
*/
|
||||
function load_original() {
|
||||
|
||||
//maybe deprecated
|
||||
//$this->load_google_charts();
|
||||
|
||||
// $this->load_selectjs();
|
||||
|
||||
$this->load_modal();
|
||||
@@ -239,8 +234,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
$this->load_fileupload();
|
||||
|
||||
$this->load_datetimepicker();
|
||||
|
||||
$this->load_functions();
|
||||
|
||||
$this->load_responsive();
|
||||
@@ -249,15 +242,13 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Include Google charts
|
||||
* @depecated 2.7.1
|
||||
*/
|
||||
function load_google_charts() {
|
||||
wp_enqueue_script( 'um_gchart' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load plugin css
|
||||
*/
|
||||
@@ -284,10 +275,9 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
/**
|
||||
* Load fileupload JS
|
||||
* @depecated 2.7.1
|
||||
*/
|
||||
function load_fileupload() {
|
||||
wp_enqueue_script( 'um_fileupload' );
|
||||
wp_enqueue_style( 'um_fileupload' );
|
||||
}
|
||||
|
||||
|
||||
@@ -314,25 +304,11 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
/**
|
||||
* Load date & time picker
|
||||
* @depecated 2.7.1
|
||||
*/
|
||||
function load_datetimepicker() {
|
||||
wp_enqueue_script( 'um_datetime' );
|
||||
wp_enqueue_script( 'um_datetime_date' );
|
||||
wp_enqueue_script( 'um_datetime_time' );
|
||||
//wp_enqueue_script( 'um_datetime_legacy' );
|
||||
|
||||
// load a localized version for date/time
|
||||
$locale = get_locale();
|
||||
if ( $locale && ( file_exists( WP_LANG_DIR . '/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js' ) || file_exists( UM_PATH . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) ) {
|
||||
wp_enqueue_script('um_datetime_locale' );
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'um_datetime' );
|
||||
wp_enqueue_style( 'um_datetime_date' );
|
||||
wp_enqueue_style( 'um_datetime_time' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load scrollbar
|
||||
* @depecated 2.7.1
|
||||
|
||||
Reference in New Issue
Block a user