WordPress Button Plugin MaxButtons - Version 6.24

Version Description

  • Social Share deprecated. For Social Sharing please check the new MaxButton Social Share addon
  • New allowed link URL's schemes - ms-windows-store and steam.
  • Fixed Copy Color interface
  • Improvements how Modals handle scrolling
  • Change / Issue in MaxCSSParser which didn't allow to properly parse Pseudo CSS element which are a parent of the main anchor class.
  • Improvements in editor
Download this release

Release Info

Developer basszje
Plugin Icon 128x128 WordPress Button Plugin MaxButtons
Version 6.24
Comparing to
See all releases

Code changes from version 6.23 to 6.24

assets/css/style.css CHANGED
@@ -1 +1 @@
1
- .mb_colorpicker{z-index:200}.ads .button-primary{display:block;margin:0 auto 20px auto;width:210px;text-align:center;overflow:visible}.max-load-spinner{background:url("/wp-admin/images/wpspin_light.gif") no-repeat;background-size:16px 16px;opacity:.9;width:16px;height:16px;display:inline-block;vertical-align:middle;position:absolute;top:50%;left:50%;margin-left:-8px;margin-top:-8px;z-index:10}.max-load-overlay{position:absolute;top:0;left:0;right:0;bottom:0;opacity:0.80;background-color:#f0f0f0;z-index:9}#maxbuttons{display:inline-block;width:100%}#maxbuttons .message,#maxbuttons .mb-message{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:10px;margin:10px 0px 20px 0px;clear:both}#maxbuttons .main{position:relative;z-index:500;margin-top:15px;width:72%;float:left}#maxbuttons .mb-message.error{font-weight:700}#maxbuttons .mb-message.shortcode,#maxbuttons .mb-message.mb-notice{border:solid 1px #e6db55;background-color:#ffffe0}#maxbuttons .button-bar,#maxbuttons .form-actions,#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1){margin:15px 0;padding:10px;background:#fbfbfb none repeat scroll 0 0;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:28px}#maxbuttons h1>span{vertical-align:top;float:left}@media (max-width: 1024px){#maxbuttons h1>span{float:none}}#maxbuttons .logo{font-weight:400;font-size:13px;overflow:hidden;text-align:center}@media (max-width: 1024px){#maxbuttons .logo{text-align:left;margin-top:15px}}#maxbuttons .logo img{vertical-align:middle;padding-left:5px;padding-right:5px}#maxbuttons .logo .fb-like{margin-top:5px;height:20px;padding:0;margin-left:180px;overflow:hidden}#maxbuttons .logo .fb-like span{vertical-align:top !important}#maxbuttons .dummy-heading{display:none}@media screen and (max-width: 960px){#maxbuttons .main{width:100%}}#maxbuttons .tablenav .input-paging{width:55px}#maxbuttons .ads ul li{margin-bottom:4px}#maxbuttons .preview-buttons{background-color:#fff;border:1px solid #dfdfdf;overflow:hidden}#maxbuttons .preview-buttons .heading{width:100%;clear:both;display:inline-block;border-bottom:1px solid #dfdfdf}#maxbuttons .preview-buttons .heading>span{display:inline-block;font-weight:700;font-size:14px;float:left}#maxbuttons .preview-buttons .button-row{width:100%;clear:both;display:inline-block;border-bottom:1px solid #dfdfdf}#maxbuttons .preview-buttons .button-row>span{display:inline-block;font-size:13px;float:left;overflow:hidden}#maxbuttons .preview-buttons .button-row .actions{margin:10px 0;padding:10px 0px 10px 8px;display:inline-block;z-index:11;width:50%;background-color:#fff;position:relative}#maxbuttons .preview-buttons .col{padding:10px 0 10px 1%}#maxbuttons .preview-buttons .col_check{width:20px}#maxbuttons .preview-buttons .col_button{width:60%;overflow:hidden}@media (max-width: 780px){#maxbuttons .preview-buttons .col_button{width:70%;margin-right:5%}}#maxbuttons .preview-buttons .col_name{width:15%}@media (max-width: 780px){#maxbuttons .preview-buttons .col_name{display:none !important}}#maxbuttons .preview-buttons .col_shortcode{width:15%;padding-right:0}#maxbuttons p.status a{text-decoration:none}#maxbuttons p.status span.count{color:#999999}#maxbuttons .button-list{margin-top:10px}#maxbuttons .button-list p{font-size:13px}#maxbuttons .button-list a{text-decoration:none}#maxbuttons .button-list a.button-name{font-weight:bold}#maxbuttons .button-list .shortcode-container{margin:10px 0px 10px 2px}#maxbuttons .button-list .collection_notice{text-align:right;margin:10px 5px 0 0;padding-top:10px;float:right}#maxbuttons .shortcode-container .mb-container{margin:0 !important;float:none !important;max-width:100% !important}#maxbuttons .shortcode-container .mb-center{text-align:left !important}#maxbuttons .pagination-links a.disabled{color:#aaa;cursor:default}#maxbuttons .pagination-links a.disabled:hover{background:#e4e4e4 none repeat scroll 0 0;cursor:default;border:1px solid #d2d2d2}#maxbuttons .pagination{width:100%;display:inline-block;margin:15px 0 5px}#maxbuttons .pagination li{float:left;margin-right:5px}#maxbuttons .pagination li a,#maxbuttons .pagination li span{background:#ccc;vertical-align:middle;padding:4px 10px 8px;height:15px;display:inline-block;border:1px solid #eee;text-decoration:none;font-size:14px;font-weight:bold}#maxbuttons.maxbuttons-controller-edit .main,#maxbuttons.maxbuttons-controller-button .main{width:auto;max-width:1200px}#maxbuttons .option-container{margin-bottom:20px;border:solid 1px #cccccc;border-radius:3px 3px 3px 3px;-webkit-border-radius:3px 3px 3px 3px;background-color:#fff}#maxbuttons .option-container .title{font-size:18px;padding:9px 8px 9px 10px;text-align:left;text-shadow:0px 1px 0px #ffffff;position:relative}#maxbuttons .option-container .section-title{padding:15px;margin-top:10px;font-weight:700;font-size:16px}#maxbuttons .option-container .section-title{background-color:#fff}#maxbuttons .option-container .option-list{display:inline-block}#maxbuttons .option-container .option-list:after{clear:both}#maxbuttons .option-container .option-list .help{float:right;margin-top:5px}#maxbuttons .option-container .help{position:relative;width:18px;height:18px;font-size:18px;margin-left:10px}#maxbuttons .option-container .help span{font-family:"Open Sans",sans-serif;font-size:12px;background-color:#fff;color:#000;position:absolute;display:none;padding:10px 5px;top:-7px;left:25px;min-width:150px;border-radius:5px;text-align:center;z-index:1000;border:1px solid #ccc;line-height:15px}#maxbuttons .option-container .help:hover span{display:block}#maxbuttons .option-container>.inside{padding:10px 15px 10px 15px;border-top:solid 1px #cccccc;background-color:#ffffff}#maxbuttons .option-container>.inside .option,#maxbuttons .option-container>.inside .option-design{margin-bottom:10px;display:block;position:relative}#maxbuttons .option-container>.inside .option .label,#maxbuttons .option-container>.inside .option>label,#maxbuttons .option-container>.inside .option-design .label,#maxbuttons .option-container>.inside .option-design>label{display:inline-block;font-weight:bold;padding-left:3px;padding-top:5px;width:145px;vertical-align:top;cursor:default;min-height:25px}#maxbuttons .option-container>.inside .option .label[for],#maxbuttons .option-container>.inside .option>label[for],#maxbuttons .option-container>.inside .option-design .label[for],#maxbuttons .option-container>.inside .option-design>label[for]{cursor:pointer}@media (max-width: 780px){#maxbuttons .option-container>.inside .option .label,#maxbuttons .option-container>.inside .option>label,#maxbuttons .option-container>.inside .option-design .label,#maxbuttons .option-container>.inside .option-design>label{font-size:14px}}#maxbuttons .option-container>.inside .option:after,#maxbuttons .option-container>.inside .option:before,#maxbuttons .option-container>.inside .option-design:after,#maxbuttons .option-container>.inside .option-design:before{clear:both}#maxbuttons .option-container>.inside .option label{margin-top:2px}#maxbuttons .option-container>.inside .option label.mbcolor{margin-top:5px}#maxbuttons .option-container>.inside .option label:nth-of-type(2){margin-left:30px;width:115px}#maxbuttons .option-container>.inside .option .control-group{display:inline-block}#maxbuttons .option-container>.inside .option .rotate-left{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45));-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45))";zoom:1}#maxbuttons .option-container>.inside .option .rotate-right{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45));-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45))";zoom:1}#maxbuttons .option-design{margin-bottom:10px}#maxbuttons .option-design .input td div.cell-label{padding:1px 10px 0px 5px;font-weight:bold;border-bottom:solid 1px #d1d1d1;width:180px;font-size:13px;height:30px}#maxbuttons .option-design .default-other{font-size:13px}#maxbuttons .option p.note,#maxbuttons .option-design p.note{font-style:italic;display:inline-block;clear:both;color:#808080;padding-left:3px;margin-top:10px;margin-bottom:5px;margin-left:0;display:block}#maxbuttons .mb-message.shortcode .expanded,#maxbuttons .mb-message.mb-notice .expanded{display:none}#maxbuttons .mb-message.shortcode .expanded .example strong,#maxbuttons .mb-message.mb-notice .expanded .example strong{width:300px;display:inline-block}#maxbuttons .mb-message.shortcode .shortcode-expand,#maxbuttons .mb-message.mb-notice .shortcode-expand{clear:both;font-weight:700;display:block;margin:5px 0;cursor:pointer}@media (max-width: 1024px){#maxbuttons .mb-message.shortcode .shortcode-expand,#maxbuttons .mb-message.mb-notice .shortcode-expand{float:none;text-align:left;margin:10px 0;display:block}}#maxbuttons .manual-box{float:right;margin:3px 15px;top:0;right:0}#maxbuttons .manual-box a{text-align:center;width:100%;background:#e0e0e0 none repeat scroll 0 0;font-size:13px;font-weight:600;margin-left:4px;margin-top:5px;padding:4px 8px;position:relative;text-decoration:none;text-shadow:none}#maxbuttons .manual-entry{display:none;position:absolute;border:1px solid #000;background:#fff;width:45%;right:25px;z-index:199;box-sizing:border-box;padding-bottom:20px}#maxbuttons .manual-entry h3{font-size:18px;width:calc(100%);box-sizing:border-box;padding:10px 0;border-bottom:1px solid #ccc;text-align:center;margin:0;padding-right:35px;position:relative}#maxbuttons .manual-entry h3 span{box-sizing:border-box;cursor:pointer;width:35px;height:100%;font-size:25px;display:inline-block;position:absolute;right:5px;top:0;padding-top:8px}#maxbuttons .manual-entry h4,#maxbuttons .manual-entry p,#maxbuttons .manual-entry ol,#maxbuttons .manual-entry ul{padding:0 15px}#maxbuttons .manual-entry h4{font-size:16px}#maxbuttons .manual-entry p{font-size:13px}#maxbuttons .output{position:fixed;top:45px;right:20px;background-color:#ffffff;border:solid 1px #414141;box-shadow:0px 0px 6px #808080;z-index:99;width:auto;min-width:300px}@media (max-width: 780px){#maxbuttons .output{-webkit-box-shadow:0 0 0 0;-moz-box-shadow:0 0 0 0;box-shadow:0 0 0 0;top:0;left:0;right:0;position:relative;margin-bottom:15px;border-color:#ccc}}#maxbuttons .output .header{color:#222222;background-color:#ffffff;border-bottom:solid 1px #cccccc;font-family:"Open Sans", sans-serif;font-size:16px;font-weight:bold;padding:8px 0px 8px 10px;cursor:move;position:relative}#maxbuttons .output .header .preview-toggle{float:right;font-size:30px;width:30px;position:absolute;top:3px;right:0}#maxbuttons .output .inner{padding:5px}#maxbuttons .output .inner p{padding:5px 0 5px 5px}#maxbuttons .output .input.mbcolor{float:left;position:relative;margin-top:5px}#maxbuttons .output .input.mbcolor .wp-picker-container.wp-picker-active{padding:15px;border:1px solid #ccc;background-color:#fff;position:absolute;bottom:-15px;left:-270px;z-index:102;-webkit-box-shadow:4px 1px 5px #ccc;-moz-box-shadow:4px 1px 5px #ccc;box-shadow:4px 1px 5px #ccc}#maxbuttons .output .note{float:left;margin:8px 0px 0px 10px}#maxbuttons .output .result{padding:20px 5px}#maxbuttons .output .result p{padding:5px 0px 5px 0px;margin:0}#maxbuttons .output .result.preview-border-box>*{box-sizing:border-box}#maxbuttons .conditional-option{display:none}#maxbuttons .media_query{width:640px;margin:0 20px 15px 0;border:1px solid #ccc;padding:10px 15px;display:inline-block;clear:both;position:relative}#maxbuttons .media_query .removebutton{position:absolute;right:10px;top:10px;cursor:pointer;z-index:100;padding:10px 5px}#maxbuttons .media_query input:after{clear:both}#maxbuttons .media_query .label{clear:both;margin-bottom:15px}#maxbuttons .media_query label.title{padding:0;font-size:20px}#maxbuttons .media_query .custom.hidden{display:none}#maxbuttons .media_query .option.custom label:nth-of-type(2){margin-left:95px}#maxbuttons .media_query .description{padding:15px 0px;text-align:left}#maxbuttons .media_query select{width:60px}#maxbuttons .media_query .input input{margin-top:0px;padding-top:2px}#maxbuttons .media_queries_options .new-query{margin-top:25px}#maxbuttons .media_queries_options .new-query select{width:auto}#maxbuttons .media_option_prot,#maxbuttons #media_desc{display:none}#maxbuttons .copy-warning{width:400px;margin:0 auto;position:relative;line-height:1.1}#maxbuttons .copy-warning:before{content:"\f534";font-size:40px;color:#ff0000;width:35px;height:35px;font-family:"Dashicons";position:absolute;left:20px;top:40%;margin-top:-14px}#maxbuttons .copy-warning .example{margin-bottom:5px}#maxbuttons .form-actions a{margin-right:10px}#maxbuttons select{width:150px}#maxbuttons select.small{width:auto}#maxbuttons .input{display:inline-block;margin-right:15px;min-height:35px}#maxbuttons .input img{vertical-align:middle}#maxbuttons .input.mbcolor{min-width:50px}#maxbuttons .input.checkbox input{margin-top:0}#maxbuttons .input.checkbox label{line-height:16px;margin-top:0 !important}#maxbuttons input[type='text']{width:450px}@media (max-width: 780px){#maxbuttons input[type='text']{width:350px}}#maxbuttons input[type='text'].tiny{width:35px;vertical-align:middle}#maxbuttons input[type='text'].small{width:50px}#maxbuttons input[type='text'].medium{width:150px}#maxbuttons input[type='text'].tiny-nopad{width:35px}#maxbuttons input[type='number']{vertical-align:middle}#maxbuttons input[type='number'].tiny,#maxbuttons input[type='number'].tiny-nopad{width:55px}@media (max-width: 780px){#maxbuttons input[type='number'].tiny,#maxbuttons input[type='number'].tiny-nopad{width:60px}}#maxbuttons input[type='number'].small{width:70px}@media (max-width: 780px){#maxbuttons input[type='number'].small{width:75px}}#maxbuttons textarea{width:450px;height:80px}#maxbuttons .option-container .inside .option label.mbcolor:nth-of-type(2){margin-left:37px}#maxbuttons .option-container .inside .option.url{margin-bottom:0}#maxbuttons .option-container .inside .option.url_options{margin:5px 0 10px}#maxbuttons .option-container .inside .option.url_options .nofollow{margin-left:35px}#maxbuttons .option-container .inside .option.url_options label,#maxbuttons .option-container .inside .option.rel_options label{font-weight:400}#maxbuttons .option-container .inside .option.font .checkbox{margin-right:2px}#maxbuttons .option-container .inside .option.font .radio{margin-right:0}#maxbuttons .option-container .inside .option.font .input.font{margin-right:2px}#maxbuttons .option-container .inside .option.font .input.font_size{margin-right:0}#maxbuttons .option-container .inside .option.font .input.font_size:after{display:block}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font{display:inline-block}#maxbuttons .option-container .inside .option.font:after{clear:both}#maxbuttons .option-container .inside .option.font>*{float:left}}#maxbuttons .option-container .inside .option.font .control-group.font_weight{margin-left:28px}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font .control-group.font_weight{clear:left;margin-left:148px;margin-top:10px}}#maxbuttons .option-container .inside .option.font .control-group.text_align{margin-left:48px}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font .control-group.text_align{margin-left:20px;margin-top:10px}}#maxbuttons .option-container .inside .option.padding_top .input,#maxbuttons .option-container .inside .option.container_margin_top .input{margin-right:30px}#maxbuttons .option-container .inside .option.padding_top .input:last-of-type,#maxbuttons .option-container .inside .option.container_margin_top .input:last-of-type{margin-right:0}@media (max-width: 780px){#maxbuttons .option-container .inside .option.padding_top .input,#maxbuttons .option-container .inside .option.container_margin_top .input{margin-right:15px}}#maxbuttons .option-container .inside .option.text_color label{padding-top:10px}#maxbuttons .option-container .inside .option.text_color label:nth-of-type(2){margin-left:51px}#maxbuttons .option-container .inside .option.description label{padding-top:35px}#maxbuttons .option-container .inside .option .radius-wrap{position:relative;margin-left:45px;display:inline-block}#maxbuttons .option-container .inside .option.radius .label:first-child{width:100px;float:left}#maxbuttons .option-container .inside .option.radius .bottom,#maxbuttons .option-container .inside .option.radius .top{position:relative}#maxbuttons .option-container .inside .option.radius .bottom .input,#maxbuttons .option-container .inside .option.radius .top .input{margin-right:0;margin-left:0}#maxbuttons .option-container .inside .option.radius .bottom .dashicons:nth-child(3),#maxbuttons .option-container .inside .option.radius .top .dashicons:nth-child(3){margin-right:10px}#maxbuttons .option-container .inside .option.radius .top{margin-bottom:10px}#maxbuttons .option-container .inside .option.radius label{display:inline-block;font-weight:700;width:90px;margin-left:5px;cursor:default}#maxbuttons .option-container .inside .option.radius .dashicons{font-size:35px;height:35px;width:35px;color:#ccc}#maxbuttons .option-container .inside .option.radius .top .dashicons{margin-top:-5px}#maxbuttons .option-container .inside .option.radius .bottom .dashicons{margin-top:5px}#maxbuttons .option-container .inside .option.radius #radius_toggle{position:absolute;left:46%;top:25px;font-size:30px;cursor:pointer}#maxbuttons .option-container .inside .option.gradient_head .label:nth-child(even){width:120px}#maxbuttons .option-container .inside .option .gradient_end_color,#maxbuttons .option-container .inside .option .gradient_end_color_hover{margin-left:58px}#maxbuttons .default{display:inline-block;padding-left:10px;padding-top:4px;font-style:italic;color:#808080}#maxbuttons .default .other{padding-left:40px;padding-top:8px}#maxbuttons .mb-button{width:38px;height:38px;background-color:#eceded;display:inline-block;margin-right:6px;cursor:pointer;display:none}#maxbuttons .mb-button span{text-align:center;padding:9px 0;width:100%;line-height:20px}#maxbuttons .check_button{display:none}#maxbuttons .check_button+label{background-position:center center;background-repeat:no-repeat;background-color:#fff;display:inline-block;border:1px solid #ddd;font_weight:normal;padding:4px}@media (max-width: 780px){#maxbuttons .check_button+label{padding:10px}}#maxbuttons .check_button.text+label{padding:5px}#maxbuttons .check_button.icon+label i{width:20px;height:20px;color:#545454}#maxbuttons .check_button.icon+label i:focus{outline:none}#maxbuttons .check_button:checked+label{background:#ebebeb none repeat scroll 0 0;border-color:#999999;box-shadow:0 2px 5px -3px rgba(0,0,0,0.3) inset}#maxbuttons .option .input_label{display:inline-block;vertical-align:top}#maxbuttons .option .input_label.left{margin-right:10px}#maxbuttons .option .input_label.right{margin-left:10px}#maxbuttons .option .range_value{margin-top:5px}#maxbuttons .option .range_value output{clear:both;font-size:18px;text-align:center;width:100%;display:inline-block}#maxbuttons .option .switch_label{padding-top:2px !important;margin:0 !important}#maxbuttons .switch_button{margin-left:-5px}#maxbuttons .switch_button label{padding:8px 5px}#maxbuttons .switch_button label:focus{outline:none}#maxbuttons .switch_button input{display:none}#maxbuttons .switch_button input:checked ~ .the_switch{background:#6fbeb5}#maxbuttons .switch_button input:checked ~ .the_switch:after{left:26px;background:#179588}#maxbuttons .switch_button input::disabled ~ .the_switch{background:#d5d5d5;pointer-events:none}#maxbuttons .switch_button input:disabled ~ .the_switch:after{background:#bcbdbc}#maxbuttons .switch_button .the_switch{position:relative;display:inline-block;height:15px;width:50px;background:#898989;border-radius:100px;cursor:pointer;transition:all 0.3s ease}#maxbuttons .switch_button .the_switch:after{position:absolute;left:-2px;top:-3px;display:block;width:24px;height:24px;border-radius:100px;background:#aaa;box-shadow:0px 3px 3px rgba(0,0,0,0.05);content:'';transition:all 0.2s ease}#maxbuttons .switch_button .the_switch:active:after{transform:scale(0.9, 0.85)}#maxbuttons .switch_button .the_switch:focus{outline:none}#maxbuttons .input.mbcolor{margin-top:5px;position:relative}#maxbuttons .input.mbcolor .wp-picker-clear{display:none}#maxbuttons .input.mbcolor input[type="text"]{width:75px;line-height:22px}#maxbuttons .input.mbcolor .wp-color-picker{width:inherit}#maxbuttons .input.mbcolor .wp-color-result{-webkit-box-shadow:-1px 1px 2px #999;-moz-box-shadow:-1px 1px 2px #999;box-shadow:-1px 1px 2px #999;height:30px;border:0}#maxbuttons .input.mbcolor .wp-color-result:after{font-size:12px;line-height:30px;display:none}#maxbuttons .input.mbcolor .wp-color-result:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 5px rgba(30,140,190,0.8);-moz-box-shadow:0 0 5px rgba(30,140,190,0.8);box-shadow:0 0 5px rgba(30,140,190,0.8)}#maxbuttons .input.mbcolor .wp-color-result-text{display:none}#maxbuttons .input.mbcolor .wp-picker-input-wrap{padding:0}#maxbuttons .input.mbcolor .wp-picker-active+.arrows{display:inline-block}#maxbuttons .input.mbcolor .arrows{position:absolute;display:none;top:0;margin-top:40%}#maxbuttons .input.mbcolor .arrows.right{right:-45px}#maxbuttons .input.mbcolor .arrows.left{left:-35px}#maxbuttons .input.mbcolor .arrows .arrow-left,#maxbuttons .input.mbcolor .arrows .arrow-right{width:0;height:0;font-size:0;line-height:0;vertical-align:bottom;cursor:pointer}#maxbuttons .input.mbcolor .arrows .arrow-left{border-top:30px solid transparent;border-bottom:30px solid transparent;border-right:20px solid #ccc}#maxbuttons .input.mbcolor .arrows .arrow-right{border-top:30px solid transparent;border-bottom:30px solid transparent;border-left:20px solid #ccc;margin-top:35px}#maxbuttons .input.mbcolor .arrows .left,#maxbuttons .input.mbcolor .arrows .right{display:inline-block;float:left;clear:both;width:35px;height:45px}#maxbuttons .input.mbcolor .arrows .left{margin-top:15px}#maxbuttons [type='range']{-webkit-appearance:none;width:250px}#maxbuttons [type='range']:focus{outline:0}#maxbuttons [type='range']:focus::-webkit-slider-runnable-track{background:#fff}#maxbuttons [type='range']:focus::-ms-fill-lower{background:#fff}#maxbuttons [type='range']:focus::-ms-fill-upper{background:#fff}#maxbuttons [type='range']::-webkit-slider-runnable-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:#fff;border:1px solid #cfd8dc;border-radius:10px}#maxbuttons [type='range']::-webkit-slider-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px;-webkit-appearance:none;margin-top:-7px}#maxbuttons [type='range']::-moz-range-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:#fff;border:1px solid #cfd8dc;border-radius:10px}#maxbuttons [type='range']::-moz-range-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px}#maxbuttons [type='range']::-ms-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:transparent;border-color:transparent;border-width:12px 0;color:transparent}#maxbuttons [type='range']::-ms-fill-lower{background:#f2f2f2;border:1px solid #cfd8dc;border-radius:20px}#maxbuttons [type='range']::-ms-fill-upper{background:#fff;border:1px solid #cfd8dc;border-radius:20px}#maxbuttons [type='range']::-ms-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px;margin-top:0}#maxbuttons .rss-feed{overflow:hidden;clear:both;margin-bottom:20px}#maxbuttons .rss-feed li{width:32%;margin-right:2%;float:left;margin-bottom:2%}#maxbuttons .rss-feed li:nth-child(3n){margin-right:0}#maxbuttons .rss-feed li a{min-height:110px;max-height:110px;overflow:hidden;background:#fff;width:100%;display:block;padding:10px;box-sizing:border-box;border:1px solid #bbb;text-decoration:none;transition:all 200ms;border-radius:2px}#maxbuttons .rss-feed li a:hover{background:#f9f9f9}#maxbuttons .rss-feed li a:hover span{color:#0074a2}#maxbuttons .rss-feed li a span{color:#2ea2cc;font-weight:bold;font-size:1.2em;line-height:1.5em}#maxbuttons .system_info{width:90%;background-color:#fff;border:1px solid #000;padding:15px}#maxbuttons .system_info .info{margin:5px 0}#maxbuttons .system_info .info label{width:250px;display:inline-block;clear:both}#maxbuttons.maxbuttons-settings .option-container .inside .option-design{margin:20px 0}#maxbuttons.maxbuttons-settings .option-container .inside .option-design label{line-height:14px;height:40px;vertical-align:top;width:200px}#maxbuttons h2.tabs{margin:1em 0;min-height:35px}#maxbuttons h2.sub-tabs,#maxbuttons h2.submit-tab{list-style:none;clear:both;margin-bottom:0}#maxbuttons h2.sub-tabs a,#maxbuttons h2.submit-tab a{font-weight:400;font-size:14px;cursor:pointer}#maxbuttons h2.sub-tabs a .dashicons,#maxbuttons h2.submit-tab a .dashicons{margin-right:10px;line-height:24px}#maxbuttons h2.sub-tabs .save-indicator,#maxbuttons h2.submit-tab .save-indicator{float:right;font-size:25px;display:none;margin-right:10px}#maxbuttons h2.sub-tabs .save-indicator.dashicons-warning,#maxbuttons h2.submit-tab .save-indicator.dashicons-warning{color:#ff0000}#maxbuttons h2.sub-tabs .save-indicator.dashicons-yes,#maxbuttons h2.submit-tab .save-indicator.dashicons-yes{color:#00ff00}#maxbuttons.mb_tabs_active .mb_tab{border:0px;background:none;border-radius:0 0 0 0;-webkit-border-radius:0 0 0 0}#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1) button{top:0}#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1) .right{float:right}#maxbuttons.mb_tabs_active .mb_tab>.inside{border:1px solid #e5e5e5}#maxbuttons.maxbuttons-collections-edit .main{width:100%;max-width:none}#maxbuttons .collection-addnew{display:inline-block}@media (max-width: 780px){#maxbuttons .collection-addnew{margin-left:5px}}#maxbuttons .collection_list .collection{position:relative;background-color:#fff;padding:15px;border-radius:15px;margin:15px 0}#maxbuttons .collection_list .collection h3{display:inline-block;width:90%;margin-top:0;font-size:18px;line-height:20px}#maxbuttons .collection_list .collection h3 a{color:#000;font-size:25px;text-decoration:none}#maxbuttons .collection_list .collection h3 a:hover{text-decoration:underline}#maxbuttons .collection_list .collection h3 .dashicons{color:#ccc;margin-left:15px}#maxbuttons .collection_list .collection h3 .button-count{font-weight:400;font-size:15px;margin-left:15px;vertical-align:top}#maxbuttons .collection_list .collection .collection_remove{top:10px;right:15px;font-size:25px;font-weight:400;position:absolute;cursor:pointer}#maxbuttons .collection_list .collection.welcome p{font-size:14px;line-height:22px}#maxbuttons .collection_list .collection-container{position:relative;width:100%;display:inline-block;clear:both}#maxbuttons .collection_list .collection-container .maxcollection{position:static !important}#maxbuttons .inside .preview_collection.option label{display:inline-block;float:none;font-size:25px;width:100%}#maxbuttons .mb_collection_selection{display:inline-block;min-height:300px;margin:25px 0}#maxbuttons .mb_collection_selection .sortable .item{margin-bottom:25px;position:relative;padding-left:30px;min-height:45px;clear:both}#maxbuttons .mb_collection_selection .sortable .item .button-remove{margin-top:5px;position:absolute;left:20px;top:-15px;border:1px solid #000;border-radius:11px;width:20px;height:20px;background-color:rgba(0,0,0,0.5)}#maxbuttons .mb_collection_selection .sortable .item .button-remove:hover{cursor:pointer}#maxbuttons .mb_collection_selection .sortable .item .button-remove span{color:#fff;font-size:16px;padding-top:2px;overflow:hidden}#maxbuttons .mb_collection_selection .sortable-placeholder{border:3px dashed #aaa;height:45px;width:344px;background:#ccc}#maxbuttons .mb_collection_selection .button_data{display:none}#maxbuttons .mb-social-options{float:right;width:45%;border:1px solid #000;height:100%}#maxbuttons .mb-buttons-selection{float:left;width:45%;overflow:hidden;border:1px solid #000}#maxbuttons .mb-preview-window{position:fixed;top:40%;right:20px;width:30%;max-width:45%;max-height:90vh;background-color:rgba(255,255,255,0.7);border:1px solid #000;z-index:500 !important;overflow:hidden;display:none}@media (max-width: 780px){#maxbuttons .mb-preview-window{position:relative;left:0;top:0;bottom:0;right:0;width:100%;height:auto;display:inline-block;border-color:#ccc}}#maxbuttons .mb-preview-window .mb-preview-wrapper{position:relative;display:inline-block;width:100%}#maxbuttons .sub-tabs .preview-on{background-color:#00b9eb;color:#fff}#maxbuttons .sub-tabs .preview-on::before{line-height:24px}#maxbuttons #picker-back{top:0;left:0;right:0;bottom:0;background-color:#000;z-index:110000;position:fixed;opacity:0.7;display:none}#maxbuttons #picker-modal,#maxbuttons .max-modal.picker-modal{display:none;width:calc(100% - 60px);min-height:300px;top:30px;bottom:30px;left:30px;right:30px;z-index:160000}#maxbuttons #picker-modal .modal_header,#maxbuttons .max-modal.picker-modal .modal_header{height:15px;display:block;overflow:hidden;top:0;left:0;bottom:0;right:0;border:0}#maxbuttons #picker-modal .picker-packages,#maxbuttons .max-modal.picker-modal .picker-packages{top:31px;left:0;width:205px;bottom:0;background-color:#f3f3f3;position:absolute;border-right:1px solid #ccc;overflow-x:hidden;overflow-y:auto}#maxbuttons #picker-modal .picker-packages ul,#maxbuttons .max-modal.picker-modal .picker-packages ul{margin-top:4px}#maxbuttons #picker-modal .picker-packages li a,#maxbuttons .max-modal.picker-modal .picker-packages li a{padding:6px 20px;display:block;color:#0073aa;text-decoration:none;font-size:13px;line-height:16px}#maxbuttons #picker-modal .picker-packages li a:hover,#maxbuttons .max-modal.picker-modal .picker-packages li a:hover{background:rgba(0,0,0,0.04) none repeat scroll 0 0;color:#21759b}#maxbuttons #picker-modal .picker-packages li a.pack-active,#maxbuttons .max-modal.picker-modal .picker-packages li a.pack-active{font-weight:700;color:#000}#maxbuttons #picker-modal .picker-main,#maxbuttons .max-modal.picker-modal .picker-main{left:206px;top:31px;right:0;bottom:60px;position:absolute;border-bottom:1px solid #dddddd;overflow-y:scroll;background-color:#fff}#maxbuttons #picker-modal .picker-main .screen,#maxbuttons .max-modal.picker-modal .picker-main .screen{margin:5px 5px}#maxbuttons #picker-modal .picker-main .screen .tablenav-pages,#maxbuttons .max-modal.picker-modal .picker-main .screen .tablenav-pages{float:none;margin-left:1%}#maxbuttons #picker-modal .picker-main .item,#maxbuttons .max-modal.picker-modal .picker-main .item{padding:5px;margin:5px 0 5px 1%;border:1px solid #000;width:16%;height:auto;float:left;text-align:center;position:relative;background-color:#eee;border:1px solid #b4b9be;display:inline-block}#maxbuttons #picker-modal .picker-main .item .button_data,#maxbuttons .max-modal.picker-modal .picker-main .item .button_data{display:none}#maxbuttons #picker-modal .picker-main .item .button_name,#maxbuttons .max-modal.picker-modal .picker-main .item .button_name{clear:left;display:block;margin-top:15px;font-size:9px}#maxbuttons #picker-modal .picker-main .item .button-selected,#maxbuttons .max-modal.picker-modal .picker-main .item .button-selected{position:absolute;font-size:20px;top:-10px;right:-10px;width:24px;height:24px;color:#fff;background-color:#1e8cbe;z-index:100;border-radius:12px}#maxbuttons #picker-modal .picker-main .item .button-selected span,#maxbuttons .max-modal.picker-modal .picker-main .item .button-selected span{padding-top:2px}#maxbuttons #picker-modal .picker-inselection,#maxbuttons .max-modal.picker-modal .picker-inselection{height:60px;display:block;position:absolute;bottom:0;right:0;left:206px;overflow:hidden}#maxbuttons #picker-modal .picker-inselection .info,#maxbuttons .max-modal.picker-modal .picker-inselection .info{height:60px;float:left;display:inline-block;padding:10px 15px;display:none}#maxbuttons #picker-modal .picker-inselection .info .clear-selection,#maxbuttons .max-modal.picker-modal .picker-inselection .info .clear-selection{color:#ff0000;display:block;padding:0}#maxbuttons #picker-modal .picker-inselection .info .clear-selection:hover,#maxbuttons .max-modal.picker-modal .picker-inselection .info .clear-selection:hover{background-color:#ff0000;color:#fff}#maxbuttons #picker-modal .picker-inselection .items,#maxbuttons .max-modal.picker-modal .picker-inselection .items{display:inline-block;position:absolute;overflow:hidden;padding-top:5px;height:100%;left:130px;right:180px}@media (max-width: 780px){#maxbuttons #picker-modal .picker-inselection .items,#maxbuttons .max-modal.picker-modal .picker-inselection .items{display:none}}#maxbuttons #picker-modal .picker-inselection .items .item,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item{height:40px;width:40px;overflow:hidden;float:left;margin:3px;position:relative}#maxbuttons #picker-modal .picker-inselection .items .item .button_name,#maxbuttons #picker-modal .picker-inselection .items .item .button_data,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button_name,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button_data{display:none}#maxbuttons #picker-modal .picker-inselection .items .item .button-remove,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button-remove{display:none;position:absolute;width:30px;height:30px;left:2px;border-radius:15px;top:2px;background-color:rgba(0,0,0,0.5)}#maxbuttons #picker-modal .picker-inselection .items .item .button-remove span,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button-remove span{font-size:20px;color:#fff;padding-left:5px;padding-top:5px}#maxbuttons #picker-modal .picker-inselection .items .item:hover .button-remove,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item:hover .button-remove{display:block}#maxbuttons #picker-modal .picker-inselection .add,#maxbuttons .max-modal.picker-modal .picker-inselection .add{float:right;margin-top:15px;margin-right:15px;height:100%}#maxbuttons .social_block .social-option{clear:both;margin-top:25px}#maxbuttons .social_block .social-option .shortcode-container{display:inline-block}#maxbuttons .social_block .social-option .button_name{display:inline-block;margin-left:10px;vertical-align:middle;font-weight:700}#maxbuttons #mbfeedback .link{height:25px;width:100px;position:fixed;top:40%;right:0;z-index:1000;transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}#maxbuttons #mbfeedback .link a{background:#ccc;height:25px;width:70px;padding:8px 16px;color:#fff;font-family:Arial, sans-serif;font-size:15px;font-weight:bold;text-decoration:none;line-height:15px;border-bottom:solid 1px #333;border-left:solid 1px #333;border-right:solid 1px #fff}#maxbuttons #mbfeedback .link a::hover{background:#06c}#maxbuttons .ad-wrap{width:27%;float:left;max-width:300px;margin-left:1%;min-width:200px;margin-top:41px}#maxbuttons .ad-wrap .ads{background:#fff;margin-bottom:20px;text-align:center}#maxbuttons .ad-wrap .ads.image-ad{background:none;margin-top:20px}#maxbuttons .ad-wrap .ads.image-ad img{max-width:100%}#maxbuttons .ad-wrap .ads>a{text-decoration:none}#maxbuttons .ad-wrap .ads .header{background-color:#88c5c2;color:#fff;font-size:18px;text-transform:uppercase;padding:12px}#maxbuttons .ad-wrap .ads h3{text-align:center;padding-bottom:14px}#maxbuttons .ad-wrap .ads ul{list-style:none}#maxbuttons .ad-wrap .ads ul li{font-weight:bold;text-decoration:none;color:#000000}#maxbuttons .ad-wrap .ads ul li.plus{font-size:38px;font-weight:700;color:#88c5c2}#maxbuttons .ad-wrap .ads span.img{text-align:center;display:block}#maxbuttons .ad-wrap .ads .ads_button_wrap{margin:20px 0 30px;display:inline-block}#maxbuttons .ad-wrap .ads .ads_button_wrap .button{color:#fff;background-color:#88c5c2;font-size:16px;font-weight:bold;border:0;padding:0 40px}@media screen and (max-width: 960px){#maxbuttons .ad-wrap{display:none}}#maxbuttons.maxbuttons-pro-gopro .main{width:95%;max-width:860px}#maxbuttons.maxbuttons-pro-gopro h1.title{margin:0;font-size:24px;display:inline-block}#maxbuttons.maxbuttons-pro-gopro h1.title .big-maxg-btn{display:inline-block;background-color:#86c5c2;border-color:#73a3a8;margin:0 10px;vertical-align:super;line-height:23px;border-top:0;border-left:0;border-right:0;top:5px}#maxbuttons.maxbuttons-pro-gopro h1.title img{vertical-align:middle}#maxbuttons.maxbuttons-pro-gopro .logo{margin:0;display:inline-block;margin-top:14px}#maxbuttons.maxbuttons-pro-gopro .logo .simple-btn{color:#62c0e6;text-decoration:underline}#maxbuttons.maxbuttons-pro-gopro .default-section{text-align:center;padding:0px 10px}#maxbuttons.maxbuttons-pro-gopro .default-section p{position:relative;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size:16px;margin:17px 0;color:#5b5b5b}#maxbuttons.maxbuttons-pro-gopro .default-section:nth-child(even){background-color:#fff}#maxbuttons.maxbuttons-pro-gopro .default-section:nth-child(odd){background-color:#faf5f1}#maxbuttons.maxbuttons-pro-gopro .default-section .big-maxg-btn{background-color:#fd8d61;border-color:#f0702b;font-size:36px;margin:10px}#maxbuttons.maxbuttons-pro-gopro .default-section h2{font-family:'Quicksand', sans-serif;font-weight:bold;color:#88c5c2;font-size:36px;line-height:38px;max-width:80%;margin:14px auto}#maxbuttons.maxbuttons-pro-gopro .default-section .rating{width:380px;margin:0 auto}#maxbuttons.maxbuttons-pro-gopro .default-section .rating p{margin:10px 0 0;font-size:22px;color:#000}#maxbuttons.maxbuttons-pro-gopro .default-section .icon-row p{font-weight:bold}#maxbuttons.maxbuttons-pro-gopro .default-section .icon-row img{width:106px;height:106px}#maxbuttons.maxbuttons-pro-gopro .social-row div{margin-bottom:5px}#maxbuttons.maxbuttons-pro-gopro .social-row p{background:#fff;padding:15px 5px 0 5px;margin:15px 0 0 15px;font-weight:700}#maxbuttons.maxbuttons-pro-gopro .social-row img{margin-top:15px}#maxbuttons.maxbuttons-pro-gopro .social-row p{min-height:162px}#maxbuttons.maxbuttons-pro-gopro .container{width:inherit;margin:0 auto;padding:30px 0}#maxbuttons.maxbuttons-pro-gopro img{max-width:100%}#maxbuttons.maxbuttons-pro-gopro .icon-row,#maxbuttons.maxbuttons-pro-gopro .image-row{position:relative}#maxbuttons.maxbuttons-pro-gopro .width-100{width:100%;margin-bottom:15px}#maxbuttons.maxbuttons-pro-gopro .width-33{width:33.33333333%;float:left;padding:0 15px;margin:0 -15px 40px}#maxbuttons.maxbuttons-pro-gopro .width-50{width:50%;float:left;padding:0 15px;margin:0 -15px 40px}#maxbuttons.maxbuttons-pro-gopro .clearfix{clear:both}#maxbuttons.maxbuttons-pro-gopro .bordered{border-radius:30px;padding:16px;background-color:#fff;box-sizing:border-box}@media (max-width: 780px){#maxbuttons.maxbuttons-pro-gopro .bordered{border:0;padding:8}}#maxbuttons.maxbuttons-pro-gopro .bordered p{margin:0 0 10px}#maxbuttons.maxbuttons-pro-gopro .inline-block{display:inline-block !important;vertical-align:middle}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn{font-family:'Quicksand', sans-serif;font-size:20px;color:#fff;font-weight:bold;padding:10px 15px;transition:all linear .2s;display:block;text-align:center;border-bottom:4px solid;text-transform:uppercase;border-radius:10px;text-decoration:none;line-height:42px}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:hover,#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:focus{color:#fff;text-decoration:none;outline:none}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:hover{box-shadow:0 8px 6px -6px rgba(0,0,0,0.5)}.maxmodal-data{display:none}.max-modal{display:none;width:60%;max-width:70%;height:auto;max-height:90vh;overflow:hidden;position:fixed;left:50%;top:50%;z-index:100101;display:none;background:#ffffff;border-radius:4px 4px 4px 4px;-webkit-border-radius:4px 4px 4px 4px;-webkit-box-shadow:-3px -3px 10px rgba(0,0,0,0.5);-moz-box-shadow:-3px -3px 10px rgba(0,0,0,0.5);box-shadow:-3px -3px 10px rgba(0,0,0,0.5)}@media (max-width: 960px){.max-modal{max-width:90%}}@media (max-width: 780px){.max-modal{max-width:100%}}.max-modal.success{border:4px solid green}.max-modal.error{border:4px solid red}.max-modal.error h3{background-color:#ff0000}.max-modal .content-area{background-color:#fff}.max-modal .modal_header{text-align:center;font-size:16px;font-weight:700;background-color:#f3f3f3;border-bottom:1px solid #ccc;padding:8px 5px;cursor:move}.max-modal .modal_header h3{margin:0;color:#444;font-weight:400;padding:0;text-align:center;text-shadow:none;font-size:16px}.max-modal .modal_header .modal_close{position:absolute;right:5px;top:8px;width:20px;height:20px;cursor:pointer;color:#444}.max-modal .modal_header .modal_close:hover{cursor:pointer;color:#111}.max-modal .content,.max-modal .modal_content{text-align:center;padding:5px 15px 10px;height:auto;overflow-y:auto}.max-modal textarea{overflow-x:auto}.max-modal .controls{padding:10px;text-align:center;clear:both}.max-modal .controls .button,.max-modal .controls .button-primary{margin-right:8px}.max-modal .tablenav .tablenav-pages a,.max-modal .tablenav-pages-navspan{background:#e5e5e5 none repeat scroll 0 0;border:1px solid #cccccc;display:inline-block;font-size:16px;font-weight:normal;line-height:1;min-width:17px;padding:3px 5px 7px;text-align:center}.max-modal textarea#maxbutton-css{width:100%;height:250px;font-family:Consolas, 'Courier New', 'Courier';font-size:13px;white-space:normal;word-wrap:break-word;overflow:none}.maxmodal_overlay{background:#000;left:0;right:0;bottom:0;top:0;height:100%;position:fixed;opacity:0.7;z-index:100100;display:none}.media-buttons #maxbuttons{margin:0;overflow-y:auto}.media-buttons #maxbuttons .preview-buttons{border:0;clear:both}.media-buttons #maxbuttons .preview-buttons .hint{font-size:12px;float:left;display:inline-block;line-height:30px;margin-top:3px}.media-buttons #maxbuttons .button-select{cursor:pointer;border:1px solid #fff}.media-buttons #maxbuttons .button-select.selected{border-top:1px solid #0085ba;border-bottom:1px solid #0085ba;background:#f7f7f7}.media-buttons #maxbuttons .button-select.selected .col_insert .small{font-weight:700}.media-buttons #maxbuttons .col_insert{width:150px;padding-top:15px}.media-buttons #maxbuttons .col_insert .small{font-size:10px}.media-buttons .pagination{width:100%;margin:10px 0;min-height:20px}.media-buttons .pagination span{font-size:15px;font-weight:700;float:left;cursor:pointer}.media-buttons .pagination .next{float:right}.media-buttons .shortcode_options{width:400px;margin:0 auto;display:inline-block}.media-buttons .shortcode_options .button_example{margin:15px}.media-buttons .shortcode_options input{margin-bottom:10px;display:inline-block;float:left}.media-buttons .shortcode_options label{margin-right:25px;display:inline-block;float:left;clear:left;width:100px;line-height:20px;font-weight:700}.media-buttons .shortcode_options p{clear:both}.media-buttons .shortcode_options input[type='button']{clear:both;float:none}.media-buttons .loading{background:transparent url("../../images/spinner.gif") no-repeat scroll 0 0/20px 20px;display:inline-block;float:right;margin:5px 5px 0 0;height:40px;opacity:0.7;vertical-align:middle;visibility:hidden;width:40px}.media-buttons .controls{position:absolute;width:100%;padding:10px 0;background:#f3f3f3;text-align:right;bottom:0;left:0;border-top:1px solid #ccc}
1
+ .mb_colorpicker{z-index:200}.ads .button-primary{display:block;margin:0 auto 20px auto;width:210px;text-align:center;overflow:visible}.max-load-spinner{background:url("/wp-admin/images/wpspin_light.gif") no-repeat;background-size:16px 16px;opacity:.9;width:16px;height:16px;display:inline-block;vertical-align:middle;position:absolute;top:50%;left:50%;margin-left:-8px;margin-top:-8px;z-index:10}.max-load-spinner.large{background:url("/wp-admin/images/wpspin_light-2x.gif") no-repeat;width:32px;height:32px}.max-load-overlay{position:absolute;top:0;left:0;right:0;bottom:0;opacity:0.80;background-color:#f0f0f0;z-index:9}#maxbuttons{display:inline-block;width:100%}#maxbuttons .message,#maxbuttons .mb-message{border:solid 1px #e6db55;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:10px;margin:10px 0px 20px 0px;clear:both;background:#fff}#maxbuttons .main{position:relative;z-index:500;margin-top:15px;width:72%;float:left}#maxbuttons .mb-message.error{font-weight:700}#maxbuttons .mb-message.shortcode,#maxbuttons .mb-message.mb-notice{border:solid 1px #e6db55;background-color:#ffffe0}#maxbuttons .mb-message.warning{border-left:4px solid #ffba00}#maxbuttons .mb-message.error{border-left:4px solid #ff0000}#maxbuttons .button-bar,#maxbuttons .form-actions,#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1){margin:15px 0;padding:10px;background:#fbfbfb none repeat scroll 0 0;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04);min-height:28px}#maxbuttons h1>span{vertical-align:top;float:left}@media (max-width: 1024px){#maxbuttons h1>span{float:none}}#maxbuttons .logo{font-weight:400;font-size:13px;overflow:hidden;text-align:center}@media (max-width: 1024px){#maxbuttons .logo{text-align:left;margin-top:15px}}#maxbuttons .logo img{vertical-align:middle;padding-left:5px;padding-right:5px}#maxbuttons .logo .fb-like{margin-top:5px;height:20px;padding:0;margin-left:180px;overflow:hidden}#maxbuttons .logo .fb-like span{vertical-align:top !important}#maxbuttons .dummy-heading{display:none}@media screen and (max-width: 960px){#maxbuttons .main{width:100%}}#maxbuttons .tablenav .input-paging{width:55px}#maxbuttons .ads ul li{margin-bottom:4px}#maxbuttons .preview-buttons{background-color:#fff;border:1px solid #dfdfdf;overflow:hidden}#maxbuttons .preview-buttons .heading{width:100%;clear:both;display:inline-block;border-bottom:1px solid #dfdfdf}#maxbuttons .preview-buttons .heading>span{display:inline-block;font-weight:700;font-size:14px;float:left}#maxbuttons .preview-buttons .button-row{width:100%;clear:both;display:inline-block;border-bottom:1px solid #dfdfdf}#maxbuttons .preview-buttons .button-row>span{display:inline-block;font-size:13px;float:left;overflow:hidden}#maxbuttons .preview-buttons .button-row .actions{margin:10px 0;padding:10px 0px 10px 8px;display:inline-block;z-index:11;width:50%;background-color:#fff;position:relative}#maxbuttons .preview-buttons .col{padding:10px 0 10px 1%}#maxbuttons .preview-buttons .col_check{width:20px}#maxbuttons .preview-buttons .col_button{width:60%;overflow:hidden}@media (max-width: 780px){#maxbuttons .preview-buttons .col_button{width:70%;margin-right:5%}}#maxbuttons .preview-buttons .col_name{width:15%}@media (max-width: 780px){#maxbuttons .preview-buttons .col_name{display:none !important}}#maxbuttons .preview-buttons .col_shortcode{width:15%;padding-right:0}#maxbuttons p.status a{text-decoration:none}#maxbuttons p.status span.count{color:#999999}#maxbuttons .button-list{margin-top:10px}#maxbuttons .button-list p{font-size:13px}#maxbuttons .button-list a{text-decoration:none}#maxbuttons .button-list a.button-name{font-weight:bold}#maxbuttons .button-list .shortcode-container{margin:10px 0px 10px 2px}#maxbuttons .button-list .collection_notice{text-align:right;margin:10px 5px 0 0;padding-top:10px;float:right}#maxbuttons .shortcode-container .mb-container{margin:0 !important;float:none !important;max-width:100% !important}#maxbuttons .shortcode-container .mb-center{text-align:left !important}#maxbuttons .pagination-links a.disabled{color:#aaa;cursor:default}#maxbuttons .pagination-links a.disabled:hover{background:#e4e4e4 none repeat scroll 0 0;cursor:default;border:1px solid #d2d2d2}#maxbuttons .pagination{width:100%;display:inline-block;margin:15px 0 5px}#maxbuttons .pagination li{float:left;margin-right:5px}#maxbuttons .pagination li a,#maxbuttons .pagination li span{background:#ccc;vertical-align:middle;padding:4px 10px 8px;height:15px;display:inline-block;border:1px solid #eee;text-decoration:none;font-size:14px;font-weight:bold}#maxbuttons.maxbuttons-controller-edit .main,#maxbuttons.maxbuttons-controller-button .main{width:auto;max-width:1200px}#maxbuttons .option-container{margin-bottom:20px;border:solid 1px #cccccc;border-radius:3px 3px 3px 3px;-webkit-border-radius:3px 3px 3px 3px;background-color:#fff}#maxbuttons .option-container .title{font-size:18px;padding:9px 8px 9px 10px;text-align:left;text-shadow:0px 1px 0px #ffffff;position:relative}#maxbuttons .option-container .section-title{padding:15px;margin-top:10px;font-weight:700;font-size:16px}#maxbuttons .option-container .section-title{background-color:#fff}#maxbuttons .option-container .option-list{display:inline-block}#maxbuttons .option-container .option-list:after{clear:both}#maxbuttons .option-container .option-list .help{float:right;margin-top:5px}#maxbuttons .option-container .help{position:relative;width:18px;height:18px;font-size:18px;margin-left:10px}#maxbuttons .option-container .help span{font-family:"Open Sans",sans-serif;font-size:12px;background-color:#fff;color:#000;position:absolute;display:none;padding:10px 5px;top:-7px;left:25px;min-width:150px;border-radius:5px;text-align:center;z-index:1000;border:1px solid #ccc;line-height:15px}#maxbuttons .option-container .help:hover span{display:block}#maxbuttons .option-container>.inside{padding:10px 15px 10px 15px;border-top:solid 1px #cccccc;background-color:#ffffff}#maxbuttons .option-container>.inside .option,#maxbuttons .option-container>.inside .option-design{margin-bottom:10px;display:block;position:relative}#maxbuttons .option-container>.inside .option .label,#maxbuttons .option-container>.inside .option>label,#maxbuttons .option-container>.inside .option-design .label,#maxbuttons .option-container>.inside .option-design>label{display:inline-block;font-weight:bold;padding-left:3px;padding-top:5px;width:145px;vertical-align:top;cursor:default;min-height:25px}#maxbuttons .option-container>.inside .option .label[for],#maxbuttons .option-container>.inside .option>label[for],#maxbuttons .option-container>.inside .option-design .label[for],#maxbuttons .option-container>.inside .option-design>label[for]{cursor:pointer}@media (max-width: 780px){#maxbuttons .option-container>.inside .option .label,#maxbuttons .option-container>.inside .option>label,#maxbuttons .option-container>.inside .option-design .label,#maxbuttons .option-container>.inside .option-design>label{font-size:14px}}#maxbuttons .option-container>.inside .option:after,#maxbuttons .option-container>.inside .option:before,#maxbuttons .option-container>.inside .option-design:after,#maxbuttons .option-container>.inside .option-design:before{clear:both}#maxbuttons .option-container>.inside .option label{margin-top:2px}#maxbuttons .option-container>.inside .option label.mbcolor{margin-top:5px}#maxbuttons .option-container>.inside .option label:nth-of-type(2){margin-left:30px;width:115px}#maxbuttons .option-container>.inside .option .control-group{display:inline-block}#maxbuttons .option-container>.inside .option .rotate-left{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45));-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45))";zoom:1}#maxbuttons .option-container>.inside .option .rotate-right{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45));-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45))";zoom:1}#maxbuttons .option-design{margin-bottom:10px}#maxbuttons .option-design .input td div.cell-label{padding:1px 10px 0px 5px;font-weight:bold;border-bottom:solid 1px #d1d1d1;width:180px;font-size:13px;height:30px}#maxbuttons .option-design .default-other{font-size:13px}#maxbuttons .option p.note,#maxbuttons .option-design p.note{font-style:italic;display:inline-block;clear:both;color:#808080;padding-left:3px;margin-top:10px;margin-bottom:5px;margin-left:0;display:block}#maxbuttons .mb-message.shortcode .expanded,#maxbuttons .mb-message.mb-notice .expanded{display:none}#maxbuttons .mb-message.shortcode .expanded .example strong,#maxbuttons .mb-message.mb-notice .expanded .example strong{width:300px;display:inline-block}#maxbuttons .mb-message.shortcode .shortcode-expand,#maxbuttons .mb-message.mb-notice .shortcode-expand{clear:both;font-weight:700;display:block;margin:5px 0;cursor:pointer}@media (max-width: 1024px){#maxbuttons .mb-message.shortcode .shortcode-expand,#maxbuttons .mb-message.mb-notice .shortcode-expand{float:none;text-align:left;margin:10px 0;display:block}}#maxbuttons .manual-box{float:right;margin:3px 15px;top:0;right:0}#maxbuttons .manual-box a{text-align:center;width:100%;background:#e0e0e0 none repeat scroll 0 0;font-size:13px;font-weight:600;margin-left:4px;margin-top:5px;padding:4px 8px;position:relative;text-decoration:none;text-shadow:none}#maxbuttons .manual-entry{display:none;position:absolute;border:1px solid #000;background:#fff;width:45%;right:25px;z-index:199;box-sizing:border-box;padding-bottom:20px}#maxbuttons .manual-entry h3{font-size:18px;width:calc(100%);box-sizing:border-box;padding:10px 0;border-bottom:1px solid #ccc;text-align:center;margin:0;padding-right:35px;position:relative}#maxbuttons .manual-entry h3 span{box-sizing:border-box;cursor:pointer;width:35px;height:100%;font-size:25px;display:inline-block;position:absolute;right:5px;top:0;padding-top:8px}#maxbuttons .manual-entry h4,#maxbuttons .manual-entry p,#maxbuttons .manual-entry ol,#maxbuttons .manual-entry ul{padding:0 15px}#maxbuttons .manual-entry h4{font-size:16px}#maxbuttons .manual-entry p{font-size:13px}#maxbuttons .output{position:fixed;top:45px;right:20px;background-color:#ffffff;border:solid 1px #414141;box-shadow:0px 0px 6px #808080;z-index:99;width:auto;min-width:300px}@media (max-width: 780px){#maxbuttons .output{-webkit-box-shadow:0 0 0 0;-moz-box-shadow:0 0 0 0;box-shadow:0 0 0 0;top:0;left:0;right:0;position:relative;margin-bottom:15px;border-color:#ccc}}#maxbuttons .output .header{color:#222222;background-color:#ffffff;border-bottom:solid 1px #cccccc;font-family:"Open Sans", sans-serif;font-size:16px;font-weight:bold;padding:8px 0px 8px 10px;cursor:move;position:relative}#maxbuttons .output .header .preview-toggle{float:right;font-size:30px;width:30px;position:absolute;top:3px;right:0}#maxbuttons .output .inner{padding:5px}#maxbuttons .output .inner p{padding:5px 0 5px 5px}#maxbuttons .output .input.mbcolor{float:left;position:relative;margin-top:5px}#maxbuttons .output .input.mbcolor .wp-picker-container.wp-picker-active{padding:15px;border:1px solid #ccc;background-color:#fff;position:absolute;bottom:-15px;left:-270px;z-index:102;-webkit-box-shadow:4px 1px 5px #ccc;-moz-box-shadow:4px 1px 5px #ccc;box-shadow:4px 1px 5px #ccc}#maxbuttons .output .note{float:left;margin:8px 0px 0px 10px}#maxbuttons .output .result{padding:20px 5px}#maxbuttons .output .result p{padding:5px 0px 5px 0px;margin:0}#maxbuttons .output .result.preview-border-box>*{box-sizing:border-box}#maxbuttons .conditional-option{display:none}#maxbuttons .media_query{width:640px;margin:0 20px 15px 0;border:1px solid #ccc;padding:10px 15px;display:inline-block;clear:both;position:relative}#maxbuttons .media_query .removebutton{position:absolute;right:10px;top:10px;cursor:pointer;z-index:100;padding:10px 5px}#maxbuttons .media_query input:after{clear:both}#maxbuttons .media_query .label{clear:both;margin-bottom:15px}#maxbuttons .media_query label.title{padding:0;font-size:20px}#maxbuttons .media_query .custom.hidden{display:none}#maxbuttons .media_query .option.custom label:nth-of-type(2){margin-left:95px}#maxbuttons .media_query .description{padding:15px 0px;text-align:left}#maxbuttons .media_query select{width:60px}#maxbuttons .media_query .input input{margin-top:0px;padding-top:2px}#maxbuttons .media_queries_options .new-query{margin-top:25px}#maxbuttons .media_queries_options .new-query select{width:auto}#maxbuttons .media_option_prot,#maxbuttons #media_desc{display:none}#maxbuttons .copy-warning{width:400px;margin:0 auto;position:relative;line-height:1.1}#maxbuttons .copy-warning:before{content:"\f534";font-size:40px;color:#ff0000;width:35px;height:35px;font-family:"Dashicons";position:absolute;left:20px;top:40%;margin-top:-14px}#maxbuttons .copy-warning .example{margin-bottom:5px}#maxbuttons .form-actions a{margin-right:10px}#maxbuttons select{width:150px}#maxbuttons select.small{width:auto}#maxbuttons .input{display:inline-block;margin-right:15px;min-height:35px}#maxbuttons .input img{vertical-align:middle}#maxbuttons .input.mbcolor{min-width:50px}#maxbuttons .input.checkbox input{margin-top:0}#maxbuttons .input.checkbox label{line-height:16px;margin-top:0 !important}#maxbuttons .maxajax-load-spinner{width:16px;height:16px;background:url("/wp-admin/images/wpspin_light.gif") no-repeat;opacity:0.9s;display:inline-block;margin:0 10px;z-index:10;vertical-align:middle}#maxbuttons input[type='text']{width:450px}@media (max-width: 780px){#maxbuttons input[type='text']{width:350px}}#maxbuttons input[type='text'].tiny{width:35px;vertical-align:middle}#maxbuttons input[type='text'].small{width:50px}#maxbuttons input[type='text'].medium{width:150px}#maxbuttons input[type='text'].tiny-nopad{width:35px}#maxbuttons input[type='number']{vertical-align:middle}#maxbuttons input[type='number'].tiny,#maxbuttons input[type='number'].tiny-nopad{width:55px}@media (max-width: 780px){#maxbuttons input[type='number'].tiny,#maxbuttons input[type='number'].tiny-nopad{width:60px}}#maxbuttons input[type='number'].small{width:70px}@media (max-width: 780px){#maxbuttons input[type='number'].small{width:75px}}#maxbuttons textarea{width:450px;height:80px}#maxbuttons .option-container .inside .option label.mbcolor:nth-of-type(2){margin-left:37px}#maxbuttons .option-container .inside .option.url{margin-bottom:0}#maxbuttons .option-container .inside .option.url_options{margin:5px 0 10px}#maxbuttons .option-container .inside .option.url_options .nofollow{margin-left:35px}#maxbuttons .option-container .inside .option.url_options label,#maxbuttons .option-container .inside .option.rel_options label{font-weight:400}#maxbuttons .option-container .inside .option.font .checkbox{margin-right:2px}#maxbuttons .option-container .inside .option.font .radio{margin-right:0}#maxbuttons .option-container .inside .option.font .input.font{margin-right:2px}#maxbuttons .option-container .inside .option.font .input.font_size{margin-right:0}#maxbuttons .option-container .inside .option.font .input.font_size:after{display:block}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font{display:inline-block}#maxbuttons .option-container .inside .option.font:after{clear:both}#maxbuttons .option-container .inside .option.font>*{float:left}}#maxbuttons .option-container .inside .option.font .control-group.font_weight{margin-left:28px}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font .control-group.font_weight{clear:left;margin-left:148px;margin-top:10px}}#maxbuttons .option-container .inside .option.font .control-group.text_align{margin-left:48px}@media (max-width: 780px){#maxbuttons .option-container .inside .option.font .control-group.text_align{margin-left:20px;margin-top:10px}}#maxbuttons .option-container .inside .option.padding_top .input,#maxbuttons .option-container .inside .option.container_margin_top .input{margin-right:30px}#maxbuttons .option-container .inside .option.padding_top .input:last-of-type,#maxbuttons .option-container .inside .option.container_margin_top .input:last-of-type{margin-right:0}@media (max-width: 780px){#maxbuttons .option-container .inside .option.padding_top .input,#maxbuttons .option-container .inside .option.container_margin_top .input{margin-right:15px}}#maxbuttons .option-container .inside .option.text_color label{padding-top:10px}#maxbuttons .option-container .inside .option.text_color label:nth-of-type(2){margin-left:51px}#maxbuttons .option-container .inside .option.description label{padding-top:35px}#maxbuttons .option-container .inside .option .radius-wrap{position:relative;margin-left:45px;display:inline-block}#maxbuttons .option-container .inside .option.radius .label:first-child{width:100px;float:left}#maxbuttons .option-container .inside .option.radius .bottom,#maxbuttons .option-container .inside .option.radius .top{position:relative}#maxbuttons .option-container .inside .option.radius .bottom .input,#maxbuttons .option-container .inside .option.radius .top .input{margin-right:0;margin-left:0}#maxbuttons .option-container .inside .option.radius .bottom .dashicons:nth-child(3),#maxbuttons .option-container .inside .option.radius .top .dashicons:nth-child(3){margin-right:10px}#maxbuttons .option-container .inside .option.radius .top{margin-bottom:10px}#maxbuttons .option-container .inside .option.radius label{display:inline-block;font-weight:700;width:90px;margin-left:5px;cursor:default}#maxbuttons .option-container .inside .option.radius .dashicons{font-size:35px;height:35px;width:35px;color:#ccc}#maxbuttons .option-container .inside .option.radius .top .dashicons{margin-top:-5px}#maxbuttons .option-container .inside .option.radius .bottom .dashicons{margin-top:5px}#maxbuttons .option-container .inside .option.radius #radius_toggle{position:absolute;left:46%;top:25px;font-size:30px;cursor:pointer}#maxbuttons .option-container .inside .option.gradient_head .label:nth-child(even){width:120px}#maxbuttons .option-container .inside .option .gradient_end_color,#maxbuttons .option-container .inside .option .gradient_end_color_hover{margin-left:58px}#maxbuttons .default{display:inline-block;padding-left:10px;padding-top:4px;font-style:italic;color:#808080}#maxbuttons .default .other{padding-left:40px;padding-top:8px}#maxbuttons .mb-button{width:38px;height:38px;background-color:#eceded;display:inline-block;margin-right:6px;cursor:pointer;display:none}#maxbuttons .mb-button span{text-align:center;padding:9px 0;width:100%;line-height:20px}#maxbuttons .check_button{display:none}#maxbuttons .check_button+label{background-position:center center;background-repeat:no-repeat;background-color:#fff;display:inline-block;border:1px solid #ddd;font_weight:normal;padding:4px}@media (max-width: 780px){#maxbuttons .check_button+label{padding:10px}}#maxbuttons .check_button.text+label{padding:5px}#maxbuttons .check_button.icon+label i{width:20px;height:20px;color:#545454}#maxbuttons .check_button.icon+label i:focus{outline:none}#maxbuttons .check_button:checked+label{background:#ebebeb none repeat scroll 0 0;border-color:#999999;box-shadow:0 2px 5px -3px rgba(0,0,0,0.3) inset}#maxbuttons .option .input_label{display:inline-block;vertical-align:top}#maxbuttons .option .input_label.left{margin-right:10px}#maxbuttons .option .input_label.right{margin-left:10px}#maxbuttons .option .range_value{margin-top:5px}#maxbuttons .option .range_value output{clear:both;font-size:18px;text-align:center;width:100%;display:inline-block}#maxbuttons .option .switch_label{padding-top:2px !important;margin:0 !important}#maxbuttons .switch_button{margin-left:-5px}#maxbuttons .switch_button label{padding:8px 5px}#maxbuttons .switch_button label:focus{outline:none}#maxbuttons .switch_button input{display:none}#maxbuttons .switch_button input:checked ~ .the_switch{background:#6fbeb5}#maxbuttons .switch_button input:checked ~ .the_switch:after{left:26px;background:#179588}#maxbuttons .switch_button input::disabled ~ .the_switch{background:#d5d5d5;pointer-events:none}#maxbuttons .switch_button input:disabled ~ .the_switch:after{background:#bcbdbc}#maxbuttons .switch_button .the_switch{position:relative;display:inline-block;height:15px;width:50px;background:#898989;border-radius:100px;cursor:pointer;transition:all 0.3s ease}#maxbuttons .switch_button .the_switch:after{position:absolute;left:-2px;top:-3px;display:block;width:24px;height:24px;border-radius:100px;background:#aaa;box-shadow:0px 3px 3px rgba(0,0,0,0.05);content:'';transition:all 0.2s ease}#maxbuttons .switch_button .the_switch:active:after{transform:scale(0.9, 0.85)}#maxbuttons .switch_button .the_switch:focus{outline:none}#maxbuttons .input.mbcolor{margin-top:5px;position:relative}#maxbuttons .input.mbcolor .wp-picker-clear{display:none}#maxbuttons .input.mbcolor input[type="text"]{width:75px;line-height:22px}#maxbuttons .input.mbcolor .wp-color-picker{width:inherit}#maxbuttons .input.mbcolor .wp-color-result{-webkit-box-shadow:-1px 1px 2px #999;-moz-box-shadow:-1px 1px 2px #999;box-shadow:-1px 1px 2px #999;height:30px;border:0}#maxbuttons .input.mbcolor .wp-color-result:after{font-size:12px;line-height:30px;display:none}#maxbuttons .input.mbcolor .wp-color-result:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 5px rgba(30,140,190,0.8);-moz-box-shadow:0 0 5px rgba(30,140,190,0.8);box-shadow:0 0 5px rgba(30,140,190,0.8)}#maxbuttons .input.mbcolor .wp-color-result-text{display:none}#maxbuttons .input.mbcolor .wp-picker-input-wrap{padding:0}#maxbuttons .input.mbcolor .wp-picker-active+.arrows{display:inline-block}#maxbuttons .input.mbcolor .arrows{position:absolute;display:none;top:0;margin-top:40%}#maxbuttons .input.mbcolor .arrows.right{right:-45px}#maxbuttons .input.mbcolor .arrows.left{left:-35px}#maxbuttons .input.mbcolor .arrows .arrow-left,#maxbuttons .input.mbcolor .arrows .arrow-right{width:0;height:0;font-size:0;line-height:0;vertical-align:bottom;cursor:pointer;transition:.8s}#maxbuttons .input.mbcolor .arrows .arrow-left{border-top:30px solid transparent;border-bottom:30px solid transparent;border-right:20px solid #ccc}#maxbuttons .input.mbcolor .arrows .arrow-left:hover{border-right-color:#33b3db}#maxbuttons .input.mbcolor .arrows .arrow-right{border-top:30px solid transparent;border-bottom:30px solid transparent;border-left:20px solid #ccc;margin-top:35px}#maxbuttons .input.mbcolor .arrows .arrow-right:hover{border-left-color:#33b3db}#maxbuttons .input.mbcolor .arrows .left,#maxbuttons .input.mbcolor .arrows .right{display:inline-block;float:left;clear:both;width:35px;height:45px}#maxbuttons .input.mbcolor .arrows .left{margin-top:15px}#maxbuttons [type='range']{-webkit-appearance:none;width:250px}#maxbuttons [type='range']:focus{outline:0}#maxbuttons [type='range']:focus::-webkit-slider-runnable-track{background:#fff}#maxbuttons [type='range']:focus::-ms-fill-lower{background:#fff}#maxbuttons [type='range']:focus::-ms-fill-upper{background:#fff}#maxbuttons [type='range']::-webkit-slider-runnable-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:#fff;border:1px solid #cfd8dc;border-radius:10px}#maxbuttons [type='range']::-webkit-slider-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px;-webkit-appearance:none;margin-top:-7px}#maxbuttons [type='range']::-moz-range-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:#fff;border:1px solid #cfd8dc;border-radius:10px}#maxbuttons [type='range']::-moz-range-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px}#maxbuttons [type='range']::-ms-track{cursor:pointer;height:12px;transition:all .2s ease;width:250px;background:transparent;border-color:transparent;border-width:12px 0;color:transparent}#maxbuttons [type='range']::-ms-fill-lower{background:#f2f2f2;border:1px solid #cfd8dc;border-radius:20px}#maxbuttons [type='range']::-ms-fill-upper{background:#fff;border:1px solid #cfd8dc;border-radius:20px}#maxbuttons [type='range']::-ms-thumb{background:#179588;border:0px solid #eceff1;border-radius:12px;cursor:pointer;height:24px;width:24px;margin-top:0}#maxbuttons .rss-feed{overflow:hidden;clear:both;margin-bottom:20px}#maxbuttons .rss-feed li{width:32%;margin-right:2%;float:left;margin-bottom:2%}#maxbuttons .rss-feed li:nth-child(3n){margin-right:0}#maxbuttons .rss-feed li a{min-height:110px;max-height:110px;overflow:hidden;background:#fff;width:100%;display:block;padding:10px;box-sizing:border-box;border:1px solid #bbb;text-decoration:none;transition:all 200ms;border-radius:2px}#maxbuttons .rss-feed li a:hover{background:#f9f9f9}#maxbuttons .rss-feed li a:hover span{color:#0074a2}#maxbuttons .rss-feed li a span{color:#2ea2cc;font-weight:bold;font-size:1.2em;line-height:1.5em}#maxbuttons .system_info{width:90%;background-color:#fff;border:1px solid #000;padding:15px}#maxbuttons .system_info .info{margin:5px 0}#maxbuttons .system_info .info label{width:250px;display:inline-block;clear:both}#maxbuttons.maxbuttons-settings .option-container .inside .option-design{margin:20px 0}#maxbuttons.maxbuttons-settings .option-container .inside .option-design label{line-height:14px;height:40px;vertical-align:top;width:200px}#maxbuttons h2.tabs{margin:1em 0;min-height:35px}#maxbuttons h2.sub-tabs,#maxbuttons h2.submit-tab{list-style:none;clear:both;margin-bottom:0}#maxbuttons h2.sub-tabs a,#maxbuttons h2.submit-tab a{font-weight:400;font-size:14px;cursor:pointer}#maxbuttons h2.sub-tabs a .dashicons,#maxbuttons h2.submit-tab a .dashicons{margin-right:10px;line-height:24px}#maxbuttons h2.sub-tabs .save-indicator,#maxbuttons h2.submit-tab .save-indicator{float:right;font-size:25px;display:none;margin-right:10px}#maxbuttons h2.sub-tabs .save-indicator.dashicons-warning,#maxbuttons h2.submit-tab .save-indicator.dashicons-warning{color:#ff0000}#maxbuttons h2.sub-tabs .save-indicator.dashicons-yes,#maxbuttons h2.submit-tab .save-indicator.dashicons-yes{color:#00ff00}#maxbuttons.mb_tabs_active .mb_tab{border:0px;background:none;border-radius:0 0 0 0;-webkit-border-radius:0 0 0 0}#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1) button{top:0}#maxbuttons.mb_tabs_active .mb_tab>.title:nth-of-type(1) .right{float:right}#maxbuttons.mb_tabs_active .mb_tab>.inside{border:1px solid #e5e5e5}#maxbuttons.maxbuttons-collections-edit .main{width:100%;max-width:none}#maxbuttons .social-share-move{padding:15px;border:0}#maxbuttons .social-share-move .inside{border:0}#maxbuttons .social-share-move h3{font-size:28px;line-height:30px}#maxbuttons .social-share-move p{font-size:16px}#maxbuttons .social-share-move a{width:200px;height:auto;font-size:30px;line-height:32px;padding:12px 0;text-align:center}#maxbuttons .collection-addnew{display:inline-block}@media (max-width: 780px){#maxbuttons .collection-addnew{margin-left:5px}}#maxbuttons .collection_list .collection{position:relative;background-color:#fff;padding:15px;border-radius:15px;margin:15px 0}#maxbuttons .collection_list .collection h3{display:inline-block;width:90%;margin-top:0;font-size:18px;line-height:20px}#maxbuttons .collection_list .collection h3 a{color:#000;font-size:25px;text-decoration:none}#maxbuttons .collection_list .collection h3 a:hover{text-decoration:underline}#maxbuttons .collection_list .collection h3 .dashicons{color:#ccc;margin-left:15px}#maxbuttons .collection_list .collection h3 .button-count{font-weight:400;font-size:15px;margin-left:15px;vertical-align:top}#maxbuttons .collection_list .collection .collection_remove{top:10px;right:15px;font-size:25px;font-weight:400;position:absolute;cursor:pointer}#maxbuttons .collection_list .collection.welcome p{font-size:14px;line-height:22px}#maxbuttons .collection_list .collection-container{position:relative;width:100%;display:inline-block;clear:both}#maxbuttons .collection_list .collection-container .maxcollection{position:static !important}#maxbuttons .inside .preview_collection.option label{display:inline-block;float:none;font-size:25px;width:100%}#maxbuttons .mb_collection_selection{display:inline-block;min-height:300px;margin:25px 0}#maxbuttons .mb_collection_selection .sortable .item{margin-bottom:25px;position:relative;padding-left:30px;min-height:45px;clear:both}#maxbuttons .mb_collection_selection .sortable .item .button-remove{margin-top:5px;position:absolute;left:20px;top:-15px;border:1px solid #000;border-radius:11px;width:20px;height:20px;background-color:rgba(0,0,0,0.5)}#maxbuttons .mb_collection_selection .sortable .item .button-remove:hover{cursor:pointer}#maxbuttons .mb_collection_selection .sortable .item .button-remove span{color:#fff;font-size:16px;padding-top:2px;overflow:hidden}#maxbuttons .mb_collection_selection .sortable-placeholder{border:3px dashed #aaa;height:45px;width:344px;background:#ccc}#maxbuttons .mb_collection_selection .button_data{display:none}#maxbuttons .mb-social-options{float:right;width:45%;border:1px solid #000;height:100%}#maxbuttons .mb-buttons-selection{float:left;width:45%;overflow:hidden;border:1px solid #000}#maxbuttons .mb-preview-window{position:fixed;top:40%;right:20px;width:30%;max-width:45%;max-height:90vh;background-color:rgba(255,255,255,0.7);border:1px solid #000;z-index:500 !important;overflow:hidden;display:none}@media (max-width: 780px){#maxbuttons .mb-preview-window{position:relative;left:0;top:0;bottom:0;right:0;width:100%;height:auto;display:inline-block;border-color:#ccc}}#maxbuttons .mb-preview-window .mb-preview-wrapper{position:relative;display:inline-block;width:100%}#maxbuttons .sub-tabs .preview-on{background-color:#00b9eb;color:#fff}#maxbuttons .sub-tabs .preview-on::before{line-height:24px}#maxbuttons #picker-back{top:0;left:0;right:0;bottom:0;background-color:#000;z-index:110000;position:fixed;opacity:0.7;display:none}#maxbuttons #picker-modal,#maxbuttons .max-modal.picker-modal{display:none;width:calc(100% - 60px);min-height:300px;top:30px;bottom:30px;left:30px;right:30px;z-index:160000}#maxbuttons #picker-modal .modal_header,#maxbuttons .max-modal.picker-modal .modal_header{height:15px;display:block;overflow:hidden;top:0;left:0;bottom:0;right:0;border:0}#maxbuttons #picker-modal .picker-packages,#maxbuttons .max-modal.picker-modal .picker-packages{top:31px;left:0;width:205px;bottom:0;background-color:#f3f3f3;position:absolute;border-right:1px solid #ccc;overflow-x:hidden;overflow-y:auto}#maxbuttons #picker-modal .picker-packages ul,#maxbuttons .max-modal.picker-modal .picker-packages ul{margin-top:4px}#maxbuttons #picker-modal .picker-packages li a,#maxbuttons .max-modal.picker-modal .picker-packages li a{padding:6px 20px;display:block;color:#0073aa;text-decoration:none;font-size:13px;line-height:16px}#maxbuttons #picker-modal .picker-packages li a:hover,#maxbuttons .max-modal.picker-modal .picker-packages li a:hover{background:rgba(0,0,0,0.04) none repeat scroll 0 0;color:#21759b}#maxbuttons #picker-modal .picker-packages li a.pack-active,#maxbuttons .max-modal.picker-modal .picker-packages li a.pack-active{font-weight:700;color:#000}#maxbuttons #picker-modal .picker-main,#maxbuttons .max-modal.picker-modal .picker-main{left:206px;top:31px;right:0;bottom:60px;position:absolute;border-bottom:1px solid #dddddd;overflow-y:scroll;background-color:#fff}#maxbuttons #picker-modal .picker-main .screen,#maxbuttons .max-modal.picker-modal .picker-main .screen{margin:5px 5px}#maxbuttons #picker-modal .picker-main .screen .tablenav-pages,#maxbuttons .max-modal.picker-modal .picker-main .screen .tablenav-pages{float:none;margin-left:1%}#maxbuttons #picker-modal .picker-main .item,#maxbuttons .max-modal.picker-modal .picker-main .item{padding:5px;margin:5px 0 5px 1%;border:1px solid #000;width:16%;height:auto;float:left;text-align:center;position:relative;background-color:#eee;border:1px solid #b4b9be;display:inline-block}#maxbuttons #picker-modal .picker-main .item .button_data,#maxbuttons .max-modal.picker-modal .picker-main .item .button_data{display:none}#maxbuttons #picker-modal .picker-main .item .button_name,#maxbuttons .max-modal.picker-modal .picker-main .item .button_name{clear:left;display:block;margin-top:15px;font-size:9px}#maxbuttons #picker-modal .picker-main .item .button-selected,#maxbuttons .max-modal.picker-modal .picker-main .item .button-selected{position:absolute;font-size:20px;top:-10px;right:-10px;width:24px;height:24px;color:#fff;background-color:#1e8cbe;z-index:100;border-radius:12px}#maxbuttons #picker-modal .picker-main .item .button-selected span,#maxbuttons .max-modal.picker-modal .picker-main .item .button-selected span{padding-top:2px}#maxbuttons #picker-modal .picker-inselection,#maxbuttons .max-modal.picker-modal .picker-inselection{height:60px;display:block;position:absolute;bottom:0;right:0;left:206px;overflow:hidden}#maxbuttons #picker-modal .picker-inselection .info,#maxbuttons .max-modal.picker-modal .picker-inselection .info{height:60px;float:left;display:inline-block;padding:10px 15px;display:none}#maxbuttons #picker-modal .picker-inselection .info .clear-selection,#maxbuttons .max-modal.picker-modal .picker-inselection .info .clear-selection{color:#ff0000;display:block;padding:0}#maxbuttons #picker-modal .picker-inselection .info .clear-selection:hover,#maxbuttons .max-modal.picker-modal .picker-inselection .info .clear-selection:hover{background-color:#ff0000;color:#fff}#maxbuttons #picker-modal .picker-inselection .items,#maxbuttons .max-modal.picker-modal .picker-inselection .items{display:inline-block;position:absolute;overflow:hidden;padding-top:5px;height:100%;left:130px;right:180px}@media (max-width: 780px){#maxbuttons #picker-modal .picker-inselection .items,#maxbuttons .max-modal.picker-modal .picker-inselection .items{display:none}}#maxbuttons #picker-modal .picker-inselection .items .item,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item{height:40px;width:40px;overflow:hidden;float:left;margin:3px;position:relative}#maxbuttons #picker-modal .picker-inselection .items .item .button_name,#maxbuttons #picker-modal .picker-inselection .items .item .button_data,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button_name,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button_data{display:none}#maxbuttons #picker-modal .picker-inselection .items .item .button-remove,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button-remove{display:none;position:absolute;width:30px;height:30px;left:2px;border-radius:15px;top:2px;background-color:rgba(0,0,0,0.5)}#maxbuttons #picker-modal .picker-inselection .items .item .button-remove span,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item .button-remove span{font-size:20px;color:#fff;padding-left:5px;padding-top:5px}#maxbuttons #picker-modal .picker-inselection .items .item:hover .button-remove,#maxbuttons .max-modal.picker-modal .picker-inselection .items .item:hover .button-remove{display:block}#maxbuttons #picker-modal .picker-inselection .add,#maxbuttons .max-modal.picker-modal .picker-inselection .add{float:right;margin-top:15px;margin-right:15px;height:100%}#maxbuttons .social_block .social-option{clear:both;margin-top:25px}#maxbuttons .social_block .social-option .shortcode-container{display:inline-block}#maxbuttons .social_block .social-option .button_name{display:inline-block;margin-left:10px;vertical-align:middle;font-weight:700}#maxbuttons #mbfeedback .link{height:25px;width:100px;position:fixed;top:40%;right:0;z-index:1000;transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}#maxbuttons #mbfeedback .link a{background:#ccc;height:25px;width:70px;padding:8px 16px;color:#fff;font-family:Arial, sans-serif;font-size:15px;font-weight:bold;text-decoration:none;line-height:15px;border-bottom:solid 1px #333;border-left:solid 1px #333;border-right:solid 1px #fff}#maxbuttons #mbfeedback .link a::hover{background:#06c}#maxbuttons .ad-wrap{width:27%;float:left;max-width:300px;margin-left:1%;min-width:200px;margin-top:41px}#maxbuttons .ad-wrap .ads{background:#fff;margin-bottom:20px;text-align:center}#maxbuttons .ad-wrap .ads.image-ad{background:none;margin-top:20px}#maxbuttons .ad-wrap .ads.image-ad img{max-width:100%}#maxbuttons .ad-wrap .ads>a{text-decoration:none}#maxbuttons .ad-wrap .ads .header{background-color:#88c5c2;color:#fff;font-size:18px;text-transform:uppercase;padding:12px}#maxbuttons .ad-wrap .ads h3{text-align:center;padding-bottom:14px}#maxbuttons .ad-wrap .ads ul{list-style:none}#maxbuttons .ad-wrap .ads ul li{font-weight:bold;text-decoration:none;color:#000000}#maxbuttons .ad-wrap .ads ul li.plus{font-size:38px;font-weight:700;color:#88c5c2}#maxbuttons .ad-wrap .ads span.img{text-align:center;display:block}#maxbuttons .ad-wrap .ads .ads_button_wrap{margin:20px 0 30px;display:inline-block}#maxbuttons .ad-wrap .ads .ads_button_wrap .button{color:#fff;background-color:#88c5c2;font-size:16px;font-weight:bold;border:0;padding:0 40px}@media screen and (max-width: 960px){#maxbuttons .ad-wrap{display:none}}#maxbuttons.maxbuttons-pro-gopro .main{width:95%;max-width:860px}#maxbuttons.maxbuttons-pro-gopro h1.title{margin:0;font-size:24px;display:inline-block}#maxbuttons.maxbuttons-pro-gopro h1.title .big-maxg-btn{display:inline-block;background-color:#86c5c2;border-color:#73a3a8;margin:0 10px;vertical-align:super;line-height:23px;border-top:0;border-left:0;border-right:0;top:5px}#maxbuttons.maxbuttons-pro-gopro h1.title img{vertical-align:middle}#maxbuttons.maxbuttons-pro-gopro .logo{margin:0;display:inline-block;margin-top:14px}#maxbuttons.maxbuttons-pro-gopro .logo .simple-btn{color:#62c0e6;text-decoration:underline}#maxbuttons.maxbuttons-pro-gopro .default-section{text-align:center;padding:0px 10px}#maxbuttons.maxbuttons-pro-gopro .default-section p{position:relative;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size:16px;margin:17px 0;color:#5b5b5b}#maxbuttons.maxbuttons-pro-gopro .default-section:nth-child(even){background-color:#fff}#maxbuttons.maxbuttons-pro-gopro .default-section:nth-child(odd){background-color:#faf5f1}#maxbuttons.maxbuttons-pro-gopro .default-section .big-maxg-btn{background-color:#fd8d61;border-color:#f0702b;font-size:36px;margin:10px}#maxbuttons.maxbuttons-pro-gopro .default-section h2{font-family:'Quicksand', sans-serif;font-weight:bold;color:#88c5c2;font-size:36px;line-height:38px;max-width:80%;margin:14px auto}#maxbuttons.maxbuttons-pro-gopro .default-section .rating{width:380px;margin:0 auto}#maxbuttons.maxbuttons-pro-gopro .default-section .rating p{margin:10px 0 0;font-size:22px;color:#000}#maxbuttons.maxbuttons-pro-gopro .default-section .icon-row p{font-weight:bold}#maxbuttons.maxbuttons-pro-gopro .default-section .icon-row img{width:106px;height:106px}#maxbuttons.maxbuttons-pro-gopro .social-row div{margin-bottom:5px}#maxbuttons.maxbuttons-pro-gopro .social-row p{background:#fff;padding:15px 5px 0 5px;margin:15px 0 0 15px;font-weight:700}#maxbuttons.maxbuttons-pro-gopro .social-row img{margin-top:15px}#maxbuttons.maxbuttons-pro-gopro .social-row p{min-height:162px}#maxbuttons.maxbuttons-pro-gopro .container{width:inherit;margin:0 auto;padding:30px 0}#maxbuttons.maxbuttons-pro-gopro img{max-width:100%}#maxbuttons.maxbuttons-pro-gopro .icon-row,#maxbuttons.maxbuttons-pro-gopro .image-row{position:relative}#maxbuttons.maxbuttons-pro-gopro .width-100{width:100%;margin-bottom:15px}#maxbuttons.maxbuttons-pro-gopro .width-33{width:33.33333333%;float:left;padding:0 15px;margin:0 -15px 40px}#maxbuttons.maxbuttons-pro-gopro .width-50{width:50%;float:left;padding:0 15px;margin:0 -15px 40px}#maxbuttons.maxbuttons-pro-gopro .clearfix{clear:both}#maxbuttons.maxbuttons-pro-gopro .bordered{border-radius:30px;padding:16px;background-color:#fff;box-sizing:border-box}@media (max-width: 780px){#maxbuttons.maxbuttons-pro-gopro .bordered{border:0;padding:8}}#maxbuttons.maxbuttons-pro-gopro .bordered p{margin:0 0 10px}#maxbuttons.maxbuttons-pro-gopro .inline-block{display:inline-block !important;vertical-align:middle}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn{font-family:'Quicksand', sans-serif;font-size:20px;color:#fff;font-weight:bold;padding:10px 15px;transition:all linear .2s;display:block;text-align:center;border-bottom:4px solid;text-transform:uppercase;border-radius:10px;text-decoration:none;line-height:42px}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:hover,#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:focus{color:#fff;text-decoration:none;outline:none}#maxbuttons.maxbuttons-pro-gopro .big-maxg-btn:hover{box-shadow:0 8px 6px -6px rgba(0,0,0,0.5)}.maxmodal-data{display:none}body.max-modal-active{overflow:hidden}.max-modal{display:none;width:60%;max-width:70%;height:auto;max-height:90vh;overflow:hidden;position:fixed;left:50%;top:50%;z-index:100101;display:none;background:#ffffff;border-radius:4px 4px 4px 4px;-webkit-border-radius:4px 4px 4px 4px;-webkit-box-shadow:-3px -3px 10px rgba(0,0,0,0.5);-moz-box-shadow:-3px -3px 10px rgba(0,0,0,0.5);box-shadow:-3px -3px 10px rgba(0,0,0,0.5)}.max-modal.fullscreen{width:auto;max-width:auto;max-height:auto;left:10px;right:10px;top:10px;bottom:10px}@media (max-width: 960px){.max-modal{max-width:90%}}@media (max-width: 780px){.max-modal{max-width:100%}}.max-modal.success{border:4px solid green}.max-modal.error{border:4px solid red}.max-modal.error h3{background-color:#ff0000}.max-modal .content-area{background-color:#fff}.max-modal .modal_header{text-align:center;font-size:16px;font-weight:700;background-color:#f3f3f3;border-bottom:1px solid #ccc;padding:8px 5px;cursor:move}.max-modal .modal_header h3{margin:0;color:#444;font-weight:400;padding:0;text-align:center;text-shadow:none;font-size:16px}.max-modal .modal_header .modal_close{position:absolute;right:5px;top:8px;width:20px;height:20px;cursor:pointer;color:#444}.max-modal .modal_header .modal_close:hover{cursor:pointer;color:#111}.max-modal .content,.max-modal .modal_content{text-align:center;padding:5px 15px 10px;height:100%;overflow-y:auto}.max-modal textarea{overflow-x:auto}.max-modal .controls{padding:10px;text-align:center;clear:both}.max-modal .controls .button,.max-modal .controls .button-primary{margin-right:8px}.max-modal .tablenav .tablenav-pages a,.max-modal .tablenav-pages-navspan{background:#e5e5e5 none repeat scroll 0 0;border:1px solid #cccccc;display:inline-block;font-size:16px;font-weight:normal;line-height:1;min-width:17px;padding:3px 5px 7px;text-align:center}.max-modal textarea#maxbutton-css{width:100%;height:250px;font-family:Consolas, 'Courier New', 'Courier';font-size:13px;white-space:normal;word-wrap:break-word;overflow:none}.maxmodal_overlay{background:#000;left:0;right:0;bottom:0;top:0;height:100%;position:fixed;opacity:0.7;z-index:100100;display:none}.media-buttons #maxbuttons{margin:0;overflow-y:auto}.media-buttons #maxbuttons .preview-buttons{border:0;clear:both}.media-buttons #maxbuttons .preview-buttons .hint{font-size:12px;float:left;display:inline-block;line-height:30px;margin-top:3px}.media-buttons #maxbuttons .button-select{cursor:pointer;border:1px solid #fff}.media-buttons #maxbuttons .button-select.selected{border-top:1px solid #0085ba;border-bottom:1px solid #0085ba;background:#f7f7f7}.media-buttons #maxbuttons .button-select.selected .col_insert .small{font-weight:700}.media-buttons #maxbuttons .col_insert{width:150px;padding-top:15px}.media-buttons #maxbuttons .col_insert .small{font-size:10px}.media-buttons .pagination{width:100%;margin:10px 0;min-height:20px}.media-buttons .pagination span{font-size:15px;font-weight:700;float:left;cursor:pointer}.media-buttons .pagination .next{float:right}.media-buttons .shortcode_options{width:400px;margin:0 auto;display:inline-block}.media-buttons .shortcode_options .button_example{margin:15px}.media-buttons .shortcode_options input{margin-bottom:10px;display:inline-block;float:left}.media-buttons .shortcode_options label{margin-right:25px;display:inline-block;float:left;clear:left;width:100px;line-height:20px;font-weight:700}.media-buttons .shortcode_options p{clear:both}.media-buttons .shortcode_options input[type='button']{clear:both;float:none}.media-buttons .loading{background:transparent url("../../images/spinner.gif") no-repeat scroll 0 0/20px 20px;display:inline-block;float:right;margin:5px 5px 0 0;height:40px;opacity:0.7;vertical-align:middle;visibility:hidden;width:40px}.media-buttons .controls{position:absolute;width:100%;padding:10px 0;background:#f3f3f3;text-align:right;bottom:0;left:0;border-top:1px solid #ccc}
assets/scss/_collection.scss CHANGED
@@ -5,6 +5,33 @@
5
  max-width: none;
6
  }
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  .collection-addnew
9
  {
10
  display: inline-block;
5
  max-width: none;
6
  }
7
 
8
+ // temp interface befire exit collection IF
9
+ .social-share-move {
10
+ padding: 15px;
11
+ border: 0;
12
+ .inside {
13
+ border: 0;
14
+ }
15
+ h3 {
16
+ font-size: 28px;
17
+ line-height: 30px;
18
+
19
+ }
20
+
21
+ p {
22
+ font-size: 16px;
23
+ }
24
+ a {
25
+ width: 200px;
26
+ height: auto;
27
+ font-size: 30px;
28
+ line-height: 32px;
29
+ padding: 12px 0;
30
+ text-align: center;
31
+ }
32
+
33
+ }
34
+
35
  .collection-addnew
36
  {
37
  display: inline-block;
assets/scss/_elements.scss CHANGED
@@ -1,32 +1,44 @@
1
 
2
- /* Here be elements for the editors.Standardized somehow */
3
 
4
 
5
- select {
6
- width: 150px;
7
  &.small { width: auto; } // small as can be.
8
- }
9
 
10
- .input {
11
  display: inline-block;
12
  margin-right: 15px;
13
  //margin-top: 3px;
14
  min-height: 35px;
15
 
16
-
17
- img { vertical-align: middle; }
18
- &.mbcolor { min-width: 50px; }
19
  &.checkbox { //padding-top: 8px;
20
  input { margin-top: 0; }
21
  label {
22
- line-height: 16px;
23
  margin-top: 0 !important;
24
  }
25
  }
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  input {
29
- // margin-top: 0;
30
  // padding: 3px 4px;
31
  }
32
 
@@ -36,12 +48,12 @@ input[type='text'] {
36
  {
37
  width: 350px;
38
  }
39
- &.tiny {
40
- width: 35px;
41
  vertical-align: middle;
42
  }
43
  &.small {
44
- width: 50px;
45
  }
46
  &.medium {
47
  width: 150px;
@@ -53,15 +65,15 @@ input[type='text'] {
53
 
54
  input[type='number']
55
  {
56
- vertical-align: middle;
57
-
58
- &.tiny, &.tiny-nopad {
59
- width: 55px;
60
  @include bp(780)
61
  {
62
- width: 60px;
63
- }
64
- }
65
  &.small { width: 70px;
66
  @include bp(780)
67
  {
@@ -81,36 +93,36 @@ textarea {
81
 
82
 
83
 
84
- // finetuning
85
  .option-container .inside .option {
86
- label.mbcolor:nth-of-type(2) {
87
  margin-left: 37px;
88
-
89
- }
90
  &.url { margin-bottom: 0; }
91
- &.url_options { margin: 5px 0 10px; }
92
- &.url_options .nofollow { margin-left: 35px; }
93
- &.url_options, &.rel_options
94
  {
95
  label {
96
  font-weight: 400;
97
  }
98
- // .input { float: left; }
99
  }
100
- &.font .checkbox {
101
  margin-right: 2px;
102
- }
103
 
104
- &.font .radio { margin-right: 0; }
105
- &.font .input.font { margin-right: 2px; }
106
 
107
  &.font .input.font_size {
108
- margin-right: 0;
109
  &:after {
110
  display: block;
111
  }
112
- }
113
-
114
  @include bp(780)
115
  {
116
  &.font {
@@ -118,81 +130,81 @@ textarea {
118
  &:after {
119
  clear: both;
120
  }
121
-
122
  > * { float: left; }
123
  }
124
  }
125
-
126
  &.font .control-group.font_weight {
127
- margin-left: 28px;
128
  @include bp(780)
129
  {
130
 
131
- clear: left;
132
  margin-left: 148px;
133
  margin-top: 10px;
134
  }
135
  }
136
  &.font .control-group.text_align {
137
- margin-left: 48px;
138
  @include bp(780)
139
  {
140
  margin-left: 20px;
141
  margin-top: 10px;
142
  }
143
  }
144
-
145
  &.padding_top .input, &.container_margin_top .input {
146
  margin-right: 30px;
147
- &:last-of-type { margin-right: 0; }
148
  @include bp(780)
149
  {
150
  margin-right: 15px;
151
  }
152
 
153
- }
154
- &.text_color label { padding-top: 10px; }
155
- &.text_color label:nth-of-type(2) { margin-left: 51px; }
156
- &.description label { padding-top: 35px; }
157
 
158
  .radius-wrap {
159
- position: relative;
160
- margin-left: 45px;
161
  display: inline-block;
162
- }
163
- &.radius {
164
- .label:first-child { width: 100px; float:left; }
165
- .bottom, .top {
166
  position: relative;
167
- .input { margin-right: 0; margin-left: 0;}
168
- .dashicons:nth-child(3) { margin-right: 10px; }
169
- }
170
  .top { margin-bottom: 10px; }
171
- label {
172
- display:inline-block;
173
- font-weight: 700;
174
- width: 90px;
175
  margin-left: 5px;
176
  cursor: default;
177
- }
178
- .dashicons { font-size: 35px; height: 35px; width: 35px; color:#ccc; }
179
- .top .dashicons { margin-top: -5px; }
180
- .bottom .dashicons { margin-top: 5px; }
181
- #radius_toggle {
182
- position: absolute;
183
- left:46%;
184
- top:25px;
185
  font-size: 30px;
186
  cursor:pointer;
187
- }
188
-
189
  }
190
- &.gradient_head .label:nth-child(even) { width: 120px; }
191
  .gradient_end_color, .gradient_end_color_hover {
192
- margin-left: 58px;
193
  }
194
-
195
-
196
  } // end
197
 
198
  .default {
@@ -203,39 +215,39 @@ textarea {
203
  font-style: italic;
204
  color: #808080;
205
 
206
- .other {
207
  padding-left: 40px;
208
  padding-top: 8px;
209
-
210
-
211
  }
212
  }
213
 
214
  .mb-button {
215
- width: 38px;
216
- height: 38px;
217
  background-color: #eceded;
218
- display: inline-block;
219
- margin-right: 6px;
220
  cursor: pointer;
221
  display: none;
222
-
223
  span {
224
- text-align:center;
225
- padding: 9px 0;
226
  width: 100%;
227
  line-height: 20px;
228
  }
229
  }
230
 
231
  .check_button
232
- {
233
  display: none;
234
  + label{
235
- background-position: center center;
236
- background-repeat: no-repeat;
237
  background-color: #fff;
238
- display: inline-block;
239
  border: 1px solid #ddd;
240
  font_weight: normal;
241
  padding: 4px;
@@ -244,87 +256,87 @@ textarea {
244
  padding: 10px;
245
  }
246
  }
247
- &.text + label {
248
- padding: 5px;
249
-
250
  }
251
 
252
  &.icon + label i
253
- {
254
- width: 20px;
255
- height: 20px;
256
  color: #545454;
257
- &:focus {
258
  outline: none;
259
  }
260
  }
261
 
262
- &:checked + label {
263
  background: #ebebeb none repeat scroll 0 0;
264
  border-color: #999999;
265
  box-shadow: 0 2px 5px -3px rgba(0, 0, 0, 0.3) inset;
266
- }
267
 
268
  }
269
 
270
- /** Slider / Range input **/
271
  .option .input_label {
272
- display: inline-block;
273
- vertical-align: top;
274
  &.left { margin-right: 10px; }
275
  &.right { margin-left: 10px; }
276
- }
277
 
278
  .option .range_value
279
  {
280
  margin-top: 5px;
281
 
282
- output {
283
- clear: both;
284
  font-size: 18px;
285
- text-align: center;
286
  width: 100%;
287
  display: inline-block;
288
  }
289
  }
290
 
291
 
292
- .option .switch_label {
293
  //vertical-align: top;
294
  //line-height: 35px;
295
  padding-top: 2px !important;
296
  margin: 0 !important;
297
  /*display: inline-block;
298
  padding: 5px;
299
- font-size: 14px;
300
  margin-right: 10px;
301
  */
302
  }
303
 
304
- .switch_button
305
  {
306
  margin-left: -5px;
307
-
308
  label{
309
  padding: 8px 5px; // this padding to make clicking more flexible ( bigger hitbox )
310
-
311
  &:focus {
312
  outline: none;
313
- }
314
  }
315
- input { display: none;
316
- &:checked ~ .the_switch { background: #6fbeb5; }
317
  &:checked ~ .the_switch:after {
318
  left: 26px;
319
  background: #179588;
320
- }
321
  &::disabled ~ .the_switch{
322
  background: #d5d5d5;
323
  pointer-events: none;
324
  }
325
  &:disabled ~ .the_switch:after { background: #bcbdbc; }
326
- }
327
- .the_switch{
328
  position: relative;
329
  display: inline-block;
330
  height: 15px;
@@ -346,7 +358,7 @@ textarea {
346
  content: '';
347
  transition: all 0.2s ease;
348
  }
349
- &:active:after { transform: scale(0.9, 0.85); }
350
  &:focus {
351
  outline: none;
352
  }
@@ -356,48 +368,48 @@ textarea {
356
 
357
 
358
 
359
- /** COLORPICKER **/
360
 
361
- .input.mbcolor {
362
  margin-top: 5px;
363
- position: relative;
364
-
365
- .wp-picker-clear { display: none; } // can't control behavior -- xxit.
366
- input[type="text"] { width: 75px; line-height: 22px; }
367
- .wp-color-picker {
368
- width: inherit;
369
- }
370
- .wp-color-result {
371
  @include box-shadow(-1px, 1px, 2px, #999);
372
  height: 30px;
373
- border: 0;
374
 
375
  &:after {
376
- font-size: 12px;
377
- line-height: 30px;
378
  display: none;
379
  }
380
- &:focus {
381
  border-color: #5b9dd9;
382
  @include box-shadow(0, 0, 5px, rgba(30, 140, 190, 0.8) );
383
- }
384
  }
385
 
386
- .wp-color-result-text { // looming in WP 4.9 A
387
  display: none;
388
- }
389
  .wp-picker-input-wrap {
390
  padding: 0;
391
  }
392
 
393
- .wp-picker-active {
394
  & + .arrows {
395
  display: inline-block;
396
- }
397
-
398
  }
399
- .arrows {
400
- position: absolute;
401
  display: none;
402
  top: 0;
403
  margin-top: 40%;
@@ -407,40 +419,49 @@ textarea {
407
  &.left {
408
  left: -35px;
409
  }
410
-
411
  .arrow-left, .arrow-right {
412
- width: 0;
413
- height: 0;
414
  font-size: 0;
415
- line-height: 0;
416
  vertical-align: bottom;
417
  cursor: pointer;
 
 
418
  }
419
- .arrow-left {
420
  border-top: 30px solid transparent;
421
- border-bottom: 30px solid transparent;
422
- border-right:20px solid #ccc;
 
 
 
 
423
  }
424
  .arrow-right {
425
  border-top: 30px solid transparent;
426
  border-bottom: 30px solid transparent;
427
-
428
  border-left: 20px solid #ccc;
429
  margin-top: 35px;
430
- }
431
-
 
 
 
 
432
  .left, .right {
433
  display: inline-block;
434
  float: left;
435
  clear: both;
436
  width: 35px;
437
  height: 45px;
438
-
439
- }
440
  .left {
441
  margin-top: 15px;
442
  }
443
  }
444
-
445
- }
446
 
 
1
 
2
+ /* Here be elements for the editors.Standardized somehow */
3
 
4
 
5
+ select {
6
+ width: 150px;
7
  &.small { width: auto; } // small as can be.
8
+ }
9
 
10
+ .input {
11
  display: inline-block;
12
  margin-right: 15px;
13
  //margin-top: 3px;
14
  min-height: 35px;
15
 
16
+
17
+ img { vertical-align: middle; }
18
+ &.mbcolor { min-width: 50px; }
19
  &.checkbox { //padding-top: 8px;
20
  input { margin-top: 0; }
21
  label {
22
+ line-height: 16px;
23
  margin-top: 0 !important;
24
  }
25
  }
26
  }
27
 
28
+ .maxajax-load-spinner {
29
+ width: 16px;
30
+ height: 16px;
31
+ background: url('/wp-admin/images/wpspin_light.gif') no-repeat;
32
+ opacity: 0.9s;
33
+ display: inline-block;
34
+ margin: 0 10px;
35
+ z-index: 10;
36
+ vertical-align: middle;
37
+ }
38
+
39
+
40
  input {
41
+ // margin-top: 0;
42
  // padding: 3px 4px;
43
  }
44
 
48
  {
49
  width: 350px;
50
  }
51
+ &.tiny {
52
+ width: 35px;
53
  vertical-align: middle;
54
  }
55
  &.small {
56
+ width: 50px;
57
  }
58
  &.medium {
59
  width: 150px;
65
 
66
  input[type='number']
67
  {
68
+ vertical-align: middle;
69
+
70
+ &.tiny, &.tiny-nopad {
71
+ width: 55px;
72
  @include bp(780)
73
  {
74
+ width: 60px;
75
+ }
76
+ }
77
  &.small { width: 70px;
78
  @include bp(780)
79
  {
93
 
94
 
95
 
96
+ // finetuning
97
  .option-container .inside .option {
98
+ label.mbcolor:nth-of-type(2) {
99
  margin-left: 37px;
100
+
101
+ }
102
  &.url { margin-bottom: 0; }
103
+ &.url_options { margin: 5px 0 10px; }
104
+ &.url_options .nofollow { margin-left: 35px; }
105
+ &.url_options, &.rel_options
106
  {
107
  label {
108
  font-weight: 400;
109
  }
110
+ // .input { float: left; }
111
  }
112
+ &.font .checkbox {
113
  margin-right: 2px;
114
+ }
115
 
116
+ &.font .radio { margin-right: 0; }
117
+ &.font .input.font { margin-right: 2px; }
118
 
119
  &.font .input.font_size {
120
+ margin-right: 0;
121
  &:after {
122
  display: block;
123
  }
124
+ }
125
+
126
  @include bp(780)
127
  {
128
  &.font {
130
  &:after {
131
  clear: both;
132
  }
133
+
134
  > * { float: left; }
135
  }
136
  }
137
+
138
  &.font .control-group.font_weight {
139
+ margin-left: 28px;
140
  @include bp(780)
141
  {
142
 
143
+ clear: left;
144
  margin-left: 148px;
145
  margin-top: 10px;
146
  }
147
  }
148
  &.font .control-group.text_align {
149
+ margin-left: 48px;
150
  @include bp(780)
151
  {
152
  margin-left: 20px;
153
  margin-top: 10px;
154
  }
155
  }
156
+
157
  &.padding_top .input, &.container_margin_top .input {
158
  margin-right: 30px;
159
+ &:last-of-type { margin-right: 0; }
160
  @include bp(780)
161
  {
162
  margin-right: 15px;
163
  }
164
 
165
+ }
166
+ &.text_color label { padding-top: 10px; }
167
+ &.text_color label:nth-of-type(2) { margin-left: 51px; }
168
+ &.description label { padding-top: 35px; }
169
 
170
  .radius-wrap {
171
+ position: relative;
172
+ margin-left: 45px;
173
  display: inline-block;
174
+ }
175
+ &.radius {
176
+ .label:first-child { width: 100px; float:left; }
177
+ .bottom, .top {
178
  position: relative;
179
+ .input { margin-right: 0; margin-left: 0;}
180
+ .dashicons:nth-child(3) { margin-right: 10px; }
181
+ }
182
  .top { margin-bottom: 10px; }
183
+ label {
184
+ display:inline-block;
185
+ font-weight: 700;
186
+ width: 90px;
187
  margin-left: 5px;
188
  cursor: default;
189
+ }
190
+ .dashicons { font-size: 35px; height: 35px; width: 35px; color:#ccc; }
191
+ .top .dashicons { margin-top: -5px; }
192
+ .bottom .dashicons { margin-top: 5px; }
193
+ #radius_toggle {
194
+ position: absolute;
195
+ left:46%;
196
+ top:25px;
197
  font-size: 30px;
198
  cursor:pointer;
199
+ }
200
+
201
  }
202
+ &.gradient_head .label:nth-child(even) { width: 120px; }
203
  .gradient_end_color, .gradient_end_color_hover {
204
+ margin-left: 58px;
205
  }
206
+
207
+
208
  } // end
209
 
210
  .default {
215
  font-style: italic;
216
  color: #808080;
217
 
218
+ .other {
219
  padding-left: 40px;
220
  padding-top: 8px;
221
+
222
+
223
  }
224
  }
225
 
226
  .mb-button {
227
+ width: 38px;
228
+ height: 38px;
229
  background-color: #eceded;
230
+ display: inline-block;
231
+ margin-right: 6px;
232
  cursor: pointer;
233
  display: none;
234
+
235
  span {
236
+ text-align:center;
237
+ padding: 9px 0;
238
  width: 100%;
239
  line-height: 20px;
240
  }
241
  }
242
 
243
  .check_button
244
+ {
245
  display: none;
246
  + label{
247
+ background-position: center center;
248
+ background-repeat: no-repeat;
249
  background-color: #fff;
250
+ display: inline-block;
251
  border: 1px solid #ddd;
252
  font_weight: normal;
253
  padding: 4px;
256
  padding: 10px;
257
  }
258
  }
259
+ &.text + label {
260
+ padding: 5px;
261
+
262
  }
263
 
264
  &.icon + label i
265
+ {
266
+ width: 20px;
267
+ height: 20px;
268
  color: #545454;
269
+ &:focus {
270
  outline: none;
271
  }
272
  }
273
 
274
+ &:checked + label {
275
  background: #ebebeb none repeat scroll 0 0;
276
  border-color: #999999;
277
  box-shadow: 0 2px 5px -3px rgba(0, 0, 0, 0.3) inset;
278
+ }
279
 
280
  }
281
 
282
+ /** Slider / Range input **/
283
  .option .input_label {
284
+ display: inline-block;
285
+ vertical-align: top;
286
  &.left { margin-right: 10px; }
287
  &.right { margin-left: 10px; }
288
+ }
289
 
290
  .option .range_value
291
  {
292
  margin-top: 5px;
293
 
294
+ output {
295
+ clear: both;
296
  font-size: 18px;
297
+ text-align: center;
298
  width: 100%;
299
  display: inline-block;
300
  }
301
  }
302
 
303
 
304
+ .option .switch_label {
305
  //vertical-align: top;
306
  //line-height: 35px;
307
  padding-top: 2px !important;
308
  margin: 0 !important;
309
  /*display: inline-block;
310
  padding: 5px;
311
+ font-size: 14px;
312
  margin-right: 10px;
313
  */
314
  }
315
 
316
+ .switch_button
317
  {
318
  margin-left: -5px;
319
+
320
  label{
321
  padding: 8px 5px; // this padding to make clicking more flexible ( bigger hitbox )
322
+
323
  &:focus {
324
  outline: none;
325
+ }
326
  }
327
+ input { display: none;
328
+ &:checked ~ .the_switch { background: #6fbeb5; }
329
  &:checked ~ .the_switch:after {
330
  left: 26px;
331
  background: #179588;
332
+ }
333
  &::disabled ~ .the_switch{
334
  background: #d5d5d5;
335
  pointer-events: none;
336
  }
337
  &:disabled ~ .the_switch:after { background: #bcbdbc; }
338
+ }
339
+ .the_switch{
340
  position: relative;
341
  display: inline-block;
342
  height: 15px;
358
  content: '';
359
  transition: all 0.2s ease;
360
  }
361
+ &:active:after { transform: scale(0.9, 0.85); }
362
  &:focus {
363
  outline: none;
364
  }
368
 
369
 
370
 
371
+ /** COLORPICKER **/
372
 
373
+ .input.mbcolor {
374
  margin-top: 5px;
375
+ position: relative;
376
+
377
+ .wp-picker-clear { display: none; } // can't control behavior -- xxit.
378
+ input[type="text"] { width: 75px; line-height: 22px; }
379
+ .wp-color-picker {
380
+ width: inherit;
381
+ }
382
+ .wp-color-result {
383
  @include box-shadow(-1px, 1px, 2px, #999);
384
  height: 30px;
385
+ border: 0;
386
 
387
  &:after {
388
+ font-size: 12px;
389
+ line-height: 30px;
390
  display: none;
391
  }
392
+ &:focus {
393
  border-color: #5b9dd9;
394
  @include box-shadow(0, 0, 5px, rgba(30, 140, 190, 0.8) );
395
+ }
396
  }
397
 
398
+ .wp-color-result-text { // looming in WP 4.9 A
399
  display: none;
400
+ }
401
  .wp-picker-input-wrap {
402
  padding: 0;
403
  }
404
 
405
+ .wp-picker-active {
406
  & + .arrows {
407
  display: inline-block;
408
+ }
409
+
410
  }
411
+ .arrows {
412
+ position: absolute;
413
  display: none;
414
  top: 0;
415
  margin-top: 40%;
419
  &.left {
420
  left: -35px;
421
  }
422
+
423
  .arrow-left, .arrow-right {
424
+ width: 0;
425
+ height: 0;
426
  font-size: 0;
427
+ line-height: 0;
428
  vertical-align: bottom;
429
  cursor: pointer;
430
+ transition: .8s;
431
+
432
  }
433
+ .arrow-left {
434
  border-top: 30px solid transparent;
435
+ border-bottom: 30px solid transparent;
436
+ border-right:20px solid #ccc;
437
+ &:hover {
438
+ border-right-color: #33b3db;
439
+ }
440
+
441
  }
442
  .arrow-right {
443
  border-top: 30px solid transparent;
444
  border-bottom: 30px solid transparent;
445
+
446
  border-left: 20px solid #ccc;
447
  margin-top: 35px;
448
+ &:hover {
449
+ border-left-color: #33b3db;
450
+ }
451
+
452
+ }
453
+
454
  .left, .right {
455
  display: inline-block;
456
  float: left;
457
  clear: both;
458
  width: 35px;
459
  height: 45px;
460
+
461
+ }
462
  .left {
463
  margin-top: 15px;
464
  }
465
  }
 
 
466
 
467
+ }
assets/scss/_general.scss CHANGED
@@ -3,14 +3,15 @@
3
 
4
  */
5
  .message {
6
- //border: solid 1px #e6db55;
7
  border-radius: 3px;
8
  -moz-border-radius: 3px;
9
  -webkit-border-radius: 3px;
10
  padding: 10px;
11
  margin: 10px 0px 20px 0px;
12
  clear: both;
13
-
 
14
 
15
  }
16
 
@@ -34,6 +35,9 @@
34
  background-color: #ffffe0;
35
 
36
  }
 
 
 
37
  &.mb-notice {
38
  @extend .shortcode;
39
  }
3
 
4
  */
5
  .message {
6
+ border: solid 1px #e6db55;
7
  border-radius: 3px;
8
  -moz-border-radius: 3px;
9
  -webkit-border-radius: 3px;
10
  padding: 10px;
11
  margin: 10px 0px 20px 0px;
12
  clear: both;
13
+ background: #fff;
14
+
15
 
16
  }
17
 
35
  background-color: #ffffe0;
36
 
37
  }
38
+ &.warning { border-left: 4px solid #ffba00; }
39
+ &.error { border-left: 4px solid #ff0000; }
40
+
41
  &.mb-notice {
42
  @extend .shortcode;
43
  }
assets/scss/_global.scss CHANGED
@@ -5,11 +5,11 @@
5
  // colorpicker
6
  .mb_colorpicker {
7
  z-index: 200;
8
-
9
  }
10
-
11
-
12
- .ads
13
  {
14
  .button-primary {
15
  display: block;
@@ -29,16 +29,21 @@
29
  height: 16px;
30
  display: inline-block;
31
  vertical-align: middle;
32
- position: absolute;
33
- top: 50%;
34
- left: 50%;
35
- margin-left: -8px;
36
- margin-top: -8px;
37
  z-index: 10;
 
 
 
 
 
38
  }
39
 
40
- .max-load-overlay {
41
- position: absolute;
42
  top: 0;
43
  left: 0;
44
  right: 0;
@@ -47,5 +52,3 @@
47
  background-color: #f0f0f0;
48
  z-index: 9;
49
  }
50
-
51
-
5
  // colorpicker
6
  .mb_colorpicker {
7
  z-index: 200;
8
+
9
  }
10
+
11
+
12
+ .ads
13
  {
14
  .button-primary {
15
  display: block;
29
  height: 16px;
30
  display: inline-block;
31
  vertical-align: middle;
32
+ position: absolute;
33
+ top: 50%;
34
+ left: 50%;
35
+ margin-left: -8px;
36
+ margin-top: -8px;
37
  z-index: 10;
38
+ &.large {
39
+ background: url('/wp-admin/images/wpspin_light-2x.gif') no-repeat;
40
+ width: 32px;
41
+ height: 32px;
42
+ }
43
  }
44
 
45
+ .max-load-overlay {
46
+ position: absolute;
47
  top: 0;
48
  left: 0;
49
  right: 0;
52
  background-color: #f0f0f0;
53
  z-index: 9;
54
  }
 
 
assets/scss/_maxmodal.scss CHANGED
@@ -3,30 +3,47 @@
3
  display: none;
4
  }
5
 
 
 
 
 
 
6
  .max-modal {
7
  display: none;
8
  width: 60%;
9
- max-width: 70%;
10
- height: auto;
11
  max-height: 90vh;
12
  overflow: hidden;
13
 
14
- position: fixed;
15
- left: 50%;
16
- top: 50%;
17
  //overflow-y: auto;
18
- z-index: 100101; // just trying to stay on top, don't blame me.
19
-
 
 
 
 
 
 
 
 
 
 
 
 
20
  display: none;
21
  background: #ffffff;
22
-
23
  @include border-radius(4px, 4px,4px,4px);
24
- @include box-shadow( -3px, -3px, 10px, rgba(0,0 , 0, 0.5) );
25
-
26
- @include bp(960)
27
  {
28
  max-width: 90%
29
-
30
  }
31
  @include bp(780)
32
  {
@@ -35,62 +52,62 @@
35
  &.success {
36
  //borer: solgreen;
37
  border: 4px solid green;
38
-
39
  }
40
- &.error {
41
- border: 4px solid red;
42
  h3 { background-color: #ff0000;}
43
  }
44
-
45
- .content-area {
46
  background-color: #fff;
47
-
48
  }
49
 
50
  .modal_header {
51
- text-align: center;
52
  font-size: 16px;
53
  font-weight: 700;
54
- background-color: #f3f3f3;
55
  border-bottom: 1px solid #ccc;
56
  padding: 8px 5px;
57
  cursor: move;
58
-
59
- h3 {
60
- margin: 0;
61
  color: #444;
62
  font-weight: 400;
63
- padding: 0;
64
  text-align: center;
65
  text-shadow: none;
66
  font-size: 16px;
67
- }
68
-
69
  .modal_close {
70
- position: absolute;
71
- right: 5px;
72
  top: 8px;
73
  width: 20px;
74
  height: 20px;
75
  cursor: pointer;
76
  color: #444;
77
- &:hover {
78
  cursor: pointer;
79
  color: #111;
80
  }
81
- }
82
- }
83
- .content, .modal_content {
84
- text-align: center;
85
  padding: 5px 15px 10px;
86
  //display: inline-block;
87
- height: auto;
88
  //margin-top: -40px;
89
  overflow-y: auto;
90
  }
91
- textarea { overflow-x: auto; }
92
- .controls {
93
- padding: 10px;
94
  text-align: center;
95
  clear: both;
96
  .button, .button-primary
@@ -99,7 +116,7 @@
99
  }
100
  }
101
 
102
- /* Fixes for Beaver Builder, which loads without WP backend styles */
103
  .tablenav .tablenav-pages a, .tablenav-pages-navspan {
104
  background: #e5e5e5 none repeat scroll 0 0;
105
  border: 1px solid #cccccc;
@@ -111,7 +128,7 @@
111
  padding: 3px 5px 7px;
112
  text-align: center;
113
  }
114
-
115
  }
116
 
117
 
@@ -124,18 +141,18 @@
124
  word-wrap: break-word;
125
  overflow: none;
126
  }
127
-
128
- .maxmodal_overlay
129
  {
130
- background: #000;
131
  left: 0;
132
- right: 0;
133
  bottom: 0;
134
- top: 0;
135
  height: 100%;
136
- position: fixed;
137
- opacity : 0.7;
138
  z-index: 100100;
139
  display: none;
140
 
141
- }
3
  display: none;
4
  }
5
 
6
+ body.max-modal-active {
7
+ overflow: hidden;
8
+
9
+ }
10
+
11
  .max-modal {
12
  display: none;
13
  width: 60%;
14
+ max-width: 70%;
15
+ height: auto;
16
  max-height: 90vh;
17
  overflow: hidden;
18
 
19
+ position: fixed;
20
+ left: 50%;
21
+ top: 50%;
22
  //overflow-y: auto;
23
+ z-index: 100101; // just trying to stay on top, don't blame me.
24
+
25
+ &.fullscreen {
26
+ width: auto;
27
+ max-width: auto;
28
+ max-height: auto;
29
+ left: 10px;
30
+ right: 10px;
31
+ top: 10px;
32
+ bottom: 10px;
33
+
34
+
35
+ }
36
+
37
  display: none;
38
  background: #ffffff;
39
+
40
  @include border-radius(4px, 4px,4px,4px);
41
+ @include box-shadow( -3px, -3px, 10px, rgba(0,0 , 0, 0.5) );
42
+
43
+ @include bp(960)
44
  {
45
  max-width: 90%
46
+
47
  }
48
  @include bp(780)
49
  {
52
  &.success {
53
  //borer: solgreen;
54
  border: 4px solid green;
55
+
56
  }
57
+ &.error {
58
+ border: 4px solid red;
59
  h3 { background-color: #ff0000;}
60
  }
61
+
62
+ .content-area {
63
  background-color: #fff;
64
+
65
  }
66
 
67
  .modal_header {
68
+ text-align: center;
69
  font-size: 16px;
70
  font-weight: 700;
71
+ background-color: #f3f3f3;
72
  border-bottom: 1px solid #ccc;
73
  padding: 8px 5px;
74
  cursor: move;
75
+
76
+ h3 {
77
+ margin: 0;
78
  color: #444;
79
  font-weight: 400;
80
+ padding: 0;
81
  text-align: center;
82
  text-shadow: none;
83
  font-size: 16px;
84
+ }
85
+
86
  .modal_close {
87
+ position: absolute;
88
+ right: 5px;
89
  top: 8px;
90
  width: 20px;
91
  height: 20px;
92
  cursor: pointer;
93
  color: #444;
94
+ &:hover {
95
  cursor: pointer;
96
  color: #111;
97
  }
98
+ }
99
+ }
100
+ .content, .modal_content {
101
+ text-align: center;
102
  padding: 5px 15px 10px;
103
  //display: inline-block;
104
+ height: 100%;
105
  //margin-top: -40px;
106
  overflow-y: auto;
107
  }
108
+ textarea { overflow-x: auto; }
109
+ .controls {
110
+ padding: 10px;
111
  text-align: center;
112
  clear: both;
113
  .button, .button-primary
116
  }
117
  }
118
 
119
+ /* Fixes for Beaver Builder, which loads without WP backend styles */
120
  .tablenav .tablenav-pages a, .tablenav-pages-navspan {
121
  background: #e5e5e5 none repeat scroll 0 0;
122
  border: 1px solid #cccccc;
128
  padding: 3px 5px 7px;
129
  text-align: center;
130
  }
131
+
132
  }
133
 
134
 
141
  word-wrap: break-word;
142
  overflow: none;
143
  }
144
+
145
+ .maxmodal_overlay
146
  {
147
+ background: #000;
148
  left: 0;
149
+ right: 0;
150
  bottom: 0;
151
+ top: 0;
152
  height: 100%;
153
+ position: fixed;
154
+ opacity : 0.7;
155
  z-index: 100100;
156
  display: none;
157
 
158
+ }
blocks/basic.php CHANGED
@@ -2,116 +2,116 @@
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
- $blockClass["basic"] = "basicBlock";
6
- $blockOrder[0][] = "basic";
7
 
8
-
9
- class basicBlock extends maxBlock
10
  {
11
- protected $blockname = "basic";
12
  protected $fields = array("name" => array("default" => ''),
13
- "status" => array("default" => "publish"),
14
  "description" => array("default" => ''),
15
  "url" => array("default" => ''),
16
- 'link_title' => array('default' => ''),
17
- // "text" => array("default" => ''),
18
  "new_window" => array("default" => 0),
19
  "nofollow" => array("default" => 0)
20
- );
21
- protected $protocols = array("http","https",'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'sms', 'callto', 'fax', 'xmpp', "javascript", 'file'); // allowed url protocols for esc_url functions
22
-
23
 
24
  function __construct()
25
  {
26
- parent::__construct();
27
  }
28
-
29
 
30
  public function parse_css($css, $mode = 'normal')
31
  {
32
  // emtpy string init is not like by PHP 7.1
33
  if (! is_array($css))
34
- $css = array();
 
 
35
 
36
- $data = $this->data[$this->blockname];
37
-
38
  $css["maxbutton"]["normal"]["position"] = "relative";
39
  $css["maxbutton"]["normal"]["text-decoration"] = "none";
40
  // $css["maxbutton"]["normal"]["white-space"] = "nowrap"; // hinders correct rendering of oneline-multilines
41
- $css["maxbutton"]["normal"]["display"] = "inline-block";
42
 
43
- /*if (isset($data["url"]) && $data["url"] == '') // don't show clickable anchor if there is no URL.
44
  {
45
- $css["maxbutton"]["normal"]["cursor"] = 'default';
46
- // $css[":hover"]["cursor"] = 'default';
47
- } */
 
 
48
 
49
- return $css;
50
-
51
  }
52
-
53
 
54
-
 
55
  public function save_fields($data, $post)
56
- {
57
- // Possible solution:
58
  // $post["url"] = isset($post["url"]) ? urldecode(urldecode($post["url"])) : '';
59
-
60
- $description = false;
61
 
62
- if (isset($post["description"]) && $post["description"] != '')
 
 
63
  {
64
- $description = str_replace("\n", '-nwline-', $post["description"]);
65
- $description = sanitize_text_field($description);
66
- $description = str_replace('-nwline-', "\n", $description);
67
-
68
  }
69
-
70
  $data = parent::save_fields($data, $post);
71
 
72
  // bypass sanitize for description - causing the end of line-breaks
73
- if ($description)
74
- $data["basic"]["description"] = $description;
75
-
76
  // bypassing sanitize text field - causes problems with URLs and spaces
77
- $url = isset($post["url"]) ? trim($post["url"]) : '';
78
-
79
- $parsed_url = parse_url($url);
80
- $rawEncode = array("query","fragment");
81
  foreach($rawEncode as $item)
82
  {
83
- if (isset($parsed_url[$item]))
84
  {
85
- $parsed_url[$item] = rawurlencode($parsed_url[$item]);
86
  }
87
  }
88
-
89
- $url = $this->unParseURL($parsed_url);
90
-
91
- $url = str_replace(" ", "%20", trim($url) );
92
-
93
  if (! $this->checkRelative($parsed_url))
94
  $url = esc_url_raw($url, $this->protocols); // str replace - known WP issue with spaces
95
-
96
  $data[$this->blockname]["url"] = $url;
97
-
98
- if (isset($post["name"]))
99
- $data["name"] = sanitize_text_field($post["name"]);
100
- if (isset($post["status"]))
101
- $data["status"] = sanitize_text_field($post["status"]); // for conversion old - new.
102
  return $data;
103
  }
104
-
105
  protected function unparseURL($parsed_url)
106
  {
107
  // Don't add // to these schemes
108
- $noslash_schemes = array('javascript', 'mailto', 'tel', 'sms');
109
  if (isset($parsed_url['scheme']) && in_array($parsed_url['scheme'], $noslash_schemes) )
110
  $scheme = $parsed_url["scheme"] . ":";
111
- else
112
  $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
113
-
114
-
115
  $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
116
  $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
117
  $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
@@ -122,363 +122,369 @@ class basicBlock extends maxBlock
122
  $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
123
  return "$scheme$user$pass$host$port$path$query$fragment";
124
  }
125
-
126
  /* Check for a relative URL that gets killed by esc_url ( if there is no / first ) */
127
- protected function checkRelative($parsed_url)
128
  {
129
  if (! isset($parsed_url['host']) && ! isset($parsed_url['scheme']) )
130
  {
131
  if (isset($parsed_url['path']) && $parsed_url['path'] !== '' && substr($parsed_url['path'], 0,1) !== '/')
132
  {
133
- return true;
134
  }
135
  }
136
 
137
  return false;
138
-
139
  }
140
 
141
  public function parse_button($domObj, $mode = 'normal')
142
  {
143
-
144
- $data = $this->data[$this->blockname];
145
- $button_id = $this->data["id"];
146
-
147
- $anchor = $domObj->find("a",0);
148
-
149
- if (isset($data["nofollow"]) && $data["nofollow"] == 1)
150
  $anchor->rel = "nofollow";
151
- // $buttonAttrs[] = "rel=nofollow";
152
- if (isset($data["new_window"]) && $data["new_window"] == 1)
153
- $anchor->target = "_blank";
154
  if (isset($data['link_title']) && strlen($data['link_title']) > 0)
155
- $anchor->title = $data['link_title'];
156
-
157
-
158
- if (isset($data["url"]) && $data["url"] != '')
159
  {
160
- $url = $data["url"];
161
- $parsed_url = parse_url($url);
162
-
163
  if (! $this->checkRelative($parsed_url))
164
  $url = esc_url($url, $this->protocols);
165
-
166
  $url = rawurldecode($url); // removes the + from a URL part.
167
- $url = apply_filters('mb-url', $url, $data['url']); // passes processed url / raw url.
168
- $url = apply_filters('mb-url-' . $button_id, $url, $data['url']);
169
-
170
-
171
  $anchor->href = $url;
172
- //do_shortcode( esc_url($url, $this->protocols) );
173
-
174
  }
175
- else // fixing an iOS problem which renders anchors without URL wrongly.
176
  {
177
  $anchor->href = 'javascript:void(0);';
178
- }
179
-
180
-
181
- return $domObj;
182
-
183
- }
184
 
185
  public function map_fields($map)
186
  {
187
-
188
- $map["url"]["attr"] = "href";
189
- $map["link_title"]["attr"] = "title";
190
-
191
- // $map["text"]["func"] = "updateAnchorText";
192
-
193
- return $map;
194
  }
195
 
196
- public function admin_fields()
197
  {
198
  //parent::admin_fields();
199
-
200
- //$data = $this->data[$this->blockname];
201
- // On it's way out this
202
  /*foreach($this->fields as $field => $options)
203
- {
204
- $default = (isset($options["default"])) ? $options["default"] : '';
205
  ${$field} = (isset($data[$field])) ? $data[$field] : $default;
206
-
207
  } */
208
- $icon_url = MB()->get_plugin_url() . 'images/icons/' ;
209
  ?>
210
 
211
  <div class="mb_tab option-container mb_tab">
212
  <div class="title"><?php _e('Basics', 'maxbuttons') ?></div>
213
  <div class="inside basic">
214
- <?php
215
-
 
 
216
  // Name
217
- $field_name = new maxField() ;
218
- $field_name->label = __('Button Name', 'maxbuttons');
219
  // $field_name->note = __('Something that you can quickly identify the button with.', 'maxbuttons');
220
- $field_name->value = maxBlocks::getValue('name');
221
- $field_name->id = 'name';
222
- $field_name->name = $field_name->id;
223
- $field_name->placeholder = __("Button Name","maxbuttons");
224
- $field_name->output('start','end');
225
-
226
-
227
- // URL
228
- $field_url = new maxField();
229
  $field_url->label = __('URL', 'maxbuttons');
230
  // $field_url->note = __('The link when the button is clicked.', 'maxbuttons');
231
  $field_url->value = rawurldecode(maxBlocks::getValue('url') );
232
- $field_url->id = 'url';
233
- $field_url->placeholder = __("http://","maxbuttons");
234
- $field_url->name = $field_url->id;
235
-
236
- $field_url->output('start','end');
237
-
238
  // Spacer
239
- $fspacer = new maxField('spacer');
240
- $fspacer->name = 'url_options';
241
  $fspacer->label = '&nbsp;';
242
- $fspacer->output('start');
243
-
244
-
245
  // New Window
246
- $fwindow = new maxField('checkbox');
247
- $fwindow->label = __('Open in New Window', 'maxbuttons');
248
- $fwindow->name = 'new_window';
249
- $fwindow->id = $fwindow->name;
250
  $fwindow->value = 1;
251
- //$fwindow->inputclass = 'check_button';
252
- $fwindow->checked = checked( maxBlocks::getValue('new_window'), 1, false);
253
-
254
- $fwindow->output('','');
255
-
256
  //$fspacer->name ='rel_options';
257
- //$fspacer->output('start');
258
-
259
- // NoRel
260
- $ffollow = new maxField('checkbox');
261
  $ffollow->label = __('Use rel="nofollow"', 'maxbuttons');
262
- $ffollow->value = 1;
263
- $ffollow->name = 'nofollow';
264
- $ffollow->id = $ffollow->name;
265
- $ffollow->checked = checked( maxBlocks::getValue('nofollow'), 1, false);
266
-
267
- $ffollow->output('','end');
268
-
269
  // TITLE
270
-
271
  $field_title = new maxField();
272
  $field_title->label = __('Button Title', 'maxbuttons');
273
  $field_title->name = 'link_title'; // title is too generic
274
- $field_title->id = $field_title->name;
275
- $field_title->value = maxBlocks::getValue('link_title');
276
-
277
  $field_title->output('start','end');
278
-
279
- // TEXT
280
- $field_text = new maxField();
281
- $field_text->label = __('Text','maxbuttons');
282
- $field_text->name = 'text';
283
- $field_text->id = 'text';
284
  $field_text->value = maxBlocks::getValue('text') ;
285
-
286
- $field_text->output('start','end');
287
-
288
  // FONTS
289
- $fonts = MB()->getClass('admin')->loadFonts();
290
-
291
- $field_font = new maxField('generic');
292
- $field_font->label = __('Font','maxbuttons');
293
- $field_font->name = 'font';
294
- $field_font->id = $field_font->name;
295
- $field_font->value= maxBlocks::getValue('font');
296
- $field_font->content = maxUtils::selectify($field_font->name, $fonts, $field_font->value);
297
-
298
- $field_font->output('start');
299
  ?>
300
 
301
- <?php
302
  // FONT SIZE
303
- //global $maxbuttons_font_sizes;
304
- $sizes = apply_filters('mb/editor/fontsizes', maxUtils::generate_font_sizes(10,50) );
305
-
306
-
307
- $field_size = new maxField('number');
308
- // $field_size->label = '';
309
- $field_size->name = 'font_size';
310
  $field_size->id= $field_size->name;
311
- $field_size->inputclass = 'tiny';
312
- $field_size->min = 8;
313
- $field_size->value = maxUtils::strip_px(maxBlocks::getValue('font_size'));
314
- //$field_size->content = maxUtils::selectify($field_size->name, $sizes, $field_size->value, '', 'small');
315
-
316
- $field_size->output();
317
 
318
  // Font style checkboxes
319
- $fweight = new maxField('checkbox');
320
- $fweight->icon = 'dashicons-editor-bold';
321
  $fweight->title = __("Bold",'maxbuttons');
322
- $fweight->id = 'check_fweight';
323
- $fweight->name = 'font_weight';
324
- $fweight->value = 'bold';
325
  $fweight->inputclass = 'check_button icon';
326
  $fweight->checked = checked( maxBlocks::getValue('font_weight'), 'bold', false);
327
-
328
- $fweight->output('group_start');
329
-
330
- $fstyle = new maxField('checkbox');
331
- $fstyle->icon = 'dashicons-editor-italic';
332
  $fstyle->title = __("Italic",'maxbuttons');
333
- $fstyle->id = 'check_fstyle';
334
- $fstyle->name = 'font_style';
335
- $fstyle->value = 'italic';
336
- $fstyle->inputclass = 'check_button icon';
337
  $fstyle->checked = checked( maxBlocks::getValue('font_style'), 'italic', false);
338
-
339
- $fstyle->output('','group_end');
340
-
341
-
342
- $falign_left = new maxField('radio');
343
- $falign_left->icon = 'dashicons-editor-alignleft';
344
- $falign_left->title = __('Align left','maxbuttons');
345
- $falign_left->id = 'radio_talign_left';
346
- $falign_left->name = 'text_align';
347
- $falign_left->value = 'left';
348
- $falign_left->inputclass = 'check_button icon';
349
- $falign_left->checked = checked ( maxblocks::getValue('text_align'), 'left', false);
350
-
351
- $falign_left->output('group_start');
352
-
353
- $falign_center = new maxField('radio');
354
- $falign_center->icon = 'dashicons-editor-aligncenter';
355
- $falign_center->title = __('Align center','maxbuttons');
356
- $falign_center->id = 'radio_talign_center';
357
- $falign_center->name = 'text_align';
358
- $falign_center->value = 'center';
359
- $falign_center->inputclass = 'check_button icon';
360
- $falign_center->checked = checked( maxblocks::getValue('text_align'), 'center', false);
361
-
362
- $falign_center->output();
363
-
364
- $falign_right = new maxField('radio');
365
- $falign_right->icon = 'dashicons-editor-alignright';
366
- $falign_right->title = __('Align right','maxbuttons');
367
- $falign_right->id = 'radio_talign_right';
368
- $falign_right->name = 'text_align';
369
- $falign_right->value = 'right';
370
- $falign_right->inputclass = 'check_button icon';
371
- $falign_right->checked = checked( maxblocks::getValue('text_align'), 'right', false);
372
-
373
- $falign_right->output('', array('group_end','end') );
374
-
375
  // Padding - trouble
376
- $ptop = new maxField('number');
377
- $ptop->label = __('Padding', 'maxbuttons');
378
  $ptop->id = 'padding_top';
379
- $ptop->name = $ptop->id;
380
- $ptop->min = 0;
381
  $ptop->inputclass = 'tiny';
382
- $ptop->before_input = '<img src="' . $icon_url . 'p_top.png" title="' . __("Padding Top","maxbuttons") . '" >';
383
- $ptop->value = maxUtils::strip_px(maxBlocks::getValue('padding_top'));
384
-
385
- $ptop->output('start');
386
-
387
- $pright = new maxField('number');
388
  $pright->id = 'padding_right';
389
- $pright->name = $pright->id;
390
  $pright->min = 0;
391
- $pright->inputclass = 'tiny';
392
- $pright->before_input = '<img src="' . $icon_url . 'p_right.png" class="icon padding" title="' . __("Padding Right","maxbuttons") . '" >';
393
- $pright->value = maxUtils::strip_px(maxBlocks::getValue('padding_right'));
394
-
395
- $pright->output();
396
 
397
- $pbottom = new maxField('number');
398
  $pbottom->id = 'padding_bottom';
399
- $pbottom->name = $pbottom->id;
400
- $pbottom->min = 0;
401
- $pbottom->inputclass = 'tiny';
402
- $pbottom->before_input = '<img src="' . $icon_url . 'p_bottom.png" class="icon padding" title="' . __("Padding Bottom","maxbuttons") . '" >';
403
- $pbottom->value = maxUtils::strip_px(maxBlocks::getValue('padding_bottom'));
404
-
405
  $pbottom->output();
406
-
407
- $pleft = new maxField('number');
408
  $pleft->id = 'padding_left';
409
- $pleft->name = $pleft->id;
410
- $pleft->min = 0;
411
- $pleft->inputclass = 'tiny';
412
- $pleft->before_input = '<img src="' . $icon_url . 'p_left.png" class="icon padding" title="' . __("Padding Left","maxbuttons") . '" >';
413
- $pleft->value = maxUtils::strip_px(maxBlocks::getValue('padding_left'));
414
-
415
- $pleft->output('','end');
416
-
417
-
418
  // Text Color
419
- $fcolor = new maxField('color');
420
- $fcolor->id = 'text_color';
421
- $fcolor->name = $fcolor->id;
422
- $fcolor->value = maxBlocks::getColorValue('text_color');
423
- $fcolor->label = __('Text Color','maxbuttons');
424
- $fcolor->copycolor = true;
425
- $fcolor->bindto = 'text_color_hover';
426
- $fcolor->copypos = 'right';
427
- $fcolor->output('start');
428
-
429
- // Text Color Hover
430
- $fcolor_hover = new maxField('color');
431
- $fcolor_hover->id = 'text_color_hover';
432
- $fcolor_hover->name = $fcolor_hover->id;
433
- $fcolor_hover->value = maxBlocks::getColorValue('text_color_hover');
434
- $fcolor_hover->label = __('Text Color Hover','maxbuttons');
435
- $fcolor_hover->copycolor = true;
436
- $fcolor_hover->bindto = $fcolor->id;
437
- $fcolor_hover->copypos = 'left';
438
- $fcolor_hover->output('','end');
439
-
440
- // Dimension : width
441
- $field_width = new maxField('number');
442
- $field_width->label = __('Button Width','maxbuttons');
443
- $field_width->name = 'button_width';
444
- $field_width->id = $field_width->name;
445
- $field_width->inputclass = 'small';
 
 
 
 
446
  $field_width->min = 0;
447
- $field_width->value= maxUtils::strip_px(maxBlocks::getValue('button_width')); // strippx?
448
  $field_width->output('start');
449
-
450
- // Dimension : height
451
- $field_height = new maxField('number');
452
- $field_height->label = __('Button Height','maxbuttons');
453
- $field_height->name = 'button_height';
454
- $field_height->id = $field_height->name;
455
- $field_height->inputclass = 'small';
456
  $field_height->min = 0;
457
- $field_height->value= maxUtils::strip_px(maxBlocks::getValue('button_height')); // strippx?
458
  $field_height->output('','end');
459
-
460
  // Description
461
- $description_hide = get_option('maxbuttons_hidedescription');
462
- if ($description_hide == 1)
463
- $field_desc = new maxField('hidden');
464
  else
465
- $field_desc = new maxField('textarea');
466
-
467
  $field_desc->label = __('Description', 'maxbuttons');
468
- $field_desc->name = 'description';
469
- $field_desc->id = $field_desc->name;
470
- $field_desc->esc_function = 'esc_textarea';
471
- $field_desc->value = maxBlocks::getValue('description') ;
472
- $field_desc->placeholder = __('Brief explanation about how and where the button is used.','maxbuttons');
473
  $field_desc->output('start','end');
474
-
475
  ?>
476
-
477
 
478
  </div>
479
  </div>
480
  <?php } // admin_display
481
-
482
- } // class
483
-
484
  ?>
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
+ $blockClass["basic"] = "basicBlock";
6
+ $blockOrder[0][] = "basic";
7
 
8
+
9
+ class basicBlock extends maxBlock
10
  {
11
+ protected $blockname = "basic";
12
  protected $fields = array("name" => array("default" => ''),
13
+ "status" => array("default" => "publish"),
14
  "description" => array("default" => ''),
15
  "url" => array("default" => ''),
16
+ 'link_title' => array('default' => ''),
17
+ // "text" => array("default" => ''),
18
  "new_window" => array("default" => 0),
19
  "nofollow" => array("default" => 0)
20
+ );
21
+ protected $protocols = array("http","https",'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'sms', 'callto', 'fax', 'xmpp', "javascript", 'file', 'ms-windows-store', 'steam'); // allowed url protocols for esc_url functions
22
+
23
 
24
  function __construct()
25
  {
26
+ parent::__construct();
27
  }
28
+
29
 
30
  public function parse_css($css, $mode = 'normal')
31
  {
32
  // emtpy string init is not like by PHP 7.1
33
  if (! is_array($css))
34
+ $css = array();
35
+
36
+ $data = $this->data[$this->blockname];
37
 
 
 
38
  $css["maxbutton"]["normal"]["position"] = "relative";
39
  $css["maxbutton"]["normal"]["text-decoration"] = "none";
40
  // $css["maxbutton"]["normal"]["white-space"] = "nowrap"; // hinders correct rendering of oneline-multilines
41
+ $css["maxbutton"]["normal"]["display"] = "inline-block";
42
 
43
+ /*if (isset($data["url"]) && $data["url"] == '') // don't show clickable anchor if there is no URL.
44
  {
45
+ $css["maxbutton"]["normal"]["cursor"] = 'default';
46
+ // $css[":hover"]["cursor"] = 'default';
47
+ } */
48
+
49
+ return $css;
50
 
 
 
51
  }
 
52
 
53
+
54
+
55
  public function save_fields($data, $post)
56
+ {
57
+ // Possible solution:
58
  // $post["url"] = isset($post["url"]) ? urldecode(urldecode($post["url"])) : '';
 
 
59
 
60
+ $description = false;
61
+
62
+ if (isset($post["description"]) && $post["description"] != '')
63
  {
64
+ $description = str_replace("\n", '-nwline-', $post["description"]);
65
+ $description = sanitize_text_field($description);
66
+ $description = str_replace('-nwline-', "\n", $description);
67
+
68
  }
69
+
70
  $data = parent::save_fields($data, $post);
71
 
72
  // bypass sanitize for description - causing the end of line-breaks
73
+ if ($description)
74
+ $data["basic"]["description"] = $description;
75
+
76
  // bypassing sanitize text field - causes problems with URLs and spaces
77
+ $url = isset($post["url"]) ? trim($post["url"]) : '';
78
+
79
+ $parsed_url = parse_url($url);
80
+ $rawEncode = array("query","fragment");
81
  foreach($rawEncode as $item)
82
  {
83
+ if (isset($parsed_url[$item]))
84
  {
85
+ $parsed_url[$item] = rawurlencode($parsed_url[$item]);
86
  }
87
  }
88
+
89
+ $url = $this->unParseURL($parsed_url);
90
+
91
+ $url = str_replace(" ", "%20", trim($url) );
92
+
93
  if (! $this->checkRelative($parsed_url))
94
  $url = esc_url_raw($url, $this->protocols); // str replace - known WP issue with spaces
95
+
96
  $data[$this->blockname]["url"] = $url;
97
+
98
+ if (isset($post["name"]))
99
+ $data["name"] = sanitize_text_field($post["name"]);
100
+ if (isset($post["status"]))
101
+ $data["status"] = sanitize_text_field($post["status"]); // for conversion old - new.
102
  return $data;
103
  }
104
+
105
  protected function unparseURL($parsed_url)
106
  {
107
  // Don't add // to these schemes
108
+ $noslash_schemes = array('javascript', 'mailto', 'tel', 'sms');
109
  if (isset($parsed_url['scheme']) && in_array($parsed_url['scheme'], $noslash_schemes) )
110
  $scheme = $parsed_url["scheme"] . ":";
111
+ else
112
  $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
113
+
114
+
115
  $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
116
  $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
117
  $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
122
  $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
123
  return "$scheme$user$pass$host$port$path$query$fragment";
124
  }
125
+
126
  /* Check for a relative URL that gets killed by esc_url ( if there is no / first ) */
127
+ protected function checkRelative($parsed_url)
128
  {
129
  if (! isset($parsed_url['host']) && ! isset($parsed_url['scheme']) )
130
  {
131
  if (isset($parsed_url['path']) && $parsed_url['path'] !== '' && substr($parsed_url['path'], 0,1) !== '/')
132
  {
133
+ return true;
134
  }
135
  }
136
 
137
  return false;
138
+
139
  }
140
 
141
  public function parse_button($domObj, $mode = 'normal')
142
  {
143
+
144
+ $data = $this->data[$this->blockname];
145
+ $button_id = $this->data["id"];
146
+
147
+ $anchor = $domObj->find("a",0);
148
+
149
+ if (isset($data["nofollow"]) && $data["nofollow"] == 1)
150
  $anchor->rel = "nofollow";
151
+ // $buttonAttrs[] = "rel=nofollow";
152
+ if (isset($data["new_window"]) && $data["new_window"] == 1)
153
+ $anchor->target = "_blank";
154
  if (isset($data['link_title']) && strlen($data['link_title']) > 0)
155
+ $anchor->title = $data['link_title'];
156
+
157
+
158
+ if (isset($data["url"]) && $data["url"] != '')
159
  {
160
+ $url = $data["url"];
161
+ $parsed_url = parse_url($url);
162
+
163
  if (! $this->checkRelative($parsed_url))
164
  $url = esc_url($url, $this->protocols);
165
+
166
  $url = rawurldecode($url); // removes the + from a URL part.
167
+ $url = apply_filters('mb-url', $url, $data['url']); // passes processed url / raw url.
168
+ $url = apply_filters('mb-url-' . $button_id, $url, $data['url']);
169
+
170
+
171
  $anchor->href = $url;
172
+ //do_shortcode( esc_url($url, $this->protocols) );
173
+
174
  }
175
+ else // fixing an iOS problem which renders anchors without URL wrongly.
176
  {
177
  $anchor->href = 'javascript:void(0);';
178
+ }
179
+
180
+
181
+ return $domObj;
182
+
183
+ }
184
 
185
  public function map_fields($map)
186
  {
187
+
188
+ $map["url"]["attr"] = "href";
189
+ $map["link_title"]["attr"] = "title";
190
+
191
+ // $map["text"]["func"] = "updateAnchorText";
192
+
193
+ return $map;
194
  }
195
 
196
+ public function admin_fields()
197
  {
198
  //parent::admin_fields();
199
+
200
+ //$data = $this->data[$this->blockname];
201
+ // On it's way out this
202
  /*foreach($this->fields as $field => $options)
203
+ {
204
+ $default = (isset($options["default"])) ? $options["default"] : '';
205
  ${$field} = (isset($data[$field])) ? $data[$field] : $default;
206
+
207
  } */
208
+ $icon_url = MB()->get_plugin_url() . 'images/icons/' ;
209
  ?>
210
 
211
  <div class="mb_tab option-container mb_tab">
212
  <div class="title"><?php _e('Basics', 'maxbuttons') ?></div>
213
  <div class="inside basic">
214
+ <?php
215
+ $color_copy_self = __("Replace color from other field", "maxbuttons");
216
+ $color_copy_move = __("Copy Color to other field", "maxbuttons");
217
+
218
  // Name
219
+ $field_name = new maxField() ;
220
+ $field_name->label = __('Button Name', 'maxbuttons');
221
  // $field_name->note = __('Something that you can quickly identify the button with.', 'maxbuttons');
222
+ $field_name->value = maxBlocks::getValue('name');
223
+ $field_name->id = 'name';
224
+ $field_name->name = $field_name->id;
225
+ $field_name->placeholder = __("Button Name","maxbuttons");
226
+ $field_name->output('start','end');
227
+
228
+
229
+ // URL
230
+ $field_url = new maxField();
231
  $field_url->label = __('URL', 'maxbuttons');
232
  // $field_url->note = __('The link when the button is clicked.', 'maxbuttons');
233
  $field_url->value = rawurldecode(maxBlocks::getValue('url') );
234
+ $field_url->id = 'url';
235
+ $field_url->placeholder = __("http://","maxbuttons");
236
+ $field_url->name = $field_url->id;
237
+
238
+ $field_url->output('start','end');
239
+
240
  // Spacer
241
+ $fspacer = new maxField('spacer');
242
+ $fspacer->name = 'url_options';
243
  $fspacer->label = '&nbsp;';
244
+ $fspacer->output('start');
245
+
246
+
247
  // New Window
248
+ $fwindow = new maxField('checkbox');
249
+ $fwindow->label = __('Open in New Window', 'maxbuttons');
250
+ $fwindow->name = 'new_window';
251
+ $fwindow->id = $fwindow->name;
252
  $fwindow->value = 1;
253
+ //$fwindow->inputclass = 'check_button';
254
+ $fwindow->checked = checked( maxBlocks::getValue('new_window'), 1, false);
255
+
256
+ $fwindow->output('','');
257
+
258
  //$fspacer->name ='rel_options';
259
+ //$fspacer->output('start');
260
+
261
+ // NoRel
262
+ $ffollow = new maxField('checkbox');
263
  $ffollow->label = __('Use rel="nofollow"', 'maxbuttons');
264
+ $ffollow->value = 1;
265
+ $ffollow->name = 'nofollow';
266
+ $ffollow->id = $ffollow->name;
267
+ $ffollow->checked = checked( maxBlocks::getValue('nofollow'), 1, false);
268
+
269
+ $ffollow->output('','end');
270
+
271
  // TITLE
272
+
273
  $field_title = new maxField();
274
  $field_title->label = __('Button Title', 'maxbuttons');
275
  $field_title->name = 'link_title'; // title is too generic
276
+ $field_title->id = $field_title->name;
277
+ $field_title->value = maxBlocks::getValue('link_title');
278
+
279
  $field_title->output('start','end');
280
+
281
+ // TEXT
282
+ $field_text = new maxField();
283
+ $field_text->label = __('Text','maxbuttons');
284
+ $field_text->name = 'text';
285
+ $field_text->id = 'text';
286
  $field_text->value = maxBlocks::getValue('text') ;
287
+
288
+ $field_text->output('start','end');
289
+
290
  // FONTS
291
+ $fonts = MB()->getClass('admin')->loadFonts();
292
+
293
+ $field_font = new maxField('generic');
294
+ $field_font->label = __('Font','maxbuttons');
295
+ $field_font->name = 'font';
296
+ $field_font->id = $field_font->name;
297
+ $field_font->value= maxBlocks::getValue('font');
298
+ $field_font->content = maxUtils::selectify($field_font->name, $fonts, $field_font->value);
299
+
300
+ $field_font->output('start');
301
  ?>
302
 
303
+ <?php
304
  // FONT SIZE
305
+ //global $maxbuttons_font_sizes;
306
+ $sizes = apply_filters('mb/editor/fontsizes', maxUtils::generate_font_sizes(10,50) );
307
+
308
+
309
+ $field_size = new maxField('number');
310
+ // $field_size->label = '';
311
+ $field_size->name = 'font_size';
312
  $field_size->id= $field_size->name;
313
+ $field_size->inputclass = 'tiny';
314
+ $field_size->min = 8;
315
+ $field_size->value = maxUtils::strip_px(maxBlocks::getValue('font_size'));
316
+ //$field_size->content = maxUtils::selectify($field_size->name, $sizes, $field_size->value, '', 'small');
317
+
318
+ $field_size->output();
319
 
320
  // Font style checkboxes
321
+ $fweight = new maxField('checkbox');
322
+ $fweight->icon = 'dashicons-editor-bold';
323
  $fweight->title = __("Bold",'maxbuttons');
324
+ $fweight->id = 'check_fweight';
325
+ $fweight->name = 'font_weight';
326
+ $fweight->value = 'bold';
327
  $fweight->inputclass = 'check_button icon';
328
  $fweight->checked = checked( maxBlocks::getValue('font_weight'), 'bold', false);
329
+
330
+ $fweight->output('group_start');
331
+
332
+ $fstyle = new maxField('checkbox');
333
+ $fstyle->icon = 'dashicons-editor-italic';
334
  $fstyle->title = __("Italic",'maxbuttons');
335
+ $fstyle->id = 'check_fstyle';
336
+ $fstyle->name = 'font_style';
337
+ $fstyle->value = 'italic';
338
+ $fstyle->inputclass = 'check_button icon';
339
  $fstyle->checked = checked( maxBlocks::getValue('font_style'), 'italic', false);
340
+
341
+ $fstyle->output('','group_end');
342
+
343
+
344
+ $falign_left = new maxField('radio');
345
+ $falign_left->icon = 'dashicons-editor-alignleft';
346
+ $falign_left->title = __('Align left','maxbuttons');
347
+ $falign_left->id = 'radio_talign_left';
348
+ $falign_left->name = 'text_align';
349
+ $falign_left->value = 'left';
350
+ $falign_left->inputclass = 'check_button icon';
351
+ $falign_left->checked = checked ( maxblocks::getValue('text_align'), 'left', false);
352
+
353
+ $falign_left->output('group_start');
354
+
355
+ $falign_center = new maxField('radio');
356
+ $falign_center->icon = 'dashicons-editor-aligncenter';
357
+ $falign_center->title = __('Align center','maxbuttons');
358
+ $falign_center->id = 'radio_talign_center';
359
+ $falign_center->name = 'text_align';
360
+ $falign_center->value = 'center';
361
+ $falign_center->inputclass = 'check_button icon';
362
+ $falign_center->checked = checked( maxblocks::getValue('text_align'), 'center', false);
363
+
364
+ $falign_center->output();
365
+
366
+ $falign_right = new maxField('radio');
367
+ $falign_right->icon = 'dashicons-editor-alignright';
368
+ $falign_right->title = __('Align right','maxbuttons');
369
+ $falign_right->id = 'radio_talign_right';
370
+ $falign_right->name = 'text_align';
371
+ $falign_right->value = 'right';
372
+ $falign_right->inputclass = 'check_button icon';
373
+ $falign_right->checked = checked( maxblocks::getValue('text_align'), 'right', false);
374
+
375
+ $falign_right->output('', array('group_end','end') );
376
+
377
  // Padding - trouble
378
+ $ptop = new maxField('number');
379
+ $ptop->label = __('Padding', 'maxbuttons');
380
  $ptop->id = 'padding_top';
381
+ $ptop->name = $ptop->id;
382
+ $ptop->min = 0;
383
  $ptop->inputclass = 'tiny';
384
+ $ptop->before_input = '<img src="' . $icon_url . 'p_top.png" title="' . __("Padding Top","maxbuttons") . '" >';
385
+ $ptop->value = maxUtils::strip_px(maxBlocks::getValue('padding_top'));
386
+
387
+ $ptop->output('start');
388
+
389
+ $pright = new maxField('number');
390
  $pright->id = 'padding_right';
391
+ $pright->name = $pright->id;
392
  $pright->min = 0;
393
+ $pright->inputclass = 'tiny';
394
+ $pright->before_input = '<img src="' . $icon_url . 'p_right.png" class="icon padding" title="' . __("Padding Right","maxbuttons") . '" >';
395
+ $pright->value = maxUtils::strip_px(maxBlocks::getValue('padding_right'));
396
+
397
+ $pright->output();
398
 
399
+ $pbottom = new maxField('number');
400
  $pbottom->id = 'padding_bottom';
401
+ $pbottom->name = $pbottom->id;
402
+ $pbottom->min = 0;
403
+ $pbottom->inputclass = 'tiny';
404
+ $pbottom->before_input = '<img src="' . $icon_url . 'p_bottom.png" class="icon padding" title="' . __("Padding Bottom","maxbuttons") . '" >';
405
+ $pbottom->value = maxUtils::strip_px(maxBlocks::getValue('padding_bottom'));
406
+
407
  $pbottom->output();
408
+
409
+ $pleft = new maxField('number');
410
  $pleft->id = 'padding_left';
411
+ $pleft->name = $pleft->id;
412
+ $pleft->min = 0;
413
+ $pleft->inputclass = 'tiny';
414
+ $pleft->before_input = '<img src="' . $icon_url . 'p_left.png" class="icon padding" title="' . __("Padding Left","maxbuttons") . '" >';
415
+ $pleft->value = maxUtils::strip_px(maxBlocks::getValue('padding_left'));
416
+
417
+ $pleft->output('','end');
418
+
419
+
420
  // Text Color
421
+ $fcolor = new maxField('color');
422
+ $fcolor->id = 'text_color';
423
+ $fcolor->name = $fcolor->id;
424
+ $fcolor->value = maxBlocks::getColorValue('text_color');
425
+ $fcolor->label = __('Text Color','maxbuttons');
426
+ $fcolor->copycolor = true;
427
+ $fcolor->bindto = 'text_color_hover';
428
+ $fcolor->copypos = 'right';
429
+ $fcolor->right_title = $color_copy_move;
430
+ $fcolor->left_title = $color_copy_self;
431
+ $fcolor->output('start');
432
+
433
+ // Text Color Hover
434
+ $fcolor_hover = new maxField('color');
435
+ $fcolor_hover->id = 'text_color_hover';
436
+ $fcolor_hover->name = $fcolor_hover->id;
437
+ $fcolor_hover->value = maxBlocks::getColorValue('text_color_hover');
438
+ $fcolor_hover->label = __('Text Color Hover','maxbuttons');
439
+ $fcolor_hover->copycolor = true;
440
+ $fcolor_hover->bindto = $fcolor->id;
441
+ $fcolor_hover->copypos = 'left';
442
+ $fcolor_hover->right_title = $color_copy_self;
443
+ $fcolor_hover->left_title = $color_copy_move;
444
+ $fcolor_hover->output('','end');
445
+
446
+ // Dimension : width
447
+ $field_width = new maxField('number');
448
+ $field_width->label = __('Button Width','maxbuttons');
449
+ $field_width->name = 'button_width';
450
+ $field_width->id = $field_width->name;
451
+ $field_width->inputclass = 'small';
452
  $field_width->min = 0;
453
+ $field_width->value= maxUtils::strip_px(maxBlocks::getValue('button_width')); // strippx?
454
  $field_width->output('start');
455
+
456
+ // Dimension : height
457
+ $field_height = new maxField('number');
458
+ $field_height->label = __('Button Height','maxbuttons');
459
+ $field_height->name = 'button_height';
460
+ $field_height->id = $field_height->name;
461
+ $field_height->inputclass = 'small';
462
  $field_height->min = 0;
463
+ $field_height->value= maxUtils::strip_px(maxBlocks::getValue('button_height')); // strippx?
464
  $field_height->output('','end');
465
+
466
  // Description
467
+ $description_hide = get_option('maxbuttons_hidedescription');
468
+ if ($description_hide == 1)
469
+ $field_desc = new maxField('hidden');
470
  else
471
+ $field_desc = new maxField('textarea');
472
+
473
  $field_desc->label = __('Description', 'maxbuttons');
474
+ $field_desc->name = 'description';
475
+ $field_desc->id = $field_desc->name;
476
+ $field_desc->esc_function = 'esc_textarea';
477
+ $field_desc->value = maxBlocks::getValue('description') ;
478
+ $field_desc->placeholder = __('Brief explanation about how and where the button is used.','maxbuttons');
479
  $field_desc->output('start','end');
480
+
481
  ?>
482
+
483
 
484
  </div>
485
  </div>
486
  <?php } // admin_display
487
+
488
+ } // class
489
+
490
  ?>
blocks/border.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
- $blockClass["border"] = "borderBlock";
5
- $blockOrder[30][] = "border";
6
 
7
- class borderBlock extends maxBlock
8
  {
9
- protected $blockname = "border";
10
- protected $fields = array("radius_top_left" =>
11
  array("default" => "4px",
12
- "css" => "border-top-left-radius"
13
  ),
14
  "radius_top_right" => array("default" => "4px",
15
  "css" => "border-top-right-radius"
@@ -19,7 +19,7 @@ class borderBlock extends maxBlock
19
  ),
20
  "radius_bottom_right" => array("default" => "4px",
21
  "css" => "border-bottom-right-radius"
22
- ),
23
  "border_style" => array("default" => "solid",
24
  "css" => "border-style"
25
  ),
@@ -36,48 +36,48 @@ class borderBlock extends maxBlock
36
  "box_shadow_width" => array("default" => "2px",
37
  "css" => "box-shadow-width",
38
  "csspseudo" => "normal,hover"),
39
- 'box_shadow_spread' => array('default' => '0px',
40
- 'css' => 'box-shadow-spread',
41
  'csspseudo' => 'normal,hover'),
42
-
43
- );
44
-
45
 
46
  function __construct()
47
  {
48
  parent::__construct();
49
- $this->fields = apply_filters($this->blockname. "-block-fields",$this->fields);
50
- $this->data[$this->blockname] = array(); //empty init
51
  }
52
-
53
  public function map_fields($map)
54
  {
55
- $map = parent::map_fields($map);
56
- $map["box_shadow_offset_left"]["func"] = "updateBoxShadow";
57
- $map["box_shadow_offset_top"]["func"] = "updateBoxShadow";
58
- $map["box_shadow_width"]["func"] = "updateBoxShadow";
59
- $map["box_shadow_spread"]["func"] = "updateBoxShadow";
60
-
61
- $map["radius_top_left"]["func"] = "updateRadius";
62
- $map["radius_top_right"]["func"] = "updateRadius";
63
- $map["radius_bottom_left"]["func"] = "updateRadius";
64
- $map["radius_bottom_right"]["func"] = "updateRadius";
65
-
66
-
67
- return $map;
68
  }
69
 
70
- public function admin_fields()
71
  {
72
-
73
- $data = $this->data[$this->blockname];
74
  foreach($this->fields as $field => $options)
75
- {
76
- $default = (isset($options["default"])) ? $options["default"] : '';
77
  $$field = (isset($data[$field])) ? $data[$field] : $default;
78
- ${$field . "_default"} = $default;
79
  }
80
-
81
  $maxbuttons_border_styles = array(
82
  '' => '',
83
  'dashed' => __('dashed','maxbuttons'),
@@ -89,196 +89,207 @@ class borderBlock extends maxBlock
89
  'ridge' => __('ridge','maxbuttons'),
90
  'solid' => __('solid','maxbuttons')
91
  );
92
- ?>
 
 
 
93
  <div class="option-container mb_tab">
94
  <div class="title"><?php _e('Border', 'maxbuttons') ?></div>
95
  <div class="inside">
96
-
97
-
98
- <?php
99
  // Spacer
100
- $fspacer = new maxField('spacer');
101
  $fspacer->label = __('Radius','maxbuttons');
102
- $fspacer->name = 'radius';
103
- $fspacer->output('start');
104
-
105
  // Radius left top
106
- $radius_tleft = new maxField('number');
107
  //$radius_tleft->label = __('Top Left', 'maxbuttons');
108
- //$radius_tleft->label = '<span class="dashicons dashicons-arrow-left-alt2 rotate-right"></span>';
109
- $radius_tleft->value = maxUtils::strip_px(maxBlocks::getValue('radius_top_left'));
110
- $radius_tleft->id = 'radius_top_left';
111
- $radius_tleft->name = $radius_tleft->id;
112
  $radius_tleft->min = 0;
113
- $radius_tleft->inputclass = 'tiny';
114
- $radius_tleft->publish = false;
115
- $rtl = $radius_tleft->output('');
116
-
117
  // Radius right top
118
- $radius_tright = new maxField('number');
119
- //$radius_tright->label = __('Top Right', 'maxbuttons');
120
- //$radius_tright->label = '<span class="dashicons dashicons-arrow-right-alt2 rotate-left"></span>';
121
- $radius_tright->value = maxUtils::strip_px(maxBlocks::getValue('radius_top_right'));
122
- $radius_tright->id = 'radius_top_right';
123
- $radius_tright->name = $radius_tright->id;
124
  $radius_tright->min = 0;
125
- $radius_tright->inputclass = 'tiny';
126
- $radius_tright->publish = false;
127
- $rtr = $radius_tright->output('', '');
 
128
 
129
-
130
  // Radius bottom left
131
- $radius_bleft = new maxField('number');
132
  //$radius_bleft->label = __('Bottom Left', 'maxbuttons');
133
- //$radius_bleft->label = '<span class="dashicons dashicons-arrow-left-alt2 rotate-left"></span>';
134
- $radius_bleft->value = maxUtils::strip_px(maxBlocks::getValue('radius_bottom_left'));
135
- $radius_bleft->id = 'radius_bottom_left';
136
- $radius_bleft->name = $radius_bleft->id;
137
  $radius_bleft->min = 0;
138
- $radius_bleft->inputclass = 'tiny';
139
- $radius_bleft->publish = false;
140
- $rbl = $radius_bleft->output('');
141
-
142
  // Radius bottom right
143
- $radius_bright = new maxField('number');
144
- //$radius_bright->label = __('Bottom Right', 'maxbuttons');
145
- //$radius_bright->label = '<span class="dashicons dashicons-arrow-right-alt2 rotate-right"></span>';
146
- $radius_bright->value = maxUtils::strip_px(maxBlocks::getValue('radius_bottom_right'));
147
- $radius_bright->id = 'radius_bottom_right';
148
  $radius_bright->name = $radius_bright->id;
149
- $radius_bright->min = 0;
150
- $radius_bright->inputclass = 'tiny';
151
- $radius_bright->publish = false;
152
- $rbr = $radius_bright->output('', '');
153
-
154
- // If all same, lock the corners for simultanious change.
155
- if ($radius_tleft->value == $radius_tright->value &&
156
- $radius_tright->value == $radius_bleft->value &&
157
- $radius_bleft->value = $radius_bright->value)
158
  {
159
- $lock = 'lock';
160
  }
161
  else
162
  $lock = 'unlock';
163
-
164
  $radius = new maxField('radius');
165
- $radius->radius_tl = $rtl;
166
- $radius->label_tl = __('Top Left','maxbuttons');
167
- $radius->radius_tr = $rtr;
168
- $radius->label_tr = __('Top Right','maxbuttons');
169
- $radius->radius_bl = $rbl;
170
- $radius->label_bl = __('Bottom Left','maxbuttons');
171
  $radius->radius_br = $rbr;
172
  $radius->label_br = __('Bottom Right','maxbuttons');
173
  $radius->lock = $lock;
174
  $radius->output('','end');
175
-
176
  // Border style
177
- $bstyle = new maxField('generic');
178
- $bstyle->label = __('Style','maxbuttons');
179
- $bstyle->name = 'border_style';
180
- $bstyle->id = $bstyle->name;
181
- $bstyle->value= maxBlocks::getValue('border_style');
182
- $bstyle->setDefault(maxBlocks::getDefault('border_style'));
183
- $bstyle->content = maxUtils::selectify($bstyle->name, $maxbuttons_border_styles, $bstyle->value);
184
- $bstyle->output('start', 'end');
185
 
186
  // Border width
187
- $bwidth = new maxField('number');
188
- $bwidth->label = __('Width', 'maxbuttons');
189
- $bwidth->name = 'border_width';
190
- $bwidth->id = $bwidth->name;
191
- $bwidth->value = maxUtils::strip_px( maxBlocks::getValue('border_width') );
192
  $bwidth->min = 0;
193
- $bwidth->inputclass = 'tiny';
194
  $bwidth->output('start','end');
195
 
196
  // Border Color
197
- $bcolor = new maxField('color');
198
- $bcolor->id = 'border_color';
199
- $bcolor->name = $bcolor->id;
200
- $bcolor->value = maxBlocks::getColorValue('border_color');
201
- $bcolor->label = __('Border Color','maxbuttons');
202
- $bcolor->copycolor = true;
203
- $bcolor->bindto = 'border_color_hover';
204
- $bcolor->copypos = 'right';
205
- $bcolor->output('start');
206
-
207
- // Border Color Hover
208
- $bcolor_hover = new maxField('color');
209
- $bcolor_hover->id = 'border_color_hover';
210
- $bcolor_hover->name = $bcolor_hover->id;
211
- $bcolor_hover->value = maxBlocks::getColorValue('border_color_hover');
212
- $bcolor_hover->label = __('Hover','maxbuttons');
 
 
213
  $bcolor_hover->copycolor = true;
214
- $bcolor_hover->bindto = 'border_color';
215
- $bcolor_hover->copypos = 'left';
216
- $bcolor_hover->output('','end');
 
 
217
 
218
  // Shadow offset left
219
- $bshadow = new maxField('number');
220
- $bshadow->label = __('Shadow Offset Left','maxbuttons');
221
- $bshadow->name = 'box_shadow_offset_left';
222
- $bshadow->id = $bshadow->name;
223
- $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_offset_left') );
224
- $bshadow->inputclass = 'tiny';
225
- $bshadow->output('start');
226
-
227
- // Shadow offset top
228
- $bshadow = new maxField('number');
229
- $bshadow->label = __('Shadow Offset Top','maxbuttons');
230
- $bshadow->name = 'box_shadow_offset_top';
231
- $bshadow->id = $bshadow->name;
232
- $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_offset_top') );
233
- $bshadow->inputclass = 'tiny';
234
- $bshadow->output('','end');
235
 
236
  // Shadow width
237
- $bshadow = new maxField('number');
238
- $bshadow->label = __('Shadow Blur','maxbuttons');
239
- $bshadow->name = 'box_shadow_width';
240
- $bshadow->id = $bshadow->name;
241
- $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_width') );
242
- $bshadow->inputclass = 'tiny';
243
- $bshadow->output('start','');
244
-
245
- $bspread = new maxField('number');
246
- $bspread->label = __('Shadow Spread', 'maxbuttons');
247
- $bspread->value = maxUtils::strip_px(maxBlocks::getValue('box_shadow_spread'));
248
- $bspread->id = 'box_shadow_spread';
249
- $bspread->name = $bspread->id;
250
- $bspread->inputclass = 'tiny';
251
  $bspread->output('','end');
252
-
253
  // Border Shadow Color
254
- $scolor = new maxField('color');
255
- $scolor->id = 'box_shadow_color';
256
- $scolor->name = $scolor->id;
257
- $scolor->value = maxBlocks::getColorValue('box_shadow_color');
258
- $scolor->label = __('Border Shadow Color','maxbuttons');
259
- $scolor->copycolor = true;
260
- $scolor->bindto = 'box_shadow_color_hover';
261
- $scolor->copypos = 'right';
262
- $scolor->output('start');
263
-
264
- // Border Shadow Color Hover
265
- $scolor_hover = new maxField('color');
266
- $scolor_hover->id = 'box_shadow_color_hover';
267
- $scolor_hover->name = $scolor_hover->id;
268
- $scolor_hover->value = maxBlocks::getColorValue('box_shadow_color_hover');
269
- $scolor_hover->label = __('Hover','maxbuttons');
 
 
270
  $scolor_hover->copycolor = true;
271
- $scolor_hover->bindto = 'box_shadow_color';
272
- $scolor_hover->copypos = 'left';
273
- $scolor_hover->output('','end');
274
-
 
 
275
  ?>
276
 
277
  </div>
278
  </div>
279
- <?php
280
  } // admin fields
281
-
282
- } // class
283
 
284
  ?>
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
+ $blockClass["border"] = "borderBlock";
5
+ $blockOrder[30][] = "border";
6
 
7
+ class borderBlock extends maxBlock
8
  {
9
+ protected $blockname = "border";
10
+ protected $fields = array("radius_top_left" =>
11
  array("default" => "4px",
12
+ "css" => "border-top-left-radius"
13
  ),
14
  "radius_top_right" => array("default" => "4px",
15
  "css" => "border-top-right-radius"
19
  ),
20
  "radius_bottom_right" => array("default" => "4px",
21
  "css" => "border-bottom-right-radius"
22
+ ),
23
  "border_style" => array("default" => "solid",
24
  "css" => "border-style"
25
  ),
36
  "box_shadow_width" => array("default" => "2px",
37
  "css" => "box-shadow-width",
38
  "csspseudo" => "normal,hover"),
39
+ 'box_shadow_spread' => array('default' => '0px',
40
+ 'css' => 'box-shadow-spread',
41
  'csspseudo' => 'normal,hover'),
42
+
43
+ );
44
+
45
 
46
  function __construct()
47
  {
48
  parent::__construct();
49
+ $this->fields = apply_filters($this->blockname. "-block-fields",$this->fields);
50
+ $this->data[$this->blockname] = array(); //empty init
51
  }
52
+
53
  public function map_fields($map)
54
  {
55
+ $map = parent::map_fields($map);
56
+ $map["box_shadow_offset_left"]["func"] = "updateBoxShadow";
57
+ $map["box_shadow_offset_top"]["func"] = "updateBoxShadow";
58
+ $map["box_shadow_width"]["func"] = "updateBoxShadow";
59
+ $map["box_shadow_spread"]["func"] = "updateBoxShadow";
60
+
61
+ $map["radius_top_left"]["func"] = "updateRadius";
62
+ $map["radius_top_right"]["func"] = "updateRadius";
63
+ $map["radius_bottom_left"]["func"] = "updateRadius";
64
+ $map["radius_bottom_right"]["func"] = "updateRadius";
65
+
66
+
67
+ return $map;
68
  }
69
 
70
+ public function admin_fields()
71
  {
72
+
73
+ $data = $this->data[$this->blockname];
74
  foreach($this->fields as $field => $options)
75
+ {
76
+ $default = (isset($options["default"])) ? $options["default"] : '';
77
  $$field = (isset($data[$field])) ? $data[$field] : $default;
78
+ ${$field . "_default"} = $default;
79
  }
80
+
81
  $maxbuttons_border_styles = array(
82
  '' => '',
83
  'dashed' => __('dashed','maxbuttons'),
89
  'ridge' => __('ridge','maxbuttons'),
90
  'solid' => __('solid','maxbuttons')
91
  );
92
+
93
+ $color_copy_self = __("Replace color from other field", "maxbuttons");
94
+ $color_copy_move = __("Copy Color to other field", "maxbuttons");
95
+ ?>
96
  <div class="option-container mb_tab">
97
  <div class="title"><?php _e('Border', 'maxbuttons') ?></div>
98
  <div class="inside">
99
+
100
+
101
+ <?php
102
  // Spacer
103
+ $fspacer = new maxField('spacer');
104
  $fspacer->label = __('Radius','maxbuttons');
105
+ $fspacer->name = 'radius';
106
+ $fspacer->output('start');
107
+
108
  // Radius left top
109
+ $radius_tleft = new maxField('number');
110
  //$radius_tleft->label = __('Top Left', 'maxbuttons');
111
+ //$radius_tleft->label = '<span class="dashicons dashicons-arrow-left-alt2 rotate-right"></span>';
112
+ $radius_tleft->value = maxUtils::strip_px(maxBlocks::getValue('radius_top_left'));
113
+ $radius_tleft->id = 'radius_top_left';
114
+ $radius_tleft->name = $radius_tleft->id;
115
  $radius_tleft->min = 0;
116
+ $radius_tleft->inputclass = 'tiny';
117
+ $radius_tleft->publish = false;
118
+ $rtl = $radius_tleft->output('');
119
+
120
  // Radius right top
121
+ $radius_tright = new maxField('number');
122
+ //$radius_tright->label = __('Top Right', 'maxbuttons');
123
+ //$radius_tright->label = '<span class="dashicons dashicons-arrow-right-alt2 rotate-left"></span>';
124
+ $radius_tright->value = maxUtils::strip_px(maxBlocks::getValue('radius_top_right'));
125
+ $radius_tright->id = 'radius_top_right';
126
+ $radius_tright->name = $radius_tright->id;
127
  $radius_tright->min = 0;
128
+ $radius_tright->inputclass = 'tiny';
129
+ $radius_tright->publish = false;
130
+ $rtr = $radius_tright->output('', '');
131
+
132
 
 
133
  // Radius bottom left
134
+ $radius_bleft = new maxField('number');
135
  //$radius_bleft->label = __('Bottom Left', 'maxbuttons');
136
+ //$radius_bleft->label = '<span class="dashicons dashicons-arrow-left-alt2 rotate-left"></span>';
137
+ $radius_bleft->value = maxUtils::strip_px(maxBlocks::getValue('radius_bottom_left'));
138
+ $radius_bleft->id = 'radius_bottom_left';
139
+ $radius_bleft->name = $radius_bleft->id;
140
  $radius_bleft->min = 0;
141
+ $radius_bleft->inputclass = 'tiny';
142
+ $radius_bleft->publish = false;
143
+ $rbl = $radius_bleft->output('');
144
+
145
  // Radius bottom right
146
+ $radius_bright = new maxField('number');
147
+ //$radius_bright->label = __('Bottom Right', 'maxbuttons');
148
+ //$radius_bright->label = '<span class="dashicons dashicons-arrow-right-alt2 rotate-right"></span>';
149
+ $radius_bright->value = maxUtils::strip_px(maxBlocks::getValue('radius_bottom_right'));
150
+ $radius_bright->id = 'radius_bottom_right';
151
  $radius_bright->name = $radius_bright->id;
152
+ $radius_bright->min = 0;
153
+ $radius_bright->inputclass = 'tiny';
154
+ $radius_bright->publish = false;
155
+ $rbr = $radius_bright->output('', '');
156
+
157
+ // If all same, lock the corners for simultanious change.
158
+ if ($radius_tleft->value == $radius_tright->value &&
159
+ $radius_tright->value == $radius_bleft->value &&
160
+ $radius_bleft->value = $radius_bright->value)
161
  {
162
+ $lock = 'lock';
163
  }
164
  else
165
  $lock = 'unlock';
166
+
167
  $radius = new maxField('radius');
168
+ $radius->radius_tl = $rtl;
169
+ $radius->label_tl = __('Top Left','maxbuttons');
170
+ $radius->radius_tr = $rtr;
171
+ $radius->label_tr = __('Top Right','maxbuttons');
172
+ $radius->radius_bl = $rbl;
173
+ $radius->label_bl = __('Bottom Left','maxbuttons');
174
  $radius->radius_br = $rbr;
175
  $radius->label_br = __('Bottom Right','maxbuttons');
176
  $radius->lock = $lock;
177
  $radius->output('','end');
178
+
179
  // Border style
180
+ $bstyle = new maxField('generic');
181
+ $bstyle->label = __('Style','maxbuttons');
182
+ $bstyle->name = 'border_style';
183
+ $bstyle->id = $bstyle->name;
184
+ $bstyle->value= maxBlocks::getValue('border_style');
185
+ $bstyle->setDefault(maxBlocks::getDefault('border_style'));
186
+ $bstyle->content = maxUtils::selectify($bstyle->name, $maxbuttons_border_styles, $bstyle->value);
187
+ $bstyle->output('start', 'end');
188
 
189
  // Border width
190
+ $bwidth = new maxField('number');
191
+ $bwidth->label = __('Width', 'maxbuttons');
192
+ $bwidth->name = 'border_width';
193
+ $bwidth->id = $bwidth->name;
194
+ $bwidth->value = maxUtils::strip_px( maxBlocks::getValue('border_width') );
195
  $bwidth->min = 0;
196
+ $bwidth->inputclass = 'tiny';
197
  $bwidth->output('start','end');
198
 
199
  // Border Color
200
+ $bcolor = new maxField('color');
201
+ $bcolor->id = 'border_color';
202
+ $bcolor->name = $bcolor->id;
203
+ $bcolor->value = maxBlocks::getColorValue('border_color');
204
+ $bcolor->label = __('Border Color','maxbuttons');
205
+ $bcolor->copycolor = true;
206
+ $bcolor->bindto = 'border_color_hover';
207
+ $bcolor->copypos = 'right';
208
+ $bcolor->left_title = $color_copy_self;
209
+ $bcolor->right_title = $color_copy_move;
210
+ $bcolor->output('start');
211
+
212
+ // Border Color Hover
213
+ $bcolor_hover = new maxField('color');
214
+ $bcolor_hover->id = 'border_color_hover';
215
+ $bcolor_hover->name = $bcolor_hover->id;
216
+ $bcolor_hover->value = maxBlocks::getColorValue('border_color_hover');
217
+ $bcolor_hover->label = __('Hover','maxbuttons');
218
  $bcolor_hover->copycolor = true;
219
+ $bcolor_hover->bindto = 'border_color';
220
+ $bcolor_hover->copypos = 'left';
221
+ $bcolor_hover->left_title = $color_copy_move;
222
+ $bcolor_hover->right_title = $color_copy_self;
223
+ $bcolor_hover->output('','end');
224
 
225
  // Shadow offset left
226
+ $bshadow = new maxField('number');
227
+ $bshadow->label = __('Shadow Offset Left','maxbuttons');
228
+ $bshadow->name = 'box_shadow_offset_left';
229
+ $bshadow->id = $bshadow->name;
230
+ $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_offset_left') );
231
+ $bshadow->inputclass = 'tiny';
232
+ $bshadow->output('start');
233
+
234
+ // Shadow offset top
235
+ $bshadow = new maxField('number');
236
+ $bshadow->label = __('Shadow Offset Top','maxbuttons');
237
+ $bshadow->name = 'box_shadow_offset_top';
238
+ $bshadow->id = $bshadow->name;
239
+ $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_offset_top') );
240
+ $bshadow->inputclass = 'tiny';
241
+ $bshadow->output('','end');
242
 
243
  // Shadow width
244
+ $bshadow = new maxField('number');
245
+ $bshadow->label = __('Shadow Blur','maxbuttons');
246
+ $bshadow->name = 'box_shadow_width';
247
+ $bshadow->id = $bshadow->name;
248
+ $bshadow->value = maxUtils::strip_px( maxBlocks::getValue('box_shadow_width') );
249
+ $bshadow->inputclass = 'tiny';
250
+ $bshadow->output('start','');
251
+
252
+ $bspread = new maxField('number');
253
+ $bspread->label = __('Shadow Spread', 'maxbuttons');
254
+ $bspread->value = maxUtils::strip_px(maxBlocks::getValue('box_shadow_spread'));
255
+ $bspread->id = 'box_shadow_spread';
256
+ $bspread->name = $bspread->id;
257
+ $bspread->inputclass = 'tiny';
258
  $bspread->output('','end');
259
+
260
  // Border Shadow Color
261
+ $scolor = new maxField('color');
262
+ $scolor->id = 'box_shadow_color';
263
+ $scolor->name = $scolor->id;
264
+ $scolor->value = maxBlocks::getColorValue('box_shadow_color');
265
+ $scolor->label = __('Border Shadow Color','maxbuttons');
266
+ $scolor->copycolor = true;
267
+ $scolor->bindto = 'box_shadow_color_hover';
268
+ $scolor->copypos = 'right';
269
+ $scolor->left_title = $color_copy_self;
270
+ $scolor->right_title = $color_copy_move;
271
+ $scolor->output('start');
272
+
273
+ // Border Shadow Color Hover
274
+ $scolor_hover = new maxField('color');
275
+ $scolor_hover->id = 'box_shadow_color_hover';
276
+ $scolor_hover->name = $scolor_hover->id;
277
+ $scolor_hover->value = maxBlocks::getColorValue('box_shadow_color_hover');
278
+ $scolor_hover->label = __('Hover','maxbuttons');
279
  $scolor_hover->copycolor = true;
280
+ $scolor_hover->bindto = 'box_shadow_color';
281
+ $scolor_hover->copypos = 'left';
282
+ $scolor_hover->left_title = $color_copy_self;
283
+ $scolor_hover->right_title = $color_copy_move;
284
+ $scolor_hover->output('','end');
285
+
286
  ?>
287
 
288
  </div>
289
  </div>
290
+ <?php
291
  } // admin fields
292
+
293
+ } // class
294
 
295
  ?>
blocks/gradient.php CHANGED
@@ -1,235 +1,243 @@
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
- $blockClass["gradient"] = "gradientBlock";
5
  $blockOrder[40][] = "gradient";
6
 
7
- class gradientBlock extends maxBlock
8
  {
9
- protected $blockname = "gradient";
10
  protected $fields = array("gradient_stop" => array("default" => "45",
11
  "css" => "gradient-stop",
12
- "csspseudo" => "normal,hover",
13
  ),
14
 
15
- "gradient_start_opacity" => array("default" => "100",
16
  "css" => "gradient-start-opacity"),
17
- "gradient_end_opacity" => array("default" => "100",
18
  "css" => "gradient-end-opacity"),
19
- "gradient_start_opacity_hover" => array("default" => "100",
20
  "css" => "gradient-start-opacity",
21
- "csspseudo" => "hover"),
22
  "gradient_end_opacity_hover" => array("default" => "100",
23
- "css" => "gradient-end-opacity",
24
  "csspseudo" => "hover"),
25
  'use_gradient' => array('default' => '0',
26
  'css' => 'gradient-use-gradient',
27
- 'csspseudo' => 'normal,hover',
28
  ),
29
-
30
- );
31
-
32
 
33
  public function map_fields($map)
34
  {
35
-
36
- $map["gradient_stop"]["func"] = "updateGradientOpacity";
37
- $map["gradient_start_opacity"]["func"] = "updateGradientOpacity";
38
- $map["gradient_end_opacity"]["func"] = "updateGradientOpacity";
39
- $map["gradient_start_opacity_hover"]["func"] = "updateGradientOpacity";
40
- $map["gradient_end_opacity_hover"]["func"] = "updateGradientOpacity";
41
-
42
- return $map;
43
  }
44
 
45
 
46
- public function admin_fields()
47
  {
48
- $data = $this->data[$this->blockname];
49
-
50
- ?>
51
  <div class="mb_tab option-container gradient-options">
52
  <div class="title"><?php _e('Background', 'maxbuttons') ?></div>
53
  <div class="inside">
54
  <?php
55
-
56
- $g_start = maxBlocks::getColorValue('gradient_start_color');
57
  $g_end = maxBlocks::getColorValue('gradient_end_color');
58
- $gh_start = maxBlocks::getColorValue('gradient_start_color_hover');
59
  $gh_end = maxBlocks::getColorValue('gradient_end_color_hover');
60
-
61
- $use_gradient = maxBlocks::getValue('use_gradient');
62
-
63
- if (! isset($data['use_gradient'] ))
64
  {
65
- if ($g_start != $g_end || $gh_start != $gh_end)
66
  $use_gradient = true;
67
  else
68
  $use_gradient = false;
69
-
70
  }
71
 
72
- $condition = array('target' => 'use_gradient', 'values' => 'checked');
73
- $gradient_conditional = htmlentities(json_encode($condition));
 
 
 
 
74
 
75
- // $fspacer->output('start');
76
-
77
- $useg = new maxField('switch');
78
  $useg->label = __('Use Gradients', 'maxbuttons');
79
  $useg->name = 'use_gradient';
80
  $useg->id = $useg->name;
81
- $useg->value = '1';
82
- $useg->checked = checked($use_gradient, 1, false);
83
- $useg->output ('start','end');
84
 
85
  // Spacer
86
- $fspacer = new maxField('spacer');
87
  $fspacer->label = '&nbsp;';
88
- $fspacer->name = 'gradient_head';
89
- $fspacer->output('start');
90
-
91
  // Spacer
92
- //$fspacer = new maxField('spacer');
93
  $fspacer->label = __('Start','maxbuttons');
94
- $fspacer->name = 'gradient_start';
95
  $fspacer->output('');
96
-
97
  // Spacer
98
- //$fspacer = new maxField('spacer');
99
  $fspacer->label = __('End','maxbuttons');
100
- $fspacer->name = 'gradient_end';
101
  $fspacer->conditional = $gradient_conditional;
102
- $fspacer->output('', 'end');
103
-
104
  // Background Color
105
- $color = new maxField('color');
106
- $color->id = 'gradient_start_color';
107
- $color->name = $color->id;
108
- $color->value = $g_start;
109
- $color->label = __('Background color','maxbuttons');
110
- $color->inputclass = 'square';
111
- $color->copycolor = true;
112
- $color->bindto = 'gradient_end_color';
113
- $color->copypos = 'right';
114
-
115
-
116
-
117
- $color->output('start');
118
-
119
  // Background Color (End Gradient)
120
- $ecolor = new maxField('color');
121
- $ecolor->id = 'gradient_end_color';
122
- $ecolor->name = $ecolor->id;
123
- $ecolor->value = $g_end;
124
- $ecolor->inputclass = 'square';
125
- $ecolor->copycolor = true;
126
- $ecolor->bindto = $color->id;
127
- $ecolor->copypos = 'left';
128
- $ecolor->conditional = $gradient_conditional;
129
- $ecolor->output('', 'end');
130
-
131
-
132
- // Background Color Hover
133
- $color_hover = new maxField('color');
134
- $color_hover->id = 'gradient_start_color_hover';
135
- $color_hover->name = $color_hover->id;
136
- $color_hover->value = $gh_start;
137
- $color_hover->label = __('Background hover','maxbuttons');
138
- $color_hover->inputclass = 'square';
139
- $color_hover->copycolor = true;
140
- $color_hover->bindto = 'gradient_end_color_hover';
141
- $color_hover->copypos = 'right';
142
-
143
- $color_hover->output('start','');
144
-
145
- // Background Color Hover
146
- $ecolor_hover = new maxField('color');
147
- $ecolor_hover->id = 'gradient_end_color_hover';
148
- $ecolor_hover->name = $ecolor_hover->id;
149
- $ecolor_hover->value = $gh_end;
150
- $ecolor_hover->inputclass = 'square';
151
- // $ecolor_hover->label = __('Color Hover End','maxbuttons');
152
- $ecolor_hover->copycolor = true;
153
- $ecolor_hover->bindto = $color_hover->id;
154
- $ecolor_hover->copypos = 'left';
155
- $ecolor_hover->conditional = $gradient_conditional;
156
- $ecolor_hover->output('','end');
157
-
 
 
 
 
 
 
158
  ?>
159
-
160
  <!--
161
  <p><a href='#'>See more options</a></p>
162
  -->
163
  <div id='gradient_fold' class="fold">
164
-
165
- <?php
166
- $startop = new maxField('number');
167
- $startop->label = __('Normal Opacity','maxbuttons');
168
  $startop->name = 'gradient_start_opacity';
169
  $startop->id = $startop->name;
170
- $startop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_start_opacity') );
171
  //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity'));
172
- $startop->min = 1;
173
  $startop->max = 100;
174
- $startop->inputclass = 'small';
175
- $startop->output('start','');
176
 
177
- $endop = new maxField('number');
178
- // $endop->label = __('Normal Opacity','maxbuttons');
179
  $endop->name = 'gradient_end_opacity';
180
  $endop->id = $endop->name;
181
- $endop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_end_opacity') );
182
  $endop->setDefault(maxBlocks::getDefault('gradient_end_opacity'));
183
- $endop->min = 1;
184
  $endop->max = 100;
185
- $endop->inputclass = 'small';
186
- $endop->conditional = $gradient_conditional;
187
- $endop->output('','end');
188
-
189
- $startop = new maxField('number');
190
- $startop->label = __('Hover opacity','maxbuttons');
191
  $startop->name = 'gradient_start_opacity_hover';
192
  $startop->id = $startop->name;
193
- $startop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_start_opacity_hover') );
194
  //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity_hover'));
195
- $startop->min = 1;
196
  $startop->max = 100;
197
- $startop->inputclass = 'small';
198
 
199
- $startop->output('start','');
200
 
201
- $endop = new maxField('number');
202
- // $endop->label = __('Hover Opacity','maxbuttons');
203
  $endop->name = 'gradient_end_opacity_hover';
204
  $endop->id = $endop->name;
205
- $endop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_end_opacity_hover') );
206
  $endop->setDefault(maxBlocks::getDefault('gradient_end_opacity_hover'));
207
- $endop->min = 1;
208
  $endop->max = 100;
209
- $endop->inputclass = 'small';
210
- $endop->conditional = $gradient_conditional;
211
-
212
- $endop->output('','end');
213
 
214
 
215
- $stop = new maxField('number');
216
- $stop->label = __('Gradient stop','maxbuttons');
217
  $stop->name = 'gradient_stop';
218
  $stop->id = $stop->name;
219
- $stop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_stop') );
220
  $stop->setDefault(maxBlocks::getDefault('gradient_stop'));
221
- $stop->min = 1;
222
  $stop->max = 99;
223
- $stop->inputclass = 'small';
224
- $stop->output('start','end');
225
  ?>
226
-
227
-
228
- </div><!-- // fold -->
229
-
230
  </div>
231
  </div>
232
- <?php
233
  } // admin_fields
234
 
235
  } // class
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
+ $blockClass["gradient"] = "gradientBlock";
5
  $blockOrder[40][] = "gradient";
6
 
7
+ class gradientBlock extends maxBlock
8
  {
9
+ protected $blockname = "gradient";
10
  protected $fields = array("gradient_stop" => array("default" => "45",
11
  "css" => "gradient-stop",
12
+ "csspseudo" => "normal,hover",
13
  ),
14
 
15
+ "gradient_start_opacity" => array("default" => "100",
16
  "css" => "gradient-start-opacity"),
17
+ "gradient_end_opacity" => array("default" => "100",
18
  "css" => "gradient-end-opacity"),
19
+ "gradient_start_opacity_hover" => array("default" => "100",
20
  "css" => "gradient-start-opacity",
21
+ "csspseudo" => "hover"),
22
  "gradient_end_opacity_hover" => array("default" => "100",
23
+ "css" => "gradient-end-opacity",
24
  "csspseudo" => "hover"),
25
  'use_gradient' => array('default' => '0',
26
  'css' => 'gradient-use-gradient',
27
+ 'csspseudo' => 'normal,hover',
28
  ),
29
+
30
+ );
31
+
32
 
33
  public function map_fields($map)
34
  {
35
+
36
+ $map["gradient_stop"]["func"] = "updateGradientOpacity";
37
+ $map["gradient_start_opacity"]["func"] = "updateGradientOpacity";
38
+ $map["gradient_end_opacity"]["func"] = "updateGradientOpacity";
39
+ $map["gradient_start_opacity_hover"]["func"] = "updateGradientOpacity";
40
+ $map["gradient_end_opacity_hover"]["func"] = "updateGradientOpacity";
41
+
42
+ return $map;
43
  }
44
 
45
 
46
+ public function admin_fields()
47
  {
48
+ $data = $this->data[$this->blockname];
49
+
50
+ ?>
51
  <div class="mb_tab option-container gradient-options">
52
  <div class="title"><?php _e('Background', 'maxbuttons') ?></div>
53
  <div class="inside">
54
  <?php
55
+
56
+ $g_start = maxBlocks::getColorValue('gradient_start_color');
57
  $g_end = maxBlocks::getColorValue('gradient_end_color');
58
+ $gh_start = maxBlocks::getColorValue('gradient_start_color_hover');
59
  $gh_end = maxBlocks::getColorValue('gradient_end_color_hover');
60
+
61
+ $use_gradient = maxBlocks::getValue('use_gradient');
62
+
63
+ if (! isset($data['use_gradient'] ))
64
  {
65
+ if ($g_start != $g_end || $gh_start != $gh_end)
66
  $use_gradient = true;
67
  else
68
  $use_gradient = false;
69
+
70
  }
71
 
72
+ $condition = array('target' => 'use_gradient', 'values' => 'checked');
73
+ $gradient_conditional = htmlentities(json_encode($condition));
74
+
75
+ $color_copy_self = __("Replace color from other field", "maxbuttons");
76
+ $color_copy_move = __("Copy Color to other field", "maxbuttons");
77
+ // $fspacer->output('start');
78
 
79
+ $useg = new maxField('switch');
 
 
80
  $useg->label = __('Use Gradients', 'maxbuttons');
81
  $useg->name = 'use_gradient';
82
  $useg->id = $useg->name;
83
+ $useg->value = '1';
84
+ $useg->checked = checked($use_gradient, 1, false);
85
+ $useg->output ('start','end');
86
 
87
  // Spacer
88
+ $fspacer = new maxField('spacer');
89
  $fspacer->label = '&nbsp;';
90
+ $fspacer->name = 'gradient_head';
91
+ $fspacer->output('start');
92
+
93
  // Spacer
94
+ //$fspacer = new maxField('spacer');
95
  $fspacer->label = __('Start','maxbuttons');
96
+ $fspacer->name = 'gradient_start';
97
  $fspacer->output('');
98
+
99
  // Spacer
100
+ //$fspacer = new maxField('spacer');
101
  $fspacer->label = __('End','maxbuttons');
102
+ $fspacer->name = 'gradient_end';
103
  $fspacer->conditional = $gradient_conditional;
104
+ $fspacer->output('', 'end');
105
+
106
  // Background Color
107
+ $color = new maxField('color');
108
+ $color->id = 'gradient_start_color';
109
+ $color->name = $color->id;
110
+ $color->value = $g_start;
111
+ $color->label = __('Background color','maxbuttons');
112
+ $color->inputclass = 'square';
113
+ $color->copycolor = true;
114
+ $color->bindto = 'gradient_end_color';
115
+ $color->left_title = $color_copy_self;
116
+ $color->right_title = $color_copy_move;
117
+ $color->copypos = 'right';
118
+
119
+ $color->output('start');
120
+
121
  // Background Color (End Gradient)
122
+ $ecolor = new maxField('color');
123
+ $ecolor->id = 'gradient_end_color';
124
+ $ecolor->name = $ecolor->id;
125
+ $ecolor->value = $g_end;
126
+ $ecolor->inputclass = 'square';
127
+ $ecolor->copycolor = true;
128
+ $ecolor->bindto = $color->id;
129
+ $ecolor->copypos = 'left';
130
+ $ecolor->left_title = $color_copy_move;
131
+ $ecolor->right_title = $color_copy_self;
132
+ $ecolor->conditional = $gradient_conditional;
133
+ $ecolor->output('', 'end');
134
+
135
+
136
+ // Background Color Hover
137
+ $color_hover = new maxField('color');
138
+ $color_hover->id = 'gradient_start_color_hover';
139
+ $color_hover->name = $color_hover->id;
140
+ $color_hover->value = $gh_start;
141
+ $color_hover->label = __('Background hover','maxbuttons');
142
+ $color_hover->inputclass = 'square';
143
+ $color_hover->copycolor = true;
144
+ $color_hover->bindto = 'gradient_end_color_hover';
145
+ $color_hover->left_title = $color_copy_self;
146
+ $color_hover->right_title = $color_copy_move;
147
+ $color_hover->copypos = 'right';
148
+
149
+ $color_hover->output('start','');
150
+
151
+ // Background Color Hover
152
+ $ecolor_hover = new maxField('color');
153
+ $ecolor_hover->id = 'gradient_end_color_hover';
154
+ $ecolor_hover->name = $ecolor_hover->id;
155
+ $ecolor_hover->value = $gh_end;
156
+ $ecolor_hover->inputclass = 'square';
157
+ // $ecolor_hover->label = __('Color Hover End','maxbuttons');
158
+ $ecolor_hover->copycolor = true;
159
+ $ecolor_hover->bindto = $color_hover->id;
160
+ $ecolor_hover->copypos = 'left';
161
+ $ecolor_hover->left_title = $color_copy_move;
162
+ $ecolor_hover->right_title = $color_copy_self;
163
+ $ecolor_hover->conditional = $gradient_conditional;
164
+ $ecolor_hover->output('','end');
165
+
166
  ?>
167
+
168
  <!--
169
  <p><a href='#'>See more options</a></p>
170
  -->
171
  <div id='gradient_fold' class="fold">
172
+
173
+ <?php
174
+ $startop = new maxField('number');
175
+ $startop->label = __('Normal Opacity','maxbuttons');
176
  $startop->name = 'gradient_start_opacity';
177
  $startop->id = $startop->name;
178
+ $startop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_start_opacity') );
179
  //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity'));
180
+ $startop->min = 1;
181
  $startop->max = 100;
182
+ $startop->inputclass = 'small';
183
+ $startop->output('start','');
184
 
185
+ $endop = new maxField('number');
186
+ // $endop->label = __('Normal Opacity','maxbuttons');
187
  $endop->name = 'gradient_end_opacity';
188
  $endop->id = $endop->name;
189
+ $endop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_end_opacity') );
190
  $endop->setDefault(maxBlocks::getDefault('gradient_end_opacity'));
191
+ $endop->min = 1;
192
  $endop->max = 100;
193
+ $endop->inputclass = 'small';
194
+ $endop->conditional = $gradient_conditional;
195
+ $endop->output('','end');
196
+
197
+ $startop = new maxField('number');
198
+ $startop->label = __('Hover opacity','maxbuttons');
199
  $startop->name = 'gradient_start_opacity_hover';
200
  $startop->id = $startop->name;
201
+ $startop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_start_opacity_hover') );
202
  //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity_hover'));
203
+ $startop->min = 1;
204
  $startop->max = 100;
205
+ $startop->inputclass = 'small';
206
 
207
+ $startop->output('start','');
208
 
209
+ $endop = new maxField('number');
210
+ // $endop->label = __('Hover Opacity','maxbuttons');
211
  $endop->name = 'gradient_end_opacity_hover';
212
  $endop->id = $endop->name;
213
+ $endop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_end_opacity_hover') );
214
  $endop->setDefault(maxBlocks::getDefault('gradient_end_opacity_hover'));
215
+ $endop->min = 1;
216
  $endop->max = 100;
217
+ $endop->inputclass = 'small';
218
+ $endop->conditional = $gradient_conditional;
219
+
220
+ $endop->output('','end');
221
 
222
 
223
+ $stop = new maxField('number');
224
+ $stop->label = __('Gradient stop','maxbuttons');
225
  $stop->name = 'gradient_stop';
226
  $stop->id = $stop->name;
227
+ $stop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_stop') );
228
  $stop->setDefault(maxBlocks::getDefault('gradient_stop'));
229
+ $stop->min = 1;
230
  $stop->max = 99;
231
+ $stop->inputclass = 'small';
232
+ $stop->output('start','end');
233
  ?>
234
+
235
+
236
+ </div><!-- // fold -->
237
+
238
  </div>
239
  </div>
240
+ <?php
241
  } // admin_fields
242
 
243
  } // class
blocks/text.php CHANGED
@@ -1,40 +1,40 @@
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
- $blockClass["text"] = "textBlock";
5
- $blockOrder[50][] = "text";
6
 
7
- class textBlock extends maxBlock
8
  {
9
 
10
- protected $blockname = "text";
11
  protected $fields = array(
12
-
13
- "text" => array("default" => '' ),
14
- "font" => array("default" => "Tahoma",
15
- "css" => "font-family",
16
  "csspart" => 'mb-text'
17
  ),
18
-
19
  "font_size" => array("default" => "15px",
20
  "css" => "font-size",
21
  "csspart" => 'mb-text' ),
22
- /* "font_size_unit" => array("default" => "em",
23
  "css" => "font_size_unit",
24
  "csspart" => "mb-text",
25
  ), */
26
- "text_align" => array(
27
  "default" => "center",
28
  "css" => "text-align",
29
  "csspart" => "mb-text",
30
-
31
  ),
32
-
33
  "font_style" => array("default" => "normal",
34
  "css" => "font-style",
35
  "csspart" => 'mb-text'),
36
-
37
- "font_weight" => array("default" => "normal",
38
  "css" => "font-weight",
39
  "csspart" => 'mb-text'),
40
  "text_shadow_offset_left" => array("default" => "0px",
@@ -42,12 +42,12 @@ class textBlock extends maxBlock
42
  "csspart" => 'mb-text',
43
  "csspseudo" => "normal,hover"
44
  ),
45
-
46
  "text_shadow_offset_top" => array("default" => "0px",
47
  "css" => "text-shadow-top",
48
  "csspart" => 'mb-text',
49
  "csspseudo" => "normal,hover"),
50
- "text_shadow_width" => array("default" => "0px",
51
  "css" => "text-shadow-width",
52
  "csspart" => 'mb-text',
53
  "csspseudo" => "normal,hover"),
@@ -64,121 +64,127 @@ class textBlock extends maxBlock
64
  "padding_left" => array("default" => "0px",
65
  "css" => "padding-left",
66
  "csspart" => "mb-text")
67
- );
68
-
69
 
70
  function __construct()
71
  {
72
  parent::__construct();
73
- $this->fields["text"]["default"] = __("YOUR TEXT","maxbuttons");
74
-
75
  }
76
 
77
  public function map_fields($map)
78
  {
79
  $map = parent::map_fields($map);
80
- $map["text"]["func"] = "updateAnchorText";
81
- $map["text_shadow_offset_left"]["func"] = "updateTextShadow";
82
- $map["text_shadow_offset_top"]["func"] = "updateTextShadow";
83
- $map["text_shadow_width"]["func"] = "updateTextShadow";
84
-
85
- return $map;
86
  }
87
  public function parse_css($css, $mode = 'normal')
88
  {
89
  $css = parent::parse_css($css);
90
-
91
  // allow for font not to be set, but default to theme
92
- $font_size = isset($css["mb-text"]["normal"]["font-size"]) ? $css["mb-text"]["normal"]["font-size"] : $this->fields['font_size']['default'];
93
  if ($font_size == 0 || $font_size == '0px')
94
- unset($css["mb-text"]["normal"]["font-size"]);
95
-
96
- $css["mb-text"]["normal"]["line-height"] = "1em";
97
- $css["mb-text"]["normal"]["box-sizing"] = "border-box"; // default.
98
- $css["mb-text"]["normal"]["display"] = "block";
99
  $css['mb-text']['normal']['background-color'] = 'unset'; // prevent bg overwriting
100
- return $css;
101
- }
102
  public function parse_button($domObj, $mode = 'normal')
103
  {
104
- $data = $this->data[$this->blockname];
105
- $anchor = $domObj->find("a",0);
106
-
107
- if (isset($data["text"]) && $data["text"] != '' || $mode == 'preview')
108
- $anchor->innertext = "<span class='mb-text'>" . do_shortcode($data["text"]) . "</span>";
109
- return $domObj;
110
-
111
  }
112
-
113
- public function admin_fields()
114
  {
115
- $data = $this->data[$this->blockname];
116
  foreach($this->fields as $field => $options)
117
- {
118
- $default = (isset($options["default"])) ? $options["default"] : '';
119
  $$field = (isset($data[$field])) ? $data[$field] : $default;
120
- ${$field . "_default"} = $default;
121
  }
122
-
 
 
123
  ?>
124
  <div class="mb_tab option-container">
125
  <div class="title"><?php _e('Text Shadow', 'maxbuttons') ?></div>
126
  <div class="inside text">
127
  <?php
128
  // Shadow offset left
129
- $field_shadow = new maxField('number') ;
130
- $field_shadow->label = __('Shadow Offset Left', 'maxbuttons');
131
- $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_offset_left'));
132
- $field_shadow->id = 'text_shadow_offset_left';
133
- $field_shadow->name = $field_shadow->id;
134
- $field_shadow->inputclass = 'tiny';
135
- $field_shadow->output('start');
136
-
137
  // Shadow offset top
138
- $field_shadow = new maxField('number') ;
139
- $field_shadow->label = __('Shadow Offset Top', 'maxbuttons');
140
- $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_offset_top'));
141
- $field_shadow->id = 'text_shadow_offset_top';
142
- $field_shadow->name = $field_shadow->id;
143
- $field_shadow->inputclass = 'tiny';
144
  $field_shadow->output('','end');
145
 
146
  // Shadow width
147
- $field_shadow = new maxField('number') ;
148
- $field_shadow->label = __('Shadow Blur', 'maxbuttons');
149
- $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_width'));
150
- $field_shadow->id = 'text_shadow_width';
151
  $field_shadow->min = 0;
152
- $field_shadow->name = $field_shadow->id;
153
- $field_shadow->inputclass = 'tiny';
154
  $field_shadow->output('start','end');
155
-
156
  // Text Color
157
- $fshadow = new maxField('color');
158
- $fshadow->id = 'text_shadow_color';
159
- $fshadow->name = $fshadow->id;
160
- $fshadow->value = maxBlocks::getColorValue('text_shadow_color');
161
- $fshadow->label = __('Shadow Color','maxbuttons');
162
- $fshadow->copycolor = true;
163
- $fshadow->bindto = 'text_shadow_color_hover';
164
- $fshadow->copypos = 'right';
165
- $fshadow->output('start');
166
-
167
- // Text Color Hover
168
- $fshadow_hover = new maxField('color');
169
- $fshadow_hover->id = 'text_shadow_color_hover';
170
- $fshadow_hover->name = $fshadow_hover->id;
171
- $fshadow_hover->value = maxBlocks::getColorValue('text_shadow_color_hover');
172
- $fshadow_hover->label = __('Hover','maxbuttons');
173
- $fshadow_hover->copycolor = true;
174
- $fshadow_hover->bindto = 'text_shadow_color';
175
- $fshadow_hover->copypos = 'left';
176
- $fshadow_hover->output('','end');
177
- ?>
 
 
 
 
178
 
179
  </div>
180
  </div>
181
- <?php } // admin fields
182
- } // class
183
-
184
  ?>
1
  <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
+ $blockClass["text"] = "textBlock";
5
+ $blockOrder[50][] = "text";
6
 
7
+ class textBlock extends maxBlock
8
  {
9
 
10
+ protected $blockname = "text";
11
  protected $fields = array(
12
+
13
+ "text" => array("default" => '' ),
14
+ "font" => array("default" => "Tahoma",
15
+ "css" => "font-family",
16
  "csspart" => 'mb-text'
17
  ),
18
+
19
  "font_size" => array("default" => "15px",
20
  "css" => "font-size",
21
  "csspart" => 'mb-text' ),
22
+ /* "font_size_unit" => array("default" => "em",
23
  "css" => "font_size_unit",
24
  "csspart" => "mb-text",
25
  ), */
26
+ "text_align" => array(
27
  "default" => "center",
28
  "css" => "text-align",
29
  "csspart" => "mb-text",
30
+
31
  ),
32
+
33
  "font_style" => array("default" => "normal",
34
  "css" => "font-style",
35
  "csspart" => 'mb-text'),
36
+
37
+ "font_weight" => array("default" => "normal",
38
  "css" => "font-weight",
39
  "csspart" => 'mb-text'),
40
  "text_shadow_offset_left" => array("default" => "0px",
42
  "csspart" => 'mb-text',
43
  "csspseudo" => "normal,hover"
44
  ),
45
+
46
  "text_shadow_offset_top" => array("default" => "0px",
47
  "css" => "text-shadow-top",
48
  "csspart" => 'mb-text',
49
  "csspseudo" => "normal,hover"),
50
+ "text_shadow_width" => array("default" => "0px",
51
  "css" => "text-shadow-width",
52
  "csspart" => 'mb-text',
53
  "csspseudo" => "normal,hover"),
64
  "padding_left" => array("default" => "0px",
65
  "css" => "padding-left",
66
  "csspart" => "mb-text")
67
+ );
68
+
69
 
70
  function __construct()
71
  {
72
  parent::__construct();
73
+ $this->fields["text"]["default"] = __("YOUR TEXT","maxbuttons");
74
+
75
  }
76
 
77
  public function map_fields($map)
78
  {
79
  $map = parent::map_fields($map);
80
+ $map["text"]["func"] = "updateAnchorText";
81
+ $map["text_shadow_offset_left"]["func"] = "updateTextShadow";
82
+ $map["text_shadow_offset_top"]["func"] = "updateTextShadow";
83
+ $map["text_shadow_width"]["func"] = "updateTextShadow";
84
+
85
+ return $map;
86
  }
87
  public function parse_css($css, $mode = 'normal')
88
  {
89
  $css = parent::parse_css($css);
90
+
91
  // allow for font not to be set, but default to theme
92
+ $font_size = isset($css["mb-text"]["normal"]["font-size"]) ? $css["mb-text"]["normal"]["font-size"] : $this->fields['font_size']['default'];
93
  if ($font_size == 0 || $font_size == '0px')
94
+ unset($css["mb-text"]["normal"]["font-size"]);
95
+
96
+ $css["mb-text"]["normal"]["line-height"] = "1em";
97
+ $css["mb-text"]["normal"]["box-sizing"] = "border-box"; // default.
98
+ $css["mb-text"]["normal"]["display"] = "block";
99
  $css['mb-text']['normal']['background-color'] = 'unset'; // prevent bg overwriting
100
+ return $css;
101
+ }
102
  public function parse_button($domObj, $mode = 'normal')
103
  {
104
+ $data = $this->data[$this->blockname];
105
+ $anchor = $domObj->find("a",0);
106
+
107
+ if (isset($data["text"]) && $data["text"] != '' || $mode == 'preview')
108
+ $anchor->innertext = "<span class='mb-text'>" . do_shortcode($data["text"]) . "</span>";
109
+ return $domObj;
110
+
111
  }
112
+
113
+ public function admin_fields()
114
  {
115
+ $data = $this->data[$this->blockname];
116
  foreach($this->fields as $field => $options)
117
+ {
118
+ $default = (isset($options["default"])) ? $options["default"] : '';
119
  $$field = (isset($data[$field])) ? $data[$field] : $default;
120
+ ${$field . "_default"} = $default;
121
  }
122
+
123
+ $color_copy_self = __("Replace color from other field", "maxbuttons");
124
+ $color_copy_move = __("Copy Color to other field", "maxbuttons");
125
  ?>
126
  <div class="mb_tab option-container">
127
  <div class="title"><?php _e('Text Shadow', 'maxbuttons') ?></div>
128
  <div class="inside text">
129
  <?php
130
  // Shadow offset left
131
+ $field_shadow = new maxField('number') ;
132
+ $field_shadow->label = __('Shadow Offset Left', 'maxbuttons');
133
+ $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_offset_left'));
134
+ $field_shadow->id = 'text_shadow_offset_left';
135
+ $field_shadow->name = $field_shadow->id;
136
+ $field_shadow->inputclass = 'tiny';
137
+ $field_shadow->output('start');
138
+
139
  // Shadow offset top
140
+ $field_shadow = new maxField('number') ;
141
+ $field_shadow->label = __('Shadow Offset Top', 'maxbuttons');
142
+ $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_offset_top'));
143
+ $field_shadow->id = 'text_shadow_offset_top';
144
+ $field_shadow->name = $field_shadow->id;
145
+ $field_shadow->inputclass = 'tiny';
146
  $field_shadow->output('','end');
147
 
148
  // Shadow width
149
+ $field_shadow = new maxField('number') ;
150
+ $field_shadow->label = __('Shadow Blur', 'maxbuttons');
151
+ $field_shadow->value = maxUtils::strip_px(maxBlocks::getValue('text_shadow_width'));
152
+ $field_shadow->id = 'text_shadow_width';
153
  $field_shadow->min = 0;
154
+ $field_shadow->name = $field_shadow->id;
155
+ $field_shadow->inputclass = 'tiny';
156
  $field_shadow->output('start','end');
157
+
158
  // Text Color
159
+ $fshadow = new maxField('color');
160
+ $fshadow->id = 'text_shadow_color';
161
+ $fshadow->name = $fshadow->id;
162
+ $fshadow->value = maxBlocks::getColorValue('text_shadow_color');
163
+ $fshadow->label = __('Shadow Color','maxbuttons');
164
+ $fshadow->copycolor = true;
165
+ $fshadow->bindto = 'text_shadow_color_hover';
166
+ $fshadow->copypos = 'right';
167
+ $fshadow->left_title = $color_copy_self;
168
+ $fshadow->right_title = $color_copy_move;
169
+ $fshadow->output('start');
170
+
171
+ // Text Color Hover
172
+ $fshadow_hover = new maxField('color');
173
+ $fshadow_hover->id = 'text_shadow_color_hover';
174
+ $fshadow_hover->name = $fshadow_hover->id;
175
+ $fshadow_hover->value = maxBlocks::getColorValue('text_shadow_color_hover');
176
+ $fshadow_hover->label = __('Hover','maxbuttons');
177
+ $fshadow_hover->copycolor = true;
178
+ $fshadow_hover->bindto = 'text_shadow_color';
179
+ $fshadow_hover->copypos = 'left';
180
+ $fshadow_hover->left_title = $color_copy_move;
181
+ $fshadow_hover->right_title = $color_copy_self;
182
+ $fshadow_hover->output('','end');
183
+ ?>
184
 
185
  </div>
186
  </div>
187
+ <?php } // admin fields
188
+ } // class
189
+
190
  ?>
blocks/tpl/color.tpl CHANGED
@@ -1,9 +1,7 @@
1
- {if:label} <label for='%%id%%' class='mbcolor'>%%label%%</label> {/if:label}
2
 
3
  <div class="input mbcolor %%name%%" {if:conditional}data-show="%%conditional%%"{/if:conditional}>
4
-
5
- <input type="text" name="%%name%%" id="%%id%%" class="color-field" value="%%value%%">
6
- {if:copycolor} <div class="arrows %%copypos%%" data-id="%%id%%" data-bind="%%bindto%%"><div class='right'><span class='arrow-right'></div><div class='left'><span class='arrow-left'></div></div> {/if:copycolor}
7
  </div>
8
-
9
-
1
+ {if:label} <label for='%%id%%' class='mbcolor'>%%label%%</label> {/if:label}
2
 
3
  <div class="input mbcolor %%name%%" {if:conditional}data-show="%%conditional%%"{/if:conditional}>
4
+
5
+ <input type="text" name="%%name%%" id="%%id%%" class="color-field" value="%%value%%">
6
+ {if:copycolor} <div class="arrows %%copypos%%" data-id="%%id%%" data-bind="%%bindto%%"><div class='right'><span class='arrow-right' title='%%right_title%%'></div><div class='left'><span class='arrow-left' title='%%left_title%%'></div></div> {/if:copycolor}
7
  </div>
 
 
blocks/tpl/radio.tpl CHANGED
@@ -1,13 +1,16 @@
1
- <div class='input radio %%name%%'>
2
-
3
- <input type='radio' name='%%name%%' id='%%id%%' data-field='%%name%%'
4
- {if:inputclass}class="%%inputclass%%"{/if:inputclass}
5
- value='%%value%%'
6
- %%checked%%
 
7
  {if:icon}tabindex='-1'{/if:icon}
8
  />
9
  <label for='%%id%%' {if:title}title="%%title%%"{/if:title}>
10
- {if:icon} <i class='dashicons %%icon%%' tabindex='0'></i> {/if:icon}
11
- {if:label} %%label%% {/if:label}
 
 
12
  </label>
13
  </div>
1
+
2
+ <div class='input radio %%name%%'>
3
+
4
+ <input type='radio' name='%%name%%' id='%%id%%' data-field='%%name%%'
5
+ {if:inputclass}class="%%inputclass%%"{/if:inputclass}
6
+ value='%%value%%'
7
+ %%checked%%
8
  {if:icon}tabindex='-1'{/if:icon}
9
  />
10
  <label for='%%id%%' {if:title}title="%%title%%"{/if:title}>
11
+ {if:icon} <i class='dashicons %%icon%%' tabindex='0'></i> {/if:icon}
12
+ {if:custom_icon} <i class='%%custom_icon%%'></i>{/if:custom_icon}
13
+ {if:image} <img src='%%image%%' /> {/if:image}
14
+ {if:label} %%label {/if:label}
15
  </label>
16
  </div>
classes/admin-class.php CHANGED
@@ -1,34 +1,34 @@
1
  <?php
2
- namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
  class maxButtonsAdmin
6
  {
7
-
8
- protected $wpdb;
9
- protected static $instance = null;
10
-
11
  function __construct()
12
  {
13
- global $wpdb;
14
  $this->wpdb = $wpdb;
15
  }
16
-
17
  public static function getInstance()
18
  {
19
- if (is_null(self::$instance))
20
- self::$instance = new maxButtonsAdmin();
21
-
22
- return self::$instance;
23
-
24
  }
25
 
26
- public function loadFonts()
27
  {
28
  $fonts = array(
29
  '' => '',
30
  'Arial' => 'Arial',
31
- 'Courier New' => 'Courier New',
32
  'Georgia' => 'Georgia',
33
  'Tahoma' => 'Tahoma',
34
  'Times New Roman' => 'Times New Roman',
@@ -38,280 +38,280 @@ class maxButtonsAdmin
38
  return $fonts;
39
  }
40
 
41
- /* Get multiple buttons
42
-
43
- Used for overview pages, retrieve buttons on basis of passed arguments.
44
-
45
  @return array Array of found buttons with argument
46
- */
47
-
48
  function getButtons($args = array())
49
  {
50
  $defaults = array(
51
- "status" => "publish",
52
- "orderby" => "id",
53
  "order" => "DESC",
54
- "limit" => 20,
55
- "paged" => 1,
56
  );
57
- $args = wp_parse_args($args, $defaults);
58
-
59
- $limit = intval($args["limit"]);
60
  $page = intval($args["paged"]);
61
- $escape = array();
62
  $escape[] = $args["status"];
63
-
64
  // 'white-list' escaping
65
  switch ($args["orderby"])
66
  {
67
- case "id";
68
- $orderby = "id";
69
  break;
70
- case "name":
71
- default:
72
- $orderby = "name";
73
  break;
74
 
75
  }
76
-
77
  switch($args["order"])
78
  {
79
- case "DESC":
80
- case "desc":
81
- $order = "DESC";
82
  break;
83
- case "ASC":
84
- case "asc":
85
  default:
86
- $order = "ASC";
87
  break;
88
  }
89
 
90
-
91
- $sql = "SELECT id FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
92
  if ($args["orderby"] != '')
93
  {
94
- $sql .= " ORDER BY $orderby $order";
95
-
96
- }
97
-
98
- if ($limit > 0)
99
  {
100
 
101
- if ($page == 1 )
102
- $offset = 0;
103
- else
104
  $offset = ($page-1) * $limit;
105
-
106
- $sql .= " LIMIT $offset, $limit ";
107
  }
108
-
109
- $sql = $this->wpdb->prepare($sql,$escape);
110
-
111
  $buttons = $this->wpdb->get_results($sql, ARRAY_A);
112
-
113
-
114
  return $buttons;
115
-
116
  }
117
-
118
  function getButtonCount($args = array())
119
  {
120
  $defaults = array(
121
- "status" => "publish",
122
-
123
  );
124
- $args = wp_parse_args($args, $defaults);
125
-
126
- $sql = "SELECT count(id) FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
127
- $sql = $this->wpdb->prepare($sql, $args["status"] );
128
  $result = $this->wpdb->get_var($sql);
129
  return $result;
130
-
131
  }
132
-
133
  function getButtonPages($args = array())
134
  {
135
  $defaults = array(
136
- "limit" => 20,
137
- "paged" => 1,
138
- "status" => "publish",
139
- "output" => "list", // not used, future arg.
140
  "view" => "all",
141
 
142
  );
143
 
144
- $args = wp_parse_args($args, $defaults);
145
 
146
- $limit = intval($args["limit"]);
147
- $page = intval($args["paged"]);
148
  $view = $args["view"];
149
 
150
- $total = $this->getButtonCount(array("status" => $args["status"]));
151
-
152
- $num_pages = ceil($total / $limit);
153
-
154
- if ($num_pages == 0) $num_pages = 1; // lowest limit, page 1
155
- $output = '';
156
  $url = $_SERVER['REQUEST_URI'];
157
 
158
- $url = remove_query_arg("view", $url);
159
  $url = add_query_arg("view", $view, $url);
160
 
161
  $first_url = ($page != 1 ) ? add_query_arg("paged", 1, $url) : false;
162
  $last_url = ($page != $num_pages) ? add_query_arg("paged", $num_pages, $url) : false;
163
  $next_url = ($page != $num_pages) ? add_query_arg("paged", ($page + 1), $url) : false;
164
  $next_page = ($page != $num_pages) ? ($page + 1) : false;
165
- $prev_page = ($page != 1) ? ($page -1 ) : false;
166
  $prev_url = ($page != 1 ) ? add_query_arg("paged", ($page -1), $url) : false;
167
-
168
 
169
  $return = array(
170
- "first" => 1,
171
- "base" => remove_query_arg("paged",$url),
172
  "first_url" => esc_url($first_url),
173
  "last" => $num_pages,
174
  "last_url" => esc_url($last_url),
175
- "next_url" => esc_url($next_url),
176
  "prev_url" => esc_url($prev_url),
177
- "prev_page" => $prev_page,
178
- "next_page" => $next_page,
179
- "total" => $total,
180
- "current" => $page,
181
-
182
-
183
-
184
  );
185
-
186
  return $return;
187
  }
188
-
189
  static function getAjaxButtons()
190
  {
191
-
192
  $admin = self::getInstance();
193
- $args = array();
194
 
195
- $paged = (isset($_REQUEST["paged"])) ? intval($_REQUEST["paged"]) : 1;
196
- if ($paged > 0)
197
  $args["paged" ] = $paged;
198
 
199
-
200
- $button = new MaxButton();
201
  $buttons = $admin->getButtons($args);
202
-
203
  echo "<div id='maxbuttons'><div class='preview-buttons'>";
204
 
205
  echo '<div class="tablenav top"> ';
206
- echo "<span class='hint'>" . __('Click on a button to select it and add the shortcode to the editor', 'maxbuttons') . "</span>";
207
- do_action('mb-display-pagination', $args);
208
- echo '<span class="loading"></span>';
209
- echo '</div>';
210
 
211
 
212
- if (count($buttons) == 0)
213
  {
214
-
215
  $url = admin_url('admin.php?page=maxbuttons-controller&action=edit');
216
- echo "<p><strong>" . __("You didn't add any buttons yet!","maxbuttons") . "</strong></p>";
217
- echo "<P>" . sprintf(__("Click %shere%s to add one", "maxbuttons"),
218
- "<a href='$url' target='_blank'>", "</a>") . "</strong></p>";
219
 
220
  }
221
-
222
  foreach($buttons as $b)
223
  {
224
-
225
- $button_id = $b["id"];
226
  $button->set($button_id);
227
- echo "<div class='button-row button-select' data-button='$button_id'>";
228
- echo "<span class='col col_insert'> ";
229
 
230
  echo "<span class='small'>[ID: $button_id ]</span>
231
- </span> ";
232
-
233
  echo "<span class='col col_button'><div class='shortcode-container'>";
234
  $button->display(array("mode" => "preview", "load_css" => "inline" ));
235
- echo "</div></span>";
236
  echo "<span class='col col_name'>" . $button->getName() . "</span>";
237
- echo "</div>";
238
  }
239
  echo '<div class="tablenav bottom"> ';
240
- do_action('mb-display-pagination', $args);
241
- echo '<span class="loading"></span>';
242
- echo '</div>';
 
243
 
244
-
245
  echo "</div></div>";
246
- echo "<p>&nbsp;</p>";
247
-
248
- exit();
249
-
250
  }
251
  function get_header($args =array() )
252
  {
253
  $defaults = array(
254
  "tabs_active" => false,
255
- "title" => "",
256
- "action" => "",
257
- );
258
-
259
- $args = wp_parse_args($args, $defaults);
260
  extract($args);
261
-
262
- include_once(MB()->get_plugin_path() . "includes/admin_header.php");
263
-
264
  }
265
 
266
-
267
  function get_footer()
268
  {
269
- include_once(MB()->get_plugin_path() . "includes/admin_footer.php");
270
-
271
  }
272
-
273
- // unified (future way to end ajax requests + feedback
274
  function endAjaxRequest($args = array())
275
  {
276
  $defaults = array(
277
  "error" => true, // can have errors and still result true on success
278
- "result" => true,
279
- "body" => "",
280
  "title" => "",
281
- "data" => array(),
282
  );
283
-
284
- $args = wp_parse_args($args, $defaults);
285
-
286
  echo json_encode($args);
287
- die();
288
-
289
-
290
  }
291
-
292
- function log($action, $message)
293
  {
294
  if (! defined('MAXBUTTONS_DEBUG') || ! MAXBUTTONS_DEBUG)
295
- return;
296
-
297
- $stack = debug_backtrace();
298
- $caller = $stack[1]['function'];
299
-
300
- $dir = MB()->get_plugin_path() . "logs";
301
- if (! is_dir($dir))
302
- @mkdir($dir, 0777, true); // silently fail here.
303
-
304
- if (! is_dir($dir))
305
- return false;
306
-
307
- $file = fopen($dir . "/maxbuttons.log", "a+");
308
- $now = new DateTime() ;
309
- $now_format = $now->format("d/M/Y H:i:s");
310
-
311
- $write_string = "[" . $now_format . "] $action - $message ( $caller )";
312
- fwrite($file, $write_string);
313
- fclose($file);
314
-
315
-
316
  }
317
  }
1
  <?php
2
+ namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
  class maxButtonsAdmin
6
  {
7
+
8
+ protected $wpdb;
9
+ protected static $instance = null;
10
+
11
  function __construct()
12
  {
13
+ global $wpdb;
14
  $this->wpdb = $wpdb;
15
  }
16
+
17
  public static function getInstance()
18
  {
19
+ if (is_null(self::$instance))
20
+ self::$instance = new maxButtonsAdmin();
21
+
22
+ return self::$instance;
23
+
24
  }
25
 
26
+ public function loadFonts()
27
  {
28
  $fonts = array(
29
  '' => '',
30
  'Arial' => 'Arial',
31
+ 'Courier New' => 'Courier New',
32
  'Georgia' => 'Georgia',
33
  'Tahoma' => 'Tahoma',
34
  'Times New Roman' => 'Times New Roman',
38
  return $fonts;
39
  }
40
 
41
+ /* Get multiple buttons
42
+
43
+ Used for overview pages, retrieve buttons on basis of passed arguments.
44
+
45
  @return array Array of found buttons with argument
46
+ */
47
+
48
  function getButtons($args = array())
49
  {
50
  $defaults = array(
51
+ "status" => "publish",
52
+ "orderby" => "id",
53
  "order" => "DESC",
54
+ "limit" => 20,
55
+ "paged" => 1,
56
  );
57
+ $args = wp_parse_args($args, $defaults);
58
+
59
+ $limit = intval($args["limit"]);
60
  $page = intval($args["paged"]);
61
+ $escape = array();
62
  $escape[] = $args["status"];
63
+
64
  // 'white-list' escaping
65
  switch ($args["orderby"])
66
  {
67
+ case "id";
68
+ $orderby = "id";
69
  break;
70
+ case "name":
71
+ default:
72
+ $orderby = "name";
73
  break;
74
 
75
  }
76
+
77
  switch($args["order"])
78
  {
79
+ case "DESC":
80
+ case "desc":
81
+ $order = "DESC";
82
  break;
83
+ case "ASC":
84
+ case "asc":
85
  default:
86
+ $order = "ASC";
87
  break;
88
  }
89
 
90
+
91
+ $sql = "SELECT id FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
92
  if ($args["orderby"] != '')
93
  {
94
+ $sql .= " ORDER BY $orderby $order";
95
+
96
+ }
97
+
98
+ if ($limit > 0)
99
  {
100
 
101
+ if ($page == 1 )
102
+ $offset = 0;
103
+ else
104
  $offset = ($page-1) * $limit;
105
+
106
+ $sql .= " LIMIT $offset, $limit ";
107
  }
108
+
109
+ $sql = $this->wpdb->prepare($sql,$escape);
110
+
111
  $buttons = $this->wpdb->get_results($sql, ARRAY_A);
112
+
113
+
114
  return $buttons;
115
+
116
  }
117
+
118
  function getButtonCount($args = array())
119
  {
120
  $defaults = array(
121
+ "status" => "publish",
122
+
123
  );
124
+ $args = wp_parse_args($args, $defaults);
125
+
126
+ $sql = "SELECT count(id) FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
127
+ $sql = $this->wpdb->prepare($sql, $args["status"] );
128
  $result = $this->wpdb->get_var($sql);
129
  return $result;
130
+
131
  }
132
+
133
  function getButtonPages($args = array())
134
  {
135
  $defaults = array(
136
+ "limit" => 20,
137
+ "paged" => 1,
138
+ "status" => "publish",
139
+ "output" => "list", // not used, future arg.
140
  "view" => "all",
141
 
142
  );
143
 
144
+ $args = wp_parse_args($args, $defaults);
145
 
146
+ $limit = intval($args["limit"]);
147
+ $page = intval($args["paged"]);
148
  $view = $args["view"];
149
 
150
+ $total = $this->getButtonCount(array("status" => $args["status"]));
151
+
152
+ $num_pages = ceil($total / $limit);
153
+
154
+ if ($num_pages == 0) $num_pages = 1; // lowest limit, page 1
155
+ $output = '';
156
  $url = $_SERVER['REQUEST_URI'];
157
 
158
+ $url = remove_query_arg("view", $url);
159
  $url = add_query_arg("view", $view, $url);
160
 
161
  $first_url = ($page != 1 ) ? add_query_arg("paged", 1, $url) : false;
162
  $last_url = ($page != $num_pages) ? add_query_arg("paged", $num_pages, $url) : false;
163
  $next_url = ($page != $num_pages) ? add_query_arg("paged", ($page + 1), $url) : false;
164
  $next_page = ($page != $num_pages) ? ($page + 1) : false;
165
+ $prev_page = ($page != 1) ? ($page -1 ) : false;
166
  $prev_url = ($page != 1 ) ? add_query_arg("paged", ($page -1), $url) : false;
167
+
168
 
169
  $return = array(
170
+ "first" => 1,
171
+ "base" => remove_query_arg("paged",$url),
172
  "first_url" => esc_url($first_url),
173
  "last" => $num_pages,
174
  "last_url" => esc_url($last_url),
175
+ "next_url" => esc_url($next_url),
176
  "prev_url" => esc_url($prev_url),
177
+ "prev_page" => $prev_page,
178
+ "next_page" => $next_page,
179
+ "total" => $total,
180
+ "current" => $page,
181
+
182
+
183
+
184
  );
185
+
186
  return $return;
187
  }
188
+
189
  static function getAjaxButtons()
190
  {
191
+
192
  $admin = self::getInstance();
193
+ $args = array();
194
 
195
+ $paged = (isset($_REQUEST["paged"])) ? intval($_REQUEST["paged"]) : 1;
196
+ if ($paged > 0)
197
  $args["paged" ] = $paged;
198
 
199
+
200
+ $button = new MaxButton();
201
  $buttons = $admin->getButtons($args);
202
+
203
  echo "<div id='maxbuttons'><div class='preview-buttons'>";
204
 
205
  echo '<div class="tablenav top"> ';
206
+ echo "<span class='hint'>" . __('Click on a button to select it and add the shortcode to the editor', 'maxbuttons') . "</span>";
207
+ do_action('mb-display-pagination', $args);
208
+ echo '<span class="loading"></span>';
209
+ echo '</div>';
210
 
211
 
212
+ if (count($buttons) == 0)
213
  {
214
+
215
  $url = admin_url('admin.php?page=maxbuttons-controller&action=edit');
216
+ echo "<p><strong>" . __("You didn't add any buttons yet!","maxbuttons") . "</strong></p>";
217
+ echo "<P>" . sprintf(__("Click %shere%s to add one", "maxbuttons"),
218
+ "<a href='$url' target='_blank'>", "</a>") . "</strong></p>";
219
 
220
  }
221
+
222
  foreach($buttons as $b)
223
  {
224
+
225
+ $button_id = $b["id"];
226
  $button->set($button_id);
227
+ echo "<div class='button-row button-select' data-button='$button_id'>";
228
+ echo "<span class='col col_insert'> ";
229
 
230
  echo "<span class='small'>[ID: $button_id ]</span>
231
+ </span> ";
232
+
233
  echo "<span class='col col_button'><div class='shortcode-container'>";
234
  $button->display(array("mode" => "preview", "load_css" => "inline" ));
235
+ echo "</div></span>";
236
  echo "<span class='col col_name'>" . $button->getName() . "</span>";
237
+ echo "</div>";
238
  }
239
  echo '<div class="tablenav bottom"> ';
240
+ do_action('mb-display-pagination', $args);
241
+ echo '<span class="loading"></span>';
242
+ echo '</div>';
243
+
244
 
 
245
  echo "</div></div>";
246
+ echo "<p>&nbsp;</p>";
247
+
248
+ exit();
249
+
250
  }
251
  function get_header($args =array() )
252
  {
253
  $defaults = array(
254
  "tabs_active" => false,
255
+ "title" => "",
256
+ "action" => "",
257
+ );
258
+
259
+ $args = wp_parse_args($args, $defaults);
260
  extract($args);
261
+
262
+ include_once(MB()->get_plugin_path() . "includes/admin_header.php");
263
+
264
  }
265
 
266
+
267
  function get_footer()
268
  {
269
+ include_once(MB()->get_plugin_path() . "includes/admin_footer.php");
270
+
271
  }
272
+
273
+ // unified (future way to end ajax requests + feedback
274
  function endAjaxRequest($args = array())
275
  {
276
  $defaults = array(
277
  "error" => true, // can have errors and still result true on success
278
+ "result" => true,
279
+ "body" => "",
280
  "title" => "",
281
+ "data" => array(),
282
  );
283
+
284
+ $args = wp_parse_args($args, $defaults);
285
+
286
  echo json_encode($args);
287
+ die();
288
+
289
+
290
  }
291
+
292
+ function log($action, $message)
293
  {
294
  if (! defined('MAXBUTTONS_DEBUG') || ! MAXBUTTONS_DEBUG)
295
+ return;
296
+
297
+ $stack = debug_backtrace();
298
+ $caller = $stack[1]['function'];
299
+
300
+ $dir = MB()->get_plugin_path() . "logs";
301
+ if (! is_dir($dir))
302
+ @mkdir($dir, 0777, true); // silently fail here.
303
+
304
+ if (! is_dir($dir))
305
+ return false;
306
+
307
+ $file = fopen( trailingslashit($dir) . "/maxbuttons.log", "a+");
308
+ $now = new DateTime() ;
309
+ $now_format = $now->format("d/M/Y H:i:s");
310
+
311
+ $write_string = "[" . $now_format . "] $action - $message ( $caller )";
312
+ fwrite($file, $write_string);
313
+ fclose($file);
314
+
315
+
316
  }
317
  }
classes/maxCSSParser.php CHANGED
@@ -59,7 +59,8 @@ class maxCSSParser
59
 
60
  if (count($children) > 0)
61
  $struct[$root->tag] = $this->loadRecursive(array(), $children);
62
-
 
63
  $this->struct = $struct;
64
 
65
 
@@ -110,6 +111,7 @@ class maxCSSParser
110
  if ( is_null($elements) )
111
  return;
112
 
 
113
  foreach($elements as $el => $el_data)
114
  {
115
 
@@ -167,6 +169,7 @@ class maxCSSParser
167
  function parse_part($element, $el_data, $el_add = '')
168
  {
169
  maxUtils::addTime("CSSParser: Parse $element ");
 
170
 
171
  $tag = $el_data["tag"];
172
  $element_data = $this->findData($this->data, $element);
@@ -194,7 +197,18 @@ class maxCSSParser
194
  // Anchor class in default situation should be .maxbutton
195
  $anchor_class = $this->anchor_class;
196
 
197
- $ps_selector = preg_replace('/' . $anchor_class . '$|' . $anchor_class . '([.| ])/i',"$anchor_class:$pseudo\$1",$el_add);
 
 
 
 
 
 
 
 
 
 
 
198
  $this->output_css .= " $ps_selector { ";
199
  }
200
  else {
59
 
60
  if (count($children) > 0)
61
  $struct[$root->tag] = $this->loadRecursive(array(), $children);
62
+
63
+
64
  $this->struct = $struct;
65
 
66
 
111
  if ( is_null($elements) )
112
  return;
113
 
114
+
115
  foreach($elements as $el => $el_data)
116
  {
117
 
169
  function parse_part($element, $el_data, $el_add = '')
170
  {
171
  maxUtils::addTime("CSSParser: Parse $element ");
172
+
173
 
174
  $tag = $el_data["tag"];
175
  $element_data = $this->findData($this->data, $element);
197
  // Anchor class in default situation should be .maxbutton
198
  $anchor_class = $this->anchor_class;
199
 
200
+ $count = 0;
201
+
202
+ /* If PS Selector replacement doesn't match anchor class selector this probably means the parse is done in a higher level
203
+ e.g. container level, so no proper will be set. In case 0 count replacement, just put it on current */
204
+ $ps_selector = preg_replace('/' . $anchor_class . '$|' . $anchor_class . '([.| ])/i',"$anchor_class:$pseudo\$1",$el_add, -1, $count);
205
+
206
+ if ($count === 0)
207
+ {
208
+ $ps_selector = $el_add . ":" . $pseudo;
209
+ }
210
+
211
+
212
  $this->output_css .= " $ps_selector { ";
213
  }
214
  else {
includes/maxbuttons-collection-list.php CHANGED
@@ -12,10 +12,19 @@ $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_a
12
 
13
  $collections = maxCollections::getCollections();
14
  $maxCol = new maxCollection();
 
 
 
 
 
 
15
  ?>
16
-
17
  <a class="page-title-action collection-addnew" href="<?php echo admin_url() ?>admin.php?page=maxbuttons-collections&action=edit&collection=social">
18
- <?php _e("Add New","maxbuttons"); ?></a>
 
 
 
19
 
20
  <?php
21
 
@@ -91,10 +100,11 @@ foreach ($collections as $index => $data)
91
  <?php
92
  }
93
 
 
94
  if (count($collections) == 0)
95
  {
96
  do_action("mb-display-collection-welcome");
97
- }
98
  ?>
99
 
100
  </div> <!-- // collection-list -->
12
 
13
  $collections = maxCollections::getCollections();
14
  $maxCol = new maxCollection();
15
+
16
+ //if (count($collections) == 0) :
17
+ require_once('social-share.php');
18
+
19
+ //else:
20
+
21
  ?>
22
+ <!--
23
  <a class="page-title-action collection-addnew" href="<?php echo admin_url() ?>admin.php?page=maxbuttons-collections&action=edit&collection=social">
24
+ <?php _e("Add New","maxbuttons"); ?></a> -->
25
+
26
+ <?php //endif;
27
+ ?>
28
 
29
  <?php
30
 
100
  <?php
101
  }
102
 
103
+ /*
104
  if (count($collections) == 0)
105
  {
106
  do_action("mb-display-collection-welcome");
107
+ } */
108
  ?>
109
 
110
  </div> <!-- // collection-list -->
includes/maxbuttons-collections.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
- $colID = (isset($_GET["colID"])) ? intval($_GET["colID"]) : '';
6
- $action = isset($_GET["action"]) ? sanitize_text_field($_GET["action"]) : '';
7
 
8
 
9
  if (! extension_loaded('simplexml') )
10
- $action = 'nosimplexml';
11
 
12
  switch($action)
13
  {
14
- case "edit":
15
- require_once("maxbuttons-collection-edit.php");
 
 
 
 
 
 
16
  break;
17
- case 'nosimplexml':
18
- require_once('maxbuttons-no-simplexml.php');
19
- break;
20
- default;
21
- require_once("maxbuttons-collection-list.php");
22
- break;
23
  }
24
-
25
 
26
 
27
 
1
+ <?php
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
+ $colID = (isset($_GET["colID"])) ? intval($_GET["colID"]) : '';
6
+ $action = isset($_GET["action"]) ? sanitize_text_field($_GET["action"]) : '';
7
 
8
 
9
  if (! extension_loaded('simplexml') )
10
+ $action = 'nosimplexml';
11
 
12
  switch($action)
13
  {
14
+ case "edit":
15
+ require_once("maxbuttons-collection-edit.php");
16
+ break;
17
+ case 'nosimplexml':
18
+ require_once('maxbuttons-no-simplexml.php');
19
+ break;
20
+ default;
21
+ require_once("maxbuttons-collection-list.php");
22
  break;
 
 
 
 
 
 
23
  }
24
+
25
 
26
 
27
 
includes/maxbuttons-no-simplexml.php CHANGED
@@ -2,38 +2,41 @@
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
- global $page_title;
6
- $page_title = __("Enable SimpleXML", "maxbuttons");
7
- $admin = MB()->getClass("admin");
8
 
9
 
10
- $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action));
 
 
 
11
 
12
- $admin = MB()->getClass('admin');
13
- $page_title = __("Packs","maxbuttons-pro");
14
-
15
  $admin->get_header(array("title" => $page_title) );
16
 
17
  ?>
18
 
19
- <div>
20
 
21
  <h4><?php _e('PHP Module SimpleXML not found. This module will not work','maxbuttons') ?></h4>
22
  <p>
23
- <?php _e('To enable this module please install the SimpleXML PHP module. If you don\'t know how, ask your support from your
24
  hosting provider','maxbuttons'); ?>
25
 
26
  <ul>
27
  <li><a target="_blank" href='http://php.net/manual/en/simplexml.installation.php'><?php _e('SimpleXML installation','maxbuttons');?></a>
28
  </li>
29
- </ul>
30
 
31
  </p>
 
 
32
 
33
  </div>
34
- </div> <!-- main -->
35
  <div class="offers ad-wrap">
36
- <?php do_action("mb-display-ads"); ?>
37
  </div>
38
 
39
- <?php $admin->get_footer(); ?>
 
2
  namespace MaxButtons;
3
  defined('ABSPATH') or die('No direct access permitted');
4
 
5
+ global $page_title;
6
+ $page_title = __("Enable SimpleXML", "maxbuttons");
7
+ $admin = MB()->getClass("admin");
8
 
9
 
10
+ $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action));
11
+
12
+ $admin = MB()->getClass('admin');
13
+ $page_title = __("Packs","maxbuttons-pro");
14
 
 
 
 
15
  $admin->get_header(array("title" => $page_title) );
16
 
17
  ?>
18
 
19
+ <div class='social-share'>
20
 
21
  <h4><?php _e('PHP Module SimpleXML not found. This module will not work','maxbuttons') ?></h4>
22
  <p>
23
+ <?php _e('To enable this module please install the SimpleXML PHP module. If you don\'t know how, ask your support from your
24
  hosting provider','maxbuttons'); ?>
25
 
26
  <ul>
27
  <li><a target="_blank" href='http://php.net/manual/en/simplexml.installation.php'><?php _e('SimpleXML installation','maxbuttons');?></a>
28
  </li>
29
+ </ul>
30
 
31
  </p>
32
+ <?php require_once('social-share.php'); ?>
33
+
34
 
35
  </div>
36
+ </div> <!-- main -->
37
  <div class="offers ad-wrap">
38
+ <?php do_action("mb-display-ads"); ?>
39
  </div>
40
 
41
+
42
+ <?php $admin->get_footer(); ?>
includes/social-share.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $action = 'install-plugin';
3
+ $slug = 'share-button';
4
+ $url = wp_nonce_url(
5
+ add_query_arg(
6
+ array(
7
+ 'action' => $action,
8
+ 'plugin' => $slug
9
+ ),
10
+ admin_url( 'update.php' )
11
+ ),
12
+ $action.'_'.$slug
13
+ );
14
+ ?>
15
+
16
+
17
+ <div class='social-share-move option-container'>
18
+ <div class='inside'>
19
+ <h3>MaxButtons Social Share is moving </h3>
20
+
21
+ <p>We created a brand new plugin to make your Social Share experiences better. </p>
22
+
23
+ <p><a href='<?php echo $url ?>' class='button-primary large '>Get it here </a></p>
24
+ </div>
25
+ </div>
js/maxajax.js CHANGED
@@ -1,136 +1,144 @@
1
 
2
  /** New AJAX Call methods
3
- /* Get the standard AJAX vars for this plugin */
4
 
5
  var maxAjax = function(jquery) {
6
  $ = jquery;
7
 
8
  }
9
 
10
- maxAjax.prototype.init = function()
11
  {
12
 
13
  // default actions that trigger ajax action.
14
  $(document).on('click', '.mb-ajax-form .mb-ajax-submit', $.proxy(this.ajaxForm, this ));
15
- $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
16
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
17
  $(document).trigger('maxajax_init'); // for hanging in other actions.
18
  }
19
 
20
- maxAjax.prototype.ajaxInit = function()
21
  {
22
- data = {
23
  action: maxajax.ajax_action,
24
- nonce: maxajax.nonce,
25
  }
26
-
27
  return data;
28
  }
29
 
30
  maxAjax.prototype.ajaxForm = function (e)
31
  {
32
- var target = $(e.target);
33
- var form = $(target).parents('form');
34
- var action = $(target).data('action');
35
-
36
- var data = this.ajaxInit();
37
- data['form'] = form.serialize();
38
  data['plugin_action'] = action;
39
- // data['action'] = 'mb_button_action';
40
-
41
- this.showSpinner(target);
42
-
43
- this.ajaxPost(data);
44
-
45
-
46
  }
47
 
48
  /* Ajax call functionality */
49
- maxAjax.prototype.ajaxCall = function (e)
50
  {
51
 
52
- e.preventDefault();
53
- var target = e.target;
 
 
 
 
 
54
 
55
- var param = false;
56
- var plugin_action = $(target).data('action');
57
- var check_param = $(target).data('param');
58
- var param_input = $(target).data('param-input');
59
-
60
- if (typeof check_param !== 'undefined')
61
  param = check_param;
62
- if (typeof param_input !== 'undefined')
63
- param = $(param_input).val();
64
-
65
  data = this.ajaxInit();
66
 
67
  data['plugin_action'] = plugin_action;
68
  data['param'] = param;
69
  data['post'] = $('form').serialize(); // send it all
70
 
71
- this.showSpinner(target);
72
 
73
  this.ajaxPost(data);
74
  }
75
 
76
  maxAjax.prototype.showSpinner = function(target)
77
- {
78
- var spinner = '<div class="ajax-load-spinner"></div>';
79
- $('.ajax-load-spinner').remove();
 
80
  $(target).after(spinner);
81
  //return spinner;
82
  }
83
 
 
 
 
 
 
 
84
  maxAjax.prototype.ajaxPost = function(data, successHandler, errorHandler)
85
  {
86
  var self = this;
87
-
88
- if (typeof successHandler == 'undefined')
89
  {
90
- var action = data['plugin_action'];
91
- var successHandler = function (r,s,o,) { self.defaultSuccessHandler(r,s,o,action) } ;
92
-
93
  }
94
-
95
- if (typeof errorHandler == 'undefined')
96
  {
97
- var action = data['plugin_action'];
98
  var errorHandler = function (r,s,o,) { self.defaultErrorHandler(r,s,o,action) } ;
99
- }
100
 
101
 
102
  $.ajax({
103
- type: "POST",
104
  url: maxajax.ajax_url,
105
  data: data,
106
  success: successHandler,
107
  error: errorHandler,
108
- });
109
  }
110
 
111
- maxAjax.prototype.defaultSuccessHandler = function (result, status, object, action)
112
  {
 
113
  $(document).trigger('maxajax_success_' + action, [result, status, object]);
114
 
115
  }
116
 
117
- maxAjax.prototype.defaultErrorHandler = function(jq,status,error, action)
118
  {
119
- $(document).trigger('maxajax_error_' + action, jq, status, error);
 
120
  console.log(jq);
121
  console.log(status);
122
- console.log(error);
123
  }
124
 
125
 
126
  jQuery(document).ready(function($) {
127
 
128
- if (typeof window.maxFoundry === 'undefined')
129
- window.maxFoundry = {} ;
130
-
131
  window.maxFoundry.maxAjax = new maxAjax($);
132
 
133
  window.maxFoundry.maxAjax.init();
134
 
135
  }); /* END OF JQUERY */
136
-
1
 
2
  /** New AJAX Call methods
3
+ /* Get the standard AJAX vars for this plugin */
4
 
5
  var maxAjax = function(jquery) {
6
  $ = jquery;
7
 
8
  }
9
 
10
+ maxAjax.prototype.init = function()
11
  {
12
 
13
  // default actions that trigger ajax action.
14
  $(document).on('click', '.mb-ajax-form .mb-ajax-submit', $.proxy(this.ajaxForm, this ));
15
+ $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
16
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
17
  $(document).trigger('maxajax_init'); // for hanging in other actions.
18
  }
19
 
20
+ maxAjax.prototype.ajaxInit = function()
21
  {
22
+ data = {
23
  action: maxajax.ajax_action,
24
+ nonce: maxajax.nonce,
25
  }
26
+
27
  return data;
28
  }
29
 
30
  maxAjax.prototype.ajaxForm = function (e)
31
  {
32
+ var target = $(e.target);
33
+ var form = $(target).parents('form');
34
+ var action = $(target).data('action');
35
+
36
+ var data = this.ajaxInit();
37
+ data['form'] = form.serialize();
38
  data['plugin_action'] = action;
39
+ // data['action'] = 'mb_button_action';
40
+
41
+ this.showSpinner(target);
42
+
43
+ this.ajaxPost(data);
44
+
45
+
46
  }
47
 
48
  /* Ajax call functionality */
49
+ maxAjax.prototype.ajaxCall = function (e)
50
  {
51
 
52
+ e.preventDefault();
53
+ var target = e.target;
54
+
55
+ var param = false;
56
+ var plugin_action = $(target).data('action');
57
+ var check_param = $(target).data('param');
58
+ var param_input = $(target).data('param-input');
59
 
60
+ if (typeof check_param !== 'undefined')
 
 
 
 
 
61
  param = check_param;
62
+ if (typeof param_input !== 'undefined')
63
+ param = $(param_input).val();
64
+
65
  data = this.ajaxInit();
66
 
67
  data['plugin_action'] = plugin_action;
68
  data['param'] = param;
69
  data['post'] = $('form').serialize(); // send it all
70
 
71
+ this.showSpinner(target);
72
 
73
  this.ajaxPost(data);
74
  }
75
 
76
  maxAjax.prototype.showSpinner = function(target)
77
+ {
78
+ // spinner styling in elements
79
+ var spinner = '<div class="maxajax-load-spinner"></div>';
80
+ //$('.maxajax-load-spinner').remove();
81
  $(target).after(spinner);
82
  //return spinner;
83
  }
84
 
85
+ maxAjax.prototype.removeSpinner = function()
86
+ {
87
+ $('.maxajax-load-spinner').remove();
88
+
89
+ }
90
+
91
  maxAjax.prototype.ajaxPost = function(data, successHandler, errorHandler)
92
  {
93
  var self = this;
94
+
95
+ if (typeof successHandler == 'undefined')
96
  {
97
+ var action = data['plugin_action'];
98
+ var successHandler = function (r,s,o,) { self.defaultSuccessHandler(r,s,o,action) } ;
99
+
100
  }
101
+
102
+ if (typeof errorHandler == 'undefined')
103
  {
104
+ var action = data['plugin_action'];
105
  var errorHandler = function (r,s,o,) { self.defaultErrorHandler(r,s,o,action) } ;
106
+ }
107
 
108
 
109
  $.ajax({
110
+ type: "POST",
111
  url: maxajax.ajax_url,
112
  data: data,
113
  success: successHandler,
114
  error: errorHandler,
115
+ });
116
  }
117
 
118
+ maxAjax.prototype.defaultSuccessHandler = function (result, status, object, action)
119
  {
120
+ this.removeSpinner();
121
  $(document).trigger('maxajax_success_' + action, [result, status, object]);
122
 
123
  }
124
 
125
+ maxAjax.prototype.defaultErrorHandler = function(jq,status,error, action)
126
  {
127
+ this.removeSpinner();
128
+ $(document).trigger('maxajax_error_' + action, jq, status, error);
129
  console.log(jq);
130
  console.log(status);
131
+ console.log(error);
132
  }
133
 
134
 
135
  jQuery(document).ready(function($) {
136
 
137
+ if (typeof window.maxFoundry === 'undefined')
138
+ window.maxFoundry = {} ;
139
+
140
  window.maxFoundry.maxAjax = new maxAjax($);
141
 
142
  window.maxFoundry.maxAjax.init();
143
 
144
  }); /* END OF JQUERY */
 
js/maxbuttons-admin.js CHANGED
@@ -1,9 +1,9 @@
1
-
2
  var maxAdmin;
3
 
4
 
5
  jQuery(document).ready(function($) {
6
-
7
  maxAdmin = function ()
8
  {
9
  // $ = jquery;
@@ -13,157 +13,157 @@ maxAdmin.prototype = {
13
  //initialized: false,
14
  colorUpdateTime: true,
15
  fields: null,
16
- button_id: null,
17
  form_updated: false,
18
  tabs: null,
19
-
20
-
21
  }; // MaxAdmin
22
 
23
  maxAdmin.prototype.init = function () {
24
- this.button_id = $('input[name="button_id"]').val();
25
-
26
- // Prevents the output button from being clickable (also in admin list view )
27
- $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); });
28
- $(document).on('click', '.output .preview-toggle', $.proxy(this.toggle_preview, this));
29
 
30
  // overview input paging
31
  $('#maxbuttons .input-paging').on('change', $.proxy(this.do_paging, this));
32
-
33
- $('.manual-toggle').on('click', $.proxy(this.toggleManual, this));
34
- $('.manual-entry').draggable({
35
  cancel: 'p, li',
36
- });
37
 
38
- $(document).on('submit', 'form.mb_ajax_save', $.proxy(this.formAjaxSave, this));
39
 
40
- // copy / delete / trash action buttons via ajax
41
- $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
42
-
43
- // conditionals
44
  $(document).on('reInitConditionals', $.proxy(this.initConditionials, this));
45
  this.initConditionials(); // conditional options
46
-
47
- // range inputs
48
- $(document).on('change, input', 'input[type="range"]', $.proxy(this.updateRange, this ));
49
- this.updateRange(null);
50
-
51
  /*
52
  ****
53
- ### After this only init for button main edit screen
54
  ****
55
 
56
  */
57
- if ($('#new-button-form').length == 0)
58
- return;
 
59
 
60
-
61
  if (this.button_id > 0) {
62
  $("#maxbuttons .mb-message").show();
63
- }
64
-
65
- this.initResponsive(); // responsive edit interface
66
-
67
- $("#maxbuttons .output").draggable({
68
  cancel: '.nodrag',
69
- });
70
-
71
  $('#maxbuttons .color-field').wpColorPicker(
72
- {
73
  width: 300,
74
 
75
  change: $.proxy( _.throttle(function(event, ui) {
76
  event.preventDefault();
77
  var color = ui.color.toString();
78
- this.update_color(event,ui, color);
79
- }, 200), this),
80
-
81
  }
82
- );
 
 
 
 
 
83
 
84
- /* Copy Color Interface */
85
- $('.input.color .arrows').on('click', $.proxy(this.copyColor, this) );
86
-
87
- $('#radius_toggle').on('click', $.proxy(this.toggleRadiusLock,this));
88
-
89
  if ( typeof buttonFieldMap != 'undefined')
90
  this.fields = $.parseJSON(buttonFieldMap);
91
-
92
- // bind to all inputs, except for color-field or items with different handler.
93
- $('input').not('.color-field').on('keyup change', $.proxy(this.update_preview,this));
94
- $('input.color-field').on('focus', $.proxy(this.select_field, this));
95
-
96
- $('select').on('change', $.proxy(this.update_preview, this));
97
 
98
  $(window).on('beforeunload', $.proxy(function () { if (this.form_updated) return maxcol_wp.leave_page; }, this));
99
  $(document).on('keyup', 'input', function (e) {
100
 
101
- if (e.keyCode && e.keyCode == 13)
102
  {
103
  $(":input")[$(":input").index(document.activeElement) + 1].focus();
104
  return false;
105
  }
106
  });
107
-
108
- $(".button-save").click( $.proxy(function() {
109
- this.saveIndicator(false); // prevent alert when saving.
110
  $("#new-button-form").submit();
111
  return false;
112
  }, this) );
113
-
114
- // Expand shortcode tabs for more examples.
115
- $('.shortcode-expand').on('click', this.toggleShortcode);
116
 
117
-
 
 
 
118
  }; // INIT
119
 
120
-
121
- maxAdmin.prototype.repaint_preview = function ()
122
  {
123
  $('.mb_tab input[type="text"]').trigger('change');
124
- $('.mb_tab input[type="number"]').trigger('change');
125
- $('.mb_tab select').trigger('change');
126
- $('.mb_tab input[type="hidden"]').trigger('change');
127
- $('.mb_tab input[type="radio"]:checked').trigger('change');
128
- $('.mb_tab input[type="checkbox"]:checked').trigger('change');
129
-
130
  //$(document).trigger('colorUpdate', ['#text_color', $('#text_color').val() ]);
131
- //$(document).trigger('colorUpdate', ['#text_color_hover', $('#text_color_hover').val() ]);
132
-
133
  }
134
-
135
- maxAdmin.prototype.update_preview = function(e)
136
  {
137
  e.preventDefault();
138
- this.saveIndicator(true);
139
- var target = $(e.target);
140
-
141
- // migration to data field
142
- var field = $(target).data('field');
143
  if (typeof field == 'undefined')
144
  var id = $(target).attr('id'); // this should change to be ready for the option to have two the same fields on multi locations.
145
  else
146
  var id = field;
147
 
148
- var data = this.fields[id];
149
 
150
- if (typeof data == 'undefined')
151
- return; // field doesn't have updates
152
 
153
- if (typeof data.css != 'undefined')
154
  {
155
- value = target.val();
156
 
157
- if (typeof data.css_unit != 'undefined' && value.indexOf(data.css_unit) == -1)
158
  value += data.css_unit;
159
-
160
- // a target that is checkbox but not checked should unset (empty) value.
161
- if (target.is(':checkbox') && ! target.is(':checked') )
162
- value = '';
163
 
164
  this.putCSS(data, value);
165
  }
166
- if (typeof data.attr != 'undefined')
167
  {
168
  $('.output .result').find('a').attr(data.attr, target.val());
169
  }
@@ -176,190 +176,190 @@ maxAdmin.prototype.update_preview = function(e)
176
 
177
  maxAdmin.prototype.select_field = function(e)
178
  {
179
- $(e.target).select();
180
- }
181
 
182
  maxAdmin.prototype.button_action = function(e)
183
  {
184
- e.preventDefault();
185
- var action = $(e.target).data('buttonaction');
186
-
187
- this.form_updated = false;
188
-
189
- var button_id = $(e.target).data('buttonid');
190
- var nonce = $('input[name="' + action + '_nonce"]').val();
191
-
192
  var url = mb_ajax.ajaxurl;
193
- var data =
194
  {
195
  action: 'mb_button_action',
196
- button_action: action,
197
- button_id: button_id,
198
- nonce: nonce,
199
 
200
  };
201
 
202
  $.post({
203
- url: url,
204
- data: data,
205
  success: function (data) {
206
  response = JSON.parse(data);
207
-
208
- if (typeof response.redirection != 'undefined')
209
  {
210
- window.location = response.redirection;
211
  }
212
- },
213
  error: function () {
214
  console.log('error in button action' + action);
215
  },
216
  });
217
  }
218
 
219
- /* Check the copy modal and display a warning if the button has been changes */
220
  maxAdmin.prototype.checkCopyModal = function(modal)
221
  {
222
  if (this.form_updated)
223
  {
224
  modal.currentModal.find('.mb-message').show();
225
-
226
- }
227
  else
228
  $(modal.currentModal).find('.mb-message').hide();
229
  }
230
-
231
  maxAdmin.prototype.toggle_preview = function (e)
232
  {
233
  if ( $('.output .inner').is(':hidden') )
234
  {
235
- $('.output .inner').show();
236
- $('.output').css('height', 'auto');
237
- $('.preview .preview-toggle').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up');
238
  }
239
  else
240
  {
241
- $('.output .inner').hide();
242
- $('.output').css('height', 'auto');
243
  $('.preview .preview-toggle').removeClass('dashicons-arrow-up').addClass('dashicons-arrow-down');
244
  }
245
- };
246
 
247
-
248
- maxAdmin.prototype.putCSS = function(data,value,state)
249
  {
250
  state = state || 'both';
251
 
252
- var element = '.maxbutton';
253
- if (state == 'hover')
254
- element = 'a.hover ';
255
- else if(state == 'normal')
256
- element = 'a.normal ';
257
-
258
- if (typeof data.csspart != 'undefined')
259
  {
260
  var parts = data.csspart.split(",");
261
  for(i=0; i < parts.length; i++)
262
  {
263
- var cpart = parts[i];
264
  var fullpart = element + " ." + cpart;
265
- $('.output .result').find(fullpart).css(data.css, value);
266
  }
267
  }
268
  else
269
- $('.output .result').find(element).css(data.css, value);
270
  }
271
 
272
  maxAdmin.prototype.update_color = function(event, ui, color)
273
  {
274
  event.preventDefault();
275
- this.saveIndicator(true);
276
 
277
  var target = $(event.target);
278
- //var color = target.val();
279
-
280
  if (color.indexOf('#') === -1)
281
- color = '#' + color;
282
-
283
- var id = target.attr('id');
284
  $('#' + id).val(color); // otherwise field value is running 1 click behind.
285
 
286
-
287
  if(id.indexOf('box_shadow') !== -1)
288
  {
289
- this.updateBoxShadow(target);
290
  }
291
  else if(id.indexOf('text_shadow') !== -1)
292
  {
293
- this.updateTextShadow(target);
294
- }
295
  else if (id.indexOf('gradient') !== -1)
296
  {
297
  if (id.indexOf('hover') == -1)
298
  this.updateGradient();
299
  else
300
- this.updateGradient(true);
301
  }
302
  else if (id == 'button_preview')
303
  {
304
- $(".output .result").css('backgroundColor', color);
305
  }
306
  else // simple update
307
  {
308
 
309
  if (id.indexOf('hover') == -1)
310
- {
311
  state = 'normal';
312
  }
313
  else
314
  {
315
- state = 'hover';
316
  }
317
-
318
- var data = this.fields[id];
319
 
320
- this.putCSS(data, color, state);
 
 
321
  return;
322
  }
323
-
324
 
325
  };
326
-
327
  maxAdmin.prototype.copyColor = function (e)
328
  {
329
  e.preventDefault();
330
  e.stopPropagation(); // stop the color picker from closing itself.
331
-
332
- var target = $(e.target);
333
- var bindto = $(e.target).parents('[data-bind]');
334
  var fieldId = '#' + bindto.data('id'); // Field which is used
335
  var bindId = '#' + bindto.data('bind'); // Field is bound to.
336
-
337
  // check which arrow was pressed
338
  if (target.hasClass('arrow-right'))
339
- var arrow_click = 'right';
340
  else
341
  var arrow_click = 'left';
342
-
343
  // check on which side the interface is. If arrows are on right side, it's the left side (...)
344
  if (bindto.hasClass('right') )
345
- var if_side = 'left';
346
  else
347
- var if_side = 'right';
348
-
349
- /* Decide which color to replace. If interface is left - then right click is copy to other element, but if interface is right, right is overwrite current element.
350
- Left : right click - copy, left replace.
351
- Right : right click - replace, left copy.
352
  */
353
- if (if_side == 'left')
354
  {
355
- if (arrow_click == 'right')
356
  copy = true;
357
  else
358
  copy = false;
359
  }
360
- else if (if_side == 'right')
361
  {
362
- if (arrow_click == 'right')
363
  copy = false;
364
  else
365
  copy = true;
@@ -367,130 +367,130 @@ maxAdmin.prototype.copyColor = function (e)
367
 
368
  if ( copy )
369
  {
370
- $(bindId).val( $(fieldId).val() );
371
  $(bindId).trigger('change');
372
- $(bindId).wpColorPicker('color', $(fieldId).val());
373
  }
374
  else
375
  {
376
- $(fieldId).val( $(bindId).val() );
377
  $(fieldId).trigger('change');
378
- $(fieldId).wpColorPicker('color', $(bindId).val());
379
  }
380
-
381
  }
382
-
383
  maxAdmin.prototype.updateGradient = function(hover)
384
  {
385
  hover = hover || false;
386
-
387
- var hovtarget = '';
388
  if (hover)
389
- hovtarget = "_hover";
390
-
391
- var stop = parseInt($('#gradient_stop').val());
392
 
393
  if (isNaN(stop) )
394
  stop = 45;
395
-
396
- var gradients_on = $('#use_gradient').prop('checked');
397
-
398
  var start = this.hexToRgb($('#gradient_start_color' + hovtarget).val());
399
  var end = this.hexToRgb($('#gradient_end_color' + hovtarget).val());
400
  var startop = parseInt($('#gradient_start_opacity' + hovtarget).val());
401
  var endop = parseInt($('#gradient_end_opacity' + hovtarget).val());
402
-
403
  if (! gradients_on)
404
  {
405
- end = start;
406
- endop = startop;
407
  }
408
-
409
- if(isNaN(startop)) startop = 100;
410
  if(isNaN(endop)) endop = 100;
411
-
412
  if (!hover)
413
- var button = $('.output .result').find('a.normal');
414
  else
415
  var button = $('.output .result').find('a.hover');
416
 
417
 
418
-
419
-
420
- button.css("background", "linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
421
- button.css("background", "-moz-linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
422
- button.css("background", "-o-linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
423
- button.css("background", "-webkit-gradient(linear, left top, left bottom, color-stop(" +stop+ "%, rgba(" + start + "," + (startop/100) + ")), color-stop(1, rgba(" + end + "," + (endop/100) + ") ));");
424
-
425
-
426
  }
427
-
428
  maxAdmin.prototype.hexToRgb = function(hex) {
429
-
430
  hex = hex.replace('#','');
431
  var bigint = parseInt(hex, 16);
432
  var r = (bigint >> 16) & 255;
433
  var g = (bigint >> 8) & 255;
434
  var b = bigint & 255;
435
-
436
  return r + "," + g + "," + b;
437
  }
438
-
439
  maxAdmin.prototype.updateBoxShadow = function (target)
440
  {
441
  target = target || null;
442
 
443
  var left = $("#box_shadow_offset_left").val();
444
  var top = $("#box_shadow_offset_top").val();
445
- var width = $("#box_shadow_width").val();
446
- var spread = $('#box_shadow_spread').val();
447
-
448
  var color = $("#box_shadow_color").val();
449
  var hovcolor = $("#box_shadow_color_hover").val();
450
-
451
- $('.output .result').find('a.normal').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + color);
452
- $('.output .result').find('a.hover').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + hovcolor);
453
  }
454
-
455
  maxAdmin.prototype.updateTextShadow = function(target,hover)
456
  {
457
- hover = hover || false;
458
 
459
  var left = $("#text_shadow_offset_left").val();
460
  var top = $("#text_shadow_offset_top").val();
461
- var width = $("#text_shadow_width").val();
462
-
463
  var color = $("#text_shadow_color").val();
464
  var hovcolor = $("#text_shadow_color_hover").val();
465
-
466
  var id = $(target).attr('id');
467
- var data = this.fields[id];
468
-
469
- data.css = 'textShadow';
470
-
471
- var value = left + 'px ' + top + 'px ' + width + 'px ' + color;
472
- this.putCSS(data, value, 'normal');
473
-
474
  value = left + 'px ' + top + 'px ' + width + 'px ' + hovcolor;
475
- this.putCSS(data, value, 'hover');
476
-
477
  }
478
-
479
  maxAdmin.prototype.updateAnchorText = function (target)
480
  {
481
  var preview_text = $('.output .result').find('a .mb-text');
482
 
483
- // This can happen when the text is removed, button is saved, so the preview doesn't load the text element.
484
- if (preview_text.length === 0)
485
- {
486
- $('.output .result').find('a').append('<span class="mb-text"></span>');
487
- $('.output .result').find('a .mb-text').css({'display':'block','line-height':'1em','box-sizing':'border-box'});
488
-
489
  this.repaint_preview();
490
  }
491
  $('.output .result').find('a .mb-text').text(target.val());
492
  }
493
-
494
  maxAdmin.prototype.updateGradientOpacity = function(target)
495
  {
496
  this.updateGradient(true);
@@ -499,68 +499,68 @@ maxAdmin.prototype.updateGradientOpacity = function(target)
499
 
500
  maxAdmin.prototype.updateDimension = function (target)
501
  {
502
- var dimension = $(target).val();
503
- var id = $(target).attr('id');
504
- var data = this.fields[id];
505
- if (dimension > 0)
506
  this.putCSS(data, dimension);
507
  else
508
- this.putCSS(data, 'auto');
509
  }
510
 
511
  maxAdmin.prototype.updateRadius = function(target)
512
  {
513
  var value = target.val();
514
- var fields = ['radius_bottom_left', 'radius_bottom_right', 'radius_top_left', 'radius_top_right'];
515
 
516
  if ( $('#radius_toggle').data('lock') == 'lock')
517
  {
518
  for(i=0; i < fields.length; i++)
519
  {
520
- var id = fields[i];
521
  $('#' + id).val(value);
522
  var data = this.fields[id];
523
  this.putCSS(data,value + 'px');
524
 
525
- }
526
-
527
  }
528
  }
529
 
530
- maxAdmin.prototype.toggleRadiusLock = function (event)
531
  {
532
- var target = $(event.target);
533
- var lock = $(target).data('lock');
534
  if (lock == 'lock')
535
- {
536
  $(target).removeClass('dashicons-lock').addClass('dashicons-unlock');
537
  $(target).data('lock', 'unlock');
538
  }
539
- else if (lock == 'unlock')
540
  {
541
  $(target).removeClass('dashicons-unlock').addClass('dashicons-lock');
542
- $(target).data('lock', 'lock');
543
  }
544
-
545
  }
546
 
547
 
548
  maxAdmin.prototype.initResponsive = function()
549
  {
550
 
551
- window.maxFoundry.maxadmin.responsive = new mbResponsive($);
552
- window.maxFoundry.maxadmin.responsive.init(this);
553
 
554
- }
555
 
556
 
557
  maxAdmin.prototype.do_paging = function(e)
558
  {
559
- var page = parseInt($(e.target).val());
560
 
561
  if (page <= parseInt($(e.target).attr('max')) )
562
  {
563
- var url = $(e.target).data("url");
564
  window.location = url + "&paged=" + page;
565
 
566
  }
@@ -572,100 +572,106 @@ maxAdmin.prototype.toggleShortcode = function (e)
572
  if ($('.shortcode-expand').hasClass('closed'))
573
  {
574
  $(' .mb-message.shortcode .expanded').css('display','inline-block');
575
- $('.shortcode-expand span').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up');
576
  $('.shortcode-expand').removeClass('closed').addClass('open');
577
  }
578
  else
579
  {
580
  $(' .mb-message.shortcode .expanded').css('display','none');
581
- $('.shortcode-expand span').addClass('dashicons-arrow-down').removeClass('dashicons-arrow-up');
582
- $('.shortcode-expand').addClass('closed').removeClass('open');
583
  }
584
-
585
  }
586
 
587
  maxAdmin.prototype.toggleManual = function (e)
588
  {
589
  e.preventDefault();
590
- var $target = $(e.target);
591
-
592
- var subject = $target.data("target");
593
- var $newWindow = $('.manual-entry[data-manual="' + subject + '"]');
594
-
595
- if ($newWindow.is(':visible'))
596
  {
597
- $newWindow.hide();
598
  return true;
599
  }
600
 
601
- var offset = $('[data-options="' + subject + '"]').position() ;
602
  // top + height to position under manual link.
603
  var top = offset.top + $target.height();
604
-
605
- $newWindow.css('top', top);
606
  $newWindow.css('right',15);
607
  $newWindow.css('left', 'auto');
608
-
609
  $newWindow.show();
610
  }
611
 
612
- maxAdmin.prototype.initConditionials = function ()
613
  {
614
- var mAP = this;
615
 
616
-
617
- $('[data-show]').each(function () {
618
  var condition = $(this).data('show');
619
- var target = condition.target;
620
- var values = condition.values;
621
- var self = this;
622
 
623
  $(document).on('change','[name="' + target + '"]', {child: this, values: values}, $.proxy(mAP.updateConditional, mAP) );
624
- $('[name="' + target + '"]').trigger('change');
 
 
 
 
 
 
 
 
 
 
625
 
626
- });
627
-
628
  $('[data-has]').each(function () {
629
- var condition = $(this).data('has');
630
- var target = condition.target;
631
- var values = condition.values;
632
- var self = this;
633
-
634
  $(document).on('change', '[name="' + target + '"]', {target: target, child: this, values: values}, $.proxy(mAP.updateHasConditional, mAP) );
635
-
636
- });
637
 
638
 
639
  }
640
 
641
  maxAdmin.prototype.updateConditional = function (event)
642
  {
643
- var data = event.data;
644
-
645
- var cond_values = data.values;
646
  var cond_child = data.child;
647
-
648
- var target = $(event.currentTarget);
649
- var value = $(target).val();
650
 
651
- // if type = checkbox: cond_value checked means it has to be 'checked' to show. Otherwise 'unchecked' go hide.
652
- if (target.attr('type') === 'checkbox')
 
 
 
653
  {
654
-
655
- var checked = $(target).prop('checked');
656
 
657
- if (cond_values == 'checked' && checked)
658
- value = 'checked';
 
 
659
  else if (cond_values == 'unchecked' && !checked)
660
- value = 'unchecked';
661
  else
662
- value = 0;
663
-
664
- }
665
 
666
  if (cond_values.indexOf(value) >= 0)
667
  {
668
-
669
  $(cond_child).fadeIn('fast');
670
  $(cond_child).find('input, select').trigger('change');
671
  }
@@ -676,31 +682,31 @@ maxAdmin.prototype.updateConditional = function (event)
676
  }
677
  }
678
 
679
- maxAdmin.prototype.updateHasConditional = function(event)
680
  {
681
 
682
  var mAP = this;
683
- var data = event.data;
684
-
685
- var cond_values = data.values;
686
  var cond_child = data.child;
687
-
688
  var target = data.target;
689
 
690
- var hascond = false;
691
 
692
- $('[name="' + target + '"]').each(function ()
693
  {
694
- var target_val = $(this).val();
695
 
696
- if (cond_values.indexOf(target_val) >= 0)
697
  {
698
- hascond = true;
699
  return true;
700
  }
701
- });
 
702
 
703
-
704
  if (hascond)
705
  {
706
  $(cond_child).fadeIn('fast');
@@ -709,26 +715,26 @@ maxAdmin.prototype.updateHasConditional = function(event)
709
  {
710
  $(cond_child).fadeOut('fast');
711
  }
712
-
713
  }
714
 
715
- maxAdmin.prototype.updateRange = function (event)
716
  {
717
- if (typeof event == 'undefined' || event === null )
718
  {
719
- var targets = $('input[type="range"]');
720
  }
721
- else
722
  {
723
- var targets = [event.target];
724
  }
725
-
726
- $(targets).each(function () {
727
- var value = $(this).val();
728
  $(this).parents('.input').find('.range_value output').val(value + '%');
729
-
730
- });
731
-
732
  }
733
 
734
  maxAdmin.prototype.saveIndicator = function(toggle)
@@ -742,89 +748,87 @@ maxAdmin.prototype.saveIndicator = function(toggle)
742
  // General AJAX form save
743
  maxAdmin.prototype.formAjaxSave = function (e)
744
  {
745
- e.preventDefault();
746
  var url = mb_ajax.ajaxurl;
747
- var form = $(e.target);
748
 
749
  var data = form.serialize();
750
 
751
-
752
  $.ajax({
753
  type: "POST",
754
  url: url,
755
  data: data,
756
-
757
  }).done($.proxy(this.saveDone, this));
758
  }
759
 
760
  /*
761
  maxAdmin.prototype.buttonSubmit = function (e)
762
- {
763
 
764
- e.preventDefault();
765
  $('[data-form]').prop('disabled', true);
766
- var formName = $(e.target).data('form');
767
  $('#' + formName).submit();
768
 
769
- }
770
  */
771
 
772
  maxAdmin.prototype.saveDone = function (res)
773
  {
774
  $('[data-form]').prop('disabled', false);
775
-
776
  var json = $.parseJSON(res);
777
-
778
  var result = json.result;
779
- var title = json.title;
 
 
 
780
 
781
-
782
- var collection_id = json.data.id;
783
-
784
  if (typeof json.data.new_nonce !== 'undefined')
785
  {
786
- var nonce = json.data.new_nonce;
787
  $('input[name="nonce"]').val(json.data.new_nonce);
788
  }
789
-
790
  if (result)
791
  {
792
  // if collection is new - add collection_id to the field
793
- $('input[name="collection_id"]').val(collection_id);
794
-
795
  // replace the location to the correct collection
796
- var href = window.location.href;
797
  if (href.indexOf('collection_id') === -1)
798
- window.history.replaceState({}, '', href + '&collection_id=' + collection_id);
799
-
800
  // trigger other updates if needed
801
  $(document).trigger('mbFormSaved');
802
-
803
  // update previous selection to current state;
804
  var order = $('input[name="sorted"]').val();
805
  $('input[name="previous_selection"]').val(order);
806
-
807
- // in case the interface needs to be reloaded.
808
  if (json.data.reload)
809
  {
810
  document.location.reload(true);
811
  }
812
-
813
  }
814
  if (! result)
815
  {
816
- $modal = window.maxFoundry.maxmodal;
817
  $modal.newModal('collection_error');
818
  $modal.setTitle(title);
819
  $modal.setContent(json.body);
820
-
821
- $modal.setControls('<button class="modal_close button-primary">' + json.close_text + '</button>');
822
- $modal.show();
823
 
824
  }
825
  }
826
 
827
 
828
  }); /* END OF JQUERY */
829
-
830
-
1
+
2
  var maxAdmin;
3
 
4
 
5
  jQuery(document).ready(function($) {
6
+
7
  maxAdmin = function ()
8
  {
9
  // $ = jquery;
13
  //initialized: false,
14
  colorUpdateTime: true,
15
  fields: null,
16
+ button_id: null,
17
  form_updated: false,
18
  tabs: null,
19
+
20
+
21
  }; // MaxAdmin
22
 
23
  maxAdmin.prototype.init = function () {
24
+ this.button_id = $('input[name="button_id"]').val();
25
+
26
+ // Prevents the output button from being clickable (also in admin list view )
27
+ $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); });
28
+ $(document).on('click', '.output .preview-toggle', $.proxy(this.toggle_preview, this));
29
 
30
  // overview input paging
31
  $('#maxbuttons .input-paging').on('change', $.proxy(this.do_paging, this));
32
+
33
+ $('.manual-toggle').on('click', $.proxy(this.toggleManual, this));
34
+ $('.manual-entry').draggable({
35
  cancel: 'p, li',
36
+ });
37
 
38
+ $(document).on('submit', 'form.mb_ajax_save', $.proxy(this.formAjaxSave, this));
39
 
40
+ // copy / delete / trash action buttons via ajax
41
+ $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
42
+
43
+ // conditionals
44
  $(document).on('reInitConditionals', $.proxy(this.initConditionials, this));
45
  this.initConditionials(); // conditional options
46
+
47
+ // range inputs
48
+ $(document).on('change, input', 'input[type="range"]', $.proxy(this.updateRange, this ));
49
+ this.updateRange(null);
50
+
51
  /*
52
  ****
53
+ ### After this only init for button main edit screen
54
  ****
55
 
56
  */
57
+ if ($('#new-button-form').length == 0)
58
+ return;
59
+
60
 
 
61
  if (this.button_id > 0) {
62
  $("#maxbuttons .mb-message").show();
63
+ }
64
+
65
+ this.initResponsive(); // responsive edit interface
66
+
67
+ $("#maxbuttons .output").draggable({
68
  cancel: '.nodrag',
69
+ });
70
+
71
  $('#maxbuttons .color-field').wpColorPicker(
72
+ {
73
  width: 300,
74
 
75
  change: $.proxy( _.throttle(function(event, ui) {
76
  event.preventDefault();
77
  var color = ui.color.toString();
78
+ this.update_color(event,ui, color);
79
+ }, 200), this),
80
+
81
  }
82
+ );
83
+
84
+ /* Copy Color Interface */
85
+ $('.input.mbcolor .arrows').on('click', $.proxy(this.copyColor, this) );
86
+
87
+ $('#radius_toggle').on('click', $.proxy(this.toggleRadiusLock,this));
88
 
 
 
 
 
 
89
  if ( typeof buttonFieldMap != 'undefined')
90
  this.fields = $.parseJSON(buttonFieldMap);
91
+
92
+ // bind to all inputs, except for color-field or items with different handler.
93
+ $('input').not('.color-field').on('keyup change', $.proxy(this.update_preview,this));
94
+ $('input.color-field').on('focus', $.proxy(this.select_field, this));
95
+
96
+ $('select').on('change', $.proxy(this.update_preview, this));
97
 
98
  $(window).on('beforeunload', $.proxy(function () { if (this.form_updated) return maxcol_wp.leave_page; }, this));
99
  $(document).on('keyup', 'input', function (e) {
100
 
101
+ if (e.keyCode && e.keyCode == 13)
102
  {
103
  $(":input")[$(":input").index(document.activeElement) + 1].focus();
104
  return false;
105
  }
106
  });
107
+
108
+ $(".button-save").click( $.proxy(function() {
109
+ this.saveIndicator(false); // prevent alert when saving.
110
  $("#new-button-form").submit();
111
  return false;
112
  }, this) );
 
 
 
113
 
114
+ // Expand shortcode tabs for more examples.
115
+ $('.shortcode-expand').on('click', this.toggleShortcode);
116
+
117
+
118
  }; // INIT
119
 
120
+
121
+ maxAdmin.prototype.repaint_preview = function ()
122
  {
123
  $('.mb_tab input[type="text"]').trigger('change');
124
+ $('.mb_tab input[type="number"]').trigger('change');
125
+ $('.mb_tab select').trigger('change');
126
+ $('.mb_tab input[type="hidden"]').trigger('change');
127
+ $('.mb_tab input[type="radio"]:checked').trigger('change');
128
+ $('.mb_tab input[type="checkbox"]:checked').trigger('change');
129
+
130
  //$(document).trigger('colorUpdate', ['#text_color', $('#text_color').val() ]);
131
+ //$(document).trigger('colorUpdate', ['#text_color_hover', $('#text_color_hover').val() ]);
132
+
133
  }
134
+
135
+ maxAdmin.prototype.update_preview = function(e)
136
  {
137
  e.preventDefault();
138
+ this.saveIndicator(true);
139
+ var target = $(e.target);
140
+
141
+ // migration to data field
142
+ var field = $(target).data('field');
143
  if (typeof field == 'undefined')
144
  var id = $(target).attr('id'); // this should change to be ready for the option to have two the same fields on multi locations.
145
  else
146
  var id = field;
147
 
148
+ var data = this.fields[id];
149
 
150
+ if (typeof data == 'undefined')
151
+ return; // field doesn't have updates
152
 
153
+ if (typeof data.css != 'undefined')
154
  {
155
+ value = target.val();
156
 
157
+ if (typeof data.css_unit != 'undefined' && value.indexOf(data.css_unit) == -1)
158
  value += data.css_unit;
159
+
160
+ // a target that is checkbox but not checked should unset (empty) value.
161
+ if (target.is(':checkbox') && ! target.is(':checked') )
162
+ value = '';
163
 
164
  this.putCSS(data, value);
165
  }
166
+ if (typeof data.attr != 'undefined')
167
  {
168
  $('.output .result').find('a').attr(data.attr, target.val());
169
  }
176
 
177
  maxAdmin.prototype.select_field = function(e)
178
  {
179
+ $(e.target).select();
180
+ }
181
 
182
  maxAdmin.prototype.button_action = function(e)
183
  {
184
+ e.preventDefault();
185
+ var action = $(e.target).data('buttonaction');
186
+
187
+ this.form_updated = false;
188
+
189
+ var button_id = $(e.target).data('buttonid');
190
+ var nonce = $('input[name="' + action + '_nonce"]').val();
191
+
192
  var url = mb_ajax.ajaxurl;
193
+ var data =
194
  {
195
  action: 'mb_button_action',
196
+ button_action: action,
197
+ button_id: button_id,
198
+ nonce: nonce,
199
 
200
  };
201
 
202
  $.post({
203
+ url: url,
204
+ data: data,
205
  success: function (data) {
206
  response = JSON.parse(data);
207
+
208
+ if (typeof response.redirection != 'undefined')
209
  {
210
+ window.location = response.redirection;
211
  }
212
+ },
213
  error: function () {
214
  console.log('error in button action' + action);
215
  },
216
  });
217
  }
218
 
219
+ /* Check the copy modal and display a warning if the button has been changes */
220
  maxAdmin.prototype.checkCopyModal = function(modal)
221
  {
222
  if (this.form_updated)
223
  {
224
  modal.currentModal.find('.mb-message').show();
225
+
226
+ }
227
  else
228
  $(modal.currentModal).find('.mb-message').hide();
229
  }
230
+
231
  maxAdmin.prototype.toggle_preview = function (e)
232
  {
233
  if ( $('.output .inner').is(':hidden') )
234
  {
235
+ $('.output .inner').show();
236
+ $('.output').css('height', 'auto');
237
+ $('.preview .preview-toggle').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up');
238
  }
239
  else
240
  {
241
+ $('.output .inner').hide();
242
+ $('.output').css('height', 'auto');
243
  $('.preview .preview-toggle').removeClass('dashicons-arrow-up').addClass('dashicons-arrow-down');
244
  }
245
+ };
246
 
247
+
248
+ maxAdmin.prototype.putCSS = function(data,value,state)
249
  {
250
  state = state || 'both';
251
 
252
+ var element = '.maxbutton';
253
+ if (state == 'hover')
254
+ element = 'a.hover ';
255
+ else if(state == 'normal')
256
+ element = 'a.normal ';
257
+
258
+ if (typeof data.csspart != 'undefined')
259
  {
260
  var parts = data.csspart.split(",");
261
  for(i=0; i < parts.length; i++)
262
  {
263
+ var cpart = parts[i];
264
  var fullpart = element + " ." + cpart;
265
+ $('.output .result').find(fullpart).css(data.css, value);
266
  }
267
  }
268
  else
269
+ $('.output .result').find(element).css(data.css, value);
270
  }
271
 
272
  maxAdmin.prototype.update_color = function(event, ui, color)
273
  {
274
  event.preventDefault();
275
+ this.saveIndicator(true);
276
 
277
  var target = $(event.target);
278
+ //var color = target.val();
279
+
280
  if (color.indexOf('#') === -1)
281
+ color = '#' + color;
282
+
283
+ var id = target.attr('id');
284
  $('#' + id).val(color); // otherwise field value is running 1 click behind.
285
 
286
+
287
  if(id.indexOf('box_shadow') !== -1)
288
  {
289
+ this.updateBoxShadow(target);
290
  }
291
  else if(id.indexOf('text_shadow') !== -1)
292
  {
293
+ this.updateTextShadow(target);
294
+ }
295
  else if (id.indexOf('gradient') !== -1)
296
  {
297
  if (id.indexOf('hover') == -1)
298
  this.updateGradient();
299
  else
300
+ this.updateGradient(true);
301
  }
302
  else if (id == 'button_preview')
303
  {
304
+ $(".output .result").css('backgroundColor', color);
305
  }
306
  else // simple update
307
  {
308
 
309
  if (id.indexOf('hover') == -1)
310
+ {
311
  state = 'normal';
312
  }
313
  else
314
  {
315
+ state = 'hover';
316
  }
 
 
317
 
318
+ var data = this.fields[id];
319
+
320
+ this.putCSS(data, color, state);
321
  return;
322
  }
323
+
324
 
325
  };
326
+
327
  maxAdmin.prototype.copyColor = function (e)
328
  {
329
  e.preventDefault();
330
  e.stopPropagation(); // stop the color picker from closing itself.
331
+
332
+ var target = $(e.target);
333
+ var bindto = $(e.target).parents('[data-bind]');
334
  var fieldId = '#' + bindto.data('id'); // Field which is used
335
  var bindId = '#' + bindto.data('bind'); // Field is bound to.
336
+
337
  // check which arrow was pressed
338
  if (target.hasClass('arrow-right'))
339
+ var arrow_click = 'right';
340
  else
341
  var arrow_click = 'left';
342
+
343
  // check on which side the interface is. If arrows are on right side, it's the left side (...)
344
  if (bindto.hasClass('right') )
345
+ var if_side = 'left';
346
  else
347
+ var if_side = 'right';
348
+
349
+ /* Decide which color to replace. If interface is left - then right click is copy to other element, but if interface is right, right is overwrite current element.
350
+ Left : right click - copy, left replace.
351
+ Right : right click - replace, left copy.
352
  */
353
+ if (if_side == 'left')
354
  {
355
+ if (arrow_click == 'right')
356
  copy = true;
357
  else
358
  copy = false;
359
  }
360
+ else if (if_side == 'right')
361
  {
362
+ if (arrow_click == 'right')
363
  copy = false;
364
  else
365
  copy = true;
367
 
368
  if ( copy )
369
  {
370
+ $(bindId).val( $(fieldId).val() );
371
  $(bindId).trigger('change');
372
+ $(bindId).wpColorPicker('color', $(fieldId).val());
373
  }
374
  else
375
  {
376
+ $(fieldId).val( $(bindId).val() );
377
  $(fieldId).trigger('change');
378
+ $(fieldId).wpColorPicker('color', $(bindId).val());
379
  }
380
+
381
  }
382
+
383
  maxAdmin.prototype.updateGradient = function(hover)
384
  {
385
  hover = hover || false;
386
+
387
+ var hovtarget = '';
388
  if (hover)
389
+ hovtarget = "_hover";
390
+
391
+ var stop = parseInt($('#gradient_stop').val());
392
 
393
  if (isNaN(stop) )
394
  stop = 45;
395
+
396
+ var gradients_on = $('#use_gradient').prop('checked');
397
+
398
  var start = this.hexToRgb($('#gradient_start_color' + hovtarget).val());
399
  var end = this.hexToRgb($('#gradient_end_color' + hovtarget).val());
400
  var startop = parseInt($('#gradient_start_opacity' + hovtarget).val());
401
  var endop = parseInt($('#gradient_end_opacity' + hovtarget).val());
402
+
403
  if (! gradients_on)
404
  {
405
+ end = start;
406
+ endop = startop;
407
  }
408
+
409
+ if(isNaN(startop)) startop = 100;
410
  if(isNaN(endop)) endop = 100;
411
+
412
  if (!hover)
413
+ var button = $('.output .result').find('a.normal');
414
  else
415
  var button = $('.output .result').find('a.hover');
416
 
417
 
418
+
419
+
420
+ button.css("background", "linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
421
+ button.css("background", "-moz-linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
422
+ button.css("background", "-o-linear-gradient( rgba(" + start + "," + (startop/100) + ") " + stop + "%," + " rgba(" + end + "," + (endop/100) + ") )");
423
+ button.css("background", "-webkit-gradient(linear, left top, left bottom, color-stop(" +stop+ "%, rgba(" + start + "," + (startop/100) + ")), color-stop(1, rgba(" + end + "," + (endop/100) + ") ));");
424
+
425
+
426
  }
427
+
428
  maxAdmin.prototype.hexToRgb = function(hex) {
429
+
430
  hex = hex.replace('#','');
431
  var bigint = parseInt(hex, 16);
432
  var r = (bigint >> 16) & 255;
433
  var g = (bigint >> 8) & 255;
434
  var b = bigint & 255;
435
+
436
  return r + "," + g + "," + b;
437
  }
438
+
439
  maxAdmin.prototype.updateBoxShadow = function (target)
440
  {
441
  target = target || null;
442
 
443
  var left = $("#box_shadow_offset_left").val();
444
  var top = $("#box_shadow_offset_top").val();
445
+ var width = $("#box_shadow_width").val();
446
+ var spread = $('#box_shadow_spread').val();
447
+
448
  var color = $("#box_shadow_color").val();
449
  var hovcolor = $("#box_shadow_color_hover").val();
450
+
451
+ $('.output .result').find('a.normal').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + color);
452
+ $('.output .result').find('a.hover').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + hovcolor);
453
  }
454
+
455
  maxAdmin.prototype.updateTextShadow = function(target,hover)
456
  {
457
+ hover = hover || false;
458
 
459
  var left = $("#text_shadow_offset_left").val();
460
  var top = $("#text_shadow_offset_top").val();
461
+ var width = $("#text_shadow_width").val();
462
+
463
  var color = $("#text_shadow_color").val();
464
  var hovcolor = $("#text_shadow_color_hover").val();
465
+
466
  var id = $(target).attr('id');
467
+ var data = this.fields[id];
468
+
469
+ data.css = 'textShadow';
470
+
471
+ var value = left + 'px ' + top + 'px ' + width + 'px ' + color;
472
+ this.putCSS(data, value, 'normal');
473
+
474
  value = left + 'px ' + top + 'px ' + width + 'px ' + hovcolor;
475
+ this.putCSS(data, value, 'hover');
476
+
477
  }
478
+
479
  maxAdmin.prototype.updateAnchorText = function (target)
480
  {
481
  var preview_text = $('.output .result').find('a .mb-text');
482
 
483
+ // This can happen when the text is removed, button is saved, so the preview doesn't load the text element.
484
+ if (preview_text.length === 0)
485
+ {
486
+ $('.output .result').find('a').append('<span class="mb-text"></span>');
487
+ $('.output .result').find('a .mb-text').css({'display':'block','line-height':'1em','box-sizing':'border-box'});
488
+
489
  this.repaint_preview();
490
  }
491
  $('.output .result').find('a .mb-text').text(target.val());
492
  }
493
+
494
  maxAdmin.prototype.updateGradientOpacity = function(target)
495
  {
496
  this.updateGradient(true);
499
 
500
  maxAdmin.prototype.updateDimension = function (target)
501
  {
502
+ var dimension = $(target).val();
503
+ var id = $(target).attr('id');
504
+ var data = this.fields[id];
505
+ if (dimension > 0)
506
  this.putCSS(data, dimension);
507
  else
508
+ this.putCSS(data, 'auto');
509
  }
510
 
511
  maxAdmin.prototype.updateRadius = function(target)
512
  {
513
  var value = target.val();
514
+ var fields = ['radius_bottom_left', 'radius_bottom_right', 'radius_top_left', 'radius_top_right'];
515
 
516
  if ( $('#radius_toggle').data('lock') == 'lock')
517
  {
518
  for(i=0; i < fields.length; i++)
519
  {
520
+ var id = fields[i];
521
  $('#' + id).val(value);
522
  var data = this.fields[id];
523
  this.putCSS(data,value + 'px');
524
 
525
+ }
526
+
527
  }
528
  }
529
 
530
+ maxAdmin.prototype.toggleRadiusLock = function (event)
531
  {
532
+ var target = $(event.target);
533
+ var lock = $(target).data('lock');
534
  if (lock == 'lock')
535
+ {
536
  $(target).removeClass('dashicons-lock').addClass('dashicons-unlock');
537
  $(target).data('lock', 'unlock');
538
  }
539
+ else if (lock == 'unlock')
540
  {
541
  $(target).removeClass('dashicons-unlock').addClass('dashicons-lock');
542
+ $(target).data('lock', 'lock');
543
  }
544
+
545
  }
546
 
547
 
548
  maxAdmin.prototype.initResponsive = function()
549
  {
550
 
551
+ window.maxFoundry.maxadmin.responsive = new mbResponsive($);
552
+ window.maxFoundry.maxadmin.responsive.init(this);
553
 
554
+ }
555
 
556
 
557
  maxAdmin.prototype.do_paging = function(e)
558
  {
559
+ var page = parseInt($(e.target).val());
560
 
561
  if (page <= parseInt($(e.target).attr('max')) )
562
  {
563
+ var url = $(e.target).data("url");
564
  window.location = url + "&paged=" + page;
565
 
566
  }
572
  if ($('.shortcode-expand').hasClass('closed'))
573
  {
574
  $(' .mb-message.shortcode .expanded').css('display','inline-block');
575
+ $('.shortcode-expand span').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up');
576
  $('.shortcode-expand').removeClass('closed').addClass('open');
577
  }
578
  else
579
  {
580
  $(' .mb-message.shortcode .expanded').css('display','none');
581
+ $('.shortcode-expand span').addClass('dashicons-arrow-down').removeClass('dashicons-arrow-up');
582
+ $('.shortcode-expand').addClass('closed').removeClass('open');
583
  }
584
+
585
  }
586
 
587
  maxAdmin.prototype.toggleManual = function (e)
588
  {
589
  e.preventDefault();
590
+ var $target = $(e.target);
591
+
592
+ var subject = $target.data("target");
593
+ var $newWindow = $('.manual-entry[data-manual="' + subject + '"]');
594
+
595
+ if ($newWindow.is(':visible'))
596
  {
597
+ $newWindow.hide();
598
  return true;
599
  }
600
 
601
+ var offset = $('[data-options="' + subject + '"]').position() ;
602
  // top + height to position under manual link.
603
  var top = offset.top + $target.height();
604
+
605
+ $newWindow.css('top', top);
606
  $newWindow.css('right',15);
607
  $newWindow.css('left', 'auto');
608
+
609
  $newWindow.show();
610
  }
611
 
612
+ maxAdmin.prototype.initConditionials = function ()
613
  {
614
+ var mAP = this;
615
 
616
+ $('[data-show]').each(function () {
 
617
  var condition = $(this).data('show');
618
+ var target = condition.target;
619
+ var values = condition.values;
620
+ var self = this;
621
 
622
  $(document).on('change','[name="' + target + '"]', {child: this, values: values}, $.proxy(mAP.updateConditional, mAP) );
623
+ if ( $('[name="' + target + '"]').length > 1) // trigger change to test condition
624
+ {
625
+ // this statement doesn't work in MBPRO for some reason
626
+ // $('[name="' + target + '"]:checked').trigger('change', ['conditional']); // radio button
627
+ $('[name="' + target + '"]:checked').change(); // radio button
628
+
629
+ }
630
+ else {
631
+ $('[name="' + target + '"]').trigger('change', ['conditional']);
632
+ }
633
+ });
634
 
 
 
635
  $('[data-has]').each(function () {
636
+ var condition = $(this).data('has');
637
+ var target = condition.target;
638
+ var values = condition.values;
639
+ var self = this;
640
+
641
  $(document).on('change', '[name="' + target + '"]', {target: target, child: this, values: values}, $.proxy(mAP.updateHasConditional, mAP) );
642
+
643
+ });
644
 
645
 
646
  }
647
 
648
  maxAdmin.prototype.updateConditional = function (event)
649
  {
650
+ var data = event.data;
651
+ var cond_values = data.values;
 
652
  var cond_child = data.child;
 
 
 
653
 
654
+ var target = $(event.currentTarget);
655
+ var value = $(target).val();
656
+
657
+ // if type = checkbox: cond_value checked means it has to be 'checked' to show. Otherwise 'unchecked' go hide.
658
+ if (target.attr('type') === 'checkbox')
659
  {
 
 
660
 
661
+ var checked = $(target).prop('checked');
662
+
663
+ if (cond_values == 'checked' && checked)
664
+ value = 'checked';
665
  else if (cond_values == 'unchecked' && !checked)
666
+ value = 'unchecked';
667
  else
668
+ value = 0;
669
+
670
+ }
671
 
672
  if (cond_values.indexOf(value) >= 0)
673
  {
674
+
675
  $(cond_child).fadeIn('fast');
676
  $(cond_child).find('input, select').trigger('change');
677
  }
682
  }
683
  }
684
 
685
+ maxAdmin.prototype.updateHasConditional = function(event)
686
  {
687
 
688
  var mAP = this;
689
+ var data = event.data;
690
+
691
+ var cond_values = data.values;
692
  var cond_child = data.child;
693
+
694
  var target = data.target;
695
 
696
+ var hascond = false;
697
 
698
+ $('[name="' + target + '"]').each(function ()
699
  {
700
+ var target_val = $(this).val();
701
 
702
+ if (cond_values.indexOf(target_val) >= 0)
703
  {
704
+ hascond = true;
705
  return true;
706
  }
707
+ });
708
+
709
 
 
710
  if (hascond)
711
  {
712
  $(cond_child).fadeIn('fast');
715
  {
716
  $(cond_child).fadeOut('fast');
717
  }
718
+
719
  }
720
 
721
+ maxAdmin.prototype.updateRange = function (event)
722
  {
723
+ if (typeof event == 'undefined' || event === null )
724
  {
725
+ var targets = $('input[type="range"]');
726
  }
727
+ else
728
  {
729
+ var targets = [event.target];
730
  }
731
+
732
+ $(targets).each(function () {
733
+ var value = $(this).val();
734
  $(this).parents('.input').find('.range_value output').val(value + '%');
735
+
736
+ });
737
+
738
  }
739
 
740
  maxAdmin.prototype.saveIndicator = function(toggle)
748
  // General AJAX form save
749
  maxAdmin.prototype.formAjaxSave = function (e)
750
  {
751
+ e.preventDefault();
752
  var url = mb_ajax.ajaxurl;
753
+ var form = $(e.target);
754
 
755
  var data = form.serialize();
756
 
757
+
758
  $.ajax({
759
  type: "POST",
760
  url: url,
761
  data: data,
762
+
763
  }).done($.proxy(this.saveDone, this));
764
  }
765
 
766
  /*
767
  maxAdmin.prototype.buttonSubmit = function (e)
768
+ {
769
 
770
+ e.preventDefault();
771
  $('[data-form]').prop('disabled', true);
772
+ var formName = $(e.target).data('form');
773
  $('#' + formName).submit();
774
 
775
+ }
776
  */
777
 
778
  maxAdmin.prototype.saveDone = function (res)
779
  {
780
  $('[data-form]').prop('disabled', false);
781
+
782
  var json = $.parseJSON(res);
783
+
784
  var result = json.result;
785
+ var title = json.title;
786
+
787
+
788
+ var collection_id = json.data.id;
789
 
 
 
 
790
  if (typeof json.data.new_nonce !== 'undefined')
791
  {
792
+ var nonce = json.data.new_nonce;
793
  $('input[name="nonce"]').val(json.data.new_nonce);
794
  }
795
+
796
  if (result)
797
  {
798
  // if collection is new - add collection_id to the field
799
+ $('input[name="collection_id"]').val(collection_id);
800
+
801
  // replace the location to the correct collection
802
+ var href = window.location.href;
803
  if (href.indexOf('collection_id') === -1)
804
+ window.history.replaceState({}, '', href + '&collection_id=' + collection_id);
805
+
806
  // trigger other updates if needed
807
  $(document).trigger('mbFormSaved');
808
+
809
  // update previous selection to current state;
810
  var order = $('input[name="sorted"]').val();
811
  $('input[name="previous_selection"]').val(order);
812
+
813
+ // in case the interface needs to be reloaded.
814
  if (json.data.reload)
815
  {
816
  document.location.reload(true);
817
  }
818
+
819
  }
820
  if (! result)
821
  {
822
+ $modal = window.maxFoundry.maxmodal;
823
  $modal.newModal('collection_error');
824
  $modal.setTitle(title);
825
  $modal.setContent(json.body);
826
+
827
+ $modal.setControls('<button class="modal_close button-primary">' + json.close_text + '</button>');
828
+ $modal.show();
829
 
830
  }
831
  }
832
 
833
 
834
  }); /* END OF JQUERY */
 
 
js/maxmodal.js CHANGED
@@ -3,303 +3,307 @@ var maxModal;
3
 
4
  jQuery(document).ready(function($) {
5
  maxModal = function () {
6
-
7
  }
8
-
9
- maxModal.prototype = {
10
- currentModal: null,
11
  modals: [],
12
- controls: [],
13
  parent: '#maxbuttons', // modal will be written to this element.
14
- multiple: false,
15
  windowHeight: false,
16
  windowWidth: false,
17
  setWidth: false,
18
- setHeight: false,
19
  target: false,
 
20
  }
21
-
22
- maxModal.prototype.init = function()
23
  {
24
 
25
- this.windowHeight = $(window).height();
26
- this.windowWidth = $(window).width();
27
-
28
  $(document).on('click', '.maxmodal', $.proxy(this.buildModal, this));
29
- $(window).on('resize', $.proxy(this.checkResize, this));
30
-
31
  }
32
 
33
  maxModal.prototype.focus = function()
34
  {
35
- this.currentModal.show();
36
-
37
  }
38
-
39
- maxModal.prototype.get = function()
40
  {
41
  return this.currentModal;
42
  }
43
-
44
-
45
- maxModal.prototype.show = function()
46
  {
47
- $('.maxmodal_overlay').remove();
48
- this.writeOverlay();
49
-
 
50
  if (this.setWidth)
51
  {
52
- this.currentModal.width(this.setWidth);
53
  }
54
- if (this.setHeight)
55
  {
56
  this.currentModal.height(this.setHeight);
57
  }
58
-
59
- var modalHeight = this.currentModal.height();
60
- var modalWidth = this.currentModal.width();
61
-
62
- var top = (this.windowHeight - modalHeight) / 2;
63
- var left = (this.windowWidth - modalWidth) / 2;
64
-
65
- if (top < 30)
66
- {
67
  top = 30; // top + admin bar
68
  }
69
- if (left < 0)
70
  {
71
  left: 0;
72
  }
73
-
74
  if (modalHeight > this.windowHeight)
75
  this.currentModal.height(this.windowHeight - top - 5 + 'px');
76
 
77
- this.currentModal.css('left', left + 'px');
78
- this.currentModal.css('top', top + 'px');
79
  this.currentModal.css('height', modalHeight);
80
-
81
- this.currentModal.show();
82
-
83
- $('.maxmodal_overlay').show();
84
-
85
- $(document).off('keydown', $.proxy(this.keyPressHandler, this));
86
- $(document).on('keydown', $.proxy(this.keyPressHandler, this));
 
 
 
87
  }
88
-
89
- maxModal.prototype.keyPressHandler = function (e)
90
  {
91
- if (e.keyCode === 27)
92
- this.close();
93
  }
94
-
95
- maxModal.prototype.checkResize = function ()
96
  {
97
- this.windowHeight = $(window).height();
98
- this.windowWidth = $(window).width();
99
 
100
  if (this.currentModal === null)
101
  return;
102
-
103
- this.currentModal.removeAttr('style');
104
- this.currentModal.find('.modal_content').removeAttr('style');
105
- // redo sizes, repaint.
106
-
107
- this.show();
108
  }
109
-
110
- maxModal.prototype.close = function()
111
  {
112
- this.currentModal.trigger('modal_close', [this]);
113
- this.currentModal.remove();
114
  this.currentModal = null;
115
- $('.maxmodal_overlay').remove();
116
- $(document).off('keydown', $.proxy(this.keyPressHandler, this));
117
-
 
118
  }
119
-
120
- maxModal.prototype.fadeOut = function (timeOut)
121
  {
122
- if (typeof timeOut == undefined)
123
  timeOut = 600;
124
-
125
  var self = this;
126
  this.currentModal.fadeOut(timeOut, function() { self.close(); } );
127
-
128
  }
129
-
130
- maxModal.prototype.setTitle = function(title)
131
  {
132
- this.currentModal.find('.modal_title').text(title);
133
  }
134
-
135
- maxModal.prototype.setControls = function(controls)
136
  {
137
- var content = this.currentModal.find('.modal_content');
138
  var controldiv = $('<div class="controls">');
139
 
140
- for(i =0; i < this.controls.length; i++)
141
- controldiv.append(this.controls[i]);
142
-
143
  if (typeof controls !== 'undefined')
144
- controldiv.append(controls);
145
 
146
- content.append(controldiv);
147
 
148
  // general close button
149
  $(this.currentModal).find('.modal_close').off('click');
150
- $(this.currentModal).find('.modal_close').on('click', $.proxy(this.close, this));
151
  }
152
-
153
- maxModal.prototype.addControl = function (type, data, handler)
154
  {
155
- var text = '';
156
-
157
  switch(type)
158
  {
159
- case 'yes':
160
  text = modaltext.yes;
161
  break;
162
- case 'ok':
163
  text = modaltext.ok;
164
  break;
165
- case 'no':
166
  text = modaltext.no;
167
  break;
168
  case 'cancel':
169
  text = modaltext.cancel;
170
  break;
171
- case 'insert':
172
  text = mbtrans.insert; // used for mediabutton
173
  break;
174
  }
175
-
176
- var control = $('<a class="button-primary ' + type + '">' + text + '</a>');
177
- control.on('click', data, handler );
178
  this.controls.push(control);
179
-
180
  }
181
-
182
-
183
  /* Set the modal content
184
-
185
- Sets the content of the modal. Do not run this function after adding controls.
186
- @param string HTML,text content of the modal
187
  */
188
- maxModal.prototype.setContent = function(content)
189
  {
190
- this.currentModal.find('.modal_content').html(content);
191
  }
192
-
193
- /* Builds modal from hidden data
194
-
195
  Builds modal from an formatted data object in DOM. Triggered on Click
196
-
197
  */
198
- maxModal.prototype.buildModal = function(e)
199
  {
200
- e.preventDefault();
201
-
202
- var target = $(e.target);
203
- if (typeof target.data('modal') == 'undefined')
204
- target = target.parents('.maxmodal');
205
-
206
- this.target = target;
207
- var id = target.data('modal');
208
  var data = $('#' + id);
209
 
210
  // options
211
- if (typeof data.data('width') !== 'undefined')
212
- this.setWidth = data.data('width');
213
  else
214
- this.setWidth = false;
215
-
216
- if (typeof data.data('height') !== 'undefined')
217
- this.setHeight = data.data('height');
218
  else
219
- this.setHeight = false;
 
220
 
221
-
222
- var title = $(data).find('.title').text();
223
- var controls = $(data).find('.controls').html();
224
- var content = $(data).find('.content').html();
225
 
226
  this.newModal(id);
227
  this.setTitle(title)
228
  this.setContent(content);
229
  this.setControls(controls);
230
 
231
-
232
- // callback on init
233
- if (typeof $(data).data('load') !== 'undefined')
234
- {
235
 
236
  // default call
237
- var funcName = data.data('load') + '(modal)';
238
  var callFunc = new Function ('modal', funcName);
239
-
240
 
241
  /* Args coming!
242
- if (typeof(data.data('load-args') !== 'undefined')
243
  {
244
- var args = data.data('load-args').split(',');
245
-
246
  for(i=0; i< args.length; i++)
247
  {
248
-
249
  }
250
  }
251
  */
252
-
253
  try
254
  {
255
  callFunc(this);
256
  }
257
  catch(err)
258
  {
259
-
260
  console.log('MB Modal Callback Error: ' + err.message);
261
  console.log('MB Mobdal tried calling: ' + funcName);
262
  }
263
  }
264
-
265
  this.show();
266
  }
267
 
268
- maxModal.prototype.newModal = function(id)
269
  {
270
-
271
- if (this.currentModal !== null)
272
- this.close();
273
-
274
  var modal = $('<div class="max-modal ' + id + '" > \
275
  <div class="modal_header"> \
276
  <div class="modal_close dashicons dashicons-no"></div><h3 class="modal_title"></h3> \
277
  </div> \
278
  <div class="inner modal_content"></div>\
279
- </div>');
280
- if ($(this.parent).length > 0)
281
- $(this.parent).append(modal);
282
  else
283
- $('body').append(modal); // fallback in case of interrupting page builders
284
-
285
  $(modal).draggable({
286
  handle: '.modal_header'
287
- });
288
 
289
- this.modals.push(modal);
290
  this.currentModal = modal;
291
- this.controls = [];
292
- return this;
293
-
294
  }
295
-
296
- maxModal.prototype.writeOverlay = function()
297
  {
298
-
299
- $(this.parent).append('<div class="maxmodal_overlay"></div>');
300
- $('.maxmodal_overlay').on('click', $.proxy(this.close, this));
301
-
302
- }
303
 
304
- });
 
 
 
305
 
 
3
 
4
  jQuery(document).ready(function($) {
5
  maxModal = function () {
6
+
7
  }
8
+
9
+ maxModal.prototype = {
10
+ currentModal: null,
11
  modals: [],
12
+ controls: [],
13
  parent: '#maxbuttons', // modal will be written to this element.
14
+ multiple: false,
15
  windowHeight: false,
16
  windowWidth: false,
17
  setWidth: false,
18
+ setHeight: false,
19
  target: false,
20
+
21
  }
22
+
23
+ maxModal.prototype.init = function()
24
  {
25
 
26
+ this.windowHeight = $(window).height();
27
+ this.windowWidth = $(window).width();
28
+
29
  $(document).on('click', '.maxmodal', $.proxy(this.buildModal, this));
30
+ $(window).on('resize', $.proxy(this.checkResize, this));
31
+
32
  }
33
 
34
  maxModal.prototype.focus = function()
35
  {
36
+ this.currentModal.show();
37
+
38
  }
39
+
40
+ maxModal.prototype.get = function()
41
  {
42
  return this.currentModal;
43
  }
44
+
45
+
46
+ maxModal.prototype.show = function()
47
  {
48
+ $('.maxmodal_overlay').remove();
49
+ $('body').removeClass('max-modal-active');
50
+ this.writeOverlay();
51
+
52
  if (this.setWidth)
53
  {
54
+ this.currentModal.width(this.setWidth);
55
  }
56
+ if (this.setHeight)
57
  {
58
  this.currentModal.height(this.setHeight);
59
  }
60
+
61
+ var modalHeight = this.currentModal.height();
62
+ var modalWidth = this.currentModal.width();
63
+
64
+ var top = (this.windowHeight - modalHeight) / 2;
65
+ var left = (this.windowWidth - modalWidth) / 2;
66
+
67
+ if (top < 30)
68
+ {
69
  top = 30; // top + admin bar
70
  }
71
+ if (left < 0)
72
  {
73
  left: 0;
74
  }
75
+
76
  if (modalHeight > this.windowHeight)
77
  this.currentModal.height(this.windowHeight - top - 5 + 'px');
78
 
79
+ this.currentModal.css('left', left + 'px');
80
+ this.currentModal.css('top', top + 'px');
81
  this.currentModal.css('height', modalHeight);
82
+
83
+ this.currentModal.show();
84
+
85
+ $('.maxmodal_overlay').show();
86
+ $('body').addClass('max-modal-active');
87
+
88
+ $(document).off('keydown', $.proxy(this.keyPressHandler, this));
89
+ $(document).on('keydown', $.proxy(this.keyPressHandler, this));
90
+
91
+ this.currentModal.focus();
92
  }
93
+
94
+ maxModal.prototype.keyPressHandler = function (e)
95
  {
96
+ if (e.keyCode === 27)
97
+ this.close();
98
  }
99
+
100
+ maxModal.prototype.checkResize = function ()
101
  {
102
+ this.windowHeight = $(window).height();
103
+ this.windowWidth = $(window).width();
104
 
105
  if (this.currentModal === null)
106
  return;
107
+
108
+ this.currentModal.removeAttr('style');
109
+ this.currentModal.find('.modal_content').removeAttr('style');
110
+ // redo sizes, repaint.
111
+
112
+ this.show();
113
  }
114
+
115
+ maxModal.prototype.close = function()
116
  {
117
+ this.currentModal.trigger('modal_close', [this]);
118
+ this.currentModal.remove();
119
  this.currentModal = null;
120
+ $('.maxmodal_overlay').remove();
121
+ $('body').removeClass('max-modal-active');
122
+ $(document).off('keydown', $.proxy(this.keyPressHandler, this));
123
+
124
  }
125
+
126
+ maxModal.prototype.fadeOut = function (timeOut)
127
  {
128
+ if (typeof timeOut == undefined)
129
  timeOut = 600;
130
+
131
  var self = this;
132
  this.currentModal.fadeOut(timeOut, function() { self.close(); } );
133
+
134
  }
135
+
136
+ maxModal.prototype.setTitle = function(title)
137
  {
138
+ this.currentModal.find('.modal_title').text(title);
139
  }
140
+
141
+ maxModal.prototype.setControls = function(controls)
142
  {
143
+ var content = this.currentModal.find('.modal_content');
144
  var controldiv = $('<div class="controls">');
145
 
146
+ for(i =0; i < this.controls.length; i++)
147
+ controldiv.append(this.controls[i]);
148
+
149
  if (typeof controls !== 'undefined')
150
+ controldiv.append(controls);
151
 
152
+ content.append(controldiv);
153
 
154
  // general close button
155
  $(this.currentModal).find('.modal_close').off('click');
156
+ $(this.currentModal).find('.modal_close').on('click', $.proxy(this.close, this));
157
  }
158
+
159
+ maxModal.prototype.addControl = function (type, data, handler)
160
  {
161
+ var text = '';
162
+
163
  switch(type)
164
  {
165
+ case 'yes':
166
  text = modaltext.yes;
167
  break;
168
+ case 'ok':
169
  text = modaltext.ok;
170
  break;
171
+ case 'no':
172
  text = modaltext.no;
173
  break;
174
  case 'cancel':
175
  text = modaltext.cancel;
176
  break;
177
+ case 'insert':
178
  text = mbtrans.insert; // used for mediabutton
179
  break;
180
  }
181
+
182
+ var control = $('<a class="button-primary ' + type + '">' + text + '</a>');
183
+ control.on('click', data, handler );
184
  this.controls.push(control);
185
+
186
  }
187
+
188
+
189
  /* Set the modal content
190
+
191
+ Sets the content of the modal. Do not run this function after adding controls.
192
+ @param string HTML,text content of the modal
193
  */
194
+ maxModal.prototype.setContent = function(content)
195
  {
196
+ this.currentModal.find('.modal_content').html(content);
197
  }
198
+
199
+ /* Builds modal from hidden data
200
+
201
  Builds modal from an formatted data object in DOM. Triggered on Click
202
+
203
  */
204
+ maxModal.prototype.buildModal = function(e)
205
  {
206
+ e.preventDefault();
207
+
208
+ var target = $(e.target);
209
+ if (typeof target.data('modal') == 'undefined')
210
+ target = target.parents('.maxmodal');
211
+
212
+ this.target = target;
213
+ var id = target.data('modal');
214
  var data = $('#' + id);
215
 
216
  // options
217
+ if (typeof data.data('width') !== 'undefined')
218
+ this.setWidth = data.data('width');
219
  else
220
+ this.setWidth = false;
221
+
222
+ if (typeof data.data('height') !== 'undefined')
223
+ this.setHeight = data.data('height');
224
  else
225
+ this.setHeight = false;
226
+
227
 
228
+ var title = $(data).find('.title').text();
229
+ var controls = $(data).find('.controls').html();
230
+ var content = $(data).find('.content').html();
 
231
 
232
  this.newModal(id);
233
  this.setTitle(title)
234
  this.setContent(content);
235
  this.setControls(controls);
236
 
237
+ // callback on init
238
+ if (typeof $(data).data('load') !== 'undefined')
239
+ {
 
240
 
241
  // default call
242
+ var funcName = data.data('load') + '(modal)';
243
  var callFunc = new Function ('modal', funcName);
244
+
245
 
246
  /* Args coming!
247
+ if (typeof(data.data('load-args') !== 'undefined')
248
  {
249
+ var args = data.data('load-args').split(',');
250
+
251
  for(i=0; i< args.length; i++)
252
  {
253
+
254
  }
255
  }
256
  */
257
+
258
  try
259
  {
260
  callFunc(this);
261
  }
262
  catch(err)
263
  {
264
+
265
  console.log('MB Modal Callback Error: ' + err.message);
266
  console.log('MB Mobdal tried calling: ' + funcName);
267
  }
268
  }
269
+
270
  this.show();
271
  }
272
 
273
+ maxModal.prototype.newModal = function(id)
274
  {
275
+
276
+ if (this.currentModal !== null)
277
+ this.close();
278
+
279
  var modal = $('<div class="max-modal ' + id + '" > \
280
  <div class="modal_header"> \
281
  <div class="modal_close dashicons dashicons-no"></div><h3 class="modal_title"></h3> \
282
  </div> \
283
  <div class="inner modal_content"></div>\
284
+ </div>');
285
+ if ($(this.parent).length > 0)
286
+ $(this.parent).append(modal);
287
  else
288
+ $('body').append(modal); // fallback in case of interrupting page builders
289
+
290
  $(modal).draggable({
291
  handle: '.modal_header'
292
+ });
293
 
294
+ this.modals.push(modal);
295
  this.currentModal = modal;
296
+ this.controls = [];
297
+ return this;
298
+
299
  }
300
+
301
+ maxModal.prototype.writeOverlay = function()
302
  {
 
 
 
 
 
303
 
304
+ $(this.parent).append('<div class="maxmodal_overlay"></div>');
305
+ $('.maxmodal_overlay').on('click', $.proxy(this.close, this));
306
+
307
+ }
308
 
309
+ });
js/min/maxajax.js CHANGED
@@ -1,136 +1,144 @@
1
 
2
  /** New AJAX Call methods
3
- /* Get the standard AJAX vars for this plugin */
4
 
5
  var maxAjax = function(jquery) {
6
  $ = jquery;
7
 
8
  }
9
 
10
- maxAjax.prototype.init = function()
11
  {
12
 
13
  // default actions that trigger ajax action.
14
  $(document).on('click', '.mb-ajax-form .mb-ajax-submit', $.proxy(this.ajaxForm, this ));
15
- $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
16
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
17
  $(document).trigger('maxajax_init'); // for hanging in other actions.
18
  }
19
 
20
- maxAjax.prototype.ajaxInit = function()
21
  {
22
- data = {
23
  action: maxajax.ajax_action,
24
- nonce: maxajax.nonce,
25
  }
26
-
27
  return data;
28
  }
29
 
30
  maxAjax.prototype.ajaxForm = function (e)
31
  {
32
- var target = $(e.target);
33
- var form = $(target).parents('form');
34
- var action = $(target).data('action');
35
-
36
- var data = this.ajaxInit();
37
- data['form'] = form.serialize();
38
  data['plugin_action'] = action;
39
- // data['action'] = 'mb_button_action';
40
-
41
- this.showSpinner(target);
42
-
43
- this.ajaxPost(data);
44
-
45
-
46
  }
47
 
48
  /* Ajax call functionality */
49
- maxAjax.prototype.ajaxCall = function (e)
50
  {
51
 
52
- e.preventDefault();
53
- var target = e.target;
 
 
 
 
 
54
 
55
- var param = false;
56
- var plugin_action = $(target).data('action');
57
- var check_param = $(target).data('param');
58
- var param_input = $(target).data('param-input');
59
-
60
- if (typeof check_param !== 'undefined')
61
  param = check_param;
62
- if (typeof param_input !== 'undefined')
63
- param = $(param_input).val();
64
-
65
  data = this.ajaxInit();
66
 
67
  data['plugin_action'] = plugin_action;
68
  data['param'] = param;
69
  data['post'] = $('form').serialize(); // send it all
70
 
71
- this.showSpinner(target);
72
 
73
  this.ajaxPost(data);
74
  }
75
 
76
  maxAjax.prototype.showSpinner = function(target)
77
- {
78
- var spinner = '<div class="ajax-load-spinner"></div>';
79
- $('.ajax-load-spinner').remove();
 
80
  $(target).after(spinner);
81
  //return spinner;
82
  }
83
 
 
 
 
 
 
 
84
  maxAjax.prototype.ajaxPost = function(data, successHandler, errorHandler)
85
  {
86
  var self = this;
87
-
88
- if (typeof successHandler == 'undefined')
89
  {
90
- var action = data['plugin_action'];
91
- var successHandler = function (r,s,o,) { self.defaultSuccessHandler(r,s,o,action) } ;
92
-
93
  }
94
-
95
- if (typeof errorHandler == 'undefined')
96
  {
97
- var action = data['plugin_action'];
98
  var errorHandler = function (r,s,o,) { self.defaultErrorHandler(r,s,o,action) } ;
99
- }
100
 
101
 
102
  $.ajax({
103
- type: "POST",
104
  url: maxajax.ajax_url,
105
  data: data,
106
  success: successHandler,
107
  error: errorHandler,
108
- });
109
  }
110
 
111
- maxAjax.prototype.defaultSuccessHandler = function (result, status, object, action)
112
  {
 
113
  $(document).trigger('maxajax_success_' + action, [result, status, object]);
114
 
115
  }
116
 
117
- maxAjax.prototype.defaultErrorHandler = function(jq,status,error, action)
118
  {
119
- $(document).trigger('maxajax_error_' + action, jq, status, error);
 
120
  console.log(jq);
121
  console.log(status);
122
- console.log(error);
123
  }
124
 
125
 
126
  jQuery(document).ready(function($) {
127
 
128
- if (typeof window.maxFoundry === 'undefined')
129
- window.maxFoundry = {} ;
130
-
131
  window.maxFoundry.maxAjax = new maxAjax($);
132
 
133
  window.maxFoundry.maxAjax.init();
134
 
135
  }); /* END OF JQUERY */
136
-
1
 
2
  /** New AJAX Call methods
3
+ /* Get the standard AJAX vars for this plugin */
4
 
5
  var maxAjax = function(jquery) {
6
  $ = jquery;
7
 
8
  }
9
 
10
+ maxAjax.prototype.init = function()
11
  {
12
 
13
  // default actions that trigger ajax action.
14
  $(document).on('click', '.mb-ajax-form .mb-ajax-submit', $.proxy(this.ajaxForm, this ));
15
+ $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
16
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
17
  $(document).trigger('maxajax_init'); // for hanging in other actions.
18
  }
19
 
20
+ maxAjax.prototype.ajaxInit = function()
21
  {
22
+ data = {
23
  action: maxajax.ajax_action,
24
+ nonce: maxajax.nonce,
25
  }
26
+
27
  return data;
28
  }
29
 
30
  maxAjax.prototype.ajaxForm = function (e)
31
  {
32
+ var target = $(e.target);
33
+ var form = $(target).parents('form');
34
+ var action = $(target).data('action');
35
+
36
+ var data = this.ajaxInit();
37
+ data['form'] = form.serialize();
38
  data['plugin_action'] = action;
39
+ // data['action'] = 'mb_button_action';
40
+
41
+ this.showSpinner(target);
42
+
43
+ this.ajaxPost(data);
44
+
45
+
46
  }
47
 
48
  /* Ajax call functionality */
49
+ maxAjax.prototype.ajaxCall = function (e)
50
  {
51
 
52
+ e.preventDefault();
53
+ var target = e.target;
54
+
55
+ var param = false;
56
+ var plugin_action = $(target).data('action');
57
+ var check_param = $(target).data('param');
58
+ var param_input = $(target).data('param-input');
59
 
60
+ if (typeof check_param !== 'undefined')
 
 
 
 
 
61
  param = check_param;
62
+ if (typeof param_input !== 'undefined')
63
+ param = $(param_input).val();
64
+
65
  data = this.ajaxInit();
66
 
67
  data['plugin_action'] = plugin_action;
68
  data['param'] = param;
69
  data['post'] = $('form').serialize(); // send it all
70
 
71
+ this.showSpinner(target);
72
 
73
  this.ajaxPost(data);
74
  }
75
 
76
  maxAjax.prototype.showSpinner = function(target)
77
+ {
78
+ // spinner styling in elements
79
+ var spinner = '<div class="maxajax-load-spinner"></div>';
80
+ //$('.maxajax-load-spinner').remove();
81
  $(target).after(spinner);
82
  //return spinner;
83
  }
84
 
85
+ maxAjax.prototype.removeSpinner = function()
86
+ {
87
+ $('.maxajax-load-spinner').remove();
88
+
89
+ }
90
+
91
  maxAjax.prototype.ajaxPost = function(data, successHandler, errorHandler)
92
  {
93
  var self = this;
94
+
95
+ if (typeof successHandler == 'undefined')
96
  {
97
+ var action = data['plugin_action'];
98
+ var successHandler = function (r,s,o,) { self.defaultSuccessHandler(r,s,o,action) } ;
99
+
100
  }
101
+
102
+ if (typeof errorHandler == 'undefined')
103
  {
104
+ var action = data['plugin_action'];
105
  var errorHandler = function (r,s,o,) { self.defaultErrorHandler(r,s,o,action) } ;
106
+ }
107
 
108
 
109
  $.ajax({
110
+ type: "POST",
111
  url: maxajax.ajax_url,
112
  data: data,
113
  success: successHandler,
114
  error: errorHandler,
115
+ });
116
  }
117
 
118
+ maxAjax.prototype.defaultSuccessHandler = function (result, status, object, action)
119
  {
120
+ this.removeSpinner();
121
  $(document).trigger('maxajax_success_' + action, [result, status, object]);
122
 
123
  }
124
 
125
+ maxAjax.prototype.defaultErrorHandler = function(jq,status,error, action)
126
  {
127
+ this.removeSpinner();
128
+ $(document).trigger('maxajax_error_' + action, jq, status, error);
129
  console.log(jq);
130
  console.log(status);
131
+ console.log(error);
132
  }
133
 
134
 
135
  jQuery(document).ready(function($) {
136
 
137
+ if (typeof window.maxFoundry === 'undefined')
138
+ window.maxFoundry = {} ;
139
+
140
  window.maxFoundry.maxAjax = new maxAjax($);
141
 
142
  window.maxFoundry.maxAjax.init();
143
 
144
  }); /* END OF JQUERY */
 
js/min/maxbuttons-admin.js CHANGED
@@ -1 +1 @@
1
- var maxAdmin;jQuery(document).ready(function($){maxAdmin=function(){return this},maxAdmin.prototype={colorUpdateTime:!0,fields:null,button_id:null,form_updated:!1,tabs:null},maxAdmin.prototype.init=function(){this.button_id=$('input[name="button_id"]').val(),$(document).on("click",".maxbutton-preview",function(t){t.preventDefault()}),$(document).on("click",".output .preview-toggle",$.proxy(this.toggle_preview,this)),$("#maxbuttons .input-paging").on("change",$.proxy(this.do_paging,this)),$(".manual-toggle").on("click",$.proxy(this.toggleManual,this)),$(".manual-entry").draggable({cancel:"p, li"}),$(document).on("submit","form.mb_ajax_save",$.proxy(this.formAjaxSave,this)),$(document).on("click","[data-buttonaction]",$.proxy(this.button_action,this)),$(document).on("reInitConditionals",$.proxy(this.initConditionials,this)),this.initConditionials(),$(document).on("change, input",'input[type="range"]',$.proxy(this.updateRange,this)),this.updateRange(null),0!=$("#new-button-form").length&&(this.button_id>0&&$("#maxbuttons .mb-message").show(),this.initResponsive(),$("#maxbuttons .output").draggable({cancel:".nodrag"}),$("#maxbuttons .color-field").wpColorPicker({width:300,change:$.proxy(_.throttle(function(t,a){t.preventDefault();var e=a.color.toString();this.update_color(t,a,e)},200),this)}),$(".input.color .arrows").on("click",$.proxy(this.copyColor,this)),$("#radius_toggle").on("click",$.proxy(this.toggleRadiusLock,this)),"undefined"!=typeof buttonFieldMap&&(this.fields=$.parseJSON(buttonFieldMap)),$("input").not(".color-field").on("keyup change",$.proxy(this.update_preview,this)),$("input.color-field").on("focus",$.proxy(this.select_field,this)),$("select").on("change",$.proxy(this.update_preview,this)),$(window).on("beforeunload",$.proxy(function(){if(this.form_updated)return maxcol_wp.leave_page},this)),$(document).on("keyup","input",function(t){if(t.keyCode&&13==t.keyCode)return $(":input")[$(":input").index(document.activeElement)+1].focus(),!1}),$(".button-save").click($.proxy(function(){return this.saveIndicator(!1),$("#new-button-form").submit(),!1},this)),$(".shortcode-expand").on("click",this.toggleShortcode))},maxAdmin.prototype.repaint_preview=function(){$('.mb_tab input[type="text"]').trigger("change"),$('.mb_tab input[type="number"]').trigger("change"),$(".mb_tab select").trigger("change"),$('.mb_tab input[type="hidden"]').trigger("change"),$('.mb_tab input[type="radio"]:checked').trigger("change"),$('.mb_tab input[type="checkbox"]:checked').trigger("change")},maxAdmin.prototype.update_preview=function(e){e.preventDefault(),this.saveIndicator(!0);var target=$(e.target),field=$(target).data("field");if(void 0===field)var id=$(target).attr("id");else var id=field;var data=this.fields[id];void 0!==data&&(void 0!==data.css&&(value=target.val(),void 0!==data.css_unit&&-1==value.indexOf(data.css_unit)&&(value+=data.css_unit),target.is(":checkbox")&&!target.is(":checked")&&(value=""),this.putCSS(data,value)),void 0!==data.attr&&$(".output .result").find("a").attr(data.attr,target.val()),void 0!==data.func&&eval("this."+data.func+"(target)"))},maxAdmin.prototype.select_field=function(t){$(t.target).select()},maxAdmin.prototype.button_action=function(t){t.preventDefault();var a=$(t.target).data("buttonaction");this.form_updated=!1;var e=$(t.target).data("buttonid"),o=$('input[name="'+a+'_nonce"]').val(),n=mb_ajax.ajaxurl,i={action:"mb_button_action",button_action:a,button_id:e,nonce:o};$.post({url:n,data:i,success:function(t){response=JSON.parse(t),void 0!==response.redirection&&(window.location=response.redirection)},error:function(){console.log("error in button action"+a)}})},maxAdmin.prototype.checkCopyModal=function(t){this.form_updated?t.currentModal.find(".mb-message").show():$(t.currentModal).find(".mb-message").hide()},maxAdmin.prototype.toggle_preview=function(t){$(".output .inner").is(":hidden")?($(".output .inner").show(),$(".output").css("height","auto"),$(".preview .preview-toggle").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-up")):($(".output .inner").hide(),$(".output").css("height","auto"),$(".preview .preview-toggle").removeClass("dashicons-arrow-up").addClass("dashicons-arrow-down"))},maxAdmin.prototype.putCSS=function(t,a,e){var o=".maxbutton";if("hover"==(e=e||"both")?o="a.hover ":"normal"==e&&(o="a.normal "),void 0!==t.csspart){var n=t.csspart.split(",");for(i=0;i<n.length;i++){var r=o+" ."+n[i];$(".output .result").find(r).css(t.css,a)}}else $(".output .result").find(o).css(t.css,a)},maxAdmin.prototype.update_color=function(t,a,e){t.preventDefault(),this.saveIndicator(!0);var o=$(t.target);-1===e.indexOf("#")&&(e="#"+e);var n=o.attr("id");if($("#"+n).val(e),-1!==n.indexOf("box_shadow"))this.updateBoxShadow(o);else if(-1!==n.indexOf("text_shadow"))this.updateTextShadow(o);else if(-1!==n.indexOf("gradient"))-1==n.indexOf("hover")?this.updateGradient():this.updateGradient(!0);else{if("button_preview"!=n){-1==n.indexOf("hover")?state="normal":state="hover";var i=this.fields[n];return void this.putCSS(i,e,state)}$(".output .result").css("backgroundColor",e)}},maxAdmin.prototype.copyColor=function(t){t.preventDefault(),t.stopPropagation();var a=$(t.target),e=$(t.target).parents("[data-bind]"),o="#"+e.data("id"),n="#"+e.data("bind");if(a.hasClass("arrow-right"))i="right";else var i="left";if(e.hasClass("right"))r="left";else var r="right";"left"==r?copy="right"==i:"right"==r&&(copy="right"!=i),copy?($(n).val($(o).val()),$(n).trigger("change"),$(n).wpColorPicker("color",$(o).val())):($(o).val($(n).val()),$(o).trigger("change"),$(o).wpColorPicker("color",$(n).val()))},maxAdmin.prototype.updateGradient=function(t){var a="";(t=t||!1)&&(a="_hover");var e=parseInt($("#gradient_stop").val());isNaN(e)&&(e=45);var o=$("#use_gradient").prop("checked"),n=this.hexToRgb($("#gradient_start_color"+a).val()),i=this.hexToRgb($("#gradient_end_color"+a).val()),r=parseInt($("#gradient_start_opacity"+a).val()),d=parseInt($("#gradient_end_opacity"+a).val());if(o||(i=n,d=r),isNaN(r)&&(r=100),isNaN(d)&&(d=100),t)s=$(".output .result").find("a.hover");else var s=$(".output .result").find("a.normal");s.css("background","linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-moz-linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-o-linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-webkit-gradient(linear, left top, left bottom, color-stop("+e+"%, rgba("+n+","+r/100+")), color-stop(1, rgba("+i+","+d/100+") ));")},maxAdmin.prototype.hexToRgb=function(t){t=t.replace("#","");var a=parseInt(t,16);return(a>>16&255)+","+(a>>8&255)+","+(255&a)},maxAdmin.prototype.updateBoxShadow=function(t){t=t||null;var a=$("#box_shadow_offset_left").val(),e=$("#box_shadow_offset_top").val(),o=$("#box_shadow_width").val(),n=$("#box_shadow_spread").val(),i=$("#box_shadow_color").val(),r=$("#box_shadow_color_hover").val();$(".output .result").find("a.normal").css("boxShadow",a+"px "+e+"px "+o+"px "+n+"px "+i),$(".output .result").find("a.hover").css("boxShadow",a+"px "+e+"px "+o+"px "+n+"px "+r)},maxAdmin.prototype.updateTextShadow=function(t,a){a=a||!1;var e=$("#text_shadow_offset_left").val(),o=$("#text_shadow_offset_top").val(),n=$("#text_shadow_width").val(),i=$("#text_shadow_color").val(),r=$("#text_shadow_color_hover").val(),d=$(t).attr("id"),s=this.fields[d];s.css="textShadow";var l=e+"px "+o+"px "+n+"px "+i;this.putCSS(s,l,"normal"),l=e+"px "+o+"px "+n+"px "+r,this.putCSS(s,l,"hover")},maxAdmin.prototype.updateAnchorText=function(t){0===$(".output .result").find("a .mb-text").length&&($(".output .result").find("a").append('<span class="mb-text"></span>'),$(".output .result").find("a .mb-text").css({display:"block","line-height":"1em","box-sizing":"border-box"}),this.repaint_preview()),$(".output .result").find("a .mb-text").text(t.val())},maxAdmin.prototype.updateGradientOpacity=function(t){this.updateGradient(!0),this.updateGradient(!1)},maxAdmin.prototype.updateDimension=function(t){var a=$(t).val(),e=$(t).attr("id"),o=this.fields[e];a>0?this.putCSS(o,a):this.putCSS(o,"auto")},maxAdmin.prototype.updateRadius=function(t){var a=t.val(),e=["radius_bottom_left","radius_bottom_right","radius_top_left","radius_top_right"];if("lock"==$("#radius_toggle").data("lock"))for(i=0;i<e.length;i++){var o=e[i];$("#"+o).val(a);var n=this.fields[o];this.putCSS(n,a+"px")}},maxAdmin.prototype.toggleRadiusLock=function(t){var a=$(t.target),e=$(a).data("lock");"lock"==e?($(a).removeClass("dashicons-lock").addClass("dashicons-unlock"),$(a).data("lock","unlock")):"unlock"==e&&($(a).removeClass("dashicons-unlock").addClass("dashicons-lock"),$(a).data("lock","lock"))},maxAdmin.prototype.initResponsive=function(){window.maxFoundry.maxadmin.responsive=new mbResponsive($),window.maxFoundry.maxadmin.responsive.init(this)},maxAdmin.prototype.do_paging=function(t){var a=parseInt($(t.target).val());if(a<=parseInt($(t.target).attr("max"))){var e=$(t.target).data("url");window.location=e+"&paged="+a}},maxAdmin.prototype.toggleShortcode=function(t){$(".shortcode-expand").hasClass("closed")?($(" .mb-message.shortcode .expanded").css("display","inline-block"),$(".shortcode-expand span").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-up"),$(".shortcode-expand").removeClass("closed").addClass("open")):($(" .mb-message.shortcode .expanded").css("display","none"),$(".shortcode-expand span").addClass("dashicons-arrow-down").removeClass("dashicons-arrow-up"),$(".shortcode-expand").addClass("closed").removeClass("open"))},maxAdmin.prototype.toggleManual=function(t){t.preventDefault();var a=$(t.target),e=a.data("target"),o=$('.manual-entry[data-manual="'+e+'"]');if(o.is(":visible"))return o.hide(),!0;var n=$('[data-options="'+e+'"]').position().top+a.height();o.css("top",n),o.css("right",15),o.css("left","auto"),o.show()},maxAdmin.prototype.initConditionials=function(){var t=this;$("[data-show]").each(function(){var a=$(this).data("show"),e=a.target,o=a.values;$(document).on("change",'[name="'+e+'"]',{child:this,values:o},$.proxy(t.updateConditional,t)),$('[name="'+e+'"]').trigger("change")}),$("[data-has]").each(function(){var a=$(this).data("has"),e=a.target,o=a.values;$(document).on("change",'[name="'+e+'"]',{target:e,child:this,values:o},$.proxy(t.updateHasConditional,t))})},maxAdmin.prototype.updateConditional=function(t){var a=t.data,e=a.values,o=a.child,n=$(t.currentTarget),i=$(n).val();if("checkbox"===n.attr("type")){var r=$(n).prop("checked");i="checked"==e&&r?"checked":"unchecked"!=e||r?0:"unchecked"}e.indexOf(i)>=0?($(o).fadeIn("fast"),$(o).find("input, select").trigger("change")):($(o).fadeOut("fast"),$(o).find("input, select").trigger("change"))},maxAdmin.prototype.updateHasConditional=function(t){var a=t.data,e=a.values,o=a.child,n=a.target,i=!1;$('[name="'+n+'"]').each(function(){var t=$(this).val();if(e.indexOf(t)>=0)return i=!0,!0}),i?$(o).fadeIn("fast"):$(o).fadeOut("fast")},maxAdmin.prototype.updateRange=function(t){if(void 0===t||null===t)a=$('input[type="range"]');else var a=[t.target];$(a).each(function(){var t=$(this).val();$(this).parents(".input").find(".range_value output").val(t+"%")})},maxAdmin.prototype.saveIndicator=function(t){this.form_updated=!!t},maxAdmin.prototype.formAjaxSave=function(t){t.preventDefault();var a=mb_ajax.ajaxurl,e=$(t.target).serialize();$.ajax({type:"POST",url:a,data:e}).done($.proxy(this.saveDone,this))},maxAdmin.prototype.saveDone=function(t){$("[data-form]").prop("disabled",!1);var a=$.parseJSON(t),e=a.result,o=a.title,n=a.data.id;if(void 0!==a.data.new_nonce){a.data.new_nonce;$('input[name="nonce"]').val(a.data.new_nonce)}if(e){$('input[name="collection_id"]').val(n);var i=window.location.href;-1===i.indexOf("collection_id")&&window.history.replaceState({},"",i+"&collection_id="+n),$(document).trigger("mbFormSaved");var r=$('input[name="sorted"]').val();$('input[name="previous_selection"]').val(r),a.data.reload&&document.location.reload(!0)}e||($modal=window.maxFoundry.maxmodal,$modal.newModal("collection_error"),$modal.setTitle(o),$modal.setContent(a.body),$modal.setControls('<button class="modal_close button-primary">'+a.close_text+"</button>"),$modal.show())}});
1
+ var maxAdmin;jQuery(document).ready(function($){maxAdmin=function(){return this},maxAdmin.prototype={colorUpdateTime:!0,fields:null,button_id:null,form_updated:!1,tabs:null},maxAdmin.prototype.init=function(){this.button_id=$('input[name="button_id"]').val(),$(document).on("click",".maxbutton-preview",function(t){t.preventDefault()}),$(document).on("click",".output .preview-toggle",$.proxy(this.toggle_preview,this)),$("#maxbuttons .input-paging").on("change",$.proxy(this.do_paging,this)),$(".manual-toggle").on("click",$.proxy(this.toggleManual,this)),$(".manual-entry").draggable({cancel:"p, li"}),$(document).on("submit","form.mb_ajax_save",$.proxy(this.formAjaxSave,this)),$(document).on("click","[data-buttonaction]",$.proxy(this.button_action,this)),$(document).on("reInitConditionals",$.proxy(this.initConditionials,this)),this.initConditionials(),$(document).on("change, input",'input[type="range"]',$.proxy(this.updateRange,this)),this.updateRange(null),0!=$("#new-button-form").length&&(this.button_id>0&&$("#maxbuttons .mb-message").show(),this.initResponsive(),$("#maxbuttons .output").draggable({cancel:".nodrag"}),$("#maxbuttons .color-field").wpColorPicker({width:300,change:$.proxy(_.throttle(function(t,a){t.preventDefault();var e=a.color.toString();this.update_color(t,a,e)},200),this)}),$(".input.mbcolor .arrows").on("click",$.proxy(this.copyColor,this)),$("#radius_toggle").on("click",$.proxy(this.toggleRadiusLock,this)),"undefined"!=typeof buttonFieldMap&&(this.fields=$.parseJSON(buttonFieldMap)),$("input").not(".color-field").on("keyup change",$.proxy(this.update_preview,this)),$("input.color-field").on("focus",$.proxy(this.select_field,this)),$("select").on("change",$.proxy(this.update_preview,this)),$(window).on("beforeunload",$.proxy(function(){if(this.form_updated)return maxcol_wp.leave_page},this)),$(document).on("keyup","input",function(t){if(t.keyCode&&13==t.keyCode)return $(":input")[$(":input").index(document.activeElement)+1].focus(),!1}),$(".button-save").click($.proxy(function(){return this.saveIndicator(!1),$("#new-button-form").submit(),!1},this)),$(".shortcode-expand").on("click",this.toggleShortcode))},maxAdmin.prototype.repaint_preview=function(){$('.mb_tab input[type="text"]').trigger("change"),$('.mb_tab input[type="number"]').trigger("change"),$(".mb_tab select").trigger("change"),$('.mb_tab input[type="hidden"]').trigger("change"),$('.mb_tab input[type="radio"]:checked').trigger("change"),$('.mb_tab input[type="checkbox"]:checked').trigger("change")},maxAdmin.prototype.update_preview=function(e){e.preventDefault(),this.saveIndicator(!0);var target=$(e.target),field=$(target).data("field");if(void 0===field)var id=$(target).attr("id");else var id=field;var data=this.fields[id];void 0!==data&&(void 0!==data.css&&(value=target.val(),void 0!==data.css_unit&&-1==value.indexOf(data.css_unit)&&(value+=data.css_unit),target.is(":checkbox")&&!target.is(":checked")&&(value=""),this.putCSS(data,value)),void 0!==data.attr&&$(".output .result").find("a").attr(data.attr,target.val()),void 0!==data.func&&eval("this."+data.func+"(target)"))},maxAdmin.prototype.select_field=function(t){$(t.target).select()},maxAdmin.prototype.button_action=function(t){t.preventDefault();var a=$(t.target).data("buttonaction");this.form_updated=!1;var e=$(t.target).data("buttonid"),o=$('input[name="'+a+'_nonce"]').val(),n=mb_ajax.ajaxurl,i={action:"mb_button_action",button_action:a,button_id:e,nonce:o};$.post({url:n,data:i,success:function(t){response=JSON.parse(t),void 0!==response.redirection&&(window.location=response.redirection)},error:function(){console.log("error in button action"+a)}})},maxAdmin.prototype.checkCopyModal=function(t){this.form_updated?t.currentModal.find(".mb-message").show():$(t.currentModal).find(".mb-message").hide()},maxAdmin.prototype.toggle_preview=function(t){$(".output .inner").is(":hidden")?($(".output .inner").show(),$(".output").css("height","auto"),$(".preview .preview-toggle").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-up")):($(".output .inner").hide(),$(".output").css("height","auto"),$(".preview .preview-toggle").removeClass("dashicons-arrow-up").addClass("dashicons-arrow-down"))},maxAdmin.prototype.putCSS=function(t,a,e){var o=".maxbutton";if("hover"==(e=e||"both")?o="a.hover ":"normal"==e&&(o="a.normal "),void 0!==t.csspart){var n=t.csspart.split(",");for(i=0;i<n.length;i++){var r=o+" ."+n[i];$(".output .result").find(r).css(t.css,a)}}else $(".output .result").find(o).css(t.css,a)},maxAdmin.prototype.update_color=function(t,a,e){t.preventDefault(),this.saveIndicator(!0);var o=$(t.target);-1===e.indexOf("#")&&(e="#"+e);var n=o.attr("id");if($("#"+n).val(e),-1!==n.indexOf("box_shadow"))this.updateBoxShadow(o);else if(-1!==n.indexOf("text_shadow"))this.updateTextShadow(o);else if(-1!==n.indexOf("gradient"))-1==n.indexOf("hover")?this.updateGradient():this.updateGradient(!0);else{if("button_preview"!=n){-1==n.indexOf("hover")?state="normal":state="hover";var i=this.fields[n];return void this.putCSS(i,e,state)}$(".output .result").css("backgroundColor",e)}},maxAdmin.prototype.copyColor=function(t){t.preventDefault(),t.stopPropagation();var a=$(t.target),e=$(t.target).parents("[data-bind]"),o="#"+e.data("id"),n="#"+e.data("bind");if(a.hasClass("arrow-right"))i="right";else var i="left";if(e.hasClass("right"))r="left";else var r="right";"left"==r?copy="right"==i:"right"==r&&(copy="right"!=i),copy?($(n).val($(o).val()),$(n).trigger("change"),$(n).wpColorPicker("color",$(o).val())):($(o).val($(n).val()),$(o).trigger("change"),$(o).wpColorPicker("color",$(n).val()))},maxAdmin.prototype.updateGradient=function(t){var a="";(t=t||!1)&&(a="_hover");var e=parseInt($("#gradient_stop").val());isNaN(e)&&(e=45);var o=$("#use_gradient").prop("checked"),n=this.hexToRgb($("#gradient_start_color"+a).val()),i=this.hexToRgb($("#gradient_end_color"+a).val()),r=parseInt($("#gradient_start_opacity"+a).val()),d=parseInt($("#gradient_end_opacity"+a).val());if(o||(i=n,d=r),isNaN(r)&&(r=100),isNaN(d)&&(d=100),t)s=$(".output .result").find("a.hover");else var s=$(".output .result").find("a.normal");s.css("background","linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-moz-linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-o-linear-gradient( rgba("+n+","+r/100+") "+e+"%, rgba("+i+","+d/100+") )"),s.css("background","-webkit-gradient(linear, left top, left bottom, color-stop("+e+"%, rgba("+n+","+r/100+")), color-stop(1, rgba("+i+","+d/100+") ));")},maxAdmin.prototype.hexToRgb=function(t){t=t.replace("#","");var a=parseInt(t,16);return(a>>16&255)+","+(a>>8&255)+","+(255&a)},maxAdmin.prototype.updateBoxShadow=function(t){t=t||null;var a=$("#box_shadow_offset_left").val(),e=$("#box_shadow_offset_top").val(),o=$("#box_shadow_width").val(),n=$("#box_shadow_spread").val(),i=$("#box_shadow_color").val(),r=$("#box_shadow_color_hover").val();$(".output .result").find("a.normal").css("boxShadow",a+"px "+e+"px "+o+"px "+n+"px "+i),$(".output .result").find("a.hover").css("boxShadow",a+"px "+e+"px "+o+"px "+n+"px "+r)},maxAdmin.prototype.updateTextShadow=function(t,a){a=a||!1;var e=$("#text_shadow_offset_left").val(),o=$("#text_shadow_offset_top").val(),n=$("#text_shadow_width").val(),i=$("#text_shadow_color").val(),r=$("#text_shadow_color_hover").val(),d=$(t).attr("id"),s=this.fields[d];s.css="textShadow";var l=e+"px "+o+"px "+n+"px "+i;this.putCSS(s,l,"normal"),l=e+"px "+o+"px "+n+"px "+r,this.putCSS(s,l,"hover")},maxAdmin.prototype.updateAnchorText=function(t){0===$(".output .result").find("a .mb-text").length&&($(".output .result").find("a").append('<span class="mb-text"></span>'),$(".output .result").find("a .mb-text").css({display:"block","line-height":"1em","box-sizing":"border-box"}),this.repaint_preview()),$(".output .result").find("a .mb-text").text(t.val())},maxAdmin.prototype.updateGradientOpacity=function(t){this.updateGradient(!0),this.updateGradient(!1)},maxAdmin.prototype.updateDimension=function(t){var a=$(t).val(),e=$(t).attr("id"),o=this.fields[e];a>0?this.putCSS(o,a):this.putCSS(o,"auto")},maxAdmin.prototype.updateRadius=function(t){var a=t.val(),e=["radius_bottom_left","radius_bottom_right","radius_top_left","radius_top_right"];if("lock"==$("#radius_toggle").data("lock"))for(i=0;i<e.length;i++){var o=e[i];$("#"+o).val(a);var n=this.fields[o];this.putCSS(n,a+"px")}},maxAdmin.prototype.toggleRadiusLock=function(t){var a=$(t.target),e=$(a).data("lock");"lock"==e?($(a).removeClass("dashicons-lock").addClass("dashicons-unlock"),$(a).data("lock","unlock")):"unlock"==e&&($(a).removeClass("dashicons-unlock").addClass("dashicons-lock"),$(a).data("lock","lock"))},maxAdmin.prototype.initResponsive=function(){window.maxFoundry.maxadmin.responsive=new mbResponsive($),window.maxFoundry.maxadmin.responsive.init(this)},maxAdmin.prototype.do_paging=function(t){var a=parseInt($(t.target).val());if(a<=parseInt($(t.target).attr("max"))){var e=$(t.target).data("url");window.location=e+"&paged="+a}},maxAdmin.prototype.toggleShortcode=function(t){$(".shortcode-expand").hasClass("closed")?($(" .mb-message.shortcode .expanded").css("display","inline-block"),$(".shortcode-expand span").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-up"),$(".shortcode-expand").removeClass("closed").addClass("open")):($(" .mb-message.shortcode .expanded").css("display","none"),$(".shortcode-expand span").addClass("dashicons-arrow-down").removeClass("dashicons-arrow-up"),$(".shortcode-expand").addClass("closed").removeClass("open"))},maxAdmin.prototype.toggleManual=function(t){t.preventDefault();var a=$(t.target),e=a.data("target"),o=$('.manual-entry[data-manual="'+e+'"]');if(o.is(":visible"))return o.hide(),!0;var n=$('[data-options="'+e+'"]').position().top+a.height();o.css("top",n),o.css("right",15),o.css("left","auto"),o.show()},maxAdmin.prototype.initConditionials=function(){var t=this;$("[data-show]").each(function(){var a=$(this).data("show"),e=a.target,o=a.values;$(document).on("change",'[name="'+e+'"]',{child:this,values:o},$.proxy(t.updateConditional,t)),$('[name="'+e+'"]').length>1?$('[name="'+e+'"]:checked').change():$('[name="'+e+'"]').trigger("change",["conditional"])}),$("[data-has]").each(function(){var a=$(this).data("has"),e=a.target,o=a.values;$(document).on("change",'[name="'+e+'"]',{target:e,child:this,values:o},$.proxy(t.updateHasConditional,t))})},maxAdmin.prototype.updateConditional=function(t){var a=t.data,e=a.values,o=a.child,n=$(t.currentTarget),i=$(n).val();if("checkbox"===n.attr("type")){var r=$(n).prop("checked");i="checked"==e&&r?"checked":"unchecked"!=e||r?0:"unchecked"}e.indexOf(i)>=0?($(o).fadeIn("fast"),$(o).find("input, select").trigger("change")):($(o).fadeOut("fast"),$(o).find("input, select").trigger("change"))},maxAdmin.prototype.updateHasConditional=function(t){var a=t.data,e=a.values,o=a.child,n=a.target,i=!1;$('[name="'+n+'"]').each(function(){var t=$(this).val();if(e.indexOf(t)>=0)return i=!0,!0}),i?$(o).fadeIn("fast"):$(o).fadeOut("fast")},maxAdmin.prototype.updateRange=function(t){if(void 0===t||null===t)a=$('input[type="range"]');else var a=[t.target];$(a).each(function(){var t=$(this).val();$(this).parents(".input").find(".range_value output").val(t+"%")})},maxAdmin.prototype.saveIndicator=function(t){this.form_updated=!!t},maxAdmin.prototype.formAjaxSave=function(t){t.preventDefault();var a=mb_ajax.ajaxurl,e=$(t.target).serialize();$.ajax({type:"POST",url:a,data:e}).done($.proxy(this.saveDone,this))},maxAdmin.prototype.saveDone=function(t){$("[data-form]").prop("disabled",!1);var a=$.parseJSON(t),e=a.result,o=a.title,n=a.data.id;if(void 0!==a.data.new_nonce){a.data.new_nonce;$('input[name="nonce"]').val(a.data.new_nonce)}if(e){$('input[name="collection_id"]').val(n);var i=window.location.href;-1===i.indexOf("collection_id")&&window.history.replaceState({},"",i+"&collection_id="+n),$(document).trigger("mbFormSaved");var r=$('input[name="sorted"]').val();$('input[name="previous_selection"]').val(r),a.data.reload&&document.location.reload(!0)}e||($modal=window.maxFoundry.maxmodal,$modal.newModal("collection_error"),$modal.setTitle(o),$modal.setContent(a.body),$modal.setControls('<button class="modal_close button-primary">'+a.close_text+"</button>"),$modal.show())}});
js/min/maxmodal.js CHANGED
@@ -1 +1 @@
1
- var maxModal;jQuery(document).ready(function(t){(maxModal=function(){}).prototype={currentModal:null,modals:[],controls:[],parent:"#maxbuttons",multiple:!1,windowHeight:!1,windowWidth:!1,setWidth:!1,setHeight:!1,target:!1},maxModal.prototype.init=function(){this.windowHeight=t(window).height(),this.windowWidth=t(window).width(),t(document).on("click",".maxmodal",t.proxy(this.buildModal,this)),t(window).on("resize",t.proxy(this.checkResize,this))},maxModal.prototype.focus=function(){this.currentModal.show()},maxModal.prototype.get=function(){return this.currentModal},maxModal.prototype.show=function(){t(".maxmodal_overlay").remove(),this.writeOverlay(),this.setWidth&&this.currentModal.width(this.setWidth),this.setHeight&&this.currentModal.height(this.setHeight);var o=this.currentModal.height(),e=this.currentModal.width(),i=(this.windowHeight-o)/2,a=(this.windowWidth-e)/2;i<30&&(i=30),o>this.windowHeight&&this.currentModal.height(this.windowHeight-i-5+"px"),this.currentModal.css("left",a+"px"),this.currentModal.css("top",i+"px"),this.currentModal.css("height",o),this.currentModal.show(),t(".maxmodal_overlay").show(),t(document).off("keydown",t.proxy(this.keyPressHandler,this)),t(document).on("keydown",t.proxy(this.keyPressHandler,this))},maxModal.prototype.keyPressHandler=function(t){27===t.keyCode&&this.close()},maxModal.prototype.checkResize=function(){this.windowHeight=t(window).height(),this.windowWidth=t(window).width(),null!==this.currentModal&&(this.currentModal.removeAttr("style"),this.currentModal.find(".modal_content").removeAttr("style"),this.show())},maxModal.prototype.close=function(){this.currentModal.trigger("modal_close",[this]),this.currentModal.remove(),this.currentModal=null,t(".maxmodal_overlay").remove(),t(document).off("keydown",t.proxy(this.keyPressHandler,this))},maxModal.prototype.fadeOut=function(t){void 0==typeof t&&(t=600);var o=this;this.currentModal.fadeOut(t,function(){o.close()})},maxModal.prototype.setTitle=function(t){this.currentModal.find(".modal_title").text(t)},maxModal.prototype.setControls=function(o){var e=this.currentModal.find(".modal_content"),a=t('<div class="controls">');for(i=0;i<this.controls.length;i++)a.append(this.controls[i]);void 0!==o&&a.append(o),e.append(a),t(this.currentModal).find(".modal_close").off("click"),t(this.currentModal).find(".modal_close").on("click",t.proxy(this.close,this))},maxModal.prototype.addControl=function(o,e,i){var a="";switch(o){case"yes":a=modaltext.yes;break;case"ok":a=modaltext.ok;break;case"no":a=modaltext.no;break;case"cancel":a=modaltext.cancel;break;case"insert":a=mbtrans.insert}var d=t('<a class="button-primary '+o+'">'+a+"</a>");d.on("click",e,i),this.controls.push(d)},maxModal.prototype.setContent=function(t){this.currentModal.find(".modal_content").html(t)},maxModal.prototype.buildModal=function(o){o.preventDefault();var e=t(o.target);void 0===e.data("modal")&&(e=e.parents(".maxmodal")),this.target=e;var i=e.data("modal"),a=t("#"+i);void 0!==a.data("width")?this.setWidth=a.data("width"):this.setWidth=!1,void 0!==a.data("height")?this.setHeight=a.data("height"):this.setHeight=!1;var d=t(a).find(".title").text(),s=t(a).find(".controls").html(),n=t(a).find(".content").html();if(this.newModal(i),this.setTitle(d),this.setContent(n),this.setControls(s),void 0!==t(a).data("load")){var l=a.data("load")+"(modal)",r=new Function("modal",l);try{r(this)}catch(t){console.log("MB Modal Callback Error: "+t.message),console.log("MB Mobdal tried calling: "+l)}}this.show()},maxModal.prototype.newModal=function(o){null!==this.currentModal&&this.close();var e=t('<div class="max-modal '+o+'" > \t\t\t\t\t\t <div class="modal_header"> \t\t\t\t\t\t\t <div class="modal_close dashicons dashicons-no"></div><h3 class="modal_title"></h3> \t\t\t\t\t\t </div> \t\t\t\t\t\t <div class="inner modal_content"></div>\t\t\t\t\t </div>');return t(this.parent).length>0?t(this.parent).append(e):t("body").append(e),t(e).draggable({handle:".modal_header"}),this.modals.push(e),this.currentModal=e,this.controls=[],this},maxModal.prototype.writeOverlay=function(){t(this.parent).append('<div class="maxmodal_overlay"></div>'),t(".maxmodal_overlay").on("click",t.proxy(this.close,this))}});
1
+ var maxModal;jQuery(document).ready(function(t){(maxModal=function(){}).prototype={currentModal:null,modals:[],controls:[],parent:"#maxbuttons",multiple:!1,windowHeight:!1,windowWidth:!1,setWidth:!1,setHeight:!1,target:!1},maxModal.prototype.init=function(){this.windowHeight=t(window).height(),this.windowWidth=t(window).width(),t(document).on("click",".maxmodal",t.proxy(this.buildModal,this)),t(window).on("resize",t.proxy(this.checkResize,this))},maxModal.prototype.focus=function(){this.currentModal.show()},maxModal.prototype.get=function(){return this.currentModal},maxModal.prototype.show=function(){t(".maxmodal_overlay").remove(),t("body").removeClass("max-modal-active"),this.writeOverlay(),this.setWidth&&this.currentModal.width(this.setWidth),this.setHeight&&this.currentModal.height(this.setHeight);var o=this.currentModal.height(),e=this.currentModal.width(),a=(this.windowHeight-o)/2,i=(this.windowWidth-e)/2;a<30&&(a=30),o>this.windowHeight&&this.currentModal.height(this.windowHeight-a-5+"px"),this.currentModal.css("left",i+"px"),this.currentModal.css("top",a+"px"),this.currentModal.css("height",o),this.currentModal.show(),t(".maxmodal_overlay").show(),t("body").addClass("max-modal-active"),t(document).off("keydown",t.proxy(this.keyPressHandler,this)),t(document).on("keydown",t.proxy(this.keyPressHandler,this)),this.currentModal.focus()},maxModal.prototype.keyPressHandler=function(t){27===t.keyCode&&this.close()},maxModal.prototype.checkResize=function(){this.windowHeight=t(window).height(),this.windowWidth=t(window).width(),null!==this.currentModal&&(this.currentModal.removeAttr("style"),this.currentModal.find(".modal_content").removeAttr("style"),this.show())},maxModal.prototype.close=function(){this.currentModal.trigger("modal_close",[this]),this.currentModal.remove(),this.currentModal=null,t(".maxmodal_overlay").remove(),t("body").removeClass("max-modal-active"),t(document).off("keydown",t.proxy(this.keyPressHandler,this))},maxModal.prototype.fadeOut=function(t){void 0==typeof t&&(t=600);var o=this;this.currentModal.fadeOut(t,function(){o.close()})},maxModal.prototype.setTitle=function(t){this.currentModal.find(".modal_title").text(t)},maxModal.prototype.setControls=function(o){var e=this.currentModal.find(".modal_content"),a=t('<div class="controls">');for(i=0;i<this.controls.length;i++)a.append(this.controls[i]);void 0!==o&&a.append(o),e.append(a),t(this.currentModal).find(".modal_close").off("click"),t(this.currentModal).find(".modal_close").on("click",t.proxy(this.close,this))},maxModal.prototype.addControl=function(o,e,a){var i="";switch(o){case"yes":i=modaltext.yes;break;case"ok":i=modaltext.ok;break;case"no":i=modaltext.no;break;case"cancel":i=modaltext.cancel;break;case"insert":i=mbtrans.insert}var d=t('<a class="button-primary '+o+'">'+i+"</a>");d.on("click",e,a),this.controls.push(d)},maxModal.prototype.setContent=function(t){this.currentModal.find(".modal_content").html(t)},maxModal.prototype.buildModal=function(o){o.preventDefault();var e=t(o.target);void 0===e.data("modal")&&(e=e.parents(".maxmodal")),this.target=e;var a=e.data("modal"),i=t("#"+a);void 0!==i.data("width")?this.setWidth=i.data("width"):this.setWidth=!1,void 0!==i.data("height")?this.setHeight=i.data("height"):this.setHeight=!1;var d=t(i).find(".title").text(),s=t(i).find(".controls").html(),n=t(i).find(".content").html();if(this.newModal(a),this.setTitle(d),this.setContent(n),this.setControls(s),void 0!==t(i).data("load")){var l=i.data("load")+"(modal)",r=new Function("modal",l);try{r(this)}catch(t){console.log("MB Modal Callback Error: "+t.message),console.log("MB Mobdal tried calling: "+l)}}this.show()},maxModal.prototype.newModal=function(o){null!==this.currentModal&&this.close();var e=t('<div class="max-modal '+o+'" > \t\t\t\t\t\t <div class="modal_header"> \t\t\t\t\t\t\t <div class="modal_close dashicons dashicons-no"></div><h3 class="modal_title"></h3> \t\t\t\t\t\t </div> \t\t\t\t\t\t <div class="inner modal_content"></div>\t\t\t\t\t </div>');return t(this.parent).length>0?t(this.parent).append(e):t("body").append(e),t(e).draggable({handle:".modal_header"}),this.modals.push(e),this.currentModal=e,this.controls=[],this},maxModal.prototype.writeOverlay=function(){t(this.parent).append('<div class="maxmodal_overlay"></div>'),t(".maxmodal_overlay").on("click",t.proxy(this.close,this))}});
maxbuttons.php CHANGED
@@ -3,75 +3,75 @@
3
  Plugin Name: MaxButtons
4
  Plugin URI: http://maxbuttons.com
5
  Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
6
- Version: 6.23
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
- Text Domain: maxbuttons
10
  Domain Path: /languages
11
 
12
  Copyright 2017 Max Foundry, LLC (http://maxfoundry.com)
13
  */
14
- namespace MaxButtons;
15
 
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
- define('MAXBUTTONS_VERSION_NUM', '6.23');
20
-
21
- define('MAXBUTTONS_RELEASE',"28 Sep 2017");
22
 
 
23
 
24
- if (! function_exists('MaxButtons\maxbutton_double_load'))
 
25
  {
26
  function maxbutton_double_load()
27
  {
28
  $message = __("Already found an instance of MaxButtons running. Please check if you are trying to activate two MaxButtons plugins and deactivate one. ","maxbuttons" );
29
- echo "<div class='error'><h4>$message</h4></div>";
30
  return;
31
  }
32
  }
33
 
34
- if (function_exists("MaxButtons\MB"))
35
  {
36
  add_action('admin_notices', 'MaxButtons\maxbutton_double_load');
37
  return;
38
- }
39
 
40
 
41
  // In case of development, copy this to wp-config.php
42
  // define("MAXBUTTONS_DEBUG", true);
43
- // define("MAXBUTTONS_BENCHMARK",true);
44
 
45
- require_once("classes/maxbuttons-class.php");
46
 
47
  // core
48
  require_once('classes/button.php');
49
- require_once('classes/buttons.php');
50
- require_once("classes/installation.php");
51
- require_once("classes/max-utils.php");
52
 
53
  // more core
54
- require_once("classes/block.php");
55
 
56
- require_once('classes/field.php');
57
- require_once('classes/blocks.php');
58
 
59
 
60
  require_once("classes/maxCSSParser.php");
61
  require_once("classes/admin-class.php");
62
 
63
- require_once("classes/collections.php");
64
- require_once("classes/collection.php");
65
- require_once("classes/collection-block.php");
66
  require_once("classes/pack.php");
67
  require_once("classes/integrations.php");
68
 
69
- require_once("includes/maxbuttons-admin-helper.php");
70
-
71
 
72
- // external libraries
 
73
  require_once("assets/libraries/scssphp/scss.inc.php");
74
- require_once("assets/libraries/simple-template/simple_template.php");
75
 
76
  if (! class_exists('simple_html_dom_node'))
77
  require_once("assets/libraries/simplehtmldom/simple_html_dom.php");
@@ -84,10 +84,9 @@ if (! function_exists("MaxButtons\MB")) {
84
  return maxButtonsPlugin::getInstance();
85
  }
86
  }
87
- $m = new maxButtonsPlugin();
88
 
89
 
90
  // Activation / deactivation
91
  register_activation_hook(__FILE__, array(maxUtils::namespaceit("maxInstall"),'activation_hook') );
92
  register_deactivation_hook(__FILE__,array(maxUtils::namespaceit("maxInstall"), 'deactivation_hook') );
93
-
3
  Plugin Name: MaxButtons
4
  Plugin URI: http://maxbuttons.com
5
  Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
6
+ Version: 6.24
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
+ Text Domain: maxbuttons
10
  Domain Path: /languages
11
 
12
  Copyright 2017 Max Foundry, LLC (http://maxfoundry.com)
13
  */
14
+ namespace MaxButtons;
15
 
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
+ define('MAXBUTTONS_VERSION_NUM', '6.24');
 
 
20
 
21
+ define('MAXBUTTONS_RELEASE',"10 Nov 2017");
22
 
23
+
24
+ if (! function_exists('MaxButtons\maxbutton_double_load'))
25
  {
26
  function maxbutton_double_load()
27
  {
28
  $message = __("Already found an instance of MaxButtons running. Please check if you are trying to activate two MaxButtons plugins and deactivate one. ","maxbuttons" );
29
+ echo "<div class='error'><h4>$message</h4></div>";
30
  return;
31
  }
32
  }
33
 
34
+ if (function_exists("MaxButtons\MB"))
35
  {
36
  add_action('admin_notices', 'MaxButtons\maxbutton_double_load');
37
  return;
38
+ }
39
 
40
 
41
  // In case of development, copy this to wp-config.php
42
  // define("MAXBUTTONS_DEBUG", true);
43
+ // define("MAXBUTTONS_BENCHMARK",true);
44
 
45
+ require_once("classes/maxbuttons-class.php");
46
 
47
  // core
48
  require_once('classes/button.php');
49
+ require_once('classes/buttons.php');
50
+ require_once("classes/installation.php");
51
+ require_once("classes/max-utils.php");
52
 
53
  // more core
54
+ require_once("classes/block.php");
55
 
56
+ require_once('classes/field.php');
57
+ require_once('classes/blocks.php');
58
 
59
 
60
  require_once("classes/maxCSSParser.php");
61
  require_once("classes/admin-class.php");
62
 
63
+ require_once("classes/collections.php");
64
+ require_once("classes/collection.php");
65
+ require_once("classes/collection-block.php");
66
  require_once("classes/pack.php");
67
  require_once("classes/integrations.php");
68
 
69
+ require_once("includes/maxbuttons-admin-helper.php");
 
70
 
71
+
72
+ // external libraries
73
  require_once("assets/libraries/scssphp/scss.inc.php");
74
+ require_once("assets/libraries/simple-template/simple_template.php");
75
 
76
  if (! class_exists('simple_html_dom_node'))
77
  require_once("assets/libraries/simplehtmldom/simple_html_dom.php");
84
  return maxButtonsPlugin::getInstance();
85
  }
86
  }
87
+ $m = new maxButtonsPlugin();
88
 
89
 
90
  // Activation / deactivation
91
  register_activation_hook(__FILE__, array(maxUtils::namespaceit("maxInstall"),'activation_hook') );
92
  register_deactivation_hook(__FILE__,array(maxUtils::namespaceit("maxInstall"), 'deactivation_hook') );
 
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  === WordPress Button Plugin MaxButtons ===
2
  Contributors: maxfoundry, basszje, arcware, johnbhartley
3
- Tags: wordpress buttons, wordpress button plugin, social icons, css3 button generator, responsive buttons, css wordpress button
4
  Requires at least: 4.0
5
- Tested up to: 4.8.2
6
  Requires PHP: 5.3
7
- Stable tag: 6.23
8
 
9
- WordPress button plugin so powerful and easy to use anyone can create beautiful buttons and social share icons.
10
 
11
  == Description ==
12
- [MaxButtons](https://maxbuttons.com/?utm_source=repowp1&utm_medium=mbrepo&utm_content=mbr_maxbuttons&utm_campaign=mbr_maxbuttons) is one of the most used WordPress button, social share and social icon plugins. Use it to create great-looking CSS3 WordPress buttons on any post or page on your site. Our button editor makes it a snap to generate awesome responsive buttons in very little time. The social share and social icon features allow you to use or modify prebuilt social share and social icons to your delight.
13
 
14
- MaxButtons [WordPress button plugin](https://www.maxbuttons.com/#CSS3/?utm_source=repowbp&utm_medium=mbrepo&utm_content=wordpress_button_plugin&utm_campaign=repowbp) has been going strong for over 4 years and was the first button plugin for WordPress. We regularly update and upgrade MaxButtons and [MaxButtons Pro](https://maxbuttons.com/?utm_source=repomb1&utm_medium=mbrepo&utm_content=mbr_mbpro2&utm_campaign=mbr_mbpro2) plus give terrific, timely support. We take pride in MaxButtons having earned over 500 5 star reviews and over 1.2 million downloads. Here are couple of our favorites.
15
 
16
  > “The best plugin of its kind” - by celito
17
 
@@ -19,7 +19,7 @@ MaxButtons [WordPress button plugin](https://www.maxbuttons.com/#CSS3/?utm_sourc
19
 
20
  > “Easy, clear, and robust. I'm a programmer and can write CSS till the cows come home, but why? Just get it, install it and use it. Then, when you're impressed, buy the pro version” - by jleahy
21
 
22
- Max Foundry also makes the WordPress Gallery plugin [MaxGalleria](https://wordpress.org/plugins/maxgalleria/) and [WordPress Media Folders](https://wordpress.org/plugins/media-library-folders-pro/) plugin for real WordPress Media Library folders.
23
 
24
  = Requirements =
25
 
@@ -28,9 +28,9 @@ Max Foundry also makes the WordPress Gallery plugin [MaxGalleria](https://wordpr
28
 
29
  = WordPress Buttons =
30
 
31
- * [Create WordPress Buttons](https://www.maxbuttons.com/#CSS3/?utm_source=repocreate&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repocreate)
32
  * Getting [Social Icons](https://maxbuttons.com/?utm_source=repoicons1&utm_medium=mbrepo&utm_content=social_sharing&utm_campaign=repoicons1) on your WordPress site.
33
- * [Social Share](https://maxbuttons.com/?utm_source=reposhare&utm_medium=mbrepo&utm_content=social_sharing&utm_campaign=reposhare) on your WordPress site.
34
  * What is a [CSS3 Button Generator](https://maxbuttons.com/?utm_source=repocss3&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=repocss3)?
35
  * [WordPress button](https://maxbuttons.com/product-category/button-packs/?utm_source=repolibs&utm_medium=mbrepo&utm_content=button_pack&utm_campaign=repolibs) library and button sets can make my designers and developers more productive.
36
 
@@ -51,9 +51,9 @@ Max Foundry also makes the WordPress Gallery plugin [MaxGalleria](https://wordpr
51
  * Supports Shortcake plugin to see your buttons in your editor!
52
 
53
 
54
- = Social Share =
55
 
56
- MaxButtons includes [WordPress Social Share](https://maxbuttons.com/?utm_source=repobestss&utm_medium=mbrepo&utm_content=best_social_share&utm_campaign=repobestss) capabilities to let your users show their appreciation for your great content by promoting it through their social networks. MaxButtons ships with a starter set total of 5 beautifully designed social share sets for the following social networks:
57
 
58
  * Facebook
59
  * Twitter
@@ -64,21 +64,21 @@ MaxButtons includes [WordPress Social Share](https://maxbuttons.com/?utm_source=
64
  * VKontakte
65
  * StumbleUpon
66
  * Reddit
67
- * Digg
68
- * Bloglovin
69
 
70
- Use our sets as is or modify them as you would like with our button editor to get just the look and feel you want.
71
 
72
  = Social Icons =
73
 
74
- In addition to promoting your content through MaxButtons social share functions. You can also use or modify our social share icons to promote your social network profiles. Simply select a social icon or make a button, include the link to your profile and post the button shortcode on your page. Social icons are easy with MaxButtons!
75
 
76
 
77
  = MaxButtons Pro =
78
 
79
  Take your buttons to the next level with [MaxButtons Pro](https://www.maxbuttons.com/pricing/?utm_source=repombp&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=repombp)!
80
 
81
- Our premium WordPress plugin for buttons, social share and social icons brings you the [best WordPress button plugin](https://maxbuttons.com/?utm_source=mprepo&utm_medium=mbrepo&utm_content=best_css3_button&utm_campaign=repobestcss3) through continuous feature updating. Upgrading to the Pro version allows you to add icons and images to your custom WordPress buttons. The Pro features allow you to do so much more!
82
 
83
  * **Icon Support** - Add icons to your buttons and customize placement and size.
84
  * **Multi-line text** - Add a second line of text and stylize with font, size and placement.
@@ -86,6 +86,7 @@ Our premium WordPress plugin for buttons, social share and social icons brings y
86
  * **Button Packs** - Ready to use, value priced button sets that make any site good great.
87
  * **Google Analytics** Event Tracking for WordPress Buttons. The best way to see you users’ interactions with buttons in Google Analytics. No coding needed.
88
  * **Import/Export** - Useful for backing up and/or moving your buttons. Also, use any of the great free icons listed on our site.
 
89
  * **Button Search** - for easier management of large button sets.
90
  * **Font Awesome** - easiest WordPress integration
91
  * **Visual Composer** - Integrated with Visual Composer
@@ -93,17 +94,15 @@ Our premium WordPress plugin for buttons, social share and social icons brings y
93
  * **Beaver Builder** Integration
94
  * **Easy Digital Downloads** Purchase and Checkout Button Integration
95
 
96
- MaxButtons Pro includes 17 beautifully designed social share sets plus you can use the advanced functions to design and configure social buttons and icons.
97
-
98
  = WordPress Button Sets =
99
 
100
- In addition to the Basic Buttons and free button packs included with MaxButtons Pro you can also purchase additional professionally designed, production ready button packs from the largest [WordPress button](http://maxbuttons.com/product-category/button-packs/?utm_source=reposets1&utm_medium=mbrepo&utm_content=buttonsets1&utm_campaign=reposets1) library in existence. The library features more than 5,000 buttons. It is the largest WordPress button library in the known universe.
101
 
102
  [Wordpress button sets](https://maxbuttons.com/product-category/button-packs/?utm_source=reposets&utm_medium=mbrepo&utm_content=button_pack&utm_campaign=reposets) make designers and developers much more productive.
103
 
104
  = Free Icons =
105
 
106
- You can add free icons when you create your buttons with MaxButtons Pro so we’ve built one of the largest libraries to inspire you and make your buttons really stand out.
107
 
108
  = Button Shortcode =
109
 
@@ -246,38 +245,47 @@ This depends on the slider plugin you are using. Most of the well-known ones are
246
 
247
  == Changelog ==
248
 
249
- = 6.23 =
 
 
 
 
 
 
 
 
 
250
 
251
  * Fixed font-size in color picker styling
252
  * Adapted to changes on color picker layout ( WP 4.9 Alpha )
253
 
254
- = 6.22 =
255
 
256
  * Fixed bug in External CSS function and is now working again
257
  * Enhanced visibility of 'show shortcode examples' option
258
 
259
- = 6.21 =
260
 
261
  * Feature - Add simple link title to buttons plus shortcode attribute linktitle
262
  * Updated Font Awesome override to work only where needed
263
- * Removed PHP 5.2 check for being not functional
264
 
265
- = 6.20.2 =
266
 
267
  * Fixed issue with window resizes in post / page editor
268
  * Fixed issue with Shortcake integration
269
 
270
  = 6.20.1 =
271
 
272
- * Fix - warnings when using Origins Sitebuilder
273
 
274
- = 6.20 =
275
 
276
  * Big technical update and clean up of code
277
  * Moved plugin to proper use of namespaces
278
  * File:// now allowed for URL's
279
- * Moved color class to mbcolor due to frequent issues with offending plugins.
280
- * Tested for WP 4.8
281
 
282
 
283
  = 6.19.1 =
@@ -523,10 +531,3 @@ please try to deactivate and activate the plugin again
523
 
524
  = 1.24.2 =
525
  Please deactivate and then reactivate before using. If the save button does not work, be sure to clear your browser cache. Also, if the "copy and invert" button does not work, try a hard refresh of your browser or clear your cache.
526
-
527
-
528
-
529
-
530
-
531
-
532
-
1
  === WordPress Button Plugin MaxButtons ===
2
  Contributors: maxfoundry, basszje, arcware, johnbhartley
3
+ Tags: wordpress button plugin, share button, wordpress buttons, css3 button generator, responsive buttons, css wordpress button
4
  Requires at least: 4.0
5
+ Tested up to: 4.9
6
  Requires PHP: 5.3
7
+ Stable tag: 6.24
8
 
9
+ WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
10
 
11
  == Description ==
12
+ [MaxButtons](https://maxbuttons.com/?utm_source=repowp1&utm_medium=mbrepo&utm_content=mbr_maxbuttons&utm_campaign=mbr_maxbuttons) is a powerful WordPress button, share button and social icon plugin. It to creates great-looking CSS3 WordPress buttons on any post or page on your site. Our button editor makes it a snap to generate awesome responsive buttons in very little time. The social share buttons and social icon features allow you to use or modify prebuilt social share and social icons to your delight.
13
 
14
+ MaxButtons [WordPress button plugin](https://www.maxbuttons.com/#CSS3/?utm_source=repowbp&utm_medium=mbrepo&utm_content=wordpress_button_plugin&utm_campaign=repowbp) has been going strong for over 6 years and was the first button plugin for WordPress. MaxButtons has earned over 600 5 star reviews and over 1.5 million downloads. Here are couple of our favorites:
15
 
16
  > “The best plugin of its kind” - by celito
17
 
19
 
20
  > “Easy, clear, and robust. I'm a programmer and can write CSS till the cows come home, but why? Just get it, install it and use it. Then, when you're impressed, buy the pro version” - by jleahy
21
 
22
+ Max Foundry also makes the WordPress Gallery plugin [MaxGalleria](https://maxgalleria.com) and [WordPress Media Folders](https://maxgalleria.com/downloads/media-library-plus-pro/) plugin for real WordPress Media Library folders and [Welcome Mat Pro](https://welcomemat.io).
23
 
24
  = Requirements =
25
 
28
 
29
  = WordPress Buttons =
30
 
31
+ * [Create WordPress Buttons](https://maxbuttons.com/create-wordpress-button/?utm_source=repocreate&utm_medium=mbrepo&utm_content=how-to-create&utm_campaign=repocreate)
32
  * Getting [Social Icons](https://maxbuttons.com/?utm_source=repoicons1&utm_medium=mbrepo&utm_content=social_sharing&utm_campaign=repoicons1) on your WordPress site.
33
+ * [Share Buttons](https://maxbuttons.com/?utm_source=reposhare&utm_medium=mbrepo&utm_content=social_sharing&utm_campaign=reposhare) on your WordPress site.
34
  * What is a [CSS3 Button Generator](https://maxbuttons.com/?utm_source=repocss3&utm_medium=mbrepo&utm_content=what-is-generator&utm_campaign=repocss3)?
35
  * [WordPress button](https://maxbuttons.com/product-category/button-packs/?utm_source=repolibs&utm_medium=mbrepo&utm_content=button_pack&utm_campaign=repolibs) library and button sets can make my designers and developers more productive.
36
 
51
  * Supports Shortcake plugin to see your buttons in your editor!
52
 
53
 
54
+ = Share Buttons =
55
 
56
+ MaxButtons has a [share buttons addon](https://maxbuttons.com/?utm_source=repobestss&utm_medium=mbrepo&utm_content=best_social_share&utm_campaign=repobestss) that includes 7 beautifully designed share button sets for the following social networks:
57
 
58
  * Facebook
59
  * Twitter
64
  * VKontakte
65
  * StumbleUpon
66
  * Reddit
67
+ * Whatsapp
68
+ * Buffer
69
 
70
+ Plus email and print icons.
71
 
72
  = Social Icons =
73
 
74
+ In addition to promoting your content through MaxButtons share buttons you can also use share buttons to promote your social network profiles. Simply select a social icon or make a button, include the link to your profile and post the button shortcode on your page. Social icons are easy with MaxButtons!
75
 
76
 
77
  = MaxButtons Pro =
78
 
79
  Take your buttons to the next level with [MaxButtons Pro](https://www.maxbuttons.com/pricing/?utm_source=repombp&utm_medium=mbrepo&utm_content=MBPro&utm_campaign=repombp)!
80
 
81
+ Our premium WordPress plugin for buttons, share buttons and social icons brings you the [best WordPress button plugin](https://maxbuttons.com/?utm_source=mprepo&utm_medium=mbrepo&utm_content=best_css3_button&utm_campaign=repobestcss3) through continuous feature updating. Upgrading to the Pro version allows you to add icons and images to your custom WordPress buttons. The Pro features allow you to do so much more!
82
 
83
  * **Icon Support** - Add icons to your buttons and customize placement and size.
84
  * **Multi-line text** - Add a second line of text and stylize with font, size and placement.
86
  * **Button Packs** - Ready to use, value priced button sets that make any site good great.
87
  * **Google Analytics** Event Tracking for WordPress Buttons. The best way to see you users’ interactions with buttons in Google Analytics. No coding needed.
88
  * **Import/Export** - Useful for backing up and/or moving your buttons. Also, use any of the great free icons listed on our site.
89
+ * Include images in buttons.
90
  * **Button Search** - for easier management of large button sets.
91
  * **Font Awesome** - easiest WordPress integration
92
  * **Visual Composer** - Integrated with Visual Composer
94
  * **Beaver Builder** Integration
95
  * **Easy Digital Downloads** Purchase and Checkout Button Integration
96
 
 
 
97
  = WordPress Button Sets =
98
 
99
+ In addition to the Basic Buttons and free button packs included with MaxButtons Pro you can also purchase additional professionally designed, production ready button packs from the largest [WordPress button](http://maxbuttons.com/product-category/button-packs/?utm_source=reposets1&utm_medium=mbrepo&utm_content=buttonsets1&utm_campaign=reposets1) library in existence. The library features more than 6,000 buttons. It is the largest WordPress button library in the known universe.
100
 
101
  [Wordpress button sets](https://maxbuttons.com/product-category/button-packs/?utm_source=reposets&utm_medium=mbrepo&utm_content=button_pack&utm_campaign=reposets) make designers and developers much more productive.
102
 
103
  = Free Icons =
104
 
105
+ You can use free icons when you create your buttons with MaxButtons Pro so we’ve built one of the largest libraries to inspire you and make your buttons really stand out.
106
 
107
  = Button Shortcode =
108
 
245
 
246
  == Changelog ==
247
 
248
+ = 6.24 =
249
+
250
+ * Social Share deprecated. For Social Sharing please check the new MaxButton Social Share addon
251
+ * New allowed link URL's schemes - ms-windows-store and steam.
252
+ * Fixed Copy Color interface
253
+ * Improvements how Modals handle scrolling
254
+ * Change / Issue in MaxCSSParser which didn't allow to properly parse Pseudo CSS element which are a parent of the main anchor class.
255
+ * Improvements in editor
256
+
257
+ = 6.23 =
258
 
259
  * Fixed font-size in color picker styling
260
  * Adapted to changes on color picker layout ( WP 4.9 Alpha )
261
 
262
+ = 6.22 =
263
 
264
  * Fixed bug in External CSS function and is now working again
265
  * Enhanced visibility of 'show shortcode examples' option
266
 
267
+ = 6.21 =
268
 
269
  * Feature - Add simple link title to buttons plus shortcode attribute linktitle
270
  * Updated Font Awesome override to work only where needed
271
+ * Removed PHP 5.2 check for being not functional
272
 
273
+ = 6.20.2 =
274
 
275
  * Fixed issue with window resizes in post / page editor
276
  * Fixed issue with Shortcake integration
277
 
278
  = 6.20.1 =
279
 
280
+ * Fix - warnings when using Origins Sitebuilder
281
 
282
+ = 6.20 =
283
 
284
  * Big technical update and clean up of code
285
  * Moved plugin to proper use of namespaces
286
  * File:// now allowed for URL's
287
+ * Moved color class to mbcolor due to frequent issues with offending plugins.
288
+ * Tested for WP 4.8
289
 
290
 
291
  = 6.19.1 =
531
 
532
  = 1.24.2 =
533
  Please deactivate and then reactivate before using. If the save button does not work, be sure to clear your browser cache. Also, if the "copy and invert" button does not work, try a hard refresh of your browser or clear your cache.