mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- wp-admin assets refactoring (in process);
This commit is contained in:
@@ -5,3 +5,10 @@
|
||||
height: auto; }
|
||||
.um_block_settings .components-select-control .components-select-control__input[multiple] + .components-input-control__suffix {
|
||||
display: none; }
|
||||
|
||||
.um-block-notice {
|
||||
background: #fff;
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
|
||||
font-size: 13px;
|
||||
padding: 20px;
|
||||
border: 1px solid #000; }
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um_block_settings .um_block_settings_hide{display:none}.um_block_settings .components-select-control .components-select-control__input[multiple]{height:auto}.um_block_settings .components-select-control .components-select-control__input[multiple]+.components-input-control__suffix{display:none}
|
||||
.um_block_settings .um_block_settings_hide{display:none}.um_block_settings .components-select-control .components-select-control__input[multiple]{height:auto}.um_block_settings .components-select-control .components-select-control__input[multiple]+.components-input-control__suffix{display:none}.um-block-notice{background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;padding:20px;border:1px solid #000}
|
||||
@@ -8,3 +8,10 @@
|
||||
height: auto
|
||||
& + .components-input-control__suffix
|
||||
display: none
|
||||
|
||||
.um-block-notice
|
||||
background: #fff
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif
|
||||
font-size: 13px
|
||||
padding: 20px
|
||||
border: 1px solid #000
|
||||
|
||||
@@ -29,10 +29,6 @@ body.um-admin-modal-open {
|
||||
position: relative;
|
||||
top: 1px; }
|
||||
|
||||
.um-admin-metabox * {
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
-moz-osx-font-smoothing: grayscale !important; }
|
||||
|
||||
.um-admin-metabox h6 {
|
||||
font-size: 14px;
|
||||
margin: 12px 0 0 0; }
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um-adm-ico{font-size:18px;width:18px;text-align:center;display:inline-block;color:#7acf58}.um-adm-ico.inactive{color:#c74a4a}.um-adm-ico.pointer{cursor:pointer}body.um-admin-modal-open{overflow:hidden}.um-admin #major-publishing-actions{background-color:#fff!important;border-top:0}.um-admin a.button i,.um-admin a.button-primary i{font-size:15px!important;height:15px!important;width:15px!important;text-align:center!important;margin:0 5px 0 0!important;display:inline-block}.um-admin a.button i:before,.um-admin a.button-primary i:before{position:relative;top:1px}.um-admin-metabox *{-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale!important}.um-admin-metabox h6{font-size:14px;margin:12px 0 0 0}.um-admin-metabox h3{padding-left:0!important}.um-admin-metabox h4{font-size:14px;background:#f5f5f5;padding:8px 4px;color:#333}.um-admin-metabox p{margin:10px 0 0 0}.um-admin-metabox label{display:block;cursor:default;padding:0!important;font-size:13px;color:#666}.um-admin-metabox input[type=text]{height:auto!important;width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:4px 10px!important}.um-admin-metabox input[type=text]:disabled{opacity:.7!important;color:#aaa!important}.um-admin-metabox input[type=text].small{width:54px}.um-admin-metabox input[type=text].um-admin-error{border-color:#c74a4a!important}.um-admin-metabox textarea{width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:8px!important;color:#888!important;min-height:100px;height:100px}.um-admin-metabox textarea.tall{min-height:200px;height:200px}.um-admin-metabox textarea.um-admin-error{border-color:#c74a4a!important}
|
||||
.um-adm-ico{font-size:18px;width:18px;text-align:center;display:inline-block;color:#7acf58}.um-adm-ico.inactive{color:#c74a4a}.um-adm-ico.pointer{cursor:pointer}body.um-admin-modal-open{overflow:hidden}.um-admin #major-publishing-actions{background-color:#fff!important;border-top:0}.um-admin a.button i,.um-admin a.button-primary i{font-size:15px!important;height:15px!important;width:15px!important;text-align:center!important;margin:0 5px 0 0!important;display:inline-block}.um-admin a.button i:before,.um-admin a.button-primary i:before{position:relative;top:1px}.um-admin-metabox h6{font-size:14px;margin:12px 0 0 0}.um-admin-metabox h3{padding-left:0!important}.um-admin-metabox h4{font-size:14px;background:#f5f5f5;padding:8px 4px;color:#333}.um-admin-metabox p{margin:10px 0 0 0}.um-admin-metabox label{display:block;cursor:default;padding:0!important;font-size:13px;color:#666}.um-admin-metabox input[type=text]{height:auto!important;width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:4px 10px!important}.um-admin-metabox input[type=text]:disabled{opacity:.7!important;color:#aaa!important}.um-admin-metabox input[type=text].small{width:54px}.um-admin-metabox input[type=text].um-admin-error{border-color:#c74a4a!important}.um-admin-metabox textarea{width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:8px!important;color:#888!important;min-height:100px;height:100px}.um-admin-metabox textarea.tall{min-height:200px;height:200px}.um-admin-metabox textarea.um-admin-error{border-color:#c74a4a!important}
|
||||
@@ -33,9 +33,6 @@ body.#{$prefix}admin-modal-open
|
||||
top: 1px
|
||||
|
||||
.#{$prefix}admin-metabox
|
||||
*
|
||||
-webkit-font-smoothing: antialiased !important
|
||||
-moz-osx-font-smoothing: grayscale !important
|
||||
h6
|
||||
font-size: 14px
|
||||
margin: 12px 0 0 0
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
- 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;}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.um-admin-overlay{background:rgba(0,0,0,.7);width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000}.um-admin-modal a.button,.um-admin-modal a.button-primary,.um-admin-modal input[type=submit].button-primary{padding:0 12px!important;vertical-align:middle!important}.um-admin .um-admin-modal a.button i:before{display:block;top:0}.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:.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:400;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 label,.um-admin-infobox p{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:700;display:block;color:#333;cursor:default}.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}.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}.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}#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.highlighted,.um-admin-icons span:hover{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}
|
||||
@@ -0,0 +1,193 @@
|
||||
#um-settings-wrap .subsubsub {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin-left: -3px;
|
||||
margin-right: -3px; }
|
||||
#um-settings-wrap .subsubsub a {
|
||||
margin: 0 3px; }
|
||||
|
||||
.um-settings-section .description {
|
||||
font-style: italic; }
|
||||
|
||||
.um-notification-status {
|
||||
margin-right: 18px;
|
||||
font-size: 28px;
|
||||
line-height: 22px;
|
||||
color: #c74a4a;
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box; }
|
||||
.um-notification-status.um-notification-is-active {
|
||||
color: #7acf58; }
|
||||
|
||||
.um-email-configure span {
|
||||
line-height: 24px; }
|
||||
|
||||
.um-long-field {
|
||||
width: 100%; }
|
||||
|
||||
.um-medium-field {
|
||||
width: 50%; }
|
||||
|
||||
.um-small-field {
|
||||
width: 25%; }
|
||||
|
||||
.column-configure {
|
||||
width: 60px;
|
||||
text-align: center; }
|
||||
|
||||
th.column-email.column-primary {
|
||||
padding-left: 48px; }
|
||||
|
||||
.um-form-table .um-forms-line td {
|
||||
padding-right: 0; }
|
||||
|
||||
#um-settings-template-versions .wp-list-table .column-core_version {
|
||||
width: 100px;
|
||||
text-align: center; }
|
||||
|
||||
#um-settings-template-versions .wp-list-table .column-theme_version {
|
||||
width: 100px;
|
||||
text-align: center; }
|
||||
|
||||
#um-settings-template-versions .wp-list-table .column-status {
|
||||
width: 260px; }
|
||||
|
||||
#um-settings-form {
|
||||
float: left;
|
||||
width: 100%;
|
||||
margin: 0; }
|
||||
#um-settings-form .subsubsub {
|
||||
float: left;
|
||||
width: 100%; }
|
||||
|
||||
.um-settings-line .multi-checkbox-line {
|
||||
float: left;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0; }
|
||||
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
float: left;
|
||||
width: 100%; }
|
||||
|
||||
.wrap-licenses .form-table,
|
||||
.wrap-licenses thead,
|
||||
.wrap-licenses tbody,
|
||||
.wrap-licenses tfoot,
|
||||
.wrap-licenses tr,
|
||||
.wrap-licenses td,
|
||||
.wrap-licenses th,
|
||||
.wrap-licenses caption {
|
||||
display: block; }
|
||||
|
||||
.wrap-licenses .form-table tr {
|
||||
float: left;
|
||||
margin: 0 15px 15px 0;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
width: 30.5%;
|
||||
max-width: 350px;
|
||||
padding: 14px;
|
||||
min-height: 240px;
|
||||
position: relative;
|
||||
box-sizing: border-box; }
|
||||
|
||||
.wrap-licenses .form-table th {
|
||||
background: #f9f9f9;
|
||||
padding: 14px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: -14px -14px 20px;
|
||||
width: 100%; }
|
||||
|
||||
.wrap-licenses .form-table td {
|
||||
padding: 0; }
|
||||
|
||||
.wrap-licenses td input.regular-text {
|
||||
margin: 0 0 8px;
|
||||
width: 100%; }
|
||||
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] {
|
||||
position: absolute;
|
||||
background: #fafafa;
|
||||
padding: 14px;
|
||||
border-top: 1px solid #eee;
|
||||
margin: 20px -14px -14px;
|
||||
min-height: 67px;
|
||||
width: 100%;
|
||||
bottom: 14px;
|
||||
box-sizing: border-box; }
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a {
|
||||
color: #444; }
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a:hover {
|
||||
text-decoration: none; }
|
||||
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice {
|
||||
background-color: #00a0d2;
|
||||
color: #fff;
|
||||
border-color: #00a0d2; }
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a {
|
||||
color: #fff; }
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover {
|
||||
text-decoration: none; }
|
||||
|
||||
.wrap-licenses .edd-license-data.edd-license-expired {
|
||||
background-color: #e24e4e;
|
||||
color: #fff;
|
||||
border-color: #e24e4e; }
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a {
|
||||
color: #fff; }
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a:hover {
|
||||
text-decoration: none; }
|
||||
|
||||
.wrap-licenses .edd-license-data.edd-license-valid {
|
||||
background-color: #5abc55;
|
||||
color: #fff;
|
||||
border-color: #5abc55; }
|
||||
|
||||
.wrap-licenses .edd-license-data.edd-license-error, .wrap-licenses .edd-license-data.edd-license-missing, .wrap-licenses .edd-license-data.edd-license-invalid, .wrap-licenses .edd-license-data.edd-license-site_inactive, .wrap-licenses .edd-license-data.edd-license-item_name_mismatch {
|
||||
background-color: #ffebcd;
|
||||
border-color: #ffebcd; }
|
||||
|
||||
.wrap-licenses .edd-license-data p {
|
||||
font-size: 13px;
|
||||
margin-top: 0; }
|
||||
|
||||
.wrap-licenses ~ p.submit {
|
||||
clear: both; }
|
||||
|
||||
@media screen and (max-width: 980px) {
|
||||
.wrap-licenses .form-table tr {
|
||||
width: calc( 50% - 15px);
|
||||
max-width: none; } }
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
#um-settings-template-versions .wp-list-table .column-core_version,
|
||||
#um-settings-template-versions .wp-list-table .column-theme_version {
|
||||
width: auto;
|
||||
text-align: left; }
|
||||
.wrap-licenses .form-table tr {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
max-width: none; }
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
width: 100% !important; }
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
line-height: 30px !important; }
|
||||
.um-medium-field {
|
||||
width: 100%; }
|
||||
.um-small-field {
|
||||
width: 50%; } }
|
||||
|
||||
.um-setting_ajax_button_response.complete {
|
||||
color: #7acf58;
|
||||
font-style: italic; }
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
#um-settings-wrap .subsubsub{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;flex-wrap:wrap;margin-left:-3px;margin-right:-3px}#um-settings-wrap .subsubsub a{margin:0 3px}.um-settings-section .description{font-style:italic}.um-notification-status{margin-right:18px;font-size:28px;line-height:22px;color:#c74a4a;float:left;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.um-notification-status.um-notification-is-active{color:#7acf58}.um-email-configure span{line-height:24px}.um-long-field{width:100%}.um-medium-field{width:50%}.um-small-field{width:25%}.column-configure{width:60px;text-align:center}th.column-email.column-primary{padding-left:48px}.um-form-table .um-forms-line td{padding-right:0}#um-settings-template-versions .wp-list-table .column-core_version{width:100px;text-align:center}#um-settings-template-versions .wp-list-table .column-theme_version{width:100px;text-align:center}#um-settings-template-versions .wp-list-table .column-status{width:260px}#um-settings-form{float:left;width:100%;margin:0}#um-settings-form .subsubsub{float:left;width:100%}.um-settings-line .multi-checkbox-line{float:left;width:100%;clear:both;margin:0 0 10px 0;padding:0}.um-settings-line .multi-checkbox-column{float:left;margin:0;padding:0}.um-settings-line .multi-checkbox-column label{float:left;width:100%}.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tbody,.wrap-licenses td,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:block}.wrap-licenses .form-table tr{float:left;margin:0 15px 15px 0;background:#fff;border:1px solid #ccc;width:30.5%;max-width:350px;padding:14px;min-height:240px;position:relative;box-sizing:border-box}.wrap-licenses .form-table th{background:#f9f9f9;padding:14px;border-bottom:1px solid #ccc;margin:-14px -14px 20px;width:100%}.wrap-licenses .form-table td{padding:0}.wrap-licenses td input.regular-text{margin:0 0 8px;width:100%}.wrap-licenses .edd-license-data[class*=edd-license-]{position:absolute;background:#fafafa;padding:14px;border-top:1px solid #eee;margin:20px -14px -14px;min-height:67px;width:100%;bottom:14px;box-sizing:border-box}.wrap-licenses .edd-license-data[class*=edd-license-] a{color:#444}.wrap-licenses .edd-license-data[class*=edd-license-] a:hover{text-decoration:none}.wrap-licenses .edd-license-data.license-expires-soon-notice{background-color:#00a0d2;color:#fff;border-color:#00a0d2}.wrap-licenses .edd-license-data.license-expires-soon-notice a{color:#fff}.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover{text-decoration:none}.wrap-licenses .edd-license-data.edd-license-expired{background-color:#e24e4e;color:#fff;border-color:#e24e4e}.wrap-licenses .edd-license-data.edd-license-expired a{color:#fff}.wrap-licenses .edd-license-data.edd-license-expired a:hover{text-decoration:none}.wrap-licenses .edd-license-data.edd-license-valid{background-color:#5abc55;color:#fff;border-color:#5abc55}.wrap-licenses .edd-license-data.edd-license-error,.wrap-licenses .edd-license-data.edd-license-invalid,.wrap-licenses .edd-license-data.edd-license-item_name_mismatch,.wrap-licenses .edd-license-data.edd-license-missing,.wrap-licenses .edd-license-data.edd-license-site_inactive{background-color:#ffebcd;border-color:#ffebcd}.wrap-licenses .edd-license-data p{font-size:13px;margin-top:0}.wrap-licenses~p.submit{clear:both}@media screen and (max-width:980px){.wrap-licenses .form-table tr{width:calc(50% - 15px);max-width:none}}@media screen and (max-width:782px){#um-settings-template-versions .wp-list-table .column-core_version,#um-settings-template-versions .wp-list-table .column-theme_version{width:auto;text-align:left}.wrap-licenses .form-table tr{width:100%;margin-right:0;max-width:none}.um-settings-line .multi-checkbox-column{width:100%!important}.um-settings-line .multi-checkbox-column label{line-height:30px!important}.um-medium-field{width:100%}.um-small-field{width:50%}}.um-setting_ajax_button_response.complete{color:#7acf58;font-style:italic}
|
||||
@@ -0,0 +1,212 @@
|
||||
@import "selectors"
|
||||
@import "mixins"
|
||||
@import "colors"
|
||||
|
||||
##{$prefix}settings-wrap
|
||||
.subsubsub
|
||||
+flex( row, flex-start, center, wrap )
|
||||
margin-left: -3px
|
||||
margin-right: -3px
|
||||
a
|
||||
margin: 0 3px
|
||||
|
||||
.#{$prefix}settings-section
|
||||
.description
|
||||
font-style: italic
|
||||
|
||||
.#{$prefix}notification-status
|
||||
margin-right: 18px
|
||||
font-size: 28px
|
||||
line-height: 22px
|
||||
color: #{$admin-warning}
|
||||
float: left
|
||||
+border-box
|
||||
&.#{$prefix}notification-is-active
|
||||
color: #{$admin-ok}
|
||||
|
||||
.#{$prefix}email-configure
|
||||
span
|
||||
line-height: 24px
|
||||
|
||||
.#{$prefix}long-field
|
||||
width: 100%
|
||||
|
||||
.#{$prefix}medium-field
|
||||
width: 50%
|
||||
|
||||
.#{$prefix}small-field
|
||||
width: 25%
|
||||
|
||||
.column-configure
|
||||
width: 60px
|
||||
text-align: center
|
||||
|
||||
th.column-email.column-primary
|
||||
padding-left: 48px
|
||||
|
||||
|
||||
.#{$prefix}form-table
|
||||
.#{$prefix}forms-line
|
||||
td
|
||||
padding-right: 0
|
||||
|
||||
##{$prefix}settings-template-versions
|
||||
.wp-list-table
|
||||
.column-core_version
|
||||
width: 100px
|
||||
text-align: center
|
||||
.column-theme_version
|
||||
width: 100px
|
||||
text-align: center
|
||||
.column-status
|
||||
width: 260px
|
||||
|
||||
##{$prefix}settings-form
|
||||
float: left
|
||||
width: 100%
|
||||
margin: 0
|
||||
.subsubsub
|
||||
float: left
|
||||
width: 100%
|
||||
|
||||
|
||||
.#{$prefix}settings-line
|
||||
.multi-checkbox-line
|
||||
float: left
|
||||
width: 100%
|
||||
clear: both
|
||||
margin: 0 0 10px 0
|
||||
padding: 0
|
||||
|
||||
.multi-checkbox-column
|
||||
float: left
|
||||
margin: 0
|
||||
padding: 0
|
||||
|
||||
label
|
||||
float: left
|
||||
width: 100%
|
||||
|
||||
|
||||
.wrap-licenses
|
||||
.form-table,
|
||||
thead,
|
||||
tbody,
|
||||
tfoot,
|
||||
tr,
|
||||
td,
|
||||
th,
|
||||
caption
|
||||
display: block
|
||||
.form-table
|
||||
tr
|
||||
float: left
|
||||
margin: 0 15px 15px 0
|
||||
background: #fff
|
||||
border: 1px solid #ccc
|
||||
width: 30.5%
|
||||
max-width: 350px
|
||||
padding: 14px
|
||||
min-height: 240px
|
||||
position: relative
|
||||
box-sizing: border-box
|
||||
th
|
||||
background: #f9f9f9
|
||||
padding: 14px
|
||||
border-bottom: 1px solid #ccc
|
||||
margin: -14px -14px 20px
|
||||
width: 100%
|
||||
|
||||
td
|
||||
padding: 0
|
||||
|
||||
td
|
||||
input
|
||||
&.regular-text
|
||||
margin: 0 0 8px
|
||||
width: 100%
|
||||
.edd-license-data
|
||||
&[class*="edd-license-"]
|
||||
position: absolute
|
||||
background: #fafafa
|
||||
padding: 14px
|
||||
border-top: 1px solid #eee
|
||||
margin: 20px -14px -14px
|
||||
min-height: 67px
|
||||
width: 100%
|
||||
bottom: 14px
|
||||
box-sizing: border-box
|
||||
a
|
||||
color: #444
|
||||
&:hover
|
||||
text-decoration: none
|
||||
|
||||
&.license-expires-soon-notice
|
||||
background-color: #00a0d2
|
||||
color: #fff
|
||||
border-color: #00a0d2
|
||||
a
|
||||
color: #fff
|
||||
&:hover
|
||||
text-decoration: none
|
||||
&.edd-license-expired
|
||||
background-color: #e24e4e
|
||||
color: #fff
|
||||
border-color: #e24e4e
|
||||
a
|
||||
color: #fff
|
||||
&:hover
|
||||
text-decoration: none
|
||||
|
||||
&.edd-license-valid
|
||||
background-color: #5abc55
|
||||
color: #fff
|
||||
border-color: #5abc55
|
||||
|
||||
&.edd-license-error,
|
||||
&.edd-license-missing,
|
||||
&.edd-license-invalid,
|
||||
&.edd-license-site_inactive,
|
||||
&.edd-license-item_name_mismatch
|
||||
background-color: #ffebcd
|
||||
border-color: #ffebcd
|
||||
|
||||
p
|
||||
font-size: 13px
|
||||
margin-top: 0
|
||||
|
||||
& ~ p.submit
|
||||
clear: both
|
||||
|
||||
@media screen and (max-width: 980px)
|
||||
.wrap-licenses .form-table tr
|
||||
width: calc( 50% - 15px )
|
||||
max-width: none
|
||||
|
||||
@media screen and (max-width: 782px)
|
||||
##{$prefix}settings-template-versions
|
||||
.wp-list-table
|
||||
.column-core_version,
|
||||
.column-theme_version
|
||||
width: auto
|
||||
text-align: left
|
||||
|
||||
.wrap-licenses
|
||||
.form-table tr
|
||||
width: 100%
|
||||
margin-right: 0
|
||||
max-width: none
|
||||
|
||||
.#{$prefix}settings-line
|
||||
.multi-checkbox-column
|
||||
width: 100% !important
|
||||
label
|
||||
line-height: 30px !important
|
||||
.#{$prefix}medium-field
|
||||
width: 100%
|
||||
.#{$prefix}small-field
|
||||
width: 50%
|
||||
|
||||
.#{$prefix}setting_ajax_button_response.complete
|
||||
color: #{$admin-ok}
|
||||
font-style: italic
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -1,3 +1,322 @@
|
||||
if ( typeof (window.UM) !== 'object' ) {
|
||||
window.UM = {};
|
||||
}
|
||||
|
||||
if ( typeof (window.UM.admin) !== 'object' ) {
|
||||
window.UM.admin = {};
|
||||
}
|
||||
|
||||
UM.admin.builder = {
|
||||
deleteProcess: [],
|
||||
fieldsToDelete: [],
|
||||
}
|
||||
|
||||
function UM_Drag_and_Drop() {
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
||||
items: '.um-admin-drag-fld',
|
||||
connectWith: '.um-admin-drag-col,.um-admin-drag-group',
|
||||
placeholder: "um-fld-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
update: function(event, ui){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
if ( ui.item.hasClass('um-field-type-group') && ui.item.parents('.um-field-type-group').length > 0 ) {
|
||||
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable('cancel');
|
||||
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
|
||||
} else {
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-rowsubs').sortable({
|
||||
items: '.um-admin-drag-rowsub',
|
||||
placeholder: "um-rowsub-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_subrows();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-rowsub').sortable({
|
||||
items: '.um-admin-drag-col',
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
row = jQuery(this);
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-ajax').sortable({
|
||||
items: '.um-admin-drag-row',
|
||||
handle: ".um-admin-drag-row-start",
|
||||
zIndex: 9999999999,
|
||||
placeholder: "um-row-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
out: function(){
|
||||
UM.common.tipsy.hide();
|
||||
},
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_rows();
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
}
|
||||
|
||||
function UM_update_rows() {
|
||||
var c = 0;
|
||||
jQuery('a[data-remove_element="um-admin-drag-row"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-row-icons').append( '<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_update_subrows(){
|
||||
jQuery('a[data-remove_element="um-admin-drag-rowsub"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c = 0;
|
||||
jQuery(this).find('.um-admin-drag-rowsub').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-rowsub-icons').append('<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Col(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
cols = jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length;
|
||||
col = jQuery(this).parents('.um-admin-drag-col');
|
||||
if ( col.hasClass('cols-last') ) {
|
||||
if ( cols == 1 ) {
|
||||
saved_col = 1;
|
||||
}
|
||||
if ( cols == 3 ) {
|
||||
saved_col = 3;
|
||||
} else if ( cols == 2 ) {
|
||||
saved_col = 2;
|
||||
}
|
||||
} else if ( col.hasClass('cols-middle') && cols == 3 ) {
|
||||
saved_col = 2;
|
||||
} else {
|
||||
saved_col = 1;
|
||||
}
|
||||
|
||||
jQuery(this).data('column', saved_col);
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Grp(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld:not(.um-field-type-group)').each(function(){
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length == 0 ){
|
||||
jQuery(this).data('group', '');
|
||||
} else {
|
||||
jQuery(this).data('group', jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key') );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Rows_Refresh(){
|
||||
|
||||
jQuery('.um_update_order_fields').empty();
|
||||
|
||||
/* ROWS */
|
||||
var c = 0;
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
|
||||
row = jQuery(this);
|
||||
|
||||
col_num = '';
|
||||
row.find('.um-admin-drag-rowsub').each(function(){
|
||||
|
||||
subrow = jQuery(this);
|
||||
|
||||
subrow.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
subrow.find('.um-admin-drag-col').addClass('cols-' + subrow.find('.um-admin-drag-col').length );
|
||||
subrow.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( subrow.find('.um-admin-drag-col').length == 3 ) {subrow.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
if ( !col_num ) {
|
||||
col_num = subrow.find('.um-admin-drag-col').length;
|
||||
} else {
|
||||
col_num = col_num + ':' + subrow.find('.um-admin-drag-col').length;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowcols_'+c+'_cols" id="_um_rowcols_'+c+'_cols" value="'+col_num+'" />');
|
||||
|
||||
sub_rows_count = row.find('.um-admin-drag-rowsub').length;
|
||||
|
||||
var origin_id = jQuery(this).attr('data-original');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_row_'+c+'" id="_um_row_'+c+'" value="_um_row_'+c+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_roworigin_'+c+'_val" id="_um_roworigin_'+c+'_val" value="'+origin_id+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowsub_'+c+'_rows" id="_um_rowsub_'+c+'_rows" value="'+sub_rows_count+'" />');
|
||||
|
||||
jQuery(this).attr('data-original', '_um_row_'+c );
|
||||
|
||||
});
|
||||
|
||||
/* FIELDS */
|
||||
var order;
|
||||
order = 0;
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
|
||||
if ( !jQuery(this).hasClass('group') ) {
|
||||
var group = jQuery(this).data('group');
|
||||
if ( group != '' ) {
|
||||
if ( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group').find( jQuery(this) ).length == 0 ) {
|
||||
jQuery(this).appendTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
} else {
|
||||
//jQuery(this).prependTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
}
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="'+group+'" />');
|
||||
} else {
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="" />');
|
||||
}
|
||||
}
|
||||
|
||||
order++;
|
||||
|
||||
row = jQuery(this).parents('.um-admin-drag-row').index()+1;
|
||||
row = '_um_row_'+row;
|
||||
|
||||
saved_col = jQuery(this).data('column');
|
||||
|
||||
if ( saved_col == 3 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(2)') );
|
||||
}
|
||||
if ( saved_col == 2 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(1)') );
|
||||
}
|
||||
|
||||
sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_position_'+jQuery(this).data('key')+'" id="um_position_'+jQuery(this).data('key')+'" value="'+order+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_row_'+jQuery(this).data('key')+'" id="um_row_'+jQuery(this).data('key')+'" value="'+row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_subrow_'+jQuery(this).data('key')+'" id="um_subrow_'+jQuery(this).data('key')+'" value="'+sub_row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_col_'+jQuery(this).data('key')+'" id="um_col_'+jQuery(this).data('key')+'" value="'+saved_col+'" />');
|
||||
|
||||
});
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
UM_Add_Icon();
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: jQuery( '.um_update_order' ).serialize(),
|
||||
success: function(){
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function UM_Add_Icon(){
|
||||
|
||||
var add_icon_html = '<a href="#" class="um-admin-drag-add-field um-tip-n" title="Add Field" data-modal="UM_fields" data-modal-size="normal" data-dynamic-content="um_admin_show_fields" data-arg2="'+jQuery('.um-admin-drag-ajax').data('form_id')+'" data-arg1=""><i class="um-icon-plus"></i></a>';
|
||||
|
||||
jQuery('.um-admin-drag-col').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-group').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function um_builder_delete_field_ajax( callback ) {
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
let fieldDelete = UM.admin.builder.fieldsToDelete.shift();
|
||||
let arg1 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg1');
|
||||
let arg2 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg2');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field',
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
um_builder_delete_field_ajax( callback );
|
||||
},
|
||||
error: function( data ) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
function um_form_select_tab( tab, set_val ) {
|
||||
var mode_block = jQuery('input#form__um_mode');
|
||||
tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg');
|
||||
@@ -125,4 +444,491 @@ jQuery( document ).ready( function() {
|
||||
|
||||
});
|
||||
jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');});
|
||||
|
||||
jQuery( document.body ).on('click', 'a[data-silent_action^="um_"]', function() {
|
||||
if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var act_id = jQuery(this).data('silent_action');
|
||||
var arg1 = jQuery(this).data('arg1');
|
||||
var arg2 = jQuery(this).data('arg2');
|
||||
|
||||
var in_row = '';
|
||||
var in_sub_row = '';
|
||||
var in_column = '';
|
||||
var in_group = '';
|
||||
|
||||
var demon_settings = jQuery('.um-col-demon-settings');
|
||||
if ( demon_settings.data('in_column') ) {
|
||||
in_row = demon_settings.data('in_row');
|
||||
in_sub_row = demon_settings.data('in_sub_row');
|
||||
in_column = demon_settings.data('in_column');
|
||||
in_group = demon_settings.data('in_group');
|
||||
}
|
||||
|
||||
um_admin_remove_modal();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : act_id,
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
in_row: in_row,
|
||||
in_sub_row: in_sub_row,
|
||||
in_column: in_column,
|
||||
in_group: in_group,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
demon_settings.data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
um_admin_modal_responsive();
|
||||
um_admin_update_builder();
|
||||
},
|
||||
error: function( data ) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Remove field permanently */
|
||||
jQuery(document.body).on('click', '.um-admin-btns a span.remove', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if ( confirm( wp.i18n.__( 'This will permanently delete this custom field from a database and from all forms on your site. Are you sure?', 'ultimate-member' ) ) ) {
|
||||
|
||||
jQuery(this).parents('a').remove();
|
||||
|
||||
var arg1 = jQuery(this).parents('a').data('arg1');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field_global',
|
||||
arg1 : arg1,
|
||||
nonce: um_admin_scripts.nonce
|
||||
|
||||
},
|
||||
success: function(data) {
|
||||
jQuery('#um-admin-form-builder .' + arg1).remove();
|
||||
},
|
||||
error: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
/* Add a Field */
|
||||
jQuery(document.body).on('submit', 'form.um_add_field', function(e){
|
||||
e.preventDefault();
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
//need fields refactor
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
if ( jQuery( this ).find('[id^="_conditional_action"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_field"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').val() ==='' )
|
||||
{
|
||||
jQuery(conditions[i]).find('.um-admin-remove-condition').trigger('click');
|
||||
}
|
||||
} );
|
||||
conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
var id = i === 0 ? '' : i;
|
||||
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
var form = jQuery(this);
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form.serialize(),
|
||||
beforeSend: function(){
|
||||
form.css({'opacity': 0.5});
|
||||
jQuery('.um-admin-error').removeClass('um-admin-error');
|
||||
form.find('.um-admin-error-block').hide();
|
||||
form.find('.um-admin-success-block').hide();
|
||||
},
|
||||
complete: function(){
|
||||
form.css({'opacity': 1});
|
||||
},
|
||||
success: function( response ){
|
||||
if ( response.success ) {
|
||||
let data = response.data;
|
||||
if ( data.error ) {
|
||||
let c = 0;
|
||||
jQuery.each( data.error, function(i, v){
|
||||
c++;
|
||||
if ( 1 === c ) {
|
||||
form.find('#' + i).addClass('um-admin-error').trigger('focus');
|
||||
form.find('.um-admin-error-block').show().html(v);
|
||||
}
|
||||
});
|
||||
|
||||
um_admin_modal_responsive();
|
||||
} 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_update_builder();
|
||||
}
|
||||
} else {
|
||||
console.log( response );
|
||||
}
|
||||
},
|
||||
error: function( response ){
|
||||
console.log( response );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
disable link
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-builder a, .um-admin-modal a:not(.um-preview-upload)', function(e){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
toggle area
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-btn-toggle a', function(e){
|
||||
var content = jQuery(this).parent().find('.um-admin-btn-content');
|
||||
var link = jQuery(this);
|
||||
if ( content.is(':hidden') ) {
|
||||
content.show();
|
||||
link.find('i').removeClass().addClass('um-icon-minus');
|
||||
link.addClass('active');
|
||||
} else {
|
||||
content.hide();
|
||||
link.find('i').removeClass().addClass('um-icon-plus');
|
||||
link.removeClass('active');
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
clone a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-new-condition', function() {
|
||||
|
||||
if ( jQuery(this).hasClass('disabled') )
|
||||
return false;
|
||||
|
||||
var content = jQuery(this).parents('.um-admin-btn-content'),
|
||||
length = content.find('.um-admin-cur-condition').length;
|
||||
|
||||
if ( length < 5 ) {
|
||||
//content.find('select').select2('destroy');
|
||||
|
||||
var template = jQuery('.um-admin-btn-content').find('.um-admin-cur-condition-template').clone();
|
||||
template.find('input[type=text]').val('');
|
||||
template.find('select').val('');
|
||||
|
||||
template.appendTo( content );
|
||||
jQuery(template).removeClass("um-admin-cur-condition-template");
|
||||
jQuery(template).addClass("um-admin-cur-condition");
|
||||
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
} else {
|
||||
jQuery(this).addClass('disabled');
|
||||
alert( 'You already have 5 rules' );
|
||||
}
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
reset conditions
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-reset-conditions a', function(){
|
||||
var content = jQuery(this).parents('.um-admin-btn-content');
|
||||
content.find('.um-admin-cur-condition').slice(1).remove();
|
||||
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();
|
||||
});
|
||||
|
||||
/**
|
||||
remove a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-remove-condition', function(){
|
||||
var condition = jQuery(this).parents('.um-admin-cur-condition');
|
||||
jQuery('.um-admin-new-condition').removeClass('disabled');
|
||||
UM.common.tipsy.hide();
|
||||
condition.remove();
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
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();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve options from a callback function
|
||||
*/
|
||||
jQuery(document.body).on('blur',"#_custom_dropdown_options_source", function(){
|
||||
var me = jQuery(this);
|
||||
var _options = jQuery('textarea[id=_options]');
|
||||
|
||||
if( me.val() != '' ){
|
||||
var um_option_callback = me.val();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_populate_dropdown_options',
|
||||
um_option_callback: um_option_callback,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
complete: function(){
|
||||
|
||||
},
|
||||
success: function( response ){
|
||||
var arr_opts = [];
|
||||
|
||||
for (var key in response.data ){
|
||||
arr_opts.push( response.data[ key ] );
|
||||
}
|
||||
|
||||
_options.val( arr_opts.join('\n') );
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
choose font icon
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-icons span', function(){
|
||||
var icon = jQuery(this).attr('data-code');
|
||||
jQuery(this).parent().find('span').removeClass('highlighted');
|
||||
jQuery(this).addClass('highlighted');
|
||||
jQuery('#UM_fonticons').find('a.um-admin-modal-back').attr("data-code", icon);
|
||||
});
|
||||
|
||||
if ( !jQuery('.um-admin-drag').length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
/* add field to respected area */
|
||||
jQuery( document.body ).on('click', 'a.um-admin-drag-add-field', function() {
|
||||
in_row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
in_sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 1 ) {
|
||||
in_column = 1;
|
||||
} else {
|
||||
if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-middle')){
|
||||
in_column = 2;
|
||||
} else if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-last') ) {
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 3 ) {
|
||||
in_column = 3;
|
||||
} else {
|
||||
in_column = 2;
|
||||
}
|
||||
} else {
|
||||
in_column = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length ) {
|
||||
in_group = jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key');
|
||||
} else {
|
||||
in_group = '';
|
||||
}
|
||||
|
||||
jQuery('.um-col-demon-settings').data('in_row', in_row);
|
||||
jQuery('.um-col-demon-settings').data('in_sub_row', in_sub_row);
|
||||
jQuery('.um-col-demon-settings').data('in_column', in_column);
|
||||
jQuery('.um-col-demon-settings').data('in_group', in_group);
|
||||
});
|
||||
|
||||
/* add row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_row"]', function(){
|
||||
var dragg = jQuery('.um-admin-drag-ajax');
|
||||
dragg.append( '<div class="um-admin-drag-row">' + jQuery('.um-col-demon-row').html() + '</div>' );
|
||||
dragg.find('.um-admin-drag-row:last').find('.um-admin-drag-row-icons').find('a.um-admin-drag-row-edit').attr('data-arg3', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
dragg.find('.um-admin-drag-row:last').attr('data-original', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
UM_update_rows();
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* add sub row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_subrow"]', function(){
|
||||
var dragg = jQuery(this).parents('.um-admin-drag-row').find('.um-admin-drag-rowsubs');
|
||||
dragg.append( '<div class="um-admin-drag-rowsub">' + jQuery('.um-col-demon-subrow').html() + '</div>' );
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* remove element: Row, Subrow */
|
||||
jQuery(document.body).on('click', 'a[data-remove_element^="um-"]',function(){
|
||||
let deleteButton = jQuery(this);
|
||||
let element = jQuery(this).data('remove_element');
|
||||
let loadingWrapper = jQuery(this).parents('.' + element ).children('.um-admin-row-loading');
|
||||
|
||||
let row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
let subrow = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
let fieldPosition= {row,subrow};
|
||||
let deleteExists= false;
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
deleteExists = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if ( deleteExists ) {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingWrapper.show();
|
||||
|
||||
UM.admin.builder.deleteProcess.push({row,subrow});
|
||||
|
||||
UM.admin.builder.fieldsToDelete = jQuery(this).parents('.' +element).find('.um-admin-drag-fld').toArray();
|
||||
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
um_builder_delete_field_ajax( function () {
|
||||
UM.common.tipsy.hide();
|
||||
deleteButton.parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
} );
|
||||
} else {
|
||||
UM.common.tipsy.hide();
|
||||
jQuery(this).parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
}
|
||||
});
|
||||
|
||||
/* dynamically change columns */
|
||||
jQuery(document.body).on('click', '.um-admin-drag-ctrls.columns a', function(){
|
||||
|
||||
var row = jQuery(this).parents('.um-admin-drag-rowsub');
|
||||
var tab = jQuery(this);
|
||||
var tabs = jQuery(this).parent();
|
||||
tabs.find('a').removeClass('active');
|
||||
tab.addClass('active');
|
||||
var existing_cols = row.find('.um-admin-drag-col').length;
|
||||
var required_cols = tab.data('cols');
|
||||
var needed_cols = required_cols - existing_cols;
|
||||
|
||||
if ( needed_cols > 0 ) {
|
||||
|
||||
for (i = 0; i < needed_cols; i++){
|
||||
row.find('.um-admin-drag-col-dynamic').append('<div class="um-admin-drag-col"></div>');
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
} else if ( needed_cols < 0 ) {
|
||||
|
||||
needed_cols = needed_cols + 3;
|
||||
if ( needed_cols == 2 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
}
|
||||
if ( needed_cols == 1 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-middle').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
row.find('.um-admin-drag-col.cols-middle').remove();
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col:visible').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
}
|
||||
|
||||
if ( allow_update_via_col_click == true ) {
|
||||
UM_Change_Field_Col();
|
||||
UM_Rows_Refresh();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/* trigger columns at start */
|
||||
allow_update_via_col_click = false;
|
||||
jQuery('.um-admin-drag-ctrls.columns a.active').each(function(){
|
||||
jQuery(this).trigger('click');
|
||||
}).promise().done( function(){ allow_update_via_col_click = true; } );
|
||||
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,328 @@
|
||||
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 );
|
||||
|
||||
// Make responsive script only when live preview,
|
||||
if ( jQuery('.um-admin-modal').find('.um-admin-modal-body').find('.um').length ) {
|
||||
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
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){var e;jQuery(document.body).on("click",".um_license_deactivate",function(){jQuery(this).siblings(".um-option-field").val(""),jQuery(this).siblings("#submit").length?jQuery(this).siblings("#submit").trigger("click",[!0]):jQuery(this).parents("form.um-settings-form").trigger("submit")}),jQuery(document.body).on("click",".um-settings-form #submit",function(e,n){if(!n&&""===jQuery(this).siblings(".um-option-field").val())return!1}),0===jQuery("#licenses_settings").length&&(e=!1,jQuery("input, textarea, select").on("change",function(){e=!0}),jQuery("#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a").on("click",function(){window.onbeforeunload=e?function(){return wp.i18n.__("Are sure, maybe some settings not saved","ultimate-member")}:""}),jQuery(".submit input").on("click",function(){window.onbeforeunload=""}))});
|
||||
@@ -625,18 +625,6 @@ function um_modal_size( aclass ) {
|
||||
jQuery('.um-modal:visible').not('.um-modal-hidden').addClass( aclass );
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe deprecated
|
||||
*
|
||||
* @deprecated since 2.1.16
|
||||
*
|
||||
* @param id
|
||||
* @param value
|
||||
*/
|
||||
function um_modal_add_attr( id, value ) {
|
||||
jQuery('.um-modal:visible').not('.um-modal-hidden').data( id, value );
|
||||
}
|
||||
|
||||
function prepare_Modal() {
|
||||
if ( jQuery('.um-popup-overlay').length == 0 ) {
|
||||
jQuery('body').append('<div class="um-popup-overlay"></div>');
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
||||
.um-admin td, .um-admin th {
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -415,3 +415,134 @@ textarea.um-forms-field.um-small-field {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
- Form Inputs
|
||||
*/
|
||||
|
||||
.wp-picker-container input.wp-color-picker[type="text"] {
|
||||
width: 68px !important;
|
||||
float: left !important;
|
||||
padding: 2px 4px !important;
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,6 @@
|
||||
- modal
|
||||
*/
|
||||
|
||||
.um-admin-modal * {
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.um-admin-modal input[type=submit].button-primary,
|
||||
.um-admin-modal a.button-primary,
|
||||
.um-admin-modal a.button {
|
||||
@@ -46,7 +41,7 @@
|
||||
display: none;
|
||||
z-index: 10001;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
width: 730px;
|
||||
margin-left: -365px;
|
||||
}
|
||||
@@ -316,4 +311,4 @@ span.um-admin-icon-clear{
|
||||
}
|
||||
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;}
|
||||
span.um-admin-icon-clear i {font-size: 20px;vertical-align: middle;}
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/*body.um-admin .select2-container {margin-right: 2px!important;}
|
||||
|
||||
body.um-admin .select2-drop,
|
||||
body.um-admin .select2-drop.select2-drop-above,
|
||||
body.um-admin .select2-drop-active,
|
||||
body.um-admin .select2-container-multi .select2-choices
|
||||
{border: 1px solid #ddd !important}
|
||||
|
||||
body.um-admin .select2-container .select2-choice
|
||||
{
|
||||
height: 27px !important;
|
||||
line-height: 27px !important;
|
||||
border: 1px solid #ddd !important;
|
||||
color: #888 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice > .select2-chosen {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice .select2-arrow:before {
|
||||
font-size: 23px !important;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search-choice-close:before {
|
||||
font-size: 20px !important;
|
||||
color: #aaa;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container-multi .select2-search-choice-close:before {
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search input[type=text] {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-results li {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-results .select2-no-results,
|
||||
body.um-admin .select2-results .select2-searching,
|
||||
body.um-admin .select2-results .select2-selection-limit {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container-multi .select2-choices .select2-search-choice {
|
||||
line-height: 13px !important;
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop-mask {
|
||||
z-index: 10020 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop {
|
||||
z-index: 999999 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search {
|
||||
z-index: 10040 !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;
|
||||
}
|
||||
@@ -1,248 +0,0 @@
|
||||
.um-settings-section .description {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.um-block-notice {
|
||||
background: #fff;
|
||||
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
|
||||
font-size:13px;
|
||||
padding: 20px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.um-notification-status {
|
||||
margin-right: 18px;
|
||||
font-size: 28px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.um-notification-status {
|
||||
color: #a00;
|
||||
float:left;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-notification-status.um-notification-is-active {
|
||||
color: #46b450;
|
||||
}
|
||||
|
||||
.um-email-configure span {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.um-long-field {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.um-medium-field {
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.um-small-field {
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.column-configure {
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-core_version {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-theme_version {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-status {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
th.column-email.column-primary {
|
||||
padding-left: 48px;
|
||||
}
|
||||
|
||||
.um-nav-tab-wrapper {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#um-settings-emails {
|
||||
float:left;
|
||||
width:calc( 100% - 20px );
|
||||
margin-right: 20px;
|
||||
}
|
||||
#um-settings-form {
|
||||
float:left;
|
||||
width:calc( 100% - 10px );
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#um-settings-form .subsubsub {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
.um-settings-line .multi-checkbox-line {
|
||||
float:left;
|
||||
width:100%;
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
float:left;
|
||||
margin: 0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
.wrap-licenses .form-table,
|
||||
.wrap-licenses thead,
|
||||
.wrap-licenses tbody,
|
||||
.wrap-licenses tfoot,
|
||||
.wrap-licenses tr,
|
||||
.wrap-licenses td,
|
||||
.wrap-licenses th,
|
||||
.wrap-licenses caption {
|
||||
display: block;
|
||||
}
|
||||
.wrap-licenses .form-table tr {
|
||||
float: left;
|
||||
margin: 0 15px 15px 0;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
width: 30.5%;
|
||||
max-width: 350px;
|
||||
padding: 14px;
|
||||
min-height: 240px;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wrap-licenses .form-table th {
|
||||
background: #f9f9f9;
|
||||
padding: 14px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: -14px -14px 20px;
|
||||
width: 100%;
|
||||
}
|
||||
.wrap-licenses .form-table td {
|
||||
padding: 0;
|
||||
}
|
||||
.wrap-licenses td input.regular-text {
|
||||
margin: 0 0 8px;
|
||||
width: 100%;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] {
|
||||
position: absolute;
|
||||
background: #fafafa;
|
||||
padding: 14px;
|
||||
border-top: 1px solid #eee;
|
||||
margin: 20px -14px -14px;
|
||||
min-height: 67px;
|
||||
width: 100%;
|
||||
bottom: 14px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a {
|
||||
color: #444;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice {
|
||||
background-color: #00a0d2;
|
||||
color: #fff;
|
||||
border-color: #00a0d2;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.edd-license-expired {
|
||||
background-color: #e24e4e;
|
||||
color: #fff;
|
||||
border-color: #e24e4e;
|
||||
}
|
||||
|
||||
.wrap-licenses .edd-license-data.edd-license-valid {
|
||||
background-color: #5abc55;
|
||||
color: #fff;
|
||||
border-color: #5abc55;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.edd-license-error,
|
||||
.wrap-licenses .edd-license-data.edd-license-missing,
|
||||
.wrap-licenses .edd-license-data.edd-license-invalid,
|
||||
.wrap-licenses .edd-license-data.edd-license-site_inactive,
|
||||
.wrap-licenses .edd-license-data.edd-license-item_name_mismatch {
|
||||
background-color: #ffebcd;
|
||||
border-color: #ffebcd;
|
||||
}
|
||||
.wrap-licenses .edd-license-data p {
|
||||
font-size: 13px;
|
||||
margin-top: 0;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a,
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a {
|
||||
color: #fff;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover,
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.wrap-licenses ~ p.submit {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 980px) {
|
||||
.wrap-licenses .form-table tr {
|
||||
width:calc( 50% - 15px );
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.wrap-licenses .form-table tr {
|
||||
width:100%;
|
||||
margin-right: 0;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
width:100% !important;
|
||||
}
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
.um-medium-field {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.um-small-field {
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-core_version {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-theme_version {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.um_setting_ajax_button_response.complete {
|
||||
color:darkgreen;
|
||||
font-style: italic;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.3 KiB |
@@ -1,80 +0,0 @@
|
||||
function um_builder_delete_field_ajax( callback ) {
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
let fieldDelete = UM.admin.builder.fieldsToDelete.shift();
|
||||
let arg1 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg1');
|
||||
let arg2 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg2');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field',
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
um_builder_delete_field_ajax( callback );
|
||||
},
|
||||
error: function( data ) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery( document.body ).on('click', 'a[data-silent_action^="um_"]', function() {
|
||||
if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var act_id = jQuery(this).data('silent_action');
|
||||
var arg1 = jQuery(this).data('arg1');
|
||||
var arg2 = jQuery(this).data('arg2');
|
||||
|
||||
var in_row = '';
|
||||
var in_sub_row = '';
|
||||
var in_column = '';
|
||||
var in_group = '';
|
||||
|
||||
var demon_settings = jQuery('.um-col-demon-settings');
|
||||
if ( demon_settings.data('in_column') ) {
|
||||
in_row = demon_settings.data('in_row');
|
||||
in_sub_row = demon_settings.data('in_sub_row');
|
||||
in_column = demon_settings.data('in_column');
|
||||
in_group = demon_settings.data('in_group');
|
||||
}
|
||||
|
||||
um_admin_remove_modal();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : act_id,
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
in_row: in_row,
|
||||
in_sub_row: in_sub_row,
|
||||
in_column: in_column,
|
||||
in_group: in_group,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
demon_settings.data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
um_admin_modal_responsive();
|
||||
um_admin_update_builder();
|
||||
},
|
||||
error: function( data ) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
@@ -1,467 +0,0 @@
|
||||
if ( typeof (window.UM) !== 'object' ) {
|
||||
window.UM = {};
|
||||
}
|
||||
|
||||
if ( typeof (window.UM.admin) !== 'object' ) {
|
||||
window.UM.admin = {};
|
||||
}
|
||||
|
||||
UM.admin.builder = {
|
||||
deleteProcess: [],
|
||||
fieldsToDelete: [],
|
||||
}
|
||||
|
||||
function UM_Drag_and_Drop() {
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
||||
items: '.um-admin-drag-fld',
|
||||
connectWith: '.um-admin-drag-col,.um-admin-drag-group',
|
||||
placeholder: "um-fld-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
update: function(event, ui){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
if ( ui.item.hasClass('um-field-type-group') && ui.item.parents('.um-field-type-group').length > 0 ) {
|
||||
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable('cancel');
|
||||
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
|
||||
} else {
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-rowsubs').sortable({
|
||||
items: '.um-admin-drag-rowsub',
|
||||
placeholder: "um-rowsub-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_subrows();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-rowsub').sortable({
|
||||
items: '.um-admin-drag-col',
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
row = jQuery(this);
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-ajax').sortable({
|
||||
items: '.um-admin-drag-row',
|
||||
handle: ".um-admin-drag-row-start",
|
||||
zIndex: 9999999999,
|
||||
placeholder: "um-row-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
out: function(){
|
||||
UM.common.tipsy.hide();
|
||||
},
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_rows();
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
}
|
||||
|
||||
function UM_update_rows() {
|
||||
var c = 0;
|
||||
jQuery('a[data-remove_element="um-admin-drag-row"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-row-icons').append( '<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_update_subrows(){
|
||||
jQuery('a[data-remove_element="um-admin-drag-rowsub"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c = 0;
|
||||
jQuery(this).find('.um-admin-drag-rowsub').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-rowsub-icons').append('<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Col(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
cols = jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length;
|
||||
col = jQuery(this).parents('.um-admin-drag-col');
|
||||
if ( col.hasClass('cols-last') ) {
|
||||
if ( cols == 1 ) {
|
||||
saved_col = 1;
|
||||
}
|
||||
if ( cols == 3 ) {
|
||||
saved_col = 3;
|
||||
} else if ( cols == 2 ) {
|
||||
saved_col = 2;
|
||||
}
|
||||
} else if ( col.hasClass('cols-middle') && cols == 3 ) {
|
||||
saved_col = 2;
|
||||
} else {
|
||||
saved_col = 1;
|
||||
}
|
||||
|
||||
jQuery(this).data('column', saved_col);
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Grp(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld:not(.um-field-type-group)').each(function(){
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length == 0 ){
|
||||
jQuery(this).data('group', '');
|
||||
} else {
|
||||
jQuery(this).data('group', jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key') );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Rows_Refresh(){
|
||||
|
||||
jQuery('.um_update_order_fields').empty();
|
||||
|
||||
/* ROWS */
|
||||
var c = 0;
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
|
||||
row = jQuery(this);
|
||||
|
||||
col_num = '';
|
||||
row.find('.um-admin-drag-rowsub').each(function(){
|
||||
|
||||
subrow = jQuery(this);
|
||||
|
||||
subrow.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
subrow.find('.um-admin-drag-col').addClass('cols-' + subrow.find('.um-admin-drag-col').length );
|
||||
subrow.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( subrow.find('.um-admin-drag-col').length == 3 ) {subrow.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
if ( !col_num ) {
|
||||
col_num = subrow.find('.um-admin-drag-col').length;
|
||||
} else {
|
||||
col_num = col_num + ':' + subrow.find('.um-admin-drag-col').length;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowcols_'+c+'_cols" id="_um_rowcols_'+c+'_cols" value="'+col_num+'" />');
|
||||
|
||||
sub_rows_count = row.find('.um-admin-drag-rowsub').length;
|
||||
|
||||
var origin_id = jQuery(this).attr('data-original');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_row_'+c+'" id="_um_row_'+c+'" value="_um_row_'+c+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_roworigin_'+c+'_val" id="_um_roworigin_'+c+'_val" value="'+origin_id+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowsub_'+c+'_rows" id="_um_rowsub_'+c+'_rows" value="'+sub_rows_count+'" />');
|
||||
|
||||
jQuery(this).attr('data-original', '_um_row_'+c );
|
||||
|
||||
});
|
||||
|
||||
/* FIELDS */
|
||||
var order;
|
||||
order = 0;
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
|
||||
if ( !jQuery(this).hasClass('group') ) {
|
||||
var group = jQuery(this).data('group');
|
||||
if ( group != '' ) {
|
||||
if ( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group').find( jQuery(this) ).length == 0 ) {
|
||||
jQuery(this).appendTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
} else {
|
||||
//jQuery(this).prependTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
}
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="'+group+'" />');
|
||||
} else {
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="" />');
|
||||
}
|
||||
}
|
||||
|
||||
order++;
|
||||
|
||||
row = jQuery(this).parents('.um-admin-drag-row').index()+1;
|
||||
row = '_um_row_'+row;
|
||||
|
||||
saved_col = jQuery(this).data('column');
|
||||
|
||||
if ( saved_col == 3 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(2)') );
|
||||
}
|
||||
if ( saved_col == 2 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(1)') );
|
||||
}
|
||||
|
||||
sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_position_'+jQuery(this).data('key')+'" id="um_position_'+jQuery(this).data('key')+'" value="'+order+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_row_'+jQuery(this).data('key')+'" id="um_row_'+jQuery(this).data('key')+'" value="'+row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_subrow_'+jQuery(this).data('key')+'" id="um_subrow_'+jQuery(this).data('key')+'" value="'+sub_row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_col_'+jQuery(this).data('key')+'" id="um_col_'+jQuery(this).data('key')+'" value="'+saved_col+'" />');
|
||||
|
||||
});
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
UM_Add_Icon();
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: jQuery( '.um_update_order' ).serialize(),
|
||||
success: function(){
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function UM_Add_Icon(){
|
||||
|
||||
var add_icon_html = '<a href="#" class="um-admin-drag-add-field um-tip-n" title="Add Field" data-modal="UM_fields" data-modal-size="normal" data-dynamic-content="um_admin_show_fields" data-arg2="'+jQuery('.um-admin-drag-ajax').data('form_id')+'" data-arg1=""><i class="um-icon-plus"></i></a>';
|
||||
|
||||
jQuery('.um-admin-drag-col').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-group').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
if ( !jQuery('.um-admin-drag').length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
/* add field to respected area */
|
||||
jQuery( document.body ).on('click', 'a.um-admin-drag-add-field', function() {
|
||||
in_row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
in_sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 1 ) {
|
||||
in_column = 1;
|
||||
} else {
|
||||
if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-middle')){
|
||||
in_column = 2;
|
||||
} else if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-last') ) {
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 3 ) {
|
||||
in_column = 3;
|
||||
} else {
|
||||
in_column = 2;
|
||||
}
|
||||
} else {
|
||||
in_column = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length ) {
|
||||
in_group = jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key');
|
||||
} else {
|
||||
in_group = '';
|
||||
}
|
||||
|
||||
jQuery('.um-col-demon-settings').data('in_row', in_row);
|
||||
jQuery('.um-col-demon-settings').data('in_sub_row', in_sub_row);
|
||||
jQuery('.um-col-demon-settings').data('in_column', in_column);
|
||||
jQuery('.um-col-demon-settings').data('in_group', in_group);
|
||||
});
|
||||
|
||||
/* add row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_row"]', function(){
|
||||
var dragg = jQuery('.um-admin-drag-ajax');
|
||||
dragg.append( '<div class="um-admin-drag-row">' + jQuery('.um-col-demon-row').html() + '</div>' );
|
||||
dragg.find('.um-admin-drag-row:last').find('.um-admin-drag-row-icons').find('a.um-admin-drag-row-edit').attr('data-arg3', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
dragg.find('.um-admin-drag-row:last').attr('data-original', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
UM_update_rows();
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* add sub row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_subrow"]', function(){
|
||||
var dragg = jQuery(this).parents('.um-admin-drag-row').find('.um-admin-drag-rowsubs');
|
||||
dragg.append( '<div class="um-admin-drag-rowsub">' + jQuery('.um-col-demon-subrow').html() + '</div>' );
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* remove element: Row, Subrow */
|
||||
jQuery(document.body).on('click', 'a[data-remove_element^="um-"]',function(){
|
||||
let deleteButton = jQuery(this);
|
||||
let element = jQuery(this).data('remove_element');
|
||||
let loadingWrapper = jQuery(this).parents('.' + element ).children('.um-admin-row-loading');
|
||||
|
||||
let row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
let subrow = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
let fieldPosition= {row,subrow};
|
||||
let deleteExists= false;
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
deleteExists = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if ( deleteExists ) {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingWrapper.show();
|
||||
|
||||
UM.admin.builder.deleteProcess.push({row,subrow});
|
||||
|
||||
UM.admin.builder.fieldsToDelete = jQuery(this).parents('.' +element).find('.um-admin-drag-fld').toArray();
|
||||
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
um_builder_delete_field_ajax( function () {
|
||||
UM.common.tipsy.hide();
|
||||
deleteButton.parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
} );
|
||||
} else {
|
||||
UM.common.tipsy.hide();
|
||||
jQuery(this).parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
}
|
||||
});
|
||||
|
||||
/* dynamically change columns */
|
||||
jQuery(document.body).on('click', '.um-admin-drag-ctrls.columns a', function(){
|
||||
|
||||
var row = jQuery(this).parents('.um-admin-drag-rowsub');
|
||||
var tab = jQuery(this);
|
||||
var tabs = jQuery(this).parent();
|
||||
tabs.find('a').removeClass('active');
|
||||
tab.addClass('active');
|
||||
var existing_cols = row.find('.um-admin-drag-col').length;
|
||||
var required_cols = tab.data('cols');
|
||||
var needed_cols = required_cols - existing_cols;
|
||||
|
||||
if ( needed_cols > 0 ) {
|
||||
|
||||
for (i = 0; i < needed_cols; i++){
|
||||
row.find('.um-admin-drag-col-dynamic').append('<div class="um-admin-drag-col"></div>');
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
} else if ( needed_cols < 0 ) {
|
||||
|
||||
needed_cols = needed_cols + 3;
|
||||
if ( needed_cols == 2 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
}
|
||||
if ( needed_cols == 1 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-middle').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
row.find('.um-admin-drag-col.cols-middle').remove();
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col:visible').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
}
|
||||
|
||||
if ( allow_update_via_col_click == true ) {
|
||||
UM_Change_Field_Col();
|
||||
UM_Rows_Refresh();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/* trigger columns at start */
|
||||
allow_update_via_col_click = false;
|
||||
jQuery('.um-admin-drag-ctrls.columns a.active').each(function(){
|
||||
jQuery(this).trigger('click');
|
||||
}).promise().done( function(){ allow_update_via_col_click = true; } );
|
||||
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
@@ -1,109 +0,0 @@
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/* Remove field permanently */
|
||||
jQuery(document.body).on('click', '.um-admin-btns a span.remove', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if ( confirm( wp.i18n.__( 'This will permanently delete this custom field from a database and from all forms on your site. Are you sure?', 'ultimate-member' ) ) ) {
|
||||
|
||||
jQuery(this).parents('a').remove();
|
||||
|
||||
var arg1 = jQuery(this).parents('a').data('arg1');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field_global',
|
||||
arg1 : arg1,
|
||||
nonce: um_admin_scripts.nonce
|
||||
|
||||
},
|
||||
success: function(data) {
|
||||
jQuery('#um-admin-form-builder .' + arg1).remove();
|
||||
},
|
||||
error: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
/* Add a Field */
|
||||
jQuery(document.body).on('submit', 'form.um_add_field', function(e){
|
||||
e.preventDefault();
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
//need fields refactor
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
if ( jQuery( this ).find('[id^="_conditional_action"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_field"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').val() ==='' )
|
||||
{
|
||||
jQuery(conditions[i]).find('.um-admin-remove-condition').trigger('click');
|
||||
}
|
||||
} );
|
||||
conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
var id = i === 0 ? '' : i;
|
||||
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
var form = jQuery(this);
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form.serialize(),
|
||||
beforeSend: function(){
|
||||
form.css({'opacity': 0.5});
|
||||
jQuery('.um-admin-error').removeClass('um-admin-error');
|
||||
form.find('.um-admin-error-block').hide();
|
||||
form.find('.um-admin-success-block').hide();
|
||||
},
|
||||
complete: function(){
|
||||
form.css({'opacity': 1});
|
||||
},
|
||||
success: function( response ){
|
||||
if ( response.success ) {
|
||||
let data = response.data;
|
||||
if ( data.error ) {
|
||||
let c = 0;
|
||||
jQuery.each( data.error, function(i, v){
|
||||
c++;
|
||||
if ( 1 === c ) {
|
||||
form.find('#' + i).addClass('um-admin-error').trigger('focus');
|
||||
form.find('.um-admin-error-block').show().html(v);
|
||||
}
|
||||
});
|
||||
|
||||
um_admin_modal_responsive();
|
||||
} 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_update_builder();
|
||||
}
|
||||
} else {
|
||||
console.log( response );
|
||||
}
|
||||
},
|
||||
error: function( response ){
|
||||
console.log( response );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
@@ -228,115 +228,7 @@ function um_admin_modal_add_attr( id, value ) {
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/**
|
||||
disable link
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-builder a, .um-admin-modal a:not(.um-preview-upload)', function(e){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
toggle area
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-btn-toggle a', function(e){
|
||||
var content = jQuery(this).parent().find('.um-admin-btn-content');
|
||||
var link = jQuery(this);
|
||||
if ( content.is(':hidden') ) {
|
||||
content.show();
|
||||
link.find('i').removeClass().addClass('um-icon-minus');
|
||||
link.addClass('active');
|
||||
} else {
|
||||
content.hide();
|
||||
link.find('i').removeClass().addClass('um-icon-plus');
|
||||
link.removeClass('active');
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
clone a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-new-condition', function() {
|
||||
|
||||
if ( jQuery(this).hasClass('disabled') )
|
||||
return false;
|
||||
|
||||
var content = jQuery(this).parents('.um-admin-btn-content'),
|
||||
length = content.find('.um-admin-cur-condition').length;
|
||||
|
||||
if ( length < 5 ) {
|
||||
//content.find('select').select2('destroy');
|
||||
|
||||
var template = jQuery('.um-admin-btn-content').find('.um-admin-cur-condition-template').clone();
|
||||
template.find('input[type=text]').val('');
|
||||
template.find('select').val('');
|
||||
|
||||
template.appendTo( content );
|
||||
jQuery(template).removeClass("um-admin-cur-condition-template");
|
||||
jQuery(template).addClass("um-admin-cur-condition");
|
||||
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
} else {
|
||||
jQuery(this).addClass('disabled');
|
||||
alert( 'You already have 5 rules' );
|
||||
}
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
reset conditions
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-reset-conditions a', function(){
|
||||
var content = jQuery(this).parents('.um-admin-btn-content');
|
||||
content.find('.um-admin-cur-condition').slice(1).remove();
|
||||
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();
|
||||
});
|
||||
|
||||
/**
|
||||
remove a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-remove-condition', function(){
|
||||
var condition = jQuery(this).parents('.um-admin-cur-condition');
|
||||
jQuery('.um-admin-new-condition').removeClass('disabled');
|
||||
UM.common.tipsy.hide();
|
||||
condition.remove();
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
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();
|
||||
});
|
||||
|
||||
/**
|
||||
remove modal via action
|
||||
@@ -375,15 +267,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
choose font icon
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-icons span', function(){
|
||||
var icon = jQuery(this).attr('data-code');
|
||||
jQuery(this).parent().find('span').removeClass('highlighted');
|
||||
jQuery(this).addClass('highlighted');
|
||||
jQuery('#UM_fonticons').find('a.um-admin-modal-back').attr("data-code", icon);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
submit font icon
|
||||
@@ -436,41 +320,5 @@ jQuery(document).ready(function() {
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve options from a callback function
|
||||
*/
|
||||
jQuery(document.body).on('blur',"#_custom_dropdown_options_source", function(){
|
||||
var me = jQuery(this);
|
||||
var _options = jQuery('textarea[id=_options]');
|
||||
|
||||
if( me.val() != '' ){
|
||||
var um_option_callback = me.val();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_populate_dropdown_options',
|
||||
um_option_callback: um_option_callback,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
complete: function(){
|
||||
|
||||
},
|
||||
success: function( response ){
|
||||
var arr_opts = [];
|
||||
|
||||
for (var key in response.data ){
|
||||
arr_opts.push( response.data[ key ] );
|
||||
}
|
||||
|
||||
_options.val( arr_opts.join('\n') );
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}); // end jQuery(document).ready
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
jQuery( document ).ready( function() {
|
||||
|
||||
|
||||
/**
|
||||
* Licenses
|
||||
*/
|
||||
jQuery( document.body ).on( 'click', '.um_license_deactivate', function() {
|
||||
jQuery(this).siblings('.um-option-field').val('');
|
||||
if ( jQuery(this).siblings('#submit').length ) {
|
||||
// clear = true for passing the empty field value to the license form submission
|
||||
jQuery(this).siblings('#submit').trigger('click',[ true ]);
|
||||
} else {
|
||||
jQuery(this).parents('form.um-settings-form').trigger('submit');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
jQuery( document.body ).on( 'click', '.um-settings-form #submit', function( e, clear ) {
|
||||
if ( ! clear && '' === jQuery(this).siblings('.um-option-field').val() ) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Not licenses page
|
||||
*/
|
||||
if ( jQuery( '#licenses_settings' ).length === 0 ) {
|
||||
var changed = false;
|
||||
|
||||
jQuery( 'input, textarea, select' ).on('change', function() {
|
||||
changed = true;
|
||||
});
|
||||
|
||||
jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).on( 'click', function() {
|
||||
if ( changed ) {
|
||||
window.onbeforeunload = function() {
|
||||
return wp.i18n.__( 'Are sure, maybe some settings not saved', 'ultimate-member' );
|
||||
};
|
||||
} else {
|
||||
window.onbeforeunload = '';
|
||||
}
|
||||
});
|
||||
|
||||
jQuery( '.submit input' ).on( 'click', function() {
|
||||
window.onbeforeunload = '';
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -65,12 +65,8 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
|
||||
add_action( 'admin_head', array( &$this, 'admin_head' ), 9 );
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
||||
|
||||
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
|
||||
|
||||
add_action( 'load-customize.php', array( &$this, 'navmenu_scripts' ) );
|
||||
add_action( 'load-edit.php', array( &$this, 'posts_page' ) );
|
||||
|
||||
@@ -295,7 +291,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -305,6 +300,14 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
$this->register_jquery_ui();
|
||||
|
||||
// Scripts for frontend preview.
|
||||
UM()->frontend()->enqueue()->load_css();
|
||||
UM()->frontend()->enqueue()->load_modal();
|
||||
UM()->frontend()->enqueue()->load_responsive();
|
||||
|
||||
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
|
||||
//scripts for FRONTEND PREVIEW
|
||||
wp_register_script( 'um_jquery_form', $this->front_js_baseurl . 'um-jquery-form' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_fileupload', $this->front_js_baseurl . 'um-fileupload.js', array( 'jquery' ), UM_VERSION, true );
|
||||
@@ -346,48 +349,12 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter title placeholder
|
||||
*
|
||||
* @param $title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function enter_title_here( $title ) {
|
||||
$screen = get_current_screen();
|
||||
if ( 'um_directory' === $screen->post_type ) {
|
||||
$title = __( 'e.g. Member Directory', 'ultimate-member' );
|
||||
} elseif ( 'um_form' === $screen->post_type ) {
|
||||
$title = __( 'e.g. New Registration Form', 'ultimate-member' );
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs on admin head
|
||||
*/
|
||||
public function admin_head() {
|
||||
if ( UM()->admin()->screen()->is_own_post_type() ) { ?>
|
||||
<style type="text/css">
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#slugdiv,
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#minor-publishing,
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#screen-meta-links
|
||||
{display:none}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Forms
|
||||
*/
|
||||
public function load_forms() {
|
||||
$suffix = self::get_suffix();
|
||||
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
|
||||
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_localize_script(
|
||||
@@ -407,29 +374,26 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
);
|
||||
|
||||
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_enqueue_style( 'um_admin_forms' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load modal
|
||||
*/
|
||||
public function load_modal() {
|
||||
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css', array( 'wp-color-picker' ), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
$suffix = self::get_suffix();
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', array( 'jquery', 'editor', 'wp-util', 'wp-color-picker', 'wp-tinymce', 'wp-i18n', 'um_admin_common' ), ultimatemember_version, true );
|
||||
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_enqueue_script( 'um_admin_modal' );
|
||||
|
||||
wp_register_style( 'um_admin_modal', $css_url . 'admin/modal' . $suffix . '.css', array( 'wp-color-picker' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Field Processing
|
||||
*/
|
||||
public function load_field() {
|
||||
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', array( 'jquery', 'wp-util', 'wp-i18n' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_field' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Builder
|
||||
*/
|
||||
@@ -443,43 +407,10 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
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_enqueue_script( 'um_admin_builder' );
|
||||
|
||||
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_dragdrop' );
|
||||
|
||||
wp_register_style( 'um_admin_builder', $css_url . 'admin/builder' . $suffix . '.css', array( 'um_ui' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_builder' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load core WP styles/scripts
|
||||
*/
|
||||
public function load_core_wp() {
|
||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||
wp_enqueue_script( 'jquery-ui-sortable' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Admin Styles
|
||||
*/
|
||||
public function load_css() {
|
||||
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css', array(), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_columns' );
|
||||
|
||||
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css', array(), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_misc' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load functions js
|
||||
*/
|
||||
public function load_functions() {
|
||||
wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_functions' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global css
|
||||
*/
|
||||
@@ -517,15 +448,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_enqueue_style( 'um_admin_global' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load AJAX
|
||||
*/
|
||||
public function load_ajax_js() {
|
||||
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_ajax' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Gutenberg scripts
|
||||
*/
|
||||
@@ -567,7 +489,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
do_action( 'um_load_gutenberg_js' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add Gutenberg category for UM shortcodes.
|
||||
*
|
||||
@@ -606,37 +527,18 @@ 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_datetime', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION, true );
|
||||
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_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_enqueue_style( 'um_admin_common' );
|
||||
|
||||
/*if ( get_post_type() != 'shop_order' ) {
|
||||
UM()->enqueue()->wp_enqueue_scripts();
|
||||
}*/
|
||||
|
||||
// $modal_deps = array( 'um-admin-scripts' );
|
||||
if ( $this->um_cpt_form_screen ) {
|
||||
$this->load_builder();
|
||||
// $modal_deps[] = 'um-responsive';
|
||||
$this->load_modal();
|
||||
}
|
||||
|
||||
$this->load_functions();
|
||||
$this->load_forms();
|
||||
$this->load_modal();
|
||||
$this->load_field();
|
||||
$this->load_css();
|
||||
$this->load_core_wp();
|
||||
$this->load_ajax_js();
|
||||
|
||||
// Scripts for frontend preview.
|
||||
UM()->frontend()->enqueue()->load_css();
|
||||
UM()->frontend()->enqueue()->load_modal();
|
||||
UM()->frontend()->enqueue()->load_responsive();
|
||||
|
||||
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
|
||||
if ( is_rtl() ) {
|
||||
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css', array(), ultimatemember_version );
|
||||
@@ -647,6 +549,8 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
if ( 'users.php' === $hook ) {
|
||||
wp_register_style( 'um_admin_users', $css_url . 'admin/users' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_users' );
|
||||
|
||||
$this->load_modal();
|
||||
} elseif ( 'user-new.php' === $hook || 'user-edit.php' === $hook ) {
|
||||
wp_register_script( 'um_admin_role_wrapper', $js_url . 'admin/user' . $suffix . '.js', array( 'jquery', 'wp-hooks' ), UM_VERSION, true );
|
||||
$localize_roles_data = get_option( 'um_roles', array() );
|
||||
|
||||
@@ -71,6 +71,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
add_action( 'admin_head', array( &$this, 'admin_head' ), 9 );
|
||||
add_action( 'admin_footer', array( &$this, 'load_modal_content' ), 9 );
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'remove_meta_box' ), 0 );
|
||||
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ), 10, 2 );
|
||||
|
||||
add_action( 'load-post.php', array( &$this, 'add_metabox' ), 9 );
|
||||
add_action( 'load-post-new.php', array( &$this, 'add_metabox' ), 9 );
|
||||
|
||||
@@ -85,6 +88,34 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
add_filter( 'um_member_directory_meta_value_before_save', array( UM()->member_directory(), 'before_save_data' ), 10, 3 );
|
||||
}
|
||||
|
||||
public function remove_meta_box() {
|
||||
remove_meta_box( 'submitdiv', 'um_form', 'core' );
|
||||
remove_meta_box( 'slugdiv', 'um_form', 'core' );
|
||||
|
||||
remove_meta_box( 'submitdiv', 'um_directory', 'core' );
|
||||
remove_meta_box( 'slugdiv', 'um_directory', 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter title placeholder
|
||||
*
|
||||
* @param string $title
|
||||
* @param WP_Post $post
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function enter_title_here( $title, $post ) {
|
||||
if ( ! isset( $post->post_type ) ) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
if ( 'um_directory' === $post->post_type ) {
|
||||
$title = __( 'e.g. Member Directory', 'ultimate-member' );
|
||||
} elseif ( 'um_form' === $post->post_type ) {
|
||||
$title = __( 'e.g. New Registration Form', 'ultimate-member' );
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide Woocommerce Shop page restrict content metabox
|
||||
@@ -161,13 +192,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
global $current_screen;
|
||||
|
||||
if ( $current_screen->id == 'um_form' ) {
|
||||
add_action( 'add_meta_boxes', array(&$this, 'add_metabox_form'), 1 );
|
||||
add_action( 'save_post', array(&$this, 'save_metabox_form'), 10, 2 );
|
||||
add_action( 'add_meta_boxes', array( &$this, 'add_metabox_form' ), 1 );
|
||||
add_action( 'save_post', array( &$this, 'save_metabox_form' ), 10, 2 );
|
||||
}
|
||||
|
||||
if ( $current_screen->id == 'um_directory' ) {
|
||||
add_action( 'add_meta_boxes', array(&$this, 'add_metabox_directory'), 1 );
|
||||
add_action( 'save_post', array(&$this, 'save_metabox_directory'), 10, 2 );
|
||||
add_action( 'add_meta_boxes', array( &$this, 'add_metabox_directory' ), 1 );
|
||||
add_action( 'save_post', array( &$this, 'save_metabox_directory' ), 10, 2 );
|
||||
}
|
||||
|
||||
//restrict content metabox
|
||||
@@ -825,14 +856,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
/**
|
||||
* Add directory metabox
|
||||
*/
|
||||
function add_metabox_directory() {
|
||||
public function add_metabox_directory() {
|
||||
add_meta_box('submitdiv', __( 'Publish', 'ultimate-member' ), array( &$this, 'custom_submitdiv' ), 'um_directory', 'side', 'high' );
|
||||
add_meta_box( 'um-admin-form-general', __( 'General Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-sorting', __( 'Sorting', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-profile', __( 'Profile Card', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-search', __( 'Search Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-pagination', __( 'Results & Pagination', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-shortcode', __( 'Shortcode', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'side', 'default' );
|
||||
add_meta_box( 'um-admin-form-appearance', __( 'Styling: General', 'ultimate-member' ), array( &$this, 'load_metabox_directory'), 'um_directory', 'side', 'default' );
|
||||
add_meta_box( 'um-admin-form-appearance', __( 'Styling: General', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'side', 'default' );
|
||||
}
|
||||
|
||||
|
||||
@@ -989,7 +1021,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
/**
|
||||
* Add form metabox
|
||||
*/
|
||||
function add_metabox_form() {
|
||||
public function add_metabox_form() {
|
||||
|
||||
add_meta_box( 'submitdiv', __( 'Publish', 'ultimate-member' ), array( $this, 'custom_submitdiv' ), 'um_form', 'side', 'high' );
|
||||
|
||||
add_meta_box( 'um-admin-form-mode', __( 'Select Form Type', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-builder', __( 'Form Builder', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
|
||||
@@ -1061,6 +1095,57 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
do_action( 'um_admin_custom_login_metaboxes' );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function custom_submitdiv() {
|
||||
global $post, $current_screen;
|
||||
?>
|
||||
|
||||
<div class="submitbox" id="submitpost">
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action( 'post_submitbox_start' ); ?>
|
||||
<div id="delete-action">
|
||||
<?php if ( current_user_can( 'delete_post', $post->ID ) ) {
|
||||
if ( ! EMPTY_TRASH_DAYS ) {
|
||||
$delete_text = __( 'Delete Permanently', 'ultimate-member' );
|
||||
} else {
|
||||
$delete_text = __( 'Move to Trash', 'ultimate-member' );
|
||||
} ?>
|
||||
<a class="submitdelete deletion" href="<?php echo esc_url( get_delete_post_link( $post->ID ) ); ?>"> <?php echo esc_html( $delete_text ); ?> </a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<span class="spinner"></span>
|
||||
<?php if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
|
||||
|
||||
$post_type = $post->post_type; // get current post_type
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
$can_publish = current_user_can( $post_type_object->cap->publish_posts );
|
||||
|
||||
if ( $can_publish ) { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Create', 'ultimate-member' ) ?>" />
|
||||
<?php submit_button( __( 'Create', 'ultimate-member' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
|
||||
<?php }
|
||||
} else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update', 'ultimate-member' ); ?>" />
|
||||
<?php submit_button( __( 'Update', 'ultimate-member' ), 'primary button-large', 'save', false, array( 'accesskey' => 'p' ) ); ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
if ( isset( $current_screen->base ) && 'post' === $current_screen->base && isset( $current_screen->action ) && 'add' === $current_screen->action ) {
|
||||
if ( isset( $_GET['um_mode'] ) ) {
|
||||
$mode = sanitize_key( $_GET['um_mode'] ); ?>
|
||||
<input type="hidden" name="form[_um_mode]" id="form__um_mode" value="<?php echo esc_attr( $mode ); ?>" />
|
||||
<?php }
|
||||
}?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Save directory metabox
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user