Changeset 1490791
- Timestamp:
- 09/06/2016 07:51:00 AM (9 years ago)
- Location:
- kopatheme/trunk
- Files:
-
- 34 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
kopatheme/trunk/assets/css/custom-layout.css
r1486248 r1490791 16 16 background-image: none; 17 17 border: 1px solid #d3d7da; 18 box-shadow: 0 0 8px 1px #e9e8e8 inset; 19 } 18 box-shadow: 0 0 8px 1px #e9e8e8 inset; } 20 19 21 20 .clearfix:before, .kopa_section_group_layout .kopa_controls:before, .clearfix:after, .kopa_section_group_layout .kopa_controls:after { 22 21 content: " "; 23 display: table; 24 } 22 display: table; } 25 23 26 24 .clearfix:after, .kopa_section_group_layout .kopa_controls:after { 27 clear: both; 28 } 25 clear: both; } 29 26 30 27 .kopa_section_group_layout * { 31 28 -webkit-box-sizing: border-box; 32 29 -moz-box-sizing: border-box; 33 box-sizing: border-box; 34 } 35 30 box-sizing: border-box; } 36 31 .kopa_section_group_layout a { 37 text-decoration: none; 38 } 39 40 .kopa_section_group_layout a:hover, .kopa_section_group_layout a:focus { 41 text-decoration: none; 42 outline: none; 43 } 44 32 text-decoration: none; } 33 .kopa_section_group_layout a:hover, .kopa_section_group_layout a:focus { 34 text-decoration: none; 35 outline: none; } 45 36 .kopa_section_group_layout input[type="text"] { 46 margin: 0; 47 } 48 37 margin: 0; } 49 38 .kopa_section_group_layout .kopa_section_group { 50 position: relative; 51 } 52 39 position: relative; } 53 40 .kopa_section_group_layout .kopa_controls { 54 position: relative; 55 } 56 57 .kopa_section_group_layout .kopa_controls select { 58 margin: 0; 59 width: 100%; 60 } 61 41 position: relative; } 42 .kopa_section_group_layout .kopa_controls select { 43 margin: 0; 44 width: 100%; } 62 45 .kopa_section_group_layout .kopa_group_content { 63 overflow: hidden; 64 } 65 46 overflow: hidden; } 66 47 .kopa_section_group_layout .kopa_section_layout_image { 67 48 padding-left: 20px; 68 49 float: right; 69 width: 65%; 70 } 71 72 .kopa_section_group_layout .kopa_section_layout_image img { 73 display: block; 74 width: 100%; 75 height: auto; 76 border: 1px solid #d3d7da; 77 } 78 50 width: 65%; } 51 .kopa_section_group_layout .kopa_section_layout_image img { 52 display: block; 53 width: 100%; 54 height: auto; 55 border: 1px solid #d3d7da; } 79 56 .kopa_section_group_layout .kopa_section { 80 57 padding: 15px 20px 20px; 81 58 border: 1px solid #d3d7da; 82 59 margin-top: -1px; 83 background: #fff; 84 } 85 60 background: #fff; } 86 61 .kopa_section_group_layout .kopa_section_select_layout { 87 62 margin-bottom: 10px; 88 margin-top: 0; 89 } 90 63 margin-top: 0; } 91 64 .kopa_section_group_layout .kopa_section_select_layout, .kopa_section_group_layout .kopa_section_select_area_container { 92 65 float: left; 93 width: 35%; 94 } 95 66 width: 35%; } 96 67 .kopa_section_group_layout label { 97 68 margin-bottom: 20px; 98 69 margin-top: 9px; 99 display: inline-block; 100 } 101 70 display: inline-block; } 102 71 .kopa_section_group_layout .kopa_heading { 103 72 font-size: 14px; … … 107 76 padding: 0; 108 77 margin: 0 0 10px; 109 line-height: 1.4; 110 } 111 78 line-height: 1.4; } 112 79 .kopa_section_group_layout .kopa_section_select_area_container, .kopa_section_group_layout .kopa_section_layout_image { 113 display: none; 114 } 80 display: none; } 115 81 116 82 td .kopa_section_group_layout label { 117 margin-top: 5px; 118 } 83 margin-top: 5px; } 84 85 /*# sourceMappingURL=custom-layout.css.map */ -
kopatheme/trunk/assets/css/widget.css
r1486248 r1490791 1524 1524 } 1525 1525 1526 .kopa-metabox-wrapper { 1527 overflow: hidden; 1528 } 1526 1529 .kopa-metabox-wrapper .kopa_screenshot { 1527 1530 display: block; … … 1538 1541 display: none; 1539 1542 } 1543 1544 .kopa-ui-repeater-links.kopa-size--xs { 1545 width: 25%; 1546 } 1547 .kopa-ui-repeater-links.kopa-size--sm { 1548 width: 50%; 1549 } 1550 .kopa-ui-repeater-links.kopa-size--md { 1551 width: 75%; 1552 } 1553 .kopa-ui-repeater-links.kopa-size--lg { 1554 width: 100%; 1555 } 1556 1557 .kopa-repeater-group { 1558 margin-bottom: 12px; 1559 } 1560 .kopa-repeater-group label { 1561 display: block; 1562 position: relative; 1563 height: 36px; 1564 line-height: 36px; 1565 padding: 0px 12px; 1566 background-color: #eee; 1567 border: 1px solid #ddd; 1568 } 1569 .kopa-repeater-group label:hover i { 1570 display: block; 1571 } 1572 .kopa-repeater-group label i { 1573 display: none; 1574 position: absolute; 1575 top: 50%; 1576 right: 45%; 1577 margin-top: -12px; 1578 width: 48px; 1579 height: 24px; 1580 line-height: 24px; 1581 background-color: #9e9e9e; 1582 color: #fff; 1583 font-size: 13px; 1584 } 1585 .kopa-repeater-group label i:hover { 1586 background-color: #858585; 1587 } 1588 .kopa-repeater-group label i.kopa-repeater-edit { 1589 margin-right: 24px; 1590 border: 1px solid #858585; 1591 border-right: 0; 1592 -webkit-border-top-left-radius: 3px; 1593 -webkit-border-bottom-left-radius: 3px; 1594 -moz-border-radius-topleft: 5px; 1595 -moz-border-radius-bottomleft: 5px; 1596 border-top-left-radius: 3px; 1597 border-bottom-left-radius: 3px; 1598 } 1599 .kopa-repeater-group label i.kopa-repeater-delete { 1600 margin-right: -24px; 1601 border: 1px solid #858585; 1602 -webkit-border-top-right-radius: 3px; 1603 -webkit-border-bottom-right-radius: 3px; 1604 -moz-border-radius-topright: 5px; 1605 -moz-border-radius-bottomright: 5px; 1606 border-top-right-radius: 3px; 1607 border-bottom-right-radius: 3px; 1608 } 1609 .kopa-repeater-group .kopa-repeater-item-content { 1610 display: none; 1611 border-left: 1px solid #ddd; 1612 border-right: 1px solid #ddd; 1613 border-bottom: 1px solid #ddd; 1614 padding: 12px; 1615 background-color: #fafafa; 1616 } 1617 .kopa-repeater-group .kopa-repeater-item-content > .kopa-repeater-item-block, .kopa-repeater-group .kopa-repeater-item-content > p { 1618 position: relative; 1619 margin-bottom: 0px; 1620 margin-top: 12px; 1621 } 1622 .kopa-repeater-group .kopa-repeater-item-content > .kopa-repeater-item-block:first-child, .kopa-repeater-group .kopa-repeater-item-content > p:first-child { 1623 margin-top: 0px; 1624 } 1625 .kopa-repeater-group .kopa-repeater-item-content > .kopa-repeater-item-block input, .kopa-repeater-group .kopa-repeater-item-content > p input { 1626 width: 100%; 1627 } 1628 .kopa-repeater-group .kopa-repeater-item-content > .kopa-repeater-item-block > span, .kopa-repeater-group .kopa-repeater-item-content > p > span { 1629 display: block; 1630 width: 100%; 1631 } 1632 .kopa-repeater-group.kopa-repeater-group--open .kopa-repeater-item-content { 1633 display: block; 1634 border-color: #303f46; 1635 } 1636 .kopa-repeater-group.kopa-repeater-group--open label { 1637 background-color: #455a64; 1638 border-color: #303f46; 1639 } 1640 .kopa-repeater-group.kopa-repeater-group--open label span { 1641 color: #fff; 1642 } 1643 1644 .kopa-repeater-toolbar { 1645 margin-top: 12px; 1646 margin-bottom: 0px; 1647 } 1648 1649 .kopa-ui-quote .kopa-row { 1650 position: relative; 1651 padding: 15px; 1652 border: 1px solid #e5e5e5; 1653 background-color: #fafafa; 1654 margin-top: 5px; 1655 } 1656 .kopa-ui-quote .kopa-row:first-child { 1657 margin-top: 0px; 1658 } 1659 1660 .kopa-ui-icon-picker { 1661 display: block; 1662 position: relative; 1663 overflow: hidden; 1664 text-align: center; 1665 border: 1px solid #ddd; 1666 background-color: #eee; 1667 } 1668 .kopa-ui-icon-picker:hover .kopa-ui-icon-picker-action { 1669 bottom: 1px !important; 1670 } 1671 .kopa-ui-icon-picker i { 1672 display: block; 1673 border: 1px solid #fff; 1674 color: #333; 1675 } 1676 .kopa-ui-icon-picker .kopa-ui-icon-picker-action { 1677 transition: all 0.5s; 1678 -ms-transition: all 0.5s; 1679 -webkit-transition: all 0.5s; 1680 -moz-transition: all 0.5s; 1681 display: block; 1682 position: absolute; 1683 left: 1px; 1684 right: 1px; 1685 text-align: center; 1686 text-transform: uppercase; 1687 color: #fff; 1688 cursor: pointer; 1689 } 1690 .kopa-ui-icon-picker .kopa-ui-icon-picker-add { 1691 background-color: rgba(0, 115, 170, 0.75); 1692 } 1693 .kopa-ui-icon-picker .kopa-ui-icon-picker-add:hover { 1694 background-color: #0085ba; 1695 } 1696 .kopa-ui-icon-picker.kopa-size--lg { 1697 width: 90px; 1698 height: 90px; 1699 line-height: 90px; 1700 } 1701 .kopa-ui-icon-picker.kopa-size--lg i { 1702 width: 88px; 1703 height: 88px; 1704 line-height: 88px; 1705 font-size: 48px; 1706 } 1707 .kopa-ui-icon-picker.kopa-size--lg .kopa-ui-icon-picker-action { 1708 bottom: -24px; 1709 height: 24px; 1710 line-height: 24px; 1711 font-size: 10px; 1712 } 1713 .kopa-ui-icon-picker.kopa-size--xs { 1714 width: 35px; 1715 height: 35px; 1716 line-height: 35px; 1717 } 1718 .kopa-ui-icon-picker.kopa-size--xs i { 1719 width: 33px; 1720 height: 33px; 1721 line-height: 33px; 1722 font-size: 24px; 1723 } 1724 .kopa-ui-icon-picker.kopa-size--xs .kopa-ui-icon-picker-action { 1725 bottom: -33px; 1726 height: 31px; 1727 line-height: 31px; 1728 font-size: 10px; 1729 } 1730 1731 #tmpl-kopa-icon-picker .kopa-ui__header { 1732 margin-bottom: 16px; 1733 } 1734 #tmpl-kopa-icon-picker .kopa-ui__search { 1735 width: 100%; 1736 } 1737 #tmpl-kopa-icon-picker .kopa-ui__body:after { 1738 clear: both; 1739 } 1740 #tmpl-kopa-icon-picker .kopa-ui__body:before, #tmpl-kopa-icon-picker .kopa-ui__body:after { 1741 display: table; 1742 content: " "; 1743 } 1744 #tmpl-kopa-icon-picker .kopa-ui__body { 1745 margin-left: -3px; 1746 margin-right: -3px; 1747 } 1748 #tmpl-kopa-icon-picker .kopa-ui__body span { 1749 display: block; 1750 float: left; 1751 width: 53px; 1752 height: 53px; 1753 padding-left: 3px; 1754 padding-right: 3px; 1755 margin-bottom: 6px; 1756 } 1757 #tmpl-kopa-icon-picker .kopa-ui__body i { 1758 display: block; 1759 width: 100%; 1760 height: 53px; 1761 line-height: 53px; 1762 text-align: center; 1763 border: 1px solid #dddddd; 1764 background-color: #fafafa; 1765 color: #333; 1766 font-size: 14px; 1767 cursor: pointer; 1768 } 1769 #tmpl-kopa-icon-picker .kopa-ui__body i.kopa-ui__active, #tmpl-kopa-icon-picker .kopa-ui__body i:hover { 1770 transition: background-color 0.5s; 1771 -ms-transition: background-color 0.5s; 1772 -webkit-transition: background-color 0.5s; 1773 -moz-transition: background-color 0.5s; 1774 background-color: #0073aa; 1775 color: #fff; 1776 } 1777 1778 .kopa-ui-dialog .ui-dialog-buttonset { 1779 float: none; 1780 width: 100%; 1781 } 1782 .kopa-ui-dialog .ui-dialog-buttonset .kopa-ui-button-use { 1783 float: right; 1784 } 1785 .kopa-ui-dialog .ui-dialog-buttonset .kopa-ui-button-cancel { 1786 float: right; 1787 } 1788 .kopa-ui-dialog .ui-dialog-buttonset .kopa-ui-button-remove { 1789 float: left; 1790 margin-right: 0 !important; 1791 color: #ff0000; 1792 } -
kopatheme/trunk/assets/css/widget.scss
r1486248 r1490791 1 @import 'config'; 1 2 @import 'grid'; 2 3 @import 'image_field'; … … 188 189 189 190 .kopa-metabox-wrapper{ 191 overflow: hidden; 190 192 191 193 .kopa_screenshot{ … … 205 207 } 206 208 209 210 .kopa-ui-repeater-links{ 211 &.kopa-size--xs{ width: 25%; } 212 &.kopa-size--sm{ width: 50%; } 213 &.kopa-size--md{ width: 75%; } 214 &.kopa-size--lg{ width: 100%; } 215 } 216 217 .kopa-repeater-group{ 218 margin-bottom: 12px; 219 220 221 label{ 222 display: block; 223 position: relative; 224 225 height: 36px; 226 line-height: 36px; 227 padding: 0px 12px; 228 background-color: #eee; 229 border: 1px solid #ddd; 230 231 &:hover{ 232 i{ 233 display: block; 234 } 235 } 236 237 i{ 238 display: none; 239 position: absolute; 240 top: 50%; 241 right: 45%; 242 margin-top: -12px; 243 width: 48px; 244 height: 24px; 245 line-height: 24px; 246 background-color: $color_action--02; 247 color: #fff; 248 font-size: 13px; 249 250 &:hover{ 251 background-color: darken( $color_action--02 , 10 ); 252 } 253 } 254 255 i.kopa-repeater-edit{ 256 margin-right: 24px; 257 border: 1px solid darken( $color_action--02 , 10 ); 258 border-right: 0; 259 260 -webkit-border-top-left-radius: 3px; 261 -webkit-border-bottom-left-radius: 3px; 262 -moz-border-radius-topleft: 5px; 263 -moz-border-radius-bottomleft: 5px; 264 border-top-left-radius: 3px; 265 border-bottom-left-radius: 3px; 266 } 267 268 i.kopa-repeater-delete{ 269 margin-right: -24px; 270 border: 1px solid darken( $color_action--02 , 10 ); 271 272 -webkit-border-top-right-radius: 3px; 273 -webkit-border-bottom-right-radius: 3px; 274 -moz-border-radius-topright: 5px; 275 -moz-border-radius-bottomright: 5px; 276 border-top-right-radius: 3px; 277 border-bottom-right-radius: 3px; 278 } 279 } 280 281 .kopa-repeater-item-content{ 282 display: none; 283 border-left: 1px solid #ddd; 284 border-right: 1px solid #ddd; 285 border-bottom: 1px solid #ddd; 286 padding: 12px; 287 background-color: #fafafa; 288 289 & > .kopa-repeater-item-block, 290 & > p{ 291 position: relative; 292 margin-bottom: 0px; 293 margin-top: 12px; 294 295 &:first-child{ 296 margin-top: 0px; 297 } 298 299 input{ 300 width: 100%; 301 } 302 & > span{ 303 display: block; 304 width: 100%; 305 } 306 } 307 } 308 309 &.kopa-repeater-group--open{ 310 .kopa-repeater-item-content{ 311 display: block; 312 border-color: darken( $color__action--01 , 10 ); 313 } 314 315 label{ 316 background-color: $color__action--01; 317 border-color: darken( $color__action--01 , 10 ); 318 span{ 319 color: #fff; 320 } 321 } 322 } 323 324 } 325 326 .kopa-repeater-toolbar{ 327 margin-top: 12px; 328 margin-bottom: 0px; 329 } 330 331 .kopa-ui-quote{ 332 .kopa-row{ 333 position: relative; 334 padding: 15px; 335 border: 1px solid #e5e5e5; 336 background-color: #fafafa; 337 margin-top: 5px; 338 &:first-child{ 339 margin-top: 0px; 340 } 341 } 342 } 343 344 .kopa-ui-icon-picker{ 345 display: block; 346 position: relative; 347 overflow: hidden; 348 text-align: center; 349 border: 1px solid #ddd; 350 background-color: #eee; 351 352 &:hover{ 353 .kopa-ui-icon-picker-action{ 354 bottom: 1px !important; 355 } 356 } 357 358 i{ 359 display: block; 360 border: 1px solid #fff; 361 color: #333; 362 } 363 364 .kopa-ui-icon-picker-action{ 365 @include transition( .5s ); 366 display: block; 367 position: absolute; 368 left: 1px; 369 right: 1px; 370 text-align: center; 371 text-transform: uppercase; 372 color: #fff; 373 cursor: pointer; 374 } 375 376 .kopa-ui-icon-picker-add{ 377 background-color: rgba( #0073aa, .75 ); 378 &:hover{ 379 background-color: #0085ba; 380 } 381 } 382 383 &.kopa-size--lg{ 384 width: 90px; 385 height: 90px; 386 line-height: 90px; 387 i{ 388 width: 88px; 389 height: 88px; 390 line-height: 88px; 391 font-size: 48px; 392 } 393 .kopa-ui-icon-picker-action{ 394 bottom: -24px; 395 height: 24px; 396 line-height: 24px; 397 font-size: 10px; 398 } 399 } 400 401 &.kopa-size--xs{ 402 width: 35px; 403 height: 35px; 404 line-height: 35px; 405 i{ 406 width: 33px; 407 height: 33px; 408 line-height: 33px; 409 font-size: 24px; 410 } 411 .kopa-ui-icon-picker-action{ 412 bottom: -33px; 413 height: 31px; 414 line-height: 31px; 415 font-size: 10px; 416 } 417 } 418 } 419 420 #tmpl-kopa-icon-picker{ 421 .kopa-ui__header{ 422 margin-bottom: 16px; 423 } 424 425 .kopa-ui__search{ 426 width: 100%; 427 } 428 429 .kopa-ui__body{ 430 &:after{ 431 clear: both; 432 } 433 434 &:before, 435 &:after { 436 display: table; 437 content: " "; 438 } 439 } 440 441 .kopa-ui__body{ 442 margin-left: -3px; 443 margin-right: -3px; 444 445 span{ 446 display: block; 447 float: left; 448 width: 53px; 449 height: 53px; 450 padding-left: 3px; 451 padding-right: 3px; 452 margin-bottom: 6px; 453 } 454 455 i{ 456 display: block; 457 width: 100%; 458 height: 53px; 459 line-height: 53px; 460 text-align: center; 461 border: 1px solid #dddddd; 462 background-color: #fafafa; 463 color: #333; 464 font-size: 14px; 465 cursor: pointer; 466 467 &.kopa-ui__active, 468 &:hover{ 469 @include transition_m( background-color, .5s ); 470 background-color: #0073aa; 471 color: #fff; 472 } 473 } 474 475 } 476 } 477 478 .kopa-ui-dialog{ 479 480 .ui-dialog-buttonset{ 481 float: none; 482 width: 100%; 483 484 .kopa-ui-button-use{ 485 float: right; 486 } 487 488 .kopa-ui-button-cancel{ 489 float: right; 490 } 491 492 .kopa-ui-button-remove{ 493 float: left; 494 margin-right: 0 !important; 495 color: #ff0000; 496 } 497 } 498 499 } -
kopatheme/trunk/assets/js/admin-fields.js
r1486248 r1490791 1 var Kopa_Icon_Picker, Kopa_Datetime_Js, Kopa_UI_Gallery, kopa_gallery_iframe, kopa_gallery_button; 2 3 var kopa_gallery_sortable_uploader; 4 var kopa_gallery_iframe; 5 var kopa_gallery_button; 6 var kopa_lighbox_icons_id = '#kopa_advanced_field_lighbox_icons'; 7 8 jQuery(document).ready(function ($) { 9 Kopa_UI.init(); 10 Kopa_Field_Image.init($); 1 var Kopa_UI, Kopa_UI_DateTime, Kopa_UI_Gallery, Kopa_UI_Icon, Kopa_UI_Gallery_Sortable, Kopa_UI_Image, Kopa_UI_Repeater, Kopa_UI_Repeater_Link, Kopa_UI_Chosen, Kopa_UI_Icon_Picker; 2 var $kopa_icon_picker_activated; 3 var $kopa_gallery_sortable_uploader; 4 var $kopa_gallery_iframe; 5 var $kopa_gallery_button; 6 7 jQuery(document).ready(function () { 8 Kopa_UI.init(); 11 9 }); 12 10 13 jQuery( document ).ajaxSuccess( function($) { 14 Kopa_UI.init($); 15 Kopa_Field_Image.init($); 11 jQuery(document).ajaxSuccess(function () { 12 Kopa_UI.init(); 16 13 }); 17 14 18 15 var Kopa_UI = { 19 16 init: function () { 20 Kopa_Datetime_Js.init_field_datetime(); 17 Kopa_UI_DateTime.init(); 18 Kopa_UI_Image.init(); 21 19 Kopa_UI_Gallery.init(); 22 20 Kopa_UI_Gallery_Sortable.init(); 23 Kopa_Icon_Picker.init(); 21 Kopa_UI_Icon.init(); 22 Kopa_UI_Icon_Picker.init(); 23 Kopa_UI_Repeater.init(); 24 Kopa_UI_Repeater_Link.init(); 25 Kopa_UI_Chosen.init(); 24 26 } 25 27 } 26 28 27 var Kopa_Datetime_Js = { 28 init_field_datetime: function() { 29 if (jQuery('.kopa-framework-datetime').length > 0) { 30 jQuery('.kopa-framework-datetime').each(function(index, element) { 31 var kopa_timepicker = jQuery(element).attr('data-timepicker'); 32 var kopa_datepicker = jQuery(element).attr('data-datepicker'); 33 if ( 1 == kopa_timepicker ) { 34 kopa_timepicker = true; 35 } else { 36 kopa_timepicker = false; 37 } 38 if ( 1 == kopa_datepicker ) { 39 kopa_datepicker = true; 40 } else { 41 kopa_datepicker = false; 42 } 43 jQuery(element).datetimepicker({ 44 lang: 'en', 45 timepicker: kopa_timepicker, 46 datepicker: kopa_datepicker, 47 format: jQuery(element).attr('data-format'), 48 i18n: { 49 en: { 50 months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 51 dayOfWeek: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] 52 } 53 } 54 }); 29 var Kopa_UI_DateTime = { 30 init: function () { 31 if (jQuery('.kopa-framework-datetime').length > 0) { 32 jQuery('.kopa-framework-datetime').each(function (index, element) { 33 34 if( !jQuery(element).hasClass( 'kopa-framework-datetime--activated' ) ) { 35 36 var kopa_timepicker = parseInt( jQuery(element).attr('data-timepicker'), 10 ); 37 var kopa_datepicker = parseInt( jQuery(element).attr('data-datepicker'), 10 ); 38 if (1 == kopa_timepicker) { 39 kopa_timepicker = true; 40 } else { 41 kopa_timepicker = false; 42 } 43 if (1 == kopa_datepicker) { 44 kopa_datepicker = true; 45 } else { 46 kopa_datepicker = false; 47 } 48 49 jQuery(element).datetimepicker({ 50 lang: 'en', 51 timepicker: kopa_timepicker, 52 datepicker: kopa_datepicker, 53 format: jQuery(element).attr('data-format'), 54 i18n: { 55 en: { 56 months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 57 dayOfWeek: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] 58 } 59 } 60 }); 61 62 63 jQuery(element).addClass( 'kopa-framework-datetime--activated' ); 64 65 } 66 67 }); 68 } 69 } 70 }; 71 72 var Kopa_UI_Gallery = { 73 init: function () { 74 jQuery('.kopa-framework-gallery-box').on('click', '.kopa-framework-gallery-config', function (event) { 75 event.preventDefault(); 76 $kopa_gallery_button = jQuery(this); 77 if ($kopa_gallery_iframe) { 78 $kopa_gallery_iframe.open(); 79 return; 80 } 81 $kopa_gallery_iframe = wp.media.frames.$kopa_gallery_iframe = wp.media({ 82 title: 'Gallery config', 83 button: { 84 text: 'Use' 85 }, 86 library: { 87 type: 'image' 88 }, 89 multiple: true 90 }); 91 $kopa_gallery_iframe.on('open', function () { 92 var ids, selection; 93 ids = $kopa_gallery_button.parents('.kopa-framework-gallery-box').find('input.kopa-framework-gallery').val(); 94 if ('' !== ids) { 95 selection = $kopa_gallery_iframe.state().get('selection'); 96 ids = ids.split(','); 97 jQuery(ids).each(function (index, element) { 98 var attachment; 99 attachment = wp.media.attachment(element); 100 attachment.fetch(); 101 selection.add(attachment ? [attachment] : []); 102 }); 103 } 104 }); 105 $kopa_gallery_iframe.on('select', function () { 106 var result, selection; 107 result = []; 108 selection = $kopa_gallery_iframe.state().get('selection'); 109 selection.map(function (attachment) { 110 attachment = attachment.toJSON(); 111 result.push(attachment.id); 112 }); 113 if (result.length > 0) { 114 result = result.join(','); 115 $kopa_gallery_button.parents('.kopa-framework-gallery-box').find('input.kopa-framework-gallery').val(result); 116 } 117 }); 118 $kopa_gallery_iframe.open(); 119 }); 120 } 121 }; 122 123 var Kopa_UI_Icon = { 124 init: function () { 125 if (jQuery('.kopa-icon-picker').length > 0) { 126 jQuery('.kopa-icon-picker').click(function (event) { 127 128 var btn; 129 event.preventDefault(); 130 btn = jQuery(this); 131 if (jQuery( Kopa_UI_Icon.get_id( '#' ) ).length !== 1) { 132 jQuery('body').append('<div id="' + Kopa_UI_Icon.get_id( '' ) + '" class="upside-hide"></div>'); 133 jQuery.ajax({ 134 beforeSend: function (jqXHR) {}, 135 success: function (data, textStatus, jqXHR) { 136 jQuery(Kopa_UI_Icon.get_id( '#' )).html(data); 137 }, 138 complete: function () { 139 Kopa_UI_Icon.open_lighbox(btn); 140 }, 141 url: kopa_advanced_field.ajax_url, 142 dataType: "html", 143 type: 'GET', 144 async: false, 145 data: { 146 action: 'get_lighbox_icons' 147 } 55 148 }); 56 } 57 } 58 }; 59 60 var Kopa_UI_Gallery = { 61 init: function() { 62 jQuery('.kopa-framework-gallery-box').on('click', '.kopa-framework-gallery-config', function(event) { 63 event.preventDefault(); 64 kopa_gallery_button = jQuery(this); 65 if (kopa_gallery_iframe) { 66 kopa_gallery_iframe.open(); 67 return; 149 } else { 150 Kopa_UI_Icon.open_lighbox(btn); 151 } 152 }); 153 } 154 }, 155 open_lighbox: function (btn) { 156 jQuery(Kopa_UI_Icon.get_id( '#' )).dialog({ 157 width: 360, 158 height: 480, 159 modal: true, 160 closeText: '<i class="dashicons dashicons-dismiss"></i>', 161 title: kopa_advanced_field.translate.icon_picker, 162 buttons: [ 163 { 164 'text': 'Select', 165 'class': 'kopa-ui-button-use button button-primary', 166 'click': function () { 167 var icon; 168 icon = Kopa_UI_Icon.click_ok(); 169 btn.parent().find('.kopa-icon-picker-value').val(icon); 170 btn.parent().find('.kopa-icon-picker-preview i').attr('class', icon); 68 171 } 69 kopa_gallery_iframe = wp.media.frames.kopa_gallery_iframe = wp.media({ 70 title: 'Gallery config', 71 button: { 72 text: 'Use' 73 }, 74 library: { 75 type: 'image' 76 }, 77 multiple: true 78 }); 79 kopa_gallery_iframe.on('open', function() { 80 var ids, selection; 81 ids = kopa_gallery_button.parents('.kopa-framework-gallery-box').find('input.kopa-framework-gallery').val(); 82 if ('' !== ids) { 83 selection = kopa_gallery_iframe.state().get('selection'); 84 ids = ids.split(','); 85 jQuery(ids).each(function(index, element) { 86 var attachment; 87 attachment = wp.media.attachment(element); 88 attachment.fetch(); 89 selection.add(attachment ? [attachment] : []); 90 }); 91 } 92 }); 93 kopa_gallery_iframe.on('select', function() { 94 var result, selection; 95 result = []; 96 selection = kopa_gallery_iframe.state().get('selection'); 97 selection.map(function(attachment) { 98 attachment = attachment.toJSON(); 99 return result.push(attachment.id); 100 }); 101 if (result.length > 0) { 102 result = result.join(','); 103 kopa_gallery_button.parents('.kopa-framework-gallery-box').find('input.kopa-framework-gallery').val(result); 104 } 105 }); 106 kopa_gallery_iframe.open(); 107 }); 108 } 109 }; 110 111 var Kopa_Icon_Picker = { 112 init: function() { 113 if (jQuery('.kopa-icon-picker').length > 0) { 114 jQuery('.kopa-icon-picker').click(function(event) { 115 116 var btn; 117 event.preventDefault(); 118 btn = jQuery(this); 119 if (jQuery(kopa_lighbox_icons_id).length !== 1) { 120 jQuery('body').append('<div id="kopa_advanced_field_lighbox_icons" class="upside-hide"></div>'); 121 jQuery.ajax({ 122 beforeSend: function(jqXHR) {}, 123 success: function(data, textStatus, jqXHR) { 124 jQuery(kopa_lighbox_icons_id).html(data); 125 }, 126 complete: function() { 127 Kopa_Icon_Picker.open_lighbox(btn); 128 }, 129 url: kopa_advanced_field.ajax_url, 130 dataType: "html", 131 type: 'GET', 132 async: false, 133 data: { 134 action: 'get_lighbox_icons' 135 } 136 }); 137 } else { 138 Kopa_Icon_Picker.open_lighbox(btn); 139 } 140 }); 141 } 142 }, 143 open_lighbox: function(btn) { 144 jQuery(kopa_lighbox_icons_id).dialog({ 145 width: 360, 146 height: 480, 147 modal: true, 148 closeText: '<i class="dashicons dashicons-dismiss"></i>', 149 title: kopa_advanced_field.i18n.icon_picker, 150 buttons: [ 151 { 152 'text': 'Select', 153 'class': 'kopa-ui-button-use button button-primary', 154 'click': function() { 155 var icon; 156 icon = Kopa_Icon_Picker.click_ok(); 157 btn.parent().find('.kopa-icon-picker-value').val(icon); 158 btn.parent().find('.kopa-icon-picker-preview i').attr('class', icon); 159 } 160 } 161 ] 162 }); 163 }, 164 click_ok: function() { 172 } 173 ] 174 }); 175 }, 176 click_ok: function () { 165 177 var icon; 166 icon = jQuery( kopa_lighbox_icons_id).find('.kopa-icon-item.upside-active i').attr('class');167 jQuery( kopa_lighbox_icons_id).dialog('close');178 icon = jQuery(Kopa_UI_Icon.get_id( '#' )).find('.kopa-icon-item.upside-active i').attr('class'); 179 jQuery(Kopa_UI_Icon.get_id( '#' )).dialog('close'); 168 180 return icon; 169 181 }, 170 select_a_icon: function (event, obj) {182 select_a_icon: function (event, obj) { 171 183 event.preventDefault(); 172 184 obj.parents('.kopa-wrap').find('.kopa-icon-item').removeClass('upside-active'); 173 185 obj.addClass('upside-active'); 174 186 }, 175 filter_icons: function (event, obj) {187 filter_icons: function (event, obj) { 176 188 var filter, regex, wrap; 177 189 event.preventDefault(); … … 183 195 } 184 196 regex = new RegExp(filter, "i"); 185 wrap.find('.kopa-icon-item i').each(function (index, element) {197 wrap.find('.kopa-icon-item i').each(function (index, element) { 186 198 if (jQuery(this).data('title').search(regex) < 0) { 187 199 jQuery(this).parent().hide(); … … 190 202 } 191 203 }); 204 }, 205 get_id: function( $prefix ){ 206 return $prefix + 'kopa_advanced_field_lighbox_icons'; 192 207 } 193 208 }; 194 209 195 210 var Kopa_UI_Gallery_Sortable = { 196 init: function() { 197 $galleries = jQuery( 'div.kopa-ui-gallery' ); 198 if( $galleries.length ) { 211 init: function () { 212 $galleries = jQuery('div.kopa-ui-gallery'); 213 if ($galleries.length) { 214 215 $galleries.map(function ($gallery) { 216 217 var $_gallery = jQuery(this); 218 219 if( !$_gallery.hasClass( 'kopa-ui-gallery--activated' ) ) { 220 221 Kopa_UI_Gallery_Sortable._init_sortable( $_gallery.find('ul').first() ); 222 223 $_gallery.on('click', '.kopa-ui-gallery__upload', function (event) { 224 Kopa_UI_Gallery_Sortable._edit( event, jQuery(this) ); 225 }); 226 227 $_gallery.on('click', '.kopa-ui-gallery__remove', function (event) { 228 Kopa_UI_Gallery_Sortable._remove( event, jQuery(this) ); 229 }); 230 231 $_gallery.addClass( 'kopa-ui-gallery--activated' ); 232 233 } 234 235 }); 236 237 } 238 }, 239 _edit: function (event, $button) { 240 event.preventDefault(); 241 242 $wrap = $button.parents('.kopa-ui-gallery'); 243 $sortable = $wrap.find('ul').first(); 244 $inputs = $wrap.find('input[type="hidden"]'); 245 $previews = $wrap.find('img'); 246 $gallery_name = $wrap.attr('data-name'); 247 248 if ($kopa_gallery_sortable_uploader) { 249 $kopa_gallery_sortable_uploader.open(); 250 return; 251 } 252 253 $kopa_gallery_sortable_uploader = wp.media.frames.$kopa_gallery_sortable_uploader = wp.media({ 254 title: 'Uploader', 255 $button: { 256 text: 'Select' 257 }, 258 library: {type: 'image'}, 259 multiple: true 260 }); 261 262 $kopa_gallery_sortable_uploader.on('open', function () { 263 264 if ($inputs.length) { 265 266 selection = $kopa_gallery_sortable_uploader.state().get('selection'); 267 jQuery.each($inputs, function () { 268 var attachment = wp.media.attachment(parseInt(jQuery(this).val())); 269 attachment.fetch(); 270 selection.add(attachment); 271 }); 272 273 } 274 }); 275 276 $kopa_gallery_sortable_uploader.on('select', function () { 277 278 var $results = []; 279 var selection = $kopa_gallery_sortable_uploader.state().get('selection'); 280 281 selection.map(function ($attachment) { 282 $attachment = $attachment.toJSON(); 283 $results.push([$attachment.id, $attachment.sizes.thumbnail.url]); 284 }); 285 console.log($results); 286 if ($results.length) { 287 $sortable.html(''); 288 289 $results.map(function ($image) { 290 $html = Kopa_UI_Gallery_Sortable._build_single($gallery_name, $image[0], $image[1]); 291 $sortable.append(jQuery($html)); 292 }); 293 } 294 295 }); 296 297 $kopa_gallery_sortable_uploader.open(); 298 }, 299 _remove: function (event, $button) { 300 event.preventDefault(); 301 $button.parents('.kopa-ui-gallery__image').remove(); 302 }, 303 _build_single: function ($gallery_name, $image_id, $image_src) { 304 305 $html = '<li class="kopa-ui-gallery__image">'; 306 $html += '<input type="hidden" value="' + $image_id + '" name="' + $gallery_name + '[]">'; 307 $html += '<img alt="" src="' + $image_src + '">'; 308 $html += '<span class="kopa-ui-gallery__remove dashicons dashicons-trash">'; 309 $html += '</span>'; 310 $html += '</li>'; 311 312 return $html; 313 }, 314 _init_sortable: function ($sortable) { 315 $sortable.sortable({ 316 containment: 'parent' 317 }); 318 $sortable.disableSelection(); 319 } 320 } 321 322 var Kopa_UI_Image = { 323 init: function () { 324 jQuery( '.kopa-field-image' ).on( 'click', '.item-add', function (e) { 325 e.preventDefault(); 199 326 200 $galleries.map( function( $gallery ) { 201 Kopa_UI_Gallery_Sortable._init_sortable( jQuery(this).find('ul').first() ); 202 } ); 203 204 $galleries.on( 'click', '.kopa-ui-gallery__upload', function( $event ) { 205 Kopa_UI_Gallery_Sortable._edit( $event, jQuery(this) ); 206 } ); 207 208 $galleries.on( 'click', '.kopa-ui-gallery__remove', function( $event ) { 209 Kopa_UI_Gallery_Sortable._remove( $event, jQuery(this) ); 210 } ); 211 } 212 }, 213 _edit: function( $event, $button ) { 214 $event.preventDefault(); 215 216 $wrap = $button.parents('.kopa-ui-gallery'); 217 $sortable = $wrap.find( 'ul' ).first(); 218 $inputs = $wrap.find( 'input[type="hidden"]' ); 219 $previews = $wrap.find( 'img' ); 220 $gallery_name = $wrap.attr( 'data-name' ); 221 222 if (kopa_gallery_sortable_uploader) { 223 kopa_gallery_sortable_uploader.open(); 224 return; 225 } 226 227 kopa_gallery_sortable_uploader = wp.media.frames.kopa_gallery_sortable_uploader = wp.media({ 228 title: 'Uploader', 229 $button: { 230 text: 'Select' 231 }, 232 library: { type: 'image' }, 233 multiple: true 234 }); 235 236 kopa_gallery_sortable_uploader.on( 'open', function() { 237 238 if( $inputs.length ) { 239 240 selection = kopa_gallery_sortable_uploader.state().get('selection'); 241 jQuery.each( $inputs, function(){ 242 var attachment = wp.media.attachment( parseInt( jQuery(this).val() ) ); 243 attachment.fetch(); 244 selection.add( attachment ); 245 } ); 246 247 } 248 }); 249 250 kopa_gallery_sortable_uploader.on( 'select', function() { 327 var $this = jQuery(this); 251 328 252 var $results = [];253 var selection = kopa_gallery_sortable_uploader.state().get('selection');254 255 selection.map( function( $attachment ) {256 $attachment = $attachment.toJSON();257 $results.push( [ $attachment.id, $attachment.sizes.thumbnail.url] );258 });259 console.log($results);260 if ( $results.length ) {261 $sortable.html( '' );262 263 $results.map( function( $image ) {264 $html = Kopa_UI_Gallery_Sortable._build_single( $gallery_name, $image[0], $image[1] );265 $sortable.append( jQuery( $html ) );266 } );267 }268 269 });270 271 kopa_gallery_sortable_uploader.open();272 },273 _remove: function( $event, $button ) {274 $event.preventDefault();275 $button.closest('.kopa-ui-gallery__image').remove();276 },277 _build_single: function( $gallery_name, $image_id, $image_src ){278 279 $html = '<li class="kopa-ui-gallery__image">';280 $html += '<input type="hidden" value="' + $image_id + '" name="' + $gallery_name + '[]">';281 $html += '<img alt="" src="' + $image_src + '">';282 $html += '<span class="kopa-ui-gallery__remove dashicons dashicons-trash">';283 $html += '</span>';284 $html += '</li>';285 286 return $html;287 },288 _init_sortable: function( $sortable ) {289 $sortable.sortable({290 containment: 'parent'291 });292 $sortable.disableSelection();293 }294 }295 296 297 /**298 * Image Select299 * @since 1.1.9300 */301 var Kopa_Field_Image = {302 init: function ($) {303 /**304 * Image Select305 */306 307 $('.kopa-field-image .item-add').click(function (e) {308 e.preventDefault();309 var $this = $(this);310 329 var file_frame; 311 // Create the media frame.330 312 331 file_frame = wp.media.frames.downloadable_file = wp.media({ 313 332 title: 'Select an image', … … 318 337 }); 319 338 320 321 // When an image is selected, run a callback.322 339 file_frame.on('select', function () { 323 340 var attachment = file_frame.state().get('selection').first().toJSON(); … … 331 348 }); 332 349 333 // Finally, open the modal.334 350 file_frame.open(); 335 351 }); 336 337 $(document).on("click", ".kopa-field-image .item-remove", function (e) {338 $(this).parent().find('.item-add').empty();339 $(this).prev("input").val("");340 $(this).parent().removeClass('hasimage');352 353 jQuery(document).on("click", ".kopa-field-image .item-remove", function (e) { 354 jQuery(this).parent().find('.item-add').empty(); 355 jQuery(this).prev("input").val(""); 356 jQuery(this).parent().removeClass('hasimage'); 341 357 e.preventDefault(); 342 358 }); 343 } 344 }; 359 } 360 }; 361 362 var Kopa_UI_Repeater = { 363 init: function() { 364 var $repeaters; 365 $repeaters = jQuery( '.kopa-ui-repeater' ); 366 367 if ($repeaters.length) { 368 369 jQuery.each($repeaters, function() { 370 var $_repeater; 371 $_repeater = jQuery(this); 372 373 if( !$_repeater.hasClass( 'kopa-ui-repeater--activated' ) ) { 374 375 $_repeater.on( 'click', '.kopa-repeater-edit', function() { 376 377 var $wrap; 378 $wrap = jQuery( this ).parents( '.kopa-repeater-group' ); 379 380 if( $wrap.find( '.kopa-repeater-item-content' ).is(":hidden") ) { 381 $wrap.addClass( 'kopa-repeater-group--open' ); 382 }else{ 383 $wrap.removeClass( 'kopa-repeater-group--open' ); 384 } 385 386 }); 387 388 $_repeater.on('keyup', '.kopa-repeater-input-key', function() { 389 var $label, $new_key, $wrap; 390 $new_key = jQuery(this).val(); 391 if ('' === jQuery.trim($new_key)) { 392 $new_key = kopa_advanced_field.translate.untitle; 393 } else { 394 $new_key = jQuery('<div>' + $new_key + '</div>').text(); 395 } 396 $wrap = jQuery(this).parents('.kopa-repeater-group'); 397 $label = $wrap.find('> label > span'); 398 $label.text($new_key); 399 }); 400 401 $_repeater.find('.kopa-ui-repeater-container').sortable(); 402 403 $_repeater.find('.kopa-ui-repeater-container').repeatable({ 404 addTrigger: $_repeater.find('.kopa-repeater-add'), 405 deleteTrigger: '.kopa-repeater-delete', 406 template: $_repeater.attr('data-id'), 407 itemContainer: '.kopa-repeater-group' 408 }); 409 410 $_repeater.addClass( 'kopa-ui-repeater--activated' ); 411 } 412 413 }); 414 } 415 } 416 }; 417 418 var Kopa_UI_Repeater_Link = { 419 init: function() { 420 var $repeater_links; 421 $repeater_links = jQuery('.kopa-ui-repeater-links'); 422 if ($repeater_links.length) { 423 424 jQuery.each($repeater_links, function() { 425 var $_repeater; 426 $_repeater = jQuery(this); 427 428 if( !$_repeater.hasClass( 'kopa-ui-repeater-links--activated' ) ) { 429 430 431 $_repeater.on( 'click', '.kopa-repeater-edit', function() { 432 433 var $wrap; 434 $wrap = jQuery( this ).parents( '.kopa-repeater-group' ); 435 436 if( $wrap.find( '.kopa-repeater-item-content' ).is(":hidden") ) { 437 $wrap.addClass( 'kopa-repeater-group--open' ); 438 }else{ 439 $wrap.removeClass( 'kopa-repeater-group--open' ); 440 } 441 442 }); 443 444 $_repeater.on('keyup', '.kopa-repeater-input-title', function() { 445 var $label, $new_key, $wrap; 446 $new_key = jQuery(this).val(); 447 if ('' === jQuery.trim($new_key)) { 448 $new_key = kopa_advanced_field.translate.untitle; 449 } else { 450 $new_key = jQuery('<div>' + $new_key + '</div>').text(); 451 } 452 $wrap = jQuery(this).parents('.kopa-repeater-group'); 453 $label = $wrap.find('> label > span'); 454 $label.text($new_key); 455 }); 456 457 $_repeater.find('.kopa-ui-repeater-container').sortable(); 458 $_repeater.find('.kopa-ui-repeater-container').repeatable({ 459 addTrigger: $_repeater.find('.kopa-repeater-add'), 460 deleteTrigger: '.kopa-repeater-delete', 461 template: $_repeater.attr('data-id'), 462 itemContainer: '.kopa-repeater-group', 463 afterAdd: function() { 464 Kopa_UI_Icon_Picker.init(); 465 } 466 }); 467 468 $_repeater.addClass( 'kopa-ui-repeater-links--activated' ); 469 } 470 471 }); 472 } 473 } 474 }; 475 476 var Kopa_UI_Chosen = { 477 init: function() { 478 var $et_selects; 479 $et_selects = jQuery('.kopa-ui-chosen select'); 480 if ($et_selects.length) { 481 jQuery.each($et_selects, function() { 482 483 $cbo = jQuery(this); 484 if( !$cbo.hasClass( 'kopa-ui-chosen--activated' ) ) { 485 486 $cbo.chosen({ 487 allow_single_deselect: true, 488 width: $cbo.attr('data-width') 489 }); 490 491 $cbo.addClass( 'kopa-ui-chosen--activated' ); 492 493 } 494 495 }); 496 } 497 } 498 }; 499 500 var Kopa_UI_Icon_Picker = { 501 init: function() { 502 var $icon_pickers; 503 $icon_pickers = jQuery( '.kopa-ui-icon-picker' ); 504 505 if ( $icon_pickers.length ) { 506 507 jQuery.each( $icon_pickers, function(index, el) { 508 509 $_icon_pickers = jQuery( this ); 510 511 if( !$_icon_pickers.hasClass( 'kopa-ui-icon-picker--activated' ) ) { 512 513 $_icon_pickers.on( 'click', '.kopa-ui-icon-picker-add', function() { 514 var $obj; 515 $obj = jQuery(this); 516 $kopa_icon_picker_activated = $obj.parents('.kopa-ui-icon-picker'); 517 if (!Kopa_UI_Icon_Picker._getBoxObject().length) { 518 Kopa_UI_Icon_Picker._build_picker(); 519 Kopa_UI_Icon_Picker._init_dialog(); 520 } 521 522 Kopa_UI_Icon_Picker._add($obj); 523 524 }); 525 526 $_icon_pickers.addClass( 'kopa-ui-icon-picker--activated' ); 527 528 } 529 530 }); 531 532 } 533 534 }, 535 _getBoxObject: function() { 536 return jQuery('#' + Kopa_UI_Icon_Picker._getBoxId()); 537 }, 538 _getBoxId: function() { 539 return 'tmpl-kopa-icon-picker'; 540 }, 541 _add: function($obj) { 542 var $tmp_picker; 543 $tmp_picker = Kopa_UI_Icon_Picker._getBoxObject(); 544 if ($tmp_picker.hasClass('ui-dialog-content')) { 545 $tmp_picker.dialog('open'); 546 } 547 }, 548 _build_picker: function() { 549 var $selected, $tmp_html, $tmp_id, $tmp_picker, $tmp_picker_body; 550 $tmp_id = Kopa_UI_Icon_Picker._getBoxId(); 551 if ($kopa_icon_picker_activated.length && $kopa_icon_picker_activated !== void 0) { 552 $selected = $kopa_icon_picker_activated.find('input').val(); 553 } else { 554 $selected = false; 555 } 556 $tmp_html = '<div id="' + $tmp_id + '">' + '<div class="kopa-ui__header">' + '<input type="text" class="kopa-ui__search" onkeyup="Kopa_UI_Icon_Picker._search( jQuery(this) );">' + '</div>' + '<div class="kopa-ui__body">' + '</div>' + '</div>'; 557 jQuery('body').append($tmp_html); 558 $tmp_picker = Kopa_UI_Icon_Picker._getBoxObject(); 559 $tmp_picker_body = $tmp_picker.find('.kopa-ui__body'); 560 _.each(kopa_advanced_field.icon_picker.fonts, function($font) { 561 jQuery.getJSON($font.file, null, function($json, $textStatus) { 562 if ('success' === $textStatus) { 563 _.each($json, function($item) { 564 var $names, $selector; 565 $selector = $item.selector; 566 $names = $selector.split(','); 567 _.each($names, function($name) { 568 $name = _.unescape(jQuery.trim($name.replace(':before', '')).substring(1)); 569 if ($font.prefix) { 570 $name = $font.prefix + ' ' + $name; 571 } 572 if ($selected && $name === $selected) { 573 $name += ' kopa-ui__active'; 574 } 575 $tmp_picker_body.append('<span><i class="' + $name + '"></i></span>'); 576 }); 577 }); 578 } 579 }); 580 }); 581 $tmp_picker_body.on('click', 'i', function(event) { 582 var $wrap; 583 event.preventDefault(); 584 if (!jQuery(this).hasClass('kopa-ui__active')) { 585 $wrap = jQuery(this).parents('.kopa-ui__body'); 586 $wrap.find('i').removeClass('kopa-ui__active'); 587 } 588 jQuery(this).toggleClass('kopa-ui__active'); 589 }); 590 }, 591 _init_dialog: function() { 592 var $et_dialog; 593 $et_dialog = Kopa_UI_Icon_Picker._getBoxObject(); 594 $et_dialog.dialog({ 595 title: kopa_advanced_field.icon_picker.label.icon_picker, 596 dialogClass: 'kopa-ui-dialog kopa-ui-hide-title', 597 closeText: '<i class="dashicons dashicons-dismiss"></i>', 598 width: 400, 599 height: 400, 600 modal: true, 601 closeOnEscape: false, 602 resizable: false, 603 autoOpen: false, 604 buttons: [ 605 { 606 text: kopa_advanced_field.icon_picker.label.remove, 607 "class": 'kopa-ui-button-remove button button-link button-remove', 608 click: function() { 609 $et_dialog.dialog('close'); 610 $kopa_icon_picker_activated.find('input').val(''); 611 $kopa_icon_picker_activated.find('i').attr('class', ''); 612 $kopa_icon_picker_activated.find('.kopa-ui-icon-picker-add').text(kopa_advanced_field.icon_picker.label.add); 613 Kopa_UI_Icon_Picker._clear(); 614 } 615 }, { 616 text: kopa_advanced_field.icon_picker.label.cancel, 617 "class": 'kopa-ui-button-cancel button button-secondary', 618 click: function() { 619 $et_dialog.dialog('close'); 620 Kopa_UI_Icon_Picker._clear(); 621 } 622 }, { 623 text: kopa_advanced_field.icon_picker.label.use, 624 "class": 'kopa-ui-button-use button button-primary', 625 click: function() { 626 var $selected, $val; 627 if ($kopa_icon_picker_activated.length && $kopa_icon_picker_activated !== void 0) { 628 $selected = $et_dialog.find('.kopa-ui__active'); 629 if ($selected.length) { 630 $val = jQuery.trim($selected.attr('class').replace('kopa-ui__active', '')); 631 } else { 632 $val = ''; 633 } 634 $kopa_icon_picker_activated.toggleClass('kopa-state-added'); 635 $kopa_icon_picker_activated.find('.kopa-ui-icon-picker-add').text(kopa_advanced_field.icon_picker.label.edit); 636 $kopa_icon_picker_activated.find('i').attr('class', $val); 637 $kopa_icon_picker_activated.find('input').val($val); 638 } 639 $et_dialog.dialog('close'); 640 Kopa_UI_Icon_Picker._clear(); 641 } 642 } 643 ] 644 }); 645 }, 646 _search: function($input) { 647 var $regex, $tmp_picker, $tmp_picker_body, $value; 648 $tmp_picker = Kopa_UI_Icon_Picker._getBoxObject(); 649 $tmp_picker_body = $tmp_picker.find('.kopa-ui__body'); 650 $value = $input.val(); 651 if (!$value) { 652 $tmp_picker_body.find('i').parent().show(); 653 } else { 654 $regex = new RegExp($value, 'i'); 655 $tmp_picker_body.find('i').each(function() { 656 if (jQuery(this).attr('class').search($regex) < 0) { 657 jQuery(this).parent().hide(); 658 } else { 659 jQuery(this).parent().show(); 660 } 661 }); 662 } 663 }, 664 _clear: function() { 665 var $tmp_picker; 666 $kopa_icon_picker_activated = void 0; 667 $tmp_picker = Kopa_UI_Icon_Picker._getBoxObject(); 668 $tmp_picker.find('.kopa-ui__search').val(''); 669 $tmp_picker.find('.kopa-ui__body span').show(); 670 $tmp_picker.find('.kopa-ui__body i.kopa-ui__active').removeClass('kopa-ui__active'); 671 } 672 }; -
kopatheme/trunk/assets/js/admin-fields.min.js
r1470471 r1490791 1 var Kopa_ Icon_Picker,Kopa_Datetime_Js,Kopa_UI_Gallery,kopa_gallery_iframe,kopa_gallery_button,kopa_gallery_sortable_uploader,kopa_gallery_iframe,kopa_gallery_button,kopa_lighbox_icons_id="#kopa_advanced_field_lighbox_icons";jQuery(document).ready(function(e){Kopa_UI.init(),Kopa_Field_Image.init(e)}),jQuery(document).ajaxSuccess(function(){Kopa_UI.init()});var Kopa_UI={init:function(){Kopa_Datetime_Js.init_field_datetime(),Kopa_UI_Gallery.init(),Kopa_UI_Gallery_Sortable.init(),Kopa_Icon_Picker.init()}},Kopa_Datetime_Js={init_field_datetime:function(){jQuery(".kopa-framework-datetime").length>0&&jQuery(".kopa-framework-datetime").each(function(e,a){var i=jQuery(a).attr("data-timepicker"),t=jQuery(a).attr("data-datepicker");i=1==i?!0:!1,t=1==t?!0:!1,jQuery(a).datetimepicker({lang:"en",timepicker:i,datepicker:t,format:jQuery(a).attr("data-format"),i18n:{en:{months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Su","Mo","Tu","We","Th","Fr","Sa"]}}})})}},Kopa_UI_Gallery={init:function(){jQuery(".kopa-framework-gallery-box").on("click",".kopa-framework-gallery-config",function(e){return e.preventDefault(),kopa_gallery_button=jQuery(this),kopa_gallery_iframe?(kopa_gallery_iframe.open(),void 0):(kopa_gallery_iframe=wp.media.frames.kopa_gallery_iframe=wp.media({title:"Gallery config",button:{text:"Use"},library:{type:"image"},multiple:!0}),kopa_gallery_iframe.on("open",function(){var e,a;e=kopa_gallery_button.parents(".kopa-framework-gallery-box").find("input.kopa-framework-gallery").val(),""!==e&&(a=kopa_gallery_iframe.state().get("selection"),e=e.split(","),jQuery(e).each(function(e,i){var t;t=wp.media.attachment(i),t.fetch(),a.add(t?[t]:[])}))}),kopa_gallery_iframe.on("select",function(){var e,a;e=[],a=kopa_gallery_iframe.state().get("selection"),a.map(function(a){return a=a.toJSON(),e.push(a.id)}),e.length>0&&(e=e.join(","),kopa_gallery_button.parents(".kopa-framework-gallery-box").find("input.kopa-framework-gallery").val(e))}),kopa_gallery_iframe.open(),void 0)})}},Kopa_Icon_Picker={init:function(){jQuery(".kopa-icon-picker").length>0&&jQuery(".kopa-icon-picker").click(function(e){var a;e.preventDefault(),a=jQuery(this),1!==jQuery(kopa_lighbox_icons_id).length?(jQuery("body").append('<div id="kopa_advanced_field_lighbox_icons" class="upside-hide"></div>'),jQuery.ajax({beforeSend:function(){},success:function(e){jQuery(kopa_lighbox_icons_id).html(e)},complete:function(){Kopa_Icon_Picker.open_lighbox(a)},url:kopa_advanced_field.ajax_url,dataType:"html",type:"GET",async:!1,data:{action:"get_lighbox_icons"}})):Kopa_Icon_Picker.open_lighbox(a)})},open_lighbox:function(e){jQuery(kopa_lighbox_icons_id).dialog({width:360,height:480,modal:!0,closeText:'<i class="dashicons dashicons-dismiss"></i>',title:kopa_advanced_field.i18n.icon_picker,buttons:[{text:"Select","class":"kopa-ui-button-use button button-primary",click:function(){var a;a=Kopa_Icon_Picker.click_ok(),e.parent().find(".kopa-icon-picker-value").val(a),e.parent().find(".kopa-icon-picker-preview i").attr("class",a)}}]})},click_ok:function(){var e;return e=jQuery(kopa_lighbox_icons_id).find(".kopa-icon-item.upside-active i").attr("class"),jQuery(kopa_lighbox_icons_id).dialog("close"),e},select_a_icon:function(e,a){e.preventDefault(),a.parents(".kopa-wrap").find(".kopa-icon-item").removeClass("upside-active"),a.addClass("upside-active")},filter_icons:function(e,a){var i,t,o;return e.preventDefault(),o=a.parents(".kopa-list-of-icon"),(i=a.val())?(t=new RegExp(i,"i"),o.find(".kopa-icon-item i").each(function(){jQuery(this).data("title").search(t)<0?jQuery(this).parent().hide():jQuery(this).parent().show()}),void 0):(o.find(".kopa-icon-item").show(),!1)}},Kopa_UI_Gallery_Sortable={init:function(){$galleries=jQuery("div.kopa-ui-gallery"),$galleries.length&&($galleries.map(function(){Kopa_UI_Gallery_Sortable._init_sortable(jQuery(this).find("ul").first())}),$galleries.on("click",".kopa-ui-gallery__upload",function(e){Kopa_UI_Gallery_Sortable._edit(e,jQuery(this))}),$galleries.on("click",".kopa-ui-gallery__remove",function(e){Kopa_UI_Gallery_Sortable._remove(e,jQuery(this))}))},_edit:function(e,a){return e.preventDefault(),$wrap=a.parents(".kopa-ui-gallery"),$sortable=$wrap.find("ul").first(),$inputs=$wrap.find('input[type="hidden"]'),$previews=$wrap.find("img"),$gallery_name=$wrap.attr("data-name"),kopa_gallery_sortable_uploader?(kopa_gallery_sortable_uploader.open(),void 0):(kopa_gallery_sortable_uploader=wp.media.frames.kopa_gallery_sortable_uploader=wp.media({title:"Uploader",$button:{text:"Select"},library:{type:"image"},multiple:!0}),kopa_gallery_sortable_uploader.on("open",function(){$inputs.length&&(selection=kopa_gallery_sortable_uploader.state().get("selection"),jQuery.each($inputs,function(){var e=wp.media.attachment(parseInt(jQuery(this).val()));e.fetch(),selection.add(e)}))}),kopa_gallery_sortable_uploader.on("select",function(){var e=[],a=kopa_gallery_sortable_uploader.state().get("selection");a.map(function(a){a=a.toJSON(),e.push([a.id,a.sizes.thumbnail.url])}),console.log(e),e.length&&($sortable.html(""),e.map(function(e){$html=Kopa_UI_Gallery_Sortable._build_single($gallery_name,e[0],e[1]),$sortable.append(jQuery($html))}))}),kopa_gallery_sortable_uploader.open(),void 0)},_remove:function(e,a){e.preventDefault(),a.closest(".kopa-ui-gallery__image").remove()},_build_single:function(e,a,i){return $html='<li class="kopa-ui-gallery__image">',$html+='<input type="hidden" value="'+a+'" name="'+e+'[]">',$html+='<img alt="" src="'+i+'">',$html+='<span class="kopa-ui-gallery__remove dashicons dashicons-trash">',$html+="</span>",$html+="</li>"},_init_sortable:function(e){e.sortable({containment:"parent"}),e.disableSelection()}},Kopa_Field_Image={init:function(e){e(".kopa-field-image .item-add").click(function(a){a.preventDefault();var i,t=e(this);i=wp.media.frames.downloadable_file=wp.media({title:"Select an image",button:{text:"Use image"},multiple:!1}),i.on("select",function(){var e=i.state().get("selection").first().toJSON(),a=e.sizes.thumbnail;void 0!=e.sizes.full&&(a=e.sizes.full),t.html('<div class="img" style="background-image:url('+a.url+')"></div>'),t.next("input").val(e.id),t.parent().addClass("hasimage")}),i.open()}),e(document).on("click",".kopa-field-image .item-remove",function(a){e(this).parent().find(".item-add").empty(),e(this).prev("input").val(""),e(this).parent().removeClass("hasimage"),a.preventDefault()})}};1 var Kopa_UI,Kopa_UI_DateTime,Kopa_UI_Gallery,Kopa_UI_Icon,Kopa_UI_Gallery_Sortable,Kopa_UI_Image,Kopa_UI_Repeater,Kopa_UI_Repeater_Link,Kopa_UI_Chosen,Kopa_UI_Icon_Picker,$kopa_icon_picker_activated,$kopa_gallery_sortable_uploader,$kopa_gallery_iframe,$kopa_gallery_button;jQuery(document).ready(function(){Kopa_UI.init()}),jQuery(document).ajaxSuccess(function(){Kopa_UI.init()});var Kopa_UI={init:function(){Kopa_UI_DateTime.init(),Kopa_UI_Image.init(),Kopa_UI_Gallery.init(),Kopa_UI_Gallery_Sortable.init(),Kopa_UI_Icon.init(),Kopa_UI_Icon_Picker.init(),Kopa_UI_Repeater.init(),Kopa_UI_Repeater_Link.init(),Kopa_UI_Chosen.init()}},Kopa_UI_DateTime={init:function(){jQuery(".kopa-framework-datetime").length>0&&jQuery(".kopa-framework-datetime").each(function(e,a){if(!jQuery(a).hasClass("kopa-framework-datetime--activated")){var i=parseInt(jQuery(a).attr("data-timepicker"),10),t=parseInt(jQuery(a).attr("data-datepicker"),10);i=1==i?!0:!1,t=1==t?!0:!1,jQuery(a).datetimepicker({lang:"en",timepicker:i,datepicker:t,format:jQuery(a).attr("data-format"),i18n:{en:{months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Su","Mo","Tu","We","Th","Fr","Sa"]}}}),jQuery(a).addClass("kopa-framework-datetime--activated")}})}},Kopa_UI_Gallery={init:function(){jQuery(".kopa-framework-gallery-box").on("click",".kopa-framework-gallery-config",function(e){return e.preventDefault(),$kopa_gallery_button=jQuery(this),$kopa_gallery_iframe?($kopa_gallery_iframe.open(),void 0):($kopa_gallery_iframe=wp.media.frames.$kopa_gallery_iframe=wp.media({title:"Gallery config",button:{text:"Use"},library:{type:"image"},multiple:!0}),$kopa_gallery_iframe.on("open",function(){var e,a;e=$kopa_gallery_button.parents(".kopa-framework-gallery-box").find("input.kopa-framework-gallery").val(),""!==e&&(a=$kopa_gallery_iframe.state().get("selection"),e=e.split(","),jQuery(e).each(function(e,i){var t;t=wp.media.attachment(i),t.fetch(),a.add(t?[t]:[])}))}),$kopa_gallery_iframe.on("select",function(){var e,a;e=[],a=$kopa_gallery_iframe.state().get("selection"),a.map(function(a){a=a.toJSON(),e.push(a.id)}),e.length>0&&(e=e.join(","),$kopa_gallery_button.parents(".kopa-framework-gallery-box").find("input.kopa-framework-gallery").val(e))}),$kopa_gallery_iframe.open(),void 0)})}},Kopa_UI_Icon={init:function(){jQuery(".kopa-icon-picker").length>0&&jQuery(".kopa-icon-picker").click(function(e){var a;e.preventDefault(),a=jQuery(this),1!==jQuery(Kopa_UI_Icon.get_id("#")).length?(jQuery("body").append('<div id="'+Kopa_UI_Icon.get_id("")+'" class="upside-hide"></div>'),jQuery.ajax({beforeSend:function(){},success:function(e){jQuery(Kopa_UI_Icon.get_id("#")).html(e)},complete:function(){Kopa_UI_Icon.open_lighbox(a)},url:kopa_advanced_field.ajax_url,dataType:"html",type:"GET",async:!1,data:{action:"get_lighbox_icons"}})):Kopa_UI_Icon.open_lighbox(a)})},open_lighbox:function(e){jQuery(Kopa_UI_Icon.get_id("#")).dialog({width:360,height:480,modal:!0,closeText:'<i class="dashicons dashicons-dismiss"></i>',title:kopa_advanced_field.translate.icon_picker,buttons:[{text:"Select","class":"kopa-ui-button-use button button-primary",click:function(){var a;a=Kopa_UI_Icon.click_ok(),e.parent().find(".kopa-icon-picker-value").val(a),e.parent().find(".kopa-icon-picker-preview i").attr("class",a)}}]})},click_ok:function(){var e;return e=jQuery(Kopa_UI_Icon.get_id("#")).find(".kopa-icon-item.upside-active i").attr("class"),jQuery(Kopa_UI_Icon.get_id("#")).dialog("close"),e},select_a_icon:function(e,a){e.preventDefault(),a.parents(".kopa-wrap").find(".kopa-icon-item").removeClass("upside-active"),a.addClass("upside-active")},filter_icons:function(e,a){var i,t,o;return e.preventDefault(),o=a.parents(".kopa-list-of-icon"),(i=a.val())?(t=new RegExp(i,"i"),o.find(".kopa-icon-item i").each(function(){jQuery(this).data("title").search(t)<0?jQuery(this).parent().hide():jQuery(this).parent().show()}),void 0):(o.find(".kopa-icon-item").show(),!1)},get_id:function(e){return e+"kopa_advanced_field_lighbox_icons"}},Kopa_UI_Gallery_Sortable={init:function(){$galleries=jQuery("div.kopa-ui-gallery"),$galleries.length&&$galleries.map(function(){var e=jQuery(this);e.hasClass("kopa-ui-gallery--activated")||(Kopa_UI_Gallery_Sortable._init_sortable(e.find("ul").first()),e.on("click",".kopa-ui-gallery__upload",function(e){Kopa_UI_Gallery_Sortable._edit(e,jQuery(this))}),e.on("click",".kopa-ui-gallery__remove",function(e){Kopa_UI_Gallery_Sortable._remove(e,jQuery(this))}),e.addClass("kopa-ui-gallery--activated"))})},_edit:function(e,a){return e.preventDefault(),$wrap=a.parents(".kopa-ui-gallery"),$sortable=$wrap.find("ul").first(),$inputs=$wrap.find('input[type="hidden"]'),$previews=$wrap.find("img"),$gallery_name=$wrap.attr("data-name"),$kopa_gallery_sortable_uploader?($kopa_gallery_sortable_uploader.open(),void 0):($kopa_gallery_sortable_uploader=wp.media.frames.$kopa_gallery_sortable_uploader=wp.media({title:"Uploader",$button:{text:"Select"},library:{type:"image"},multiple:!0}),$kopa_gallery_sortable_uploader.on("open",function(){$inputs.length&&(selection=$kopa_gallery_sortable_uploader.state().get("selection"),jQuery.each($inputs,function(){var e=wp.media.attachment(parseInt(jQuery(this).val()));e.fetch(),selection.add(e)}))}),$kopa_gallery_sortable_uploader.on("select",function(){var e=[],a=$kopa_gallery_sortable_uploader.state().get("selection");a.map(function(a){a=a.toJSON(),e.push([a.id,a.sizes.thumbnail.url])}),console.log(e),e.length&&($sortable.html(""),e.map(function(e){$html=Kopa_UI_Gallery_Sortable._build_single($gallery_name,e[0],e[1]),$sortable.append(jQuery($html))}))}),$kopa_gallery_sortable_uploader.open(),void 0)},_remove:function(e,a){e.preventDefault(),a.parents(".kopa-ui-gallery__image").remove()},_build_single:function(e,a,i){return $html='<li class="kopa-ui-gallery__image">',$html+='<input type="hidden" value="'+a+'" name="'+e+'[]">',$html+='<img alt="" src="'+i+'">',$html+='<span class="kopa-ui-gallery__remove dashicons dashicons-trash">',$html+="</span>",$html+="</li>"},_init_sortable:function(e){e.sortable({containment:"parent"}),e.disableSelection()}},Kopa_UI_Image={init:function(){jQuery(".kopa-field-image").on("click",".item-add",function(e){e.preventDefault();var a,i=jQuery(this);a=wp.media.frames.downloadable_file=wp.media({title:"Select an image",button:{text:"Use image"},multiple:!1}),a.on("select",function(){var e=a.state().get("selection").first().toJSON(),t=e.sizes.thumbnail;void 0!=e.sizes.full&&(t=e.sizes.full),i.html('<div class="img" style="background-image:url('+t.url+')"></div>'),i.next("input").val(e.id),i.parent().addClass("hasimage")}),a.open()}),jQuery(document).on("click",".kopa-field-image .item-remove",function(e){jQuery(this).parent().find(".item-add").empty(),jQuery(this).prev("input").val(""),jQuery(this).parent().removeClass("hasimage"),e.preventDefault()})}},Kopa_UI_Repeater={init:function(){var e;e=jQuery(".kopa-ui-repeater"),e.length&&jQuery.each(e,function(){var e;e=jQuery(this),e.hasClass("kopa-ui-repeater--activated")||(e.on("click",".kopa-repeater-edit",function(){var e;e=jQuery(this).parents(".kopa-repeater-group"),e.find(".kopa-repeater-item-content").is(":hidden")?e.addClass("kopa-repeater-group--open"):e.removeClass("kopa-repeater-group--open")}),e.on("keyup",".kopa-repeater-input-key",function(){var e,a,i;a=jQuery(this).val(),a=""===jQuery.trim(a)?kopa_advanced_field.translate.untitle:jQuery("<div>"+a+"</div>").text(),i=jQuery(this).parents(".kopa-repeater-group"),e=i.find("> label > span"),e.text(a)}),e.find(".kopa-ui-repeater-container").sortable(),e.find(".kopa-ui-repeater-container").repeatable({addTrigger:e.find(".kopa-repeater-add"),deleteTrigger:".kopa-repeater-delete",template:e.attr("data-id"),itemContainer:".kopa-repeater-group"}),e.addClass("kopa-ui-repeater--activated"))})}},Kopa_UI_Repeater_Link={init:function(){var e;e=jQuery(".kopa-ui-repeater-links"),e.length&&jQuery.each(e,function(){var e;e=jQuery(this),e.hasClass("kopa-ui-repeater-links--activated")||(e.on("click",".kopa-repeater-edit",function(){var e;e=jQuery(this).parents(".kopa-repeater-group"),e.find(".kopa-repeater-item-content").is(":hidden")?e.addClass("kopa-repeater-group--open"):e.removeClass("kopa-repeater-group--open")}),e.on("keyup",".kopa-repeater-input-title",function(){var e,a,i;a=jQuery(this).val(),a=""===jQuery.trim(a)?kopa_advanced_field.translate.untitle:jQuery("<div>"+a+"</div>").text(),i=jQuery(this).parents(".kopa-repeater-group"),e=i.find("> label > span"),e.text(a)}),e.find(".kopa-ui-repeater-container").sortable(),e.find(".kopa-ui-repeater-container").repeatable({addTrigger:e.find(".kopa-repeater-add"),deleteTrigger:".kopa-repeater-delete",template:e.attr("data-id"),itemContainer:".kopa-repeater-group",afterAdd:function(){Kopa_UI_Icon_Picker.init()}}),e.addClass("kopa-ui-repeater-links--activated"))})}},Kopa_UI_Chosen={init:function(){var e;e=jQuery(".kopa-ui-chosen select"),e.length&&jQuery.each(e,function(){$cbo=jQuery(this),$cbo.hasClass("kopa-ui-chosen--activated")||($cbo.chosen({allow_single_deselect:!0,width:$cbo.attr("data-width")}),$cbo.addClass("kopa-ui-chosen--activated"))})}},Kopa_UI_Icon_Picker={init:function(){var e;e=jQuery(".kopa-ui-icon-picker"),e.length&&jQuery.each(e,function(){$_icon_pickers=jQuery(this),$_icon_pickers.hasClass("kopa-ui-icon-picker--activated")||($_icon_pickers.on("click",".kopa-ui-icon-picker-add",function(){var e;e=jQuery(this),$kopa_icon_picker_activated=e.parents(".kopa-ui-icon-picker"),Kopa_UI_Icon_Picker._getBoxObject().length||(Kopa_UI_Icon_Picker._build_picker(),Kopa_UI_Icon_Picker._init_dialog()),Kopa_UI_Icon_Picker._add(e)}),$_icon_pickers.addClass("kopa-ui-icon-picker--activated"))})},_getBoxObject:function(){return jQuery("#"+Kopa_UI_Icon_Picker._getBoxId())},_getBoxId:function(){return"tmpl-kopa-icon-picker"},_add:function(){var e;e=Kopa_UI_Icon_Picker._getBoxObject(),e.hasClass("ui-dialog-content")&&e.dialog("open")},_build_picker:function(){var e,a,i,t,o;i=Kopa_UI_Icon_Picker._getBoxId(),e=$kopa_icon_picker_activated.length&&void 0!==$kopa_icon_picker_activated?$kopa_icon_picker_activated.find("input").val():!1,a='<div id="'+i+'"><div class="kopa-ui__header"><input type="text" class="kopa-ui__search" onkeyup="Kopa_UI_Icon_Picker._search( jQuery(this) );"></div><div class="kopa-ui__body"></div></div>',jQuery("body").append(a),t=Kopa_UI_Icon_Picker._getBoxObject(),o=t.find(".kopa-ui__body"),_.each(kopa_advanced_field.icon_picker.fonts,function(a){jQuery.getJSON(a.file,null,function(i,t){"success"===t&&_.each(i,function(i){var t,n;n=i.selector,t=n.split(","),_.each(t,function(i){i=_.unescape(jQuery.trim(i.replace(":before","")).substring(1)),a.prefix&&(i=a.prefix+" "+i),e&&i===e&&(i+=" kopa-ui__active"),o.append('<span><i class="'+i+'"></i></span>')})})})}),o.on("click","i",function(e){var a;e.preventDefault(),jQuery(this).hasClass("kopa-ui__active")||(a=jQuery(this).parents(".kopa-ui__body"),a.find("i").removeClass("kopa-ui__active")),jQuery(this).toggleClass("kopa-ui__active")})},_init_dialog:function(){var e;e=Kopa_UI_Icon_Picker._getBoxObject(),e.dialog({title:kopa_advanced_field.icon_picker.label.icon_picker,dialogClass:"kopa-ui-dialog kopa-ui-hide-title",closeText:'<i class="dashicons dashicons-dismiss"></i>',width:400,height:400,modal:!0,closeOnEscape:!1,resizable:!1,autoOpen:!1,buttons:[{text:kopa_advanced_field.icon_picker.label.remove,"class":"kopa-ui-button-remove button button-link button-remove",click:function(){e.dialog("close"),$kopa_icon_picker_activated.find("input").val(""),$kopa_icon_picker_activated.find("i").attr("class",""),$kopa_icon_picker_activated.find(".kopa-ui-icon-picker-add").text(kopa_advanced_field.icon_picker.label.add),Kopa_UI_Icon_Picker._clear()}},{text:kopa_advanced_field.icon_picker.label.cancel,"class":"kopa-ui-button-cancel button button-secondary",click:function(){e.dialog("close"),Kopa_UI_Icon_Picker._clear()}},{text:kopa_advanced_field.icon_picker.label.use,"class":"kopa-ui-button-use button button-primary",click:function(){var a,i;$kopa_icon_picker_activated.length&&void 0!==$kopa_icon_picker_activated&&(a=e.find(".kopa-ui__active"),i=a.length?jQuery.trim(a.attr("class").replace("kopa-ui__active","")):"",$kopa_icon_picker_activated.toggleClass("kopa-state-added"),$kopa_icon_picker_activated.find(".kopa-ui-icon-picker-add").text(kopa_advanced_field.icon_picker.label.edit),$kopa_icon_picker_activated.find("i").attr("class",i),$kopa_icon_picker_activated.find("input").val(i)),e.dialog("close"),Kopa_UI_Icon_Picker._clear()}}]})},_search:function(e){var a,i,t,o;i=Kopa_UI_Icon_Picker._getBoxObject(),t=i.find(".kopa-ui__body"),o=e.val(),o?(a=new RegExp(o,"i"),t.find("i").each(function(){jQuery(this).attr("class").search(a)<0?jQuery(this).parent().hide():jQuery(this).parent().show()})):t.find("i").parent().show()},_clear:function(){var e;$kopa_icon_picker_activated=void 0,e=Kopa_UI_Icon_Picker._getBoxObject(),e.find(".kopa-ui__search").val(""),e.find(".kopa-ui__body span").show(),e.find(".kopa-ui__body i.kopa-ui__active").removeClass("kopa-ui__active")}}; -
kopatheme/trunk/assets/js/admin-sidebar.js
r1353276 r1490791 203 203 open_modal( 'confirm', $this, kopa_sidebar_attributes_l10n.warning, messages ); 204 204 205 // if ( confirm( messages ) ) {206 // $this.parents('.kopa_sidebar').slideUp( function () {207 // $(this).remove();208 // } );209 // }210 205 } else { 211 206 messages += errors.join("<br>"); 212 207 open_modal( 'alert', $this, kopa_sidebar_attributes_l10n.error, messages ); 213 // alert( messages );214 208 } // end check allow delete or not 215 209 … … 220 214 221 215 open_modal( 'confirm', $this, kopa_sidebar_attributes_l10n.info, confirmMessage ); 222 223 // if ( confirm( confirmMessage ) ) {224 // // for the new sidebar which has just been added225 // // delete immediately without ajax checking226 // $this.parents('.kopa_sidebar').slideUp( function () {227 // $(this).remove();228 // } );229 // }230 216 231 217 } // end check empty sidebarID … … 306 292 $('.kopa_sidebar_advanced_settings').on('click', folding_advanced_settings); 307 293 308 309 310 294 }); -
kopatheme/trunk/assets/js/admin.js
r1353276 r1490791 190 190 /* ======================================================================== 191 191 * Fonts 192 * Dependencies : google.com, jquery192 * Dependencies : google.com, jquery 193 193 * Feature added by : Smartik - http://smartik.ws/ 194 * Date : 03.17.2013194 * Date : 03.17.2013 195 195 * Modified by : Kopatheme 196 196 * Modified date : 07.26.2014 -
kopatheme/trunk/includes/abstracts/abstract-kopa-widget.php
r1486248 r1490791 115 115 foreach ( $this->settings as $key => $setting ) { 116 116 $output = null; 117 117 118 if ( isset( $new_instance[ $key ] ) ) { 118 if ( is_array( $new_instance[ $key ] ) ) { 119 $output = array_map( 'sanitize_text_field', (array) $new_instance[ $key ] ); 120 } elseif ( 'textarea' === $setting['type'] ) { 121 // $instance[ $key ] = wp_kses_post( trim( $new_instance[ $key ] ) ); 122 123 /** 124 * @see update() of WP_Widget_Text 125 */ 126 if ( current_user_can('unfiltered_html') ) { 127 $output = $new_instance[ $key ]; 128 } else { 129 $output = stripslashes( wp_filter_post_kses( addslashes($new_instance[ $key ]) ) ); // wp_filter_post_kses() expects slashed 130 } 131 } elseif ( 'datetime' === $setting['type'] ) { 132 $output = strtotime( $new_instance[ $key ] ); 133 } 134 else { 135 $output = sanitize_text_field( $new_instance[ $key ] ); 119 120 switch ( $setting[ 'type' ] ) { 121 case 'text': 122 $output = sanitize_text_field( $new_instance[ $key ] ); 123 break; 124 case 'number': 125 $output = sanitize_text_field( $new_instance[ $key ] ); 126 break; 127 case 'select': 128 $output = sanitize_text_field( $new_instance[ $key ] ); 129 break; 130 case 'multiselect': 131 $output = array_map( 'sanitize_text_field', (array) $new_instance[ $key ] ); 132 break; 133 case 'checkbox': 134 if( isset( $new_instance[ $key ] ) ) { 135 $output = $new_instance[ $key ]; 136 }else{ 137 $output = 0; 138 } 139 break; 140 case 'textarea': 141 if ( current_user_can('unfiltered_html') ) { 142 $output = $new_instance[ $key ]; 143 } else { 144 $output = stripslashes( wp_filter_post_kses( addslashes($new_instance[ $key ]) ) ); // wp_filter_post_kses() expects slashed 145 } 146 break; 147 case 'upload': 148 $output = sanitize_text_field( $new_instance[ $key ] ); 149 break; 150 case 'repeater': 151 $output = kopa_form_field_repeater_sanitize( $new_instance[ $key ], $setting ); 152 break; 153 case 'repeater_link': 154 $output = kopa_form_field_repeater_link_sanitize( $new_instance[ $key ], $setting ); 155 break; 156 case 'chosen': 157 $output = kopa_sanitize_option_chosen_sanitize( $new_instance[ $key ], $setting ); 158 break; 159 case 'chosen_singular': 160 $output = kopa_sanitize_option_chosen_sanitize( $new_instance[ $key ], $setting ); 161 break; 162 case 'datetime': 163 $output = strtotime( $new_instance[ $key ] ); 164 break; 165 case 'gallery': 166 $output = sanitize_text_field( $new_instance[ $key ] ); 167 break; 168 case 'icon': 169 $output = sanitize_text_field( $new_instance[ $key ] ); 170 break; 171 case 'taxonomy': 172 $output = sanitize_text_field( $new_instance[ $key ] ); 173 break; 174 case 'caption': 175 $output = sanitize_text_field( $new_instance[ $key ] ); 176 break; 177 case 'singular': 178 $output = sanitize_text_field( $new_instance[ $key ] ); 179 break; 180 default: 181 $output = apply_filters( 'kopa_sanitize_option_' . $setting[ 'type' ], $new_instance[ $key ], $settings ); 182 break; 136 183 } 137 } elseif ( 'checkbox' === $setting['type'] ) { 138 $output = 0; 139 } elseif ( 'multiselect' === $setting['type'] ) { 140 $output = array(); 184 141 185 } 142 186 143 187 $instance[ $key ] = $output; 188 144 189 } 145 146 190 147 191 $this->flush_widget_cache(); … … 161 205 */ 162 206 function form( $instance ) { 163 printf( '<div class="%s">', $this->control_options['id_base'] ); 207 208 printf( '<div class="%s">', $this->control_options['id_base'] ); 164 209 if ( ! $this->settings ) 165 210 return; 166 211 167 212 $wrap_start = apply_filters('kopa_set_widget_form_wrap_start','<div class="kopa-widget-block">'); 168 $wrap_end = apply_filters('kopa_set_widget_form_wrap_end', '</div>');213 $wrap_end = apply_filters('kopa_set_widget_form_wrap_end', '</div>'); 169 214 170 215 foreach ( $this->settings as $key => $setting ) { 171 172 // sanitize setting arguments 216 173 217 $setting = wp_parse_args( $setting, 174 apply_filters('kopa_widget_form_parse_args', array( 175 // common 176 'type' => '', 177 'std' => '', 178 'label' => '', 179 'desc' => '', 180 // number 181 'step' => '', 182 'min' => '', 183 'max' => '', 184 // select 185 'options' => '', 186 'size' => '', 187 // textarea 188 'rows' => '', 189 // upload 190 'mimes' => '', 191 'css' => '', 192 // datetime 193 'format' => 'Y/m/d H:i', 194 'datepicker' => true, 195 'timepicker' => true, 196 // taxonomy 197 'taxonomy' => '', 198 // singular 199 'post_type' => '' 218 apply_filters( 'kopa_widget_form_parse_args', array( 219 'type' => '', 220 'std' => '', 221 'label' => '', 222 'desc' => '', 223 'step' => '', 224 'min' => '', 225 'max' => '', 226 'options' => '', 227 'size' => '', 228 'rows' => '', 229 'mimes' => '', 230 'css' => '', 231 'format' => 'Y/m/d H:i', 232 'datepicker' => true, 233 'timepicker' => true, 234 'taxonomy' => '', 235 'post_type' => '' 200 236 ))); 201 237 202 $value = isset( $instance[ $key ] ) ? $instance[ $key ] : $setting['std']; 203 204 $setting['id'] = $this->get_field_id( $key ); 238 $value = isset( $instance[ $key ] ) ? $instance[ $key ] : $setting['std']; 239 $setting['id'] = $this->get_field_id( $key ); 205 240 $setting['name'] = $this->get_field_name( $key ); 241 $setting['desc'] = !empty($setting['desc']) ? '<small class="kopa-widget-desc">'. $setting['desc'] .'</small>' : false; 206 242 207 243 ob_start(); 208 244 209 $setting['desc'] = !empty($setting['desc']) ? '<small class="kopa-widget-desc">'. $setting['desc'] .'</small>' : false; 210 211 switch ( $setting['type'] ) { 212 case "text" : 245 switch ( $setting[ 'type' ] ) { 246 case 'repeater_link': 247 $setting['id'] = $this->get_field_name( $key ); 248 ?> 249 <p> 250 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 251 <?php echo kopa_form_field_repeater_link( '', '', $setting, $value ); ?> 252 <?php echo wp_kses_post($setting['desc']); ?> 253 </p> 254 <?php 255 break; 256 case 'repeater': 257 $setting['id'] = $this->get_field_name( $key ); 258 ?> 259 <p> 260 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 261 <?php echo kopa_form_field_repeater( '', '', $setting, $value ); ?> 262 <?php echo wp_kses_post($setting['desc']); ?> 263 </p> 264 <?php 265 break; 266 case 'chosen': 267 $setting['id'] = $this->get_field_name( $key ); 268 ?> 269 <p> 270 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 271 <?php echo kopa_form_field_chosen( '', '', $setting, $value ); ?> 272 <?php echo wp_kses_post($setting['desc']); ?> 273 </p> 274 <?php 275 break; 276 case 'chosen_singular': 277 $setting['id'] = $this->get_field_name( $key ); 278 ?> 279 <p> 280 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 281 <?php echo kopa_form_field_chosen_singular( '', '', $setting, $value ); ?> 282 <?php echo wp_kses_post($setting['desc']); ?> 283 </p> 284 <?php 285 break; 286 case 'text' : 213 287 ?> 214 288 <p> … … 219 293 <?php 220 294 break; 221 case "number":295 case 'number' : 222 296 ?> 223 297 <p> … … 228 302 <?php 229 303 break; 230 case "select":304 case 'select' : 231 305 ?> 232 306 <p> … … 241 315 <?php 242 316 break; 243 case "multiselect":317 case 'multiselect' : 244 318 ?> 245 319 <p> … … 254 328 <?php 255 329 break; 256 case "checkbox":330 case 'checkbox' : 257 331 ?> 258 332 <p> … … 263 337 <?php 264 338 break; 265 case "textarea":339 case 'textarea' : 266 340 ?> 267 341 <p> … … 272 346 <?php 273 347 break; 274 case "upload":348 case 'upload' : 275 349 if ( empty( $setting['css'] ) ) { 276 350 $setting['css'] = 'width: 88%'; … … 310 384 <?php 311 385 break; 312 313 case "datetime": 314 $date_value_time = ''; 315 if ( isset($setting['format']) && ! empty($value) ) { 316 $date_value_time = date($setting['format'],$value); 317 } 318 ?> 319 <p> 320 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 321 <input 322 class="widefat kopa-framework-datetime" 323 type="text" 324 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 325 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 326 value="<?php echo esc_attr($date_value_time);?>" 327 data-timepicker="<?php echo esc_attr($setting['timepicker']); ?>" 328 data-datepicker="<?php echo esc_attr($setting['datepicker']); ?>" 329 data-format="<?php echo wp_kses_post($setting['format']); ?>" 330 autocomplete="off"> 331 <?php echo wp_kses_post($setting['desc']); ?> 332 </p> 333 <?php break; 334 335 case 'gallery': ?> 336 <div class="kopa-framework-gallery-box"> 337 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label><br/> 338 <input 339 class="widefat kopa-framework-gallery" 340 type="text" 341 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 342 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 343 value="<?php echo esc_attr($value);?>" 344 autocomplete="off"> 345 <?php echo wp_kses_post($setting['desc']); ?> 346 <a href="#" class="kopa-framework-gallery-config button button-secondary"> 347 <?php echo esc_html__('Config', 'kopa-framework'); ?> 348 </a> 349 </div> 350 <?php 351 break; 352 353 case 'icon': ?> 354 <p> 355 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 356 <div class="kopa-icon-picker-wrap clearfix"> 357 <input type="hidden" 358 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 359 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 360 value="<?php echo esc_attr($value);?>" 361 autocomplete="off" 362 class="widefat kopa-icon-picker-value"/> 363 <span class="kopa-icon-picker-preview"><i class="<?php echo esc_attr($value);?>"></i></span> 364 <a class="kopa-icon-picker dashicons dashicons-arrow-down" href="#"></a> 365 </div> 366 </p> 367 <?php 368 break; 369 case 'taxonomy': 370 $setting['options'] = array( '' => esc_html__( '-- Select --', 'kopa-framework' ) ); 371 372 if ( isset( $setting['taxonomy'] ) && !empty( $setting['taxonomy'] ) ) { 373 $taxonomy = esc_html( $setting['taxonomy'] ); 374 $terms = get_terms( $taxonomy ); 375 if( $terms ){ 376 foreach( $terms as $term ){ 377 $setting['options'][$term->term_id] = $term->name; 378 } 379 } 380 } 381 386 case 'datetime': 387 $date_value_time = ''; 388 if ( isset($setting['format']) && ! empty($value) ) { 389 $date_value_time = date($setting['format'],$value); 390 } 391 ?> 392 <p> 393 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 394 <input 395 class="widefat kopa-framework-datetime" 396 type="text" 397 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 398 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 399 value="<?php echo esc_attr($date_value_time);?>" 400 data-timepicker="<?php echo esc_attr($setting['timepicker']); ?>" 401 data-datepicker="<?php echo esc_attr($setting['datepicker']); ?>" 402 data-format="<?php echo wp_kses_post($setting['format']); ?>" 403 autocomplete="off"> 404 <?php echo wp_kses_post($setting['desc']); ?> 405 </p> 406 <?php 407 break; 408 case 'gallery': ?> 409 <div class="kopa-framework-gallery-box"> 410 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label><br/> 411 <input 412 class="widefat kopa-framework-gallery" 413 type="text" 414 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 415 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 416 value="<?php echo esc_attr($value);?>" 417 autocomplete="off"> 418 <?php echo wp_kses_post($setting['desc']); ?> 419 <a href="#" class="kopa-framework-gallery-config button button-secondary"> 420 <?php echo esc_html__('Config', 'kopa-framework'); ?> 421 </a> 422 </div> 423 <?php 424 break; 425 case 'icon': ?> 426 <p> 427 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> 428 <div class="kopa-icon-picker-wrap clearfix"> 429 <input type="hidden" 430 name="<?php echo esc_attr( $this->get_field_name( $key ) ); ?>" 431 id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" 432 value="<?php echo esc_attr($value);?>" 433 autocomplete="off" 434 class="widefat kopa-icon-picker-value"/> 435 <span class="kopa-icon-picker-preview"><i class="<?php echo esc_attr($value);?>"></i></span> 436 <a class="kopa-icon-picker dashicons dashicons-arrow-down" href="#"></a> 437 </div> 438 </p> 439 <?php 440 break; 441 case 'taxonomy': 442 $setting['options'] = array( '' => esc_html__( '-- Select --', 'kopa-framework' ) ); 443 if ( isset( $setting['taxonomy'] ) && !empty( $setting['taxonomy'] ) ) { 444 $taxonomy = esc_html( $setting['taxonomy'] ); 445 $terms = get_terms( $taxonomy ); 446 if( $terms ){ 447 foreach( $terms as $term ){ 448 $setting['options'][$term->term_id] = $term->name; 449 } 450 } 451 } 382 452 ?> 383 453 <p> … … 391 461 </p> 392 462 <?php 393 394 break; 395 396 case 'caption': 397 ?> 398 <div> 399 <p class="kopa_ui_caption"><?php echo esc_html( $setting['label'] ); ?></p> 400 <?php echo wp_kses_post($setting['desc']); ?> 401 </div> 402 <?php 403 break; 404 case 'singular': 405 $post_type = ( isset( $setting['post_type'] ) && !empty( $setting['post_type'] ) ) ? esc_html( $setting['post_type'] ) : 'page'; 406 ?> 463 break; 464 case 'caption': 465 ?> 466 <div> 467 <p class="kopa_ui_caption"><?php echo esc_html( $setting['label'] ); ?></p> 468 <?php echo wp_kses_post($setting['desc']); ?> 469 </div> 470 <?php 471 break; 472 case 'singular': 473 $post_type = ( isset( $setting['post_type'] ) && !empty( $setting['post_type'] ) ) ? esc_html( $setting['post_type'] ) : 'page'; 474 ?> 407 475 <p> 408 476 <label for="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>"><?php echo esc_html( $setting['label'] ); ?></label> … … 452 520 <?php endif; ?> 453 521 </p> 454 455 522 <?php 523 break; 456 524 } 457 525 … … 461 529 } 462 530 463 print('</div>');531 echo '</div>'; 464 532 } 465 533 … … 482 550 return $default; 483 551 } 552 484 553 } -
kopatheme/trunk/includes/admin/class-kopa-admin-assets.php
r1486248 r1490791 13 13 if ( ! class_exists( 'Kopa_Admin_Assets' ) ) { 14 14 15 /**16 * Kopa_Admin_Assets Class17 */18 15 class Kopa_Admin_Assets { 19 16 20 /**21 * Hook in tabs.22 *23 * @since 1.0.024 * @access public25 */26 17 public function __construct() { 27 add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ) ); 28 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) ); 29 } 30 31 /** 32 * Enqueue styles 33 * 34 * @since 1.0.0 35 * @access public 36 */ 18 $is_load_compiled_assets = apply_filters( 'kopa_is_load_compiled_assets', false ); 19 20 if( $is_load_compiled_assets ) { 21 add_action( 'admin_enqueue_scripts', array( $this, 'load_compiled_assets' ) ); 22 }else{ 23 add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ) ); 24 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) ); 25 } 26 } 27 28 public function is_compiled( $hook ) { 29 $screen = get_current_screen(); 30 $is_theme_options = in_array( $screen->id, kopa_get_screen_ids() ); 31 $is_other_pages = in_array( $hook, array( 'widgets.php', 'post.php', 'post-new.php', 'edit-tags.php','term.php', 'edit.php' ) ); 32 33 return $is_other_pages || $is_theme_options; 34 } 35 36 public function load_compiled_assets( $hook ) { 37 38 if ( $this->is_compiled( $hook ) ) { 39 wp_enqueue_media(); 40 wp_enqueue_style( 'wp-color-picker' ); 41 wp_enqueue_style( 'kopatheme', KF()->framework_url() . '/assets/compiled/kopatheme.min.css', array(), KOPA_FRAMEWORK_VERSION ); 42 43 wp_enqueue_script( 'wp-color-picker' ); 44 wp_enqueue_script( 'jquery-ui-core' ); 45 wp_enqueue_script( 'jquery-ui-dialog' ); 46 wp_enqueue_script( 'jquery-ui-position' ); 47 wp_enqueue_script( 'jquery-ui-droppable' ); 48 wp_enqueue_script( 'jquery-ui-draggable' ); 49 wp_enqueue_script( 'kopatheme', KF()->framework_url() . '/assets/compiled/kopatheme.min.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 50 51 wp_localize_script( 'kopatheme', 'kopa_google_fonts', kopa_google_font_property_list_array() ); 52 wp_localize_script( 'kopatheme', 'kopa_google_font_families', kopa_google_font_list() ); 53 wp_localize_script( 'kopatheme', 'kopa_system_fonts', kopa_system_font_list() ); 54 wp_localize_script( 'kopatheme', 'kopa_font_styles', kopa_font_style_options() ); 55 wp_localize_script( 'kopatheme', 'kopa_custom_font_attributes', $this->get_i18n_fonts() ); 56 wp_localize_script( 'kopatheme', 'kopa_admin_l10n', $this->get_i18n_admin() ); 57 wp_localize_script( 'kopatheme', 'kopa_sidebar_attributes_l10n', $this->get_i18n_sidebar() ); 58 wp_localize_script( 'kopatheme', 'kopa_upload_l10n', $this->get_i18n_uploader() ); 59 wp_localize_script( 'kopatheme', 'kopa_advanced_field', $this->get_i18n_fields() ); 60 } 61 62 do_action( 'kopa_admin_css', $hook ); 63 } 64 37 65 public function admin_styles($hook) { 38 66 global $wp_scripts; 39 67 40 $screen = get_current_screen(); 41 42 // Admin styles for admins pages only 68 $screen = get_current_screen( ); 69 43 70 wp_register_style( 'kopa_admin', KF()->framework_url() . '/assets/css/admin.css', array(), KOPA_FRAMEWORK_VERSION ); 44 45 // font awesome 46 wp_register_style( 'kopa_font_awesome', KF()->framework_url() . '/assets/css/font-awesome.css', array(), '4.0.3' ); 47 48 // style for custom layout feature 71 wp_register_style( 'kopa_font_awesome', KF()->framework_url() . '/assets/css/font-awesome.css', array(), KOPA_FRAMEWORK_VERSION ); 72 wp_register_style( 'font-themify', KF()->framework_url() . '/assets/css/font-themify.css', array(), KOPA_FRAMEWORK_VERSION ); 49 73 wp_register_style( 'kopa_custom_layout', KF()->framework_url() . '/assets/css/custom-layout.css', array(), KOPA_FRAMEWORK_VERSION ); 50 51 // Widget form styles52 74 wp_register_style( 'kopa_widget', KF()->framework_url() . '/assets/css/widget.css', array(), KOPA_FRAMEWORK_VERSION ); 53 75 54 // Advanced field 55 $advanced_field = apply_filters('kopa_admin_metabox_advanced_field', false); 56 if ( $advanced_field ) { 57 wp_register_style( 'kopa_datetimepicker', KF()->framework_url() . '/assets/css/jquery.datetimepicker.css', array(), KOPA_FRAMEWORK_VERSION ); 76 if ( $this->is_use_advanced_fields() ) { 77 wp_register_style( 'jquery-datetimepicker', KF()->framework_url() . '/assets/css/jquery.datetimepicker.css', array(), KOPA_FRAMEWORK_VERSION ); 78 wp_register_style( 'jquery-chosen', KF()->framework_url() . '/assets/css/jquery.chosen.css', array(), KOPA_FRAMEWORK_VERSION ); 58 79 } 59 80 60 /** 61 * @since 1.1.9 62 * @add `appearance_page_kopa-framework` to check in_array() 63 * 64 * @since 1.2.0 65 * @add `edit-tags.php`, `term.php` to check in_array() 66 */ 67 68 if ( in_array( $hook, array( 'widgets.php', 'post.php', 'post-new.php', 'appearance_page_kopa-framework', 'edit-tags.php','term.php' ) ) ) { 69 wp_enqueue_style( 'kopa_widget' ); 70 if ( $advanced_field ) { 71 wp_enqueue_style( 'kopa_datetimepicker' ); 72 wp_enqueue_style( 'kopa_font_awesome' ); 73 wp_enqueue_style( 'kopa_jquery_ui' ); 74 wp_enqueue_style( 'kopa_jquery_ui_structure' ); 75 wp_enqueue_style( 'kopa_jquery_ui_theme' ); 76 77 wp_enqueue_script( 'jquery-ui-core' ); 78 wp_enqueue_script( 'jquery-ui-dialog' ); 79 wp_enqueue_script( 'jquery-ui-position' ); 80 wp_enqueue_script( 'jquery-ui-droppable' ); 81 wp_enqueue_script( 'jquery-ui-draggable' ); 81 if ( in_array( $hook, array( 'widgets.php', 'post.php', 'post-new.php', 'appearance_page_kopa-framework', 'edit-tags.php','term.php', 'edit.php' ) ) ) { 82 83 wp_enqueue_media(); 84 wp_enqueue_style( 'kopa_widget' ); 85 wp_enqueue_style( 'wp-color-picker' ); 86 87 if ( $this->is_use_advanced_fields() ) { 88 wp_enqueue_style( 'jquery-datetimepicker' ); 89 wp_enqueue_style( 'jquery-chosen' ); 90 wp_enqueue_style( 'kopa_font_awesome' ); 91 wp_enqueue_style( 'font-themify' ); 82 92 } 83 93 } 84 94 85 // check admin pages to enqueue styles 86 if ( in_array( $screen->id, kopa_get_screen_ids() ) ) { 87 wp_enqueue_style( 'kopa_font_awesome' ); 88 wp_enqueue_style( 'kopa_admin' ); 89 wp_enqueue_style( 'wp-color-picker' ); 90 wp_enqueue_style( 'thickbox' ); 91 } 95 if ( in_array( $screen->id, kopa_get_screen_ids() ) ) { wp_enqueue_style( 'kopa_admin' ); } 92 96 93 97 do_action( 'kopa_admin_css' ); 94 } 95 96 97 /** 98 * Enqueue scripts 99 * 100 * @since 1.0.0 101 * @access public 102 */ 98 } 99 103 100 public function admin_scripts() { 104 101 global $wp_query, $post; … … 109 106 wp_enqueue_media(); 110 107 111 // Register scripts 112 wp_register_script( 'kopa_admin', KF()->framework_url() . '/assets/js/admin'.$suffix.'.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable', 'kopa_media_uploader' ), KOPA_FRAMEWORK_VERSION ); 113 114 wp_register_script( 'kopa_dynamic_sidebar', KF()->framework_url() .'/assets/js/admin-sidebar'.$suffix.'.js', array( 'jquery', 'jquery-ui-sortable', 'thickbox' ), KOPA_FRAMEWORK_VERSION ); 115 116 wp_register_script( 'kopa_dynamic_layout', KF()->framework_url() .'/assets/js/admin-layout'.$suffix.'.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 117 118 // script for custom layout feature 119 wp_register_script( 'kopa_custom_layout', KF()->framework_url() . '/assets/js/custom-layout'.$suffix.'.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 120 121 wp_register_script( 'kopa_custom_fields', KF()->framework_url() . '/assets/js/admin-fields'.$suffix.'.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 122 123 wp_register_script( 'kopa_media_uploader', KF()->framework_url() . '/assets/js/media-uploader'.$suffix.'.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 124 125 // script for advanced fields 126 $advanced_field = apply_filters('kopa_admin_metabox_advanced_field', false); 127 if ( $advanced_field ) { 128 wp_register_script( 'kopa_datetimepicker', KF()->framework_url() . '/assets/js/jquery.datetimepicker'.$suffix.'.js', array( 'jquery' ), KOPA_FRAMEWORK_VERSION ); 108 wp_register_script( 'kopa_admin', KF()->framework_url() . '/assets/js/admin'.$suffix.'.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable', 'kopa_media_uploader' ), NULL ); 109 wp_register_script( 'kopa_dynamic_sidebar', KF()->framework_url() .'/assets/js/admin-sidebar'.$suffix.'.js', array( 'jquery', 'jquery-ui-sortable', 'thickbox' ), NULL ); 110 wp_register_script( 'kopa_dynamic_layout', KF()->framework_url() .'/assets/js/admin-layout'.$suffix.'.js', array( 'jquery' ), NULL ); 111 wp_register_script( 'kopa_custom_layout', KF()->framework_url() . '/assets/js/custom-layout'.$suffix.'.js', array( 'jquery' ), NULL ); 112 wp_register_script( 'kopa_custom_fields', KF()->framework_url() . '/assets/js/admin-fields'.$suffix.'.js', array( 'jquery' ), NULL ); 113 wp_register_script( 'kopa_media_uploader', KF()->framework_url() . '/assets/js/media-uploader'.$suffix.'.js', array( 'jquery' ), NULL ); 114 115 if ( $this->is_use_advanced_fields() ) { 116 wp_register_script( 'jquery-datetimepicker', KF()->framework_url() . '/assets/js/jquery.datetimepicker'.$suffix.'.js', array( 'jquery' ), NULL ); 117 wp_register_script( 'jquery-chosen', KF()->framework_url() . '/assets/js/jquery-chosen'.$suffix.'.js', array( 'jquery' ), NULL ); 118 wp_register_script( 'jquery-repeatable', KF()->framework_url() . '/assets/js/jquery-repeatable'.$suffix.'.js', array( 'jquery' ), NULL ); 129 119 } 130 120 131 132 133 // KopaFramework admin pages134 121 if ( in_array( $screen->id, kopa_get_screen_ids() ) ) { 135 136 122 wp_enqueue_script( 'kopa_admin' ); 123 wp_enqueue_script( 'kopa_dynamic_sidebar' ); 124 wp_enqueue_script( 'kopa_dynamic_layout' ); 125 137 126 wp_localize_script( 'kopa_admin', 'kopa_google_fonts', kopa_google_font_property_list_array() ); 138 127 wp_localize_script( 'kopa_admin', 'kopa_google_font_families', kopa_google_font_list() ); 139 128 wp_localize_script( 'kopa_admin', 'kopa_system_fonts', kopa_system_font_list() ); 140 129 wp_localize_script( 'kopa_admin', 'kopa_font_styles', kopa_font_style_options() ); 141 wp_localize_script( 'kopa_admin', 'kopa_custom_font_attributes', array( 142 'name' => array( 143 'type' => 'text', 144 'placeholder' => __( 'Enter font name', 'kopa-framework' ), 145 'required' => false, 146 'value' => __( 'Custom font', 'kopa-framework' ), 147 ), 148 'woff' => array( 149 'type' => 'upload', 150 'placeholder' => __( 'Upload .woff font file', 'kopa-framework' ), 151 'mimes' => 'font/woff', 152 ), 153 'ttf' => array( 154 'type' => 'upload', 155 'placeholder' => __( 'Upload .ttf font file', 'kopa-framework' ), 156 'mimes' => 'font/truetype', 157 ), 158 'eot' => array( 159 'type' => 'upload', 160 'placeholder' => __( 'Upload .eot font file', 'kopa-framework' ), 161 'mimes' => 'font/eot', 162 ), 163 'svg' => array( 164 'type' => 'upload', 165 'placeholder' => __( 'Upload .svg font file', 'kopa-framework' ), 166 'mimes' => 'font/svg', 167 ), 168 ) ); 169 wp_localize_script( 'kopa_admin', 'kopa_admin_l10n', array( 170 'upload' => __( 'Upload', 'kopa-framework' ), 171 'remove' => __( 'Remove', 'kopa-framework' ), 172 'confirm_reset' => __( 'Click OK to reset. Any selected settings will be lost!', 'kopa-framework' ), 173 'confirm_import' => __( 'Click OK to import. Any selected settings will be lost!', 'kopa-framework' ), 174 'confirm_delete' => __( 'Are you sure you want to delete?', 'kopa-framework' )) 175 ); 176 wp_enqueue_script( 'kopa_dynamic_sidebar' ); 177 wp_localize_script( 'kopa_dynamic_sidebar', 'kopa_sidebar_attributes_l10n', array( 178 'ajax_url' => admin_url('admin-ajax.php'), 179 'warning' => __( 'Warning', 'kopa-framework' ), 180 'error' => __( 'Error', 'kopa-framework' ), 181 'info' => __( 'Info', 'kopa-framework' ), 182 'confirm_message' => __( 'Are you sure you want to delete?', 'kopa-framework' ), 183 'close' => __( 'Close', 'kopa-framework' ), 184 'remove' => __( 'Delete', 'kopa-framework' ), 185 'advanced_settings' => __( 'Advanced Settings', 'kopa-framework' ), 186 'attributes' => array( 187 'name' => __( 'Name', 'kopa-framework' ), 188 'description' => __( 'Description', 'kopa-framework' ), 189 'before_widget' => __( 'Before Widget', 'kopa-framework' ), 190 'after_widget' => __( 'After Widget', 'kopa-framework' ), 191 'before_title' => __( 'Before Title', 'kopa-framework' ), 192 'after_title' => __( 'After Title', 'kopa-framework' ), 193 ), 194 ) ); 195 wp_enqueue_script( 'kopa_dynamic_layout' ); 130 wp_localize_script( 'kopa_admin', 'kopa_custom_font_attributes', $this->get_i18n_fonts() ); 131 wp_localize_script( 'kopa_admin', 'kopa_admin_l10n', $this->get_i18n_admin() ); 132 wp_localize_script( 'kopa_dynamic_sidebar', 'kopa_sidebar_attributes_l10n', $this->get_i18n_sidebar() ); 196 133 } 197 134 198 // script for widget upload fields199 135 wp_enqueue_media(); 200 wp_enqueue_script( 'kopa_media_uploader' ); 201 wp_enqueue_script( 'kopa_custom_fields' ); 202 203 wp_localize_script( 'kopa_media_uploader', 'kopa_upload_l10n', array( 136 wp_enqueue_script( 'kopa_media_uploader' ); 137 wp_localize_script( 'kopa_media_uploader', 'kopa_upload_l10n', $this->get_i18n_uploader() ); 138 139 if ( $this->is_use_advanced_fields() ) { 140 wp_enqueue_script( 'jquery-ui-core' ); 141 wp_enqueue_script( 'jquery-ui-dialog' ); 142 wp_enqueue_script( 'jquery-ui-position' ); 143 wp_enqueue_script( 'jquery-ui-droppable' ); 144 wp_enqueue_script( 'jquery-ui-draggable' ); 145 wp_enqueue_script( 'kopa_custom_fields' ); 146 wp_enqueue_script( 'jquery-datetimepicker' ); 147 wp_enqueue_script( 'jquery-chosen' ); 148 wp_enqueue_script( 'jquery-repeatable' ); 149 wp_localize_script( 'kopa_custom_fields', 'kopa_advanced_field', $this->get_i18n_fields() ); 150 } 151 } 152 153 public function is_use_advanced_fields() { 154 return apply_filters( 'kopa_admin_metabox_advanced_field', false ); 155 } 156 157 public function get_i18n_fonts() { 158 return array( 159 'name' => array( 160 'type' => 'text', 161 'placeholder' => esc_html__( 'Enter font name', 'kopa-framework' ), 162 'required' => false, 163 'value' => esc_html__( 'Custom font', 'kopa-framework' ), 164 ), 165 'woff' => array( 166 'type' => 'upload', 167 'placeholder' => esc_html__( 'Upload .woff font file', 'kopa-framework' ), 168 'mimes' => 'font/woff', 169 ), 170 'ttf' => array( 171 'type' => 'upload', 172 'placeholder' => esc_html__( 'Upload .ttf font file', 'kopa-framework' ), 173 'mimes' => 'font/truetype', 174 ), 175 'eot' => array( 176 'type' => 'upload', 177 'placeholder' => esc_html__( 'Upload .eot font file', 'kopa-framework' ), 178 'mimes' => 'font/eot', 179 ), 180 'svg' => array( 181 'type' => 'upload', 182 'placeholder' => esc_html__( 'Upload .svg font file', 'kopa-framework' ), 183 'mimes' => 'font/svg', 184 ), 185 ); 186 } 187 188 public function get_i18n_admin() { 189 return array( 190 'upload' => esc_html__( 'Upload', 'kopa-framework' ), 191 'remove' => esc_html__( 'Remove', 'kopa-framework' ), 192 'confirm_reset' => esc_html__( 'Click OK to reset. Any selected settings will be lost!', 'kopa-framework' ), 193 'confirm_import' => esc_html__( 'Click OK to import. Any selected settings will be lost!', 'kopa-framework' ), 194 'confirm_delete' => esc_html__( 'Are you sure you want to delete?', 'kopa-framework' ) 195 ); 196 } 197 198 public function get_i18n_sidebar() { 199 return array( 200 'ajax_url' => admin_url('admin-ajax.php'), 201 'warning' => esc_html__( 'Warning', 'kopa-framework' ), 202 'error' => esc_html__( 'Error', 'kopa-framework' ), 203 'info' => esc_html__( 'Info', 'kopa-framework' ), 204 'confirm_message' => esc_html__( 'Are you sure you want to delete?', 'kopa-framework' ), 205 'close' => esc_html__( 'Close', 'kopa-framework' ), 206 'remove' => esc_html__( 'Delete', 'kopa-framework' ), 207 'advanced_settings' => esc_html__( 'Advanced Settings', 'kopa-framework' ), 208 'attributes' => array( 209 'name' => esc_html__( 'Name', 'kopa-framework' ), 210 'description' => esc_html__( 'Description', 'kopa-framework' ), 211 'before_widget' => esc_html__( 'Before Widget', 'kopa-framework' ), 212 'after_widget' => esc_html__( 'After Widget', 'kopa-framework' ), 213 'before_title' => esc_html__( 'Before Title', 'kopa-framework' ), 214 'after_title' => esc_html__( 'After Title', 'kopa-framework' ), 215 ) 216 ); 217 } 218 219 public function get_i18n_uploader() { 220 return array( 204 221 'upload' => '+', 205 222 'remove' => '–', 206 ) 207 ); 208 209 if ( $advanced_field ) { 210 wp_enqueue_script( 'kopa_datetimepicker' ); 211 wp_localize_script( 'kopa_custom_fields', 'kopa_advanced_field', array( 212 'ajax_url' => admin_url('admin-ajax.php'), 213 'i18n' => array( 'icon_picker' => esc_attr__( 'Icon Picker', 'kopa-framework' ) ) 223 ); 224 } 225 226 public function get_i18n_fields() { 227 return array( 228 'ajax_url' => admin_url('admin-ajax.php'), 229 'translate' => array( 230 'icon_picker' => esc_attr__( 'Icon Picker', 'kopa-framework' ), 231 'untitle' => esc_html__( 'Untitle', 'kopa-framework' ), 232 ), 233 'icon' => array( 234 'shortcodes' => KF()->framework_url() . '/assets/images/shortcodes.png', 235 ), 236 'icon_picker' => array( 237 'label' => array( 238 'icon_picker' => esc_html__( 'Icon Picker', 'kopa-framework' ), 239 'add' => esc_html__( 'Add', 'kopa-framework' ), 240 'use' => esc_html__( 'Use', 'kopa-framework' ), 241 'cancel' => esc_html__( 'Cancel', 'kopa-framework' ), 242 'remove' => esc_html__( 'Remove', 'kopa-framework' ), 243 'edit' => esc_html__( 'Edit', 'kopa-framework' ), 244 ), 245 'fonts' => array( 246 'awesome' => array( 247 'name' => esc_html__( 'Awesome', 'kopa-framework' ), 248 'file' => KF()->framework_url() . '/assets/data/font-awesome.json', 249 'prefix' => 'fa' 250 ), 251 'themify' => array( 252 'name' => esc_html__( 'Themify', 'kopa-framework' ), 253 'file' => KF()->framework_url() . '/assets/data/font-themify.json', 254 'prefix' => '' 255 ) 214 256 ) 215 ); 216 } 217 257 ) 258 ); 218 259 } 219 260 -
kopatheme/trunk/includes/admin/class-kopa-admin-backup.php
r1353276 r1490791 113 113 // Check for errors 114 114 if ( ! $options || $_FILES['kopa_import_file']['error'] ) { 115 Kopa_Admin_Settings::add_error( __( 'There was a problem importing your settings.', 'kopa-framework' ) );115 Kopa_Admin_Settings::add_error( esc_html__( 'There was a problem importing your settings.', 'kopa-framework' ) ); 116 116 return false; 117 117 } … … 119 119 // Make sure this is a valid backup file. 120 120 if ( ! isset( $options['kopathemes-backup-validator'] ) ) { 121 Kopa_Admin_Settings::add_error( __( "The import file you've provided is invalid.", 'kopa-framework' ) );121 Kopa_Admin_Settings::add_error( esc_html__( "The import file you've provided is invalid.", 'kopa-framework' ) ); 122 122 return false; 123 123 } else { … … 139 139 140 140 if ( $has_updated ) { 141 Kopa_Admin_Settings::add_message( __( 'Settings successfully imported.', 'kopa-framework' ) );141 Kopa_Admin_Settings::add_message( esc_html__( 'Settings successfully imported.', 'kopa-framework' ) ); 142 142 } 143 143 -
kopatheme/trunk/includes/admin/class-kopa-admin-help.php
r1353276 r1490791 43 43 $screen->add_help_tab( array( 44 44 'id' => 'kopa_framework_docs_tab', 45 'title' => __( 'Documentation', 'kopa-framework' ),45 'title' => esc_html__( 'Documentation', 'kopa-framework' ), 46 46 'content' => 47 47 48 '<p>' . __( 'Thank you for using Kopa Framework. Should you need help using or extending Kopa Framework please read the documentation.', 'kopa-framework' ) . '</p>' .48 '<p>' . esc_html__( 'Thank you for using Kopa Framework. Should you need help using or extending Kopa Framework please read the documentation.', 'kopa-framework' ) . '</p>' . 49 49 50 '<p><a href="#docs" class="button button-primary">' . __( 'Kopa Framework Documentation', 'kopa-framework' ) . '</a> <a href="#api" class="button">' .__( 'Developer API Docs', 'kopa-framework' ) . '</a></p>'50 '<p><a href="#docs" class="button button-primary">' . esc_html__( 'Kopa Framework Documentation', 'kopa-framework' ) . '</a> <a href="#api" class="button">' . esc_html__( 'Developer API Docs', 'kopa-framework' ) . '</a></p>' 51 51 52 52 ) ); … … 54 54 $screen->add_help_tab( array( 55 55 'id' => 'kopa_framework_support_tab', 56 'title' => __( 'Support', 'kopa-framework' ),56 'title' => esc_html__( 'Support', 'kopa-framework' ), 57 57 'content' => 58 58 59 '<p>' . sprintf( __( 'After <a href="%s">reading the documentation</a>, for further assistance you can use the <a href="%s">community forum</a>, or if you have access as a Kopatheme customer, <a href="%s">our support desk</a>.', 'kopa-framework' ), '#doc', '#community', '#ticket' ) . '</p>' .59 '<p>' . sprintf(esc_html__( 'After <a href="%s">reading the documentation</a>, for further assistance you can use the <a href="%s">community forum</a>, or if you have access as a Kopatheme customer, <a href="%s">our support desk</a>.', 'kopa-framework' ), '#doc', '#community', '#ticket' ) . '</p>' . 60 60 61 '<p><a href="' . '#' . '" class="button">' . __( 'Community Support', 'kopa-framework' ) . '</a> <a href="' . '#' . '" class="button">' .__( 'Customer Support', 'kopa-framework' ) . '</a></p>'61 '<p><a href="' . '#' . '" class="button">' . esc_html__( 'Community Support', 'kopa-framework' ) . '</a> <a href="' . '#' . '" class="button">' . esc_html__( 'Customer Support', 'kopa-framework' ) . '</a></p>' 62 62 63 63 ) ); … … 65 65 $screen->add_help_tab( array( 66 66 'id' => 'kopa_framework_bugs_tab', 67 'title' => __( 'Found a bug?', 'kopa-framework' ),67 'title' => esc_html__( 'Found a bug?', 'kopa-framework' ), 68 68 'content' => 69 69 70 '<p>' . sprintf( __( 'If you find a bug within Kopa Framework core you can create a ticket via <a href="%s">Kopatheme ticket</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. Be as descriptive as possible.', 'kopa-framework' ), '#ticket', '#guide') . '</p>' .70 '<p>' . sprintf(esc_html__( 'If you find a bug within Kopa Framework core you can create a ticket via <a href="%s">Kopatheme ticket</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. Be as descriptive as possible.', 'kopa-framework' ), '#ticket', '#guide') . '</p>' . 71 71 72 '<p><a href="#report" class="button button-primary">' . __( 'Report a bug', 'kopa-framework' ) . '</a></p>'72 '<p><a href="#report" class="button button-primary">' . esc_html__( 'Report a bug', 'kopa-framework' ) . '</a></p>' 73 73 74 74 ) ); … … 76 76 77 77 $screen->set_help_sidebar( 78 '<p><strong>' . __( 'For more information:', 'kopa-framework' ) . '</strong></p>' .79 '<p><a href="#" target="_blank">' . __( 'About Kopa Framework', 'kopa-framework' ) . '</a></p>' .80 '<p><a href="#" target="_blank">' . __( 'Project on WordPress.org', 'kopa-framework' ) . '</a></p>' .81 '<p><a href="#" target="_blank">' . __( 'Official Themes', 'kopa-framework' ) . '</a></p>'78 '<p><strong>' . esc_html__( 'For more information:', 'kopa-framework' ) . '</strong></p>' . 79 '<p><a href="#" target="_blank">' . esc_html__( 'About Kopa Framework', 'kopa-framework' ) . '</a></p>' . 80 '<p><a href="#" target="_blank">' . esc_html__( 'Project on WordPress.org', 'kopa-framework' ) . '</a></p>' . 81 '<p><a href="#" target="_blank">' . esc_html__( 'Official Themes', 'kopa-framework' ) . '</a></p>' 82 82 ); 83 83 } -
kopatheme/trunk/includes/admin/class-kopa-admin-menus.php
r1353276 r1490791 47 47 48 48 $menu = array( 49 'page_title' => __( 'Theme Options', 'kopa-framework' ),50 'menu_title' => __( 'Theme Options', 'kopa-framework' ),49 'page_title' => esc_html__( 'Theme Options', 'kopa-framework' ), 50 'menu_title' => esc_html__( 'Theme Options', 'kopa-framework' ), 51 51 'capability' => 'edit_theme_options', 52 52 'menu_slug' => 'kopa-framework' -
kopatheme/trunk/includes/admin/class-kopa-admin-settings.php
r1486248 r1490791 116 116 117 117 if ( empty( $_REQUEST['_wpnonce'] ) || !wp_verify_nonce( $_REQUEST['_wpnonce'], 'kopa-settings' ) ) { 118 die( __( 'Action failed. Please refresh the page and retry.', 'kopa-framework' ) );118 die( esc_html__( 'Action failed. Please refresh the page and retry.', 'kopa-framework' ) ); 119 119 } 120 120 … … 132 132 do_action( 'kopa_settings_reset_' . $kopa_current_tab ); 133 133 } 134 self::add_message( __( 'Default options restored.', 'kopa-framework' ) );134 self::add_message( esc_html__( 'Default options restored.', 'kopa-framework' ) ); 135 135 } 136 136 // save current tab settings 137 137 else { 138 138 do_action( 'kopa_settings_save_' . $kopa_current_tab ); 139 self::add_message( __( 'Your settings have been saved.', 'kopa-framework' ) );139 self::add_message( esc_html__( 'Your settings have been saved.', 'kopa-framework' ) ); 140 140 } 141 141 … … 359 359 // Sanitize fields 360 360 $allowed_tags = array( 361 'abbr' => array( 'title' => true ),361 'abbr' => array( 'title' => true ), 362 362 'acronym' => array( 'title' => true ), 363 'code' => true,364 'em' => true,365 'strong' => true,366 'br' => true,367 'i' => true,368 'small' => true,369 'a' => array(370 'href' => true,363 'code' => true, 364 'em' => true, 365 'strong' => true, 366 'br' => true, 367 'i' => true, 368 'small' => true, 369 'a' => array( 370 'href' => true, 371 371 'title' => true, 372 372 ), … … 393 393 global $kopa_title_counter; 394 394 $kopa_title_counter = 0; 395 396 $wrap_start = '';397 $wrap_end = '';398 $output = '';395 396 $wrap_start = ''; 397 $wrap_end = ''; 398 $output = ''; 399 399 400 400 -
kopatheme/trunk/includes/admin/fields/field_font.php
r1486248 r1490791 26 26 ) ); 27 27 28 $preview = isset( $settings['preview'] ) ? $settings['preview'] : __( 'preview text', 'kopa-framework' );28 $preview = isset( $settings['preview'] ) ? $settings['preview'] : esc_html__( 'preview text', 'kopa-framework' ); 29 29 30 30 $output = $wrap_start; … … 87 87 'name' => array( 88 88 'type' => 'text', 89 'placeholder' => __( 'Enter font name', 'kopa-framework' ),89 'placeholder' => esc_html__( 'Enter font name', 'kopa-framework' ), 90 90 'required' => false, 91 91 ), 92 92 'woff' => array( 93 93 'type' => 'upload', 94 'placeholder' => __( 'Upload .woff font file', 'kopa-framework' ),94 'placeholder' => esc_html__( 'Upload .woff font file', 'kopa-framework' ), 95 95 'mimes' => 'font/woff', 96 96 ), 97 97 'ttf' => array( 98 98 'type' => 'upload', 99 'placeholder' => __( 'Upload .ttf font file', 'kopa-framework' ),99 'placeholder' => esc_html__( 'Upload .ttf font file', 'kopa-framework' ), 100 100 'mimes' => 'font/truetype', 101 101 ), 102 102 'eot' => array( 103 103 'type' => 'upload', 104 'placeholder' => __( 'Upload .eot font file', 'kopa-framework' ),104 'placeholder' => esc_html__( 'Upload .eot font file', 'kopa-framework' ), 105 105 'mimes' => 'font/eot', 106 106 ), 107 107 'svg' => array( 108 108 'type' => 'upload', 109 'placeholder' => __( 'Upload .svg font file', 'kopa-framework' ),109 'placeholder' => esc_html__( 'Upload .svg font file', 'kopa-framework' ), 110 110 'mimes' => 'font/svg', 111 111 ), -
kopatheme/trunk/includes/admin/fields/field_sidebar_manager.php
r1470471 r1490791 31 31 32 32 $sidebar_atts = array( 33 'name' => __( 'Name', 'kopa-framework' ),34 'description' => __( 'Description', 'kopa-framework' ),35 'before_widget' => __( 'Before Widget', 'kopa-framework' ),36 'after_widget' => __( 'After Widget', 'kopa-framework' ),37 'before_title' => __( 'Before Title', 'kopa-framework' ),38 'after_title' => __( 'After Title', 'kopa-framework' ),33 'name' => esc_html__( 'Name', 'kopa-framework' ), 34 'description' => esc_html__( 'Description', 'kopa-framework' ), 35 'before_widget' => esc_html__( 'Before Widget', 'kopa-framework' ), 36 'after_widget' => esc_html__( 'After Widget', 'kopa-framework' ), 37 'before_title' => esc_html__( 'Before Title', 'kopa-framework' ), 38 'after_title' => esc_html__( 'After Title', 'kopa-framework' ), 39 39 ); 40 40 -
kopatheme/trunk/includes/admin/fields/load.php
r1486248 r1490791 18 18 //Load advanced fields 19 19 require_once 'field_icon.php'; 20 require_once 'field_icon_picker.php'; 20 21 require_once 'field_color.php'; 21 22 require_once 'field_gallery_sortable.php'; … … 30 31 require_once 'field_title.php'; 31 32 require_once 'field_caption.php'; 33 require_once 'field_quote.php'; 34 require_once 'field_chosen.php'; 35 require_once 'field_chosen_singular.php'; 36 require_once 'field_repeater.php'; 37 require_once 'field_repeater_link.php'; 38 32 39 /** 33 40 * Register form fields in global list … … 48 55 'radio', 49 56 'textarea', 50 'datetime', 57 'datetime', 51 58 // Advanced 52 59 'icon', 60 'icon_picker', 53 61 'color', 54 62 'gallery', … … 66 74 'sidebar_manager', 67 75 'title', 68 'caption' 76 'caption', 77 'quote', 78 'chosen', 79 'chosen_singular', 80 'repeater', 81 'repeater_link' 69 82 ); -
kopatheme/trunk/includes/admin/layouts/class-kopa-layout-box.php
r1428092 r1490791 54 54 $output = ''; 55 55 $output .= '<div id="kopa_section_group_'.esc_attr( $value['id'] ).'" class="kopa_section_group kopa_section_group_layout">'; 56 $output .= '<label><input class="kopa_use_custom_layout" type="checkbox" name="_use_custom_layout" value="'.esc_attr( $settings['layout'] ).'" '.checked( $settings['layout'], $use_custom_layout, false ).'> '. __( 'Check if you would like to use custom setting', 'kopa-framework' ).'</label>';56 $output .= '<label><input class="kopa_use_custom_layout" type="checkbox" name="_use_custom_layout" value="'.esc_attr( $settings['layout'] ).'" '.checked( $settings['layout'], $use_custom_layout, false ).'> '.esc_html__( 'Check if you would like to use custom setting', 'kopa-framework' ).'</label>'; 57 57 $output .= '<div class="kopa_group_content">'; 58 58 … … 66 66 // select layout section 67 67 $output .= '<div id="kopa_section_select_layout_'.esc_attr( $value['id'] ).'" class="kopa_section kopa_section_select_layout">'; 68 $output .= '<h4 class="kopa_heading">'. __( 'Select layout', 'kopa-framework' ).'</h4>';68 $output .= '<h4 class="kopa_heading">'.esc_html__( 'Select layout', 'kopa-framework' ).'</h4>'; 69 69 $output .= '<div class="kopa_option">'; 70 70 $output .= '<div class="kopa_controls">'; … … 94 94 $output .= '<div class="kopa_controls">'; 95 95 $output .= '<select name="_custom_layout[sidebars]['.esc_attr( $layout_id ).']['.$position.']">'; 96 $output .= '<option value="">'. __( '—Select sidebar—', 'kopa-framework' ).'</option>';96 $output .= '<option value="">'.esc_html__( '—Select sidebar—', 'kopa-framework' ).'</option>'; 97 97 98 98 // print all registered sidebars … … 123 123 echo '<tr>'; 124 124 echo '<th scope="row" valign="top">'; 125 echo __( 'Custom Layout', 'kopa-framework' );125 echo esc_html__( 'Custom Layout', 'kopa-framework' ); 126 126 echo '</th>'; 127 127 echo '<td>'; -
kopatheme/trunk/includes/admin/layouts/class-kopa-layout-post-type.php
r1353276 r1490791 51 51 add_meta_box( 52 52 'kopa_custom_layout', 53 __( 'Custom Layout', 'kopa-framework' ),53 esc_html__( 'Custom Layout', 'kopa-framework' ), 54 54 array( $this, 'output_fields' ), 55 55 $args['screen'], -
kopatheme/trunk/includes/admin/settings/class-kopa-settings-backup-manager.php
r1467551 r1490791 26 26 public function __construct() { 27 27 $this->id = 'backup-manager'; 28 $this->label = __( 'Backup', 'kopa-framework' );28 $this->label = esc_html__( 'Backup', 'kopa-framework' ); 29 29 30 30 add_filter( 'kopa_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); … … 46 46 // restore default settings 47 47 array( 48 'title' => __( 'Restore Default', 'kopa-framework' ),48 'title' => esc_html__( 'Restore Default', 'kopa-framework' ), 49 49 'type' => 'title', 50 50 'id' => 'restore_default_settings', … … 52 52 ), 53 53 array( 54 'title' => __( 'Restore Default Settings', 'kopa-framework' ),55 'desc' => __( 'Select one of the options below. When you click the "Restore Defaults" button below, the Kopa Framework will restore corresponding default settings for you.', 'kopa-framework' ),54 'title' => esc_html__( 'Restore Default Settings', 'kopa-framework' ), 55 'desc' => esc_html__( 'Select one of the options below. When you click the "Restore Defaults" button below, the Kopa Framework will restore corresponding default settings for you.', 'kopa-framework' ), 56 56 'type' => 'restore_default', 57 57 'id' => 'kopa-restore-default', … … 65 65 */ 66 66 'options' => array( 67 'theme-options,sidebar-manager,layout-manager' => __( 'All Settings (This will contain all of the options listed below.)', 'kopa-framework' ),68 'theme-options' => __( 'Theme Options', 'kopa-framework' ),69 'sidebar-manager,layout-manager' => __( 'Sidebars & Layouts', 'kopa-framework' ),67 'theme-options,sidebar-manager,layout-manager' => esc_html__( 'All Settings (This will contain all of the options listed below.)', 'kopa-framework' ), 68 'theme-options' => esc_html__( 'Theme Options', 'kopa-framework' ), 69 'sidebar-manager,layout-manager' => esc_html__( 'Sidebars & Layouts', 'kopa-framework' ), 70 70 ), 71 71 'default' => 'theme-options,sidebar-manager,layout-manager', … … 74 74 // backup settings 75 75 array( 76 'title' => __( 'Import/Export', 'kopa-framework' ),76 'title' => esc_html__( 'Import/Export', 'kopa-framework' ), 77 77 'type' => 'title', 78 78 'id' => 'backup_settings', … … 80 80 ), 81 81 array( 82 'title' => __( 'Import Settings', 'kopa-framework' ),82 'title' => esc_html__( 'Import Settings', 'kopa-framework' ), 83 83 'type' => 'import', 84 84 'id' => 'import', 85 'desc' => __( "If you have settings in a backup file on your computer, you can import those into this site.", 'kopa-framework' ),85 'desc' => esc_html__( "If you have settings in a backup file on your computer, you can import those into this site.", 'kopa-framework' ), 86 86 'default' => '', 87 87 ), 88 88 array( 89 'title' => __( 'Export Settings', 'kopa-framework' ),89 'title' => esc_html__( 'Export Settings', 'kopa-framework' ), 90 90 'type' => 'export', 91 91 'id' => 'export', 92 'desc' => sprintf( __( "When you click the button below, the Kopa Framework will create a text file for you to save to your computer.\nThis text file can be used to restore your settings here on \"%s\", or to easily setup another website with the same settings.", 'kopa-framework' ), get_bloginfo( 'name' ) ),92 'desc' => sprintf( esc_html__( "When you click the button below, the Kopa Framework will create a text file for you to save to your computer.\nThis text file can be used to restore your settings here on \"%s\", or to easily setup another website with the same settings.", 'kopa-framework' ), get_bloginfo( 'name' ) ), 93 93 /** 94 94 * Tab ids that separate by commas … … 99 99 */ 100 100 'options' => array( 101 'theme-options,sidebar-manager,layout-manager' => __( 'All Settings (This will contain all of the options listed below.)', 'kopa-framework' ),102 'theme-options' => __( 'Theme Options', 'kopa-framework' ),103 'sidebar-manager,layout-manager' => __( 'Sidebars & Layouts', 'kopa-framework' ),101 'theme-options,sidebar-manager,layout-manager' => esc_html__( 'All Settings (This will contain all of the options listed below.)', 'kopa-framework' ), 102 'theme-options' => esc_html__( 'Theme Options', 'kopa-framework' ), 103 'sidebar-manager,layout-manager' => esc_html__( 'Sidebars & Layouts', 'kopa-framework' ), 104 104 ), 105 105 'default' => 'theme-options,sidebar-manager,layout-manager', -
kopatheme/trunk/includes/admin/settings/class-kopa-settings-layout-manager.php
r1353276 r1490791 26 26 public function __construct() { 27 27 $this->id = 'layout-manager'; 28 $this->label = __( 'Layout Manager', 'kopa-framework' );28 $this->label = esc_html__( 'Layout Manager', 'kopa-framework' ); 29 29 30 30 add_filter( 'kopa_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); … … 65 65 // frontpage layout 66 66 array( 67 'title' => __( 'Frontpage', 'kopa-framework' ),67 'title' => esc_html__( 'Frontpage', 'kopa-framework' ), 68 68 'type' => 'title', 69 69 'id' => 'frontpage-title', … … 71 71 72 72 'frontpage-layout' => array( 73 'title' => __( 'Frontpage', 'kopa-framework' ),73 'title' => esc_html__( 'Frontpage', 'kopa-framework' ), 74 74 'type' => 'layout_manager', 75 75 'id' => 'frontpage-layout', … … 81 81 // blog layout 82 82 array( 83 'title' => __( 'Blog', 'kopa-framework' ),83 'title' => esc_html__( 'Blog', 'kopa-framework' ), 84 84 'type' => 'title', 85 85 'id' => 'blog-title', … … 87 87 88 88 'blog-layout' => array( 89 'title' => __( 'Blog', 'kopa-framework' ),89 'title' => esc_html__( 'Blog', 'kopa-framework' ), 90 90 'type' => 'layout_manager', 91 91 'id' => 'blog-layout', … … 97 97 // page layout 98 98 array( 99 'title' => __( 'Page', 'kopa-framework' ),99 'title' => esc_html__( 'Page', 'kopa-framework' ), 100 100 'type' => 'title', 101 101 'id' => 'page-title', … … 103 103 104 104 'page-layout' => array( 105 'title' => __( 'Page', 'kopa-framework' ),105 'title' => esc_html__( 'Page', 'kopa-framework' ), 106 106 'type' => 'layout_manager', 107 107 'id' => 'page-layout', … … 113 113 // post layout 114 114 array( 115 'title' => __( 'Post', 'kopa-framework' ),115 'title' => esc_html__( 'Post', 'kopa-framework' ), 116 116 'type' => 'title', 117 117 'id' => 'post-title', … … 119 119 120 120 'post-layout' => array( 121 'title' => __( 'Post', 'kopa-framework' ),121 'title' => esc_html__( 'Post', 'kopa-framework' ), 122 122 'type' => 'layout_manager', 123 123 'id' => 'post-layout', … … 129 129 // search layout 130 130 array( 131 'title' => __( 'Search', 'kopa-framework' ),131 'title' => esc_html__( 'Search', 'kopa-framework' ), 132 132 'type' => 'title', 133 133 'id' => 'search-title', … … 135 135 136 136 'search-layout' => array( 137 'title' => __( 'Search', 'kopa-framework' ),137 'title' => esc_html__( 'Search', 'kopa-framework' ), 138 138 'type' => 'layout_manager', 139 139 'id' => 'search-layout', … … 145 145 // error 404 layout 146 146 array( 147 'title' => __( '404', 'kopa-framework' ),147 'title' => esc_html__( '404', 'kopa-framework' ), 148 148 'type' => 'title', 149 149 'id' => 'error404-title', … … 151 151 152 152 'error404-layout' => array( 153 'title' => __( 'Error 404', 'kopa-framework' ),153 'title' => esc_html__( 'Error 404', 'kopa-framework' ), 154 154 'type' => 'layout_manager', 155 155 'id' => 'error404-layout', -
kopatheme/trunk/includes/admin/settings/class-kopa-settings-sidebar-manager.php
r1353276 r1490791 26 26 public function __construct() { 27 27 $this->id = 'sidebar-manager'; 28 $this->label = __( 'Sidebar Manager', 'kopa-framework' );28 $this->label = esc_html__( 'Sidebar Manager', 'kopa-framework' ); 29 29 30 30 add_filter( 'kopa_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); … … 47 47 return apply_filters( 'kopa_sidebar_manager_settings', array( 48 48 array( 49 'title' => __( 'Sidebar Manager', 'kopa-framework' ),49 'title' => esc_html__( 'Sidebar Manager', 'kopa-framework' ), 50 50 'type' => 'title', 51 51 'id' => 'sidebar-title', … … 53 53 array( 54 54 'title' => 'Sidebar Manager', 55 'description' => __( 'Add as many sidebars (widget areas) as you need. Creating sidebars (widget areas) is unlimited.', 'kopa-framework' ),55 'description' => esc_html__( 'Add as many sidebars (widget areas) as you need. Creating sidebars (widget areas) is unlimited.', 'kopa-framework' ), 56 56 'id' => 'sidebar-manager', 57 57 'type' => 'sidebar_manager', -
kopatheme/trunk/includes/admin/settings/class-kopa-settings-theme-options.php
r1467551 r1490791 26 26 public function __construct() { 27 27 $this->id = 'theme-options'; 28 $this->label = __( 'General Settings', 'kopa-framework' );28 $this->label = esc_html__( 'General Settings', 'kopa-framework' ); 29 29 30 30 add_filter( 'kopa_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); -
kopatheme/trunk/includes/class-kopa-ajax.php
r1462248 r1490791 59 59 60 60 if ( isset( $sidebars_widgets[ $sidebar_id ] ) && ! empty( $sidebars_widgets[ $sidebar_id ] ) ) { 61 $warnings[] = __( 'This sidebar is currently containing widgets.', 'kopa-framework' );61 $warnings[] = esc_html__( 'This sidebar is currently containing widgets.', 'kopa-framework' ); 62 62 } 63 63 … … 83 83 $layout_name = isset( $option['layouts'][ $layout_id ]['title'] ) ? $option['layouts'][ $layout_id ]['title'] : ''; 84 84 $page_title = isset( $option['title'] ) ? $option['title'] : ''; 85 $errors[] = " " . sprintf( __( '%1$s of %2$s.', 'kopa-framework' ), $layout_name, $page_title );85 $errors[] = " " . sprintf( esc_html__( '%1$s of %2$s.', 'kopa-framework' ), $layout_name, $page_title ); 86 86 } 87 87 } … … 93 93 // warning messages 94 94 // if ( ! empty( $warnings ) ) { 95 // $warnings[] = __( 'Delete it will also delete all widgets are inside it.', 'kopa-framework' );95 // $warnings[] = esc_html__( 'Delete it will also delete all widgets are inside it.', 'kopa-framework' ); 96 96 // } 97 97 … … 100 100 if ( ! empty( $errors ) ) { 101 101 $allow_delete = false; 102 array_unshift( $errors, '<strong>' . __( 'This sidebar is being used in:', 'kopa-framework' ) . '</strong>' );103 $errors[] = '<strong>' . __('You cannot delete this sidebar.', 'kopa-framework') . '</strong>';102 array_unshift( $errors, '<strong>' . esc_html__( 'This sidebar is being used in:', 'kopa-framework' ) . '</strong>' ); 103 $errors[] = '<strong>' . esc_html__('You cannot delete this sidebar.', 'kopa-framework') . '</strong>'; 104 104 } 105 105 … … 135 135 class="kopa-textbox" 136 136 placeholder="<?php echo esc_html__('Search...', 'upside'); ?>" 137 onkeyup="Kopa_ Icon_Picker.filter_icons(event, jQuery(this));">137 onkeyup="Kopa_UI_Icon.filter_icons(event, jQuery(this));"> 138 138 </div> 139 139 <div class="kopa-row kopa-wrap"> 140 140 <?php foreach($icons as $key => $val): ?> 141 <span class="kopa-icon-item kopa-col-xs-2" onclick="Kopa_ Icon_Picker.select_a_icon(event, jQuery(this));">141 <span class="kopa-icon-item kopa-col-xs-2" onclick="Kopa_UI_Icon.select_a_icon(event, jQuery(this));"> 142 142 <i class="<?php echo esc_attr($key); ?>" data-title="<?php echo esc_attr($val); ?>"></i> 143 143 </span> -
kopatheme/trunk/includes/kopa-fonts-functions.php
r1353276 r1490791 12510 12510 array ( 12511 12511 'style' => '100', 12512 'label' => __( 'Thin', 'kopa-framework' ),12512 'label' => esc_html__( 'Thin', 'kopa-framework' ), 12513 12513 ), 12514 12514 array ( 12515 12515 'style' => '100italic', 12516 'label' => __( 'Thin/Italic', 'kopa-framework' ),12516 'label' => esc_html__( 'Thin/Italic', 'kopa-framework' ), 12517 12517 ), 12518 12518 array ( 12519 12519 'style' => '200', 12520 'label' => __( 'Extra-Light', 'kopa-framework' ),12520 'label' => esc_html__( 'Extra-Light', 'kopa-framework' ), 12521 12521 ), 12522 12522 array ( 12523 12523 'style' => '200italic', 12524 'label' => __( 'Extra-Light/Italic', 'kopa-framework' ),12524 'label' => esc_html__( 'Extra-Light/Italic', 'kopa-framework' ), 12525 12525 ), 12526 12526 array ( 12527 12527 'style' => '300', 12528 'label' => __( 'Light', 'kopa-framework' ),12528 'label' => esc_html__( 'Light', 'kopa-framework' ), 12529 12529 ), 12530 12530 array ( 12531 12531 'style' => '300italic', 12532 'label' => __( 'Light/Italic', 'kopa-framework' ),12532 'label' => esc_html__( 'Light/Italic', 'kopa-framework' ), 12533 12533 ), 12534 12534 array ( 12535 12535 'style' => '400', 12536 'label' => __( 'Normal', 'kopa-framework' ),12536 'label' => esc_html__( 'Normal', 'kopa-framework' ), 12537 12537 ), 12538 12538 array ( 12539 12539 'style' => '400italic', 12540 'label' => __( 'Normal/Italic', 'kopa-framework' ),12540 'label' => esc_html__( 'Normal/Italic', 'kopa-framework' ), 12541 12541 ), 12542 12542 array ( 12543 12543 'style' => 'regular', 12544 'label' => __( 'Normal', 'kopa-framework' ),12544 'label' => esc_html__( 'Normal', 'kopa-framework' ), 12545 12545 ), 12546 12546 array ( 12547 12547 'style' => 'italic', 12548 'label' => __( 'Normal/Italic', 'kopa-framework' ),12548 'label' => esc_html__( 'Normal/Italic', 'kopa-framework' ), 12549 12549 ), 12550 12550 array ( 12551 12551 'style' => '500', 12552 'label' => __( 'Medium', 'kopa-framework' ),12552 'label' => esc_html__( 'Medium', 'kopa-framework' ), 12553 12553 ), 12554 12554 array ( 12555 12555 'style' => '500italic', 12556 'label' => __( 'Medium/Italic', 'kopa-framework' ),12556 'label' => esc_html__( 'Medium/Italic', 'kopa-framework' ), 12557 12557 ), 12558 12558 array ( 12559 12559 'style' => '600', 12560 'label' => __( 'Semi-Bold', 'kopa-framework' ),12560 'label' => esc_html__( 'Semi-Bold', 'kopa-framework' ), 12561 12561 ), 12562 12562 array ( 12563 12563 'style' => '600italic', 12564 'label' => __( 'Semi-Bold/Italic', 'kopa-framework' ),12564 'label' => esc_html__( 'Semi-Bold/Italic', 'kopa-framework' ), 12565 12565 ), 12566 12566 array ( 12567 12567 'style' => '700', 12568 'label' => __( 'Bold', 'kopa-framework' ),12568 'label' => esc_html__( 'Bold', 'kopa-framework' ), 12569 12569 ), 12570 12570 array ( 12571 12571 'style' => '700italic', 12572 'label' => __( 'Bold/Italic', 'kopa-framework' ),12572 'label' => esc_html__( 'Bold/Italic', 'kopa-framework' ), 12573 12573 ), 12574 12574 array ( 12575 12575 'style' => 'bold', 12576 'label' => __( 'Bold', 'kopa-framework' ),12576 'label' => esc_html__( 'Bold', 'kopa-framework' ), 12577 12577 ), 12578 12578 array ( 12579 12579 'style' => 'bolditalic', 12580 'label' => __( 'Bold/Italic', 'kopa-framework' ),12580 'label' => esc_html__( 'Bold/Italic', 'kopa-framework' ), 12581 12581 ), 12582 12582 array ( 12583 12583 'style' => '800', 12584 'label' => __( 'Extra-Bold', 'kopa-framework' ),12584 'label' => esc_html__( 'Extra-Bold', 'kopa-framework' ), 12585 12585 ), 12586 12586 array ( 12587 12587 'style' => '800italic', 12588 'label' => __( 'Extra-Bold/Italic', 'kopa-framework' ),12588 'label' => esc_html__( 'Extra-Bold/Italic', 'kopa-framework' ), 12589 12589 ), 12590 12590 array ( 12591 12591 'style' => '900', 12592 'label' => __( 'Ultra-Bold', 'kopa-framework' ),12592 'label' => esc_html__( 'Ultra-Bold', 'kopa-framework' ), 12593 12593 ), 12594 12594 array ( 12595 12595 'style' => '900italic', 12596 'label' => __( 'Ultra-Bold/Italic', 'kopa-framework' ),12596 'label' => esc_html__( 'Ultra-Bold/Italic', 'kopa-framework' ), 12597 12597 ), 12598 12598 ) ); -
kopatheme/trunk/kopa-framework.php
r1486248 r1490791 3 3 * Plugin Name: Kopa Framework 4 4 * Description: A WordPress framework by Kopatheme. 5 * Version: 1.2. 15 * Version: 1.2.5 6 6 * Author: Kopa Theme 7 7 * Author URI: http://kopatheme.com … … 25 25 * @copyright 2014 Kopatheme 26 26 * @license GPLv2 or later 27 * @version 1. 0.1027 * @version 1.2.5 28 28 * @package KopaFramework 29 29 * @link http://kopatheme.com … … 35 35 * @var string framework version 36 36 */ 37 public $version = '1.2. 0';37 public $version = '1.2.5'; 38 38 39 39 /** … … 156 156 add_filter( 'kopa_enable_admin_help_tab', '__return_false' ); 157 157 158 159 160 161 162 163 164 165 166 167 168 158 #metabox-custom-wrap 159 $is_metabox_wrapper = apply_filters('kopa_admin_metabox_wrapper', true); 160 if ( $is_metabox_wrapper ) { 161 add_filter('kopa_admin_meta_box_wrap_start', array( $this, 'meta_box_wrap_start' ), 10, 3); 162 add_filter('kopa_admin_meta_box_wrap_end', array( $this, 'meta_box_wrap_end' ), 10, 3); 163 } 164 165 $advanced_field = apply_filters('kopa_admin_metabox_advanced_field', false); 166 if ( $advanced_field ) { 167 add_filter('kopa_sanitize_option_datetime', array($this, 'kopa_sanitize_option_datetime'), 10, 2); 168 } 169 169 } 170 170 -
kopatheme/trunk/languages/kopa-framework-en_US.pot
r1486248 r1490791 4 4 "Project-Id-Version: Kopa Framework\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2016-0 8-18 10:03+0700\n"6 "POT-Creation-Date: 2016-09-01 10:00+0700\n" 7 7 "PO-Revision-Date: 2015-05-17 23:17+0700\n" 8 8 "Last-Translator: thanh4890 <[email protected]>\n" … … 16 16 "X-Poedit-SourceCharset: UTF-8\n" 17 17 "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" 18 "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" 18 "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;" 19 "esc_html__;esc_html_e;esc_attr__;esc_attr_e\n" 19 20 "X-Poedit-Basepath: ..\n" 20 21 "X-Textdomain-Support: yes\n" 21 22 "X-Poedit-SearchPath-0: .\n" 22 23 23 #: includes/admin/class-kopa-admin-assets.php:1 4024 #: includes/admin/fields/field_font.php: 9524 #: includes/admin/class-kopa-admin-assets.php:160 25 #: includes/admin/fields/field_font.php:89 25 26 msgid "Enter font name" 26 27 msgstr "" 27 28 28 #: includes/admin/class-kopa-admin-assets.php:1 4229 #: includes/admin/class-kopa-admin-assets.php:162 29 30 msgid "Custom font" 30 31 msgstr "" 31 32 32 #: includes/admin/class-kopa-admin-assets.php:1 4633 #: includes/admin/fields/field_font.php: 10033 #: includes/admin/class-kopa-admin-assets.php:166 34 #: includes/admin/fields/field_font.php:94 34 35 msgid "Upload .woff font file" 35 36 msgstr "" 36 37 37 #: includes/admin/class-kopa-admin-assets.php:1 5138 #: includes/admin/fields/field_font.php: 10538 #: includes/admin/class-kopa-admin-assets.php:171 39 #: includes/admin/fields/field_font.php:99 39 40 msgid "Upload .ttf font file" 40 41 msgstr "" 41 42 42 #: includes/admin/class-kopa-admin-assets.php:1 5643 #: includes/admin/fields/field_font.php:1 1043 #: includes/admin/class-kopa-admin-assets.php:176 44 #: includes/admin/fields/field_font.php:104 44 45 msgid "Upload .eot font file" 45 46 msgstr "" 46 47 47 #: includes/admin/class-kopa-admin-assets.php:1 6148 #: includes/admin/fields/field_font.php:1 1548 #: includes/admin/class-kopa-admin-assets.php:181 49 #: includes/admin/fields/field_font.php:109 49 50 msgid "Upload .svg font file" 50 51 msgstr "" 51 52 52 #: includes/admin/class-kopa-admin-assets.php:1 6653 #: includes/admin/class-kopa-admin-assets.php:189 53 54 msgid "Upload" 54 55 msgstr "" 55 56 56 #: includes/admin/class-kopa-admin-assets.php:1 6757 #: includes/admin/class-kopa-admin-assets.php:190 57 58 msgid "Remove" 58 59 msgstr "" 59 60 60 #: includes/admin/class-kopa-admin-assets.php:1 6861 #: includes/admin/class-kopa-admin-assets.php:191 61 62 msgid "Click OK to reset. Any selected settings will be lost!" 62 63 msgstr "" 63 64 64 #: includes/admin/class-kopa-admin-assets.php:1 6965 #: includes/admin/class-kopa-admin-assets.php:192 65 66 msgid "Click OK to import. Any selected settings will be lost!" 66 67 msgstr "" 67 68 68 #: includes/admin/class-kopa-admin-assets.php:1 7069 #: includes/admin/class-kopa-admin-assets.php: 17869 #: includes/admin/class-kopa-admin-assets.php:193 70 #: includes/admin/class-kopa-admin-assets.php:203 70 71 msgid "Are you sure you want to delete?" 71 72 msgstr "" 72 73 73 #: includes/admin/class-kopa-admin-assets.php: 17574 #: includes/admin/class-kopa-admin-assets.php:200 74 75 msgid "Warning" 75 76 msgstr "" 76 77 77 #: includes/admin/class-kopa-admin-assets.php: 17678 #: includes/admin/class-kopa-admin-assets.php:201 78 79 msgid "Error" 79 80 msgstr "" 80 81 81 #: includes/admin/class-kopa-admin-assets.php: 17782 #: includes/admin/class-kopa-admin-assets.php:202 82 83 msgid "Info" 83 84 msgstr "" 84 85 85 #: includes/admin/class-kopa-admin-assets.php: 17986 #: includes/admin/class-kopa-admin-assets.php:204 86 87 msgid "Close" 87 88 msgstr "" 88 89 89 #: includes/admin/class-kopa-admin-assets.php: 18090 #: includes/admin/class-kopa-admin-assets.php:205 90 91 msgid "Delete" 91 92 msgstr "" 92 93 93 #: includes/admin/class-kopa-admin-assets.php: 18194 #: includes/admin/class-kopa-admin-assets.php:206 94 95 msgid "Advanced Settings" 95 96 msgstr "" 96 97 97 #: includes/admin/class-kopa-admin-assets.php: 18398 #: includes/admin/class-kopa-admin-assets.php:208 98 99 #: includes/admin/fields/field_sidebar_manager.php:33 99 100 msgid "Name" 100 101 msgstr "" 101 102 102 #: includes/admin/class-kopa-admin-assets.php: 184103 #: includes/admin/class-kopa-admin-assets.php:209 103 104 #: includes/admin/fields/field_sidebar_manager.php:34 104 105 msgid "Description" 105 106 msgstr "" 106 107 107 #: includes/admin/class-kopa-admin-assets.php: 185108 #: includes/admin/class-kopa-admin-assets.php:210 108 109 #: includes/admin/fields/field_sidebar_manager.php:35 109 110 msgid "Before Widget" 110 111 msgstr "" 111 112 112 #: includes/admin/class-kopa-admin-assets.php: 186113 #: includes/admin/class-kopa-admin-assets.php:211 113 114 #: includes/admin/fields/field_sidebar_manager.php:36 114 115 msgid "After Widget" 115 116 msgstr "" 116 117 117 #: includes/admin/class-kopa-admin-assets.php: 187118 #: includes/admin/class-kopa-admin-assets.php:212 118 119 #: includes/admin/fields/field_sidebar_manager.php:37 119 120 msgid "Before Title" 120 121 msgstr "" 121 122 122 #: includes/admin/class-kopa-admin-assets.php: 188123 #: includes/admin/class-kopa-admin-assets.php:213 123 124 #: includes/admin/fields/field_sidebar_manager.php:38 124 125 msgid "After Title" -
kopatheme/trunk/readme.txt
r1486248 r1490791 5 5 Requires at least: 4.1 6 6 Tested up to: 4.6 7 Stable tag: 1.2. 17 Stable tag: 1.2.5 8 8 License: GPLv2 or later 9 9 … … 21 21 22 22 == Changelog == 23 = 1.2.5 = 24 * Add new 4 fields: chosen, chosen_singular, repeater, repeater_link ( widget ) 25 26 = 1.2.4 = 27 * Tested up to: WordPress version 4.6 28 * Apply filter: "kopa_is_load_compiled_assets" 29 * Replace function __(), _e() by esc_html__(), esc_html_e() 30 31 = 1.2.3 = 32 * Add new 5 fields: chosen, chosen_singular, repeater, repeater_link, icon_picker ( metabox, theme-options ) 33 23 34 = 1.2.2 = 24 35 * Fix Advanced fields JS bug
Note: See TracChangeset
for help on using the changeset viewer.