Version Description
- Fixed a problem with sidebar replacement on front page.
Download this release
Release Info
Developer | iworks |
Plugin | Custom Sidebars – Dynamic Widget Area Manager |
Version | 3.2.1 |
Comparing to | |
See all releases |
Code changes from version 3.2.0 to 3.2.1
- assets/css/cs-cloning.min.css +1 -5
- assets/css/cs-scan.css +2 -2
- assets/css/cs-scan.min.css +0 -4
- assets/css/cs-visibility.min.css +1 -5
- assets/css/cs.css +3 -3
- assets/css/cs.min.css +1 -5
- assets/js/cs-cloning.js +120 -128
- assets/js/cs-cloning.min.js +2 -2
- assets/js/cs-visibility.js +34 -34
- assets/js/cs-visibility.min.js +2 -2
- assets/js/cs.js +19 -19
- assets/js/cs.min.js +2 -2
- customsidebars.php +1 -1
- inc/class-custom-sidebars-editor.php +1 -1
- inc/class-custom-sidebars-replacer.php +1 -1
- inc/class-custom-sidebars-visibility.php +5 -5
- inc/class-custom-sidebars.php +1 -1
- languages/custom-sidebars.pot +46 -63
- readme.txt +5 -2
- views/import.php +14 -16
- views/metabox.php +1 -1
assets/css/cs-cloning.min.css
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
|
2 |
-
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
-
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
-
|
5 |
-
.inactive-sidebar .csb-clone{display:none}.widget-control-actions .csb-clone-button{margin:0 5px 0 0}.csb-marker{position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.3)}.csb-marker .widget-top,.csb-marker .widget-inside{opacity:.5}.csb-marker:before{content:attr(data-group);position:absolute;top:50%;left:5px;right:5px;text-align:center;margin-top:-1em;line-height:2em;height:2em;font-size:20px;z-index:1001;background:rgba(255,255,255,.2)}.csb-marker:after{content:'';position:absolute;left:1px;top:1px;right:1px;bottom:1px;background:url(../img/stripes.png);opacity:.05;z-index:1000;cursor:default}h4.csb-group{padding-left:45px;position:relative}h4 .btn-clone-group{position:absolute;top:50%;margin-top:-10px;left:15px;cursor:pointer;opacity:.6}h4 .btn-clone-group:hover{opacity:1}
|
1 |
+
.inactive-sidebar .csb-clone{display:none}.widget-control-actions .csb-clone-button{margin:0 5px 0 0}.csb-marker{position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.3)}.csb-marker .widget-inside,.csb-marker .widget-top{opacity:.5}.csb-marker:before{content:attr(data-group);position:absolute;top:50%;left:5px;right:5px;text-align:center;margin-top:-1em;line-height:2em;height:2em;font-size:20px;z-index:1001;background:rgba(255,255,255,.2)}.csb-marker:after{content:'';position:absolute;left:1px;top:1px;right:1px;bottom:1px;background:url(../img/stripes.png);opacity:.05;z-index:1000;cursor:default}h4.csb-group{padding-left:45px;position:relative}h4 .btn-clone-group{position:absolute;top:50%;margin-top:-10px;left:15px;cursor:pointer;opacity:.6}h4 .btn-clone-group:hover{opacity:1}
|
|
|
|
|
|
|
|
assets/css/cs-scan.css
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
.custom-sidebars-wp-checkup {
|
2 |
border-radius: 4px;
|
3 |
-ms-flex-align: center;
|
4 |
-
|
5 |
background: #fff url(../img/heart.png) no-repeat 0 50%;
|
6 |
border: 0;
|
7 |
display: -ms-flexbox;
|
@@ -9,7 +9,7 @@
|
|
9 |
min-height: 100px;
|
10 |
padding-left: 135px;
|
11 |
-ms-flex-pack: justify;
|
12 |
-
|
13 |
}
|
14 |
.custom-sidebars-wp-checkup form {
|
15 |
white-space: nowrap;
|
1 |
.custom-sidebars-wp-checkup {
|
2 |
border-radius: 4px;
|
3 |
-ms-flex-align: center;
|
4 |
+
align-items: center;
|
5 |
background: #fff url(../img/heart.png) no-repeat 0 50%;
|
6 |
border: 0;
|
7 |
display: -ms-flexbox;
|
9 |
min-height: 100px;
|
10 |
padding-left: 135px;
|
11 |
-ms-flex-pack: justify;
|
12 |
+
justify-content: space-between;
|
13 |
}
|
14 |
.custom-sidebars-wp-checkup form {
|
15 |
white-space: nowrap;
|
assets/css/cs-scan.min.css
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.0-beta.1
|
2 |
-
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
-
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
-
|
5 |
.custom-sidebars-wp-checkup{border-radius:4px;-ms-flex-align:center;align-items:center;background:#fff url(../img/heart.png) no-repeat 0 50%;border:0;display:-ms-flexbox;display:flex;min-height:100px;padding-left:135px;-ms-flex-pack:justify;justify-content:space-between}.custom-sidebars-wp-checkup form{white-space:nowrap}.custom-sidebars-wp-checkup form input{border:0;border-radius:4px}.custom-sidebars-wp-checkup form input[type=text]{background-color:#f2f2f2;padding:15px 14px}.custom-sidebars-wp-checkup form input[type=submit]{background-color:#17a8e3;color:#fff;padding:15px 35px;text-transform:uppercase;margin-left:10px}.custom-sidebars-wp-checkup p{font-size:1.2em}.custom-sidebars-wp-checkup p b{color:#840006}
|
|
|
|
|
|
|
|
|
1 |
.custom-sidebars-wp-checkup{border-radius:4px;-ms-flex-align:center;align-items:center;background:#fff url(../img/heart.png) no-repeat 0 50%;border:0;display:-ms-flexbox;display:flex;min-height:100px;padding-left:135px;-ms-flex-pack:justify;justify-content:space-between}.custom-sidebars-wp-checkup form{white-space:nowrap}.custom-sidebars-wp-checkup form input{border:0;border-radius:4px}.custom-sidebars-wp-checkup form input[type=text]{background-color:#f2f2f2;padding:15px 14px}.custom-sidebars-wp-checkup form input[type=submit]{background-color:#17a8e3;color:#fff;padding:15px 35px;text-transform:uppercase;margin-left:10px}.custom-sidebars-wp-checkup p{font-size:1.2em}.custom-sidebars-wp-checkup p b{color:#840006}
|
assets/css/cs-visibility.min.css
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
|
2 |
-
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
-
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
-
|
5 |
-
.inactive-sidebar .csb-visibility{display:none}.widget-control-actions .button{margin:0 0 0 5px}@media screen and (max-width:782px){.widget-control-actions .csb-visibility-button .dashicons{line-height:normal;height:auto;font-size:19px}}@media screen and (max-width:782px) and (max-width:400px){.widget-control-actions .csb-visibility-button .dashicons{display:none}}@media screen and (max-width:782px){.widget-control-actions .alignright,.widget-control-actions .alignleft{float:none}.widget-control-actions .alignright{padding-top:10px;text-align:right}.widget-control-actions .alignright .button{margin-bottom:5px}}.csb-visibility{margin:0 -15px 15px}.csb-option-row{margin:0 -15px;padding:0 15px 12px;position:relative}.csb-visibility-inner{border:1px solid #E5E5E5;border-left:0;border-right:0;padding:12px 15px 0;background:#FAFAFA}.csb-visibility-inner .toggle-action{display:block;margin:-15px -15px 0;padding:15px 15px 0;cursor:pointer;border:0}.csb-visibility-inner .csb-option-row:hover{background:#F4F4F4}.csb-visibility-inner .csb-option-row:hover.csb-always:hover{background:transparent}.csb-visibility-inner .csb-option-row.csb-action .action{top:15px}.csb-visibility-inner .csb-option-row .clear-filter:hover{color:#C00}.csb-visibility-inner .csb-option-row .action{position:absolute;right:15px;top:7px;z-index:1;color:#AAA;cursor:pointer;font-size:20px}.csb-visibility-inner .csb-option-row .action:hover{color:#000}.csb-visibility-inner .csb-action{margin-bottom:0}.csb-visibility-inner .csb-action label{cursor:default}.csb-visibility-inner .csb-action b{padding:5px;border:1px solid transparent;cursor:pointer;margin-left:-6px}.csb-visibility-inner .csb-action:hover b{padding:5px;background:#FFF;border:1px solid #DDD}.csb-visibility-inner .csb-always{padding-bottom:0;text-align:center;font-style:italic}.csb-visibility-inner .csb-always label{margin-bottom:0;color:#AAA;cursor:default}.csb-visibility-inner .csb-and{margin-right:10px;font-weight:700}.csb-visibility-inner label{display:block;border-top:1px solid #E8E8E8;margin:0 -15px 5px;padding:5px 15px}.csb-visibility-inner .csb-detail-row label{border:0;margin-bottom:0;padding-bottom:0}.csb-visibility-inner .csb-detail-row .detail{margin-top:10px}.csb-visibility-inner .chosen-container{display:block!important;width:100%!important}.csb-visibility-inner .dropdown{position:absolute;z-index:2;background:#FFF;border:1px solid #DDD;right:10px;top:20px;color:#555;box-shadow:0 1px 10px rgba(0,0,0,.15)}.csb-visibility-inner .dropdown li{padding:5px 15px;cursor:pointer;margin:0}.csb-visibility-inner .dropdown li:hover{color:#000;background:#EEE}.csb-visibility-inner .dropdown li.csb-group,.csb-visibility-inner .dropdown li.csb-group:hover{color:#999;font-weight:700;background:#F8F8F8;padding-left:5px;cursor:default}
|
1 |
+
.inactive-sidebar .csb-visibility{display:none}.widget-control-actions .button{margin:0 0 0 5px}@media screen and (max-width:782px){.widget-control-actions .csb-visibility-button .dashicons{line-height:normal;height:auto;font-size:19px}}@media screen and (max-width:782px) and (max-width:400px){.widget-control-actions .csb-visibility-button .dashicons{display:none}}@media screen and (max-width:782px){.widget-control-actions .alignleft,.widget-control-actions .alignright{float:none}.widget-control-actions .alignright{padding-top:10px;text-align:right}.widget-control-actions .alignright .button{margin-bottom:5px}}.csb-visibility{margin:0 -15px 15px}.csb-option-row{margin:0 -15px;padding:0 15px 12px;position:relative}.csb-visibility-inner{border:1px solid #e5e5e5;border-left:0;border-right:0;padding:12px 15px 0;background:#fafafa}.csb-visibility-inner .toggle-action{display:block;margin:-15px -15px 0;padding:15px 15px 0;cursor:pointer;border:0}.csb-visibility-inner .csb-option-row:hover{background:#f4f4f4}.csb-visibility-inner .csb-option-row:hover.csb-always:hover{background:0 0}.csb-visibility-inner .csb-option-row.csb-action .action{top:15px}.csb-visibility-inner .csb-option-row .clear-filter:hover{color:#c00}.csb-visibility-inner .csb-option-row .action{position:absolute;right:15px;top:7px;z-index:1;color:#aaa;cursor:pointer;font-size:20px}.csb-visibility-inner .csb-option-row .action:hover{color:#000}.csb-visibility-inner .csb-action{margin-bottom:0}.csb-visibility-inner .csb-action label{cursor:default}.csb-visibility-inner .csb-action b{padding:5px;border:1px solid transparent;cursor:pointer;margin-left:-6px}.csb-visibility-inner .csb-action:hover b{padding:5px;background:#fff;border:1px solid #ddd}.csb-visibility-inner .csb-always{padding-bottom:0;text-align:center;font-style:italic}.csb-visibility-inner .csb-always label{margin-bottom:0;color:#aaa;cursor:default}.csb-visibility-inner .csb-and{margin-right:10px;font-weight:700}.csb-visibility-inner label{display:block;border-top:1px solid #e8e8e8;margin:0 -15px 5px;padding:5px 15px}.csb-visibility-inner .csb-detail-row label{border:0;margin-bottom:0;padding-bottom:0}.csb-visibility-inner .csb-detail-row .detail{margin-top:10px}.csb-visibility-inner .chosen-container{display:block!important;width:100%!important}.csb-visibility-inner .dropdown{position:absolute;z-index:2;background:#fff;border:1px solid #ddd;right:10px;top:20px;color:#555;box-shadow:0 1px 10px rgba(0,0,0,.15)}.csb-visibility-inner .dropdown li{padding:5px 15px;cursor:pointer;margin:0}.csb-visibility-inner .dropdown li:hover{color:#000;background:#eee}.csb-visibility-inner .dropdown li.csb-group,.csb-visibility-inner .dropdown li.csb-group:hover{color:#999;font-weight:700;background:#f8f8f8;padding-left:5px;cursor:default}
|
|
|
|
|
|
|
|
assets/css/cs.css
CHANGED
@@ -299,9 +299,9 @@
|
|
299 |
display: -ms-flexbox;
|
300 |
display: flex;
|
301 |
-ms-flex-wrap: nowrap;
|
302 |
-
|
303 |
-ms-flex-pack: justify;
|
304 |
-
|
305 |
margin: 24px 30px 0 30px;
|
306 |
padding: 0;
|
307 |
}
|
@@ -323,7 +323,7 @@
|
|
323 |
.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text] {
|
324 |
color: #aaa;
|
325 |
-ms-flex-positive: 1;
|
326 |
-
|
327 |
}
|
328 |
.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active {
|
329 |
box-shadow: none;
|
299 |
display: -ms-flexbox;
|
300 |
display: flex;
|
301 |
-ms-flex-wrap: nowrap;
|
302 |
+
flex-wrap: nowrap;
|
303 |
-ms-flex-pack: justify;
|
304 |
+
justify-content: space-between;
|
305 |
margin: 24px 30px 0 30px;
|
306 |
padding: 0;
|
307 |
}
|
323 |
.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text] {
|
324 |
color: #aaa;
|
325 |
-ms-flex-positive: 1;
|
326 |
+
flex-grow: 1;
|
327 |
}
|
328 |
.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active {
|
329 |
box-shadow: none;
|
assets/css/cs.min.css
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.0-beta.1
|
2 |
-
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
-
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
-
|
5 |
-
.module-export .pro-layer{position:absolute;left:0;top:0;right:0;bottom:0;z-index:99999;background:rgba(255,255,255,.8);text-align:center;font-size:26px;font-weight:100;padding-top:120px;line-height:1.5}.module-export .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.module-export .pro-layer a:hover,.module-export .pro-layer a:focus,.module-export .pro-layer a:active{background:#1E8CBE;color:#FFF}.frm-location .pro-layer{padding:10px;text-align:center;font-size:26px;font-weight:100;line-height:1.5}.frm-location .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.frm-location .pro-layer a:hover,.frm-location .pro-layer a:focus,.frm-location .pro-layer a:active{background:#1E8CBE;color:#FFF}.frm-location table.form-table{margin-bottom:10px}.frm-location table.form-table td,.frm-location table.form-table th{padding:5px}.frm-location table.form-table td.num .dashicons-trash{cursor:pointer;color:#a00}.frm-location table.form-table .num{width:3em;text-align:center}.csb-pro-layer{float:left;position:relative;opacity:.5;margin-right:10px}.csb-pro-layer .pro-info{position:absolute;left:0;top:0;right:0;bottom:0;opacity:0;background:rgba(96,96,96,.75);z-index:99999;text-align:center;text-decoration:none;line-height:28px;font-size:16px;font-weight:100;color:#FFF;text-decoration:underline;padding:0;margin:0;overflow:hidden}.csb-pro-layer:hover{opacity:1}.csb-pro-layer:hover .pro-info,.csb-pro-layer:hover .pro-info:hover,.csb-pro-layer:hover .pro-info:active,.csb-pro-layer:hover .pro-info:focus{line-height:48px;left:-10px;top:-10px;right:-5px;bottom:-10px;opacity:1}.csb-pro-layer .button{margin:0 5px 0 0;float:left}.csb-pro-layer .button .dashicons{line-height:26px;height:26px;float:left;margin-right:6px}#defaultsidebarspage p.submit{padding:0 0 10px;clear:both}#poststuff.defaultsdetailscontainer h2{border-bottom:0;margin-bottom:5px}#defaultsforposts,#defaultsforpages{padding:0 10px;background:#fcfcfc;overflow:hidden}.defaultsSelector{margin-bottom:30px}.cscolright{clear:right;float:right;margin:0;overflow:hidden;padding:0;width:49%}.cscolleft{margin:0;overflow:hidden;padding:0;width:49%}.widgets-php .widget-liquid-left{width:100%}.widgets-php .cs-wrap .widget-liquid-right .widget.open{z-index:9999!important}.widgets-php .widget-liquid-right{padding:0 0 75px;margin:-10px -214% 0 0;width:210%;background:#e4e4e4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:480px){.widgets-php .widget-liquid-right{width:100%}}.widgets-php .widget-liquid-right #widgets-right{margin:20px}.widgets-php .widget-liquid-right .overview{list-style:none;position:absolute;left:0;top:0;width:auto;right:0;padding-left:20px;border-left:1px solid #DDD}.widgets-php #wpcontent{position:relative}.widgets-php #wpcontent .wrap .cs-wrap{margin-right:68%;padding-top:1em;position:relative}@media screen and (max-width:480px){.widgets-php #wpcontent .wrap .cs-wrap{position:static;margin:0}}.widgets-php #wpcontent #screen-meta-links{position:relative;z-index:10}.widgets-php #wpcontent #screen-meta{position:relative;z-index:10}.widgets-php #widgets-left{margin-right:0!important}.widgets-php #footer{background:#fff;margin-right:0;padding-right:20px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new{background-color:#fff;padding:15px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new p{border-radius:4px;border:3px dashed #ddd;color:#777;cursor:pointer;font-weight:700;margin:0;padding:90px 10px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-box{border-radius:4px;margin:55px 0 16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront{background-color:#f9c200}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner{min-height:145px;margin-right:-16px;background:url(../img/devman.png) no-repeat 100% 50%;padding:50px 120px 45px 20px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p{font-size:1.4em;color:#000;margin-top:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p:last-of-type{margin-bottom:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner .button{background-color:#00a7e6;color:#fff;font-weight:700;height:auto;padding:15px 16px;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup{background-color:#fff}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner{background:url(../img/hand-with-heart.png) no-repeat 100% 100%;font-size:1.2em;min-height:227px;padding-bottom:10px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4,.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{margin:0;padding:0 120px 0 30px;font-size:1.1em}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4{color:#222;font-size:1.2em;padding-top:50px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{color:#c1272c;padding-top:16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{border-radius:4px;background-color:#fafafa;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;margin:24px 30px 0;padding:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input{background-color:transparent;border:0;font-size:1em;margin:0;padding:10px 15px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:0 4px 4px 0;background-color:#00a7e6;color:#fff;min-width:3em;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{color:#aaa;-ms-flex-positive:1;flex-grow:1}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active{box-shadow:none}@media screen and (max-width:590px){.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{background-color:transparent;display:block}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{background-color:#fafafa}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:4px;display:block;margin:10px 0 0 auto;width:auto}}#cs-options .cs-action{line-height:26px;margin-right:20px}#cs-options .cs-action.btn-export{white-space:nowrap}#cs-options .cs-filter{float:right}@media screen and (max-width:700px){#cs-options .cs-filter{float:none;margin-top:5px}}.sidebar-form{margin:0 15px}.sidebar-form label{display:block}.sidebar-form .submit{text-align:right;margin:0;padding:1em 0}.sidebar-form .description{margin-top:5px;text-align:right}.sidebar_name,.sidebar_description{width:100%}div#widgets-right .sidebar-name>h3{padding:15px}div#widgets-right .widgets-sortables .sidebar-name>h3{padding:15px 7px}.widgets-holder-wrap.closed>div:nth-child(2){display:none}#defaultsidebarspage .hndle{cursor:pointer}#customsidebarspage #col-right{width:62%}.widgets_access .widget-liquid-right{position:static}#oldbrowsererror{display:none}#defaultsidebarspage .postbox{position:static}#defaultsidebarspage .inside{position:static}body.appearance_page_customsidebars .wrap h2{float:none}body.appearance_page_customsidebars #poststuff h2{margin-top:0}.widget.ui-draggable-dragging{z-index:10001!important}.csb-more-content{display:none}.csb-has-more .csb-more-content{display:block}#cs-widgets-extra{display:none}#cs-title-options{zoom:1;background:#E8E8E8;margin:-20px -20px 0 -20px;padding:10px 20px 20px;border-bottom:1px solid #DDD}.cs-title h3{font-weight:100}.cs-title h3 .cs-icon{margin-left:10px;color:#999}.replaceable{position:relative}.replaceable .replace-marker{position:absolute;left:0;top:0;bottom:0;width:5px;margin:0 5px 0 0;border-left:2px solid #05c944;z-index:10}.replaceable .replace-marker:hover:before{content:attr(data-label);background:#333;color:#EEE;font-size:13px;white-space:nowrap;padding:5px;position:absolute;top:7px;right:13px;line-height:20px}.replaceable .replace-marker:hover:after{content:'';position:absolute;top:16px;right:3px;border:6px solid transparent;border-left-color:#333}.cs-message{margin:.5em 0;padding:10px;position:absolute;left:0;right:0;box-shadow:0 1px 10px rgba(0,0,0,.2);z-index:100}.cs-message .close{position:absolute;top:.5em;right:.5em;opacity:.3;color:#000;cursor:pointer;text-decoration:none;font-size:14px;line-height:26px;width:26px;text-align:center;background:rgba(0,0,0,.1)}.cs-message .close:hover,.cs-message .close:focus,.cs-message .close:active{opacity:1}.cs-update{background:#ffffe0;border:1px solid #E6DB55}.cs-error{background:#FFEBE8;border:1px solid #C00}.cs-toolbar{color:#333;padding:0;background:#FCFCFC;border-top:1px solid #E5E5E5}.cs-toolbar:after{display:table;content:'';clear:both}.closed .cs-toolbar{display:none}.cs-toolbar .cs-tool{text-decoration:none;line-height:40px;height:40px;padding:0 10px;white-space:nowrap;background:#FFF;position:relative;overflow:hidden}.cs-toolbar .dashicons{line-height:40px}.cs-toolbar .cs-separator{border-left:1px solid #E5E5E5;width:1px;padding:0;margin:0;height:40px;overflow:hidden;display:inline-block;color:#ddd}.cs-custom-sidebar .cs-tool,.cs-custom-sidebar .cs-separator{float:right}.cs-theme-sidebar .cs-tool,.cs-theme-sidebar .cs-separator{float:left}.cs-toolbar .delete-sidebar{color:#a00}.cs-toolbar .delete-sidebar:hover,.cs-toolbar .delete-sidebar:focus,.cs-toolbar .delete-sidebar:active{color:red}.cs-toolbar .cs-tool.btn-replaceable{color:#555}.cs-toolbar .cs-tool.btn-replaceable:hover{color:#333!important}.replaceable .cs-toolbar .cs-tool.btn-replaceable{background:#edfff3;color:#333}.replace-tip-box{float:left}.replace-tip{width:200px}.csb .button{outline:0}.csb .button>.dashicons,.csb .button-primary>.dashicons,.csb .button-secondary>.dashicons{opacity:.75;line-height:26px;margin-right:5px;transition:opacity .2s}.csb .button:hover>.dashicons,.csb .button-primary:hover>.dashicons,.csb .button-secondary:hover>.dashicons{opacity:1}.rtl div.widget-liquid-right{float:left;right:auto;left:0}.rtl.widgets-php #wpcontent .wrap .cs-wrap{margin-right:2px;margin-left:68%}.rtl.widgets-php .widget-liquid-right{margin:-10px 0 0 -214%}.rtl.widgets-php #widgets-left{margin-left:0!important}.rtl.widgets-php.folded #wpcontent,.rtl.widgets-php.folded #wpfooter{margin-left:325px;margin-right:52px}.rtl #cs-title-options h2{margin-right:5px}.rtl #cs-options .cs-filter{float:left}.rtl #cs-options .cs-action{margin-right:0;margin-left:20px}.rtl .sidebar-form .submit{text-align:left}.rtl #TB_ajaxWindowTitle{float:right}.rtl #TB_closeAjaxWindow{float:left}.csb-export-head{min-width:450px}.csb-export-head th{vertical-align:top;text-align:right;color:#679;width:150px}.csb-export-head tr:hover{background:#FAFAFA}.csb-export-head ul{margin:0}.csb-export-head .dashicons.hint{font-size:12px;line-height:22px}.csb-form{padding-left:15px}.csb-form h2,.csb-form h3,.csb-form .form-buttons,#poststuff .csb-form h2,#poststuff .csb-form h3,#poststuff .csb-form .form-buttons{padding-left:0;margin-left:-15px}.form-buttons{clear:both}.show-infos{position:relative;display:inline-block;margin:0 5px}h2 .show-infos{top:4px}.show-infos .export-infos{position:absolute;top:-5px;left:30px;font-size:13px;line-height:1.4em;font-weight:400;background:#FFF;box-shadow:0 1px 8px rgba(0,0,0,.2);border:3px solid #FAFAFA;padding:5px;z-index:10}.show-infos .export-infos:before,.show-infos .export-infos:after{content:'';position:absolute;left:-17px;top:5px;border:7px solid transparent;border-right-color:#FAFAFA;z-index:1}.show-infos .export-infos:after{left:-18px;top:5px;border-right-color:rgba(0,0,0,.15);z-index:0}.show-infos:hover .export-infos{display:block!important}.export-infos .section{font-weight:700;margin:10px 0 5px -2px;color:#666}.cs-half{float:left;width:49%;margin-right:1%}.cs-replaceable{margin-bottom:5px}.cs-replaceable>.details{display:none;margin:5px 0}.cs-replaceable.open>.details{display:block}.popup-content .message.no-sidebars{font-size:1.4em}@media screen and (max-width:480px){.wpmui-popup .buttons{height:80px;text-align:left}.wpmui-popup .buttons label{float:none;display:block;margin-bottom:.5em}.wpmui-popup .buttons .btn-save{float:right}}@media screen and (max-width:782px){#wpbody-content .wp-list-table.fixed .column-cs_replacement{display:none}}#wpbody-content .wp-list-table .column-cs_replacement{width:10%}#wpbody-content .wp-list-table .column-cs_replacement dt{opacity:.8;color:#666}#wpbody-content .wp-list-table .column-cs_replacement dd{margin-left:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit{border-top:1px solid #eee;margin-top:10px;padding-top:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit label span.title{display:block;float:left;min-width:5em;white-space:nowrap;padding-right:10px;width:auto}#wpbody-content .wp-list-table .inline-edit-row-page .inline-edit-col-right{float:right}
|
1 |
+
.module-export .pro-layer{position:absolute;left:0;top:0;right:0;bottom:0;z-index:99999;background:rgba(255,255,255,.8);text-align:center;font-size:26px;font-weight:100;padding-top:120px;line-height:1.5}.module-export .pro-layer a{margin-top:20px;display:inline-block;background:#2ea2cc;color:#fafafa;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.module-export .pro-layer a:active,.module-export .pro-layer a:focus,.module-export .pro-layer a:hover{background:#1e8cbe;color:#fff}.frm-location .pro-layer{padding:10px;text-align:center;font-size:26px;font-weight:100;line-height:1.5}.frm-location .pro-layer a{margin-top:20px;display:inline-block;background:#2ea2cc;color:#fafafa;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.frm-location .pro-layer a:active,.frm-location .pro-layer a:focus,.frm-location .pro-layer a:hover{background:#1e8cbe;color:#fff}.frm-location table.form-table{margin-bottom:10px}.frm-location table.form-table td,.frm-location table.form-table th{padding:5px}.frm-location table.form-table td.num .dashicons-trash{cursor:pointer;color:#a00}.frm-location table.form-table .num{width:3em;text-align:center}.csb-pro-layer{float:left;position:relative;opacity:.5;margin-right:10px}.csb-pro-layer .pro-info{position:absolute;left:0;top:0;right:0;bottom:0;opacity:0;background:rgba(96,96,96,.75);z-index:99999;text-align:center;text-decoration:none;line-height:28px;font-size:16px;font-weight:100;color:#fff;text-decoration:underline;padding:0;margin:0;overflow:hidden}.csb-pro-layer:hover{opacity:1}.csb-pro-layer:hover .pro-info,.csb-pro-layer:hover .pro-info:active,.csb-pro-layer:hover .pro-info:focus,.csb-pro-layer:hover .pro-info:hover{line-height:48px;left:-10px;top:-10px;right:-5px;bottom:-10px;opacity:1}.csb-pro-layer .button{margin:0 5px 0 0;float:left}.csb-pro-layer .button .dashicons{line-height:26px;height:26px;float:left;margin-right:6px}#defaultsidebarspage p.submit{padding:0 0 10px;clear:both}#poststuff.defaultsdetailscontainer h2{border-bottom:0;margin-bottom:5px}#defaultsforpages,#defaultsforposts{padding:0 10px;background:#fcfcfc;overflow:hidden}.defaultsSelector{margin-bottom:30px}.cscolright{clear:right;float:right;margin:0;overflow:hidden;padding:0;width:49%}.cscolleft{margin:0;overflow:hidden;padding:0;width:49%}.widgets-php .widget-liquid-left{width:100%}.widgets-php .cs-wrap .widget-liquid-right .widget.open{z-index:9999!important}.widgets-php .widget-liquid-right{padding:0 0 75px 0;margin:-10px -214% 0 0;width:210%;background:#e4e4e4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:480px){.widgets-php .widget-liquid-right{width:100%}}.widgets-php .widget-liquid-right #widgets-right{margin:20px}.widgets-php .widget-liquid-right .overview{list-style:none;position:absolute;left:0;top:0;width:auto;right:0;padding-left:20px;border-left:1px solid #ddd}.widgets-php #wpcontent{position:relative}.widgets-php #wpcontent .wrap .cs-wrap{margin-right:68%;padding-top:1em;position:relative}@media screen and (max-width:480px){.widgets-php #wpcontent .wrap .cs-wrap{position:static;margin:0}}.widgets-php #wpcontent #screen-meta-links{position:relative;z-index:10}.widgets-php #wpcontent #screen-meta{position:relative;z-index:10}.widgets-php #widgets-left{margin-right:0!important}.widgets-php #footer{background:#fff;margin-right:0;padding-right:20px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new{background-color:#fff;padding:15px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new p{border-radius:4px;border:3px dashed #ddd;color:#777;cursor:pointer;font-weight:700;margin:0;padding:90px 10px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-box{border-radius:4px;margin:55px 0 16px 0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront{background-color:#f9c200}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner{min-height:145px;margin-right:-16px;background:url(../img/devman.png) no-repeat 100% 50%;padding:50px 120px 45px 20px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p{font-size:1.4em;color:#000;margin-top:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p:last-of-type{margin-bottom:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner .button{background-color:#00a7e6;color:#fff;font-weight:700;height:auto;padding:15px 16px;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup{background-color:#fff}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner{background:url(../img/hand-with-heart.png) no-repeat 100% 100%;font-size:1.2em;min-height:227px;padding-bottom:10px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4,.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{margin:0;padding:0 120px 0 30px;font-size:1.1em}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4{color:#222;font-size:1.2em;padding-top:50px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{color:#c1272c;padding-top:16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{border-radius:4px;background-color:#fafafa;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;margin:24px 30px 0 30px;padding:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input{background-color:transparent;border:0;font-size:1em;margin:0;padding:10px 15px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:0 4px 4px 0;background-color:#00a7e6;color:#fff;min-width:3em;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{color:#aaa;-ms-flex-positive:1;flex-grow:1}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active{box-shadow:none}@media screen and (max-width:590px){.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{background-color:transparent;display:block}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{background-color:#fafafa}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:4px;display:block;margin:10px 0 0 auto;width:auto}}#cs-options .cs-action{line-height:26px;margin-right:20px}#cs-options .cs-action.btn-export{white-space:nowrap}#cs-options .cs-filter{float:right}@media screen and (max-width:700px){#cs-options .cs-filter{float:none;margin-top:5px}}.sidebar-form{margin:0 15px}.sidebar-form label{display:block}.sidebar-form .submit{text-align:right;margin:0;padding:1em 0}.sidebar-form .description{margin-top:5px;text-align:right}.sidebar_description,.sidebar_name{width:100%}div#widgets-right .sidebar-name>h3{padding:15px}div#widgets-right .widgets-sortables .sidebar-name>h3{padding:15px 7px}.widgets-holder-wrap.closed>div:nth-child(2){display:none}#defaultsidebarspage .hndle{cursor:pointer}#customsidebarspage #col-right{width:62%}.widgets_access .widget-liquid-right{position:static}#oldbrowsererror{display:none}#defaultsidebarspage .postbox{position:static}#defaultsidebarspage .inside{position:static}body.appearance_page_customsidebars .wrap h2{float:none}body.appearance_page_customsidebars #poststuff h2{margin-top:0}.widget.ui-draggable-dragging{z-index:10001!important}.csb-more-content{display:none}.csb-has-more .csb-more-content{display:block}#cs-widgets-extra{display:none}#cs-title-options{zoom:1;background:#e8e8e8;margin:-20px -20px 0 -20px;padding:10px 20px 20px;border-bottom:1px solid #ddd}.cs-title h3{font-weight:100}.cs-title h3 .cs-icon{margin-left:10px;color:#999}.replaceable{position:relative}.replaceable .replace-marker{position:absolute;left:0;top:0;bottom:0;width:5px;margin:0 5px 0 0;border-left:2px solid #05c944;z-index:10}.replaceable .replace-marker:hover:before{content:attr(data-label);background:#333;color:#eee;font-size:13px;white-space:nowrap;padding:5px;position:absolute;top:7px;right:13px;line-height:20px}.replaceable .replace-marker:hover:after{content:'';position:absolute;top:16px;right:3px;border:6px solid transparent;border-left-color:#333}.cs-message{margin:.5em 0;padding:10px;position:absolute;left:0;right:0;box-shadow:0 1px 10px rgba(0,0,0,.2);z-index:100}.cs-message .close{position:absolute;top:.5em;right:.5em;opacity:.3;color:#000;cursor:pointer;text-decoration:none;font-size:14px;line-height:26px;width:26px;text-align:center;background:rgba(0,0,0,.1)}.cs-message .close:active,.cs-message .close:focus,.cs-message .close:hover{opacity:1}.cs-update{background:#ffffe0;border:1px solid #e6db55}.cs-error{background:#ffebe8;border:1px solid #c00}.cs-toolbar{color:#333;padding:0;background:#fcfcfc;border-top:1px solid #e5e5e5}.cs-toolbar:after{display:table;content:'';clear:both}.closed .cs-toolbar{display:none}.cs-toolbar .cs-tool{text-decoration:none;line-height:40px;height:40px;padding:0 10px;white-space:nowrap;background:#fff;position:relative;overflow:hidden}.cs-toolbar .dashicons{line-height:40px}.cs-toolbar .cs-separator{border-left:1px solid #e5e5e5;width:1px;padding:0;margin:0;height:40px;overflow:hidden;display:inline-block;color:#ddd}.cs-custom-sidebar .cs-separator,.cs-custom-sidebar .cs-tool{float:right}.cs-theme-sidebar .cs-separator,.cs-theme-sidebar .cs-tool{float:left}.cs-toolbar .delete-sidebar{color:#a00}.cs-toolbar .delete-sidebar:active,.cs-toolbar .delete-sidebar:focus,.cs-toolbar .delete-sidebar:hover{color:red}.cs-toolbar .cs-tool.btn-replaceable{color:#555}.cs-toolbar .cs-tool.btn-replaceable:hover{color:#333!important}.replaceable .cs-toolbar .cs-tool.btn-replaceable{background:#edfff3;color:#333}.replace-tip-box{float:left}.replace-tip{width:200px}.csb .button{outline:0}.csb .button-primary>.dashicons,.csb .button-secondary>.dashicons,.csb .button>.dashicons{opacity:.75;line-height:26px;margin-right:5px;transition:opacity .2s}.csb .button-primary:hover>.dashicons,.csb .button-secondary:hover>.dashicons,.csb .button:hover>.dashicons{opacity:1}.rtl div.widget-liquid-right{float:left;right:auto;left:0}.rtl.widgets-php #wpcontent .wrap .cs-wrap{margin-right:2px;margin-left:68%}.rtl.widgets-php .widget-liquid-right{margin:-10px 0 0 -214%}.rtl.widgets-php #widgets-left{margin-left:0!important}.rtl.widgets-php.folded #wpcontent,.rtl.widgets-php.folded #wpfooter{margin-left:325px;margin-right:52px}.rtl #cs-title-options h2{margin-right:5px}.rtl #cs-options .cs-filter{float:left}.rtl #cs-options .cs-action{margin-right:0;margin-left:20px}.rtl .sidebar-form .submit{text-align:left}.rtl #TB_ajaxWindowTitle{float:right}.rtl #TB_closeAjaxWindow{float:left}.csb-export-head{min-width:450px}.csb-export-head th{vertical-align:top;text-align:right;color:#679;width:150px}.csb-export-head tr:hover{background:#fafafa}.csb-export-head ul{margin:0}.csb-export-head .dashicons.hint{font-size:12px;line-height:22px}.csb-form{padding-left:15px}#poststuff .csb-form .form-buttons,#poststuff .csb-form h2,#poststuff .csb-form h3,.csb-form .form-buttons,.csb-form h2,.csb-form h3{padding-left:0;margin-left:-15px}.form-buttons{clear:both}.show-infos{position:relative;display:inline-block;margin:0 5px}h2 .show-infos{top:4px}.show-infos .export-infos{position:absolute;top:-5px;left:30px;font-size:13px;line-height:1.4em;font-weight:400;background:#fff;box-shadow:0 1px 8px rgba(0,0,0,.2);border:3px solid #fafafa;padding:5px;z-index:10}.show-infos .export-infos:after,.show-infos .export-infos:before{content:'';position:absolute;left:-17px;top:5px;border:7px solid transparent;border-right-color:#fafafa;z-index:1}.show-infos .export-infos:after{left:-18px;top:5px;border-right-color:rgba(0,0,0,.15);z-index:0}.show-infos:hover .export-infos{display:block!important}.export-infos .section{font-weight:700;margin:10px 0 5px -2px;color:#666}.cs-half{float:left;width:49%;margin-right:1%}.cs-replaceable{margin-bottom:5px}.cs-replaceable>.details{display:none;margin:5px 0}.cs-replaceable.open>.details{display:block}.popup-content .message.no-sidebars{font-size:1.4em}@media screen and (max-width:480px){.wpmui-popup .buttons{height:80px;text-align:left}.wpmui-popup .buttons label{float:none;display:block;margin-bottom:.5em}.wpmui-popup .buttons .btn-save{float:right}}@media screen and (max-width:782px){#wpbody-content .wp-list-table.fixed .column-cs_replacement{display:none}}#wpbody-content .wp-list-table .column-cs_replacement{width:10%}#wpbody-content .wp-list-table .column-cs_replacement dt{opacity:.8;color:#666}#wpbody-content .wp-list-table .column-cs_replacement dd{margin-left:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit{border-top:1px solid #eee;margin-top:10px;padding-top:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit label span.title{display:block;float:left;min-width:5em;white-space:nowrap;padding-right:10px;width:auto}#wpbody-content .wp-list-table .inline-edit-row-page .inline-edit-col-right{float:right}
|
|
|
|
|
|
|
|
assets/js/cs-cloning.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global jQuery:false */
|
@@ -12,6 +12,97 @@ jQuery(function init_cloning() {
|
|
12 |
$all = jQuery( '#widgets-right' ),
|
13 |
is_cloning = false;
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Moves the "Clone" button next to the save button.
|
17 |
*/
|
@@ -38,13 +129,13 @@ jQuery(function init_cloning() {
|
|
38 |
*/
|
39 |
var update_group_counter = function update_group_counter( ev, el ) {
|
40 |
// We do NOT want to change the group-id when we clone a widget...
|
41 |
-
if ( is_cloning ) {
|
42 |
-
|
|
|
43 |
var $widget = jQuery( el ).closest( '.widget' ),
|
44 |
$widget_group = $widget.find( 'input.csb-clone-group' ),
|
45 |
group_id = parseInt( $widget_group.val() ),
|
46 |
check = null;
|
47 |
-
|
48 |
do {
|
49 |
check = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' );
|
50 |
if ( ! check.length || ( 1 === check.length && check[0] === $widget_group[0] ) ) {
|
@@ -59,19 +150,6 @@ jQuery(function init_cloning() {
|
|
59 |
update_template_groups();
|
60 |
};
|
61 |
|
62 |
-
/**
|
63 |
-
* Updates all group_id values for the widget-templates to the next free id.
|
64 |
-
*/
|
65 |
-
var update_template_groups = function update_template_groups() {
|
66 |
-
var $groups = jQuery( '#widgets-left input.csb-clone-group' ),
|
67 |
-
next_id = parseInt( $groups.first().val() );
|
68 |
-
|
69 |
-
while ( $all.find( 'input.csb-clone-group[value="' + next_id + '"]' ).length ) {
|
70 |
-
next_id += 1;
|
71 |
-
}
|
72 |
-
|
73 |
-
$groups.val( next_id );
|
74 |
-
};
|
75 |
|
76 |
/**
|
77 |
* Viually highlights all widgets of the same group.
|
@@ -97,41 +175,6 @@ jQuery(function init_cloning() {
|
|
97 |
$marked.removeClass('csb-marker');
|
98 |
};
|
99 |
|
100 |
-
/**
|
101 |
-
* Adds icons to all widgets that are inside a group.
|
102 |
-
*/
|
103 |
-
var init_group_icons = function init_group_icons() {
|
104 |
-
var $groups = $all.find( 'input.csb-clone-group' );
|
105 |
-
|
106 |
-
$groups.each(function() {
|
107 |
-
var group_id = jQuery( this ).val(),
|
108 |
-
$members = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' ).closest( '.widget' ),
|
109 |
-
$titles = $members.find( '.widget-title h4, .widget-title h3' ),
|
110 |
-
action = 'add';
|
111 |
-
|
112 |
-
if ( isNaN( group_id ) || group_id < 1 ) {
|
113 |
-
action = 'remove';
|
114 |
-
}
|
115 |
-
if ( $members.length < 2 ) {
|
116 |
-
action = 'remove';
|
117 |
-
}
|
118 |
-
|
119 |
-
// Always remove the icons from the group.
|
120 |
-
$titles.removeClass( 'csb-group group-active' )
|
121 |
-
.find( '.btn-clone-group' ).remove();
|
122 |
-
$members.removeAttr( 'data-csb-icon' );
|
123 |
-
|
124 |
-
// If action is "add" then we add the icons again.
|
125 |
-
if ( action === 'add' ) {
|
126 |
-
$titles.addClass( 'csb-group group-active' )
|
127 |
-
.prepend( '<i class="dashicons dashicons-admin-links btn-clone-group"></i> ' );
|
128 |
-
$titles.find( '.btn-clone-group' )
|
129 |
-
.hover( mark_group, unmark_group )
|
130 |
-
.click( toggle_group );
|
131 |
-
}
|
132 |
-
});
|
133 |
-
};
|
134 |
-
|
135 |
/**
|
136 |
* Remove widget from group/assign to group again (only works until widget
|
137 |
* was saved.)
|
@@ -141,7 +184,6 @@ jQuery(function init_cloning() {
|
|
141 |
$title = $widget.find( '.widget-title h4' ),
|
142 |
$icon = $title.find( '.btn-clone-group' ),
|
143 |
$group = $widget.find( 'input.csb-clone-group' );
|
144 |
-
|
145 |
ev.preventDefault();
|
146 |
ev.stopPropagation();
|
147 |
if ( $title.hasClass( 'group-active' ) ) {
|
@@ -160,68 +202,34 @@ jQuery(function init_cloning() {
|
|
160 |
};
|
161 |
|
162 |
/**
|
163 |
-
*
|
164 |
-
* Add a new widget using default WordPress JS API and then update all the
|
165 |
-
* input values of the new widget to match the original widget.
|
166 |
*/
|
167 |
-
var
|
168 |
-
var $
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
$base = $available.find('input.id_base[value="' + class_name + '"]'),
|
192 |
-
$in_question = $base.closest( '.widget' );
|
193 |
-
$in_question.addClass( 'widget-in-question' );
|
194 |
-
|
195 |
-
// 4. Provide data about the origin widget.
|
196 |
-
var group_id = $widget.find( 'input.csb-clone-group' ).val(),
|
197 |
-
$contr = $in_question.find( '.widget-control-actions' ),
|
198 |
-
$group = $in_question.find( 'input.csb-clone-group' ),
|
199 |
-
$state = $in_question.find( 'input.csb-clone-state' );
|
200 |
-
$group.val( group_id );
|
201 |
-
$state.val( 'empty' );
|
202 |
-
|
203 |
-
// 5. Select the current sidebar in the chooser.
|
204 |
-
var $sidebar = $widget.closest( '.widgets-sortables' ),
|
205 |
-
sb_id = $sidebar.attr( 'id' );
|
206 |
-
$chooser.find ( '.widgets-chooser-selected' ).removeClass( 'widgets-chooser-selected' );
|
207 |
-
$chooser.find( 'li' ).each( function() {
|
208 |
-
var $li = jQuery( this );
|
209 |
-
if ( sb_id === $li.data('sidebarId') ) {
|
210 |
-
$li.addClass( 'widgets-chooser-selected' ).focus();
|
211 |
}
|
212 |
});
|
213 |
-
|
214 |
-
// 6. Add the new widget to the sidebar.
|
215 |
-
// This will directly trigger the ajax command to save the widget.
|
216 |
-
window.wpWidgets.addWidget( $chooser );
|
217 |
-
|
218 |
-
// 7. Remove the custom elements and information again.
|
219 |
-
window.wpWidgets.clearWidgetSelection();
|
220 |
-
update_template_groups();
|
221 |
-
|
222 |
-
is_cloning = false;
|
223 |
-
|
224 |
-
return false;
|
225 |
};
|
226 |
|
227 |
/**
|
@@ -236,22 +244,6 @@ jQuery(function init_cloning() {
|
|
236 |
}
|
237 |
};
|
238 |
|
239 |
-
/**
|
240 |
-
* Update all widgets belonging to the same group.
|
241 |
-
*/
|
242 |
-
var prepare_update_group = function prepare_update_group( ev ) {
|
243 |
-
var $widget = jQuery( this ).closest( '.widget' ),
|
244 |
-
group_id = $widget.find( 'input.csb-clone-group' ).val(),
|
245 |
-
$members = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' ).closest( '.widget' ).not( $widget );
|
246 |
-
|
247 |
-
$members.each(function() {
|
248 |
-
var $item = jQuery( this ),
|
249 |
-
$state = $item.find( 'input.csb-clone-state' );
|
250 |
-
|
251 |
-
$item.addClass('wpmui-loading').attr( 'data-reload', true );
|
252 |
-
});
|
253 |
-
};
|
254 |
-
|
255 |
/**
|
256 |
* Update all widgets belonging to the same group.
|
257 |
*/
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global jQuery:false */
|
12 |
$all = jQuery( '#widgets-right' ),
|
13 |
is_cloning = false;
|
14 |
|
15 |
+
/**
|
16 |
+
* Updates all group_id values for the widget-templates to the next free id.
|
17 |
+
*/
|
18 |
+
var update_template_groups = function update_template_groups() {
|
19 |
+
var $groups = jQuery( '#widgets-left input.csb-clone-group' ),
|
20 |
+
next_id = parseInt( $groups.first().val() );
|
21 |
+
while ( $all.find( 'input.csb-clone-group[value="' + next_id + '"]' ).length ) {
|
22 |
+
next_id += 1;
|
23 |
+
}
|
24 |
+
$groups.val( next_id );
|
25 |
+
};
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Clones the widget:
|
29 |
+
* Add a new widget using default WordPress JS API and then update all the
|
30 |
+
* input values of the new widget to match the original widget.
|
31 |
+
*/
|
32 |
+
var clone_widget = function clone_widget( ev ) {
|
33 |
+
var $widget = jQuery( this ).closest( '.widget' ),
|
34 |
+
$available = jQuery( '#widgets-left' ),
|
35 |
+
$chooser = jQuery( '.widgets-chooser' ),
|
36 |
+
$content = jQuery( '#wpbody-content' );
|
37 |
+
|
38 |
+
ev.preventDefault();
|
39 |
+
is_cloning = true;
|
40 |
+
|
41 |
+
// 1. If the current widget is new then first save the current widget
|
42 |
+
var state = $widget.find( 'input.csb-clone-state' ).val();
|
43 |
+
if ( 'new' === state ) {
|
44 |
+
window.wpWidgets.save( $widget, 0, 0, 0 );
|
45 |
+
}
|
46 |
+
|
47 |
+
// 2. Close any open chooser
|
48 |
+
window.wpWidgets.clearWidgetSelection();
|
49 |
+
$chooser.slideUp( 200, function() {
|
50 |
+
$chooser.hide();
|
51 |
+
$content.append( this );
|
52 |
+
});
|
53 |
+
|
54 |
+
// 3. Find the "widget-in-question".
|
55 |
+
var class_name = $widget.find('input.id_base').val(),
|
56 |
+
$base = $available.find('input.id_base[value="' + class_name + '"]'),
|
57 |
+
$in_question = $base.closest( '.widget' );
|
58 |
+
$in_question.addClass( 'widget-in-question' );
|
59 |
+
|
60 |
+
// 4. Provide data about the origin widget.
|
61 |
+
var group_id = $widget.find( 'input.csb-clone-group' ).val(),
|
62 |
+
$contr = $in_question.find( '.widget-control-actions' ),
|
63 |
+
$group = $in_question.find( 'input.csb-clone-group' ),
|
64 |
+
$state = $in_question.find( 'input.csb-clone-state' );
|
65 |
+
$group.val( group_id );
|
66 |
+
$state.val( 'empty' );
|
67 |
+
|
68 |
+
// 5. Select the current sidebar in the chooser.
|
69 |
+
var $sidebar = $widget.closest( '.widgets-sortables' ),
|
70 |
+
sb_id = $sidebar.attr( 'id' );
|
71 |
+
$chooser.find ( '.widgets-chooser-selected' ).removeClass( 'widgets-chooser-selected' );
|
72 |
+
$chooser.find( 'li' ).each( function() {
|
73 |
+
var $li = jQuery( this );
|
74 |
+
if ( sb_id === $li.data('sidebarId') ) {
|
75 |
+
$li.addClass( 'widgets-chooser-selected' ).focus();
|
76 |
+
}
|
77 |
+
});
|
78 |
+
|
79 |
+
// 6. Add the new widget to the sidebar.
|
80 |
+
// This will directly trigger the ajax command to save the widget.
|
81 |
+
window.wpWidgets.addWidget( $chooser );
|
82 |
+
|
83 |
+
// 7. Remove the custom elements and information again.
|
84 |
+
window.wpWidgets.clearWidgetSelection();
|
85 |
+
update_template_groups();
|
86 |
+
|
87 |
+
is_cloning = false;
|
88 |
+
|
89 |
+
return false;
|
90 |
+
};
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Update all widgets belonging to the same group.
|
94 |
+
*/
|
95 |
+
var prepare_update_group = function prepare_update_group( ev ) {
|
96 |
+
var $widget = jQuery( this ).closest( '.widget' ),
|
97 |
+
group_id = $widget.find( 'input.csb-clone-group' ).val(),
|
98 |
+
$members = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' ).closest( '.widget' ).not( $widget );
|
99 |
+
$members.each(function() {
|
100 |
+
var $item = jQuery( this ),
|
101 |
+
$state = $item.find( 'input.csb-clone-state' );
|
102 |
+
$item.addClass('wpmui-loading').attr( 'data-reload', true );
|
103 |
+
});
|
104 |
+
};
|
105 |
+
|
106 |
/**
|
107 |
* Moves the "Clone" button next to the save button.
|
108 |
*/
|
129 |
*/
|
130 |
var update_group_counter = function update_group_counter( ev, el ) {
|
131 |
// We do NOT want to change the group-id when we clone a widget...
|
132 |
+
if ( is_cloning ) {
|
133 |
+
return false;
|
134 |
+
}
|
135 |
var $widget = jQuery( el ).closest( '.widget' ),
|
136 |
$widget_group = $widget.find( 'input.csb-clone-group' ),
|
137 |
group_id = parseInt( $widget_group.val() ),
|
138 |
check = null;
|
|
|
139 |
do {
|
140 |
check = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' );
|
141 |
if ( ! check.length || ( 1 === check.length && check[0] === $widget_group[0] ) ) {
|
150 |
update_template_groups();
|
151 |
};
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
/**
|
155 |
* Viually highlights all widgets of the same group.
|
175 |
$marked.removeClass('csb-marker');
|
176 |
};
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
/**
|
179 |
* Remove widget from group/assign to group again (only works until widget
|
180 |
* was saved.)
|
184 |
$title = $widget.find( '.widget-title h4' ),
|
185 |
$icon = $title.find( '.btn-clone-group' ),
|
186 |
$group = $widget.find( 'input.csb-clone-group' );
|
|
|
187 |
ev.preventDefault();
|
188 |
ev.stopPropagation();
|
189 |
if ( $title.hasClass( 'group-active' ) ) {
|
202 |
};
|
203 |
|
204 |
/**
|
205 |
+
* Adds icons to all widgets that are inside a group.
|
|
|
|
|
206 |
*/
|
207 |
+
var init_group_icons = function init_group_icons() {
|
208 |
+
var $groups = $all.find( 'input.csb-clone-group' );
|
209 |
+
$groups.each(function() {
|
210 |
+
var group_id = jQuery( this ).val(),
|
211 |
+
$members = $all.find( 'input.csb-clone-group[value="' + group_id + '"]' ).closest( '.widget' ),
|
212 |
+
$titles = $members.find( '.widget-title h4, .widget-title h3' ),
|
213 |
+
action = 'add';
|
214 |
+
if ( isNaN( group_id ) || group_id < 1 ) {
|
215 |
+
action = 'remove';
|
216 |
+
}
|
217 |
+
if ( $members.length < 2 ) {
|
218 |
+
action = 'remove';
|
219 |
+
}
|
220 |
+
// Always remove the icons from the group.
|
221 |
+
$titles.removeClass( 'csb-group group-active' )
|
222 |
+
.find( '.btn-clone-group' ).remove();
|
223 |
+
$members.removeAttr( 'data-csb-icon' );
|
224 |
+
// If action is "add" then we add the icons again.
|
225 |
+
if ( action === 'add' ) {
|
226 |
+
$titles.addClass( 'csb-group group-active' )
|
227 |
+
.prepend( '<i class="dashicons dashicons-admin-links btn-clone-group"></i> ' );
|
228 |
+
$titles.find( '.btn-clone-group' )
|
229 |
+
.hover( mark_group, unmark_group )
|
230 |
+
.click( toggle_group );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
};
|
234 |
|
235 |
/**
|
244 |
}
|
245 |
};
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
/**
|
248 |
* Update all widgets belonging to the same group.
|
249 |
*/
|
assets/js/cs-cloning.min.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
-
jQuery(function(){var a=jQuery(document),b=jQuery("#widgets-right"),c=!1,d=function(a,b){var
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
+
jQuery(function(){var a=jQuery(document),b=jQuery("#widgets-right"),c=!1,d=function(){for(var a=jQuery("#widgets-left input.csb-clone-group"),c=parseInt(a.first().val());b.find('input.csb-clone-group[value="'+c+'"]').length;)c+=1;a.val(c)},e=function(a){var b=jQuery(this).closest(".widget"),e=jQuery("#widgets-left"),f=jQuery(".widgets-chooser"),g=jQuery("#wpbody-content");a.preventDefault(),c=!0,"new"===b.find("input.csb-clone-state").val()&&window.wpWidgets.save(b,0,0,0),window.wpWidgets.clearWidgetSelection(),f.slideUp(200,function(){f.hide(),g.append(this)});var h=b.find("input.id_base").val(),i=e.find('input.id_base[value="'+h+'"]'),j=i.closest(".widget");j.addClass("widget-in-question");var k=b.find("input.csb-clone-group").val(),l=(j.find(".widget-control-actions"),j.find("input.csb-clone-group")),m=j.find("input.csb-clone-state");l.val(k),m.val("empty");var n=b.closest(".widgets-sortables"),o=n.attr("id");return f.find(".widgets-chooser-selected").removeClass("widgets-chooser-selected"),f.find("li").each(function(){var a=jQuery(this);o===a.data("sidebarId")&&a.addClass("widgets-chooser-selected").focus()}),window.wpWidgets.addWidget(f),window.wpWidgets.clearWidgetSelection(),d(),c=!1,!1},f=function(a){var c=jQuery(this).closest(".widget"),d=c.find("input.csb-clone-group").val();b.find('input.csb-clone-group[value="'+d+'"]').closest(".widget").not(c).each(function(){var a=jQuery(this);a.find("input.csb-clone-state"),a.addClass("wpmui-loading").attr("data-reload",!0)})},g=function(a,b){var c=jQuery(b).closest(".widget"),d=c.find(".csb-clone-button"),g=c.find(".widget-control-actions .widget-control-save"),h=c.find(".widget-control-actions .spinner"),i=c.find(".widget-control-save");c.data("_csb_cloning")||(h.insertBefore(g).css({float:"left"}),d.insertBefore(g).click(e),i.click(f),c.data("_csb_cloning",!0))},h=function(a,e){if(c)return!1;for(var f=jQuery(e).closest(".widget"),g=f.find("input.csb-clone-group"),h=parseInt(g.val()),i=null;;){if(i=b.find('input.csb-clone-group[value="'+h+'"]'),!i.length||1===i.length&&i[0]===g[0])break;h+=1}g.val(h),d()},i=function(a){var c=jQuery(this).closest(".widget"),d=c.find("input.csb-clone-group").val(),e=b.find('input.csb-clone-group[value="'+d+'"]').closest(".widget");isNaN(d)||d<1||(e.addClass("csb-marker"),c.removeClass("csb-marker"))},j=function(a){jQuery(".widget.csb-marker").removeClass("csb-marker")},k=function(a){var b=jQuery(this).closest(".widget"),c=b.find(".widget-title h4"),d=c.find(".btn-clone-group"),e=b.find("input.csb-clone-group");return a.preventDefault(),a.stopPropagation(),c.hasClass("group-active")?(c.removeClass("group-active"),d.removeClass("dashicons-admin-links").addClass("dashicons-editor-unlink"),e.data("group",e.val()),e.val(0),j()):(c.addClass("group-active"),d.addClass("dashicons-admin-links").removeClass("dashicons-editor-unlink"),e.val(e.data("group")),i.call(this,[a])),!1},l=function(){b.find("input.csb-clone-group").each(function(){var a=jQuery(this).val(),c=b.find('input.csb-clone-group[value="'+a+'"]').closest(".widget"),d=c.find(".widget-title h4, .widget-title h3"),e="add";(isNaN(a)||a<1)&&(e="remove"),c.length<2&&(e="remove"),d.removeClass("csb-group group-active").find(".btn-clone-group").remove(),c.removeAttr("data-csb-icon"),"add"===e&&(d.addClass("csb-group group-active").prepend('<i class="dashicons dashicons-admin-links btn-clone-group"></i> '),d.find(".btn-clone-group").hover(i,j).click(k))})},m=function(a){"empty"===a.find("input.csb-clone-state").val()&&(a.addClass("wpmui-loading"),window.wpWidgets.save(a,0,1,0))},n=function(a){b.find(".widget[data-reload]").each(function(){var a=jQuery(this);a.find("input.csb-clone-state").val("empty"),a.removeAttr("data-reload"),window.wpWidgets.save(a,0,0,0)})},o=function(a,b,c,d){var e="string"==typeof c.data?c.data:"",f=e.match(/^.*&action=([^&]+).*$/),g=e.match(/^.*&widget-id=([^&]+).*$/),h=f&&2===f.length?f[1]:"",i=g&&2===g.length?g[1]:"";if(i.length){var j=jQuery('.widget input.widget-id[value="'+i+'"]'),k=j.closest(".widget");switch(h){case"save-widget":k.removeClass("wpmui-loading"),d.length?d.match(/^deleted:/)?window.setTimeout(l,400):(l(),n()):m(k)}}};b.find(".widget").each(g),a.on("widget-added",g),a.on("widget-added",h),a.ajaxSuccess(o),l(),d()});
|
assets/js/cs-visibility.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global jQuery:false */
|
@@ -10,32 +10,6 @@
|
|
10 |
jQuery(function init_visibility() {
|
11 |
var $doc = jQuery( document );
|
12 |
|
13 |
-
/**
|
14 |
-
* Moves the "Visibility" button next to the save button.
|
15 |
-
*/
|
16 |
-
var init_widget = function init_widget( ev, el ) {
|
17 |
-
var $widget = jQuery( el ).closest( '.widget' ),
|
18 |
-
$btn = $widget.find( '.csb-visibility-button' ),
|
19 |
-
$target = $widget.find( '.widget-control-actions .widget-control-save' ),
|
20 |
-
$spinner = $widget.find( '.widget-control-actions .spinner' );
|
21 |
-
|
22 |
-
if ( $widget.data( '_csb_visibility' ) ) {
|
23 |
-
return;
|
24 |
-
}
|
25 |
-
|
26 |
-
$spinner.insertBefore( $target ).css({ 'float': 'left' });
|
27 |
-
$btn.insertBefore( $target ).click( toggle_section );
|
28 |
-
$widget.on( 'click', '.toggle-action b', toggle_action );
|
29 |
-
$widget.on( 'csb:update', update_display );
|
30 |
-
$widget.on( 'click', '.clear-filter', remove_filter );
|
31 |
-
$widget.on( 'click', '.choose-filters', show_filter_menu );
|
32 |
-
$widget.on( 'click', '.add-filter', add_filter );
|
33 |
-
$widget.on( 'change', 'input[data-lbl-all][data-lbl-single]', toggle_label );
|
34 |
-
$widget.on( 'change', 'select.posttype', update_posttypes );
|
35 |
-
|
36 |
-
$widget.data( '_csb_visibility', true );
|
37 |
-
};
|
38 |
-
|
39 |
/**
|
40 |
* Removes the current filter row from the conditions
|
41 |
*/
|
@@ -57,6 +31,13 @@ jQuery(function init_visibility() {
|
|
57 |
return false;
|
58 |
};
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
/**
|
61 |
* User clicks on a new filter option in the "Add filter" dropdown.
|
62 |
* Show the filter row.
|
@@ -109,13 +90,6 @@ jQuery(function init_visibility() {
|
|
109 |
return false;
|
110 |
};
|
111 |
|
112 |
-
/**
|
113 |
-
* Close the filter menu again.
|
114 |
-
*/
|
115 |
-
var hide_filter_menu = function hide_filter_menu( ev ) {
|
116 |
-
jQuery( '.csb-action .dropdown:visible' ).hide();
|
117 |
-
};
|
118 |
-
|
119 |
/**
|
120 |
* Shows or hides the visibility-options for the current widget.
|
121 |
*/
|
@@ -217,6 +191,32 @@ jQuery(function init_visibility() {
|
|
217 |
});
|
218 |
};
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
jQuery( '#widgets-right .widget' ).each( init_widget );
|
221 |
$doc.on( 'widget-added', init_widget );
|
222 |
});
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global jQuery:false */
|
10 |
jQuery(function init_visibility() {
|
11 |
var $doc = jQuery( document );
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Removes the current filter row from the conditions
|
15 |
*/
|
31 |
return false;
|
32 |
};
|
33 |
|
34 |
+
/**
|
35 |
+
* Close the filter menu again.
|
36 |
+
*/
|
37 |
+
var hide_filter_menu = function hide_filter_menu( ev ) {
|
38 |
+
jQuery( '.csb-action .dropdown:visible' ).hide();
|
39 |
+
};
|
40 |
+
|
41 |
/**
|
42 |
* User clicks on a new filter option in the "Add filter" dropdown.
|
43 |
* Show the filter row.
|
90 |
return false;
|
91 |
};
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
/**
|
94 |
* Shows or hides the visibility-options for the current widget.
|
95 |
*/
|
191 |
});
|
192 |
};
|
193 |
|
194 |
+
/**
|
195 |
+
* Moves the "Visibility" button next to the save button.
|
196 |
+
*/
|
197 |
+
var init_widget = function init_widget( ev, el ) {
|
198 |
+
var $widget = jQuery( el ).closest( '.widget' ),
|
199 |
+
$btn = $widget.find( '.csb-visibility-button' ),
|
200 |
+
$target = $widget.find( '.widget-control-actions .widget-control-save' ),
|
201 |
+
$spinner = $widget.find( '.widget-control-actions .spinner' );
|
202 |
+
|
203 |
+
if ( $widget.data( '_csb_visibility' ) ) {
|
204 |
+
return;
|
205 |
+
}
|
206 |
+
|
207 |
+
$spinner.insertBefore( $target ).css({ 'float': 'left' });
|
208 |
+
$btn.insertBefore( $target ).click( toggle_section );
|
209 |
+
$widget.on( 'click', '.toggle-action b', toggle_action );
|
210 |
+
$widget.on( 'csb:update', update_display );
|
211 |
+
$widget.on( 'click', '.clear-filter', remove_filter );
|
212 |
+
$widget.on( 'click', '.choose-filters', show_filter_menu );
|
213 |
+
$widget.on( 'click', '.add-filter', add_filter );
|
214 |
+
$widget.on( 'change', 'input[data-lbl-all][data-lbl-single]', toggle_label );
|
215 |
+
$widget.on( 'change', 'select.posttype', update_posttypes );
|
216 |
+
|
217 |
+
$widget.data( '_csb_visibility', true );
|
218 |
+
};
|
219 |
+
|
220 |
jQuery( '#widgets-right .widget' ).each( init_widget );
|
221 |
$doc.on( 'widget-added', init_widget );
|
222 |
});
|
assets/js/cs-visibility.min.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
-
jQuery(function(){var a=jQuery(document),b=function(a
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
+
jQuery(function(){var a=jQuery(document),b=function(a){var b=jQuery(this),c=b.closest(".csb-option-row"),d=b.closest(".widget"),e="."+jQuery.trim(c.attr("class").replace("csb-option-row","")),f=d.find('[data-for="'+e+'"]'),g=c.find("input, select, textarea");return a.preventDefault(),f.show(),c.fadeOut(400,function(){g.val("").trigger("change.select2"),d.trigger("csb:update")}),!1},c=function(a){jQuery(".csb-action .dropdown:visible").hide()},d=function(a){var b=jQuery(this),d=b.data("for"),e=b.closest(".widget"),f=e.find(".csb-always"),g=e.find(d);return a.preventDefault(),g.show(),b.hide(),f.hide(),c(),e.trigger("csb:update"),!1},e=function(){var a=jQuery(this).closest(".widget"),b=a.find(".csb-always"),c=a.find(".csb-option-row:visible:not(.csb-action,.csb-always)");0===c.length?b.show():(b.hide(),c.find(".csb-and").show(),c.first().find(".csb-and").hide()),wpmUi.upgrade_multiselect(a)},f=function(b){var d=jQuery(this),e=d.closest(".csb-option-row"),f=e.find(".dropdown");return b.preventDefault(),f.show(),a.one("click",c),!1},g=function(a){var b=jQuery(this),c=b.closest(".widget"),d=c.find(".csb-visibility-inner"),e=d.find(".csb-visible-flag");return a.preventDefault(),"0"===e.val()?(e.val("1"),d.show(),c.trigger("csb:update")):(e.val("0"),d.hide()),!1},h=function(a){var b=jQuery(this).closest("label"),c=b.closest(".widget"),d="#"+b.attr("for"),e=c.find(d),f=e.val(),g=c.find(".lbl-show-if"),h=c.find(".lbl-hide-if");return a.preventDefault(),"show"!==f?(g.show(),h.hide(),e.val("show")):(g.hide(),h.show(),e.val("hide")),!1},i=function(a){var b=jQuery(this).closest("label"),c=b.closest(".csb-detail-row"),d=b.find("input[type=checkbox]"),e=b.find(".lbl"),f=c.find(".detail"),g=f.find("input,select,textarea");d.prop("checked")?(e.text(d.data("lbl-single")),f.show()):(e.text(d.data("lbl-all")),f.hide(),g.val("").trigger("change.select2"))},j=function(a){var b,c=jQuery(this),d=c.closest(".csb-option-row"),e=d.find(".csb-detail-row"),f=c.val();if(e.addClass("csb-hide"),f)for(b=0;b<f.length;b+=1)e.filter(".csb-pt-"+f[b]).removeClass("csb-hide ");e.each(function(){var a=jQuery(this),b=a.find("input[type=checkbox]");a.hasClass("csb-hide")?(a.hide(),b.prop("checked",!1),i.call(b)):a.show()})},k=function(a,c){var k=jQuery(c).closest(".widget"),l=k.find(".csb-visibility-button"),m=k.find(".widget-control-actions .widget-control-save"),n=k.find(".widget-control-actions .spinner");k.data("_csb_visibility")||(n.insertBefore(m).css({float:"left"}),l.insertBefore(m).click(g),k.on("click",".toggle-action b",h),k.on("csb:update",e),k.on("click",".clear-filter",b),k.on("click",".choose-filters",f),k.on("click",".add-filter",d),k.on("change","input[data-lbl-all][data-lbl-single]",i),k.on("change","select.posttype",j),k.data("_csb_visibility",!0))};jQuery("#widgets-right .widget").each(k),a.on("widget-added",k)});
|
assets/js/cs.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global window:false */
|
@@ -991,6 +991,24 @@ window.csSidebars = null;
|
|
991 |
form = null,
|
992 |
id = sb.getID();
|
993 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
994 |
// Display the location data after it was loaded by ajax.
|
995 |
function handle_done_load( resp, okay, xhr ) {
|
996 |
var theme_sb, opt, name, msg = {}; // Only used in error case.
|
@@ -1334,24 +1352,6 @@ window.csSidebars = null;
|
|
1334 |
return false;
|
1335 |
}
|
1336 |
|
1337 |
-
/**
|
1338 |
-
* (_) add new rule
|
1339 |
-
*
|
1340 |
-
* @since 3.2.0
|
1341 |
-
*/
|
1342 |
-
function _add_new_rule( data, table ) {
|
1343 |
-
var template = wp.template('custom-sidebars-new-rule-row');
|
1344 |
-
$('tbody', table ).append( template( data ) );
|
1345 |
-
$('tfoot', table).hide();
|
1346 |
-
$('tbody .dashicons-trash', table).on( 'click', function() {
|
1347 |
-
$(this).closest('tr').detach();
|
1348 |
-
if ( 0 === $('tbody tr', table ).length ) {
|
1349 |
-
$('tfoot', table).show();
|
1350 |
-
}
|
1351 |
-
});
|
1352 |
-
return false;
|
1353 |
-
}
|
1354 |
-
|
1355 |
// Show the LOCATION popup.
|
1356 |
popup = wpmUi.popup()
|
1357 |
.modal( true )
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
/*global window:false */
|
991 |
form = null,
|
992 |
id = sb.getID();
|
993 |
|
994 |
+
/**
|
995 |
+
* (_) add new rule
|
996 |
+
*
|
997 |
+
* @since 3.2.0
|
998 |
+
*/
|
999 |
+
function _add_new_rule( data, table ) {
|
1000 |
+
var template = wp.template('custom-sidebars-new-rule-row');
|
1001 |
+
$('tbody', table ).append( template( data ) );
|
1002 |
+
$('tfoot', table).hide();
|
1003 |
+
$('tbody .dashicons-trash', table).on( 'click', function() {
|
1004 |
+
$(this).closest('tr').detach();
|
1005 |
+
if ( 0 === $('tbody tr', table ).length ) {
|
1006 |
+
$('tfoot', table).show();
|
1007 |
+
}
|
1008 |
+
});
|
1009 |
+
return false;
|
1010 |
+
}
|
1011 |
+
|
1012 |
// Display the location data after it was loaded by ajax.
|
1013 |
function handle_done_load( resp, okay, xhr ) {
|
1014 |
var theme_sb, opt, name, msg = {}; // Only used in error case.
|
1352 |
return false;
|
1353 |
}
|
1354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1355 |
// Show the LOCATION popup.
|
1356 |
popup = wpmUi.popup()
|
1357 |
.modal( true )
|
assets/js/cs.min.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! Custom Sidebars - v3.2.
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
-
function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),a.button&&i.$().find(".btn-save").text(a.button),void(a.advance&&(i.$().find("#csb-more").prop("checked",!0),d()))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return 0<i.$("#csb-more:checked").length&&jQuery("<input>").attr({type:"hidden",value:"show",name:"advance"}).appendTo(a),i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id,_wpnonce:csSidebarsData._wpnonce_get}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(b){function c(a){a.find(".name").text(j)}function d(){g.loading(!1),g.destroy()}function e(a,b,c){var d={};g.loading(!1),g.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+i).closest(".widgets-holder-wrap").remove(),csSidebars.remove(i),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function f(){g.loading(!0),h.reset().data({do:"delete",sb:i,_wpnonce:a("#_wp_nonce_cs_delete_sidebar").val()}).ondone(e).load_json()}var g=null,h=null,i=b.getID(),j=b.name;return g=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(c).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("click",".btn-cancel",d),g.$().on("click",".btn-delete",f),!0},showLocations:function(b){function c(b,c,d){function e(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function f(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===l?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var g,j,k;if(i.loading(!1),!c)return i.destroy(),void csSidebars.showAjaxError(b);i.$().find(".sb-name").text(b.sidebar.name);var l=b.sidebar.id;i.$().find(".message.no-sidebars").hide();var m=0,n=i.$().find(".cs-replaceable");n.hide(),b.replaceable=wpmUi.obj(b.replaceable);for(var o in b.replaceable)b.replaceable.hasOwnProperty(o)&&(n.filter("."+b.replaceable[o]).show(),m++);0===m&&(i.$().find(".wpmui-box, .message, .button-primary").hide(),i.$().find(".message.no-sidebars").show().parent().addClass("notice notice-error").removeClass("hidden"));var p=i.$().find(".cs-datalist.cs-cat"),q=i.$().find(".cs-datalist.cs-arc-cat"),r=b.categories;q.empty(),p.empty();for(var s in r)e(r[s],q,s),e(r[s],p,s);for(var t in r){if(r[t].single)for(g in r[t].single)f(r[t].single[g],g,t,p);if(r[t].archive)for(g in r[t].archive)f(r[t].archive[g],g,t,q)}var u=i.$().find(".cs-datalist.cs-pt"),v=b.posttypes;u.empty();for(var w in v)j=jQuery("<option></option>"),k=v[w].name,j.attr("value",w).text(k),u.append(j);for(var x in v)if(v[x].single)for(g in v[x].single)f(v[x].single[g],g,x,u);var y=i.$().find(".cs-datalist.cs-arc"),z=b.archives;y.empty();for(var A in z)j=jQuery("<option></option>"),k=z[A].name,j.attr("value",A).text(k),y.append(j);for(var B in z)if(z[B].archive)for(g in z[B].archive)f(z[B].archive[g],g,B,y);var C=i.$().find(".cs-datalist.cs-arc-aut"),D=b.authors;C.empty();for(var E in D)j=jQuery("<option></option>"),k=D[E].name,j.attr("value",E).text(k),C.append(j);for(var F in D)if(D[F].archive)for(g in D[F].archive)f(D[F].archive[g],g,F,C);i.$().find(".cs-3rd-part .cs-datalist").each(function(){var c=b[a(this).data("id")];a(this).empty();for(var d in c)j=jQuery("<option></option>"),k=c[d].name,j.attr("value",d).text(k),a(this).append(j);for(var e in c)if(c[e].archive)for(g in c[e].archive)f(c[e].archive[g],g,e,a(this))}),i.$().find(".cf-custom-taxonomies .cs-datalist").each(function(){var c=b[a(this).data("id")];a(this).empty();for(var d in c)j=jQuery("<option></option>"),k=c[d].name,j.attr("value",d).text(k),a(this).append(j);for(var e in c)if(c[e].single)for(g in c[e].single)f(c[e].single[g],g,e,a(this))});var G=i.$().find(".csb-media-screen-width table");a.each(b.screen,function(b,c){a.each(c,function(a,c){h({minmax:a,mode:c,size:b},G)})})}function d(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function e(a,b,c){var d={};i.loading(!1),i.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function f(){i.loading(!0),j.reset().data(k).ondone(e).load_json()}function g(){return h({minmax:"max",mode:"hide",size:0},a("table",a(this).parent())),!1}function h(b,c){var d=wp.template("custom-sidebars-new-rule-row");return a("tbody",c).append(d(b)),a("tfoot",c).hide(),a("tbody .dashicons-trash",c).on("click",function(){a(this).closest("tr").detach(),0===a("tbody tr",c).length&&a("tfoot",c).show()}),!1}var i=null,j=null,k=null,l=b.getID();return i=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),i.loading(!0),k=i.$().find(".frm-location"),k.find(".sb-id").val(l),j=wpmUi.ajax(null,"cs-ajax"),j.reset().data({do:"get-location",sb:l}).ondone(c).load_json(),i.$().on("click",".detail-toggle",d),i.$().on("click",".btn-save",f),i.$().on("click",".btn-cancel",i.destroy),i.$().on("click",".btn-add-rule",g),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}(),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-allow-author input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_allow_author",_wpnonce:a("#custom_sidebars_allow_author").val(),value:this.checked};a.post(ajaxurl,b)})})}(jQuery),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-custom-taxonomies input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_metabox_custom_taxonomies",_wpnonce:a("#custom_sidebars_custom_taxonomies").val(),fields:{}};a("#screen-options-wrap .cs-custom-taxonomies input[type=checkbox]").each(function(){b.fields[a(this).val()]=this.checked}),a.post(ajaxurl,b)})})}(jQuery),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-roles input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_metabox_roles",_wpnonce:a("#custom_sidebars_metabox_roles").val(),fields:{}};a("#screen-options-wrap .cs-roles input[type=checkbox]").each(function(){b.fields[a(this).val()]=this.checked}),a.post(ajaxurl,b)})})}(jQuery);
|
1 |
+
/*! Custom Sidebars - v3.2.1
|
2 |
* https://premium.wpmudev.org/project/custom-sidebars-pro/
|
3 |
* Copyright (c) 2018; * Licensed GPLv2+ */
|
4 |
|
5 |
+
function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),a.button&&i.$().find(".btn-save").text(a.button),void(a.advance&&(i.$().find("#csb-more").prop("checked",!0),d()))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return 0<i.$("#csb-more:checked").length&&jQuery("<input>").attr({type:"hidden",value:"show",name:"advance"}).appendTo(a),i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id,_wpnonce:csSidebarsData._wpnonce_get}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(b){function c(a){a.find(".name").text(j)}function d(){g.loading(!1),g.destroy()}function e(a,b,c){var d={};g.loading(!1),g.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+i).closest(".widgets-holder-wrap").remove(),csSidebars.remove(i),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function f(){g.loading(!0),h.reset().data({do:"delete",sb:i,_wpnonce:a("#_wp_nonce_cs_delete_sidebar").val()}).ondone(e).load_json()}var g=null,h=null,i=b.getID(),j=b.name;return g=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(c).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("click",".btn-cancel",d),g.$().on("click",".btn-delete",f),!0},showLocations:function(b){function c(b,c){var d=wp.template("custom-sidebars-new-rule-row");return a("tbody",c).append(d(b)),a("tfoot",c).hide(),a("tbody .dashicons-trash",c).on("click",function(){a(this).closest("tr").detach(),0===a("tbody tr",c).length&&a("tfoot",c).show()}),!1}function d(b,d,e){function f(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function g(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===l?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var h,j,k;if(i.loading(!1),!d)return i.destroy(),void csSidebars.showAjaxError(b);i.$().find(".sb-name").text(b.sidebar.name);var l=b.sidebar.id;i.$().find(".message.no-sidebars").hide();var m=0,n=i.$().find(".cs-replaceable");n.hide(),b.replaceable=wpmUi.obj(b.replaceable);for(var o in b.replaceable)b.replaceable.hasOwnProperty(o)&&(n.filter("."+b.replaceable[o]).show(),m++);0===m&&(i.$().find(".wpmui-box, .message, .button-primary").hide(),i.$().find(".message.no-sidebars").show().parent().addClass("notice notice-error").removeClass("hidden"));var p=i.$().find(".cs-datalist.cs-cat"),q=i.$().find(".cs-datalist.cs-arc-cat"),r=b.categories;q.empty(),p.empty();for(var s in r)f(r[s],q,s),f(r[s],p,s);for(var t in r){if(r[t].single)for(h in r[t].single)g(r[t].single[h],h,t,p);if(r[t].archive)for(h in r[t].archive)g(r[t].archive[h],h,t,q)}var u=i.$().find(".cs-datalist.cs-pt"),v=b.posttypes;u.empty();for(var w in v)j=jQuery("<option></option>"),k=v[w].name,j.attr("value",w).text(k),u.append(j);for(var x in v)if(v[x].single)for(h in v[x].single)g(v[x].single[h],h,x,u);var y=i.$().find(".cs-datalist.cs-arc"),z=b.archives;y.empty();for(var A in z)j=jQuery("<option></option>"),k=z[A].name,j.attr("value",A).text(k),y.append(j);for(var B in z)if(z[B].archive)for(h in z[B].archive)g(z[B].archive[h],h,B,y);var C=i.$().find(".cs-datalist.cs-arc-aut"),D=b.authors;C.empty();for(var E in D)j=jQuery("<option></option>"),k=D[E].name,j.attr("value",E).text(k),C.append(j);for(var F in D)if(D[F].archive)for(h in D[F].archive)g(D[F].archive[h],h,F,C);i.$().find(".cs-3rd-part .cs-datalist").each(function(){var c=b[a(this).data("id")];a(this).empty();for(var d in c)j=jQuery("<option></option>"),k=c[d].name,j.attr("value",d).text(k),a(this).append(j);for(var e in c)if(c[e].archive)for(h in c[e].archive)g(c[e].archive[h],h,e,a(this))}),i.$().find(".cf-custom-taxonomies .cs-datalist").each(function(){var c=b[a(this).data("id")];a(this).empty();for(var d in c)j=jQuery("<option></option>"),k=c[d].name,j.attr("value",d).text(k),a(this).append(j);for(var e in c)if(c[e].single)for(h in c[e].single)g(c[e].single[h],h,e,a(this))});var G=i.$().find(".csb-media-screen-width table");a.each(b.screen,function(b,d){a.each(d,function(a,d){c({minmax:a,mode:d,size:b},G)})})}function e(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function f(a,b,c){var d={};i.loading(!1),i.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function g(){i.loading(!0),j.reset().data(k).ondone(f).load_json()}function h(){return c({minmax:"max",mode:"hide",size:0},a("table",a(this).parent())),!1}var i=null,j=null,k=null,l=b.getID();return i=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),i.loading(!0),k=i.$().find(".frm-location"),k.find(".sb-id").val(l),j=wpmUi.ajax(null,"cs-ajax"),j.reset().data({do:"get-location",sb:l}).ondone(d).load_json(),i.$().on("click",".detail-toggle",e),i.$().on("click",".btn-save",g),i.$().on("click",".btn-cancel",i.destroy),i.$().on("click",".btn-add-rule",h),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}(),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-allow-author input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_allow_author",_wpnonce:a("#custom_sidebars_allow_author").val(),value:this.checked};a.post(ajaxurl,b)})})}(jQuery),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-custom-taxonomies input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_metabox_custom_taxonomies",_wpnonce:a("#custom_sidebars_custom_taxonomies").val(),fields:{}};a("#screen-options-wrap .cs-custom-taxonomies input[type=checkbox]").each(function(){b.fields[a(this).val()]=this.checked}),a.post(ajaxurl,b)})})}(jQuery),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-roles input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_metabox_roles",_wpnonce:a("#custom_sidebars_metabox_roles").val(),fields:{}};a("#screen-options-wrap .cs-roles input[type=checkbox]").each(function(){b.fields[a(this).val()]=this.checked}),a.post(ajaxurl,b)})})}(jQuery);
|
customsidebars.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Custom Sidebars
|
4 |
* Plugin URI: https://wordpress.org/plugins/custom-sidebars/
|
5 |
* Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
|
6 |
-
* Version: 3.2.
|
7 |
* Author: WPMU DEV
|
8 |
* Author URI: http://premium.wpmudev.org/
|
9 |
* Textdomain: custom-sidebars
|
3 |
* Plugin Name: Custom Sidebars
|
4 |
* Plugin URI: https://wordpress.org/plugins/custom-sidebars/
|
5 |
* Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
|
6 |
+
* Version: 3.2.1
|
7 |
* Author: WPMU DEV
|
8 |
* Author URI: http://premium.wpmudev.org/
|
9 |
* Textdomain: custom-sidebars
|
inc/class-custom-sidebars-editor.php
CHANGED
@@ -453,7 +453,7 @@ class CustomSidebarsEditor extends CustomSidebars {
|
|
453 |
$archive_type = array(
|
454 |
'_blog' => __( 'Front Page', 'custom-sidebars' ),
|
455 |
'_search' => __( 'Search Results', 'custom-sidebars' ),
|
456 |
-
'_404' => __( 'Not
|
457 |
'_authors' => __( 'Any Author Archive', 'custom-sidebars' ),
|
458 |
'_date' => __( 'Date Archives', 'custom-sidebars' ),
|
459 |
);
|
453 |
$archive_type = array(
|
454 |
'_blog' => __( 'Front Page', 'custom-sidebars' ),
|
455 |
'_search' => __( 'Search Results', 'custom-sidebars' ),
|
456 |
+
'_404' => __( 'Not Found (404)', 'custom-sidebars' ),
|
457 |
'_authors' => __( 'Any Author Archive', 'custom-sidebars' ),
|
458 |
'_date' => __( 'Date Archives', 'custom-sidebars' ),
|
459 |
);
|
inc/class-custom-sidebars-replacer.php
CHANGED
@@ -263,7 +263,7 @@ class CustomSidebarsReplacer extends CustomSidebars {
|
|
263 |
}
|
264 |
|
265 |
// 1 |== Single posts/pages --------------------------------------------
|
266 |
-
if ( is_singular() ) {
|
267 |
$post_type = get_post_type();
|
268 |
$post_type = apply_filters( 'cs_replace_post_type', $post_type, 'single' );
|
269 |
$expl && do_action( 'cs_explain', 'Type 1: Single ' . ucfirst( $post_type ) );
|
263 |
}
|
264 |
|
265 |
// 1 |== Single posts/pages --------------------------------------------
|
266 |
+
if ( is_singular() && ! is_home() && ! is_front_page() ) {
|
267 |
$post_type = get_post_type();
|
268 |
$post_type = apply_filters( 'cs_replace_post_type', $post_type, 'single' );
|
269 |
$expl && do_action( 'cs_explain', 'Type 1: Single ' . ucfirst( $post_type ) );
|
inc/class-custom-sidebars-visibility.php
CHANGED
@@ -155,11 +155,11 @@ class CustomSidebarsVisibility extends CustomSidebars {
|
|
155 |
$pagetype_list = array(
|
156 |
'frontpage' => __( 'Front Page', 'custom-sidebars' ),
|
157 |
'home' => __( 'Post Index', 'custom-sidebars' ),
|
158 |
-
'single' => __( 'Single
|
159 |
//'posts' => __( 'Posts page', 'custom-sidebars' ), "Posts page" is same as "Post Index"...
|
160 |
'archive' => __( 'Archives', 'custom-sidebars' ),
|
161 |
-
'search' => __( 'Search
|
162 |
-
'e404' => __( 'Not
|
163 |
'preview' => __( 'Preview', 'custom-sidebars' ),
|
164 |
'day' => __( 'Archive: Day', 'custom-sidebars' ),
|
165 |
'month' => __( 'Archive: Month', 'custom-sidebars' ),
|
@@ -242,12 +242,12 @@ class CustomSidebarsVisibility extends CustomSidebars {
|
|
242 |
<li class="add-filter"
|
243 |
data-for=".csb-pagetypes"
|
244 |
<?php if ( ! empty( $cond['pagetypes'] ) ) : ?>style="display:none"<?php endif; ?>>
|
245 |
-
<?php _e( 'Special
|
246 |
</li>
|
247 |
<li class="add-filter"
|
248 |
data-for=".csb-posttypes"
|
249 |
<?php if ( ! empty( $cond['posttypes'] ) ) : ?>style="display:none"<?php endif; ?>>
|
250 |
-
<?php _e( 'For
|
251 |
</li>
|
252 |
<li class="csb-group"><?php _e( 'Taxonomy', 'custom-sidebars' ); ?></li>
|
253 |
<?php foreach ( $tax_list as $tax_item ) :
|
155 |
$pagetype_list = array(
|
156 |
'frontpage' => __( 'Front Page', 'custom-sidebars' ),
|
157 |
'home' => __( 'Post Index', 'custom-sidebars' ),
|
158 |
+
'single' => __( 'Single Page', 'custom-sidebars' ),
|
159 |
//'posts' => __( 'Posts page', 'custom-sidebars' ), "Posts page" is same as "Post Index"...
|
160 |
'archive' => __( 'Archives', 'custom-sidebars' ),
|
161 |
+
'search' => __( 'Search Results', 'custom-sidebars' ),
|
162 |
+
'e404' => __( 'Not Found (404)', 'custom-sidebars' ),
|
163 |
'preview' => __( 'Preview', 'custom-sidebars' ),
|
164 |
'day' => __( 'Archive: Day', 'custom-sidebars' ),
|
165 |
'month' => __( 'Archive: Month', 'custom-sidebars' ),
|
242 |
<li class="add-filter"
|
243 |
data-for=".csb-pagetypes"
|
244 |
<?php if ( ! empty( $cond['pagetypes'] ) ) : ?>style="display:none"<?php endif; ?>>
|
245 |
+
<?php _e( 'Special Pages', 'custom-sidebars' ); ?>
|
246 |
</li>
|
247 |
<li class="add-filter"
|
248 |
data-for=".csb-posttypes"
|
249 |
<?php if ( ! empty( $cond['posttypes'] ) ) : ?>style="display:none"<?php endif; ?>>
|
250 |
+
<?php _e( 'For Post Type', 'custom-sidebars' ); ?>
|
251 |
</li>
|
252 |
<li class="csb-group"><?php _e( 'Taxonomy', 'custom-sidebars' ); ?></li>
|
253 |
<?php foreach ( $tax_list as $tax_item ) :
|
inc/class-custom-sidebars.php
CHANGED
@@ -90,7 +90,7 @@ class CustomSidebars {
|
|
90 |
*/
|
91 |
public function wp_enqueue_add_version( $version, $handle ) {
|
92 |
if ( preg_match( '/^wpmu\-cs\-/', $handle ) ) {
|
93 |
-
return '3.2.
|
94 |
}
|
95 |
return $version;
|
96 |
}
|
90 |
*/
|
91 |
public function wp_enqueue_add_version( $version, $handle ) {
|
92 |
if ( preg_match( '/^wpmu\-cs\-/', $handle ) ) {
|
93 |
+
return '3.2.1';
|
94 |
}
|
95 |
return $version;
|
96 |
}
|
languages/custom-sidebars.pot
CHANGED
@@ -3,26 +3,27 @@
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
|
6 |
-
"Report-Msgid-Bugs-To:
|
7 |
-
"
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"X-Generator: grunt-wp-i18n 0.5.3\n"
|
15 |
-
"X-Poedit-KeywordsList: "
|
16 |
-
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
|
17 |
-
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
|
18 |
"Language: en\n"
|
19 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
20 |
"X-Poedit-Country: United States\n"
|
21 |
"X-Poedit-SourceCharset: UTF-8\n"
|
|
|
|
|
|
|
22 |
"X-Poedit-Basepath: ../\n"
|
23 |
"X-Poedit-SearchPath-0: .\n"
|
24 |
"X-Poedit-Bookmarks: \n"
|
25 |
"X-Textdomain-Support: yes\n"
|
|
|
26 |
|
27 |
#: inc/class-custom-sidebars-checkup-notification.php:114
|
28 |
msgid ""
|
@@ -104,19 +105,20 @@ msgid "Front Page"
|
|
104 |
msgstr ""
|
105 |
|
106 |
#: inc/class-custom-sidebars-editor.php:455
|
|
|
107 |
msgid "Search Results"
|
108 |
msgstr ""
|
109 |
|
110 |
#: inc/class-custom-sidebars-editor.php:456
|
111 |
#: inc/class-custom-sidebars-visibility.php:162
|
112 |
-
msgid "Not
|
113 |
msgstr ""
|
114 |
|
115 |
#: inc/class-custom-sidebars-editor.php:457
|
116 |
msgid "Any Author Archive"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: inc/class-custom-sidebars-editor.php:458
|
120 |
msgid "Date Archives"
|
121 |
msgstr ""
|
122 |
|
@@ -228,17 +230,13 @@ msgstr[0] ""
|
|
228 |
msgstr[1] ""
|
229 |
|
230 |
#: inc/class-custom-sidebars-visibility.php:158
|
231 |
-
msgid "Single
|
232 |
msgstr ""
|
233 |
|
234 |
#: inc/class-custom-sidebars-visibility.php:160
|
235 |
msgid "Archives"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: inc/class-custom-sidebars-visibility.php:161
|
239 |
-
msgid "Search results"
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
#: inc/class-custom-sidebars-visibility.php:163 views/widgets-export.php:43
|
243 |
msgid "Preview"
|
244 |
msgstr ""
|
@@ -291,12 +289,12 @@ msgstr ""
|
|
291 |
msgid "Membership2"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: inc/class-custom-sidebars-visibility.php:245 views/import.php:
|
295 |
-
msgid "Special
|
296 |
msgstr ""
|
297 |
|
298 |
#: inc/class-custom-sidebars-visibility.php:250
|
299 |
-
msgid "For
|
300 |
msgstr ""
|
301 |
|
302 |
#: inc/class-custom-sidebars-visibility.php:252
|
@@ -366,7 +364,7 @@ msgid ""
|
|
366 |
"\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: inc/class-custom-sidebars.php:962 views/import.php:
|
370 |
msgid "Widgets"
|
371 |
msgstr ""
|
372 |
|
@@ -412,7 +410,7 @@ msgstr ""
|
|
412 |
msgid "WPML"
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: views/bulk-edit.php:23 views/import.php:
|
416 |
msgid "Custom Sidebars"
|
417 |
msgstr ""
|
418 |
|
@@ -449,15 +447,15 @@ msgid "Exported on"
|
|
449 |
msgstr ""
|
450 |
|
451 |
#: views/import.php:84
|
452 |
-
msgid "WordPress
|
453 |
msgstr ""
|
454 |
|
455 |
#: views/import.php:95
|
456 |
-
msgid "WordPress
|
457 |
msgstr ""
|
458 |
|
459 |
#: views/import.php:100
|
460 |
-
msgid "Plugin
|
461 |
msgstr ""
|
462 |
|
463 |
#: views/import.php:102
|
@@ -468,87 +466,80 @@ msgstr ""
|
|
468 |
msgid "Theme"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: views/import.php:
|
472 |
msgid "Mark the sidebars that you want to import."
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: views/import.php:
|
476 |
msgid "Also import all widgets of the selected sidebars."
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: views/import.php:
|
480 |
msgid "Name"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: views/import.php:
|
484 |
msgid "Description"
|
485 |
msgstr ""
|
486 |
|
487 |
-
#: views/import.php:
|
488 |
msgid "Note"
|
489 |
msgstr ""
|
490 |
|
491 |
-
#: views/import.php:
|
492 |
msgid "New sidebar will be created"
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: views/import.php:
|
496 |
msgid "Existing sidebar will be replaced!"
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: views/import.php:
|
500 |
msgid "(Theme sidebar)"
|
501 |
msgstr ""
|
502 |
|
503 |
-
#: views/import.php:
|
504 |
msgid "Configuration"
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: views/import.php:
|
508 |
-
msgid "Replaceable
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: views/import.php:
|
512 |
-
msgid "
|
513 |
msgstr ""
|
514 |
|
515 |
-
#: views/import.php:
|
516 |
-
msgid "
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: views/import.php:
|
520 |
-
msgid "
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: views/import.php:
|
524 |
-
|
|
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: views/import.php:
|
528 |
-
msgid "
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: views/import.php:369
|
532 |
-
msgid "
|
533 |
msgstr ""
|
534 |
|
535 |
#: views/import.php:370
|
536 |
-
msgid "
|
537 |
msgstr ""
|
538 |
|
539 |
#: views/import.php:371
|
540 |
-
msgid "
|
541 |
-
msgstr ""
|
542 |
-
|
543 |
-
#: views/import.php:372
|
544 |
-
msgid "Tag archives"
|
545 |
-
msgstr ""
|
546 |
-
|
547 |
-
#: views/import.php:373
|
548 |
-
msgid "Search results page"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: views/import.php:
|
552 |
msgid "Replace the current plugin configuration with the imported configuration."
|
553 |
msgstr ""
|
554 |
|
@@ -702,18 +693,10 @@ msgstr ""
|
|
702 |
msgid "Archive Types"
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: views/widgets-location.php:156 views/widgets-location.php:177
|
706 |
-
msgid "Category Archives"
|
707 |
-
msgstr ""
|
708 |
-
|
709 |
#: views/widgets-location.php:157
|
710 |
msgid "Authors"
|
711 |
msgstr ""
|
712 |
|
713 |
-
#: views/widgets-location.php:188
|
714 |
-
msgid "Author Archives"
|
715 |
-
msgstr ""
|
716 |
-
|
717 |
#: views/widgets-location.php:206
|
718 |
msgid "For Screen Sizes"
|
719 |
msgstr ""
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
|
6 |
+
"Report-Msgid-Bugs-To: "
|
7 |
+
"https://wordpress.org/support/plugin/custom-sidebars-pro\n"
|
8 |
+
"POT-Creation-Date: 2018-08-22 20:11:52+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
|
|
|
|
|
|
|
15 |
"Language: en\n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
17 |
"X-Poedit-Country: United States\n"
|
18 |
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
+
"X-Poedit-KeywordsList: "
|
20 |
+
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
|
21 |
+
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
|
22 |
"X-Poedit-Basepath: ../\n"
|
23 |
"X-Poedit-SearchPath-0: .\n"
|
24 |
"X-Poedit-Bookmarks: \n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
+
"X-Generator: grunt-wp-i18n1.0.2\n"
|
27 |
|
28 |
#: inc/class-custom-sidebars-checkup-notification.php:114
|
29 |
msgid ""
|
105 |
msgstr ""
|
106 |
|
107 |
#: inc/class-custom-sidebars-editor.php:455
|
108 |
+
#: inc/class-custom-sidebars-visibility.php:161
|
109 |
msgid "Search Results"
|
110 |
msgstr ""
|
111 |
|
112 |
#: inc/class-custom-sidebars-editor.php:456
|
113 |
#: inc/class-custom-sidebars-visibility.php:162
|
114 |
+
msgid "Not Found (404)"
|
115 |
msgstr ""
|
116 |
|
117 |
#: inc/class-custom-sidebars-editor.php:457
|
118 |
msgid "Any Author Archive"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: inc/class-custom-sidebars-editor.php:458 views/import.php:368
|
122 |
msgid "Date Archives"
|
123 |
msgstr ""
|
124 |
|
230 |
msgstr[1] ""
|
231 |
|
232 |
#: inc/class-custom-sidebars-visibility.php:158
|
233 |
+
msgid "Single Page"
|
234 |
msgstr ""
|
235 |
|
236 |
#: inc/class-custom-sidebars-visibility.php:160
|
237 |
msgid "Archives"
|
238 |
msgstr ""
|
239 |
|
|
|
|
|
|
|
|
|
240 |
#: inc/class-custom-sidebars-visibility.php:163 views/widgets-export.php:43
|
241 |
msgid "Preview"
|
242 |
msgstr ""
|
289 |
msgid "Membership2"
|
290 |
msgstr ""
|
291 |
|
292 |
+
#: inc/class-custom-sidebars-visibility.php:245 views/import.php:364
|
293 |
+
msgid "Special Pages"
|
294 |
msgstr ""
|
295 |
|
296 |
#: inc/class-custom-sidebars-visibility.php:250
|
297 |
+
msgid "For Post Type"
|
298 |
msgstr ""
|
299 |
|
300 |
#: inc/class-custom-sidebars-visibility.php:252
|
364 |
"\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: inc/class-custom-sidebars.php:962 views/import.php:145
|
368 |
msgid "Widgets"
|
369 |
msgstr ""
|
370 |
|
410 |
msgid "WPML"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: views/bulk-edit.php:23 views/import.php:128 views/widgets.php:47
|
414 |
msgid "Custom Sidebars"
|
415 |
msgstr ""
|
416 |
|
447 |
msgstr ""
|
448 |
|
449 |
#: views/import.php:84
|
450 |
+
msgid "WordPress Settings"
|
451 |
msgstr ""
|
452 |
|
453 |
#: views/import.php:95
|
454 |
+
msgid "WordPress Version"
|
455 |
msgstr ""
|
456 |
|
457 |
#: views/import.php:100
|
458 |
+
msgid "Plugin Version"
|
459 |
msgstr ""
|
460 |
|
461 |
#: views/import.php:102
|
466 |
msgid "Theme"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: views/import.php:130
|
470 |
msgid "Mark the sidebars that you want to import."
|
471 |
msgstr ""
|
472 |
|
473 |
+
#: views/import.php:135
|
474 |
msgid "Also import all widgets of the selected sidebars."
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: views/import.php:142 views/widgets-editor.php:15
|
478 |
msgid "Name"
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: views/import.php:143 views/widgets-editor.php:20
|
482 |
msgid "Description"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: views/import.php:144
|
486 |
msgid "Note"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: views/import.php:152
|
490 |
msgid "New sidebar will be created"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: views/import.php:154
|
494 |
msgid "Existing sidebar will be replaced!"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: views/import.php:222
|
498 |
msgid "(Theme sidebar)"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: views/import.php:250
|
502 |
msgid "Configuration"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: views/import.php:254 views/import.php:257
|
506 |
+
msgid "Replaceable Sidebars"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: views/import.php:276
|
510 |
+
msgid "By Post Type"
|
511 |
msgstr ""
|
512 |
|
513 |
+
#: views/import.php:305
|
514 |
+
msgid "Post-Type Archives"
|
515 |
msgstr ""
|
516 |
|
517 |
+
#: views/import.php:326
|
518 |
+
msgid "By Category"
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: views/import.php:346 views/widgets-location.php:156
|
522 |
+
#: views/widgets-location.php:177
|
523 |
+
msgid "Category Archives"
|
524 |
msgstr ""
|
525 |
|
526 |
+
#: views/import.php:367
|
527 |
+
msgid "Main Blog Page"
|
528 |
msgstr ""
|
529 |
|
530 |
+
#: views/import.php:369 views/widgets-location.php:188
|
531 |
+
msgid "Author Archives"
|
532 |
msgstr ""
|
533 |
|
534 |
#: views/import.php:370
|
535 |
+
msgid "Tag Archives"
|
536 |
msgstr ""
|
537 |
|
538 |
#: views/import.php:371
|
539 |
+
msgid "Search Results Page"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
msgstr ""
|
541 |
|
542 |
+
#: views/import.php:381
|
543 |
msgid "Replace the current plugin configuration with the imported configuration."
|
544 |
msgstr ""
|
545 |
|
693 |
msgid "Archive Types"
|
694 |
msgstr ""
|
695 |
|
|
|
|
|
|
|
|
|
696 |
#: views/widgets-location.php:157
|
697 |
msgid "Authors"
|
698 |
msgstr ""
|
699 |
|
|
|
|
|
|
|
|
|
700 |
#: views/widgets-location.php:206
|
701 |
msgid "For Screen Sizes"
|
702 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Custom Sidebars - Dynamic Widget Area Manager ===
|
2 |
Contributors: WPMUDEV, marquex, WPMUDEV-Support2, WPMUDEV-Support1, WPMUDEV-Support6, WPMUDEV-Support4, iworks
|
3 |
Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
|
4 |
-
Requires at least: 3.
|
5 |
Tested up to: 4.9.8
|
6 |
-
Stable tag: 3.2.
|
7 |
|
8 |
Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
|
9 |
|
@@ -111,6 +111,9 @@ Custom Sidebars has the same license as WordPress, so you can use it wherever yo
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
114 |
= 3.2.0 =
|
115 |
* Added ability show/hide widgets depend on screen size, using CSS media queries.
|
116 |
* Added integration with "WP Multilang" - now you can choose a sidebar to depend on "WP Multilang" language.
|
1 |
=== Custom Sidebars - Dynamic Widget Area Manager ===
|
2 |
Contributors: WPMUDEV, marquex, WPMUDEV-Support2, WPMUDEV-Support1, WPMUDEV-Support6, WPMUDEV-Support4, iworks
|
3 |
Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
|
4 |
+
Requires at least: 3.8
|
5 |
Tested up to: 4.9.8
|
6 |
+
Stable tag: 3.2.1
|
7 |
|
8 |
Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
|
9 |
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 3.2.1 =
|
115 |
+
* Fixed a problem with sidebar replacement on front page.
|
116 |
+
|
117 |
= 3.2.0 =
|
118 |
* Added ability show/hide widgets depend on screen size, using CSS media queries.
|
119 |
* Added integration with "WP Multilang" - now you can choose a sidebar to depend on "WP Multilang" language.
|
views/import.php
CHANGED
@@ -81,7 +81,7 @@ function list_sidebar_replacement( $label, $list ) {
|
|
81 |
</tbody>
|
82 |
</table>
|
83 |
|
84 |
-
<div class="section"><?php _e( 'WordPress
|
85 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
86 |
<thead>
|
87 |
<tr>
|
@@ -92,12 +92,12 @@ function list_sidebar_replacement( $label, $list ) {
|
|
92 |
</thead>
|
93 |
<tbody>
|
94 |
<tr>
|
95 |
-
<th><?php _e( 'WordPress
|
96 |
<td><?php echo esc_html( $import['meta']['wp_version'] ); ?></td>
|
97 |
<td><?php echo esc_html( $wp_version ); ?></td>
|
98 |
</tr>
|
99 |
<tr>
|
100 |
-
<th><?php _e( 'Plugin
|
101 |
<td><?php echo esc_html( $import['meta']['csb_version'] ); ?></td>
|
102 |
<td><?php echo esc_html( isset( $csb_info['Version'] )? $csb_info['Version'] : __( 'Unknown', 'custom-sidebars' ) ); ?></td>
|
103 |
</tr>
|
@@ -115,11 +115,9 @@ function list_sidebar_replacement( $label, $list ) {
|
|
115 |
<pre><?php echo esc_html( stripslashes( $import['meta']['description'] ) ); ?></pre>
|
116 |
<?php endif; ?>
|
117 |
|
118 |
-
|
119 |
<form class="frm-import csb-form">
|
120 |
<input type="hidden" name="do" value="import" />
|
121 |
|
122 |
-
|
123 |
<?php
|
124 |
/* *****************************************************************
|
125 |
*
|
@@ -253,7 +251,7 @@ if ( count( $import_sidebar ) ) {
|
|
253 |
<div class="show-infos">
|
254 |
<i class="dashicons dashicons-info"></i>
|
255 |
<div class="export-infos" style="display:none">
|
256 |
-
<div class="section"><?php _e( 'Replaceable
|
257 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
258 |
<tr>
|
259 |
<th scope="row"><?php _e( 'Replaceable Sidebars', 'custom-sidebars' ); ?></th>
|
@@ -275,7 +273,7 @@ if (
|
|
275 |
) {
|
276 |
printf(
|
277 |
'<div class="section">%s/div>',
|
278 |
-
esc_html__( 'By
|
279 |
);
|
280 |
echo '<table cellspacing="1" cellpadding="4" class="csb-export-head">';
|
281 |
$list = $import['options']['post_type_single'];
|
@@ -304,7 +302,7 @@ if (
|
|
304 |
&& is_array( $import['options']['post_type_archive'] )
|
305 |
) {
|
306 |
?>
|
307 |
-
<div class="section"><?php _e( 'Post-
|
308 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
309 |
<?php
|
310 |
$list = $import['options']['post_type_archive'];
|
@@ -325,7 +323,7 @@ if (
|
|
325 |
) {
|
326 |
|
327 |
?>
|
328 |
-
<div class="section"><?php _e( 'By
|
329 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
330 |
<?php
|
331 |
$list = $import['options']['category_single'];
|
@@ -345,7 +343,7 @@ if (
|
|
345 |
&& is_array( $import['options']['category_archive'] )
|
346 |
) {
|
347 |
?>
|
348 |
-
<div class="section"><?php _e( 'Category
|
349 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
350 |
<?php
|
351 |
$list = $import['options']['category_archive'];
|
@@ -363,14 +361,14 @@ foreach ( $list as $key => $values ) {
|
|
363 |
}
|
364 |
?>
|
365 |
<?php /* special pages */ ?>
|
366 |
-
<div class="section"><?php _e( 'Special
|
367 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
368 |
<?php
|
369 |
-
list_sidebar_replacement( __( 'Main
|
370 |
-
list_sidebar_replacement( __( 'Date
|
371 |
-
list_sidebar_replacement( __( 'Author
|
372 |
-
list_sidebar_replacement( __( 'Tag
|
373 |
-
list_sidebar_replacement( __( 'Search
|
374 |
?>
|
375 |
</table>
|
376 |
</div>
|
81 |
</tbody>
|
82 |
</table>
|
83 |
|
84 |
+
<div class="section"><?php _e( 'WordPress Settings', 'custom-sidebars' ); ?></div>
|
85 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
86 |
<thead>
|
87 |
<tr>
|
92 |
</thead>
|
93 |
<tbody>
|
94 |
<tr>
|
95 |
+
<th><?php _e( 'WordPress Version', 'custom-sidebars' ); ?></th>
|
96 |
<td><?php echo esc_html( $import['meta']['wp_version'] ); ?></td>
|
97 |
<td><?php echo esc_html( $wp_version ); ?></td>
|
98 |
</tr>
|
99 |
<tr>
|
100 |
+
<th><?php _e( 'Plugin Version', 'custom-sidebars' ); ?></th>
|
101 |
<td><?php echo esc_html( $import['meta']['csb_version'] ); ?></td>
|
102 |
<td><?php echo esc_html( isset( $csb_info['Version'] )? $csb_info['Version'] : __( 'Unknown', 'custom-sidebars' ) ); ?></td>
|
103 |
</tr>
|
115 |
<pre><?php echo esc_html( stripslashes( $import['meta']['description'] ) ); ?></pre>
|
116 |
<?php endif; ?>
|
117 |
|
|
|
118 |
<form class="frm-import csb-form">
|
119 |
<input type="hidden" name="do" value="import" />
|
120 |
|
|
|
121 |
<?php
|
122 |
/* *****************************************************************
|
123 |
*
|
251 |
<div class="show-infos">
|
252 |
<i class="dashicons dashicons-info"></i>
|
253 |
<div class="export-infos" style="display:none">
|
254 |
+
<div class="section"><?php _e( 'Replaceable Sidebars', 'custom-sidebars' ); ?></div>
|
255 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
256 |
<tr>
|
257 |
<th scope="row"><?php _e( 'Replaceable Sidebars', 'custom-sidebars' ); ?></th>
|
273 |
) {
|
274 |
printf(
|
275 |
'<div class="section">%s/div>',
|
276 |
+
esc_html__( 'By Post Type', 'custom-sidebars' )
|
277 |
);
|
278 |
echo '<table cellspacing="1" cellpadding="4" class="csb-export-head">';
|
279 |
$list = $import['options']['post_type_single'];
|
302 |
&& is_array( $import['options']['post_type_archive'] )
|
303 |
) {
|
304 |
?>
|
305 |
+
<div class="section"><?php _e( 'Post-Type Archives', 'custom-sidebars' ); ?></div>
|
306 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
307 |
<?php
|
308 |
$list = $import['options']['post_type_archive'];
|
323 |
) {
|
324 |
|
325 |
?>
|
326 |
+
<div class="section"><?php _e( 'By Category', 'custom-sidebars' ); ?></div>
|
327 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
328 |
<?php
|
329 |
$list = $import['options']['category_single'];
|
343 |
&& is_array( $import['options']['category_archive'] )
|
344 |
) {
|
345 |
?>
|
346 |
+
<div class="section"><?php _e( 'Category Archives', 'custom-sidebars' ); ?></div>
|
347 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
348 |
<?php
|
349 |
$list = $import['options']['category_archive'];
|
361 |
}
|
362 |
?>
|
363 |
<?php /* special pages */ ?>
|
364 |
+
<div class="section"><?php _e( 'Special Pages', 'custom-sidebars' ); ?></div>
|
365 |
<table cellspacing="1" cellpadding="4" class="csb-export-head">
|
366 |
<?php
|
367 |
+
list_sidebar_replacement( __( 'Main Blog Page', 'custom-sidebars' ), $import['options']['blog'] );
|
368 |
+
list_sidebar_replacement( __( 'Date Archives', 'custom-sidebars' ), $import['options']['date'] );
|
369 |
+
list_sidebar_replacement( __( 'Author Archives', 'custom-sidebars' ), $import['options']['authors'] );
|
370 |
+
list_sidebar_replacement( __( 'Tag Archives', 'custom-sidebars' ), $import['options']['tags'] );
|
371 |
+
list_sidebar_replacement( __( 'Search Results Page', 'custom-sidebars' ), $import['options']['search'] );
|
372 |
?>
|
373 |
</table>
|
374 |
</div>
|
views/metabox.php
CHANGED
@@ -60,7 +60,7 @@ function custom_sidebars_replace_not_allowed( $page_name, $img, $archive = null
|
|
60 |
);
|
61 |
echo '</ul>';
|
62 |
echo '</p>';
|
63 |
-
$url = esc_url( CSB_IMG_URL . 'metabox/' . $img . '?version=3.2.
|
64 |
printf(
|
65 |
'<a href="%s" target="_blank"><img src="%s" style="width:100%%" /><a>',
|
66 |
$url,
|
60 |
);
|
61 |
echo '</ul>';
|
62 |
echo '</p>';
|
63 |
+
$url = esc_url( CSB_IMG_URL . 'metabox/' . $img . '?version=3.2.1' );
|
64 |
printf(
|
65 |
'<a href="%s" target="_blank"><img src="%s" style="width:100%%" /><a>',
|
66 |
$url,
|