WordPress Button Plugin MaxButtons - Version 9.4

Version Description

  • New - Clearer interface showing changes and differences on responsive screens from main button
  • Major improvements in Javascript performance and loading the button editor
  • Screen icon and title on preview window to make more clear which screen is active
  • Updated range input, removed deprecated styles

  • Tweak - Pressing ctrl-s now saves the button.

  • Fix - Preview width / height would in some cases show wrong value when changing screen

  • Fix - Better escaping in query for CSS output

  • Fix - Issue loading gradient color fields in responsive screens

  • Fix - Removing color from color field will now make it transparent

  • Fix - Check on user capability when doing button actions.

Download this release

Release Info

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

Code changes from version 9.3 to 9.4

assets/css/maxmodal.css CHANGED
@@ -20,9 +20,6 @@ body.max-modal-active {
20
  display: none;
21
  background: #ffffff;
22
  border-radius: 4px 4px 4px 4px;
23
- -webkit-border-radius: 4px 4px 4px 4px;
24
- -webkit-box-shadow: -3px -3px 10px rgba(0, 0, 0, 0.5);
25
- -moz-box-shadow: -3px -3px 10px rgba(0, 0, 0, 0.5);
26
  box-shadow: -3px -3px 10px rgba(0, 0, 0, 0.5);
27
  /* Fixes for Beaver Builder, which loads without WP backend styles */
28
  }
20
  display: none;
21
  background: #ffffff;
22
  border-radius: 4px 4px 4px 4px;
 
 
 
23
  box-shadow: -3px -3px 10px rgba(0, 0, 0, 0.5);
24
  /* Fixes for Beaver Builder, which loads without WP backend styles */
25
  }
assets/css/maxmodal.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../scss/maxmodal.scss","../scss/_mixins.scss"],"names":[],"mappings":"AAEA;EACC;;;AAGD;EACE;;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAYA;EACA;ECSA;EACA;EAZA;EACA;EACA;ADuGA;;AAlHA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;ACyDC;ED9EH;IAgCE;;;ACuCE;EDvEJ;IAqCE;;;AAED;EAEE;;AAGF;EACE;;AACA;EAAK;;AAGP;EACE;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AAIH;EACC;EACA;EAIA;;AAED;EAAW;;AACX;EACC;EACA;EACA;;AACA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAUH;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"maxmodal.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../scss/maxmodal.scss","../scss/_mixins.scss"],"names":[],"mappings":"AAEA;EACC;;;AAGD;EACE;;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAYA;EACA;ECGA;EATA;AD6GA;;AAlHA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;ACkDC;EDvEH;IAgCE;;;ACgCE;EDhEJ;IAqCE;;;AAED;EAEE;;AAGF;EACE;;AACA;EAAK;;AAGP;EACE;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AAIH;EACC;EACA;EAIA;;AAED;EAAW;;AACX;EACC;EACA;EACA;;AACA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAUH;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"maxmodal.css"}
assets/css/style.css CHANGED
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
  /* Modal */
3
  .mb_colorpicker {
4
  z-index: 200;
@@ -355,7 +354,6 @@
355
  margin-bottom: 20px;
356
  border: solid 1px #cccccc;
357
  border-radius: 3px 3px 3px 3px;
358
- -webkit-border-radius: 3px 3px 3px 3px;
359
  background-color: #fff;
360
  position: relative;
361
  z-index: 1;
@@ -518,6 +516,16 @@
518
  font-size: 14px;
519
  }
520
  }
 
 
 
 
 
 
 
 
 
 
521
  #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, #maxbuttons .block_sidebar > .inside .option:after, #maxbuttons .block_sidebar > .inside .option:before, #maxbuttons .block_sidebar > .inside .option-design:after, #maxbuttons .block_sidebar > .inside .option-design:before {
522
  clear: both;
523
  }
@@ -535,24 +543,10 @@
535
  display: inline-block;
536
  }
537
  #maxbuttons .option-container > .inside .option .rotate-left, #maxbuttons .block_sidebar > .inside .option .rotate-left {
538
- -webkit-transform: rotate(-45deg);
539
- -moz-transform: rotate(-45deg);
540
- -ms-transform: rotate(-45deg);
541
- -o-transform: rotate(-45deg);
542
  transform: rotate(-45deg);
543
- filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45));
544
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-45), M12=-sin(-45), M21=sin(-45), M22=cos(-45))";
545
- zoom: 1;
546
  }
547
  #maxbuttons .option-container > .inside .option .rotate-right, #maxbuttons .block_sidebar > .inside .option .rotate-right {
548
- -webkit-transform: rotate(45deg);
549
- -moz-transform: rotate(45deg);
550
- -ms-transform: rotate(45deg);
551
- -o-transform: rotate(45deg);
552
  transform: rotate(45deg);
553
- filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45));
554
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(45), M12=-sin(45), M21=sin(45), M22=cos(45))";
555
- zoom: 1;
556
  }
557
  #maxbuttons .option-design {
558
  margin-bottom: 10px;
@@ -662,7 +656,7 @@
662
  }
663
  #maxbuttons .manual-entry h3 {
664
  font-size: 18px;
665
- width: calc(100%);
666
  box-sizing: border-box;
667
  padding: 10px 0;
668
  border-bottom: 1px solid #ccc;
@@ -705,8 +699,6 @@
705
  }
706
  @media (max-width: 780px) {
707
  #maxbuttons .output {
708
- -webkit-box-shadow: 0 0 0 0;
709
- -moz-box-shadow: 0 0 0 0;
710
  box-shadow: 0 0 0 0;
711
  top: 0;
712
  left: 0;
@@ -741,6 +733,9 @@
741
  #maxbuttons .output .inner p {
742
  padding: 5px 0 5px 5px;
743
  }
 
 
 
744
  #maxbuttons .output .input.mbcolor {
745
  float: left;
746
  position: relative;
@@ -754,8 +749,6 @@
754
  bottom: -15px;
755
  left: -270px;
756
  z-index: 102;
757
- -webkit-box-shadow: 4px 1px 5px #ccc;
758
- -moz-box-shadow: 4px 1px 5px #ccc;
759
  box-shadow: 4px 1px 5px #ccc;
760
  }
761
  #maxbuttons .output .note {
@@ -822,7 +815,7 @@
822
  line-height: 1.1;
823
  }
824
  #maxbuttons .copy-warning:before {
825
- content: "";
826
  font-size: 40px;
827
  color: #ff0000;
828
  width: 35px;
@@ -948,11 +941,18 @@
948
  #maxbuttons select.small {
949
  width: auto;
950
  }
 
 
 
 
 
 
951
  #maxbuttons .input {
952
  display: inline-block;
953
  margin-right: 15px;
954
  min-height: 35px;
955
  vertical-align: top;
 
956
  }
957
  #maxbuttons .input img {
958
  vertical-align: middle;
@@ -977,6 +977,12 @@
977
  z-index: 10;
978
  vertical-align: middle;
979
  }
 
 
 
 
 
 
980
  #maxbuttons input[type=text] {
981
  width: 450px;
982
  }
@@ -1226,6 +1232,12 @@
1226
  #maxbuttons .check_button.icon + label i:focus {
1227
  outline: none;
1228
  }
 
 
 
 
 
 
1229
  #maxbuttons .check_button:checked + label {
1230
  background: #ebebeb none repeat scroll 0 0;
1231
  border-color: #999999;
@@ -1344,8 +1356,6 @@
1344
  width: inherit;
1345
  }
1346
  #maxbuttons .input.mbcolor .wp-color-result {
1347
- -webkit-box-shadow: -1px 1px 2px #999;
1348
- -moz-box-shadow: -1px 1px 2px #999;
1349
  box-shadow: -1px 1px 2px #999;
1350
  height: 30px;
1351
  width: 30px;
@@ -1353,6 +1363,12 @@
1353
  position: relative;
1354
  background: unset;
1355
  }
 
 
 
 
 
 
1356
  #maxbuttons .input.mbcolor .wp-color-result:after {
1357
  font-size: 12px;
1358
  line-height: 30px;
@@ -1360,8 +1376,6 @@
1360
  }
1361
  #maxbuttons .input.mbcolor .wp-color-result:focus {
1362
  border-color: #5b9dd9;
1363
- -webkit-box-shadow: 0 0 5px rgba(30, 140, 190, 0.8);
1364
- -moz-box-shadow: 0 0 5px rgba(30, 140, 190, 0.8);
1365
  box-shadow: 0 0 5px rgba(30, 140, 190, 0.8);
1366
  }
1367
  #maxbuttons .input.mbcolor .mb_transparent_wrap {
@@ -1436,8 +1450,12 @@
1436
  }
1437
  #maxbuttons [type=range] {
1438
  -webkit-appearance: none;
 
 
1439
  width: 250px;
1440
- margin-top: 8px;
 
 
1441
  }
1442
  #maxbuttons [type=range]:focus {
1443
  outline: 0;
@@ -1452,69 +1470,86 @@
1452
  background: white;
1453
  }
1454
  #maxbuttons [type=range]::-webkit-slider-runnable-track {
1455
- cursor: pointer;
1456
- height: 5px;
1457
  transition: all 0.2s ease;
1458
  width: 250px;
 
 
1459
  background: #fff;
1460
  border: 1px solid #cfd8dc;
1461
  border-radius: 10px;
1462
  }
1463
  #maxbuttons [type=range]::-webkit-slider-thumb {
 
1464
  background: #179588;
1465
  border: 0px solid #eceff1;
1466
  border-radius: 12px;
1467
- cursor: pointer;
 
1468
  height: 20px;
1469
  width: 20px;
1470
  -webkit-appearance: none;
1471
- margin-top: -8.5px;
1472
  }
1473
  #maxbuttons [type=range]::-moz-range-track {
1474
- cursor: pointer;
1475
- height: 5px;
 
1476
  transition: all 0.2s ease;
1477
  width: 250px;
 
1478
  background: #fff;
1479
  border: 1px solid #cfd8dc;
1480
  border-radius: 10px;
 
1481
  }
1482
  #maxbuttons [type=range]::-moz-range-thumb {
 
1483
  background: #179588;
1484
  border: 0px solid #eceff1;
1485
  border-radius: 12px;
1486
- cursor: pointer;
 
1487
  height: 20px;
1488
  width: 20px;
1489
  }
1490
  #maxbuttons [type=range]::-ms-track {
1491
- cursor: pointer;
1492
- height: 5px;
1493
  transition: all 0.2s ease;
1494
  width: 250px;
 
1495
  background: transparent;
1496
  border-color: transparent;
1497
  border-width: 10px 0;
1498
  color: transparent;
1499
  }
1500
  #maxbuttons [type=range]::-ms-fill-lower {
 
1501
  background: #f2f2f2;
1502
  border: 1px solid #cfd8dc;
1503
  border-radius: 20px;
1504
  }
1505
  #maxbuttons [type=range]::-ms-fill-upper {
 
1506
  background: #fff;
1507
  border: 1px solid #cfd8dc;
1508
  border-radius: 20px;
1509
  }
1510
  #maxbuttons [type=range]::-ms-thumb {
 
1511
  background: #179588;
1512
  border: 0px solid #eceff1;
1513
  border-radius: 12px;
1514
- cursor: pointer;
 
1515
  height: 20px;
1516
  width: 20px;
1517
- margin-top: 0;
 
 
 
1518
  }
1519
  #maxbuttons .support.tiles {
1520
  display: flex;
@@ -1588,7 +1623,6 @@
1588
  border: 0px;
1589
  background: none;
1590
  border-radius: 0 0 0 0;
1591
- -webkit-border-radius: 0 0 0 0;
1592
  }
1593
  #maxbuttons.mb_tabs_active .mb_tab > .title:nth-of-type(1) button {
1594
  top: 0;
 
1
  /* Modal */
2
  .mb_colorpicker {
3
  z-index: 200;
354
  margin-bottom: 20px;
355
  border: solid 1px #cccccc;
356
  border-radius: 3px 3px 3px 3px;
 
357
  background-color: #fff;
358
  position: relative;
359
  z-index: 1;
516
  font-size: 14px;
517
  }
518
  }
519
+ #maxbuttons .option-container > .inside .option .original-tooltip, #maxbuttons .option-container > .inside .option-design .original-tooltip, #maxbuttons .block_sidebar > .inside .option .original-tooltip, #maxbuttons .block_sidebar > .inside .option-design .original-tooltip {
520
+ position: absolute;
521
+ padding: 3px;
522
+ background: #FFFFE1;
523
+ border: 1px solid #000;
524
+ z-index: 99;
525
+ left: 5%;
526
+ top: 100%;
527
+ white-space: nowrap;
528
+ }
529
  #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, #maxbuttons .block_sidebar > .inside .option:after, #maxbuttons .block_sidebar > .inside .option:before, #maxbuttons .block_sidebar > .inside .option-design:after, #maxbuttons .block_sidebar > .inside .option-design:before {
530
  clear: both;
531
  }
543
  display: inline-block;
544
  }
545
  #maxbuttons .option-container > .inside .option .rotate-left, #maxbuttons .block_sidebar > .inside .option .rotate-left {
 
 
 
 
546
  transform: rotate(-45deg);
 
 
 
547
  }
548
  #maxbuttons .option-container > .inside .option .rotate-right, #maxbuttons .block_sidebar > .inside .option .rotate-right {
 
 
 
 
549
  transform: rotate(45deg);
 
 
 
550
  }
551
  #maxbuttons .option-design {
552
  margin-bottom: 10px;
656
  }
657
  #maxbuttons .manual-entry h3 {
658
  font-size: 18px;
659
+ width: 100%;
660
  box-sizing: border-box;
661
  padding: 10px 0;
662
  border-bottom: 1px solid #ccc;
699
  }
700
  @media (max-width: 780px) {
701
  #maxbuttons .output {
 
 
702
  box-shadow: 0 0 0 0;
703
  top: 0;
704
  left: 0;
733
  #maxbuttons .output .inner p {
734
  padding: 5px 0 5px 5px;
735
  }
736
+ #maxbuttons .output .inner p#live-preview-screentitle {
737
+ margin: 0;
738
+ }
739
  #maxbuttons .output .input.mbcolor {
740
  float: left;
741
  position: relative;
749
  bottom: -15px;
750
  left: -270px;
751
  z-index: 102;
 
 
752
  box-shadow: 4px 1px 5px #ccc;
753
  }
754
  #maxbuttons .output .note {
815
  line-height: 1.1;
816
  }
817
  #maxbuttons .copy-warning:before {
818
+ content: "\f534";
819
  font-size: 40px;
820
  color: #ff0000;
821
  width: 35px;
941
  #maxbuttons select.small {
942
  width: auto;
943
  }
944
+ #maxbuttons select.responsive-changed {
945
+ font-weight: 700;
946
+ border-left-width: 4px;
947
+ border-left-color: #0f6a7d;
948
+ border-left-style: solid;
949
+ }
950
  #maxbuttons .input {
951
  display: inline-block;
952
  margin-right: 15px;
953
  min-height: 35px;
954
  vertical-align: top;
955
+ position: relative;
956
  }
957
  #maxbuttons .input img {
958
  vertical-align: middle;
977
  z-index: 10;
978
  vertical-align: middle;
979
  }
980
+ #maxbuttons input.responsive-changed {
981
+ font-weight: 700;
982
+ border-left-width: 4px;
983
+ border-left-color: #0f6a7d;
984
+ border-left-style: solid;
985
+ }
986
  #maxbuttons input[type=text] {
987
  width: 450px;
988
  }
1232
  #maxbuttons .check_button.icon + label i:focus {
1233
  outline: none;
1234
  }
1235
+ #maxbuttons .check_button:checked.responsive-changed + label {
1236
+ font-weight: 700;
1237
+ border-left-width: 4px;
1238
+ border-left-color: #0f6a7d;
1239
+ border-left-style: solid;
1240
+ }
1241
  #maxbuttons .check_button:checked + label {
1242
  background: #ebebeb none repeat scroll 0 0;
1243
  border-color: #999999;
1356
  width: inherit;
1357
  }
1358
  #maxbuttons .input.mbcolor .wp-color-result {
 
 
1359
  box-shadow: -1px 1px 2px #999;
1360
  height: 30px;
1361
  width: 30px;
1363
  position: relative;
1364
  background: unset;
1365
  }
1366
+ #maxbuttons .input.mbcolor .wp-color-result.responsive-changed {
1367
+ font-weight: 700;
1368
+ border-left-width: 4px;
1369
+ border-left-color: #0f6a7d;
1370
+ border-left-style: solid;
1371
+ }
1372
  #maxbuttons .input.mbcolor .wp-color-result:after {
1373
  font-size: 12px;
1374
  line-height: 30px;
1376
  }
1377
  #maxbuttons .input.mbcolor .wp-color-result:focus {
1378
  border-color: #5b9dd9;
 
 
1379
  box-shadow: 0 0 5px rgba(30, 140, 190, 0.8);
1380
  }
1381
  #maxbuttons .input.mbcolor .mb_transparent_wrap {
1450
  }
1451
  #maxbuttons [type=range] {
1452
  -webkit-appearance: none;
1453
+ background: transparent;
1454
+ margin: 10px 0;
1455
  width: 250px;
1456
+ }
1457
+ #maxbuttons [type=range]::-moz-focus-outer {
1458
+ border: 0;
1459
  }
1460
  #maxbuttons [type=range]:focus {
1461
  outline: 0;
1470
  background: white;
1471
  }
1472
  #maxbuttons [type=range]::-webkit-slider-runnable-track {
1473
+ cursor: cursor;
1474
+ height: 10px;
1475
  transition: all 0.2s ease;
1476
  width: 250px;
1477
+ box-sizing: border-box;
1478
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1479
  background: #fff;
1480
  border: 1px solid #cfd8dc;
1481
  border-radius: 10px;
1482
  }
1483
  #maxbuttons [type=range]::-webkit-slider-thumb {
1484
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1485
  background: #179588;
1486
  border: 0px solid #eceff1;
1487
  border-radius: 12px;
1488
+ box-sizing: border-box;
1489
+ cursor: default;
1490
  height: 20px;
1491
  width: 20px;
1492
  -webkit-appearance: none;
1493
+ margin-top: -6px;
1494
  }
1495
  #maxbuttons [type=range]::-moz-range-track {
1496
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1497
+ cursor: cursor;
1498
+ height: 10px;
1499
  transition: all 0.2s ease;
1500
  width: 250px;
1501
+ box-sizing: border-box;
1502
  background: #fff;
1503
  border: 1px solid #cfd8dc;
1504
  border-radius: 10px;
1505
+ height: 5px;
1506
  }
1507
  #maxbuttons [type=range]::-moz-range-thumb {
1508
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1509
  background: #179588;
1510
  border: 0px solid #eceff1;
1511
  border-radius: 12px;
1512
+ box-sizing: border-box;
1513
+ cursor: default;
1514
  height: 20px;
1515
  width: 20px;
1516
  }
1517
  #maxbuttons [type=range]::-ms-track {
1518
+ cursor: cursor;
1519
+ height: 10px;
1520
  transition: all 0.2s ease;
1521
  width: 250px;
1522
+ box-sizing: border-box;
1523
  background: transparent;
1524
  border-color: transparent;
1525
  border-width: 10px 0;
1526
  color: transparent;
1527
  }
1528
  #maxbuttons [type=range]::-ms-fill-lower {
1529
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1530
  background: #f2f2f2;
1531
  border: 1px solid #cfd8dc;
1532
  border-radius: 20px;
1533
  }
1534
  #maxbuttons [type=range]::-ms-fill-upper {
1535
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1536
  background: #fff;
1537
  border: 1px solid #cfd8dc;
1538
  border-radius: 20px;
1539
  }
1540
  #maxbuttons [type=range]::-ms-thumb {
1541
+ box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2), 0 0 0px rgba(13, 13, 13, 0.2);
1542
  background: #179588;
1543
  border: 0px solid #eceff1;
1544
  border-radius: 12px;
1545
+ box-sizing: border-box;
1546
+ cursor: default;
1547
  height: 20px;
1548
  width: 20px;
1549
+ margin-top: 2.5px;
1550
+ }
1551
+ #maxbuttons [type=range]:disabled::-webkit-slider-thumb, #maxbuttons [type=range]:disabled::-moz-range-thumb, #maxbuttons [type=range]:disabled::-ms-thumb, #maxbuttons [type=range]:disabled::-webkit-slider-runnable-track, #maxbuttons [type=range]:disabled::-ms-fill-lower, #maxbuttons [type=range]:disabled::-ms-fill-upper {
1552
+ cursor: not-allowed;
1553
  }
1554
  #maxbuttons .support.tiles {
1555
  display: flex;
1623
  border: 0px;
1624
  background: none;
1625
  border-radius: 0 0 0 0;
 
1626
  }
1627
  #maxbuttons.mb_tabs_active .mb_tab > .title:nth-of-type(1) button {
1628
  top: 0;
assets/css/style.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../scss/_global.scss","../scss/style.scss","../scss/_general.scss","../scss/_overview.scss","../scss/_editor.scss","../scss/_elements.scss","../scss/_collection.scss","../scss/_mixins.scss","../scss/_input_range.scss","../scss/_support.scss","../scss/_settings.scss","../scss/_subtabs.scss","../scss/_feedback.scss","../scss/_ads.scss","../scss/_gopro.scss","../scss/_gosocial.scss"],"names":[],"mappings":";AAEA;AAGC;EACC;;;AAOD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACC;EACI;EACA;EACA;;;AAIN;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AC3CD;EAGC;EACA;ACZD;;AAAA;ACqJA;AAeA;AC2OA;AAyIA;AA+IA;ACvqBA;AA4SA;AA2GA;AChZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AJJA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;EACA;EACA;EACA;EACA;;AAMA;EAEC;;AAED;EACC;EACA;;AAGD;EAAY;;AACZ;EAAU;;AASX;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;EACA;;AK+BC;ELjCF;IAKE;;;AAKD;EAEA;EAEA;EAGA;EACA;;AKeC;ELvBD;IAYC;IACA;;;AAGD;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;;AAEA;EAAO;;AAST;EAAiB;;AAGjB;EACC;IAAQ;;;AC5GR;EAAgB;;AAMhB;EAAQ;;AAIT;EACC;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;;AAGF;EAEC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAED;EAEC;EACA;EACA;EACA;EAEA;EACA;EACA;;AAED;EAEC;;AAKF;EACC;;AAED;EACC;;AAED;EAEC;EAEA;;AIUE;EJdH;IAOE;IACA;;;AAED;EACC;EACA;;AAKF;EACC;;AIJE;EJGH;IAIE;;;AAGF;EACC;EACA;;AACA;EAEC;EACA;EACA;EAEA;EACA;;AASF;EACC;;AAED;EACC;;AAKF;EACC;EACA;;AACA;EACC;;AAEA;EACA;;AAED;EACC;;AAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;;AAMA;EAAgB;EAAsB;EAAuB;;AAC9D;EAAa;;AAMb;EACC;EACA;;AACA;EACC;EACA;EACA;;AAOH;EAEC;EACA;EACA;;AAEA;EACC;EACA;;AACA;EACC;EACC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;;AAOH;EAEE;EACA;EACA;EACA;;AAEA;EACC;;AAED;EACC;;AAED;EACC;EAAiB;;AAElB;EAAK;;AACL;EACE;EACD;;AAGD;EAEC;EACA;EACA;;ACvNH;EAEC;EACA;;AAGA;EACA;EACA;EGmCA;EACA;EHlCA;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;;AAIA;EACC;;AAKA;EAEC;;AACA;EAAU;;AACV;EACC;EACA;;AAIH;EAEC;EAGA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;;AAKD;EACC;EAEC;;AAIH;EACE;;AAIH;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EACC;EACD;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAGA;EAEC;;AAID;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAMH;EACC;;AAMH;EACA;EACA;EACA;;AACA;EAEG;EACA;;AAKF;EACA;EACA;EACA;;AACC;EACC;;AAGD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEC;;AG1HA;EH+GD;IAeC;;;AAKD;EAAoB;;AAKrB;EACC;;AACA;EAAY;;AAGb;EACC;EACA;;AAED;EACC;;AAED;EGpLA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AH6KA;EGrLA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AHkLD;EACA;AAiBA;AAAA;AAAA;AAAA;;AAdA;EACC;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;;AASD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;EACA;EAEA;;AAKC;EACC;;AAED;EAAS;;AAET;EACC;;AACD;EAAI;EAAiB;;AAGnB;EAAS;EACP;;AAKL;EAEE;EACA;EACA;EACA;EAEA;;AGlOD;EH2ND;IAUG;IACA;IACA;IACA;;;AAKH;EAEE;EACA;EACD;EACA;;AAEA;EACC;EACA;EACA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACE;EAED;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;EACF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIF;EACC;;AAED;EAAK;;AACL;EAAI;;AAMN;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AGxUG;EH+TJ;IG/WC;IACA;IACA;IHyXC;IACA;IACA;IACA;IACA;IACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;;AAIF;EACC;;AACA;EAEC;;AAGF;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EG1aF;EACA;EACA;;AH4aA;EACC;EACA;;AAED;EACC;;AAEA;EACC;EACA;;AAED;EACC;;AAED;EAEC;EACA;EACA;;AACA;EAGC;EACA;EACA;EACA;EACA;;AAGA;EAGC;EACA;EACE;EACA;EACA;EACF;EACA;;AASF;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEC;;AAGF;EAEC;;AAUJ;EAAsB;;AAGrB;EACA;;AAID;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;;AAMA;AAGF;AAAA;AAAA;AAAA;;AAIC;EACC;;AAKF;EAEC;;AAID;EAEE;;AAEA;EAEC;;AAEA;EAEC;EACA;EACA;EACA;EACA;EAEA;EAGA;EAEA;EACA;EACA;EACA;EACA;EACA;AAYH;AAAA;AAAA;AAAA;;AAVG;EAEC;;AAED;EAEC;EACA;EACA;;AAMD;EAEC;EAGA;;AACA;EAEC;;AAIF;EAEC;EACA;EACA;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;;AAKH;EAEE;EACA;;AAGH;EAEC;;AACA;EAEC;;AAED;EAAY;;AAOd;EAEC;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;;AAEA;EAAK;;AAGN;EAEE;;AACD;EAEC;EACA;EACA;;AAEA;EACC;;AAED;EAEC;;ACtsBJ;EACC;;AACA;EAAU;;AAGX;EACC;EACA;EAEA;EACA;;AAEA;EAAM;;AACN;EAAY;;AAEV;EAAQ;;AACR;EACC;EACA;;AAKJ;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AASD;EACC;;AEuCG;EFxCJ;IAIE;;;AAED;EACC;EACA;;AAED;EACC;;AAED;EACC;;AAED;EACA;;AAID;EAEC;;AAEA;EACC;;AEcE;EFfH;IAIE;;;AAGF;EAAU;;AEQP;EFRH;IAGE;;;AAOH;EACC;EACA;;AASC;EACC;;AAGF;EAAQ;;AACR;EAAgB;;AAChB;EAAuB;;AACvB;EAA0B;;AAGzB;EACC;;AAIF;EACC;;AAGD;EAA0B;;AACzB;EAAyC;;AAEzC;EACC;;AACC;EACC;;AAKH;EAAiB;EAAoB;;AACrC;EAAQ;;AAER;EAAe;;AE9Cb;EFmDD;IACC;;EACA;IACC;;EAGD;IAAM;;;AAIR;EACC;;AE9DC;EF6DF;IAKG;IACD;IACA;;;AAGF;EACC;;AExEC;EFuEF;IAIE;IACA;;;AAIH;EACC;;AACA;EAAiB;;AElFf;EFgFH;IAKE;;;AAKF;EAAoC;;AACpC;EAAsB;;AAEtB;EACC;EACA;EACA;;AAGC;EAAqB;EAAc;;AACnC;EACC;;AACA;EAAS;EAAiB;;AAC1B;EAA0B;;AAE3B;EAAO;;AACP;EACC;EACA;EACA;EACA;EACA;;AAED;EAAa;EAAiB;EAAc;EAAc;;AAC1D;EAAkB;;AAClB;EAAqB;;AACrB;EACC;EACA;EACA;EACA;EACA;;AAIF;EAAwC;;AACxC;EACE;;AAIH;EAEE;;AAIF;EACE;EACA;;AAQH;EAEC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAIF;EAEC;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AE9LE;EFuLH;IAUE;;;AAGF;EACC;;AAID;EAEC;EACA;EACA;;AACA;EACC;;AAIF;EACK;EACD;EACA;;AAML;EACC;EACA;;AACA;EAAS;;AACT;EAAU;;AAGX;EAEC;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAKF;EAGC;EACA;EACA;AACA;AAAA;AAAA;AAAA;AAAA;;AASD;EAEC;;AAEA;EACC;;AAEA;EACC;;AAGF;EAAQ;;AACP;EAA0B;;AAC1B;EACE;EACA;;AAGF;EAEC;;AAED;EACE;EACA;;AAEF;EAAiC;;AAElC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACG;EACD;EACA;;AAIH;EAAiB;;AACjB;EACC;;AASH;EACC;EACA;;AAEA;EAAmB;;AACnB;EAAqB;EAAa;;AAClC;EACC;;AAED;EEhYA;EACA;EACA;EFgYC;EACA;EACA;EACA;EACA;;AAOA;EACC;EACA;EACA;;AAED;EACC;EEnZF;EACA;EACA;;AFsZC;EAEA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACA;;AACA;EAEC;EACA;;AAIF;EAEC;EACA;;AAIC;EACA;;AAID;EACC;EACA;EACD;EACC;;AACA;EACC;;AAED;EACC;;AAGD;EACE;EACD;EACA;EACA;EACA;EACC;EACF;;AAGA;EACC;EACA;EACA;;AACD;EACE;;AAIF;EACC;EACA;EAEA;EACA;;AACD;EACE;;AAKF;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;;AG3dJ;EACE;EAEA,OApCY;EAqCZ;;AAEA;EACE;;AAEA;EACE;;AAGF;EACE,YA3DQ;;AA8DV;EACE;;AAIJ;EAvCA;EACA,QAhBa;EAiBb;EACA,OAnBY;EA0DV,YAtEU;EAuEV;EACA,eApDW;;AAuDb;EAvCA,YAnCY;EAoCZ;EACA,eAnCa;EAoCb;EACA,QApCa;EAqCb,OApCY;EAwEV;EACA;;AAGF;EArDA;EACA,QAhBa;EAiBb;EACA,OAnBY;EAwEV,YApFU;EAqFV;EACA,eAlEW;;AAqEb;EArDA,YAnCY;EAoCZ;EACA,eAnCa;EAoCb;EACA,QApCa;EAqCb,OApCY;;AAwFZ;EAjEA;EACA,QAhBa;EAiBb;EACA,OAnBY;EAmFV;EACA;EACA;EACA;;AAGF;EAEE;EACA;EACA;;AAGF;EAEE,YA9GU;EA+GV;EACA;;AAGF;EA/EA,YAnCY;EAoCZ;EACA,eAnCa;EAoCb;EACA,QApCa;EAqCb,OApCY;EAgHV;;ACxHJ;EACE;;AAEA;EAEC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;;AAMJ;EACC;EACA;EACA;EACA;;AACA;EACC;;AAEA;EACC;EACA;EACA;;AC7BF;EAEC;;AAEA;EAEC;EACA;EACA;EACA;EACA;;ACXH;EACC;EACA;;AAGD;EACC;EAEA;EACA;;AAEA;EACC;EACA;EACA;;AAKA;EAAa;EAAoB;;AAElC;EAEC;EACA;EACC;EACD;;AACA;EAEC;;AAED;EAEC;;AAOH;EACC;EACA;EJCA;EACA;;AIIC;EAAS;;AACT;EAAS;;AAEV;EACC;;ALpDF;EACC;EACA;;AA8BD;EAEC;;AC8CG;EDhDJ;IAOE;;;AAKD;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AACA;EAAS;;AAEV;EACC;EACA;;AAED;EACC;EACA;EACA;EACA;;AAGF;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EAGE;EACA;;AAIH;EACC;EACA;EAEA;EACA;;AACA;EACC;;AAWF;EACC;EACA;EACA;EACA;;AAQF;EAEE;EAED;EAGA;;AACA;EACC;EACA;EACA;EAEA;EAEA;;AAGA;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAAU;;AACV;EACC;EACA;EACA;EACA;;AAUH;EACC;EACA;EACA;EACA;;AAED;EAAe;;AAKhB;EACC;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;AAqBA;AAAA;AAAA;;AC/IG;ED8GJ;IAeE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;AAED;EACC;EACC;EAEA;;AAUF;EACC;EACA;;AACA;EAAY;;AAYd;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA;EAEA;EACA;EAAW;EACX;EAAY;EAEZ;;AAEA;EACC;EACA;EAEA;EAEA;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;AACD;AAAA;AAAA;AAAA;AAAA;AAAA;;AAMC;EAAK;;AAEJ;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AAED;EACC;EACA;;AAMJ;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACC;;AAIA;EAAkB;EACjB;;AAIF;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAAe;;AACf;EACC;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AACA;EAAO;;AAMV;EACC;EACC;EACD;EACA;EACA;EACA;EACA;;AAIA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AACA;EACC;EACA;;AAIH;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;;ACnVC;ED2UF;IAWE;;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EAA6B;;AAC7B;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;AAEA;EACC;EACA;EACA;EACA;;AAGF;EACC;;AAMH;EACC;EACA;EACA;EACA;;AAWF;EAEC;EACA;;AAEA;EAAuB;;AACtB;EACA;EACA;EAEA;EACA;;AMreD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGC;EAEA;EACC;EAEA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAA+B;EAA6B;;AAC5D;EACC;;AC9BL;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEC;EACA;EACA;;AAEA;EAEC;EACA;;AACA;EACC;;AAIF;EACC;;AAED;EACC;EACC;EACA;EACA;EACD;;AAEA;EACA;EACA;;AAGD;EAEC;;AAEE;EAEA;;AAEA;EAAK;;AACH;EAAI;EAAa;;AAIpB;EAAK;EAAmB;;AAExB;EAAM;;AAGR;EAAI;;AAEJ;EACC;;AAGA;EAEC;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAMH;EACC;EACA;;AAED;EACC;EACA;;AAEC;EACC;EACA;EACA;EACA;EACA;EACA;;AAML;EACC;IACC;;;ACjGA;EACC;EACA;;AAGF;EACE;EACA;EACD;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAIH;EACC;EACA;EACA;;AAEA;EACE;EACA;;AAMH;EACE;EACA;EACA;;AACA;EACC;;AAED;EAEE;EACA;;AAEA;EACC;EACC;;AAEF;EACE;;AAKN;EACE;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACK;;AAEL;EACC;;AAED;EACC;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;;AACG;EACC;EACA;EACA;;AAKL;EACG;;AAEH;EACC;EACA;;AAMH;EAAM;;AACN;EACC;EACA;EACA;EACA;;AAGD;EAAM;;AACN;EAAO;;AAGR;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACC;EACA;EACC;EACA;;AAIF;EACE;;AAGF;EAEE;EACA;EACA;EACC;EACD;;AP1FC;EOoFH;IAUG;IAEA;;;AAKH;EACE;;AAGF;EACE;EACA;;AAGF;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;AAGD;EACE;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AChON;EACI;;AACA;EACE;;AAIH;EAAK;EAAuB;EAAiB;;AAC5C;EACE;EACA;EACA;;AAEF;EAAK;;AACL;EAAU;;AAGd;EACE;;AAGF;EACI;EACA;;AACA;EAAK;;AACL;EACI;EACA;EACA;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA","file":"style.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../scss/_global.scss","../scss/style.scss","../scss/_general.scss","../scss/_overview.scss","../scss/_editor.scss","../scss/_elements.scss","../scss/_collection.scss","../scss/_mixins.scss","../scss/_input_range.scss","../scss/_support.scss","../scss/_settings.scss","../scss/_subtabs.scss","../scss/_feedback.scss","../scss/_ads.scss","../scss/_gopro.scss","../scss/_gosocial.scss"],"names":[],"mappings":"AAEA;AAGC;EACC;;;AAOD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACC;EACI;EACA;EACA;;;AAIN;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AC3CD;EAGC;EACA;ACZD;;AAAA;ACqJA;AAeA;ACwPA;AAmIA;AA+IA;AC9qBA;AAqTA;AA2GA;ACzZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AJJA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;EACA;EACA;EACA;EACA;;AAMA;EAEC;;AAED;EACC;EACA;;AAGD;EAAY;;AACZ;EAAU;;AASX;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;EACA;;AKwBC;EL1BF;IAKE;;;AAKD;EAEA;EAEA;EAGA;EACA;;AKQC;ELhBD;IAYC;IACA;;;AAGD;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;;AAEA;EAAO;;AAST;EAAiB;;AAGjB;EACC;IAAQ;;;AC5GR;EAAgB;;AAMhB;EAAQ;;AAIT;EACC;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;;AAGF;EAEC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAED;EAEC;EACA;EACA;EACA;EAEA;EACA;EACA;;AAED;EAEC;;AAKF;EACC;;AAED;EACC;;AAED;EAEC;EAEA;;AIGE;EJPH;IAOE;IACA;;;AAED;EACC;EACA;;AAKF;EACC;;AIXE;EJUH;IAIE;;;AAGF;EACC;EACA;;AACA;EAEC;EACA;EACA;EAEA;EACA;;AASF;EACC;;AAED;EACC;;AAKF;EACC;EACA;;AACA;EACC;;AAEA;EACA;;AAED;EACC;;AAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;;AAMA;EAAgB;EAAsB;EAAuB;;AAC9D;EAAa;;AAMb;EACC;EACA;;AACA;EACC;EACA;EACA;;AAOH;EAEC;EACA;EACA;;AAEA;EACC;EACA;;AACA;EACC;EACC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;;AAOH;EAEE;EACA;EACA;EACA;;AAEA;EACC;;AAED;EACC;;AAED;EACC;EAAiB;;AAElB;EAAK;;AACL;EACE;EACD;;AAGD;EAEC;EACA;EACA;;ACvNH;EAEC;EACA;;AAGA;EACA;EACA;EG6BA;EH3BA;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;;AAIA;EACC;;AAKA;EAEC;;AACA;EAAU;;AACV;EACC;EACA;;AAIH;EAEC;EAGA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;;AAKD;EACC;EAEC;;AAIH;EACE;;AAIH;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EACC;EACD;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAGA;EAEC;;AAID;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAMH;EACC;;AAMH;EACA;EACA;EACA;;AACA;EAEG;EACA;;AAKF;EACA;EACA;EACA;;AACC;EACC;;AAGD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEC;;AGjIA;EHsHD;IAeC;;;AAKF;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EAAoB;;AAKrB;EACC;;AACA;EAAY;;AAGb;EACC;EACA;;AAED;EACC;;AAED;EGvMA;;AHwMA;EGxMA;;AH8MD;EACA;AAiBA;AAAA;AAAA;AAAA;;AAdA;EACC;EACA;EACA;EACA;EACA;EACA;;AAKD;EACC;;AASD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;EACA;EAEA;;AAKC;EACC;;AAED;EAAS;;AAET;EACC;;AACD;EAAI;EAAiB;;AAGnB;EAAS;EACP;;AAKL;EAEE;EACA;EACA;EACA;EAEA;;AGtPD;EH+OD;IAUG;IACA;IACA;IACA;;;AAKH;EAEE;EACA;EACD;EACA;;AAEA;EACC;EACA;EACA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKD;EACE;EAED;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;EACF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIF;EACC;;AAED;EAAK;;AACL;EAAI;;AAMN;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AG5VG;EHmVJ;IGhYC;IH4YC;IACA;IACA;IACA;IACA;IACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;;AAIF;EACC;;AACA;EACC;;AACA;EAA6B;;AAG/B;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EG3bF;;AH+bA;EACC;EACA;;AAED;EACC;;AAEA;EACC;EACA;;AAED;EACC;;AAED;EAEC;EACA;EACA;;AACA;EAGC;EACA;EACA;EACA;EACA;;AAEA;EAEC;EACA;EACE;EACA;EACA;EACF;EACA;;AAKF;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEC;;AAGF;EAEC;;AAUJ;EAAsB;;AAGrB;EACA;;AAID;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;;AAMA;AAGF;AAAA;AAAA;AAAA;;AAIC;EACC;;AAKF;EAEC;;AAID;EAEE;;AAEA;EAEC;;AAEA;EAEC;EACA;EACA;EACA;EACA;EAEA;EAGA;EAEA;EACA;EACA;EACA;EACA;EACA;AAYH;AAAA;AAAA;AAAA;;AAVG;EAEC;;AAED;EAEC;EACA;EACA;;AAMD;EAEC;EAGA;;AACA;EAEC;;AAIF;EAEC;EACA;EACA;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;;AAKH;EAEE;EACA;;AAGH;EAEC;;AACA;EAEC;;AAED;EAAY;;AAOd;EAEC;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;;AAEA;EAAK;;AAGN;EAEE;;AACD;EAEC;EACA;EACA;;AAEA;EACC;;AAED;EAEC;;AC7sBJ;EACC;;AACA;EAAU;;AEiDR;EACC;EAKA;EACA;EACA;;AFrDJ;EACC;EACA;EAEA;EACA;EACA;;AAEA;EAAM;;AACN;EAAY;;AAEV;EAAQ;;AAGR;EACC;EACA;;AAMJ;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AEeE;EACC;EAKA;EACA;EACA;;AFdJ;EACC;;AE2BG;EF5BJ;IAKE;;;AAED;EACC;EACA;;AAED;EACC;;AAED;EACC;;AAED;EACA;;AAID;EAEC;;AAEA;EACC;;AECE;EFFH;IAIE;;;AAGF;EAAU;;AELP;EFKH;IAGE;;;AAOH;EACC;EACA;;AASC;EACC;;AAGF;EAAQ;;AACR;EAAgB;;AAChB;EAAuB;;AACvB;EAA0B;;AAGzB;EACC;;AAIF;EACC;;AAGD;EAA0B;;AACzB;EAAyC;;AAEzC;EACC;;AACC;EACC;;AAKH;EAAiB;EAAoB;;AACrC;EAAQ;;AAER;EAAe;;AE3Db;EFgED;IACC;;EACA;IACC;;EAGD;IAAM;;;AAIR;EACC;;AE3EC;EF0EF;IAKG;IACD;IACA;;;AAGF;EACC;;AErFC;EFoFF;IAIE;IACA;;;AAIH;EACC;;AACA;EAAiB;;AE/Ff;EF6FH;IAKE;;;AAKF;EAAoC;;AACpC;EAAsB;;AAEtB;EACC;EACA;EACA;;AAGC;EAAqB;EAAc;;AACnC;EACC;;AACA;EAAS;EAAiB;;AAC1B;EAA0B;;AAE3B;EAAO;;AACP;EACC;EACA;EACA;EACA;EACA;;AAED;EAAa;EAAiB;EAAc;EAAc;;AAC1D;EAAkB;;AAClB;EAAqB;;AACrB;EACC;EACA;EACA;EACA;EACA;;AAIF;EAAwC;;AACxC;EACE;;AAIH;EAEE;;AAIF;EACE;EACA;;AAQH;EAEC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AAMF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AAIF;EAEC;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AE5ME;EFqMH;IAUE;;;AAGF;EACC;;AAID;EAEC;EACA;EACA;;AACA;EACC;;AEnPA;EACC;EAKA;EACA;EACA;;AFiPH;EACK;EACD;EACA;;AAML;EACC;EACA;;AACA;EAAS;;AACT;EAAU;;AAGX;EAEC;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAKF;EAGC;EACA;EACA;AACA;AAAA;AAAA;AAAA;AAAA;;AASD;EAEC;;AAEA;EACC;;AAEA;EACC;;AAGF;EAAQ;;AACP;EAA0B;;AAC1B;EACE;EACA;;AAGF;EAEC;;AAED;EACE;EACA;;AAEF;EAAiC;;AAElC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACG;EACD;EACA;;AAIH;EAAiB;;AACjB;EACC;;AASH;EACC;EACA;;AAEA;EAAmB;;AACnB;EAAqB;EAAa;;AAClC;EACC;;AAED;EE7YA;EF+YC;EACA;EACA;EACA;EACA;;AE5XC;EACC;EAKA;EACA;EACA;;AF6XF;EACC;EACA;EACA;;AAED;EACC;EElaF;;AFuaC;EAEA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACA;;AACA;EAEC;EACA;;AAIF;EAEC;EACA;;AAIC;EACA;;AAID;EACC;EACA;EACD;EACC;;AACA;EACC;;AAED;EACC;;AAGD;EACE;EACD;EACA;EACA;EACA;EACC;EACF;;AAGA;EACC;EACA;EACA;;AACD;EACE;;AAIF;EACC;EACA;EAEA;EACA;;AACD;EACE;;AAKF;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;;AGjeJ;EACE;EACA;EACA;EACA,OAxCY;;AA0CZ;EACE;;AAGF;EACE;;AAEA;EACE;;AAGF;EACE,YAlEQ;;AAqEV;EACE;;AAIJ;EA5CA;EACA,QAlBa;EAmBb;EACA,OArBY;EAsBb;EARC;EAmDE,YA7EU;EA8EV;EACA,eA3DW;;AA8Db;EAxDA;EAaA,YAtCY;EAuCZ;EACA,eAtCa;EAuCb;EACA;EACA,QAxCa;EAyCb,OAxCY;EA+EV;EACA;;AAGF;EA9DA;EAIA;EACA,QAlBa;EAmBb;EACA,OArBY;EAsBb;EAyDG,YA3FU;EA4FV;EACA,eAzEW;EA0EX;;AAGF;EAvEA;EAaA,YAtCY;EAuCZ;EACA,eAtCa;EAuCb;EACA;EACA,QAxCa;EAyCb,OAxCY;;AAgGZ;EAvEA;EACA,QAlBa;EAmBb;EACA,OArBY;EAsBb;EAqEG;EACA;EACA;EACA;;AAGF;EAnFA;EAqFE,YAxFoB;EAyFpB;EACA;;AAGF;EA1FA;EA4FE,YAtHU;EAuHV;EACA;;AAGF;EAjGA;EAaA,YAtCY;EAuCZ;EACA,eAtCa;EAuCb;EACA;EACA,QAxCa;EAyCb,OAxCY;EAwHV;;AAIA;EAME;;AC5IN;EACE;;AAEA;EAEC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;;AAMJ;EACC;EACA;EACA;EACA;;AACA;EACC;;AAEA;EACC;EACA;EACA;;AC7BF;EAEC;;AAEA;EAEC;EACA;EACA;EACA;EACA;;ACXH;EACC;EACA;;AAGD;EACC;EAEA;EACA;;AAEA;EACC;EACA;EACA;;AAKA;EAAa;EAAoB;;AAElC;EAEC;EACA;EACC;EACD;;AACA;EAEC;;AAED;EAEC;;AAOH;EACC;EACA;EJLA;;AIWC;EAAS;;AACT;EAAS;;AAEV;EACC;;ALpDF;EACC;EACA;;AA8BD;EAEC;;ACuCG;EDzCJ;IAOE;;;AAKD;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AACA;EAAS;;AAEV;EACC;EACA;;AAED;EACC;EACA;EACA;EACA;;AAGF;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EAGE;EACA;;AAIH;EACC;EACA;EAEA;EACA;;AACA;EACC;;AAWF;EACC;EACA;EACA;EACA;;AAQF;EAEE;EAED;EAGA;;AACA;EACC;EACA;EACA;EAEA;EAEA;;AAGA;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAAU;;AACV;EACC;EACA;EACA;EACA;;AAUH;EACC;EACA;EACA;EACA;;AAED;EAAe;;AAKhB;EACC;EACA;EACA;EACA;;AAID;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;AAqBA;AAAA;AAAA;;ACtJG;EDqHJ;IAeE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;AAED;EACC;EACC;EAEA;;AAUF;EACC;EACA;;AACA;EAAY;;AAYd;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA;EAEA;EACA;EAAW;EACX;EAAY;EAEZ;;AAEA;EACC;EACA;EAEA;EAEA;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;AACD;AAAA;AAAA;AAAA;AAAA;AAAA;;AAMC;EAAK;;AAEJ;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AAED;EACC;EACA;;AAMJ;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACC;;AAIA;EAAkB;EACjB;;AAIF;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAAe;;AACf;EACC;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AACA;EAAO;;AAMV;EACC;EACC;EACD;EACA;EACA;EACA;EACA;;AAIA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AACA;EACC;EACA;;AAIH;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;;AC1VC;EDkVF;IAWE;;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EAA6B;;AAC7B;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;AAEA;EACC;EACA;EACA;EACA;;AAGF;EACC;;AAMH;EACC;EACA;EACA;EACA;;AAWF;EAEC;EACA;;AAEA;EAAuB;;AACtB;EACA;EACA;EAEA;EACA;;AMreD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGC;EAEA;EACC;EAEA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAA+B;EAA6B;;AAC5D;EACC;;AC9BL;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEC;EACA;EACA;;AAEA;EAEC;EACA;;AACA;EACC;;AAIF;EACC;;AAED;EACC;EACC;EACA;EACA;EACD;;AAEA;EACA;EACA;;AAGD;EAEC;;AAEE;EAEA;;AAEA;EAAK;;AACH;EAAI;EAAa;;AAIpB;EAAK;EAAmB;;AAExB;EAAM;;AAGR;EAAI;;AAEJ;EACC;;AAGA;EAEC;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAMH;EACC;EACA;;AAED;EACC;EACA;;AAEC;EACC;EACA;EACA;EACA;EACA;EACA;;AAML;EACC;IACC;;;ACjGA;EACC;EACA;;AAGF;EACE;EACA;EACD;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAIH;EACC;EACA;EACA;;AAEA;EACE;EACA;;AAMH;EACE;EACA;EACA;;AACA;EACC;;AAED;EAEE;EACA;;AAEA;EACC;EACC;;AAEF;EACE;;AAKN;EACE;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACK;;AAEL;EACC;;AAED;EACC;EACA;EACA;EACA;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;AAED;EACC;EACA;;AACG;EACC;EACA;EACA;;AAKL;EACG;;AAEH;EACC;EACA;;AAMH;EAAM;;AACN;EACC;EACA;EACA;EACA;;AAGD;EAAM;;AACN;EAAO;;AAGR;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACC;EACA;EACC;EACA;;AAIF;EACE;;AAGF;EAEE;EACA;EACA;EACC;EACD;;APjGC;EO2FH;IAUG;IAEA;;;AAKH;EACE;;AAGF;EACE;EACA;;AAGF;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;AAGD;EACE;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AChON;EACI;;AACA;EACE;;AAIH;EAAK;EAAuB;EAAiB;;AAC5C;EACE;EACA;EACA;;AAEF;EAAK;;AACL;EAAU;;AAGd;EACE;;AAGF;EACI;EACA;;AACA;EAAK;;AACL;EACI;EACA;EACA;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA","file":"style.css"}
assets/libraries/alpha-color/alpha-color-picker.js CHANGED
@@ -4,15 +4,18 @@
4
  * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
5
  * Only run in input and is defined data alpha in true
6
  *
7
- * Version: 3.0.0
8
  * https://github.com/kallookoo/wp-color-picker-alpha
9
  * Licensed under the GPLv2 license or later.
10
  */
11
 
 
 
 
12
  ( function( $, undef ) {
13
 
14
  var wpColorPickerAlpha = {
15
- 'version' : 300
16
  };
17
 
18
  // Always try to use the last version of this script.
@@ -126,8 +129,15 @@
126
  var self = this,
127
  debounceTimeout = 100,
128
  callback = function( event ){
129
- var val = input.val(),
130
- color = new Color( val ),
 
 
 
 
 
 
 
131
  val = val.replace( /^(#|(rgb|hsl)a?)/, '' ),
132
  type = self.alphaOptions.alphaColorType;
133
 
@@ -542,7 +552,7 @@
542
  self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } );
543
 
544
  // fire change callback if we have one
545
- if ( typeof self.options.change === 'function') {
546
  self.options.change.call( this, event, ui );
547
  }
548
  }
@@ -567,7 +577,7 @@
567
  *
568
  * @since 3.0.0
569
  */
570
- self.toggler.on('click', function() {
571
  if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
572
  self.close();
573
  } else {
@@ -585,7 +595,7 @@
585
  *
586
  * @return {void}
587
  */
588
- el.on('change', function( event ) {
589
  var val = $( this ).val();
590
 
591
  if ( el.hasClass( 'iris-error' ) || val === '' || val.match( /^(#|(rgb|hsl)a?)$/ ) ) {
@@ -611,7 +621,7 @@
611
  *
612
  * @return {void}
613
  */
614
- self.button.on('click', function( event ) {
615
  if ( $( this ).hasClass( 'wp-picker-default' ) ) {
616
  el.val( self.options.defaultColor ).change();
617
  } else if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
@@ -632,4 +642,4 @@
632
  } );
633
  },
634
  } );
635
- } ( jQuery ) );
4
  * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
5
  * Only run in input and is defined data alpha in true
6
  *
7
+ * Version: 3.0.2
8
  * https://github.com/kallookoo/wp-color-picker-alpha
9
  * Licensed under the GPLv2 license or later.
10
  */
11
 
12
+ /* MAXBUTTONS NOTE WHEN UPDATING: _addInputListeners function changed to accomodate for empty input ( == transparant ) -
13
+ */
14
+
15
  ( function( $, undef ) {
16
 
17
  var wpColorPickerAlpha = {
18
+ 'version' : 302
19
  };
20
 
21
  // Always try to use the last version of this script.
129
  var self = this,
130
  debounceTimeout = 100,
131
  callback = function( event ){
132
+ var val = input.val();
133
+ // maxbuttons: make empty input field transparent color
134
+ if (val == '' )
135
+ {
136
+ val = 'rgba(255, 255, 255, 0)'; // if empty, default to white full transp.
137
+ }
138
+
139
+
140
+ var color = new Color( val ),
141
  val = val.replace( /^(#|(rgb|hsl)a?)/, '' ),
142
  type = self.alphaOptions.alphaColorType;
143
 
552
  self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } );
553
 
554
  // fire change callback if we have one
555
+ if ( typeof self.options.change === 'function' ) {
556
  self.options.change.call( this, event, ui );
557
  }
558
  }
577
  *
578
  * @since 3.0.0
579
  */
580
+ self.toggler.on( 'click', function() {
581
  if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
582
  self.close();
583
  } else {
595
  *
596
  * @return {void}
597
  */
598
+ el.on( 'change', function( event ) {
599
  var val = $( this ).val();
600
 
601
  if ( el.hasClass( 'iris-error' ) || val === '' || val.match( /^(#|(rgb|hsl)a?)$/ ) ) {
621
  *
622
  * @return {void}
623
  */
624
+ self.button.on( 'click', function( event ) {
625
  if ( $( this ).hasClass( 'wp-picker-default' ) ) {
626
  el.val( self.options.defaultColor ).change();
627
  } else if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
642
  } );
643
  },
644
  } );
645
+ } )( jQuery );
assets/scss/_editor.scss CHANGED
@@ -208,8 +208,20 @@
208
  {
209
  font-size: 14px;
210
  }
211
- }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
  &:after, &:before { clear: both; }
215
  }
@@ -231,6 +243,7 @@
231
  .rotate-left { @include rotate(-45); }
232
  .rotate-right { @include rotate(45); }
233
  }
 
234
  }
235
 
236
 
@@ -442,8 +455,8 @@
442
  .inner {
443
  padding: 5px;
444
  p {
445
-
446
  padding: 5px 0 5px 5px;
 
447
  }
448
  }
449
  .input.mbcolor {
@@ -489,11 +502,9 @@
489
  width: 3px;
490
  border-left: 1px dashed #000;
491
  border-top: 1px dashed #000;
492
- // border-bottom: 1px dashed #000;
493
- ///transform: rotate(90deg);
494
  span
495
  {
496
- //transform: rotate(90deg);
497
  right: 30px;
498
  transform: rotate(-90deg);
499
  transform-origin: 100% 0;
@@ -501,10 +512,6 @@
501
  line-height: 30px;
502
  display: block;
503
  text-align: center;
504
- // position: absolute;
505
- // margin-right: 8px;
506
- // top: 20px;
507
- //left: -4px;
508
 
509
  }
510
 
208
  {
209
  font-size: 14px;
210
  }
 
211
 
212
+ } //label > label.
213
+ // Tooltip to show changes in responsive from original values.
214
+ .original-tooltip
215
+ {
216
+ position: absolute;
217
+ padding: 3px;
218
+ background: #FFFFE1;
219
+ border: 1px solid #000;
220
+ z-index: 99;
221
+ left: 5%;
222
+ top: 100%;
223
+ white-space: nowrap;
224
+ }
225
 
226
  &:after, &:before { clear: both; }
227
  }
243
  .rotate-left { @include rotate(-45); }
244
  .rotate-right { @include rotate(45); }
245
  }
246
+
247
  }
248
 
249
 
455
  .inner {
456
  padding: 5px;
457
  p {
 
458
  padding: 5px 0 5px 5px;
459
+ &#live-preview-screentitle { margin : 0 }
460
  }
461
  }
462
  .input.mbcolor {
502
  width: 3px;
503
  border-left: 1px dashed #000;
504
  border-top: 1px dashed #000;
505
+
 
506
  span
507
  {
 
508
  right: 30px;
509
  transform: rotate(-90deg);
510
  transform-origin: 100% 0;
512
  line-height: 30px;
513
  display: block;
514
  text-align: center;
 
 
 
 
515
 
516
  }
517
 
assets/scss/_elements.scss CHANGED
@@ -3,6 +3,7 @@
3
  select {
4
  min-width: 150px;
5
  &.small { width: auto; } // small as can be.
 
6
  }
7
 
8
  .input {
@@ -11,16 +12,20 @@ select {
11
  //margin-top: 3px;
12
  min-height: 35px;
13
  vertical-align: top;
 
14
 
15
  img { vertical-align: middle; }
16
  &.mbcolor { min-width: 50px; }
17
  &.checkbox { //padding-top: 8px;
18
- input { margin-top: 0; }
 
 
19
  label {
20
  line-height: 16px;
21
  margin-top: 0 !important;
22
  }
23
  }
 
24
  }
25
 
26
  .maxajax-load-spinner {
@@ -36,12 +41,13 @@ select {
36
 
37
 
38
  input {
39
- // margin-top: 0;
40
- // padding: 3px 4px;
41
  }
42
 
43
  input[type='text'] {
44
  width: 450px;
 
45
  @include bp(780)
46
  {
47
  width: 350px;
@@ -263,6 +269,7 @@ textarea {
263
  .check_button
264
  {
265
  display: none;
 
266
  + label{
267
  background-position: center center;
268
  background-repeat: no-repeat;
@@ -290,7 +297,9 @@ textarea {
290
  outline: none;
291
  }
292
  }
293
-
 
 
294
  &:checked + label {
295
  background: #ebebeb none repeat scroll 0 0;
296
  border-color: #999999;
@@ -423,7 +432,9 @@ textarea {
423
  border: 0;
424
  position: relative;
425
  background: unset;
426
- //
 
 
427
  &:before
428
  {
429
 
3
  select {
4
  min-width: 150px;
5
  &.small { width: auto; } // small as can be.
6
+ @include responsive-changed;
7
  }
8
 
9
  .input {
12
  //margin-top: 3px;
13
  min-height: 35px;
14
  vertical-align: top;
15
+ position: relative;
16
 
17
  img { vertical-align: middle; }
18
  &.mbcolor { min-width: 50px; }
19
  &.checkbox { //padding-top: 8px;
20
+ input { margin-top: 0;
21
+
22
+ }
23
  label {
24
  line-height: 16px;
25
  margin-top: 0 !important;
26
  }
27
  }
28
+
29
  }
30
 
31
  .maxajax-load-spinner {
41
 
42
 
43
  input {
44
+ @include responsive-changed;
45
+
46
  }
47
 
48
  input[type='text'] {
49
  width: 450px;
50
+
51
  @include bp(780)
52
  {
53
  width: 350px;
269
  .check_button
270
  {
271
  display: none;
272
+
273
  + label{
274
  background-position: center center;
275
  background-repeat: no-repeat;
297
  outline: none;
298
  }
299
  }
300
+ &:checked {
301
+ @include responsive-changed('&.responsive-changed + label');
302
+ }
303
  &:checked + label {
304
  background: #ebebeb none repeat scroll 0 0;
305
  border-color: #999999;
432
  border: 0;
433
  position: relative;
434
  background: unset;
435
+
436
+ @include responsive-changed;
437
+
438
  &:before
439
  {
440
 
assets/scss/_input_range.scss CHANGED
@@ -1,9 +1,11 @@
1
  // Styling Cross-Browser Compatible Range Inputs with Sass
2
  // Github: https://github.com/darlanrod/input-range-sass
3
  // Author: Darlan Rod https://github.com/darlanrod
4
- // Version 1.4.1
5
  // MIT License
6
 
 
 
7
  $track-color: #fff !default;
8
  $thumb-color: #179588 !default;
9
 
@@ -17,7 +19,7 @@ $thumb-border-width: 0px !default;
17
  $thumb-border-color: #eceff1 !default;
18
 
19
  $track-width: 250px !default;
20
- $track-height: 5px !default;
21
  $track-shadow-size: 0px !default;
22
  $track-shadow-blur: 0px !default;
23
  $track-shadow-color: rgba(0, 0, 0, .2) !default;
@@ -27,15 +29,18 @@ $track-border-color: #cfd8dc !default;
27
  $track-radius: 10px !default;
28
  $contrast: 5% !default;
29
 
 
 
30
  @mixin shadow($shadow-size, $shadow-blur, $shadow-color) {
31
- //box-shadow: $shadow-size $shadow-size $shadow-blur $shadow-color, 0 0 $shadow-size lighten($shadow-color, 5%);
32
  }
33
 
34
  @mixin track {
35
- cursor: pointer;
36
  height: $track-height;
37
  transition: all .2s ease;
38
  width: $track-width;
 
39
  }
40
 
41
  @mixin thumb {
@@ -43,17 +48,21 @@ $contrast: 5% !default;
43
  background: $thumb-color;
44
  border: $thumb-border-width solid $thumb-border-color;
45
  border-radius: $thumb-radius;
46
- cursor: pointer;
 
47
  height: $thumb-height;
48
  width: $thumb-width;
49
-
50
  }
51
 
52
  [type='range'] {
53
  -webkit-appearance: none;
54
- //margin: $thumb-height / 2 0;
 
55
  width: $track-width;
56
- margin-top: 8px;
 
 
 
57
 
58
  &:focus {
59
  outline: 0;
@@ -82,15 +91,16 @@ $contrast: 5% !default;
82
  &::-webkit-slider-thumb {
83
  @include thumb;
84
  -webkit-appearance: none;
85
- margin-top: ((-$track-border-width * 2 + $track-height) / 2) - ($thumb-height / 2);
86
  }
87
 
88
  &::-moz-range-track {
89
- @include track;
90
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
 
91
  background: $track-color;
92
  border: $track-border-width solid $track-border-color;
93
  border-radius: $track-radius;
 
94
  }
95
 
96
  &::-moz-range-thumb {
@@ -101,26 +111,37 @@ $contrast: 5% !default;
101
  @include track;
102
  background: transparent;
103
  border-color: transparent;
104
- border-width: ($thumb-height / 2) 0;
105
  color: transparent;
106
  }
107
 
108
  &::-ms-fill-lower {
109
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
110
- background: darken($track-color, $contrast);
111
  border: $track-border-width solid $track-border-color;
112
- border-radius: $track-radius * 2;
113
  }
114
 
115
  &::-ms-fill-upper {
116
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
117
  background: $track-color;
118
  border: $track-border-width solid $track-border-color;
119
- border-radius: $track-radius * 2;
120
  }
121
 
122
  &::-ms-thumb {
123
  @include thumb;
124
- margin-top: 0;
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
  }
1
  // Styling Cross-Browser Compatible Range Inputs with Sass
2
  // Github: https://github.com/darlanrod/input-range-sass
3
  // Author: Darlan Rod https://github.com/darlanrod
4
+ // Version 1.5.2
5
  // MIT License
6
 
7
+ @use "sass:math" as math;
8
+
9
  $track-color: #fff !default;
10
  $thumb-color: #179588 !default;
11
 
19
  $thumb-border-color: #eceff1 !default;
20
 
21
  $track-width: 250px !default;
22
+ $track-height: 10px !default;
23
  $track-shadow-size: 0px !default;
24
  $track-shadow-blur: 0px !default;
25
  $track-shadow-color: rgba(0, 0, 0, .2) !default;
29
  $track-radius: 10px !default;
30
  $contrast: 5% !default;
31
 
32
+ $ie-bottom-track-color: darken($track-color, $contrast) !default;
33
+
34
  @mixin shadow($shadow-size, $shadow-blur, $shadow-color) {
35
+ box-shadow: $shadow-size $shadow-size $shadow-blur $shadow-color, 0 0 $shadow-size lighten($shadow-color, 5%);
36
  }
37
 
38
  @mixin track {
39
+ cursor: cursor;
40
  height: $track-height;
41
  transition: all .2s ease;
42
  width: $track-width;
43
+ box-sizing: border-box;
44
  }
45
 
46
  @mixin thumb {
48
  background: $thumb-color;
49
  border: $thumb-border-width solid $thumb-border-color;
50
  border-radius: $thumb-radius;
51
+ box-sizing: border-box;
52
+ cursor: default;
53
  height: $thumb-height;
54
  width: $thumb-width;
 
55
  }
56
 
57
  [type='range'] {
58
  -webkit-appearance: none;
59
+ background: transparent;
60
+ margin: math.div($thumb-height, 2) 0;
61
  width: $track-width;
62
+
63
+ &::-moz-focus-outer {
64
+ border: 0;
65
+ }
66
 
67
  &:focus {
68
  outline: 0;
91
  &::-webkit-slider-thumb {
92
  @include thumb;
93
  -webkit-appearance: none;
94
+ margin-top: (math.div((-$track-border-width * 2 + $track-height), 2) - math.div($thumb-height, 2));
95
  }
96
 
97
  &::-moz-range-track {
 
98
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
99
+ @include track;
100
  background: $track-color;
101
  border: $track-border-width solid $track-border-color;
102
  border-radius: $track-radius;
103
+ height: math.div($track-height, 2);
104
  }
105
 
106
  &::-moz-range-thumb {
111
  @include track;
112
  background: transparent;
113
  border-color: transparent;
114
+ border-width: math.div($thumb-height, 2) 0;
115
  color: transparent;
116
  }
117
 
118
  &::-ms-fill-lower {
119
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
120
+ background: $ie-bottom-track-color;
121
  border: $track-border-width solid $track-border-color;
122
+ border-radius: ($track-radius * 2);
123
  }
124
 
125
  &::-ms-fill-upper {
126
  @include shadow($track-shadow-size, $track-shadow-blur, $track-shadow-color);
127
  background: $track-color;
128
  border: $track-border-width solid $track-border-color;
129
+ border-radius: ($track-radius * 2);
130
  }
131
 
132
  &::-ms-thumb {
133
  @include thumb;
134
+ margin-top: math.div($track-height, 4);
135
+ }
136
+
137
+ &:disabled {
138
+ &::-webkit-slider-thumb,
139
+ &::-moz-range-thumb,
140
+ &::-ms-thumb,
141
+ &::-webkit-slider-runnable-track,
142
+ &::-ms-fill-lower,
143
+ &::-ms-fill-upper {
144
+ cursor: not-allowed;
145
+ }
146
  }
147
  }
assets/scss/_mixins.scss CHANGED
@@ -15,25 +15,19 @@
15
  } @else {
16
  background: linear-gradient( $start $stop, $end) $important;
17
  }
18
- //filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$start}', endColorStr='#{$end}');
19
  }
20
 
21
  @mixin user-select($value){
22
  -webkit-user-select: $value;
23
- -moz-user-select: $value;
24
  -ms-user-select: $value;
25
- -o-user-select: $value;
26
  user-select: $value;
27
  }
28
 
29
  @mixin box-shadow($left, $top, $blur, $color,$spread:null, $inset:false, $important:null) {
30
  @if $inset {
31
- -webkit-box-shadow:inset $left $top $blur $spread $color $important;
32
- -moz-box-shadow:inset $left $top $blur $spread $color $important;
33
  box-shadow:inset $left $top $blur $spread $color $important;
34
  } @else {
35
- -webkit-box-shadow: $left $top $blur $spread $color $important;
36
- -moz-box-shadow: $left $top $blur $spread $color $important;
37
  box-shadow: $left $top $blur $spread $color $important;
38
  }
39
  }
@@ -44,32 +38,31 @@
44
  @mixin border-radius($topleft, $topright, $bottomleft, $bottomright)
45
  {
46
  border-radius: $topleft $topright $bottomleft $bottomright;
47
- -webkit-border-radius: $topleft $topright $bottomleft $bottomright;
48
  }
49
 
50
  @mixin rotate( $degrees ) {
51
- -webkit-transform: rotate(#{$degrees}deg);
52
- -moz-transform: rotate(#{$degrees}deg);
53
- -ms-transform: rotate(#{$degrees}deg);
54
- -o-transform: rotate(#{$degrees}deg);
55
  transform: rotate(#{$degrees}deg);
56
-
57
- filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)});
58
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)})";
59
- zoom: 1;
60
  }
61
 
62
 
63
  @mixin transition($property, $duration, $ms: false) {
64
- -webkit-transition: $property $duration ease-in-out;
65
- -moz-transition: $property $duration ease-in-out;
66
- -o-transition: $property $duration ease-in-out;
67
- @if ($ms) {
68
- -ms-transition: $property $duration ease-in-out;
69
- }
70
  transition: $property $duration ease-in-out;
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  @mixin bp($point)
74
  {
75
  @if $point == 480
15
  } @else {
16
  background: linear-gradient( $start $stop, $end) $important;
17
  }
 
18
  }
19
 
20
  @mixin user-select($value){
21
  -webkit-user-select: $value;
 
22
  -ms-user-select: $value;
 
23
  user-select: $value;
24
  }
25
 
26
  @mixin box-shadow($left, $top, $blur, $color,$spread:null, $inset:false, $important:null) {
27
  @if $inset {
 
 
28
  box-shadow:inset $left $top $blur $spread $color $important;
29
  } @else {
30
+
 
31
  box-shadow: $left $top $blur $spread $color $important;
32
  }
33
  }
38
  @mixin border-radius($topleft, $topright, $bottomleft, $bottomright)
39
  {
40
  border-radius: $topleft $topright $bottomleft $bottomright;
 
41
  }
42
 
43
  @mixin rotate( $degrees ) {
 
 
 
 
44
  transform: rotate(#{$degrees}deg);
 
 
 
 
45
  }
46
 
47
 
48
  @mixin transition($property, $duration, $ms: false) {
 
 
 
 
 
 
49
  transition: $property $duration ease-in-out;
50
  }
51
 
52
+ @mixin responsive-changed($classDef:'&.responsive-changed') {
53
+ // class to show that the responsive option not same as default.
54
+ #{$classDef} {
55
+ font-weight: 700;
56
+ // background: #cccccc50;
57
+ //background: linear-gradient(209deg, #0f6a7d 0%, #ebebeb 35%);
58
+ //background-repeat: no-repeat;
59
+ //border-color: #cccccc50;
60
+ border-left-width: 4px;
61
+ border-left-color: #0f6a7d;
62
+ border-left-style: solid;
63
+ }
64
+ }
65
+
66
  @mixin bp($point)
67
  {
68
  @if $point == 480
blocks/advanced.php CHANGED
@@ -109,28 +109,31 @@ class advancedBlock extends maxBlock
109
 
110
  $imp = new maxField('switch');
111
  $imp->note = __('Adding !important to the button styles can help avoid potential conflicts with your theme styles.', 'maxbuttons') ;
112
- $imp->id = 'important_css';
113
  $imp->name = $imp->id;
114
  $imp->value = 1;
115
  $imp->label = __('Use !Important', 'maxbuttons');
116
  $imp->checked = checked($screen->getValue('important_css'), 1, false);
 
117
  $screen->addField($imp, 'start', 'end');
118
 
119
  $class = new maxField();
120
- $class->id = 'extra_classes';
121
  $class->name = $class->id;
122
  $class->label = __("Extra classes","maxbuttons");
123
  $class->value = $screen->getValue($class->id);
124
  $class->note = __("Useful for custom code or other plugins who target classes", "maxbuttons");
125
  $class->help = "<p class='shortcode'>Shortcode attribute : extraclass </p> <p>Using attribute will add classes, not replace them </p> ";
 
126
  $screen->addField($class, 'start', 'end');
127
 
128
  $rel = new maxField();
129
- $rel->id = 'custom_rel';
130
  $rel->name = $rel->id;
131
  $rel->label = __("Custom Rel Tag","maxbuttons");
132
  $rel->value = $screen->getValue($rel->id);
133
  $rel->note = __("Useful when button is targeting lightbox and/or popup plugins that use this method", "maxbuttons");
 
134
  $screen->addField($rel, 'start', 'end');
135
 
136
  // do_action('mb-after-advanced');
@@ -138,29 +141,34 @@ class advancedBlock extends maxBlock
138
  $nocss = new maxField('switch');
139
  $nocss->note = __('Enabling the "Use External CSS" will stop loading any button styling. You will need to put the button style manually', 'maxbuttons');
140
  $nocss->label = __('Use External CSS', 'maxbuttons');
141
- $nocss->id = 'external_css';
142
  $nocss->value = 1;
143
  $nocss->name = $nocss->id;
144
  $nocss->checked = checked($screen->getValue($nocss->id), 1, false);
 
145
  $screen->addField($nocss, 'start');
146
 
147
  $nospace = new maxField('spacer');
148
  $nospace->content = __("Warning: This will remove all styling of the buttons!","maxbuttons");
 
149
  // $nospace->output('','end');
150
  $screen->addField($nospace, '', 'end');
151
 
152
  $viewcss = new maxField('button');
153
- $viewcss->id = 'view_css_modal';
154
  $viewcss->name = $viewcss->id;
155
  $viewcss->label = '&nbsp;';
156
  $viewcss->button_label = __('View CSS', 'maxbuttons');
157
  $viewcss->inputclass = 'maxmodal';
158
  $viewcss->modal = 'view-css';
 
159
  $screen->addField($viewcss, 'start', 'end');
160
 
161
- $this->sidebar($screen);
162
- $endblock = new maxField('block_end');
163
- $screen->addField($endblock);
 
 
164
 
165
  ?>
166
 
@@ -195,6 +203,7 @@ class advancedBlock extends maxBlock
195
  </div>
196
 
197
  <?php
 
198
  } // admin_fields
199
 
200
  } // class
109
 
110
  $imp = new maxField('switch');
111
  $imp->note = __('Adding !important to the button styles can help avoid potential conflicts with your theme styles.', 'maxbuttons') ;
112
+ $imp->id = $screen->getFieldID('important_css');
113
  $imp->name = $imp->id;
114
  $imp->value = 1;
115
  $imp->label = __('Use !Important', 'maxbuttons');
116
  $imp->checked = checked($screen->getValue('important_css'), 1, false);
117
+ $imp->is_responsive = false;
118
  $screen->addField($imp, 'start', 'end');
119
 
120
  $class = new maxField();
121
+ $class->id = $screen->getFieldID('extra_classes');
122
  $class->name = $class->id;
123
  $class->label = __("Extra classes","maxbuttons");
124
  $class->value = $screen->getValue($class->id);
125
  $class->note = __("Useful for custom code or other plugins who target classes", "maxbuttons");
126
  $class->help = "<p class='shortcode'>Shortcode attribute : extraclass </p> <p>Using attribute will add classes, not replace them </p> ";
127
+ $class->is_responsive = false;
128
  $screen->addField($class, 'start', 'end');
129
 
130
  $rel = new maxField();
131
+ $rel->id = $screen->getFieldID('custom_rel');
132
  $rel->name = $rel->id;
133
  $rel->label = __("Custom Rel Tag","maxbuttons");
134
  $rel->value = $screen->getValue($rel->id);
135
  $rel->note = __("Useful when button is targeting lightbox and/or popup plugins that use this method", "maxbuttons");
136
+ $rel->is_responsive = false;
137
  $screen->addField($rel, 'start', 'end');
138
 
139
  // do_action('mb-after-advanced');
141
  $nocss = new maxField('switch');
142
  $nocss->note = __('Enabling the "Use External CSS" will stop loading any button styling. You will need to put the button style manually', 'maxbuttons');
143
  $nocss->label = __('Use External CSS', 'maxbuttons');
144
+ $nocss->id = $screen->getFieldID('external_css');
145
  $nocss->value = 1;
146
  $nocss->name = $nocss->id;
147
  $nocss->checked = checked($screen->getValue($nocss->id), 1, false);
148
+ $nocss->is_responsive = false;
149
  $screen->addField($nocss, 'start');
150
 
151
  $nospace = new maxField('spacer');
152
  $nospace->content = __("Warning: This will remove all styling of the buttons!","maxbuttons");
153
+ $nospace->is_responsive = false;
154
  // $nospace->output('','end');
155
  $screen->addField($nospace, '', 'end');
156
 
157
  $viewcss = new maxField('button');
158
+ $viewcss->id = $screen->getFieldID('view_css_modal');
159
  $viewcss->name = $viewcss->id;
160
  $viewcss->label = '&nbsp;';
161
  $viewcss->button_label = __('View CSS', 'maxbuttons');
162
  $viewcss->inputclass = 'maxmodal';
163
  $viewcss->modal = 'view-css';
164
+ $viewcss->is_responsive = false;
165
  $screen->addField($viewcss, 'start', 'end');
166
 
167
+ $this->sidebar($screen);
168
+ $endblock = new maxField('block_end');
169
+ $screen->addField($endblock);
170
+
171
+ if (false === $screen->is_responsive() && false === $screen->is_new()):
172
 
173
  ?>
174
 
203
  </div>
204
 
205
  <?php
206
+ endif; // not-responsive
207
  } // admin_fields
208
 
209
  } // class
blocks/basic.php CHANGED
@@ -218,11 +218,10 @@ class basicBlock extends maxBlock
218
  public function map_fields($map)
219
  {
220
  $map = parent::map_fields($map);
 
221
  $map["url"]["attr"] = "href";
222
  $map["link_title"]["attr"] = "title";
223
 
224
- // $map["text"]["func"] = "updateAnchorText";
225
-
226
  return $map;
227
  }
228
 
@@ -273,7 +272,7 @@ class basicBlock extends maxBlock
273
  $check_name = $this->check_unique_name($screen->getValue('name'));
274
 
275
  // Name
276
- $field_name = new maxField() ;
277
  $field_name->label = __('Button Name', 'maxbuttons');
278
  $field_name->id = $screen->getFieldID('name');
279
  $field_name->value = $screen->getValue($field_name->id);
218
  public function map_fields($map)
219
  {
220
  $map = parent::map_fields($map);
221
+
222
  $map["url"]["attr"] = "href";
223
  $map["link_title"]["attr"] = "title";
224
 
 
 
225
  return $map;
226
  }
227
 
272
  $check_name = $this->check_unique_name($screen->getValue('name'));
273
 
274
  // Name
275
+ $field_name = new maxField();
276
  $field_name->label = __('Button Name', 'maxbuttons');
277
  $field_name->id = $screen->getFieldID('name');
278
  $field_name->value = $screen->getValue($field_name->id);
blocks/color.php CHANGED
@@ -94,11 +94,7 @@ class colorBlock extends maxBlock
94
  ),
95
  );
96
 
97
- public function map_fields($map)
98
- {
99
- $map = parent::map_fields($map);
100
- return $map;
101
- }
102
  public function parse_css($css, $screens, string $mode = 'normal') {
103
 
104
  $data = $this->getBlockData();
94
  ),
95
  );
96
 
97
+
 
 
 
 
98
  public function parse_css($css, $screens, string $mode = 'normal') {
99
 
100
  $data = $this->getBlockData();
blocks/container.php CHANGED
@@ -111,6 +111,7 @@ class containerBlock extends maxBlock
111
 
112
  public function map_fields($map)
113
  {
 
114
  $map["container_width_unit"]["func"] = "updateContainerUnit";
115
  return $map;
116
  }
111
 
112
  public function map_fields($map)
113
  {
114
+ $map = parent::map_fields($map);
115
  $map["container_width_unit"]["func"] = "updateContainerUnit";
116
  return $map;
117
  }
blocks/responsive.php CHANGED
@@ -190,13 +190,25 @@ class responsiveBlock extends maxBlock
190
  $screen->addField($start_block);
191
 
192
  $explain = new maxField('generic');
193
- $explain->id = $screen->getFieldID('responsive_explain');
194
  $explain->name = $explain->id;
195
  $explain->label = '&nbsp;';
196
  $explain->content = __("<p>Add a Responsive Screen to prepare your button for mobile devices. <br> Put the width and height of the view screen you want this design to be active at. <br> Then click the 'save changes and add screen' button.</p> ", 'maxbuttons');
197
  $explain->is_new = true;
 
198
  $screen->addField($explain, 'start', 'end');
199
 
 
 
 
 
 
 
 
 
 
 
 
200
  $name = new maxField('text');
201
  $name->id = $screen->getFieldID('screen_name');
202
  $name->name = $name->id;
190
  $screen->addField($start_block);
191
 
192
  $explain = new maxField('generic');
193
+ $explain->id = $screen->getFieldID('responsive_explain_new');
194
  $explain->name = $explain->id;
195
  $explain->label = '&nbsp;';
196
  $explain->content = __("<p>Add a Responsive Screen to prepare your button for mobile devices. <br> Put the width and height of the view screen you want this design to be active at. <br> Then click the 'save changes and add screen' button.</p> ", 'maxbuttons');
197
  $explain->is_new = true;
198
+ $explain->is_responsive =false;
199
  $screen->addField($explain, 'start', 'end');
200
 
201
+ $rexplain = new maxField('generic');
202
+ $rexplain->id = $screen->getFieldID('responsive_explain');
203
+ $rexplain->name = $rexplain->id;
204
+ $rexplain->label = '&nbsp';
205
+ $rexplain->content = sprintf(__('%s The button on this screen will show with this layout on the defined screen conditions only. %s %s You can see what fields are different from the main button by the border marking. %s When hovering over the field it will show you the value of the main button : %s %s', 'maxbuttons'), '<p>','</p>', '<p>','<br>', '<input type="text" class="responsive-changed example medium disabled" disabled value="' . __('example', 'maxbuttons') . '" title="' . __('Original value: example', 'maxbuttons') . '">' , '</p>');
206
+
207
+ $rexplain->is_new = false;
208
+ $rexplain->is_default = false;
209
+ $screen->addfield($rexplain, 'start', 'end');
210
+
211
+
212
  $name = new maxField('text');
213
  $name->id = $screen->getFieldID('screen_name');
214
  $name->name = $name->id;
blocks/text.php CHANGED
@@ -82,6 +82,7 @@ class textBlock extends maxBlock
82
  public function map_fields($map)
83
  {
84
  $map = parent::map_fields($map);
 
85
  $map["text"]["func"] = "updateAnchorText";
86
  $map["text_shadow_offset_left"]["func"] = "updateTextShadow";
87
  $map["text_shadow_offset_top"]["func"] = "updateTextShadow";
82
  public function map_fields($map)
83
  {
84
  $map = parent::map_fields($map);
85
+
86
  $map["text"]["func"] = "updateAnchorText";
87
  $map["text_shadow_offset_left"]["func"] = "updateTextShadow";
88
  $map["text_shadow_offset_top"]["func"] = "updateTextShadow";
classes/block.php CHANGED
@@ -416,7 +416,6 @@ abstract class maxBlock
416
 
417
  }
418
  return $map;
419
-
420
  }
421
 
422
  /** Sets the data
@@ -431,9 +430,10 @@ abstract class maxBlock
431
  }
432
 
433
  // simple util function to get blockdata.
434
- protected function getBlockData()
435
  {
436
- return (isset($this->data[$this->blockname])) ? $this->data[$this->blockname] : array();
 
437
  }
438
 
439
- }
416
 
417
  }
418
  return $map;
 
419
  }
420
 
421
  /** Sets the data
430
  }
431
 
432
  // simple util function to get blockdata.
433
+ protected function getBlockData($blockName = null)
434
  {
435
+ $blockName = (! is_null($blockName)) ? $blockName : $this->blockname;
436
+ return (isset($this->data[$blockName])) ? $this->data[$blockName] : array();
437
  }
438
 
439
+ } // class
classes/blocks.php CHANGED
@@ -71,7 +71,6 @@ class maxBlocks
71
  {
72
  if (isset($blockClass[$block]))
73
  $newBlocks[$block] = $blockClass[$block];
74
-
75
  }
76
  }
77
  $blockClass = $newBlocks;
71
  {
72
  if (isset($blockClass[$block]))
73
  $newBlocks[$block] = $blockClass[$block];
 
74
  }
75
  }
76
  $blockClass = $newBlocks;
classes/button.php CHANGED
@@ -346,6 +346,9 @@ class maxButton
346
  // Get Screens again from Class. Blocks parse might override this ( i.e. auto-responsive)
347
  $screens = Screen::getScreens();
348
 
 
 
 
349
  $this->button_css = $css;
350
  $css = $this->getCSSParser()->setScreens($screens);
351
  $css = $this->getCSSParser()->parse($this->button_css);
@@ -530,12 +533,14 @@ class maxButton
530
  if ($args["preview_part"] != 'normal')
531
  {
532
  $domObj->find('a',0)->class .= ' hover';
 
533
  $domObj = $cssParser->outputInline($domObj,'hover');
534
 
535
  }
536
  else
537
  {
538
  $domObj->find('a',0)->class .= ' normal';
 
539
  $domObj = $cssParser->outputInline($domObj);
540
  }
541
 
346
  // Get Screens again from Class. Blocks parse might override this ( i.e. auto-responsive)
347
  $screens = Screen::getScreens();
348
 
349
+ // Start fixing here!
350
+ //echo "<PRE>PARSE " . $this->id . " ;; "; print_R($css); echo "</PRE>";
351
+
352
  $this->button_css = $css;
353
  $css = $this->getCSSParser()->setScreens($screens);
354
  $css = $this->getCSSParser()->parse($this->button_css);
533
  if ($args["preview_part"] != 'normal')
534
  {
535
  $domObj->find('a',0)->class .= ' hover';
536
+ $domObj->find('a', 0)->id = 'maxbuttons_preview_hover';
537
  $domObj = $cssParser->outputInline($domObj,'hover');
538
 
539
  }
540
  else
541
  {
542
  $domObj->find('a',0)->class .= ' normal';
543
+ $domObj->find('a', 0)->id = 'maxbuttons_preview_normal';
544
  $domObj = $cssParser->outputInline($domObj);
545
  }
546
 
classes/buttons.php CHANGED
@@ -127,6 +127,13 @@ class maxButtons
127
  if (! $check)
128
  exit('Invalid Nonce');
129
 
 
 
 
 
 
 
 
130
  switch($action)
131
  {
132
  case "delete":
@@ -194,10 +201,15 @@ class maxButtons
194
  return;
195
 
196
  $idar = explode(',', $id);
197
- $idar = array_filter($idar, 'is_numeric');
198
- $id = implode(',',$idar);
 
 
 
 
 
199
 
200
- $row = $wpdb->get_col($wpdb->prepare("SELECT cache FROM " . maxUtils::get_table_name() . " WHERE id in($id) and status ='%s'", 'publish'));
201
 
202
  header( "Content-type: text/css; charset: UTF-8" );
203
  foreach($row as $content)
127
  if (! $check)
128
  exit('Invalid Nonce');
129
 
130
+ $maxbuttons_capabilities = MB()->get_user_level();
131
+ if (! current_user_can($maxbuttons_capabilities))
132
+ {
133
+ exit('No access rights to do this');
134
+ }
135
+
136
+
137
  switch($action)
138
  {
139
  case "delete":
201
  return;
202
 
203
  $idar = explode(',', $id);
204
+ $idar = array_filter($idar, 'intval');
205
+
206
+ $placeholders = implode(',', array_fill(0, count($idar), '%d' ));
207
+ $data = array_merge($idar, array('publish')); // id's + status
208
+
209
+ $sql = "SELECT cache FROM " . maxUtils::get_table_name() . " WHERE id in($placeholders) and status ='%s'";
210
+ $sql = $wpdb->prepare($sql, $data);
211
 
212
+ $row = $wpdb->get_col($sql);
213
 
214
  header( "Content-type: text/css; charset: UTF-8" );
215
  foreach($row as $content)
classes/controllers/editorController.php CHANGED
@@ -91,6 +91,7 @@ class editorController extends MaxController
91
  $map = array();
92
  $the_map = array();
93
 
 
94
  foreach($blocks as $block)
95
  {
96
 
91
  $map = array();
92
  $the_map = array();
93
 
94
+
95
  foreach($blocks as $block)
96
  {
97
 
classes/field.php CHANGED
@@ -32,7 +32,7 @@ class maxField
32
  public $min; // number
33
  public $is_responsive = true; // available in responsive screens
34
  public $is_default = true; // for default fields.
35
- public $is_new = false; // for new . ( setting both the true will make it for BOTH responsive and new)
36
 
37
  /* Border radius */
38
  public $radius_tl;
32
  public $min; // number
33
  public $is_responsive = true; // available in responsive screens
34
  public $is_default = true; // for default fields.
35
+ public $is_new = false; // for new . ( setting both to true will make it for BOTH responsive and new)
36
 
37
  /* Border radius */
38
  public $radius_tl;
classes/maxCSSParser.php CHANGED
@@ -200,6 +200,13 @@ class maxCSSParser
200
  return false;
201
  }
202
 
 
 
 
 
 
 
 
203
  /** Element is the current element that being parsed. El_add is the parent element that should be put before the subpart
204
  * @param $element CSS class Definition
205
  * @param $el_data DomDoc Element data of this element.
200
  return false;
201
  }
202
 
203
+ // Returns the CSS selector for the responsive screen. Used for custom CSS.
204
+ public function getResponsiveScreenSelector($screen)
205
+ {
206
+ // $deef = $screen->;
207
+ $def = $this->renderResponsiveDefinition();
208
+ }
209
+
210
  /** Element is the current element that being parsed. El_add is the parent element that should be put before the subpart
211
  * @param $element CSS class Definition
212
  * @param $el_data DomDoc Element data of this element.
classes/maxbuttons-class.php CHANGED
@@ -46,8 +46,6 @@ class maxButtonsPlugin
46
  $this->version = MAXBUTTONS_VERSION_NUM;
47
 
48
  $js_url = trailingslashit($this->plugin_url . 'js');
49
- if (! $this->debug_mode)
50
- $js_url .= 'min/';
51
 
52
  $this->js_url = $js_url;
53
 
@@ -289,8 +287,8 @@ class maxButtonsPlugin
289
  return $this->installed_version;
290
  }
291
 
292
- /** Installs and adds the main menu and the submenu items */
293
- public function admin_menu() {
294
  $maxbuttons_capabilities = get_option('maxbuttons_user_level');
295
  if(!$maxbuttons_capabilities) {
296
  $maxbuttons_capabilities = 'manage_options';
@@ -298,9 +296,16 @@ class maxButtonsPlugin
298
  update_option('maxbuttons_user_level', $maxbuttons_capabilities);
299
  }
300
 
 
 
 
 
 
 
 
301
  $page_title = __('MaxButtons: Buttons', 'maxbuttons');
302
  $menu_title = __('MaxButtons', 'maxbuttons');
303
- $capability = $maxbuttons_capabilities;
304
  $admin_capability = 'manage_options';
305
  $menu_slug = 'maxbuttons-controller';
306
  $function = array($this, 'load_admin_page');
@@ -443,8 +448,6 @@ class maxButtonsPlugin
443
  {
444
  $version = MAXBUTTONS_VERSION_NUM;
445
  $js_url = trailingslashit($this->plugin_url . 'js');
446
- if (! $this->debug_mode)
447
- $js_url .= 'min/';
448
 
449
  if ($libname == 'review_notice')
450
  {
@@ -583,6 +586,10 @@ class maxButtonsPlugin
583
  {
584
  wp_register_script('maxbutton-live-preview', $this->js_url . 'live-preview.js',array('maxbutton-admin'), $this->version, true);
585
 
 
 
 
 
586
  wp_enqueue_script('maxbutton-live-preview');
587
 
588
  $this->load_library('fontawesome');
46
  $this->version = MAXBUTTONS_VERSION_NUM;
47
 
48
  $js_url = trailingslashit($this->plugin_url . 'js');
 
 
49
 
50
  $this->js_url = $js_url;
51
 
287
  return $this->installed_version;
288
  }
289
 
290
+ public function get_user_level()
291
+ {
292
  $maxbuttons_capabilities = get_option('maxbuttons_user_level');
293
  if(!$maxbuttons_capabilities) {
294
  $maxbuttons_capabilities = 'manage_options';
296
  update_option('maxbuttons_user_level', $maxbuttons_capabilities);
297
  }
298
 
299
+ return $maxbuttons_capabilities;
300
+ }
301
+
302
+ /** Installs and adds the main menu and the submenu items */
303
+ public function admin_menu() {
304
+
305
+
306
  $page_title = __('MaxButtons: Buttons', 'maxbuttons');
307
  $menu_title = __('MaxButtons', 'maxbuttons');
308
+ $capability = $this->get_user_level();
309
  $admin_capability = 'manage_options';
310
  $menu_slug = 'maxbuttons-controller';
311
  $function = array($this, 'load_admin_page');
448
  {
449
  $version = MAXBUTTONS_VERSION_NUM;
450
  $js_url = trailingslashit($this->plugin_url . 'js');
 
 
451
 
452
  if ($libname == 'review_notice')
453
  {
586
  {
587
  wp_register_script('maxbutton-live-preview', $this->js_url . 'live-preview.js',array('maxbutton-admin'), $this->version, true);
588
 
589
+ wp_localize_script('maxbutton-live-preview', 'lptranslations', array(
590
+ 'originalValue' => __('Original Value: ', 'maxbuttons'),
591
+ ));
592
+
593
  wp_enqueue_script('maxbutton-live-preview');
594
 
595
  $this->load_library('fontawesome');
classes/screen.php CHANGED
@@ -187,8 +187,31 @@ class Screen
187
  if (! $this->isFieldThisScreen($field))
188
  return;
189
 
 
190
  $this->addField($field, $start, $end); // add the field to the array
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  foreach($this->fields as $field_id => $array)
193
  {
194
  if ($field_id == $insert_field)
@@ -206,21 +229,31 @@ class Screen
206
 
207
  // Find position to insert new field
208
  // Yes this could be more efficient.
209
- $new_fields = array();
 
210
  $i = 0;
 
211
  foreach($this->fields as $field_id => $array)
212
  {
213
  if ($i == $insert_pos && $op == 'before')
214
  {
215
  $new_fields[$new_field_id] = $new_field_ar;
 
216
  }
217
  $new_fields[$field_id] = $array;
218
  if ($i == $insert_pos && $op == 'after')
219
  {
220
  $new_fields[$new_field_id] = $new_field_ar;
 
221
  }
222
  $i++;
223
  }
 
 
 
 
 
 
224
  $this->fields = $new_fields;
225
  }
226
 
@@ -320,13 +353,20 @@ class Screen
320
 
321
  }
322
 
 
 
 
 
 
323
  public function getValue($fieldname)
324
  {
325
  if(isset($this->data[$fieldname]))
 
326
  return $this->data[$fieldname];
 
327
  elseif($this->is_responsive && strpos($fieldname, $this->prefix) >= 0) // try to retrieve original value of the responsive field.
328
  {
329
- $prefixless = str_replace($this->prefix, '', $fieldname);
330
 
331
  if (isset($this->data[$prefixless]))
332
  return $this->data[$prefixless];
@@ -352,6 +392,81 @@ public function getColorValue($fieldname)
352
  return $value;
353
  }
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  public function getDefault($fieldname)
356
  {
357
  $fieldDef = maxBlocks::getFieldDefinition($fieldname) ;
187
  if (! $this->isFieldThisScreen($field))
188
  return;
189
 
190
+ //echo "<PRE>"
191
  $this->addField($field, $start, $end); // add the field to the array
192
 
193
+ $added_field_index = array_search($field->id, array_keys($this->fields), true);
194
+ //var_dump($added_field_index);
195
+
196
+ $insert_field_index = array_search($insert_field, array_keys($this->fields), true);
197
+ if ($insert_field_index === false)
198
+ {
199
+ $insert_field_index = count($this->fields) -2; // after the start block field, in the begin of block
200
+ // $op = 'after';
201
+ }
202
+
203
+
204
+ if ($op == 'after')
205
+ {
206
+ $insert_field_index++;
207
+ }
208
+
209
+ $this->fields = array_slice($this->fields, 0, $insert_field_index, true) + array_slice($this->fields, $added_field_index, 1, true) +
210
+ array_slice($this->fields, ($insert_field_index), null, true);
211
+
212
+ return ;
213
+
214
+ // old, @todo can go if no bugs arise.
215
  foreach($this->fields as $field_id => $array)
216
  {
217
  if ($field_id == $insert_field)
229
 
230
  // Find position to insert new field
231
  // Yes this could be more efficient.
232
+ $new_fields = array(); //$this->fields;
233
+ $inserted = false;
234
  $i = 0;
235
+
236
  foreach($this->fields as $field_id => $array)
237
  {
238
  if ($i == $insert_pos && $op == 'before')
239
  {
240
  $new_fields[$new_field_id] = $new_field_ar;
241
+ $inserted = true;
242
  }
243
  $new_fields[$field_id] = $array;
244
  if ($i == $insert_pos && $op == 'after')
245
  {
246
  $new_fields[$new_field_id] = $new_field_ar;
247
+ $inserted = true;
248
  }
249
  $i++;
250
  }
251
+ // This can happen if inserted example is not in responsive screen
252
+ if ( $inserted === false)
253
+ {
254
+ $new_fields[$new_field_id] = $new_field_ar;
255
+ }
256
+
257
  $this->fields = $new_fields;
258
  }
259
 
353
 
354
  }
355
 
356
+ protected function getParentFieldName($fieldname)
357
+ {
358
+ return $prefixless = str_replace($this->prefix, '', $fieldname);
359
+ }
360
+
361
  public function getValue($fieldname)
362
  {
363
  if(isset($this->data[$fieldname]))
364
+ {
365
  return $this->data[$fieldname];
366
+ }
367
  elseif($this->is_responsive && strpos($fieldname, $this->prefix) >= 0) // try to retrieve original value of the responsive field.
368
  {
369
+ $prefixless = $this->getParentFieldName($fieldname); //str_replace($this->prefix, '', $fieldname);
370
 
371
  if (isset($this->data[$prefixless]))
372
  return $this->data[$prefixless];
392
  return $value;
393
  }
394
 
395
+ public function getScreenIcon()
396
+ {
397
+ $screen_type = $this->getScreenType();
398
+ $min_width = $this->getValue($this->getFieldID('min_width'));
399
+
400
+ switch ($screen_type)
401
+ {
402
+ case 'new':
403
+ $icon = 'dashicons-plus';
404
+ break;
405
+ case 'responsive':
406
+ if ($min_width >= 1024)
407
+ $icon = 'dashicons-laptop';
408
+ else
409
+ $icon = 'dashicons-smartphone';
410
+ break;
411
+ case 'default':
412
+ default:
413
+ $icon = 'dashicons-desktop';
414
+ break;
415
+ }
416
+
417
+ return $icon;
418
+ }
419
+
420
+ public function getScreenTitle()
421
+ {
422
+ $min_width = $this->getValue($this->getFieldID('min_width'));
423
+ $max_width = $this->getValue($this->getFieldID('max_width'));
424
+
425
+ $display = $title = '';
426
+
427
+ if ($this->is_default())
428
+ {
429
+ $title = __('Your main button for all screens. ', 'maxbuttons');
430
+
431
+ }
432
+ elseif ($this->is_new())
433
+ {
434
+ $title = __('Add a new responsive screen for mobile devices', 'maxbuttons');
435
+ $display = __('for mobile', 'maxbuttons');
436
+ }
437
+ elseif ($min_width && $max_width)
438
+ {
439
+ $display = $min_width . __('px', 'maxbuttons') . ' - ' . $max_width . __('px', 'maxbuttons');
440
+ $title = sprintf(__('Shows at screen size from %s to %s', 'maxbuttons'), $min_width . __('px', 'maxbuttons'), $max_width . __('px', 'maxbuttons'));
441
+ }
442
+ elseif (! $min_width && $max_width)
443
+ {
444
+ $display = '< ' . $max_width . __('px', 'maxbuttons');
445
+ $title = sprintf(__('Shows at screen size smaller than %s', 'maxbuttons'), $max_width . __('px', 'maxbuttons'));
446
+
447
+ }
448
+ elseif (! $max_width && $min_width)
449
+ {
450
+ $display = '> ' . $min_width . __('px', 'maxbuttons');
451
+ $title = sprintf(__('Shows at screen size bigger than %s', 'maxbuttons'), $min_width . __('px', 'maxbuttons'));
452
+ }
453
+ elseif (! $min_width && ! $max_width) // if somebody does something like this :/
454
+ {
455
+ $display = '';
456
+ $title = sprintf(__('Set width and height to use this responsive screen', 'maxbuttons'));
457
+ }
458
+
459
+ return array($display, $title);
460
+ }
461
+
462
+ public function getScreenType()
463
+ {
464
+ $screen_type = ($this->is_responsive()) ? 'responsive' : 'default';
465
+ $screen_type = ($this->is_new()) ? 'new' : $screen_type;
466
+
467
+ return $screen_type;
468
+ }
469
+
470
  public function getDefault($fieldname)
471
  {
472
  $fieldDef = maxBlocks::getFieldDefinition($fieldname) ;
includes/maxbuttons-button.php CHANGED
@@ -93,7 +93,7 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
93
 
94
  <p><?php printf(__('Create an %s Responsive Screen %s with the +Add button below. You can fully customize your look on mobile devices!', 'maxbuttons'), '<b>', '</b>'); ?></p>
95
 
96
- <h4>Read our Documentation</h4>
97
 
98
  <p><?php _e('More on shortcodes, button sizes, mobile devices: ', 'maxbuttons'); ?>
99
  <a href="https://maxbuttons.com/documentation/" target="_blank"><?php _e('Read our documentation', 'maxbuttons'); ?></a>
@@ -104,8 +104,10 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
104
  <?php endif; ?>
105
 
106
  <!-- preview -->
107
- <div class="output">
108
- <div class="header"><?php _e('Preview', 'maxbuttons') ?>
 
 
109
  <span class='preview-toggle dashicons dashicons-arrow-up'> </span>
110
  </div>
111
 
@@ -132,7 +134,10 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
132
  $width = __('auto', 'maxbuttons');
133
  $w_unit = '';
134
  }
 
 
135
  ?>
 
136
  <p><?php _e('The top is the normal button, the bottom one is the hover.', 'maxbuttons') ?></p>
137
 
138
 
@@ -154,7 +159,7 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
154
 
155
  <input type='hidden' id='colorpicker_current' value=''>
156
 
157
- <div class="input mbcolor preview nodrag">
158
  <input type="text" name="button_preview" id="button_preview" class="mb-color-field" value="#ffffff">
159
  </div>
160
 
@@ -173,8 +178,8 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
173
  $screens = $this->view->screens;
174
  ?>
175
  <?php foreach($screens as $screen): // show screen menu icons
176
- $screen_type = ($screen->is_responsive()) ? 'responsive' : 'default';
177
- $screen_type = ($screen->is_new()) ? 'new' : $screen_type;
178
 
179
  $min_width = $max_width = 0;
180
  if ($screen->is_responsive())
@@ -188,61 +193,14 @@ $admin->get_header(array("title" => $page_title, "title_action" => $action) );
188
 
189
  $current = ($screen->id == $this->view->currentScreen) ? 'option-active' : '';
190
 
191
- switch ($screen_type)
192
- {
193
- case 'new':
194
- $icon = 'dashicons-plus';
195
- break;
196
- case 'responsive':
197
- if ($min_width >= 1024)
198
- $icon = 'dashicons-laptop';
199
- else
200
- $icon = 'dashicons-smartphone';
201
- break;
202
- case 'default':
203
- default:
204
- $icon = 'dashicons-desktop';
205
- break;
206
- }
207
-
208
- $display = '';
209
-
210
- if ($screen->is_default())
211
- {
212
- $title = __('Your main button for all screens. ', 'maxbuttons');
213
- }
214
- elseif ($screen->is_new())
215
- {
216
- $title = __('Add a new responsive screen for mobile devices', 'maxbuttons');
217
- $display = __('for mobile', 'maxbuttons');
218
- }
219
- elseif ($min_width && $max_width)
220
- {
221
- $display = $min_width . __('px', 'maxbuttons') . ' - ' . $max_width . __('px', 'maxbuttons');
222
- $title = sprintf(__('Shows at screen size from %s to %s', 'maxbuttons'), $min_width . __('px', 'maxbuttons'), $max_width . __('px', 'maxbuttons'));
223
- }
224
- elseif (! $min_width && $max_width)
225
- {
226
- $display = '< ' . $max_width . __('px', 'maxbuttons');
227
- $title = sprintf(__('Shows at screen size smaller than %s', 'maxbuttons'), $max_width . __('px', 'maxbuttons'));
228
-
229
- }
230
- elseif (! $max_width && $min_width)
231
- {
232
- $display = '> ' . $min_width . __('px', 'maxbuttons');
233
- $title = sprintf(__('Shows at screen size bigger than %s', 'maxbuttons'), $min_width . __('px', 'maxbuttons'));
234
- }
235
- elseif (! $min_width && ! $max_width) // if somebody does something like this :/
236
- {
237
- $display = '';
238
- $title = sprintf(__('Set width and height to use this responsive screen', 'maxbuttons'));
239
- }
240
 
241
  ?>
242
  <input type="hidden" name="screens[]" value="<?php echo $screen->id ?>" />
243
  <div class='screen-option <?php echo $current ?>' data-screenid="<?php echo $screen->id ?>" data-screentype="<?php echo $screen_type ?>" title="<?php echo $title ?>">
244
  <div class='wrapper'>
245
- <span class='dashicons <?php echo $icon ?>'></span>
246
  <span class='screen_name'><?php echo $screen->name ?></span>
247
  <?php if ($screen->is_responsive() || $screen->is_new()) {
248
  echo "<span class='screen_size'>" . $display . "</span>";
93
 
94
  <p><?php printf(__('Create an %s Responsive Screen %s with the +Add button below. You can fully customize your look on mobile devices!', 'maxbuttons'), '<b>', '</b>'); ?></p>
95
 
96
+ <h4><?php _e('Read our documentation','maxbuttons'); ?></h4>
97
 
98
  <p><?php _e('More on shortcodes, button sizes, mobile devices: ', 'maxbuttons'); ?>
99
  <a href="https://maxbuttons.com/documentation/" target="_blank"><?php _e('Read our documentation', 'maxbuttons'); ?></a>
104
  <?php endif; ?>
105
 
106
  <!-- preview -->
107
+ <div class="output" id='live-preview-modal'>
108
+ <div class="header"><?php _e('Preview', 'maxbuttons') ?> -
109
+ <span id='live-preview-icon' class='dashicons <?php echo $this->getCurrentScreen()->getScreenIcon() ?>'></span>
110
+ <span id='live-preview-screenname'><?php echo $this->getCurrentScreen()->name; ?></span>
111
  <span class='preview-toggle dashicons dashicons-arrow-up'> </span>
112
  </div>
113
 
134
  $width = __('auto', 'maxbuttons');
135
  $w_unit = '';
136
  }
137
+
138
+ $titleAr = $this->getCurrentScreen()->getScreenTitle();
139
  ?>
140
+ <p id='live-preview-screentitle'><?php echo array_pop($titleAr); ?></p>
141
  <p><?php _e('The top is the normal button, the bottom one is the hover.', 'maxbuttons') ?></p>
142
 
143
 
159
 
160
  <input type='hidden' id='colorpicker_current' value=''>
161
 
162
+ <div class="input mbcolor preview nodrag" id="preview_window_colorpicker">
163
  <input type="text" name="button_preview" id="button_preview" class="mb-color-field" value="#ffffff">
164
  </div>
165
 
178
  $screens = $this->view->screens;
179
  ?>
180
  <?php foreach($screens as $screen): // show screen menu icons
181
+
182
+ $screen_type = $screen->getScreenType();
183
 
184
  $min_width = $max_width = 0;
185
  if ($screen->is_responsive())
193
 
194
  $current = ($screen->id == $this->view->currentScreen) ? 'option-active' : '';
195
 
196
+
197
+ list($display, $title ) = $screen->getScreenTitle();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  ?>
200
  <input type="hidden" name="screens[]" value="<?php echo $screen->id ?>" />
201
  <div class='screen-option <?php echo $current ?>' data-screenid="<?php echo $screen->id ?>" data-screentype="<?php echo $screen_type ?>" title="<?php echo $title ?>">
202
  <div class='wrapper'>
203
+ <span class='dashicons <?php echo $screen->getScreenIcon(); ?>' data-screenIcon="<?php echo $screen->getScreenIcon() ?>"></span>
204
  <span class='screen_name'><?php echo $screen->name ?></span>
205
  <?php if ($screen->is_responsive() || $screen->is_new()) {
206
  echo "<span class='screen_size'>" . $display . "</span>";
js/init.js CHANGED
@@ -6,7 +6,6 @@ jQuery(document).ready(function(jq) {
6
 
7
  function runMaxInit()
8
  {
9
- //console.log('** INIT MAXADMIN ** ');
10
 
11
  if (typeof window.maxFoundry === 'undefined')
12
  window.maxFoundry = {};
@@ -18,7 +17,6 @@ jQuery(document).ready(function(jq) {
18
  }
19
  else
20
  {
21
- //console.error('Could not Load Live Preview');
22
  }
23
 
24
  window.maxFoundry.maxadmin = new maxAdmin();
6
 
7
  function runMaxInit()
8
  {
 
9
 
10
  if (typeof window.maxFoundry === 'undefined')
11
  window.maxFoundry = {};
17
  }
18
  else
19
  {
 
20
  }
21
 
22
  window.maxFoundry.maxadmin = new maxAdmin();
js/live-preview.js CHANGED
@@ -1,3 +1,4 @@
 
1
  var $ = jQuery;
2
 
3
  // Here be gathering everything related to live updating MB.
@@ -8,11 +9,17 @@ function maxLivePreview()
8
 
9
  maxLivePreview.prototype = {
10
  fields: {},
 
11
  screens: {},
12
  currentScreen: '',
13
- currentFields: {},
14
  reloadInProgress: false,
15
- reloaded: {} // for partly reloads when doing a screen update.
 
 
 
 
 
16
  }
17
 
18
  maxLivePreview.prototype.init = function ()
@@ -20,6 +27,12 @@ maxLivePreview.prototype.init = function ()
20
  this.loadScreens();
21
  this.bindFields();
22
 
 
 
 
 
 
 
23
  }
24
 
25
  maxLivePreview.prototype.bindFields = function()
@@ -28,37 +41,65 @@ maxLivePreview.prototype.bindFields = function()
28
  $('#maxbuttons input,#maxbuttons textarea').not('.mb-color-field').on('keyup change', $.proxy(this.update_preview_event,this));
29
  $('#maxbuttons select').on('change', $.proxy(this.update_preview_event, this));
30
 
31
- $('#maxbuttons .mb-color-field').wpColorPicker(
32
- {
33
- width: 300,
34
- alpha: true,
35
- palettes: this.colorPalettes,
36
- change: $.proxy( _.throttle(function(event, ui) {
37
-
38
- //var color = ui.color.toString();
39
- this.update_color_event(event,ui);
40
 
41
- }, 300), this),
42
-
43
- });
44
 
45
  // Presets
46
  $('[data-action="set-preset"]').on('click', $.proxy(this.setPreset, this));
47
 
48
  $(document).on('changed_screen', $.proxy(this.changed_screen, this));
 
49
  }
50
 
51
  // on screen change, reload preview.
52
  maxLivePreview.prototype.changed_screen = function(e, screen)
53
  {
54
  // this needs a check to not run the default setup twice.
55
- this.setCurrentScreen('default');
56
- this.reloadFields(); // 'reload/reset' the preview to the main screen.
57
- if (screen != 'default') // no need to reload if not default
58
- {
 
 
59
  this.setCurrentScreen(screen);
60
  this.reloadFields(); // implement overrides of the screen.
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  }
64
 
@@ -66,14 +107,17 @@ maxLivePreview.prototype.reloadFields = function()
66
  {
67
  $(document).trigger('livepreview-reload-start');
68
  this.reloadInProgress = true;
 
69
 
70
- for(var mapfield in this.currentFields)
71
  {
72
- var data = this.fields[this.currentScreen][mapfield];
73
- this.update_preview( $('#' + mapfield), data);
 
74
  }
75
  this.reloadInProgress = false;
76
- this.reloaded = {};
 
77
  $(document).trigger('livepreview-reload-end');
78
  }
79
 
@@ -87,67 +131,153 @@ maxLivePreview.prototype.loadScreens = function ()
87
  var screen_id = $screen.attr('id').replace('screen_', '');
88
  var map = $(this).text();
89
  if (typeof map != 'undefined')
90
- self.fields[screen_id] = JSON.parse(map);
91
-
92
- if ($screen.hasClass('current-screen'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  {
94
  self.setCurrentScreen(screen_id);
95
- }
96
  });
 
97
  }
98
 
99
  // function to help static function to get the proper ID's for the current field.
100
  // byName is optional, signaling to search the field by form name instead of #id ( checkbox, radio )
101
- // byName can result in multiple fields.
102
- maxLivePreview.prototype.getFieldByID = function(name, byName)
 
103
  {
104
- if (typeof byName == 'undefined')
105
- {
106
  byName = false;
107
- }
 
 
 
 
108
 
109
  if (this.currentScreen == 'default')
110
  var id = name;
111
  else
112
- var id = this.currentScreen + '_' + name;
113
-
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  if (byName)
116
  {
117
- var $field = $('input[name="' + id + '"]');
118
  }
119
  else
120
  {
121
- var $field = $('#' + id);
 
 
 
 
 
 
 
122
  }
123
 
124
- return $field;
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
 
127
  maxLivePreview.prototype.setCurrentScreen = function(id)
128
  {
129
  this.currentScreen = id;
130
- this.currentFields = this.fields[id];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
- $(document).trigger('livepreview-screen-set', [id, this.currentFields] );
 
 
 
 
133
  }
134
 
135
  maxLivePreview.prototype.update_preview_event = function(e)
136
  {
137
  e.preventDefault();
138
- var target = $(e.target);
139
 
140
  // migration to data field
141
- var field = $(target).data('field');
142
- var id = $(target).attr('id'); // this should change to be ready for the option to have two the same fields on multi locations.
 
 
 
143
 
144
- var data = this.currentFields[id];
145
 
146
  $(document).trigger('livePreviewUpdate', true);
147
 
148
  if (data !== null)
149
  {
150
- this.update_preview( $('#' + id), data);
151
  }
152
 
153
  }
@@ -156,34 +286,41 @@ maxLivePreview.prototype.update_preview_event = function(e)
156
  * state = csspseudo
157
  * field_id is ID of form field, data is corresponding field data in fieldmap.
158
  */
159
- maxLivePreview.prototype.update_preview = function($field, data)
160
  {
161
 
162
  var state = null;
 
163
  if (typeof data == 'undefined')
 
164
  return; // field doesn't have updates
 
165
 
166
  // check all attributes. Fields can use any of those for different processes.
167
  if (typeof data.css != 'undefined')
168
  {
169
- value = $field.val();
170
 
171
  // a target that is checkbox but not checked should unset (empty) value.
172
- if ($field.is(':checkbox') && ! $field.is(':checked') )
 
173
  value = '';
 
174
 
175
- if ($field.is(':radio') && ! $field.is(':checked') )
 
176
  return; // not our radio update.
177
-
178
  if (typeof data.pseudo !== 'undefined')
179
  {
180
  state = data.pseudo;
181
  }
 
182
  this.putCSS(data, value, state);
183
  }
184
  if (typeof data.attr !== 'undefined')
185
  {
186
- $('.output .result').find('a').attr(data.attr, $field.val());
187
  }
188
 
189
  if (typeof data.func !== 'undefined')
@@ -201,33 +338,157 @@ maxLivePreview.prototype.update_preview = function($field, data)
201
  try
202
  {
203
  var callFunc = new Function ('target', 'self', funcName);
204
- callFunc($field, this);
205
  }
206
  catch(err)
207
  {
208
- console.error(err);
209
  }
210
 
211
  }
212
  };
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  maxLivePreview.prototype.putCSS = function(data,value,state)
215
  {
216
  state = state || 'both';
217
  if (typeof data == 'undefined')
218
  return false;
219
 
220
- var element = '.maxbutton';
 
 
 
221
  if (state == 'hover')
222
- element = 'a.hover ';
 
 
 
223
  else if(state == 'normal')
224
- element = 'a.normal ';
 
 
 
225
 
226
  if (typeof data.unitfield != 'undefined')
227
  {
228
 
229
- var unitfielddata = this.getFieldByID(data.unitfield, true).filter(":checked"); // get by name, radio button
230
- var unitvalue = unitfielddata.val();
 
 
 
 
 
 
231
 
232
  if (value == 0)
233
  value = 'auto';
@@ -242,28 +503,46 @@ maxLivePreview.prototype.putCSS = function(data,value,state)
242
  if (value.indexOf(data.css_unit) == -1)
243
  value += data.css_unit;
244
  }
 
245
  if (typeof data.csspart != 'undefined')
246
  {
247
  var parts = data.csspart.split(",");
248
- for(i=0; i < parts.length; i++)
249
  {
250
  var cpart = parts[i];
251
- var fullpart = element + " ." + cpart;
252
- $('.output .result').find(fullpart).css(data.css, value);
 
 
 
 
 
 
 
 
253
  }
254
  }
255
- else
256
- $('.output .result').find(element).css(data.css, value);
 
 
 
 
 
 
 
 
 
 
257
 
258
  }
259
 
260
  maxLivePreview.prototype.update_color_event = function(event, ui)
261
  {
262
- //event.preventDefault();
263
- console.log('update color field');
264
- var target = $(event.target);
265
  var color = (ui.color.to_s('hex')); // since Alphapicker 3.0
266
- this.update_color(target, ui, color);
267
  $(document).trigger('livePreviewUpdate', true);
268
 
269
  }
@@ -271,22 +550,22 @@ maxLivePreview.prototype.update_color_event = function(event, ui)
271
  maxLivePreview.prototype.update_color = function(field, ui, color)
272
  {
273
  var self = this;
274
- var id = field.attr('id');
275
-
276
 
277
  if (color.indexOf('#') === -1 && color.indexOf('rgba') < 0)
278
  {
279
  color = '#' + color; // add # to color
280
  }
281
 
282
- $('#' + id).val(color); // otherwise field value is running 1 click behind.
 
283
 
284
  // toggle transparency when needed.
285
- if ( $(field).val() == '')
286
  {
287
  $(field).parents('.mbcolor').find('.wp-color-result').children('.the_color').css('background-image', 'url(' + maxadmin_settings.icon_transparent + ')');
288
  if (typeof event.type !== 'undefined' && event.type == 'change')
289
- this.update_color(e, null, 'rgba(0,0,0,0)');
290
  }
291
  else {
292
  $(field).parents('.mbcolor').find('.wp-color-result').children('.the_color').css('background-image', 'none');
@@ -317,7 +596,7 @@ maxLivePreview.prototype.update_color = function(field, ui, color)
317
  else // simple update
318
  {
319
 
320
- var data = this.currentFields[id];
321
  var state = 'normal';
322
  if (typeof data !== 'undefined' && typeof data.pseudo !== 'undefined')
323
  {
@@ -328,58 +607,57 @@ maxLivePreview.prototype.update_color = function(field, ui, color)
328
  }
329
  };
330
 
331
- maxLivePreview.prototype.updateBoxShadow = function (target)
332
  {
333
  // target = target || null;
334
  if (this.reloadInProgress && typeof this.reloaded.boxshadow !== 'undefined')
335
  return;
336
 
337
- var id = $(target).attr('id');
338
 
339
- var left = this.getFieldByID('box_shadow_offset_left').val();
340
- var top = this.getFieldByID("box_shadow_offset_top").val();
341
- var width = this.getFieldByID("box_shadow_width").val();
342
- var spread = this.getFieldByID('box_shadow_spread').val();
343
 
344
- var color = this.getFieldByID("box_shadow_color").val();
345
- var hovcolor = this.getFieldByID("box_shadow_color_hover").val();
346
 
347
  if (color == '') color = 'rgba(0,0,0,0)';
348
  if (hovcolor == '') hovcolor = 'rgba(0,0,0,0)';
349
 
350
- var id = $(target).attr('id');
351
- var data = this.currentFields[id];
352
  if (typeof data == 'undefined') // field not defined.
353
  return;
354
  data.css = 'boxShadow';
355
 
356
- value = left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + color;
357
- value_hover = left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + hovcolor;
358
 
359
  this.putCSS(data, value, 'normal');
360
  this.putCSS(data, value_hover, 'hover');
361
 
362
  this.reloaded.boxshadow = true;
363
- //$('.output .result').find('a.normal').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + color);
364
- //$('.output .result').find('a.hover').css("boxShadow",left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + hovcolor);
365
  }
366
 
367
- maxLivePreview.prototype.updateTextShadow = function(target)
368
  {
369
  // hover = hover || false;
370
  if (this.reloadInProgress && typeof this.reloaded.textshadow !== 'undefined')
371
  return;
372
 
373
- var left = this.getFieldByID("text_shadow_offset_left").val();
374
- var top = this.getFieldByID("text_shadow_offset_top").val();
375
- var width = this.getFieldByID("text_shadow_width").val();
376
 
377
- var color = this.getFieldByID("text_shadow_color").val();
378
- var hovcolor = this.getFieldByID("text_shadow_color_hover").val();
379
 
380
- var id = $(target).attr('id');
 
381
 
382
- var data = this.currentFields[id];
383
  if (typeof data == 'undefined') // field not defined.
384
  return;
385
  data.css = 'textShadow';
@@ -396,7 +674,7 @@ maxLivePreview.prototype.updateTextShadow = function(target)
396
  this.reloaded.textshadow = true;
397
  }
398
 
399
- maxLivePreview.prototype.updateAnchorText = function (target)
400
  {
401
  var preview_text = $('.output .result').find('a .mb-text');
402
 
@@ -408,23 +686,24 @@ maxLivePreview.prototype.updateAnchorText = function (target)
408
 
409
  this.reloadFields();
410
  }
411
- $('.output .result').find('a .mb-text').text(target.val());
412
  }
413
 
414
- maxLivePreview.prototype.updateGradientOpacity = function(target)
415
  {
416
  this.updateGradient(true);
417
  this.updateGradient(false);
418
  }
419
 
420
- maxLivePreview.prototype.updateDimension = function ($field)
421
  {
422
  if (this.reloadInProgress && typeof this.reloaded.dimension !== 'undefined')
 
423
  return;
424
-
425
- var id = $field.data('field');
426
  if (typeof id == 'undefined')
427
- var id = $field.attr('id');
428
  if (typeof id == 'undefined') // still don't want, then no.
429
  return;
430
  var data = {};
@@ -432,23 +711,30 @@ maxLivePreview.prototype.updateDimension = function ($field)
432
  // get the units.
433
  if (id.indexOf('width') >= 0)
434
  {
435
- var $field = this.getFieldByID('button_width');
436
- var $unitfield = this.getFieldByID('button_size_unit_width', true);
437
  data.css = 'width';
438
  var updatePreview = '.preview_border_width span';
439
- var unitUpdate = '.input.' + $field.attr('name') + ' .unit';
440
  }
441
  else if(id.indexOf('height') >= 0)
442
  {
443
- var $field = this.getFieldByID('button_height');
444
- var $unitfield = this.getFieldByID('button_size_unit_height', true);
445
  data.css = 'height';
446
  var updatePreview = '.preview_border_height span';
447
- var unitUpdate = '.input.' + $field.attr('name') + ' .unit';
448
  }
449
 
450
- var dimension = $field.val();
451
- var unit = $unitfield.filter(':checked').val();
 
 
 
 
 
 
 
452
 
453
  if (dimension == 0)
454
  {
@@ -472,32 +758,32 @@ maxLivePreview.prototype.updateDimension = function ($field)
472
  this.reloaded.dimension = true;
473
  }
474
 
475
- maxLivePreview.prototype.updateRadius = function(target)
476
  {
477
  if (this.reloadInProgress && typeof this.reloaded.radius !== 'undefined')
478
  return;
479
 
480
- var value = target.val();
481
  var fields = ['radius_bottom_left', 'radius_bottom_right', 'radius_top_left', 'radius_top_right'];
482
 
483
  var toggle = this.getFieldByID('radius_toggle');
484
 
485
  if ( $(toggle).data('lock') == 'lock')
486
  {
487
- for(i=0; i < fields.length; i++)
488
  {
489
- var $field = this.getFieldByID(fields[i]); // find the real field.
490
- $field.val(value); // set value via locking
491
- var id = $field.attr('id'); // get the real id, from element.
492
- var data = this.currentFields[id];
493
  this.putCSS(data,value + 'px'); // update
494
 
495
  }
496
  }
497
  else { // update as regular single field
498
- var value = $(target).val();
499
- var id = $(target).attr('id');
500
- var data = this.currentFields[id];
501
  this.putCSS(data, value);
502
  }
503
 
@@ -509,28 +795,27 @@ maxLivePreview.prototype.getGradient = function(hover)
509
  {
510
  hover = hover || false;
511
 
512
-
513
  var hovtarget = '';
514
  if (hover)
515
  hovtarget = "_hover";
516
 
517
- var stop = parseInt(this.getFieldByID('gradient_stop').val());
518
 
519
  if (isNaN(stop) )
520
  stop = 45;
521
 
522
- var gradients_on = this.getFieldByID('use_gradient').prop('checked');
523
 
524
- var color = this.getFieldByID('gradient_start_color' + hovtarget).val();
525
- var endcolor = this.getFieldByID('gradient_end_color' + hovtarget).val();
526
 
527
  if (color == '') color = 'rgba(0,0,0,0)';
528
  if (endcolor == '') endcolor = 'rgba(0,0,0,0)';
529
 
530
  var start = this.hexToRgb(color);
531
  var end = this.hexToRgb(endcolor);
532
- var startop = parseInt(this.getFieldByID('gradient_start_opacity' + hovtarget).val());
533
- var endop = parseInt(this.getFieldByID('gradient_end_opacity' + hovtarget).val());
534
 
535
  if (! gradients_on)
536
  {
@@ -541,8 +826,6 @@ maxLivePreview.prototype.getGradient = function(hover)
541
  if(isNaN(startop)) startop = 100;
542
  if(isNaN(endop)) endop = 100;
543
 
544
-
545
-
546
  if (start.indexOf('rgba') < 0)
547
  var startrgba = "rgba(" + start + "," + (startop/100) + ") ";
548
  else
@@ -556,46 +839,62 @@ maxLivePreview.prototype.getGradient = function(hover)
556
  var gradient = 'linear-gradient(' + startrgba + stop + "%," + endrgba + ')';
557
 
558
  return gradient;
559
-
560
  }
561
 
562
  maxLivePreview.prototype.updateGradient = function(hover)
563
  {
564
- if (this.reloadInProgress && typeof this.reloaded.gradient !== 'undefined')
565
- return;
 
 
 
566
 
567
  var gradient = this.getGradient(hover);
568
 
569
  if (!hover)
570
- var button = $('.output .result').find('a.normal');
571
  else
572
- var button = $('.output .result').find('a.hover');
573
 
574
  button.css("background", gradient);
575
 
576
  $(document).trigger('livepreview/gradient/updated', [gradient, hover]);
577
- this.reloaded.gradient = true;
 
 
 
 
 
 
 
578
  }
579
 
580
- maxLivePreview.prototype.updateContainerUnit = function($field)
581
  {
582
- var $field = this.getFieldByID('container_width_unit', true);
583
- var val = $field.filter(':checked').val();
 
 
 
 
 
 
 
584
 
585
  if (val == 'pixel')
586
  val = 'px';
587
  else
588
  val = '%';
589
 
590
- var cwidth = this.getFieldByID('container_width').attr('name');
591
 
592
  $('.option.' + cwidth + ' .unit').text(val);
593
  }
594
 
595
  maxLivePreview.prototype.setPreset = function(e)
596
  {
597
- var options = $('#' + this.currentScreen + '_preset-hidden').val();
598
- var setPreset = $('#' + this.currentScreen + '_preset option:selected').val();
599
  options = JSON.parse(options);
600
 
601
 
1
+ 'use strict';
2
  var $ = jQuery;
3
 
4
  // Here be gathering everything related to live updating MB.
9
 
10
  maxLivePreview.prototype = {
11
  fields: {},
12
+ fieldData: {},
13
  screens: {},
14
  currentScreen: '',
15
+ // currentFields: {},
16
  reloadInProgress: false,
17
+ reloaded: {}, // for partly reloads when doing a screen update.
18
+ translations: {},
19
+ tooltipListeners: {},
20
+ screenDidInit: {}, // colorPickers are loaded on changeScreen (performance) but should run once. Hence this. Perhaps for other inits later
21
+ preview_button_normal: null,
22
+ preview_button_hover: null,
23
  }
24
 
25
  maxLivePreview.prototype.init = function ()
27
  this.loadScreens();
28
  this.bindFields();
29
 
30
+ this.translations = lptranslations;
31
+
32
+ this.preview_button_normal = $(document.getElementById('maxbuttons_preview_normal'));
33
+ this.preview_button_hover = $(document.getElementById('maxbuttons_preview_hover'));
34
+
35
+ this.initColorPicker(document.getElementById('button_preview'));
36
  }
37
 
38
  maxLivePreview.prototype.bindFields = function()
41
  $('#maxbuttons input,#maxbuttons textarea').not('.mb-color-field').on('keyup change', $.proxy(this.update_preview_event,this));
42
  $('#maxbuttons select').on('change', $.proxy(this.update_preview_event, this));
43
 
 
 
 
 
 
 
 
 
 
44
 
 
 
 
45
 
46
  // Presets
47
  $('[data-action="set-preset"]').on('click', $.proxy(this.setPreset, this));
48
 
49
  $(document).on('changed_screen', $.proxy(this.changed_screen, this));
50
+
51
  }
52
 
53
  // on screen change, reload preview.
54
  maxLivePreview.prototype.changed_screen = function(e, screen)
55
  {
56
  // this needs a check to not run the default setup twice.
57
+ //this.setCurrentScreen('default');
58
+ //this.reloadFields(); // 'reload/reset' the preview to the main screen.
59
+ this.screenInit(screen);
60
+
61
+ // if (screen != 'default') // no need to reload if not default
62
+ //{
63
  this.setCurrentScreen(screen);
64
  this.reloadFields(); // implement overrides of the screen.
65
+ // }
66
+
67
+ }
68
+
69
+ // Function to on demand load certain heavy interface elements when screen is loaded. Should have to load only once!
70
+ maxLivePreview.prototype.screenInit = function(screen)
71
+ {
72
+ if (this.screenDidInit[screen] === true)
73
+ {
74
+ console.log('Did already init, skip');
75
+ return false;
76
+ }
77
+
78
+ var colorFields = document.querySelectorAll('#screen_' + screen + '.mbscreen-editor .mb-color-field');
79
+
80
+ for (var i = 0; i < colorFields.length; i++)
81
+ {
82
+ this.initColorPicker(colorFields[i]);
83
+ }
84
+ // Potential slowdown, but shitty to do elsehhow.
85
+ // clicking on color picker circle scrolls to top and loads # on the page, which is bad.
86
+ document.querySelectorAll('.iris-square-value').forEach ( function (e){ e.removeAttribute('href'); });
87
+
88
+ this.screenDidInit[screen] = true;
89
+
90
+ }
91
+
92
+ maxLivePreview.prototype.initColorPicker = function(field)
93
+ {
94
+ $(field).wpColorPicker(
95
+ {
96
+ width: 300,
97
+ alpha: true,
98
+ palettes: this.colorPalettes,
99
+ change: $.proxy( _.throttle(function(event, ui) {
100
+ this.update_color_event(event,ui);
101
+ }, 300), this),
102
+ });
103
 
104
  }
105
 
107
  {
108
  $(document).trigger('livepreview-reload-start');
109
  this.reloadInProgress = true;
110
+ this.reloaded = {};
111
 
112
+ for(var mapfield in this.fields[this.currentScreen])
113
  {
114
+ var data = this.fieldData[this.currentScreen][mapfield];
115
+
116
+ this.update_preview( this.fields[this.currentScreen][mapfield], data);
117
  }
118
  this.reloadInProgress = false;
119
+
120
+
121
  $(document).trigger('livepreview-reload-end');
122
  }
123
 
131
  var screen_id = $screen.attr('id').replace('screen_', '');
132
  var map = $(this).text();
133
  if (typeof map != 'undefined')
134
+ {
135
+ var fields = JSON.parse(map);
136
+ var fieldcache = [] ;
137
+ var fieldData = [];
138
+ for (var field in fields)
139
+ {
140
+ var fcheck = document.getElementById(field);
141
+ if (fcheck)
142
+ {
143
+ fieldcache[field] = fcheck;
144
+ fieldData[field] = fields[field];
145
+ }
146
+ else { // checkboxes and radio shizzle.
147
+ var inputs = document.querySelectorAll('input[name="' + field + '"]');
148
+ for (var i = 0; i < inputs.length; i++)
149
+ {
150
+ var inputId = inputs[i].getAttribute('id');
151
+ fieldcache[inputId] = inputs[i];
152
+ fieldData[inputId] = fields[field];
153
+ }
154
+
155
+ }
156
+ }
157
+ self.fields[screen_id] = fieldcache;
158
+ self.fieldData[screen_id] = fieldData;
159
+ }
160
+ /* Seems not to work / responsible.
161
+ if ($screen.hasClass('current-screen'))
162
  {
163
  self.setCurrentScreen(screen_id);
164
+ } */
165
  });
166
+
167
  }
168
 
169
  // function to help static function to get the proper ID's for the current field.
170
  // byName is optional, signaling to search the field by form name instead of #id ( checkbox, radio )
171
+ // byName can result in multiple fields. (pass null not to use)
172
+ // getparent is to return the field as defined in default screen. Many elements only exist there.
173
+ maxLivePreview.prototype.getFieldByID = function(name, byName, getparent)
174
  {
175
+ if (typeof byName == 'undefined' || byName == null)
 
176
  byName = false;
177
+
178
+ if (typeof getparent == 'undefined')
179
+ {
180
+ getparent = false;
181
+ }
182
 
183
  if (this.currentScreen == 'default')
184
  var id = name;
185
  else
186
+ {
187
+ if (name.indexOf(this.currentScreen) == -1 && getparent === false)
188
+ {
189
+ var id = this.currentScreen + '_' + name;
190
+ }
191
+ else if (getparent === true && this.isResponsiveScreen())
192
+ {
193
+ // Remove current screen prefix from id.
194
+ var id = name.replace(this.currentScreen + '_', '');
195
+ // name.substring(name.indexOf('_') + 1);
196
+ }
197
+ else {
198
+ var id = name;
199
+ }
200
+ }
201
 
202
  if (byName)
203
  {
204
+ var field = document.querySelectorAll('input[name="' + id + '"]');
205
  }
206
  else
207
  {
208
+ if (typeof this.fields[this.currentScreen][id] == 'object' )
209
+ {
210
+ var field = this.fields[this.currentScreen][id];
211
+ }
212
+ else
213
+ {
214
+ var field = document.getElementById(id); // $('#' + id);
215
+ }
216
  }
217
 
218
+ return field;
219
+ }
220
+
221
+ // returns object with definitions for CSS.
222
+ maxLivePreview.prototype.getFieldData = function(id)
223
+ {
224
+ return this.fieldData[this.currentScreen][id];
225
+ }
226
+
227
+ maxLivePreview.prototype.getFields = function(id)
228
+ {
229
+ return this.fields[this.currentScreen];
230
  }
231
 
232
  maxLivePreview.prototype.setCurrentScreen = function(id)
233
  {
234
  this.currentScreen = id;
235
+ $(document).trigger('livepreview-screen-set', [id] );
236
+ }
237
+
238
+ maxLivePreview.prototype.isResponsiveScreen= function ()
239
+ {
240
+ if (this.currentScreen.indexOf('rs') >= 0)
241
+ {
242
+ return true;
243
+ }
244
+ return false;
245
+ /*var screenDat
246
+ a = document.querySelector('.screen-option.option-active');
247
+ if (screenData && screenData.dataset.screentype == 'responsive')
248
+ {
249
+ return true;
250
+ }
251
+ return false; */
252
+ }
253
+
254
+ maxLivePreview.prototype.isResponseField = function(field)
255
+ {
256
 
257
+ if (field.id.indexOf(this.currentScreen) == -1)
258
+ {
259
+ return false;
260
+ }
261
+ return true;
262
  }
263
 
264
  maxLivePreview.prototype.update_preview_event = function(e)
265
  {
266
  e.preventDefault();
 
267
 
268
  // migration to data field
269
+ var targetfield = e.target.dataset.field
270
+ var id = e.target.getAttribute('id'); // this should change to be ready for the option to have two the same fields on multi locations.
271
+
272
+ var field = this.fields[this.currentScreen][id];
273
+ var data = this.fieldData[this.currentScreen][id];
274
 
 
275
 
276
  $(document).trigger('livePreviewUpdate', true);
277
 
278
  if (data !== null)
279
  {
280
+ this.update_preview(field, data);
281
  }
282
 
283
  }
286
  * state = csspseudo
287
  * field_id is ID of form field, data is corresponding field data in fieldmap.
288
  */
289
+ maxLivePreview.prototype.update_preview = function(field, data)
290
  {
291
 
292
  var state = null;
293
+
294
  if (typeof data == 'undefined')
295
+ {
296
  return; // field doesn't have updates
297
+ }
298
 
299
  // check all attributes. Fields can use any of those for different processes.
300
  if (typeof data.css != 'undefined')
301
  {
302
+ var value = field.value;
303
 
304
  // a target that is checkbox but not checked should unset (empty) value.
305
+ if (field.type == 'checkbox' && ! field.checked )
306
+ {
307
  value = '';
308
+ }
309
 
310
+ if (field.type == 'radio' && ! field.checked )
311
+ {
312
  return; // not our radio update.
313
+ }
314
  if (typeof data.pseudo !== 'undefined')
315
  {
316
  state = data.pseudo;
317
  }
318
+ this.updateResponsiveFieldChanged(field, value);
319
  this.putCSS(data, value, state);
320
  }
321
  if (typeof data.attr !== 'undefined')
322
  {
323
+ $('.output .result').find('a').attr(data.attr, field.value);
324
  }
325
 
326
  if (typeof data.func !== 'undefined')
338
  try
339
  {
340
  var callFunc = new Function ('target', 'self', funcName);
341
+ callFunc(field, this);
342
  }
343
  catch(err)
344
  {
345
+ console.error(err, data, field);
346
  }
347
 
348
  }
349
  };
350
 
351
+ maxLivePreview.prototype.updateResponsiveFieldChanged = function(field, value)
352
+ {
353
+ if (! this.isResponsiveScreen())
354
+ {
355
+ return;
356
+ }
357
+ else if (field.type == 'radio')
358
+ {
359
+ if( ! field.checked)
360
+ {
361
+ return; // not our radio update.
362
+ }
363
+ else {
364
+ value = 1;
365
+ }
366
+ }
367
+ else if (field.type == 'checkbox' )
368
+ {
369
+ if (! field.checked)
370
+ var value = 0;
371
+ else {
372
+ var value = 1;
373
+ }
374
+ }
375
+
376
+ var parentDefault = this.getFieldByID(field.id, false, true);
377
+
378
+ if (parentDefault.type == 'checkbox' || parentDefault.type == 'radio')
379
+ {
380
+ if (parentDefault.checked)
381
+ var parentValue = 1;
382
+ else {
383
+ var parentValue = 0;
384
+ }
385
+ }
386
+ else {
387
+ var parentValue = parentDefault.value;
388
+ }
389
+
390
+ // find label for input fields, or use field itself if not ?
391
+ var field_id = field.id;
392
+
393
+ if ( field.classList.contains('wp-color-picker'))
394
+ {
395
+ // shown field is first button from picker container, hopefully.
396
+ var field = field.closest('.wp-picker-container').children[0];
397
+
398
+ }
399
+
400
+ if (value != parentValue)
401
+ {
402
+
403
+ field.classList.add('responsive-changed');
404
+ field.dataset.responseOriginal = parentValue;
405
+
406
+ if (! this.tooltipListeners[field_id] || this.tooltipListeners[field_id] == false)
407
+ {
408
+ var handler = this.showOriginalValue.bind(this);
409
+ this.tooltipListeners[field_id] = handler;
410
+ field.addEventListener('mouseover', handler);
411
+ }
412
+ }
413
+ else
414
+ {
415
+ field.classList.remove('responsive-changed');
416
+ delete field.dataset.responseOriginal;
417
+ if (this.tooltipListeners[field_id])
418
+ {
419
+ field.removeEventListener('mouseover', this.tooltipListeners[field_id]);
420
+ this.tooltipListeners[field_id] = false;
421
+ }
422
+ }
423
+ }
424
+
425
+ maxLivePreview.prototype.showOriginalValue = function(e)
426
+ {
427
+ var field = e.target;
428
+
429
+ // Their originals are pretty obvious
430
+ if (field.type == 'radio' || field.type == 'checkbox')
431
+ return;
432
+
433
+ // I.e. color picker has a child span that should look at parent elemenet.
434
+ if (typeof field.dataset.responseOriginal == 'undefined' && typeof field.offsetParent.dataset.responseOriginal !== 'undefined')
435
+ {
436
+ var text = field.offsetParent.dataset.responseOriginal;
437
+ }
438
+ else {
439
+ var text = field.dataset.responseOriginal;
440
+ }
441
+ var tooltip = document.createElement('span');
442
+ tooltip.innerText = this.translations.originalValue + ' ' + text;
443
+ tooltip.classList.add('original-tooltip');
444
+
445
+ // probably many cases to add here.
446
+ var tooltarget = field.closest('.input');
447
+
448
+ field.addEventListener('mouseout', function () {
449
+ var els = document.querySelectorAll('.original-tooltip');
450
+ for (var i = 0; i < els.length; i++)
451
+ {
452
+ var el = els[i];
453
+ el.parentNode.removeChild(el);
454
+ }
455
+ }, {once:true});
456
+
457
+ tooltarget.appendChild(tooltip);
458
+ }
459
+
460
  maxLivePreview.prototype.putCSS = function(data,value,state)
461
  {
462
  state = state || 'both';
463
  if (typeof data == 'undefined')
464
  return false;
465
 
466
+ //var element = '.maxbutton';
467
+ var updateHover = true;
468
+ var updateNormal = true;
469
+
470
  if (state == 'hover')
471
+ {
472
+ // element = 'a.hover ';
473
+ updateNormal = false;
474
+ }
475
  else if(state == 'normal')
476
+ {
477
+ // element = 'a.normal ';
478
+ updateHover = false;
479
+ }
480
 
481
  if (typeof data.unitfield != 'undefined')
482
  {
483
 
484
+ var unitfielddata = this.getFieldByID(data.unitfield, true); //.filter(":checked"); // get by name, radio button
485
+ for (var i = 0; i < unitfielddata.length; i++)
486
+ {
487
+ if (unitfielddata.checked == true)
488
+ {
489
+ var unitvalue = unitfielddata.value;
490
+ }
491
+ }
492
 
493
  if (value == 0)
494
  value = 'auto';
503
  if (value.indexOf(data.css_unit) == -1)
504
  value += data.css_unit;
505
  }
506
+
507
  if (typeof data.csspart != 'undefined')
508
  {
509
  var parts = data.csspart.split(",");
510
+ for(var i = 0; i < parts.length; i++)
511
  {
512
  var cpart = parts[i];
513
+ //var fullpart = element + " ." + cpart;
514
+
515
+ if (true === updateNormal)
516
+ {
517
+ this.preview_button_normal.find('.' + cpart).css(data.css, value);
518
+ }
519
+ if (true === updateHover)
520
+ {
521
+ this.preview_button_hover.find('.' + cpart).css(data.css, value);
522
+ }
523
  }
524
  }
525
+ else // update on the main thing.
526
+ {
527
+ if (true === updateNormal)
528
+ {
529
+ this.preview_button_normal.css(data.css, value);
530
+ }
531
+ if (true === updateHover)
532
+ {
533
+ this.preview_button_hover.css(data.css, value);
534
+ }
535
+ }
536
+
537
 
538
  }
539
 
540
  maxLivePreview.prototype.update_color_event = function(event, ui)
541
  {
542
+ var target = event.target.getAttribute('id');
543
+ var field = this.getFieldByID(target);
 
544
  var color = (ui.color.to_s('hex')); // since Alphapicker 3.0
545
+ this.update_color(field, ui, color);
546
  $(document).trigger('livePreviewUpdate', true);
547
 
548
  }
550
  maxLivePreview.prototype.update_color = function(field, ui, color)
551
  {
552
  var self = this;
553
+ var id = field.getAttribute('id');
 
554
 
555
  if (color.indexOf('#') === -1 && color.indexOf('rgba') < 0)
556
  {
557
  color = '#' + color; // add # to color
558
  }
559
 
560
+ field.value = color; //(color); // otherwise field value is running 1 click behind.
561
+ this.updateResponsiveFieldChanged(field, color);
562
 
563
  // toggle transparency when needed.
564
+ if ( field.value == '')
565
  {
566
  $(field).parents('.mbcolor').find('.wp-color-result').children('.the_color').css('background-image', 'url(' + maxadmin_settings.icon_transparent + ')');
567
  if (typeof event.type !== 'undefined' && event.type == 'change')
568
+ this.update_color(field, null, 'rgba(0,0,0,0)');
569
  }
570
  else {
571
  $(field).parents('.mbcolor').find('.wp-color-result').children('.the_color').css('background-image', 'none');
596
  else // simple update
597
  {
598
 
599
+ var data = this.getFieldData(id);
600
  var state = 'normal';
601
  if (typeof data !== 'undefined' && typeof data.pseudo !== 'undefined')
602
  {
607
  }
608
  };
609
 
610
+ maxLivePreview.prototype.updateBoxShadow = function (field)
611
  {
612
  // target = target || null;
613
  if (this.reloadInProgress && typeof this.reloaded.boxshadow !== 'undefined')
614
  return;
615
 
616
+ var id = field.getAttribute('id');
617
 
618
+ var left = this.getFieldByID('box_shadow_offset_left').value;
619
+ var top = this.getFieldByID("box_shadow_offset_top").value;
620
+ var width = this.getFieldByID("box_shadow_width").value;
621
+ var spread = this.getFieldByID('box_shadow_spread').value;
622
 
623
+ var color = this.getFieldByID("box_shadow_color").value;
624
+ var hovcolor = this.getFieldByID("box_shadow_color_hover").value;
625
 
626
  if (color == '') color = 'rgba(0,0,0,0)';
627
  if (hovcolor == '') hovcolor = 'rgba(0,0,0,0)';
628
 
629
+
630
+ var data = this.getFieldData(id);
631
  if (typeof data == 'undefined') // field not defined.
632
  return;
633
  data.css = 'boxShadow';
634
 
635
+ var value = left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + color;
636
+ var value_hover = left + 'px ' + top + 'px ' + width + 'px ' + spread + 'px ' + hovcolor;
637
 
638
  this.putCSS(data, value, 'normal');
639
  this.putCSS(data, value_hover, 'hover');
640
 
641
  this.reloaded.boxshadow = true;
642
+
 
643
  }
644
 
645
+ maxLivePreview.prototype.updateTextShadow = function(field)
646
  {
647
  // hover = hover || false;
648
  if (this.reloadInProgress && typeof this.reloaded.textshadow !== 'undefined')
649
  return;
650
 
651
+ var left = this.getFieldByID("text_shadow_offset_left").value;
652
+ var top = this.getFieldByID("text_shadow_offset_top").value;
653
+ var width = this.getFieldByID("text_shadow_width").value;
654
 
655
+ var color = this.getFieldByID("text_shadow_color").value;
656
+ var hovcolor = this.getFieldByID("text_shadow_color_hover").value;
657
 
658
+ var id = field.getAttribute('id');
659
+ var data = this.getFieldData(id);
660
 
 
661
  if (typeof data == 'undefined') // field not defined.
662
  return;
663
  data.css = 'textShadow';
674
  this.reloaded.textshadow = true;
675
  }
676
 
677
+ maxLivePreview.prototype.updateAnchorText = function (field)
678
  {
679
  var preview_text = $('.output .result').find('a .mb-text');
680
 
686
 
687
  this.reloadFields();
688
  }
689
+ $('.output .result').find('a .mb-text').text(field.value);
690
  }
691
 
692
+ maxLivePreview.prototype.updateGradientOpacity = function(field)
693
  {
694
  this.updateGradient(true);
695
  this.updateGradient(false);
696
  }
697
 
698
+ maxLivePreview.prototype.updateDimension = function (field)
699
  {
700
  if (this.reloadInProgress && typeof this.reloaded.dimension !== 'undefined')
701
+ {
702
  return;
703
+ }
704
+ var id = field.dataset.field;
705
  if (typeof id == 'undefined')
706
+ var id = field.getAttribute('id');
707
  if (typeof id == 'undefined') // still don't want, then no.
708
  return;
709
  var data = {};
711
  // get the units.
712
  if (id.indexOf('width') >= 0)
713
  {
714
+ var field = this.getFieldByID('button_width');
715
+ var unitfield = this.getFieldByID('button_size_unit_width', true);
716
  data.css = 'width';
717
  var updatePreview = '.preview_border_width span';
718
+ var unitUpdate = '.input.' + field.getAttribute('name') + ' .unit';
719
  }
720
  else if(id.indexOf('height') >= 0)
721
  {
722
+ var field = this.getFieldByID('button_height');
723
+ var unitfield = this.getFieldByID('button_size_unit_height', true);
724
  data.css = 'height';
725
  var updatePreview = '.preview_border_height span';
726
+ var unitUpdate = '.input.' + field.getAttribute('name') + ' .unit';
727
  }
728
 
729
+ var dimension = field.value;
730
+ for (var i = 0; i < unitfield.length; i++)
731
+ {
732
+ if (unitfield[i].checked == true)
733
+ {
734
+ var unit = unitfield[i].value;
735
+ }
736
+ }
737
+
738
 
739
  if (dimension == 0)
740
  {
758
  this.reloaded.dimension = true;
759
  }
760
 
761
+ maxLivePreview.prototype.updateRadius = function(field)
762
  {
763
  if (this.reloadInProgress && typeof this.reloaded.radius !== 'undefined')
764
  return;
765
 
766
+ var value = field.value;
767
  var fields = ['radius_bottom_left', 'radius_bottom_right', 'radius_top_left', 'radius_top_right'];
768
 
769
  var toggle = this.getFieldByID('radius_toggle');
770
 
771
  if ( $(toggle).data('lock') == 'lock')
772
  {
773
+ for(var i = 0; i < fields.length; i++)
774
  {
775
+ var field = this.getFieldByID(fields[i]); // find the real field.
776
+ field.value = value; // set value via locking
777
+ var id = field.getAttribute('id'); // get the real id, from element.
778
+ var data = this.getFieldData(id);
779
  this.putCSS(data,value + 'px'); // update
780
 
781
  }
782
  }
783
  else { // update as regular single field
784
+ var value = field.value;
785
+ var id = field.getAttribute('id');
786
+ var data = this.getFieldData(id);
787
  this.putCSS(data, value);
788
  }
789
 
795
  {
796
  hover = hover || false;
797
 
 
798
  var hovtarget = '';
799
  if (hover)
800
  hovtarget = "_hover";
801
 
802
+ var stop = parseInt(this.getFieldByID('gradient_stop').value);
803
 
804
  if (isNaN(stop) )
805
  stop = 45;
806
 
807
+ var gradients_on = this.getFieldByID('use_gradient').checked;
808
 
809
+ var color = this.getFieldByID('gradient_start_color' + hovtarget).value;
810
+ var endcolor = this.getFieldByID('gradient_end_color' + hovtarget).value;
811
 
812
  if (color == '') color = 'rgba(0,0,0,0)';
813
  if (endcolor == '') endcolor = 'rgba(0,0,0,0)';
814
 
815
  var start = this.hexToRgb(color);
816
  var end = this.hexToRgb(endcolor);
817
+ var startop = parseInt(this.getFieldByID('gradient_start_opacity' + hovtarget).value);
818
+ var endop = parseInt(this.getFieldByID('gradient_end_opacity' + hovtarget).value);
819
 
820
  if (! gradients_on)
821
  {
826
  if(isNaN(startop)) startop = 100;
827
  if(isNaN(endop)) endop = 100;
828
 
 
 
829
  if (start.indexOf('rgba') < 0)
830
  var startrgba = "rgba(" + start + "," + (startop/100) + ") ";
831
  else
839
  var gradient = 'linear-gradient(' + startrgba + stop + "%," + endrgba + ')';
840
 
841
  return gradient;
 
842
  }
843
 
844
  maxLivePreview.prototype.updateGradient = function(hover)
845
  {
846
+ var reloaded = (hover) ? typeof this.reloaded.gradienthover : typeof this.reloaded.gradient;
847
+ if (this.reloadInProgress && reloaded !== 'undefined')
848
+ {
849
+ return;
850
+ }
851
 
852
  var gradient = this.getGradient(hover);
853
 
854
  if (!hover)
855
+ var button = this.preview_button_normal;
856
  else
857
+ var button = this.preview_button_hover
858
 
859
  button.css("background", gradient);
860
 
861
  $(document).trigger('livepreview/gradient/updated', [gradient, hover]);
862
+
863
+ if (hover)
864
+ {
865
+ this.reloaded.gradienthover = true;
866
+ }
867
+ else {
868
+ this.reloaded.gradient = true;
869
+ }
870
  }
871
 
872
+ maxLivePreview.prototype.updateContainerUnit = function(unused)
873
  {
874
+ var field = this.getFieldByID('container_width_unit', true);
875
+
876
+ for (var i = 0; i < field.length; i++)
877
+ {
878
+ if (field[i].checked == true)
879
+ {
880
+ var val = field[i].value;
881
+ }
882
+ }
883
 
884
  if (val == 'pixel')
885
  val = 'px';
886
  else
887
  val = '%';
888
 
889
+ var cwidth = this.getFieldByID('container_width').getAttribute('name');
890
 
891
  $('.option.' + cwidth + ' .unit').text(val);
892
  }
893
 
894
  maxLivePreview.prototype.setPreset = function(e)
895
  {
896
+ var options = document.querySelector('#' + this.currentScreen + '_preset-hidden').value;
897
+ var setPreset = document.querySelector('#' + this.currentScreen + '_preset option:checked').value;
898
  options = JSON.parse(options);
899
 
900
 
js/maxajax.js CHANGED
@@ -16,6 +16,33 @@ maxAjax.prototype.init = function()
16
  $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
17
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
18
  $(document).trigger('maxajax_init'); // for hanging in other actions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
  maxAjax.prototype.ajaxInit = function()
16
  $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
17
  $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
18
  $(document).trigger('maxajax_init'); // for hanging in other actions.
19
+
20
+ this.saveOnKey();
21
+ }
22
+
23
+ maxAjax.prototype.saveOnKey = function()
24
+ {
25
+ // save on key class to make this possible.
26
+ var saveForm = document.querySelector('.mb-ajax-form.save-on-key');
27
+ if (saveForm === null)
28
+ return false; // no form no save.
29
+
30
+ window.addEventListener('keydown', function(event) {
31
+
32
+ if (! (event.key == 's' || event.key == 'S') || ! event.ctrlKey)
33
+ {
34
+ return true;
35
+ }
36
+
37
+ // var clickEvent = new Event('click');
38
+ // console.log(document.querySelector('.mb-ajax-form .mb-ajax-submit'));
39
+ // var button = document.querySelector('.mb-ajax-form .mb-ajax-submit');
40
+ $('.mb-ajax-form .mb-ajax-submit').first().trigger('click');
41
+ /* if (button !== null)
42
+ button.dispatchEvent(clickEvent); */
43
+ event.preventDefault();
44
+ return false;
45
+ });
46
  }
47
 
48
  maxAjax.prototype.ajaxInit = function()
js/maxbuttons-admin.js CHANGED
@@ -1,3 +1,4 @@
 
1
  var $ = jQuery;
2
 
3
  function maxAdmin()
@@ -14,6 +15,8 @@ maxAdmin.prototype = {
14
  }; // MaxAdmin
15
 
16
  maxAdmin.prototype.init = function () {
 
 
17
  this.button_id = $('input[name="button_id"]').val();
18
  // Prevents the output button from being clickable (also in admin list view )
19
  $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); e.stopPropagation(); });
@@ -26,14 +29,13 @@ maxAdmin.prototype.init = function () {
26
  cancel: 'p, li',
27
  });
28
 
29
- // $(document).on('submit', 'form.mb_ajax_save', $.proxy(this.formAjaxSave, this));
30
-
31
  // copy / delete / trash action buttons via ajax
32
  $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
33
 
34
  // conditionals
35
- $(document).on('reInitConditionals', $.proxy(this.initConditionials, this));
36
- this.initConditionials(); // conditional options
 
37
 
38
  // range inputs
39
  $('#maxbuttons').on('change, input', 'input[type="range"]', $.proxy(this.updateRange, this ));
@@ -50,13 +52,10 @@ maxAdmin.prototype.init = function () {
50
  if ($('#new-button-form').length == 0)
51
  return;
52
 
53
-
54
  if (this.button_id > 0) {
55
  $("#maxbuttons .mb-message").show();
56
  }
57
 
58
- //this.initResponsive(); // responsive edit interface
59
-
60
  // this events happens when live preview updates something.
61
  $(document).on('livePreviewUpdate', $.proxy(this.saveIndicator, this) );
62
 
@@ -68,10 +67,9 @@ maxAdmin.prototype.init = function () {
68
  cancel: '.nodrag',
69
  });
70
 
71
- // clicking on color picker circle scrolls to top and loads # on the page, which is bad.
72
- $('.iris-picker-inner .iris-square-value').removeAttr('href');
73
- $(document).on('click', '.iris-picker-inner .iris-square-value', function (e) {
74
- e.preventDefault(); e.stopPropagation(); return false; });
75
 
76
  /* Copy Color Interface */
77
  $('.input.mbcolor .arrows').on('click', $.proxy(this.copyColor, this) );
@@ -116,6 +114,8 @@ maxAdmin.prototype.init = function () {
116
  if ( $('input[name="button_is_new"]').val() == 1)
117
  this.saveIndicator(null, true);
118
 
 
 
119
  }; // INIT
120
 
121
  maxAdmin.prototype.loadLivePreview = function()
@@ -129,13 +129,20 @@ maxAdmin.prototype.loadLivePreview = function()
129
  }
130
  else {
131
  alert('Live Preview not loaded, button preview not functional');
 
132
  }
133
 
134
- if (typeof window.location.hash !== 'undefined' && window.location.hash.length > 0)
 
135
  {
136
  var screenid = window.location.hash.replace('#', '');
137
  this.change_screen(screenid);
138
  }
 
 
 
 
 
139
  }
140
 
141
  maxAdmin.prototype.change_screen_event = function(e)
@@ -149,11 +156,13 @@ maxAdmin.prototype.change_screen_event = function(e)
149
  if (typeof change_screen !== 'undefined')
150
  this.change_screen(change_screen);
151
  }
 
152
  maxAdmin.prototype.change_screen = function(change_screen)
153
  {
154
 
155
  var active_screen = $('.screen-option.option-active').data('screenid');
156
- var $target = $('.screen-option[data-screenid="' + change_screen + '"]');
 
157
  if (change_screen != 'new')
158
  {
159
  $('#current_screen').val(change_screen);
@@ -161,15 +170,31 @@ maxAdmin.prototype.change_screen = function(change_screen)
161
  // not the same.
162
  if (active_screen !== change_screen)
163
  {
 
164
  window.location.hash = change_screen;
165
 
166
  $('.screen-option').removeClass('option-active');
167
- $target.addClass('option-active');
168
  $(document).trigger('changed_screen', change_screen);
169
 
170
  $('.mbscreen-editor').removeClass('current-screen');
171
  $('#screen_' + change_screen).addClass('current-screen');
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  var form = document.getElementById('new-button-form');
174
  form.action = window.location;
175
 
@@ -256,7 +281,7 @@ maxAdmin.prototype.button_action = function(e)
256
  url: url,
257
  data: data,
258
  success: function (data) {
259
- response = JSON.parse(data);
260
 
261
  if (typeof response.redirection != 'undefined')
262
  {
@@ -292,6 +317,9 @@ maxAdmin.prototype.copyColor = function (e)
292
  var fieldId = '#' + bindto.data('id'); // Field which is used
293
  var bindId = '#' + bindto.data('bind'); // Field is bound to.
294
 
 
 
 
295
  // check which arrow was pressed
296
  if (target.hasClass('arrow-right'))
297
  var arrow_click = 'right';
@@ -311,27 +339,28 @@ maxAdmin.prototype.copyColor = function (e)
311
  if (if_side == 'left')
312
  {
313
  if (arrow_click == 'right')
314
- copy = true;
315
  else
316
- copy = false;
317
  }
318
  else if (if_side == 'right')
319
  {
320
  if (arrow_click == 'right')
321
- copy = false;
322
  else
323
- copy = true;
324
  }
325
 
326
  if ( copy )
327
  {
328
- $(bindId).val( $(fieldId).val() );
 
329
  $(bindId).trigger('change');
330
  $(bindId).wpColorPicker('color', $(fieldId).val());
331
  }
332
  else
333
  {
334
- $(fieldId).val( $(bindId).val() );
335
  $(fieldId).trigger('change');
336
  $(fieldId).wpColorPicker('color', $(bindId).val());
337
  }
@@ -417,6 +446,25 @@ maxAdmin.prototype.toggleManual = function (e)
417
 
418
  maxAdmin.prototype.resetConditionals = function()
419
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  $('[data-show], [data-has]').each(function () {
421
  var condition = $(this).data('show');
422
  if (typeof condition === 'undefined')
@@ -438,78 +486,141 @@ maxAdmin.prototype.resetConditionals = function()
438
  maxAdmin.prototype.initConditionials = function ()
439
  {
440
  var mAP = this;
441
- this.resetConditionals();
 
 
442
 
443
- $('[data-show]').each(function () {
444
- var condition = $(this).data('show');
445
- var target = condition.target;
446
- var values = condition.values;
447
- var self = this;
448
 
449
- $(document).on('change','[name="' + target + '"]', {child: this, values: values}, $.proxy(mAP.updateConditional, mAP) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
 
451
- if ( $('[name="' + target + '"]').length > 1) // trigger change to test condition
452
- {
453
- $('[name="' + target + '"]:checked').trigger('change', ['conditional']); // radio / checkbox button
454
- }
455
- else {
456
- $('[name="' + target + '"]').trigger('change', ['conditional']);
457
- }
458
  });
459
 
460
- // problem here is fields having same target, will add the same event over and over //
461
- // the target, input array, have a lot of input fields, which all receive the events. this is the issue.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
 
463
- var updatelist = [];
 
 
 
464
 
465
- $('[data-has]').each(function () {
 
 
 
 
 
 
 
 
 
 
 
466
  var condition = $(this).data('has');
467
  var target = condition.target;
468
  var values = condition.values;
469
 
470
 
471
- $('[name="' + target + '"]').on('change', {target: target, child: this, values: values}, $.proxy(mAP.updateHasConditional, mAP) );
472
 
473
- var targetdecl = '[name="' + target + '"]';
474
- if (! $.inArray(targetdecl, updatelist));
475
- updatelist.push(targetdecl);
476
  });
477
 
478
- if (updatelist.length > 0)
479
- {
480
- // the issue will a lot of event checking still exist..
481
- $(updatelist.toString()).first().trigger('change', ['conditional']);
482
- }
483
 
484
  }
485
 
486
- maxAdmin.prototype.updateConditional = function (event)
487
  {
 
 
 
 
 
 
 
 
488
 
489
- var data = event.data;
490
- var cond_values = data.values;
491
- var cond_child = data.child;
 
 
 
 
492
 
493
- var target = $(event.currentTarget);
494
- var value = $(target).val();
 
 
 
495
 
496
  // if type = checkbox: cond_value checked means it has to be 'checked' to show. Otherwise 'unchecked' go hide.
497
- if (target.attr('type') === 'checkbox')
498
  {
499
-
500
- var checked = $(target).prop('checked');
501
 
502
  if (cond_values == 'checked' && checked)
503
- value = 'checked';
504
  else if (cond_values == 'unchecked' && !checked)
505
- value = 'unchecked';
506
  else
507
- value = 0;
508
  }
509
 
 
 
 
 
 
510
  if (cond_values.indexOf(value) >= 0)
511
  {
512
- $(cond_child).addClass('condshow').animate({'opacity': 1}, 300);
513
  $(cond_child).find('input, select').trigger('change');
514
  }
515
  else
@@ -718,6 +829,24 @@ maxAdmin.prototype.toggleSidebar = function(e)
718
 
719
  }
720
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  maxAdmin.prototype.checkAllInputs = function (e)
722
  {
723
  e.preventDefault;
1
+ 'use strict';
2
  var $ = jQuery;
3
 
4
  function maxAdmin()
15
  }; // MaxAdmin
16
 
17
  maxAdmin.prototype.init = function () {
18
+
19
+
20
  this.button_id = $('input[name="button_id"]').val();
21
  // Prevents the output button from being clickable (also in admin list view )
22
  $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); e.stopPropagation(); });
29
  cancel: 'p, li',
30
  });
31
 
 
 
32
  // copy / delete / trash action buttons via ajax
33
  $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
34
 
35
  // conditionals
36
+ //$(document).on('reInitConditionals', $.proxy(this.initConditionials, this));
37
+ this.initConditionials(); // conditional options
38
+
39
 
40
  // range inputs
41
  $('#maxbuttons').on('change, input', 'input[type="range"]', $.proxy(this.updateRange, this ));
52
  if ($('#new-button-form').length == 0)
53
  return;
54
 
 
55
  if (this.button_id > 0) {
56
  $("#maxbuttons .mb-message").show();
57
  }
58
 
 
 
59
  // this events happens when live preview updates something.
60
  $(document).on('livePreviewUpdate', $.proxy(this.saveIndicator, this) );
61
 
67
  cancel: '.nodrag',
68
  });
69
 
70
+
71
+ /*$(document).on('click', '.iris-picker-inner .iris-square-value', function (e) {
72
+ e.preventDefault(); e.stopPropagation(); return false; });*/
 
73
 
74
  /* Copy Color Interface */
75
  $('.input.mbcolor .arrows').on('click', $.proxy(this.copyColor, this) );
114
  if ( $('input[name="button_is_new"]').val() == 1)
115
  this.saveIndicator(null, true);
116
 
117
+ this.saveOnKey();
118
+
119
  }; // INIT
120
 
121
  maxAdmin.prototype.loadLivePreview = function()
129
  }
130
  else {
131
  alert('Live Preview not loaded, button preview not functional');
132
+ return false;
133
  }
134
 
135
+ // See screen to responsive / what it's hash unless it's default.
136
+ if (typeof window.location.hash !== 'undefined' && window.location.hash.length > 0 && window.location.hash !== '#default')
137
  {
138
  var screenid = window.location.hash.replace('#', '');
139
  this.change_screen(screenid);
140
  }
141
+ else {
142
+ this.livePreview.screenInit('default'); // still needs to init one-time on default if so.
143
+ this.livePreview.setCurrentScreen('default');
144
+
145
+ }
146
  }
147
 
148
  maxAdmin.prototype.change_screen_event = function(e)
156
  if (typeof change_screen !== 'undefined')
157
  this.change_screen(change_screen);
158
  }
159
+
160
  maxAdmin.prototype.change_screen = function(change_screen)
161
  {
162
 
163
  var active_screen = $('.screen-option.option-active').data('screenid');
164
+ var target = document.querySelector('.screen-option[data-screenid="' + change_screen + '"]');
165
+ // var $target = $('.screen-option[data-screenid="' + change_screen + '"]');
166
  if (change_screen != 'new')
167
  {
168
  $('#current_screen').val(change_screen);
170
  // not the same.
171
  if (active_screen !== change_screen)
172
  {
173
+ // Change hash in URL
174
  window.location.hash = change_screen;
175
 
176
  $('.screen-option').removeClass('option-active');
177
+ target.classList.add('option-active');
178
  $(document).trigger('changed_screen', change_screen);
179
 
180
  $('.mbscreen-editor').removeClass('current-screen');
181
  $('#screen_' + change_screen).addClass('current-screen');
182
 
183
+ var title = target.getAttribute('title');
184
+ var classes = target.querySelector('[data-screenicon]').dataset.screenicon;
185
+ var name = target.querySelector('.screen_name').textContent;
186
+
187
+ var previewModal = document.getElementById('live-preview-modal');
188
+ if (previewModal)
189
+ {
190
+ var icon = document.getElementById('live-preview-icon');
191
+ icon.className = '';
192
+ icon.classList.add('dashicons', classes);
193
+ document.getElementById('live-preview-screenname').textContent = name;
194
+ document.getElementById('live-preview-screentitle').textContent = title;
195
+
196
+ }
197
+
198
  var form = document.getElementById('new-button-form');
199
  form.action = window.location;
200
 
281
  url: url,
282
  data: data,
283
  success: function (data) {
284
+ var response = JSON.parse(data);
285
 
286
  if (typeof response.redirection != 'undefined')
287
  {
317
  var fieldId = '#' + bindto.data('id'); // Field which is used
318
  var bindId = '#' + bindto.data('bind'); // Field is bound to.
319
 
320
+ var field = document.getElementById(bindto.data('id'));
321
+ var bindField = document.getElementById(bindto.data('bind'));
322
+
323
  // check which arrow was pressed
324
  if (target.hasClass('arrow-right'))
325
  var arrow_click = 'right';
339
  if (if_side == 'left')
340
  {
341
  if (arrow_click == 'right')
342
+ var copy = true;
343
  else
344
+ var copy = false;
345
  }
346
  else if (if_side == 'right')
347
  {
348
  if (arrow_click == 'right')
349
+ var copy = false;
350
  else
351
+ var copy = true;
352
  }
353
 
354
  if ( copy )
355
  {
356
+ // $(bindId).val( $(fieldId).val() );
357
+ bindField.value = field.value;
358
  $(bindId).trigger('change');
359
  $(bindId).wpColorPicker('color', $(fieldId).val());
360
  }
361
  else
362
  {
363
+ field.value = bindField.value;
364
  $(fieldId).trigger('change');
365
  $(fieldId).wpColorPicker('color', $(bindId).val());
366
  }
446
 
447
  maxAdmin.prototype.resetConditionals = function()
448
  {
449
+ var fields = document.querySelectorAll('[data-show], [data-has]');
450
+
451
+ /*fields.forEach(function (field) {
452
+ var condition = $(this).data('show');
453
+ if (typeof condition === 'undefined')
454
+ {
455
+ condition = $(this).data('has');
456
+ }
457
+ if (typeof condition === 'undefined')
458
+ {
459
+ console.error($(this) + 'has a improperly set conditional');
460
+ return;
461
+ }
462
+ var target = condition.target;
463
+ $(document).off('change','[name="' + target + '"]'); // turn off event
464
+ });*/
465
+
466
+
467
+
468
  $('[data-show], [data-has]').each(function () {
469
  var condition = $(this).data('show');
470
  if (typeof condition === 'undefined')
486
  maxAdmin.prototype.initConditionials = function ()
487
  {
488
  var mAP = this;
489
+ //this.resetConditionals();
490
+ var conditionals = document.querySelectorAll('[data-show]');
491
+ var targets = {};
492
 
 
 
 
 
 
493
 
494
+ conditionals.forEach(function(conditionalField)
495
+ {
496
+ if (typeof conditionalField.dataset.show !== 'undefined')
497
+ {
498
+ var condition = conditionalField.dataset.show;
499
+ var condition_type = 'show';
500
+ }
501
+ else {
502
+ var condition = conditionalField.dataset.has;
503
+ var condition_type = 'has';
504
+ }
505
+ condition = JSON.parse(condition);
506
+ var target = condition.target;
507
+ var values = condition.values;
508
+
509
+ // Collect all the targets that should trigger change.
510
+ if (! targets[target])
511
+ {
512
+ targets[target] = [];
513
+ }
514
+ targets[target].push({'child' : conditionalField, 'values' : values, 'eventType': condition_type});
515
 
 
 
 
 
 
 
 
516
  });
517
 
518
+ var changeEvent = new Event('change');
519
+
520
+
521
+ // Target is the conditional field that want to be checked, on a target value.
522
+ for (const target in targets)
523
+ {
524
+ var element;
525
+
526
+ if ( (element = document.getElementById(target)) !== null)
527
+ {
528
+ element.addEventListener('change', this.conditionalEvent.bind(this,targets[target]));
529
+ element.dispatchEvent(changeEvent);
530
+ }
531
+ else if (document.querySelector('input[name="' + target + '"]') !== null)
532
+ {
533
+ var elements = document.querySelectorAll('input[name="' + target + '"]');
534
+
535
+ for (var i = 0; i < elements.length; i++)
536
+ {
537
+ var element = elements[i];
538
+
539
+ element.addEventListener('change', this.conditionalEvent.bind(this,targets[target]));
540
 
541
+ if ( (element.type !== 'radio' && element.type !== 'checkbox') || element.checked === true )
542
+ {
543
+ elements[i].dispatchEvent(changeEvent);
544
+ }
545
 
546
+ }
547
+
548
+ }
549
+
550
+ };
551
+
552
+
553
+ // Jquery has conditions. Can't be converted to vanilla Jscript, because that would require adding eventListener to all input[] array values and more important; checking for updates / changes to the DOM and rebind them when getting active.
554
+
555
+ var updatelist = [];
556
+
557
+ $('[data-has]').each(function () {
558
  var condition = $(this).data('has');
559
  var target = condition.target;
560
  var values = condition.values;
561
 
562
 
563
+ $('[name="' + target + '"]').on('change', {target: target, child: this, values: values}, $.proxy(mAP.updateHasConditional, mAP) );
564
 
565
+ var targetdecl = '[name="' + target + '"]';
566
+ if (! $.inArray(targetdecl, updatelist));
567
+ updatelist.push(targetdecl);
568
  });
569
 
570
+ if (updatelist.length > 0)
571
+ {
572
+ // the issue will a lot of event checking still exist..
573
+ $(updatelist.toString()).first().trigger('change', ['conditional']);
574
+ }
575
 
576
  }
577
 
578
+ maxAdmin.prototype.conditionalEvent = function(data, event)
579
  {
580
+ // Do and extract data in loop
581
+ for (var i = 0; i < data.length; i++)
582
+ {
583
+ if (data.eventType = 'show')
584
+ this.updateConditional(data[i].values, data[i].child, event.target);
585
+ else
586
+ this.updateHasConditional(data[i].values, data[i].child, event.target);
587
+ }
588
 
589
+ }
590
+
591
+ maxAdmin.prototype.updateConditional = function (cond_values, cond_child, eventTarget)
592
+ {
593
+ // var data = event.data;
594
+ //var cond_values = data.values;
595
+ //var cond_child = data.child;
596
 
597
+ // var target = eventTarget;
598
+ var value = eventTarget.value;
599
+ var name = eventTarget.name;
600
+ var targetValues = [];
601
+ //var elements = document.querySelector('')
602
 
603
  // if type = checkbox: cond_value checked means it has to be 'checked' to show. Otherwise 'unchecked' go hide.
604
+ if (eventTarget.type === 'checkbox')
605
  {
606
+ var checked = eventTarget.checked
 
607
 
608
  if (cond_values == 'checked' && checked)
609
+ var value = 'checked';
610
  else if (cond_values == 'unchecked' && !checked)
611
+ var value = 'unchecked';
612
  else
613
+ var value = 0;
614
  }
615
 
616
+ var $cond_child;
617
+ var fadeIn = [ { opacity: 0 }, { opacity: 1 }];
618
+ var fadeOut = [ { opacity: 1 }, { opacity: 0 }];
619
+ var timing = { duration: 1000, iterations: 1};
620
+
621
  if (cond_values.indexOf(value) >= 0)
622
  {
623
+ $(cond_child).addClass('condshow').animate({'opacity': 1}, 300);
624
  $(cond_child).find('input, select').trigger('change');
625
  }
626
  else
829
 
830
  }
831
 
832
+ maxAdmin.prototype.saveOnKey = function()
833
+ {
834
+ var saveForm = document.getElementById('new-button-form');
835
+ if (saveForm === null)
836
+ return false; // no form no save.
837
+
838
+ window.addEventListener('keydown', function(event) {
839
+
840
+ if (! (event.key == 's' || event.key == 'S') || ! event.ctrlKey)
841
+ {
842
+ return true;
843
+ }
844
+ document.getElementById('new-button-form').submit();
845
+ event.preventDefault();
846
+ return false;
847
+ });
848
+ }
849
+
850
  maxAdmin.prototype.checkAllInputs = function (e)
851
  {
852
  e.preventDefault;
js/min/init.js DELETED
@@ -1 +0,0 @@
1
- var $=jQuery;jQuery(document).ready(function(n){$=n,void 0===window.maxFoundry&&(window.maxFoundry={}),"function"==typeof maxLivePreview&&(window.maxFoundry.livePreview=maxLivePreview),window.maxFoundry.maxadmin=new maxAdmin,window.maxFoundry.maxadmin.init(),window.maxFoundry.maxmodal=new maxModal,window.maxFoundry.maxmodal.init(),window.maxFoundry.maxAjax=new maxAjax,window.maxFoundry.maxAjax.init(),window.maxFoundry.maxTabs=new maxTabs,window.maxFoundry.maxTabs.init(),$(window).trigger("maxbuttons-js-init-done")});var mbErrors=[];window.setTimeout(function(){if(void 0===window.maxFoundry){if(console.error("Detected MaxButtons load failure"),"undefined"==typeof maxbuttons_init||void 0===maxbuttons_init.initFailed)return console.error("Detected MaxButtons is not loaded, but can't find the text to express it"),!1;var n=document.querySelector("h1.title"),e=document.createElement("div");if(e.className="notice notice-error",e.innerHTML="<h1>"+maxbuttons_init.initFailedTitle+"</h1><p>"+maxbuttons_init.initFailed+"</p>",mbErrors.length>0)for(e.innerHTML+=maxbuttons_init.initFailedDetectedErrors,i=0;i<mbErrors.length;i++)e.innerHTML+=mbErrors[i];n.parentNode.insertBefore(e,n.nextSibling)}},4e3),window.addEventListener("error",function(n){var i=n.message+" - "+n.filename+":"+n.lineno+"<br>";console.error("Detected Error "+i),mbErrors.push(i)});
 
js/min/live-preview.js DELETED
@@ -1 +0,0 @@
1
- function maxLivePreview(){}var $=jQuery;maxLivePreview.prototype={fields:{},screens:{},currentScreen:"",currentFields:{},reloadInProgress:!1,reloaded:{}},maxLivePreview.prototype.init=function(){this.loadScreens(),this.bindFields()},maxLivePreview.prototype.bindFields=function(){$("#maxbuttons input,#maxbuttons textarea").not(".mb-color-field").on("keyup change",$.proxy(this.update_preview_event,this)),$("#maxbuttons select").on("change",$.proxy(this.update_preview_event,this)),$("#maxbuttons .mb-color-field").wpColorPicker({width:300,alpha:!0,palettes:this.colorPalettes,change:$.proxy(_.throttle(function(e,t){this.update_color_event(e,t)},300),this)}),$('[data-action="set-preset"]').on("click",$.proxy(this.setPreset,this)),$(document).on("changed_screen",$.proxy(this.changed_screen,this))},maxLivePreview.prototype.changed_screen=function(e,t){this.setCurrentScreen("default"),this.reloadFields(),"default"!=t&&(this.setCurrentScreen(t),this.reloadFields())},maxLivePreview.prototype.reloadFields=function(){$(document).trigger("livepreview-reload-start"),this.reloadInProgress=!0;for(var e in this.currentFields){var t=this.fields[this.currentScreen][e];this.update_preview($("#"+e),t)}this.reloadInProgress=!1,this.reloaded={},$(document).trigger("livepreview-reload-end")},maxLivePreview.prototype.loadScreens=function(){var e=this;$(".mbscreen-editor .fieldmap").each(function(){var t=$(this).parents(".mbscreen-editor"),i=t.attr("id").replace("screen_",""),r=$(this).text();void 0!==r&&(e.fields[i]=JSON.parse(r)),t.hasClass("current-screen")&&e.setCurrentScreen(i)})},maxLivePreview.prototype.getFieldByID=function(e,t){if(void 0===t&&(t=!1),"default"==this.currentScreen)i=e;else var i=this.currentScreen+"_"+e;if(t)r=$('input[name="'+i+'"]');else var r=$("#"+i);return r},maxLivePreview.prototype.setCurrentScreen=function(e){this.currentScreen=e,this.currentFields=this.fields[e],$(document).trigger("livepreview-screen-set",[e,this.currentFields])},maxLivePreview.prototype.update_preview_event=function(e){e.preventDefault();var t=$(e.target),i=($(t).data("field"),$(t).attr("id")),r=this.currentFields[i];$(document).trigger("livePreviewUpdate",!0),null!==r&&this.update_preview($("#"+i),r)},maxLivePreview.prototype.update_preview=function(e,t){var i=null;if(void 0!==t){if(void 0!==t.css){if(value=e.val(),e.is(":checkbox")&&!e.is(":checked")&&(value=""),e.is(":radio")&&!e.is(":checked"))return;void 0!==t.pseudo&&(i=t.pseudo),this.putCSS(t,value,i)}if(void 0!==t.attr&&$(".output .result").find("a").attr(t.attr,e.val()),void 0!==t.func){var r=t.func;r.indexOf(".")<0?r="self."+r+"(target)":r+="(target)";try{new Function("target","self",r)(e,this)}catch(e){console.error(e)}}}},maxLivePreview.prototype.putCSS=function(e,t,r){if(r=r||"both",void 0===e)return!1;var a=".maxbutton";if("hover"==r?a="a.hover ":"normal"==r&&(a="a.normal "),void 0!==e.unitfield){var o=this.getFieldByID(e.unitfield,!0).filter(":checked").val();0==t?t="auto":"percent"==o||"%"==o?t+="%":"pixel"!=o&&"px"!=o||(t+="px")}else void 0!==e.css_unit&&-1==t.indexOf(e.css_unit)&&-1==t.indexOf(e.css_unit)&&(t+=e.css_unit);if(void 0!==e.csspart){var s=e.csspart.split(",");for(i=0;i<s.length;i++){var d=a+" ."+s[i];$(".output .result").find(d).css(e.css,t)}}else $(".output .result").find(a).css(e.css,t)},maxLivePreview.prototype.update_color_event=function(e,t){console.log("update color field");var i=$(e.target),r=t.color.to_s("hex");this.update_color(i,t,r),$(document).trigger("livePreviewUpdate",!0)},maxLivePreview.prototype.update_color=function(t,i,r){var a=t.attr("id");if(-1===r.indexOf("#")&&r.indexOf("rgba")<0&&(r="#"+r),$("#"+a).val(r),""==$(t).val()?($(t).parents(".mbcolor").find(".wp-color-result").children(".the_color").css("background-image","url("+maxadmin_settings.icon_transparent+")"),void 0!==event.type&&"change"==event.type&&this.update_color(e,null,"rgba(0,0,0,0)")):$(t).parents(".mbcolor").find(".wp-color-result").children(".the_color").css("background-image","none"),-1!==a.indexOf("box_shadow"))this.updateBoxShadow(t);else if(-1!==a.indexOf("text_shadow"))this.updateTextShadow(t);else if(-1!==a.indexOf("gradient"))-1==a.indexOf("hover")?this.updateGradient():this.updateGradient(!0);else if("button_preview"==a)r.indexOf("rgba"),$(".output .result").css("backgroundColor",r);else{var o=this.currentFields[a],s="normal";void 0!==o&&void 0!==o.pseudo&&(s=o.pseudo),this.putCSS(o,r,s)}},maxLivePreview.prototype.updateBoxShadow=function(e){if(!this.reloadInProgress||void 0===this.reloaded.boxshadow){var t=$(e).attr("id"),i=this.getFieldByID("box_shadow_offset_left").val(),r=this.getFieldByID("box_shadow_offset_top").val(),a=this.getFieldByID("box_shadow_width").val(),o=this.getFieldByID("box_shadow_spread").val(),s=this.getFieldByID("box_shadow_color").val(),d=this.getFieldByID("box_shadow_color_hover").val();""==s&&(s="rgba(0,0,0,0)"),""==d&&(d="rgba(0,0,0,0)");var t=$(e).attr("id"),n=this.currentFields[t];void 0!==n&&(n.css="boxShadow",value=i+"px "+r+"px "+a+"px "+o+"px "+s,value_hover=i+"px "+r+"px "+a+"px "+o+"px "+d,this.putCSS(n,value,"normal"),this.putCSS(n,value_hover,"hover"),this.reloaded.boxshadow=!0)}},maxLivePreview.prototype.updateTextShadow=function(e){if(!this.reloadInProgress||void 0===this.reloaded.textshadow){var t=this.getFieldByID("text_shadow_offset_left").val(),i=this.getFieldByID("text_shadow_offset_top").val(),r=this.getFieldByID("text_shadow_width").val(),a=this.getFieldByID("text_shadow_color").val(),o=this.getFieldByID("text_shadow_color_hover").val(),s=$(e).attr("id"),d=this.currentFields[s];if(void 0!==d){d.css="textShadow",""==a&&(a="rgba(0,0,0,0)"),""==o&&(o="rgba(0,0,0,0)");var n=t+"px "+i+"px "+r+"px "+a;this.putCSS(d,n,"normal"),n=t+"px "+i+"px "+r+"px "+o,this.putCSS(d,n,"hover"),this.reloaded.textshadow=!0}}},maxLivePreview.prototype.updateAnchorText=function(e){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.reloadFields()),$(".output .result").find("a .mb-text").text(e.val())},maxLivePreview.prototype.updateGradientOpacity=function(e){this.updateGradient(!0),this.updateGradient(!1)},maxLivePreview.prototype.updateDimension=function(e){if(!this.reloadInProgress||void 0===this.reloaded.dimension){if(void 0===(t=e.data("field")))var t=e.attr("id");if(void 0!==t){var i={};if(t.indexOf("width")>=0){var e=this.getFieldByID("button_width"),r=this.getFieldByID("button_size_unit_width",!0);i.css="width";var a=".preview_border_width span",o=".input."+e.attr("name")+" .unit"}else if(t.indexOf("height")>=0){var e=this.getFieldByID("button_height"),r=this.getFieldByID("button_size_unit_height",!0);i.css="height";var a=".preview_border_height span",o=".input."+e.attr("name")+" .unit"}var s=e.val(),d=r.filter(":checked").val();0==s&&(d="",s="auto",this.putCSS(i,"auto")),"percent"==d&&(d="%"),"pixel"==d&&(d="px"),i.css_unit=d,$(a).text(s+d),$(a).css("width",s+d),this.putCSS(i,s),$(o).text(d),this.reloaded.dimension=!0}}},maxLivePreview.prototype.updateRadius=function(e){if(!this.reloadInProgress||void 0===this.reloaded.radius){var t=e.val(),r=["radius_bottom_left","radius_bottom_right","radius_top_left","radius_top_right"],a=this.getFieldByID("radius_toggle");if("lock"==$(a).data("lock"))for(i=0;i<r.length;i++){var o=this.getFieldByID(r[i]);o.val(t);var s=o.attr("id"),d=this.currentFields[s];this.putCSS(d,t+"px")}else{var t=$(e).val(),s=$(e).attr("id"),d=this.currentFields[s];this.putCSS(d,t)}this.reloaded.radius=!0}},maxLivePreview.prototype.getGradient=function(e){var t="";(e=e||!1)&&(t="_hover");var i=parseInt(this.getFieldByID("gradient_stop").val());isNaN(i)&&(i=45);var r=this.getFieldByID("use_gradient").prop("checked"),a=this.getFieldByID("gradient_start_color"+t).val(),o=this.getFieldByID("gradient_end_color"+t).val();""==a&&(a="rgba(0,0,0,0)"),""==o&&(o="rgba(0,0,0,0)");var s=this.hexToRgb(a),d=this.hexToRgb(o),n=parseInt(this.getFieldByID("gradient_start_opacity"+t).val()),l=parseInt(this.getFieldByID("gradient_end_opacity"+t).val());if(r||(d=s,l=n),isNaN(n)&&(n=100),isNaN(l)&&(l=100),s.indexOf("rgba")<0)h="rgba("+s+","+n/100+") ";else var h=s;if(d.indexOf("rgba")<0)u="rgba("+d+","+l/100+") ";else var u=d;return"linear-gradient("+h+i+"%,"+u+")"},maxLivePreview.prototype.updateGradient=function(e){if(!this.reloadInProgress||void 0===this.reloaded.gradient){var t=this.getGradient(e);if(e)i=$(".output .result").find("a.hover");else var i=$(".output .result").find("a.normal");i.css("background",t),$(document).trigger("livepreview/gradient/updated",[t,e]),this.reloaded.gradient=!0}},maxLivePreview.prototype.updateContainerUnit=function(e){var t=this.getFieldByID("container_width_unit",!0).filter(":checked").val();t="pixel"==t?"px":"%";var i=this.getFieldByID("container_width").attr("name");$(".option."+i+" .unit").text(t)},maxLivePreview.prototype.setPreset=function(e){var t=$("#"+this.currentScreen+"_preset-hidden").val(),i=$("#"+this.currentScreen+"_preset option:selected").val();t=JSON.parse(t);var r=$("#"+this.currentScreen+"_min_width"),a=$("#"+this.currentScreen+"_max_width");if(t[i]&&"none"!==i){var o=t[i],s=o.minwidth,d=o.maxwidth;s<=0&&(s=0),d<=0&&(d=0),r.val(s),a.val(d)}},maxLivePreview.prototype.hexToRgb=function(e){if(e.indexOf("rgba")>=0)return e;e=e.replace("#","");var t=parseInt(e,16);return(t>>16&255)+","+(t>>8&255)+","+(255&t)};
 
js/min/maxajax.js DELETED
@@ -1,148 +0,0 @@
1
-
2
- /** New AJAX Call methods
3
- /* Get the standard AJAX vars for this plugin */
4
- function maxAjax() {
5
- this.spinnerFunction = this.showSpinner;
6
- this.successHandler = this.defaultSuccesHandler;
7
- this.errorHandler = this.defaultErrorHandler;
8
-
9
- }
10
-
11
- maxAjax.prototype.init = function()
12
- {
13
- // default actions that trigger ajax action.
14
- $(document).on('submit', '.mb-ajax-form', function (e) { e.preventDefault(); return false; }); // don't submit ajax forms ( prevent enter submit )
15
- $(document).on('click', '.mb-ajax-form .mb-ajax-submit', $.proxy(this.ajaxForm, this ));
16
- $(document).on('click', '.mb-ajax-action', $.proxy(this.ajaxCall, this ));
17
- $(document).on('change', '.mb-ajax-action-change', $.proxy(this.ajaxCall, this));
18
- $(document).trigger('maxajax_init'); // for hanging in other actions.
19
- }
20
-
21
- maxAjax.prototype.ajaxInit = function()
22
- {
23
- data = {
24
- action: maxajax.ajax_action,
25
- nonce: maxajax.nonce,
26
- }
27
-
28
- return data;
29
- }
30
-
31
- maxAjax.prototype.setFunction = function(type, new_function)
32
- {
33
- if (type == 'spinner')
34
- {
35
- this.spinnerFunction = new_function;
36
- }
37
- }
38
-
39
- maxAjax.prototype.ajaxForm = function (e)
40
- {
41
- e.preventDefault();
42
-
43
- var target = $(e.target);
44
- var form = $(target).parents('form');
45
- var action = $(target).data('action');
46
-
47
- var data = this.ajaxInit();
48
- data['form'] = form.serialize();
49
- data['plugin_action'] = action;
50
-
51
- $(document).trigger('maxajax_formpost_' + action, [data,target]);
52
-
53
- this.spinnerFunction(target);
54
-
55
- this.ajaxPost(data);
56
- }
57
-
58
- /* Ajax call functionality */
59
- maxAjax.prototype.ajaxCall = function (e)
60
- {
61
- e.preventDefault();
62
- var target = $(e.target);
63
-
64
- if (! $(target).hasClass('.mb-ajax-action') && ! $(target).hasClass('.mb-ajax-action-change') )
65
- {
66
- if ($(target).parents('.mb-ajax-action'). length > 0)
67
- target = $(e.target).parents('.mb-ajax-action');
68
-
69
- if ($(target).parents('.mb-ajax-action-change'). length > 0)
70
- target = $(e.target).parents('.mb-ajax-action');
71
- }
72
-
73
- var param = false;
74
- var plugin_action = $(target).data('action');
75
- var check_param = $(target).data('param');
76
- var param_input = $(target).data('param-input');
77
-
78
- if (typeof check_param !== 'undefined')
79
- param = check_param;
80
- if (typeof param_input !== 'undefined')
81
- param = $(param_input).val();
82
-
83
- data = this.ajaxInit();
84
-
85
- data['plugin_action'] = plugin_action;
86
- data['param'] = param;
87
- data['post'] = $('form').serialize(); // send it all
88
-
89
- var spinnerFunc = this.spinnerFunction;
90
-
91
- this.spinnerFunction(target);
92
-
93
- this.ajaxPost(data);
94
- }
95
-
96
- maxAjax.prototype.showSpinner = function(target)
97
- {
98
- // spinner styling in elements
99
- var spinner = '<div class="maxajax-load-spinner"></div>';
100
- $(target).after(spinner);
101
- }
102
-
103
- maxAjax.prototype.removeSpinner = function()
104
- {
105
- $('.maxajax-load-spinner').remove();
106
- }
107
-
108
- maxAjax.prototype.ajaxPost = function(data, successHandler, errorHandler)
109
- {
110
- var self = this;
111
-
112
- if (typeof successHandler == 'undefined')
113
- {
114
- var action = data['plugin_action'];
115
- var successHandler = function (r,s,o,) { self.defaultSuccessHandler(r,s,o,action) } ;
116
- }
117
-
118
- if (typeof errorHandler == 'undefined')
119
- {
120
- var action = data['plugin_action'];
121
- var errorHandler = function (r,s,o,) { self.defaultErrorHandler(r,s,o,action) } ;
122
- }
123
-
124
- $.ajax({
125
- type: "POST",
126
- url: maxajax.ajax_url,
127
- data: data,
128
- success: successHandler,
129
- error: errorHandler,
130
- });
131
- }
132
-
133
- maxAjax.prototype.defaultSuccessHandler = function (result, status, object, action)
134
- {
135
- this.removeSpinner();
136
- $(document).trigger('maxajax_success_' + action, [result, status, object]);
137
-
138
- }
139
-
140
- maxAjax.prototype.defaultErrorHandler = function(jq,status,error, action)
141
- {
142
- this.removeSpinner();
143
- $(document).trigger('maxajax_error_' + action, jq, status, error);
144
- console.error(jq);
145
- console.error(status);
146
- console.error(error);
147
- console.error(action);
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/min/maxbuttons-admin.js DELETED
@@ -1 +0,0 @@
1
- function maxAdmin(){}var $=jQuery;maxAdmin.prototype={colorUpdateTime:!0,colorPalettes:!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(e){e.preventDefault(),e.stopPropagation()}),$("#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(),$("#maxbuttons").on("change, input",'input[type="range"]',$.proxy(this.updateRange,this)),this.updateRange(null),$("#bulk-action-all").on("click",$.proxy(this.checkAllInputs,this)),0!=$("#new-button-form").length&&(this.button_id>0&&$("#maxbuttons .mb-message").show(),$(document).on("livePreviewUpdate",$.proxy(this.saveIndicator,this)),$(".screen-option").on("click",$.proxy(this.change_screen_event,this)),$(".remove-screen").on("click",$.proxy(this.remove_screen,this)),$("#maxbuttons .output").draggable({cancel:".nodrag"}),$(".iris-picker-inner .iris-square-value").removeAttr("href"),$(document).on("click",".iris-picker-inner .iris-square-value",function(e){return e.preventDefault(),e.stopPropagation(),!1}),$(".input.mbcolor .arrows").on("click",$.proxy(this.copyColor,this)),$('[id$="radius_toggle"]').on("click",$.proxy(this.toggleRadiusLock,this)),$(".output .preview-toggle").on("click",$.proxy(this.toggle_preview,this)),$("#maxbuttons input.mb-color-field").on("focus",$.proxy(this.select_field,this)),$(window).on("beforeunload",$.proxy(function(){if(this.form_updated)return maxajax.leave_page},this)),$(document).on("keyup","input",function(e){if(e.keyCode&&13==e.keyCode)return $(":input")[$(":input").index(document.activeElement)+1].focus(),!1}),$(".button-save").on("click",$.proxy(function(e){return this.saveIndicator(null,!1),"new_add_screen"==$(e.target).attr("id")&&$("#add_new_screen").val("yes"),$("#new-button-form").trigger("submit"),!1},this)),$(".shortcode-expand").on("click",this.toggleShortcode),$("#url_button").on("click",$.proxy(this.openURLDialog,this)),$(".block_sidebar .open_control").on("click",this.toggleSidebar),$(window).on("maxbuttons-js-init-done",$.proxy(this.loadLivePreview,this)),1==$('input[name="button_is_new"]').val()&&this.saveIndicator(null,!0))},maxAdmin.prototype.loadLivePreview=function(){if("function"==typeof window.maxFoundry.livePreview?(this.livePreview=new window.maxFoundry.livePreview,this.livePreview.init(),$(document).trigger("livepreview-loaded")):alert("Live Preview not loaded, button preview not functional"),void 0!==window.location.hash&&window.location.hash.length>0){var e=window.location.hash.replace("#","");this.change_screen(e)}},maxAdmin.prototype.change_screen_event=function(e){e.preventDefault();var t=$(e.target);void 0===t.data("screenid")&&(t=t.parents(".screen-option"));var o=t.data("screenid");void 0!==o&&this.change_screen(o)},maxAdmin.prototype.change_screen=function(e){var t=$(".screen-option.option-active").data("screenid"),o=$('.screen-option[data-screenid="'+e+'"]');"new"!=e&&$("#current_screen").val(e),t!==e&&(window.location.hash=e,$(".screen-option").removeClass("option-active"),o.addClass("option-active"),$(document).trigger("changed_screen",e),$(".mbscreen-editor").removeClass("current-screen"),$("#screen_"+e).addClass("current-screen"))},maxAdmin.prototype.remove_screen=function(e){if(confirm(maxadmin_settings.remove_confirm)){var t=$(e.target),o=t.parents(".mbscreen-editor").data("screenid");t.parents(".mbscreen-editor").remove(),$('.screen-option[data-screenid="'+o+'"]').remove(),$('input[name="screens[]"][value="'+o+'"]').remove(),$(".removed-note").show(),this.change_screen("default"),this.saveIndicator(null,!0)}},maxAdmin.prototype.toggle_preview=function(e){$(".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.select_field=function(e){$(e.target).select()},maxAdmin.prototype.button_action=function(e){e.preventDefault();var t=$(e.target).data("buttonaction"),o=$(e.target).data("confirm");if(this.form_updated=!1,void 0!==o){if(!window.confirm(o))return}var n=$(e.target).data("buttonid"),a=$('input[name="'+t+'_nonce"]').val(),i=$('input[name="paged"]').val(),r=maxajax.ajax_url,s={action:"mb_button_action",button_action:t,button_id:n,nonce:a};void 0!==i&&(s.paged=i),$.post({url:r,data:s,success:function(e){response=JSON.parse(e),void 0!==response.redirection&&(window.location=response.redirection)},error:function(){console.error("error in button action"+t)}})},maxAdmin.prototype.checkCopyModal=function(e){this.form_updated?e.currentModal.find(".mb-message").show():$(e.currentModal).find(".mb-message").hide()},maxAdmin.prototype.copyColor=function(e){e.preventDefault(),e.stopPropagation();var t=$(e.target),o=$(e.target).parents("[data-bind]"),n="#"+o.data("id"),a="#"+o.data("bind");if(t.hasClass("arrow-right"))i="right";else var i="left";if(o.hasClass("right"))r="left";else var r="right";"left"==r?copy="right"==i:"right"==r&&(copy="right"!=i),copy?($(a).val($(n).val()),$(a).trigger("change"),$(a).wpColorPicker("color",$(n).val())):($(n).val($(a).val()),$(n).trigger("change"),$(n).wpColorPicker("color",$(a).val()))},maxAdmin.prototype.toggleRadiusLock=function(e){var t=$(e.target),o=$(t).data("lock");"lock"==o?($(t).removeClass("dashicons-lock").addClass("dashicons-unlock"),$(t).data("lock","unlock")):"unlock"==o&&($(t).removeClass("dashicons-unlock").addClass("dashicons-lock"),$(t).data("lock","lock"))},maxAdmin.prototype.initResponsive=function(){},maxAdmin.prototype.do_paging=function(e){var t=parseInt($(e.target).val());if(t<=parseInt($(e.target).attr("max"))){var o=$(e.target).data("url");window.location=o+"&paged="+t}},maxAdmin.prototype.toggleShortcode=function(e){$(".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(e){e.preventDefault();var t=$(e.target),o=t.data("target"),n=$('.manual-entry[data-manual="'+o+'"]');if(n.is(":visible"))return n.hide(),!0;var a=t.parents(".option-container");n.css("top","0px"),n.css("right","-25%"),n.prependTo(a),n.show()},maxAdmin.prototype.resetConditionals=function(){$("[data-show], [data-has]").each(function(){var e=$(this).data("show");if(void 0===e&&(e=$(this).data("has")),void 0!==e){var t=e.target;$(document).off("change",'[name="'+t+'"]')}else console.error($(this)+"has a improperly set conditional")})},maxAdmin.prototype.initConditionials=function(){var e=this;this.resetConditionals(),$("[data-show]").each(function(){var t=$(this).data("show"),o=t.target,n=t.values;$(document).on("change",'[name="'+o+'"]',{child:this,values:n},$.proxy(e.updateConditional,e)),$('[name="'+o+'"]').length>1?$('[name="'+o+'"]:checked').trigger("change",["conditional"]):$('[name="'+o+'"]').trigger("change",["conditional"])});var t=[];$("[data-has]").each(function(){var o=$(this).data("has"),n=o.target,a=o.values;$('[name="'+n+'"]').on("change",{target:n,child:this,values:a},$.proxy(e.updateHasConditional,e));var i='[name="'+n+'"]';$.inArray(i,t),t.push(i)}),t.length>0&&$(t.toString()).first().trigger("change",["conditional"])},maxAdmin.prototype.updateConditional=function(e){var t=e.data,o=t.values,n=t.child,a=$(e.currentTarget),i=$(a).val();if("checkbox"===a.attr("type")){var r=$(a).prop("checked");i="checked"==o&&r?"checked":"unchecked"!=o||r?0:"unchecked"}o.indexOf(i)>=0?($(n).addClass("condshow").animate({opacity:1},300),$(n).find("input, select").trigger("change")):($(n).animate({opacity:0},300,function(){$(n).removeClass("condshow")}),$(n).find("input, select").trigger("change"))},maxAdmin.prototype.updateHasConditional=function(e){var t=e.data,o=t.values,n=t.child,a=t.target,i=[];$(o).each(function(e){i.push("[value="+this+"]")}),$('[name="'+a+'"]').filter(i.toString()).length>0?($(n).addClass("condshow").animate({opacity:1},300),$(n).find("input, select").trigger("change")):($(n).animate({opacity:0},300,function(){$(n).removeClass("condshow")}),$(n).find("input, select").trigger("change"))},maxAdmin.prototype.updateRange=function(e){if(void 0===e||null===e)t=$('input[type="range"]');else var t=[e.target];$(t).each(function(){var e=$(this).val();$(this).parents(".input").find(".range_value output").val(e+"%")})},maxAdmin.prototype.saveIndicator=function(e,t){t?(this.form_updated=!0,$(".button-save").removeClass("disabled").addClass("button-primary")):(this.form_updated=!1,$(".button-save").addClass("disabled").removeClass("button-primary"))},maxAdmin.prototype.formAjaxSave=function(e){e.preventDefault();var t=mb_ajax.ajaxurl,o=$(e.target).serialize();$.ajax({type:"POST",url:t,data:o}).done($.proxy(this.saveDone,this))},maxAdmin.prototype.saveDone=function(e){$("[data-form]").prop("disabled",!1);var t=JSON.parse(e),o=t.result,n=t.title,a=t.data.id;if(void 0!==t.data.new_nonce){t.data.new_nonce;$('input[name="nonce"]').val(t.data.new_nonce)}if(o){$('input[name="collection_id"]').val(a);var i=window.location.href;-1===i.indexOf("collection_id")&&window.history.replaceState({},"",i+"&collection_id="+a),$(document).trigger("mbFormSaved");var r=$('input[name="sorted"]').val();$('input[name="previous_selection"]').val(r),t.data.reload&&document.location.reload(!0)}o||($modal=window.maxFoundry.maxModal,$modal.newModal("collection_error"),$modal.setTitle(n),$modal.setContent(t.body),$modal.setControls('<button class="modal_close button-primary">'+t.close_text+"</button>"),$modal.show())},maxAdmin.prototype.openURLDialog=function(e){return window.wpActiveEditor="url",-1==window.ajaxurl.indexOf("ajax_maxbuttons")&&(window.ajaxurl=window.ajaxurl+"?ajax_maxbuttons=editor"),wpLink.open(),$("#link-options").hide(),$(".query-results").css("top","70px"),$("#wp-link-submit").off("click keyup change"),$("#wp-link-submit").on("click",$.proxy(this.updateLink,this)),!1},maxAdmin.prototype.updateLink=function(e){e.preventDefault();var t=$("#url").val(),o=$("#wp-link-url").val(),n=maxadmin_settings.homeurl;return o=o.replace(n,""),$("#url").val(o),t!=o&&$(document).trigger("livePreviewUpdate",!0),wpLink.close(),!1},maxAdmin.prototype.toggleSidebar=function(e){var t=e.target,o=$(t).parents(".block_sidebar");o.hasClass("active")?o.removeClass("active"):o.addClass("active")},maxAdmin.prototype.checkAllInputs=function(e){e.preventDefault;for(var t=document.getElementById("bulk-action-all").checked,o=document.querySelectorAll('input[name="button-id[]"]'),n=0;n<o.length;n++)o[n].checked=t};
 
js/min/maxmodal.js DELETED
@@ -1 +0,0 @@
1
- var maxModal;jQuery(document).ready(function(t){$=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=$(window).height(),this.windowWidth=$(window).width(),$(document).off("click",".maxmodal"),$(document).on("click",".maxmodal",$.proxy(this.buildModal,this)),$(window).on("resize",$.proxy(this.checkResize,this))},maxModal.prototype.focus=function(){this.currentModal.show()},maxModal.prototype.get=function(){return this.currentModal},maxModal.prototype.show=function(){$(".maxmodal_overlay").remove(),$("body").removeClass("max-modal-active"),this.writeOverlay(),this.currentModal.show(),this.setWidth&&this.currentModal.width(this.setWidth),this.setHeight&&this.currentModal.height(this.setHeight),$m=this.currentModal;var t=$m.find(".modal_header").outerHeight(),o=$m.find(".modal_content").outerHeight(),e=$m.find(".modal_content").width(),a=$m.find(".modal_controls").outerHeight(),i=t+o+a,d=e,n=(this.windowHeight-i)/2,s=(this.windowWidth-d)/2;if(n<30&&(n=30),i>this.windowHeight){newHeight=this.windowHeight-n-5,this.currentModal.height(newHeight);var l=newHeight-t-a;$m.find(".modal_content").height(l)}this.currentModal.css("left",s+"px"),this.currentModal.css("top",n+"px"),this.currentModal.css("height",i),$(".maxmodal_overlay").show(),$("body").addClass("max-modal-active"),$(document).off("keydown",$.proxy(this.keyPressHandler,this)),$(document).on("keydown",$.proxy(this.keyPressHandler,this)),this.currentModal.trigger("focus")},maxModal.prototype.keyPressHandler=function(t){27===t.keyCode&&this.close()},maxModal.prototype.checkResize=function(){this.windowHeight=$(window).height(),this.windowWidth=$(window).width(),null!==this.currentModal&&(this.currentModal.removeAttr("style"),this.currentModal.find(".modal_content").removeAttr("style"),this.currentModal.removeAttr("style"),this.show())},maxModal.prototype.close=function(){this.currentModal.trigger("modal_close",[this]),this.currentModal.remove(),this.currentModal=null,$(".maxmodal_overlay").remove(),$("body").removeClass("max-modal-active"),$(document).off("keydown",$.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.resetControls=function(){this.controls=[]},maxModal.prototype.setControls=function(t){var o=this.currentModal.find(".modal_content"),e=$('<div class="modal_controls controls">');for(i=0;i<this.controls.length;i++)e.append(this.controls[i]);void 0!==t&&e.append(t),o.append(e),$(this.currentModal).find(".modal_close").off("click"),$(this.currentModal).find(".modal_close").on("click",$.proxy(this.close,this))},maxModal.prototype.addControl=function(t,o,e){var a="";switch(t){case"yes":a=modaltext.yes;break;case"ok":a=modaltext.ok;break;case"no":a=modaltext.no;break;case"cancel":a=modaltext.cancel;break;default:a=t,t="custom"}var i=$('<a class="button-primary '+t+'">'+a+"</a>");i.on("click",o,e),this.controls.push(i)},maxModal.prototype.setContent=function(t){null!==this.currentModal&&this.currentModal.find(".modal_content").html(t)},maxModal.prototype.buildModal=function(t){t.preventDefault();var o=$(t.target);void 0===o.data("modal")&&(o=o.parents(".maxmodal")),this.target=o;var e=o.data("modal"),a=$("#"+e);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 i=$(a).find(".title").text(),d=$(a).find(".controls").html(),n=$(a).find(".content").html();if(this.newModal(e),this.setTitle(i),this.setContent(n),this.setControls(d),void 0!==$(a).data("load")){var s=a.data("load")+"(modal)",l=new Function("modal",s);try{l(this)}catch(t){console.error("MB Modal Callback Error: "+t.message),console.error("MB Modal tried calling: "+s)}}this.show()},maxModal.prototype.newModal=function(t){null!==this.currentModal&&this.close();var o=$('<div class="max-modal '+t+'" > \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 $(this.parent).length>0?$(this.parent).append(o):$("body").append(o),$(o).draggable({handle:".modal_header"}),this.modals.push(o),this.currentModal=o,this.controls=[],this},maxModal.prototype.writeOverlay=function(){$(this.parent).append('<div class="maxmodal_overlay"></div>'),$(".maxmodal_overlay").on("click",$.proxy(this.close,this))}});
 
js/min/maxtabs.js DELETED
@@ -1 +0,0 @@
1
- function maxTabs(){}maxTabs.prototype.init=function(){this.tabs(),this.previewTab()},maxTabs.prototype.tabs=function(){var a=".mb_tab";if(0!==$(a).length){var t=$("#maxbuttons").data("view");if(void 0===t&&(t="list"),"list"!=t){$("#maxbuttons").addClass("mb_tabs_active"),0===$(".sub-tabs").length?($tabslocation=$('<h2 class="nav-tab-wrapper sub-tabs"></h2>'),$tabslocation.insertBefore($(a).first()),$tabslocation=$(".sub-tabs")):$tabslocation=$(".sub-tabs"),$(a).hide(),$.each($(a),function(){var a=$(this).children("div.title").first(),t=a.clone(),e=t.children("span:first").clone().wrap("<p>").parent().html(),i=t.children("span.title").text();$(t).children("span").remove(),$(t).children("input,button").remove(),a.children("span:first").remove(),a.children(".title").remove(),tab_title=void 0!==e?e+i:i;var s=$('<a class="nav-tab" href="javascript:void(0);">'+tab_title+"</a>");i=(i=i.trim()).replace(/ /g,"-"),$(s).attr("data-tab",i.toLowerCase()),$(".sub-tabs").append(s),$(this).attr("data-tab",i.toLowerCase())});var e=$('input[name="tab"]').val();void 0===e&&(e=""),""==e?($tabslocation.children(".nav-tab").first().addClass("nav-tab-active"),$(a).first().show()):($tabslocation.children('[data-tab="'+e+'"]').addClass("nav-tab-active"),$(a+'[data-tab="'+e+'"]').show()),$tabslocation.children("a").on("click",this.toggleTabs),this.addSaveTab($tabslocation)}}},maxTabs.prototype.addSaveTab=function(a){a.append('<div class="save-indicator dashicons dashicons-warning"></div>')},maxTabs.prototype.toggleTabs=function(a){a.preventDefault();$(".sub-tabs").children("a").removeClass("nav-tab-active"),$(this).addClass("nav-tab-active"),$(".mb_tab").hide();var t=$(this).data("tab");$('.mb_tab[data-tab="'+t+'"]').show(),$('input[name="tab"]').val(t),$(document).trigger("maxTabChange",[t])},maxTabs.prototype.previewTab=function(){$(".mb-preview-window").is(":visible");var a='.sub-tabs a[data-tab="preview"]';this.togglePreview(),$(a).off("click"),$(document).on("click",a,$.proxy(function(a){a.preventDefault(),a.stopPropagation();return $(".mb-preview-window").is(":visible")?this.togglePreview(!1):this.togglePreview(!0),$(document).trigger("updatePreviewWindow"),!1},this)),$(".mb-preview-window .close").on("click",{tab:a},function(a){$(a.data.tab).trigger("click")})},maxTabs.prototype.togglePreview=function(a){var t='.sub-tabs a[data-tab="preview"]';if(void 0===a)if(localStorage.getItem("mb-col-preview")){var e=localStorage.getItem("mb-col-preview");"string"==typeof e&&(e="true"==e),"boolean"==typeof e&&this.togglePreview(e)}else this.togglePreview(!0);else a?($(".mb-preview-window").show(),$(t).addClass(" preview-on"),$(t+" .dashicons").addClass("dashicons-yes").removeClass("dashicons-no"),$(t).removeClass("preview-off"),localStorage.setItem("mb-col-preview",!0)):($(".mb-preview-window").hide(),$(t).removeClass("preview-on"),$(t+" .dashicons").removeClass("dashicons-yes").addClass("dashicons-no"),$(t).addClass("preview-off"),localStorage.setItem("mb-col-preview",!1))};
 
js/min/media_button.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(t){function o(){"object"!=typeof window.maxFoundry.maxmodal&&(window.maxFoundry.maxmodal=new maxModal,window.maxFoundry.maxmodal.init()),"object"!=typeof window.maxFoundry.maxAjax&&(window.maxFoundry.maxAjax=new maxAjax,window.maxFoundry.maxAjax.init()),this.maxmodal=window.maxFoundry.maxmodal,this.maxajax=window.maxFoundry.maxAjax}$=t,(o.prototype={parent:"body",is_active:!1,maxmodal:null,maxajax:null,callback:null,useShortCodeOptions:!0,shortcodeData:null,getPage:1,ajaxSuccessHandler:null}).init=function(t){void 0!==t&&(void 0!==t.callback&&(this.callback=t.callback||null),void 0!==t.useShortCodeOptions&&(this.useShortCodeOptions=t.useShortCodeOptions),void 0!==t.parent&&(this.parent=t.parent)),this.ajaxSuccessHandler=$.proxy(this.putContent,this),$(document).off("click",".pagination span, .pagination-links a",$.proxy(this.doPagination,this)),$(document).on("click",".pagination span, .pagination-links a",$.proxy(this.doPagination,this)),$(document).off("change",".pagination-links .input-paging",$.proxy(this.doInputPagination,this)),$(document).on("change",".pagination-links .input-paging",$.proxy(this.doInputPagination,this)),$(document).off("media_button_content_buttons_load",$.proxy(this.hookButtonAction,this)),$(document).on("media_button_content_buttons_load",$.proxy(this.hookButtonAction,this)),$(document).off("media_button_content_shortcode_options",$.proxy(this.hookShortCodeAction,this)),$(document).on("media_button_content_shortcode_options",$.proxy(this.hookShortCodeAction,this))},o.prototype.openModal=function(){void 0!==window.tp&&$("#advanced-editor").wpdialog("close"),this.maxmodal.newModal("media-popup"),this.maxmodal.parent=this.parent,this.maxmodal.setTitle(mbtrans.windowtitle),this.maxmodal.setContent('<span class="loading"></span>'),this.maxmodal.show(),this.maxajax.showSpinner($(".loading")),this.loadButtons(),this.is_active=!0},o.prototype.loadButtons=function(){var t=this.maxajax.ajaxInit();t.plugin_action="getAjaxButtons",t.page=this.getPage,this.maxajax.ajaxPost(t,this.ajaxSuccessHandler)},o.prototype.putContent=function(t){t=JSON.parse(t);this.maxajax.removeSpinner(),void 0!==t.output&&this.maxmodal.setContent(t.output),void 0!==t.action&&$(document).trigger("media_button_content_"+t.action,t)},o.prototype.hookButtonAction=function(){$(document).off("click",".button-list"),$(document).on("click",".button-list",$.proxy(function(t){t.preventDefault(),t.stopPropagation();var o=$(t.target);void 0===$(o).data("button")&&(o=$(o).parents(".button-list"));var a=$(o).data("button");$(".button-list").removeClass("selected"),$(o).addClass("selected"),$(".controls .button-primary").data("button",a),this.maxmodal.currentModal.find(".controls .button-primary").removeClass("disabled")},this)),$(document).off("click",".button-preview a"),$(document).on("click",".button-preview a",function(t){t.preventDefault()}),this.maxmodal.resetControls(),this.useShortCodeOptions?this.maxmodal.addControl(mbtrans.use,"",$.proxy(this.shortCodeOptions,this)):this.maxmodal.addControl(mbtrans.insert,"",$.proxy(this.selectAction,this)),this.maxmodal.setControls(),this.maxmodal.currentModal.find(".controls .button-primary").addClass("disabled"),this.maxmodal.checkResize()},o.prototype.hookShortCodeAction=function(t,o){this.shortcodeData=o.shortcodeData;var a=o.button_id;this.maxmodal.resetControls(),this.maxmodal.addControl(mbtrans.insert,"",$.proxy(this.selectAction,this)),this.maxmodal.setControls(),$(this.maxmodal.currentModal).find(".controls .button-primary").data("button",a),$(this.maxmodal.currentModal).find(".more-options a").off("click"),$(this.maxmodal.currentModal).find(".more-options a").on("click",$.proxy(function(t){$(this.maxmodal.currentModal).find(".more-field").show(),$(t.target).parents(".option .more").hide(),this.maxmodal.checkResize()},this)),this.maxmodal.checkResize()},o.prototype.selectAction=function(t){if(t.preventDefault(),!$(t.target).hasClass("disabled")){var o=$(t.target).data("button");void 0===o||parseInt(o)<=0||("function"==typeof this.callback?this.callback(o,$(t.target)):(this.buttonToEditor(o),this.close()))}},o.prototype.shortCodeOptions=function(t){if(t.preventDefault(),!$(t.target).hasClass("disabled")){var o=$(t.target).data("button"),a=this.maxajax.ajaxInit();a.plugin_action="mediaShortcodeOptions",a.button_id=o,this.maxajax.ajaxPost(a,this.ajaxSuccessHandler)}},o.prototype.doInputPagination=function(t){t.preventDefault();var o=$(t.target),a=parseInt(o.data("current")),n=parseInt(o.val()),i=parseInt(o.attr("max"));n!=a&&n>=1&&n<=i&&(this.getPage=n,this.loadButtons())},o.prototype.doPagination=function(t){if(t.preventDefault(),$(t.target).hasClass("disabled"))return!1;var o=$(t.target).data("page");o<=1&&(o=1),this.getPage=o,this.loadButtons()},o.prototype.generateShortcode=function(t){var o='[maxbutton id="'+t+'"';return void 0!==this.shortcodeData&&$(this.shortcodeData).each(function(t,a){var n=$('input[name="'+a.name+'"]'),i=$('input[name="'+a.name+'"]').val();if("checkbox"==n.attr("type")){var e=n.is(":checked");e!=a.original&&(o+=e?" "+a.shortcode+'="'+a.checked+'"':" "+a.shortcode+'="'+a.unchecked+'"')}else i!=a.original&&(o+=" "+a.shortcode+'="'+i+'"')}),o+=" ] "},o.prototype.buttonToEditor=function(t){if(shortcode=this.generateShortcode(t),"function"==typeof window.send_to_editor)window.send_to_editor(shortcode,t);else if(void 0!==window.tp){var o=$("#advanced-editor-content").val();o+=shortcode,$("#advanced-editor-content").val(o),$("#advanced-editor").wpdialog("open")}},o.prototype.close=function(){this.maxmodal.close()},void 0===window.maxFoundry&&(window.maxFoundry={}),window.maxFoundry.maxMedia=o});
 
js/min/responsive.js DELETED
@@ -1 +0,0 @@
1
- function mbResponsive(){}mbResponsive.prototype={mbAdmin:null,responsiveMap:null},mbResponsive.prototype.init=function(e){this.mbAdmin=e,0!=$("#new-button-form").length&&(this.checkAutoQuery(),$('input[name="auto_responsive"]').on("click",$.proxy(this.checkAutoQuery,this)),$(".add_media_query").on("click",$.proxy(this.addMediaQuery,this)),this.responsiveMap=JSON.parse(responsiveMap),$(document).on("click",".removebutton",$.proxy(this.removeMediaQuery,this)))},mbResponsive.prototype.checkAutoQuery=function(){$('input[name="auto_responsive"]').is(":checked")?($(".media_queries_options").hide(),$(".option-design.new-query").hide()):($(".media_queries_options").show(),$(".option-design.new-query").show())},mbResponsive.prototype.addMediaQuery=function(){this.mbAdmin.saveIndicator(!0);var e=$(".media_option_prot").children().clone(),t=$("#new_query").val(),i=$("#new_query :selected").text(),n=$("#media_desc").children("#"+t).text();$(e).data("query",t),$(e).children('input[name="media_query[]"]').val(t),$(e).children(".title").text(i),$(e).children(".description").text(n),"custom"==t&&$(e).find(".custom").removeClass("hidden");var r=$('input[name="next_media_index"]').val();$(e).find("label, select, input").each(function(){var e=$(this).attr("name"),t=$(this).attr("id"),i=$(this).data("field"),n=$(this).prop("tagName").toLowerCase();if(void 0!==t&&$(this).attr("id",t.replace("[]","["+r+"]")),void 0!==e&&$(this).attr("name",e.replace("[]","["+r+"]")),void 0!==i&&$(this).data("field",i.replace("[]","["+r+"]")),"label"==n){var o=$(this).attr("for");void 0!==o&&$(this).attr("for",o.replace("[]","["+r+"]"))}}),$(document).trigger("reinitConditionals"),r=parseInt(r),$('input[name="next_media_index"]').val(r+1),"custom"!==t&&($("#new_query :selected").prop("disabled",!0),$("#new_query :selected").prop("selected",!1)),$(".new_query_space").append(e);var o=$(".new_query_space").offset().top;$(window).scrollTop(o-100)},mbResponsive.prototype.removeMediaQuery=function(e){var t=e.target,i=$(t).parents(".media_query").data("query");$(t).parents(".media_query").fadeOut(function(){$(this).remove()}),$('#new_query option[value="'+i+'"]').prop("disabled",!1)},mbResponsive.prototype.toggleResponsivePreview=function(e){var t=$(e.target).attr("id");t=(t=t.replace("mq_preview[","")).replace("]",""),this.renderPreview(t)},mbResponsive.prototype.renderPreview=function(e){var t=["mq_container_width","mq_container_float","mq_custom_minwidth","mq_custom_minheight","mq_hide"],i=this.responsiveMap,n=this;$.each(i,function(r){var o=this.css,a='[id^="'+r+'["]',s='[id^="'+r+'_unit["]',d=$(a).eq(e),p=d.attr("id");if(p=p.replace(/\[[0-9]\]/gi,""),$.inArray(p,t)>=0)return!0;if(p.indexOf("_unit")>=0)return!0;var u=d.val(),c="";if(void 0!==i[r+"_unit"])c=$(s).eq(e).val();var m={css:o};"font-size"==o&&(m.csspart="mb-text,mb-text2"),n.mbAdmin.putCSS(m,u+c)})};
 
js/min/review-notice.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(a){function t(t){t.preventDefault;!function(t){var e=mb_ajax_review.ajaxurl,n={action:"maxajax",plugin_action:"save_review_notice_status",status:t,nonce:mb_ajax_review.nonce};a.ajax({method:"POST",url:e,data:n,success:function(t){a(".maxbuttons-notice, .maxbuttons-reviewoffer").fadeOut()}})}(a(t.target).data("action"))}a(".maxbuttons-notice [data-action], .maxbuttons-reviewoffer [data-action]").on("click",t)});
 
js/min/tinymce.js DELETED
@@ -1 +0,0 @@
1
- tinymce.create("tinymce.plugins.maxButtons",{init:function(n,t){n.addButton("maxbutton",{title:"Insert MaxButton",image:"undefined"!=typeof mbtrans?mbtrans.icon:null,onclick:function(){var n=new window.maxFoundry.maxMedia;n.init(),n.openModal()}})},createControl:function(n,t){return null}}),tinymce.PluginManager.add("maxButtons_tinymce",tinymce.plugins.maxButtons);
 
maxbuttons.php CHANGED
@@ -3,7 +3,7 @@
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: 9.3
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
@@ -16,9 +16,9 @@ namespace MaxButtons;
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
- define('MAXBUTTONS_VERSION_NUM', '9.3');
20
 
21
- define('MAXBUTTONS_RELEASE',"25 July 2022");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
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: 9.4
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
+ define('MAXBUTTONS_VERSION_NUM', '9.4');
20
 
21
+ define('MAXBUTTONS_RELEASE',"14 September 2022");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: wordpress button plugin, share button, wordpress buttons, css3 button gene
4
  Requires at least: 4.8
5
  Tested up to: 6.0
6
  Requires PHP: 7.0
7
- Stable tag: 9.3
8
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
9
 
10
  == Description ==
@@ -276,6 +276,20 @@ Upgrading to the PRO version is quite simple. Obtain a license key via our [site
276
 
277
  == Changelog ==
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  = 9.3 =
280
 
281
  * Fixed minor CSRF issue on settings page
4
  Requires at least: 4.8
5
  Tested up to: 6.0
6
  Requires PHP: 7.0
7
+ Stable tag: 9.4
8
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
9
 
10
  == Description ==
276
 
277
  == Changelog ==
278
 
279
+ = 9.4 =
280
+
281
+ - New - Clearer interface showing changes and differences on responsive screens from main button
282
+ - Major improvements in Javascript performance and loading the button editor
283
+ - Screen icon and title on preview window to make more clear which screen is active
284
+ - Updated range input, removed deprecated styles
285
+
286
+ - Tweak - Pressing ctrl-s now saves the button.
287
+ - Fix - Preview width / height would in some cases show wrong value when changing screen
288
+ - Fix - Better escaping in query for CSS output
289
+ - Fix - Issue loading gradient color fields in responsive screens
290
+ - Fix - Removing color from color field will now make it transparent
291
+ - Fix - Check on user capability when doing button actions.
292
+
293
  = 9.3 =
294
 
295
  * Fixed minor CSRF issue on settings page