Changeset 3440212
- Timestamp:
- 01/15/2026 10:09:20 AM (2 months ago)
- Location:
- youzify/trunk
- Files:
-
- 17 edited
-
class-youzify.php (modified) (1 diff)
-
includes/admin/class-youzify-admin.php (modified) (1 diff)
-
includes/public/assets/css/youzify-woocommerce.css (modified) (1 diff)
-
includes/public/assets/css/youzify-woocommerce.min.css (modified) (1 diff)
-
includes/public/assets/js/buddypress.js (modified) (1 diff)
-
includes/public/assets/js/buddypress.min.js (modified) (1 diff)
-
includes/public/core/class-youzify-account.php (modified) (1 diff)
-
includes/public/core/class-youzify-attachments.php (modified) (3 diffs)
-
includes/public/core/functions/live-preview/classes/LinkPreview.php (modified) (2 diffs)
-
includes/public/core/functions/youzify-general-functions.php (modified) (1 diff)
-
includes/public/core/reviews/class-youzify-reviews-query.php (modified) (1 diff)
-
includes/public/core/wall/class-youzify-functions.php (modified) (1 diff)
-
includes/public/core/woocommerce/class-youzify-wc-redirects.php (modified) (1 diff)
-
includes/public/core/woocommerce/class-youzify-wc-templates.php (modified) (3 diffs)
-
includes/public/core/woocommerce/youzify-woocommerce-functions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
youzify.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
youzify/trunk/class-youzify.php
r3257383 r3440212 38 38 add_action( 'bbp_init', array( self::$instance, 'bbpress_init' ) ); 39 39 add_action( 'woocommerce_init', array( self::$instance, 'woocommerce_init' ) ); 40 // self::$instance->woocommerce_init(); 40 41 41 42 // Include General Functions -
youzify/trunk/includes/admin/class-youzify-admin.php
r3257383 r3440212 1352 1352 wp_send_json_error( 1353 1353 array( 1354 'message' => __( 'Sorry! you are not allowed to perform this action.', ' sellzyo' )1354 'message' => __( 'Sorry! you are not allowed to perform this action.', 'youzify' ) 1355 1355 ) 1356 1356 ); -
youzify/trunk/includes/public/assets/css/youzify-woocommerce.css
r3166404 r3440212 50 50 background-color: transparent; 51 51 } 52 53 .youzify-wc-payment-methods-content > a.button { 54 font-weight: 600; 55 background-color: var(--yzfy-scheme-color); 56 border-radius: 5px; 57 color: var(--yzfy-scheme-text-color); 58 padding: 15px 25px; 59 font-size: 14px; 60 } 61 62 .youzify .youzify-wc-main-content table.shop_table td a.delete { 63 background-color: #E53935; 64 padding: 8px 15px; 65 border-radius: 50px; 66 color: #fff; 67 } 68 69 70 .youzify .youzify-wc-main-content table.shop_table td.payment-method-actions { 71 display: flex; 72 gap: 5px; 73 justify-content: center; 74 } 75 .youzify .youzify-wc-main-content table.shop_table td a.default { 76 padding: 8px 15px; 77 background-color: var(--yzfy-scheme-color); 78 border-radius: 50px; 79 color: var(--yzfy-scheme-text-color); 80 padding: 8px 15px; 81 } 82 52 83 53 84 .youzify .youzify-wc-main-content table.shop_table td a:hover { -
youzify/trunk/includes/public/assets/css/youzify-woocommerce.min.css
r3166404 r3440212 1 #youzify .youzify .youzify-wc-main-content table.shop_table{width:100%;overflow:hidden;border-radius:3px;margin:0 0 35px;background-color:#fff;padding:0!important;border:none!important;border-collapse:collapse}.youzify .youzify-wc-main-content table.shop_table t d a,.youzify .youzify-wc-main-content table.shop_table td a:hover,.youzify table:not(.wp-block-table) th{background-color:transparent}.youzify .youzify-wc-main-content table.shop_table th{padding:15px}.youzify .youzify-wc-main-content table.shop_table td{padding:25px 12px}.youzify .youzify-wc-main-content table.shop_table td,.youzify .youzify-wc-main-content table.shop_table th{margin:0;border:none;color:#939ba3;clear:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;line-height:24px;letter-spacing:0}.youzify .youzify-wc-main-content table.shop_table td img{width:50px;height:initial;border-radius:3px}.youzify .youzify-wc-main-content table.shop_table td a{color:#939ba3;font-size:var(--yzfy-primary-font-size);font-weight:600}.youzify .youzify-wc-main-content table.shop_table td.woocommerce-orders-table__cell-order-number a{font-size:12px;line-height:10px;border-radius:3px;padding:10px 15px;display:inline-block}#youzify .youzify .youzify-wc-main-content table.shop_table td a.view,#youzify .youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file{border:none;color:#939ba3;margin:0;float:none;min-width:inherit;font-size:11px;font-weight:600;overflow:hidden;line-height:30px;position:relative;border-radius:2px;display:inline-block;padding:0 12px 0 40px;background-color:#f9f9f9;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.youzify .youzify-wc-main-content table.shop_table td a.view:before,.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before{top:0;left:0;bottom:0;width:30px;background:#eee;text-align:center;position:absolute}.youzify .order-again a:before{content:'\f2f1'}.youzify .order-again a{width:100%;padding:23px;color:#a0a0a0;font-size:var(--yzfy-primary-font-size);font-weight:600;clear:both;margin-bottom:30px;display:block;text-align:center;border-radius:3px;background-color:#fff}.youzify .order-again a:hover{color:#898989;background-color:#fff}.youzify .youzify-wc-edit-account-content .woocommerce-form-row{float:none;margin-bottom:20px}.youzify .youzify-wc-edit-account-content fieldset .woocommerce-form-row:last-of-type{margin-bottom:0}.youzify .youzify-wc-main-content .woocommerce .shop_table td .amount{font-weight:600}.youzify .youzify-wc-main-content .woocommerce .shop_table th{display:table-cell}.youzify .youzify-wc-main-content table.shop_table td a.view:before{content:'\f218'}.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before{content:'\f019'}.youzify .youzify-wc-main-content table.shop_table td a.view:before:hover,.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before:hover{background-color:#d0cfcf}.youzify .youzify-wc-main-content table.shop_table td a.remove{width:30px;height:30px;border:none;display:block;font-size:18px;line-height:30px;text-align:center;border-radius:100%;background:#f9f9f9;color:#939ba3!important}.youzify .youzify-wc-main-content table.shop_table td a.remove:hover{color:#fff!important;background-color:#fb6262}.youzify .youzify-wc-main-content table.account-orders-table tr:nth-child(even){background-color:rgba(249,249,249,.5)}.youzify .youzify-wc-main-content table.shop_table td a:hover{color:#606469}.youzify .youzify-wc-main-content table.shop_table tr{border:none;border-top:1px solid rgba(0,0,0,.02)}.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-remove-coupon{color:#fff;margin-left:5px;padding:5px 10px;border-radius:3px;background-color:#ff6363}.youzify .youzify-wc-main-content table.shop_table tr.cart-discount{background-color:#f9f9f9}.youzify .youzify-wc-main-content table.shop_table td input{border:1px solid #eee}.youzify .youzify-wc-main-content .cart_totals table.shop_table td{padding:15px 25px}.youzify .youzify-wc-main-content table.shop_table td.actions{padding:30px;background:0 0}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions button{float:right;height:40px;color:#fff;width:initial;min-width:auto;margin:0;padding:0 20px;font-weight:600}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions .coupon button{float:left}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions>button{color:#8b8b8b;background-color:#f2f2f2}.youzify .youzify-wc-main-content .cart_totals .order-total .amount{font-weight:600}.youzify .youzify-wc-main-content table.shop_table tbody td,.youzify .youzify-wc-main-content table.shop_table thead th{text-align:center}.youzify .youzify-wc-main-content #order_review table.shop_table tbody td,.youzify .youzify-wc-main-content #order_review table.shop_table thead th{text-align:left;border:none}.youzify .cart_totals h2,.youzify h2.woocommerce-order-details__title{display:none}#youzify .youzify table.cart td.actions .coupon .input-text{float:left;outline:0;width:80px;min-width:111px;height:40px;padding:0 12px;margin:0 4px 0 0;border:1px solid #eee}#youzify .youzify .wc-proceed-to-checkout a.checkout-button{width:100%;border:none;padding:20px;display:block;font-size:var(--yzfy-big-font-size);font-weight:600;text-align:center;margin:0 0 35px;border-radius:3px}.youzify .wc-proceed-to-checkout a.checkout-button:hover{opacity:.9}.youzify .youzify-wc-main-content table.shop_table td.actions button[name=update_cart]:before{content:'\f2f1'}.youzify .wc-proceed-to-checkout a.checkout-button:before{content:'\f07a'}.youzify .woocommerce-billing-fields>h3:before{content:'\f2bb';font-weight:200}.youzify .woocommerce-additional-fields>h3:before{content:'\f0fe'}.youzify #order_review_heading:before,.youzify .order-again a:before,.youzify .wc-proceed-to-checkout a.checkout-button:before,.youzify .woocommerce h3:before,.youzify .woocommerce-error::before,.youzify .woocommerce-info::before,.youzify .woocommerce-message::before,.youzify .youzify-wc-main-content table.shop_table td a:before,.youzify .youzify-wc-main-content table.shop_table td.actions button:before,.youzify p.cart-empty:before,.youzify p.woocommerce-thankyou-order-received:before{display:inline-block;font-family:"Font Awesome 5 Free"!important;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:8px;font-size:var(--yzfy-big-font-size)}.youzify p.cart-empty:before{width:101px;color:#777;height:80px;margin:auto auto 25px;display:block;font-size:90px;content:'\f291';font-weight:700;line-height:80px;text-align:center}.youzify p.cart-empty{color:#8b8b8b;font-size:var(--yzfy-big-font-size);margin-top:35px;text-align:center}.youzify .youzify-wc-main-content .return-to-shop{text-align:center;margin:35px 0}.youzify .youzify-wc-main-content .return-to-shop .button.wc-backward:hover{text-decoration:none}.youzify .youzify-wc-main-content .return-to-shop .button.wc-backward{border:none;color:#898989;margin:0 auto;font-size:var(--yzfy-primary-font-size);background:#fff;font-weight:600;line-height:18px;padding:12px 20px;border-radius:50px;display:inline-block;text-transform:uppercase}.youzify ul.woocommerce-thankyou-order-details+p{padding:15px;color:#898989;display:block;font-size:var(--yzfy-big-font-size);font-weight:600;background:#fff;line-height:18px;border-radius:2px;margin-bottom:35px;text-transform:none;border-left:5px solid}.youzify ul.woocommerce-thankyou-order-details+p a{color:#7c9cac}.youzify p.woocommerce-thankyou-order-received:before{color:#fff;width:30px;height:30px;font-size:var(--yzfy-primary-font-size);content:'\f00c';line-height:30px;text-align:center;margin-right:12px;border-radius:100%;display:inline-block;background:rgba(255,255,255,.2)}.youzify .woocommerce-pagination{margin-bottom:35px}.youzify .woocommerce-pagination a{margin:0;float:none;border:none;color:#898989;font-size:var(--yzfy-big-font-size);font-weight:600;padding:8px 15px;min-width:initial;border-radius:3px;display:inline-block;background-color:#fff}.youzify .woocommerce .cart-collaterals .cart_totals{width:50%;float:right;padding:0;margin:0}.youzify .woocommerce .cart-collaterals{margin:0;padding:0;background-color:transparent}.youzify .woocommerce .quantity .qty{padding:4px;width:3.631em;text-align:center}#add_payment_method .youzify .wc-proceed-to-checkout,.woocommerce-cart .youzify .wc-proceed-to-checkout,.woocommerce-checkout .youzify .wc-proceed-to-checkout{margin:0;padding:0}.woocommerce-page .youzify #content table.cart td.actions .coupon,.woocommerce-page .youzify table.cart td.actions .coupon,.youzify .woocommerce #content table.cart td.actions .coupon,.youzify .woocommerce table.cart td.actions .coupon{float:left}.woocommerce .woocommerce #content table.cart td.actions .coupon label,.woocommerce .woocommerce table.cart td.actions .coupon label,.woocommerce-page #content table.cart td.actions .coupon label,.woocommerce-page table.cart td.actions .coupon label{display:none}.youzify .youzify-wc-track-content .woocommerce p{color:#898989;font-size:var(--yzfy-big-font-size);line-height:24px;margin-bottom:20px}#youzify .edit-account,#youzify .woocommerce .track_order{padding:25px;border-radius:3px;margin-bottom:35px;background-color:#fff}.youzify .woocommerce-Address-title a.edit{height:35px;color:#fff;font-size:var(--yzfy-primary-font-size);min-width:95px;margin-left:10px;font-weight:600;line-height:35px;text-align:right;position:relative;padding:0 20px 0 0;border-radius:3px;vertical-align:middle;display:inline-block;background-color:#939ba3}.youzify .woocommerce-Address-title a.edit:before{left:0;width:35px;height:35px;content:"\f303";text-align:center;position:absolute;background-color:rgba(0,0,0,.1);display:inline-block;font-family:"Font Awesome 5 Free"!important;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:8px;font-size:var(--yzfy-big-font-size)}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) tbody td,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) tfoot th,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) thead th{text-align:left}.youzify .woocommerce-Address-title h3{margin-bottom:0}.youzify .woocommerce-Address{margin-bottom:20px}#youzify .youzify .woocommerce h3,#youzify .youzify .woocommerce-customer-details h2,#youzify .youzify .youzify-wc-box-title h3{padding:0 15px;font-size:var(--yzfy-primary-font-size);font-weight:600;min-height:35px;line-height:35px;border-radius:3px;display:inline-block;vertical-align:middle;background-color:var(--yzfy-scheme-color);color:var(--yzfy-scheme-text-color)}.edit-address #youzify .youzify div.woocommerce-Address{margin-bottom:35px;width:100%;border:none;float:none;padding:0}.youzify .woocommerce .woocommerce-billing-fields{margin-bottom:0}.youzify .woocommerce .woocommerce-checkout h3,.youzify .woocommerce-checkout .woocommerce-billing-fields h3{margin:0}.youzify .woocommerce-checkout .woocommerce-additional-fields__field-wrapper,.youzify .woocommerce-checkout .woocommerce-billing-fields__field-wrapper{padding:35px;border-radius:3px;margin-bottom:35px;background-color:#fff}#youzify .youzify .youzify-wc-main-content form .form-row label{margin:0 0 15px;display:block;color:#939ba3;clear:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;line-height:18px;letter-spacing:0}#youzify .youzify .youzify-wc-main-content form .form-row label .required,#youzify .youzify .youzify-wc-main-content form .form-row label span{color:#898989}#youzify .youzify .youzify-wc-main-content form .form-row input.input-text{padding:0 15px;min-height:45px}#youzify .youzify .youzify-wc-main-content form .form-row textarea{padding:15px}#youzify .youzify .youzify-wc-main-content form .form-row input.input-text,#youzify .youzify .youzify-wc-main-content form .form-row textarea{width:100%;margin:0;outline:0;color:#939ba3;font-size:var(--yzfy-primary-font-size);font-weight:600;border-radius:3px;height:initial;background:#f6f6f6;line-height:normal;box-sizing:border-box;border:1px solid #f3f3f3;font-family:var(--yzfy-font-family),sans-serif}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order .order-total span,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot .order-total,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot .order-total th,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table thead th{color:#fff}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table{border:none;border-collapse:collapse}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table td{padding:15px;border:none}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order tbody tr{background-color:#fff}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order .cart-subtotal{background-color:#f2f2f2}#youzify .youzify #add_payment_method #payment,#youzify .youzify .woocommerce-cart #payment,#youzify .youzify .woocommerce-checkout #payment{background:#fff;border:none;border-radius:5px;margin:0}#youzify .youzify #add_payment_method #payment ul.payment_methods,#youzify .youzify .woocommerce-cart #payment ul.payment_methods,#youzify .youzify .woocommerce-checkout #payment ul.payment_methods{padding:25px;border-bottom:1px solid #eaeaea}#youzify .youzify .woocommerce-error,#youzify .youzify .woocommerce-info,#youzify .youzify .woocommerce-message{border:none;color:#898989;font-size:var(--yzfy-big-font-size);position:relative;border-radius:2px;margin-bottom:35px;background-color:#fff;border-top:3px solid;padding:1em 2em 1em 3.5em;outline:0}#youzify .youzify .woocommerce-message a.restore-item,#youzify .youzify .woocommerce-message a.wc-forward{float:right;color:#898989;font-weight:600;background:0 0;41 #youzify .youzify .youzify-wc-main-content table.shop_table{width:100%;overflow:hidden;border-radius:3px;margin:0 0 35px;background-color:#fff;padding:0!important;border:none!important;border-collapse:collapse}.youzify .youzify-wc-main-content table.shop_table th{padding:15px}.youzify .youzify-wc-main-content table.shop_table td{padding:25px 12px}.youzify .youzify-wc-main-content table.shop_table td,.youzify .youzify-wc-main-content table.shop_table th{margin:0;border:none;color:#939ba3;clear:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;line-height:24px;letter-spacing:0}.youzify table:not(.wp-block-table) th{background-color:transparent}.youzify .youzify-wc-main-content table.shop_table td img{width:50px;height:initial;border-radius:3px}.youzify .youzify-wc-main-content table.shop_table td a{color:#939ba3;font-size:var(--yzfy-primary-font-size);font-weight:600;background-color:transparent}.youzify-wc-payment-methods-content>a.button{font-weight:600;background-color:var(--yzfy-scheme-color);border-radius:5px;color:var(--yzfy-scheme-text-color);padding:15px 25px;font-size:14px}.youzify .youzify-wc-main-content table.shop_table td a.delete{background-color:#E53935;padding:8px 15px;border-radius:50px;color:#fff}.youzify .youzify-wc-main-content table.shop_table td.payment-method-actions{display:flex;gap:5px;justify-content:center}.youzify .youzify-wc-main-content table.shop_table td a.default{background-color:var(--yzfy-scheme-color);border-radius:50px;color:var(--yzfy-scheme-text-color);padding:8px 15px}.youzify .youzify-wc-main-content table.shop_table td a:hover{background-color:transparent}.youzify .youzify-wc-main-content table.shop_table td.woocommerce-orders-table__cell-order-number a{font-size:12px;line-height:10px;border-radius:3px;padding:10px 15px;display:inline-block}#youzify .youzify .youzify-wc-main-content table.shop_table td a.view,#youzify .youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file{border:none;color:#939ba3;margin:0;float:none;min-width:inherit;font-size:11px;font-weight:600;overflow:hidden;line-height:30px;position:relative;border-radius:2px;display:inline-block;padding:0 12px 0 40px;background-color:#f9f9f9;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.youzify .youzify-wc-main-content table.shop_table td a.view:before,.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before{top:0;left:0;bottom:0;width:30px;background:#eee;text-align:center;position:absolute}.youzify .order-again a:before{content:'\f2f1'}.youzify .order-again a{width:100%;padding:23px;color:#a0a0a0;font-size:var(--yzfy-primary-font-size);font-weight:600;clear:both;margin-bottom:30px;display:block;text-align:center;border-radius:3px;background-color:#fff}.youzify .order-again a:hover{color:#898989;background-color:#fff}.youzify .youzify-wc-edit-account-content .woocommerce-form-row{float:none;margin-bottom:20px}.youzify .youzify-wc-edit-account-content fieldset .woocommerce-form-row:last-of-type{margin-bottom:0}.youzify .youzify-wc-main-content .woocommerce .shop_table td .amount{font-weight:600}.youzify .youzify-wc-main-content .woocommerce .shop_table th{display:table-cell}.youzify .youzify-wc-main-content table.shop_table td a.view:before{content:'\f218'}.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before{content:'\f019'}.youzify .youzify-wc-main-content table.shop_table td a.view:before:hover,.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before:hover{background-color:#d0cfcf}.youzify .youzify-wc-main-content table.shop_table td a.remove{width:30px;height:30px;border:none;display:block;font-size:18px;line-height:30px;text-align:center;border-radius:100%;background:#f9f9f9;color:#939ba3!important}.youzify .youzify-wc-main-content table.shop_table td a.remove:hover{color:#fff!important;background-color:#fb6262}.youzify .youzify-wc-main-content table.account-orders-table tr:nth-child(even){background-color:rgba(249,249,249,.5)}.youzify .youzify-wc-main-content table.shop_table td a:hover{color:#606469}.youzify .youzify-wc-main-content table.shop_table tr{border:none;border-top:1px solid rgba(0,0,0,.02)}.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-remove-coupon{color:#fff;margin-left:5px;padding:5px 10px;border-radius:3px;background-color:#ff6363}.youzify .youzify-wc-main-content table.shop_table tr.cart-discount{background-color:#f9f9f9}.youzify .youzify-wc-main-content table.shop_table td input{border:1px solid #eee}.youzify .youzify-wc-main-content .cart_totals table.shop_table td{padding:15px 25px}.youzify .youzify-wc-main-content table.shop_table td.actions{padding:30px;background:0 0}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions button{float:right;height:40px;color:#fff;width:initial;min-width:auto;margin:0;padding:0 20px;font-weight:600}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions .coupon button{float:left}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions>button{color:#8b8b8b;background-color:#f2f2f2}.youzify .youzify-wc-main-content .cart_totals .order-total .amount{font-weight:600}.youzify .youzify-wc-main-content table.shop_table tbody td,.youzify .youzify-wc-main-content table.shop_table thead th{text-align:center}.youzify .youzify-wc-main-content #order_review table.shop_table tbody td,.youzify .youzify-wc-main-content #order_review table.shop_table thead th{text-align:left;border:none}.youzify .cart_totals h2,.youzify h2.woocommerce-order-details__title{display:none}#youzify .youzify table.cart td.actions .coupon .input-text{float:left;outline:0;width:80px;min-width:111px;height:40px;padding:0 12px;margin:0 4px 0 0;border:1px solid #eee}#youzify .youzify .wc-proceed-to-checkout a.checkout-button{width:100%;border:none;padding:20px;display:block;font-size:var(--yzfy-big-font-size);font-weight:600;text-align:center;margin:0 0 35px;border-radius:3px}.youzify .wc-proceed-to-checkout a.checkout-button:hover{opacity:.9}.youzify .youzify-wc-main-content table.shop_table td.actions button[name=update_cart]:before{content:'\f2f1'}.youzify .wc-proceed-to-checkout a.checkout-button:before{content:'\f07a'}.youzify .woocommerce-billing-fields>h3:before{content:'\f2bb';font-weight:200}.youzify .woocommerce-additional-fields>h3:before{content:'\f0fe'}.youzify #order_review_heading:before,.youzify .order-again a:before,.youzify .wc-proceed-to-checkout a.checkout-button:before,.youzify .woocommerce h3:before,.youzify .woocommerce-error::before,.youzify .woocommerce-info::before,.youzify .woocommerce-message::before,.youzify .youzify-wc-main-content table.shop_table td a:before,.youzify .youzify-wc-main-content table.shop_table td.actions button:before,.youzify p.cart-empty:before,.youzify p.woocommerce-thankyou-order-received:before{display:inline-block;font-family:"Font Awesome 5 Free"!important;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:8px;font-size:var(--yzfy-big-font-size)}.youzify p.cart-empty:before{width:101px;color:#777;height:80px;margin:auto auto 25px;display:block;font-size:90px;content:'\f291';font-weight:700;line-height:80px;text-align:center}.youzify p.cart-empty{color:#8b8b8b;font-size:var(--yzfy-big-font-size);margin-top:35px;text-align:center}.youzify .youzify-wc-main-content .return-to-shop{text-align:center;margin:35px 0}.youzify .youzify-wc-main-content .return-to-shop .button.wc-backward:hover{text-decoration:none}.youzify .youzify-wc-main-content .return-to-shop .button.wc-backward{border:none;color:#898989;margin:0 auto;font-size:var(--yzfy-primary-font-size);background:#fff;font-weight:600;line-height:18px;padding:12px 20px;border-radius:50px;display:inline-block;text-transform:uppercase}.youzify ul.woocommerce-thankyou-order-details+p{padding:15px;color:#898989;display:block;font-size:var(--yzfy-big-font-size);font-weight:600;background:#fff;line-height:18px;border-radius:2px;margin-bottom:35px;text-transform:none;border-left:5px solid}.youzify ul.woocommerce-thankyou-order-details+p a{color:#7c9cac}.youzify p.woocommerce-thankyou-order-received:before{color:#fff;width:30px;height:30px;font-size:var(--yzfy-primary-font-size);content:'\f00c';line-height:30px;text-align:center;margin-right:12px;border-radius:100%;display:inline-block;background:rgba(255,255,255,.2)}.youzify .woocommerce-pagination{margin-bottom:35px}.youzify .woocommerce-pagination a{margin:0;float:none;border:none;color:#898989;font-size:var(--yzfy-big-font-size);font-weight:600;padding:8px 15px;min-width:initial;border-radius:3px;display:inline-block;background-color:#fff}.youzify .woocommerce .cart-collaterals .cart_totals{width:50%;float:right;padding:0;margin:0}.youzify .woocommerce .cart-collaterals{margin:0;padding:0;background-color:transparent}.youzify .woocommerce .quantity .qty{padding:4px;width:3.631em;text-align:center}#add_payment_method .youzify .wc-proceed-to-checkout,.woocommerce-cart .youzify .wc-proceed-to-checkout,.woocommerce-checkout .youzify .wc-proceed-to-checkout{margin:0;padding:0}.woocommerce-page .youzify #content table.cart td.actions .coupon,.woocommerce-page .youzify table.cart td.actions .coupon,.youzify .woocommerce #content table.cart td.actions .coupon,.youzify .woocommerce table.cart td.actions .coupon{float:left}.woocommerce .woocommerce #content table.cart td.actions .coupon label,.woocommerce .woocommerce table.cart td.actions .coupon label,.woocommerce-page #content table.cart td.actions .coupon label,.woocommerce-page table.cart td.actions .coupon label{display:none}.youzify .youzify-wc-track-content .woocommerce p{color:#898989;font-size:var(--yzfy-big-font-size);line-height:24px;margin-bottom:20px}#youzify .edit-account,#youzify .woocommerce .track_order{padding:25px;border-radius:3px;margin-bottom:35px;background-color:#fff}.youzify .woocommerce-Address-title a.edit{height:35px;color:#fff;font-size:var(--yzfy-primary-font-size);min-width:95px;margin-left:10px;font-weight:600;line-height:35px;text-align:right;position:relative;padding:0 20px 0 0;border-radius:3px;vertical-align:middle;display:inline-block;background-color:#939ba3}.youzify .woocommerce-Address-title a.edit:before{left:0;width:35px;height:35px;content:"\f303";text-align:center;position:absolute;background-color:rgba(0,0,0,.1);display:inline-block;font-family:"Font Awesome 5 Free"!important;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:8px;font-size:var(--yzfy-big-font-size)}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) tbody td,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) tfoot th,.youzify table.shop_table.order_details:not(.woocommerce-table--order-downloads) thead th{text-align:left}.youzify .woocommerce-Address-title h3{margin-bottom:0}.youzify .woocommerce-Address{margin-bottom:20px}#youzify .youzify .woocommerce h3,#youzify .youzify .woocommerce-customer-details h2,#youzify .youzify .youzify-wc-box-title h3{padding:0 15px;font-size:var(--yzfy-primary-font-size);font-weight:600;min-height:35px;line-height:35px;border-radius:3px;display:inline-block;vertical-align:middle;background-color:var(--yzfy-scheme-color);color:var(--yzfy-scheme-text-color)}.edit-address #youzify .youzify div.woocommerce-Address{margin-bottom:35px;width:100%;border:none;float:none;padding:0}.youzify .woocommerce .woocommerce-billing-fields{margin-bottom:0}.youzify .woocommerce .woocommerce-checkout h3,.youzify .woocommerce-checkout .woocommerce-billing-fields h3{margin:0}.youzify .woocommerce-checkout .woocommerce-additional-fields__field-wrapper,.youzify .woocommerce-checkout .woocommerce-billing-fields__field-wrapper{padding:35px;border-radius:3px;margin-bottom:35px;background-color:#fff}#youzify .youzify .youzify-wc-main-content form .form-row label{margin:0 0 15px;display:block;color:#939ba3;clear:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;line-height:18px;letter-spacing:0}#youzify .youzify .youzify-wc-main-content form .form-row label .required,#youzify .youzify .youzify-wc-main-content form .form-row label span{color:#898989}#youzify .youzify .youzify-wc-main-content form .form-row input.input-text{padding:0 15px;min-height:45px}#youzify .youzify .youzify-wc-main-content form .form-row textarea{padding:15px}#youzify .youzify .youzify-wc-main-content form .form-row input.input-text,#youzify .youzify .youzify-wc-main-content form .form-row textarea{width:100%;margin:0;outline:0;color:#939ba3;font-size:var(--yzfy-primary-font-size);font-weight:600;border-radius:3px;height:initial;background:#f6f6f6;line-height:normal;box-sizing:border-box;border:1px solid #f3f3f3;font-family:var(--yzfy-font-family),sans-serif}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order .order-total span,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot .order-total,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot .order-total th,.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table thead th{color:#fff}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table{border:none;border-collapse:collapse}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table td{padding:15px;border:none}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order tbody tr{background-color:#fff}.youzify .youzify-wc-main-content .woocommerce-checkout-review-order .cart-subtotal{background-color:#f2f2f2}#youzify .youzify #add_payment_method #payment,#youzify .youzify .woocommerce-cart #payment,#youzify .youzify .woocommerce-checkout #payment{background:#fff;border:none;border-radius:5px;margin:0}#youzify .youzify #add_payment_method #payment ul.payment_methods,#youzify .youzify .woocommerce-cart #payment ul.payment_methods,#youzify .youzify .woocommerce-checkout #payment ul.payment_methods{padding:25px;border-bottom:1px solid #eaeaea}#youzify .youzify .woocommerce-error,#youzify .youzify .woocommerce-info,#youzify .youzify .woocommerce-message{border:none;color:#898989;font-size:var(--yzfy-big-font-size);position:relative;border-radius:2px;margin-bottom:35px;background-color:#fff;border-top:3px solid;padding:1em 2em 1em 3.5em;outline:0}#youzify .youzify .woocommerce-message a.restore-item,#youzify .youzify .woocommerce-message a.wc-forward{float:right;color:#898989;font-weight:600;background:0 0;4 2 2 position:relative;min-width:initial;padding:0;margin:0;top:inherit;width:initial}#youzify .youzify .woocommerce-message a.restore-item:hover,#youzify .youzify .woocommerce-message a.wc-forward:hover{background:0 0}.rtl #youzify .youzify .woocommerce-message a.restore-item,.rtl #youzify .youzify .woocommerce-message a.wc-forward{float:left}.youzify .woocommerce-error::before,.youzify .woocommerce-info::before,.youzify .woocommerce-message::before{content:'\f2d0';display:inline-block;position:absolute;top:14px;left:18px}.youzify .woocommerce>.woocommerce-error,.youzify .woocommerce>.woocommerce-info,.youzify .woocommerce>.woocommerce-message{background-color:#fff}#youzify .youzify .woocommerce-message,#youzify .youzify p.woocommerce-notice{border-color:#1fc36a}#youzify p.woocommerce-notice.woocommerce-notice--success{border-color:#8BC34A}#youzify .woocommerce-message:before{color:#1fc36a}#youzify .youzify .woocommerce-info,#youzify .youzify p.woocommerce-notice.woocommerce-notice--info{border-color:#4fc1e9}.youzify p.woocommerce-notice{border-left:8px solid;background-color:#fff;margin-bottom:35px;padding:18px 20px;border-radius:3px;font-weight:600;font-size:var(--yzfy-primary-font-size);color:#898989}#youzify p.woocommerce-thankyou-order-received{background-color:#8bc34a;color:#fff}#youzify .woocommerce-info:before{color:#4fc1e9}#youzify .youzify .woocommerce-error,#youzify .youzify p.woocommerce-notice.woocommerce-notice--error{border-color:#f64d4d}#youzify .woocommerce-error:before{color:#f64d4d}#youzify .youzify .woocommerce .col2-set .col-1,#youzify .youzify .woocommerce .col2-set .col-2,#youzify .youzify .woocommerce-page .col2-set .col-1,#youzify .youzify .woocommerce-page .col2-set .col-2{float:none;width:100%;margin:0}.youzify .woocommerce-checkout{margin-bottom:35px}.youzify .woocommerce-checkout table.shop_table td,.youzify .woocommerce-checkout table.shop_table th{border:none}.youzify .youzify-wc-main-content .track_order .form-row button{float:left;height:45px;font-size:var(--yzfy-big-font-size);margin-top:10px;font-weight:600;line-height:14px;padding:12px 25px;background-color:var(--yzfy-scheme-color);color:var(--yzfy-scheme-text-color)}.youzify .woocommerce-page #payment #place_order,.youzify .youzify-wc-main-content #payment #place_order,.youzify .youzify-wc-main-content button[type=submit]{color:#fff;float:right;border:none;font-size:var(--yzfy-big-font-size);font-weight:600;line-height:14px;padding:15px 25px;border-radius:3px}#youzify .youzify #add_payment_method #payment div.form-row,#youzify .youzify .woocommerce-cart #payment div.form-row,#youzify .youzify .woocommerce-checkout #payment div.form-row{padding:25px;overflow:hidden}.youzify .woocommerce-form-coupon-toggle a{color:#7697a7;font-weight:600}.youzify .woocommerce-error .button,.youzify .woocommerce-error .wc-backward,.youzify .woocommerce-info .button,.youzify .woocommerce-message .button{float:right;color:#747474;font-size:var(--yzfy-primary-font-size);font-weight:600}.youzify .youzify-wc-main-content .form-row span em{color:#999;display:block;font-size:var(--yzfy-primary-font-size);margin-top:12px;padding:10px 12px;border-radius:3px;background:#f9f9f9;border-left:5px solid #bababa}.youzify .youzify-wc-main-content fieldset{padding:25px;margin-bottom:25px;border:1px solid #f2f2f2}#youzify .youzify .youzify-wc-main-content fieldset legend{margin:0;color:#888;border:none;width:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;padding:9px 15px;border-radius:3px;background-color:#f9f9f9}.youzify .youzify-wc-main-content form .form-row-wide{clear:both;margin-bottom:25px}.youzify .youzify-wc-main-content form .form-row .youzify .youzify-wc-main-content form .form-row:last-of-type{margin-bottom:0}#youzify .youzify-wc-main-content .checkout_coupon{border:none;padding:25px;overflow:hidden;border-radius:3px;margin-bottom:35px}.youzify .checkout_coupon{background-color:var(--yzfy-scheme-color);color:var(--yzfy-scheme-text-color)}.youzify .checkout_coupon p{font-size:var(--yzfy-big-font-size);font-weight:600;margin-bottom:20px}.youzify .youzify-wc-main-content form.checkout_coupon .form-row{padding:0;width:100%;margin-bottom:0;margin-right:8px}.youzify .youzify-wc-main-content form.checkout_coupon .form-row input{background-color:#fff;margin-bottom:15px;color:#898989;height:50px}.youzify .youzify-wc-main-content form.checkout_coupon .form-row .button{width:100%;height:50px;display:block;background:rgba(0,0,0,.09)}.youzify .youzify-wc-main-content form.checkout_coupon .form-row-last{float:none}#youzify .youzify #add_payment_method #payment ul.payment_methods li,#youzify .youzify .woocommerce-cart #payment ul.payment_methods li,#youzify .youzify .woocommerce-checkout #payment ul.payment_methods li{padding:0;border:none;color:#7a8188;font-size:var(--yzfy-big-font-size);font-weight:600;line-height:2.5}.youzify #add_payment_method #payment ul.payment_methods li img,.youzify .woocommerce-cart #payment ul.payment_methods li img,.youzify .woocommerce-checkout #payment ul.payment_methods li img{padding:0;box-shadow:none;position:relative;display:inline-block;vertical-align:middle;margin:-2px 0 0 .5em}.youzify .payment_method_stripe img{width:35px}#youzify .youzify .woocommerce-checkout #payment .wc_payment_method div.form-row{padding-bottom:0;margin-bottom:0}#youzify .youzify .woocommerce-checkout #payment .wc_payment_method div.form-row label{margin-bottom:8px}.youzify .youzify-wc-main-content #payment fieldset{background-color:#fff!important;padding:0;margin-top:15px;border-radius:5px;margin-bottom:10px}#youzify .youzify .woocommerce-checkout #payment .wc-stripe-elements-field,#youzify .youzify .woocommerce-checkout #payment .wc-stripe-iban-element-field{border:1px solid #eaeaea;margin:5px 0;padding:8px;background-color:#fff}.youzify #add_payment_method #payment .payment_method_paypal img,.youzify .woocommerce-cart #payment .payment_method_paypal img,.youzify .woocommerce-checkout #payment .payment_method_paypal img{max-height:52px}#youzify .youzify #add_payment_method #payment div.payment_box,#youzify .youzify .woocommerce-cart #payment div.payment_box,#youzify .youzify .woocommerce-checkout #payment div.payment_box{color:#898989;line-height:2.2;background-color:#f5f5f5;position:relative;box-sizing:border-box;width:100%;padding:1em;margin:1em 0;font-size:.92em;border-radius:2px}.youzify #add_payment_method #payment div.payment_box:before,.youzify .woocommerce-cart #payment div.payment_box:before,.youzify .woocommerce-checkout #payment div.payment_box:before{content:'';display:block;border:1em solid #f5f5f5;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}.youzify #add_payment_method #payment .payment_method_paypal .about_paypal,.youzify .woocommerce-cart #payment .payment_method_paypal .about_paypal,.youzify .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:right;color:#8b8b8b;font-size:11px;line-height:15px;padding:6px 12px;border-radius:3px;background:#f5f5f5;display:inline-block}.youzify #add_payment_method #payment div.payment_box a,.youzify .woocommerce-cart #payment div.payment_box a,.youzify .woocommerce-checkout #payment div.payment_box a{color:#7697a7;font-weight:600}#youzify .youzify .woocommerce #payment li.wc_payment_method input{width:initial;margin:0 5px 0 0;vertical-align:middle}.youzify .woocommerce #payment li.wc_payment_method label{font-weight:600;display:inline-block}.youzify #customer_details{margin:0;padding:0}.youzify .woocommerce-address-fields{padding:30px;border-radius:3px;margin-bottom:35px;background-color:#fff}.youzify .edit-account:after,.youzify .woocommerce .track_order:after,.youzify .woocommerce ul.order_details:after,.youzify .woocommerce-address-fields:after{content:"";clear:both;display:table}.youzify .woocommerce-address-fields .woocommerce-address-fields__field-wrapper{margin-bottom:25px}.youzify .youzify-wc-box-title{margin-bottom:25px;display:inline-block}.youzify .youzify-wc-box-title i{width:35px;float:left;height:35px;color:#898989;background:#fff;line-height:35px;margin-right:6px;text-align:center;border-radius:3px;vertical-align:middle}.youzify .woocommerce-customer-details{margin-bottom:35px}.youzify address .youzify-wc-address-item{margin-left:-6px}.youzify .youzify-wc-main-content address{border:none;padding:30px;border-radius:3px;font-style:initial;background-color:#fff}.youzify .youzify-wc-main-content address .youzify-wc-user-address{border-left:1px solid #f5f5f5}.youzify .youzify-wc-main-content address .youzify-wc-item-head i{width:20px;font-size:var(--yzfy-primary-font-size);margin-right:10px;text-align:center}.youzify .youzify-wc-main-content address .youzify-wc-item-head{margin:0;color:#939ba3;clear:initial;font-size:11px;font-weight:600;line-height:18px;letter-spacing:0;display:inline-block;vertical-align:middle;text-transform:uppercase}.youzify .youzify-wc-main-content address .youzify-wc-address-item .youzify-wc-address-value{padding:0;color:#898989;display:block;clear:initial;font-size:var(--yzfy-primary-font-size);font-weight:600;line-height:24px;letter-spacing:0;margin:10px 0 0 58px}.youzify .youzify-wc-main-content address .youzify-bullet{width:12px;height:12px;border:2px solid;margin-right:15px;border-radius:100%;display:inline-block;vertical-align:middle;background-color:#fff}.youzify-view-order .youzify-wc-main-content>p{border-left:8px solid;background-color:#fff;margin-bottom:35px;border-radius:5px;font-size:var(--yzfy-primary-font-size);color:#898989;padding:25px}.youzify-view-order .youzify-wc-main-content>p mark.order-number{background-color:transparent;font-weight:600;color:#898989}.youzify-view-order .youzify-wc-main-content>p mark.order-date{color:#898989;font-size:10px;font-weight:600;padding:5px 10px;border-radius:50px;background-color:#eee;text-transform:uppercase}.youzify-view-order .youzify-wc-main-content>p mark.order-status,body .youzify .wc-proceed-to-checkout a.checkout-button,body .youzify .wc-proceed-to-checkout a.checkout-button:hover,body .youzify .youzify-wc-main-content #payment #place_order,body .youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table tfoot .order-total,body .youzify .youzify-wc-main-content .woocommerce-checkout-review-order table.shop_table thead,body .youzify .youzify-wc-main-content button[type=submit],body .youzify .youzify-wc-main-content h3,body .youzify .youzify-wc-main-content table.shop_table td a.view:before,body .youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file:before,body .youzify .youzify-wc-main-content table.shop_table td.actions .coupon button,body .youzify .youzify-wc-main-content table.shop_table td.woocommerce-orders-table__cell-order-number a,body .youzify .youzify-wc-main-content table.shop_table thead,body .youzify table.shop_table.order_details tfoot tr:last-child{background-color:var(--yzfy-scheme-color);color:var(--yzfy-scheme-text-color)}.youzify-view-order .youzify-wc-main-content>p mark.order-status{font-size:10px;font-weight:600;padding:5px 10px;border-radius:4px;text-transform:uppercase}.youzify-view-order .youzify-wc-main-content .woocommerce-order-details__title,.youzify-wc-main-content .woocommerce-order-downloads .woocommerce-order-downloads__title{display:none}.youzify table.shop_table.order_details td{padding:15px}.youzify table.shop_table.order_details tr{border-top:1px solid rgba(0,0,0,.02)}.youzify table.shop_table.order_details tfoot tr:nth-child(1){background-color:#f8f8f8;border-bottom:1px solid rgba(0,0,0,.05)}.youzify .youzify-wc-main-content table.shop_table td{border-top:none}.youzify .youzify-wc-view-order-content table.shop_table .wc-item-meta-label,.youzify .youzify-wc-view-order-content table.shop_table .wc-item-meta-label+p{display:inline-block}.youzify .youzify-wc-view-order-content table.shop_table strong.wc-item-meta-label{font-size:11px;font-weight:600;padding:5px 8px;line-height:10px;margin-right:5px;border-radius:3px;display:inline-block;background-color:#eee;text-transform:uppercase}.youzify .woocommerce form .form-row-first{float:left}.youzify .woocommerce form .form-row-last{float:right}.youzify .woocommerce form .form-row-first,.youzify .woocommerce form .form-row-last,.youzify .woocommerce-page form .form-row-first,.youzify .woocommerce-page form .form-row-last{width:47%;overflow:visible;margin-bottom:25px}.youzify .woocommerce ul.order_details{padding:0 25px;margin:0 0 35px;list-style:none;background:#fff;border-radius:3px}.youzify .woocommerce ul.order_details li{float:left;line-height:1;color:#898989;padding-left:0;font-size:.715em;padding-right:20px;list-style-type:none;margin:25px 20px 25px 0;text-transform:uppercase;border-right:1px dashed #d3ced2}.youzify .woocommerce ul.order_details li:last-child{padding-right:0;border-right:none;margin-right:0;margin-bottom:0;padding-bottom:25px}.youzify .woocommerce ul.order_details li strong{display:block;font-size:var(--yzfy-big-font-size);margin-top:8px;font-weight:600;line-height:18px;text-transform:none}.youzify .woocommerce table.shop_table{border-collapse:collapse}.youzify .youzify-wc-main-content .checkout-steps{display:none}.youzify .checkout_coupon p,.youzify .youzify-wc-main-content table.shop_table td.actions .coupon button,.youzify .youzify-wc-main-content table.shop_table td.woocommerce-orders-table__cell-order-number a,.youzify .youzify-wc-main-content table.shop_table thead th,.youzify table.order_details tfoot tr:last-child td,.youzify table.order_details tfoot tr:last-child th{color:#fff}.woocommerce-privacy-policy-text{color:#898989;line-height:2.2;position:relative;box-sizing:border-box;width:100%;margin:0 0 15px;font-size:14px}.woocommerce-privacy-policy-text a{font-weight:600;color:#7a8188}.select2-dropdown{background-color:#fff;border:1px solid #eee}.select2-results__option{padding:8px;color:#787777;font-size:var(--yzfy-big-font-size);font-weight:600}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #eee;padding:7px}.youzify .woocommerce-address-fields select{width:100%}.youzify .select2-container--default .select2-selection--single,.youzify .woocommerce-address-fields select{background-color:#f6f6f6;border:1px solid #f3f3f3;border-radius:4px;height:45px;line-height:45px;padding:8px;font-size:var(--yzfy-big-font-size);font-weight:600;color:#898989}.youzify .select2-container--default .select2-selection--single .select2-selection__rendered{color:#a09ba3;line-height:28px}.youzify .select2-container--default .select2-selection--single .select2-selection__arrow{top:10px;right:10px}@media screen and (max-width:1024px){#youzify .edit-account,#youzify .woocommerce .track_order,#youzify .youzify .wc-proceed-to-checkout a.checkout-button,#youzify .youzify .woocommerce-error,#youzify .youzify .woocommerce-info,#youzify .youzify .woocommerce-message,#youzify .youzify .youzify-wc-main-content table.shop_table,#youzify .youzify-wc-main-content .checkout_coupon,.edit-address #youzify .youzify div.woocommerce-Address,.youzify .wc-proceed-to-checkout a.checkout-button,.youzify .woocommerce ul.order_details,.youzify .woocommerce-address-fields,.youzify .woocommerce-checkout .woocommerce-additional-fields__field-wrapper,.youzify .woocommerce-checkout .woocommerce-billing-fields__field-wrapper,.youzify .woocommerce-customer-details,.youzify .woocommerce-pagination,.youzify .youzify-wc-box-title,.youzify .youzify-wc-main-content table.shop_table,.youzify p.woocommerce-notice{margin-bottom:15px}.youzify .woocommerce-checkout .woocommerce-additional-fields__field-wrapper,.youzify .woocommerce-checkout .woocommerce-billing-fields__field-wrapper{padding:25px}}@media screen and (max-width:768px){.youzify .woocommerce .cart-collaterals .cart_totals{width:100%;float:none}}@media screen and (max-width:475px){#youzify .woocommerce table.shop_table_responsive tr.cart_item td,.woocommerce-page #youzify table.shop_table_responsive tr.cart_item td{text-align:left!important;padding:0;display:block;border:none;margin-bottom:20px;width:100%}.youzify .woocommerce form .form-row-first,.youzify .woocommerce form .form-row-last,.youzify .woocommerce-page form .form-row-first,.youzify .woocommerce-page form .form-row-last{width:100%}.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details th,.youzify table.account-orders-table th{display:none}.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details tr td,.youzify table.account-orders-table tr td{display:block}.youzify .woocommerce table.shop_table_responsive tr.cart_item td::before,.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details td::before,.youzify table.account-orders-table td::before{content:attr(data-title);float:none;color:#898989;font-weight:600;min-width:45px;font-size:11px;padding:8px 15px;line-height:11px;border-radius:2px;text-align:center;margin-bottom:15px;display:inline-block;background-color:#f5f5f5;text-transform:uppercase;border-left:4px solid #d0d0d0}.youzify .youzify-wc-main-content .woocommerce .cart-collaterals .shop_table th,.youzify .youzify-wc-main-content .woocommerce .woocommerce-cart-form__contents th{display:none}.youzify .woocommerce table.shop_table_responsive tr td::before{content:attr(data-title);font-weight:600;float:left}.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details tbody tr,.youzify table.account-orders-table tbody tr{padding:25px;display:block}.youzify .youzify-wc-main-content table.account-orders-table tr td,.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) .youzify-wc-main-content table.order_details tr td,.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details tbody tr td{line-height:15px;margin-bottom:20px}.youzify .woocommerce table.shop_table_responsive tr.cart_item td:last-child,.youzify .youzify-wc-main-content table.account-orders-table tr td:last-child,.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) .youzify-wc-main-content table.order_details tr td:last-child,.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.shop_table.order_details td:last-of-type{margin-bottom:0}.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.order_details td::before,.youzify table.account-orders-table td::before{width:fit-content;display:block}.youzify .youzify-wc-main-content:not(.youzify-wc-checkout-content) table.shop_table.order_details td{padding:0}.youzify .woocommerce table.shop_table_responsive tr td.actions::before,.youzify .woocommerce table.shop_table_responsive tr td.product-remove::before,.youzify .woocommerce table.shop_table_responsive tr td.product-thumbnail::before,.youzify table.shop_table_responsive tr td.woocommerce-orders-table__cell-order-number::before{display:none!important}.youzify .woocommerce table.shop_table_responsive tr.cart_item{padding:25px;display:block}.youzify .woocommerce table.shop_table_responsive tr td>a,.youzify .woocommerce table.shop_table_responsive tr td>div,.youzify .woocommerce table.shop_table_responsive tr td>span{display:block;width:initial}.youzify .woocommerce #content table.cart td.actions .coupon,.youzify .woocommerce table.cart td.actions .coupon,.youzify table.cart td.actions .coupon .input-text{float:none}.youzify table.cart td.actions .coupon{padding:0;margin-bottom:15px}.youzify table.cart td.actions .coupon .input-text{width:100%;padding:15px;min-height:50px;border-radius:2px;margin-bottom:15px}.youzify table.cart td.actions .button,.youzify table.cart td.actions .coupon .button{float:none;width:100%;min-height:50px}.youzify .youzify-wc-main-content table.shop_table td.actions{padding:30px;overflow:hidden}.youzify .youzify-wc-main-content .cart-collaterals table.shop_table tbody td{text-align:right}.youzify .youzify-wc-main-content table.shop_table tbody td,.youzify .youzify-wc-main-content table.shop_table thead th{text-align:left}.youzify .youzify-wc-main-content table.account-orders-table td{padding:0}.youzify .woocommerce-page #payment #place_order,.youzify .youzify-wc-main-content #payment #place_order,.youzify .youzify-wc-main-content button[type=submit]{width:100%;height:50px}#youzify .woocommerce table.shop_table_responsive tr.cart_item td:last-of-type,.woocommerce-page #youzify table.shop_table_responsive tr.cart_item td:last-of-type{margin-bottom:0}#youzify .youzify table.cart td.actions .coupon .input-text{width:100%;margin-bottom:12px;float:none}#youzify .youzify .youzify-wc-main-content table.shop_table td.actions .coupon button,#youzify .youzify .youzify-wc-main-content table.shop_table td.actions>button{float:none;width:100%}}@media screen and (max-width:425px){.youzify .woocommerce-address-fields button[type=submit],.youzify .youzify-wc-main-content #payment #place_order{width:100%;height:50px}.youzify p.woocommerce-notice{padding:12px}.youzify .woocommerce ul.order_details li{border:none;width:100%;margin-bottom:0;padding:0 0 0 10px;border-left:1px dashed #d3ced2}.youzify .woocommerce ul.order_details li:last-child{padding-bottom:0;margin-bottom:25px}.youzify .youzify-wc-main-content table.shop_table td a.view,.youzify .youzify-wc-main-content table.shop_table td a.woocommerce-MyAccount-downloads-file{font-size:var(--yzfy-primary-font-size)}}@media screen and (max-width:375px){.youzify .youzify-wc-main-content .track_order .form-row button{width:100%}.youzify .woocommerce-checkout .woocommerce-additional-fields__field-wrapper,.youzify .woocommerce-checkout .woocommerce-billing-fields__field-wrapper{padding:25px}.youzify p.cart-empty{margin-top:20px}.youzify .edit-account,.youzify .wc-proceed-to-checkout a.checkout-button,.youzify .woocommerce .track_order,.youzify .woocommerce ul.order_details,.youzify .woocommerce-address-fields,.youzify .woocommerce-customer-details,.youzify .woocommerce-pagination,.youzify .youzify-wc-box-title,.youzify .youzify-wc-main-content table.shop_table,.youzify p.woocommerce-notice{margin-bottom:15px}} -
youzify/trunk/includes/public/assets/js/buddypress.js
r3257383 r3440212 533 533 534 534 /* Comment / comment reply links */ 535 if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) { 536 if ( target.parent().hasClass('acomment-reply') ) { 537 target = target.parent(); 538 } 539 540 id = target.attr('id'); 541 ids = id.split('-'); 542 543 a_id = ids[2]; 544 c_id = target.attr('href').substr( 10, target.attr('href').length ); 545 // alert('heros') 546 form = activity.find( '#ac-form-' + a_id ); 547 548 form.css( 'display', 'none' ); 549 form.removeClass('root'); 550 jq('.ac-form').hide(); 551 552 /* Hide any error messages */ 553 form.children('div').each( function() { 554 if ( jq(this).hasClass( 'error' ) ) { 555 jq(this).hide(); 556 } 557 }); 558 559 if ( ids[1] !== 'comment' ) { 560 activity.find('#acomment-' + c_id).append( form ); 561 } else { 562 activity.find('#activity-' + a_id + ' .activity-comments').append( form ); 563 } 564 565 if ( form.parent().hasClass( 'activity-comments' ) ) { 566 form.addClass('root'); 567 } 568 569 form.slideDown( 200 ); 570 jq.scrollTo( form, 500, { 571 offset:-100, 572 easing:'swing' 573 } ); 574 activity.find('#ac-form-' + ids[2] + ' textarea').focus(); 575 576 return false; 577 } 535 // if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') || target.closest('.acomment-reply').length ) { 536 // if ( target.parent().hasClass('acomment-reply') ) { 537 // target = target.parent(); 538 // } 539 // id = target.attr('id'); 540 // ids = id.split('-'); 541 542 // a_id = ids[2]; 543 // c_id = target.attr('href').substr( 10, target.attr('href').length ); 544 // // alert('heros') 545 // form = activity.find( '#ac-form-' + a_id ); 546 547 // form.css( 'display', 'none' ); 548 // form.removeClass('root'); 549 // jq('.ac-form').hide(); 550 551 // /* Hide any error messages */ 552 // form.children('div').each( function() { 553 // if ( jq(this).hasClass( 'error' ) ) { 554 // jq(this).hide(); 555 // } 556 // }); 557 558 // if ( ids[1] !== 'comment' ) { 559 // activity.find('#acomment-' + c_id).append( form ); 560 // } else { 561 // activity.find('#activity-' + a_id + ' .activity-comments').append( form ); 562 // } 563 564 // if ( form.parent().hasClass( 'activity-comments' ) ) { 565 // form.addClass('root'); 566 // } 567 568 // form.slideDown( 200 ); 569 // jq.scrollTo( form, 500, { 570 // offset:-100, 571 // easing:'swing' 572 // } ); 573 // activity.find('#ac-form-' + ids[2] + ' textarea').focus(); 574 575 // return false; 576 // } 577 const replyElement = target.closest('.acomment-reply'); 578 579 if (replyElement.length) { 580 // Ensure 'target' is always the .acomment-reply element itself 581 target = replyElement; 582 583 id = target.attr('id'); 584 ids = id.split('-'); 585 586 a_id = ids[2]; 587 c_id = target.attr('href').substring(10); // cleaner way to slice 588 589 form = activity.find('#ac-form-' + a_id); 590 591 form.css('display', 'none'); 592 form.removeClass('root'); 593 jq('.ac-form').hide(); 594 595 // Hide any error messages 596 form.children('div').each(function() { 597 if (jq(this).hasClass('error')) { 598 jq(this).hide(); 599 } 600 }); 601 602 if (ids[1] !== 'comment') { 603 activity.find('#acomment-' + c_id).append(form); 604 } else { 605 activity.find('#activity-' + a_id + ' .activity-comments').append(form); 606 } 607 608 if (form.parent().hasClass('activity-comments')) { 609 form.addClass('root'); 610 } 611 612 form.slideDown(200); 613 614 jq.scrollTo(form, 500, { 615 offset: -100, 616 easing: 'swing' 617 }); 618 619 activity.find('#ac-form-' + ids[2] + ' textarea').focus(); 620 621 return false; 622 } 578 623 579 624 /* Activity comment posting */ -
youzify/trunk/includes/public/assets/js/buddypress.min.js
r3257383 r3440212 1 /* jshint undef: false, unused:false */ 2 /* @version 3.0.0 */ 3 // AJAX Functions 4 var jq = jQuery; 5 6 // Global variable to prevent multiple AJAX requests 7 var bp_ajax_request = null; 8 9 // Global variables to temporarily store newest activities 10 var newest_activities = ''; 11 var activity_last_recorded = 0; 12 13 var directoryPreferences = {}; 14 15 jq(document).ready( function() { 16 var activity_oldestpage = 1; 17 18 // Bail if not set 19 if ( typeof BP_DTheme === 'undefined' ) { 20 return; 21 } 22 23 /**** Page Load Actions *******************************************************/ 24 25 /* Activity filter and scope set */ 26 bp_init_activity(); 27 28 var objects = [ 'members', 'groups', 'blogs', 'group_members' ], 29 $whats_new = jq('#whats-new'); 30 31 /* Object filter and scope set. */ 32 bp_init_objects( objects ); 33 34 /* @mention Compose Scrolling */ 35 if ( $whats_new.length && bp_get_querystring('r') ) { 36 var $member_nicename = $whats_new.val(); 37 38 jq('#whats-new-options').slideDown(); 39 40 $whats_new.animate({ 41 height:'3.8em' 42 }); 43 44 jq.scrollTo( $whats_new, 500, { 45 offset:-125, 46 easing:'swing' 47 } ); 48 49 $whats_new.val('').focus().val( $member_nicename ); 50 } else { 51 jq('#whats-new-options').hide(); 52 } 53 54 /**** Activity Posting ********************************************************/ 55 56 /* Textarea focus */ 57 $whats_new.focus( function(){ 58 jq( '#whats-new-options' ).slideDown(); 59 60 jq( this ).animate({ 61 height:'3.8em' 62 }); 63 64 jq('#aw-whats-new-submit').prop('disabled', false); 65 66 jq( this ).parent().addClass( 'active' ); 67 jq( '#whats-new-content' ).addClass( 'active' ); 68 69 var $whats_new_form = jq('form#whats-new-form'), 70 $activity_all = jq( '#activity-all' ); 71 72 if ( $whats_new_form.hasClass('submitted') ) { 73 $whats_new_form.removeClass('submitted'); 74 } 75 76 // Return to the 'All Members' tab and 'Everything' filter, 77 // to avoid inconsistencies with the heartbeat integration 78 if ( $activity_all.length ) { 79 if ( ! $activity_all.hasClass( 'selected' ) ) { 80 // reset to everything 81 jq( '#activity-filter-select select' ).val( '-1' ); 82 $activity_all.children( 'a' ).trigger( 'click' ); 83 } else if ( '-1' !== jq( '#activity-filter-select select' ).val() ) { 84 jq( '#activity-filter-select select' ).val( '-1' ); 85 jq( '#activity-filter-select select' ).trigger( 'change' ); 86 } 87 } 88 }); 89 90 /* For the "What's New" form, do the following on focusout. */ 91 jq( '#whats-new-form' ).on( 'focusout', function( e ) { 92 var elem = jq( this ); 93 94 // Let child hover actions passthrough. 95 // This allows click events to go through without focusout. 96 setTimeout( function () { 97 if ( ! elem.find(':hover').length ) { 98 // Do not slide up if textarea has content. 99 if ( '' !== $whats_new.val() ) { 100 return; 101 } 102 103 $whats_new.animate({ 104 height:'2.2em' 105 }); 106 107 jq( '#whats-new-options' ).slideUp(); 108 109 jq('#aw-whats-new-submit').prop( 'disabled', true ); 110 111 jq( '#whats-new-content' ).removeClass( 'active' ); 112 $whats_new.parent().removeClass( 'active' ); 113 } 114 }, 0 ); 115 } ); 116 117 /* New posts */ 118 jq('#aw-whats-new-submit').on( 'click', function() { 119 var last_date_recorded = 0, 120 button = jq(this), 121 form = button.closest('form#whats-new-form'), 122 inputs = {}, post_data; 123 124 // Get all inputs and organize them into an object {name: value} 125 jq.each( form.serializeArray(), function( key, input ) { 126 // Only include public extra data 127 if ( '_' !== input.name.substr( 0, 1 ) && 'whats-new' !== input.name.substr( 0, 9 ) ) { 128 if ( ! inputs[ input.name ] ) { 129 inputs[ input.name ] = input.value; 130 } else { 131 // Checkboxes/dropdown list can have multiple selected value 132 if ( ! jq.isArray( inputs[ input.name ] ) ) { 133 inputs[ input.name ] = new Array( inputs[ input.name ], input.value ); 134 } else { 135 inputs[ input.name ].push( input.value ); 136 } 137 } 138 } 139 } ); 140 141 form.find( '*' ).each( function() { 142 if ( jq.nodeName( this, 'textarea' ) || jq.nodeName( this, 'input' ) ) { 143 jq(this).prop( 'disabled', true ); 144 } 145 } ); 146 147 /* Remove any errors */ 148 jq('div.error').remove(); 149 button.addClass('loading'); 150 button.prop('disabled', true); 151 form.addClass('submitted'); 152 153 /* Default POST values */ 154 object = ''; 155 item_id = jq('#whats-new-post-in').val(); 156 content = jq('#whats-new').val(); 157 firstrow = jq( '#youzify ul.activity-list li' ).first(); 158 activity_row = firstrow; 159 timestamp = null; 160 161 // Checks if at least one activity exists 162 if ( firstrow.length ) { 163 164 if ( activity_row.hasClass( 'load-newest' ) ) { 165 activity_row = firstrow.next(); 166 } 167 168 timestamp = activity_row.prop( 'class' ).match( /date-recorded-([0-9]+)/ ); 169 } 170 171 if ( timestamp ) { 172 last_date_recorded = timestamp[1]; 173 } 174 175 /* Set object for non-profile posts */ 176 if ( item_id > 0 ) { 177 object = jq('#whats-new-post-object').val(); 178 } 179 180 post_data = jq.extend( { 181 action: 'post_update', 182 'cookie': bp_get_cookies(), 183 '_wpnonce_post_update': jq('#_wpnonce_post_update').val(), 184 'content': content, 185 'object': object, 186 'item_id': item_id, 187 'since': last_date_recorded, 188 '_bp_as_nonce': jq('#_bp_as_nonce').val() || '' 189 }, inputs ); 190 191 jq.post( ajaxurl, post_data, function( response ) { 192 form.find( '*' ).each( function() { 193 if ( jq.nodeName( this, 'textarea' ) || jq.nodeName( this, 'input' ) ) { 194 jq(this).prop( 'disabled', false ); 195 } 196 }); 197 198 /* Check for errors and append if found. */ 199 if ( response[0] + response[1] === '-1' ) { 200 form.prepend( response.substr( 2, response.length ) ); 201 jq( '#' + form.attr('id') + ' div.error').hide().fadeIn( 200 ); 202 } else { 203 if ( 0 === jq('ul.activity-list').length ) { 204 jq('div.error').slideUp(100).remove(); 205 jq('#message').slideUp(100).remove(); 206 jq('div.activity').append( '<ul id="activity-stream" class="activity-list item-list">' ); 207 } 208 209 if ( firstrow.hasClass( 'load-newest' ) ) { 210 firstrow.remove(); 211 } 212 213 jq('#activity-stream').prepend(response); 214 215 if ( ! last_date_recorded ) { 216 jq('#activity-stream li:first').addClass('new-update just-posted'); 217 } 218 219 if ( 0 !== jq('#latest-update').length ) { 220 var l = jq('#activity-stream li.new-update .activity-content .activity-inner p').html(), 221 v = jq('#activity-stream li.new-update .activity-content .activity-header p a.view').attr('href'), 222 ltext = jq('#activity-stream li.new-update .activity-content .activity-inner p').text(), 223 u = ''; 224 225 if ( ltext !== '' ) { 226 u = l + ' '; 227 } 228 229 u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>'; 230 231 jq('#latest-update').slideUp(300,function(){ 232 jq('#latest-update').html( u ); 233 jq('#latest-update').slideDown(300); 234 }); 235 } 236 237 jq('li.new-update').hide().slideDown( 300 ); 238 jq('li.new-update').removeClass( 'new-update' ); 239 jq('#whats-new').val(''); 240 form.get(0).reset(); 241 242 // reset vars to get newest activities 243 newest_activities = ''; 244 activity_last_recorded = 0; 245 } 246 247 jq('#whats-new-options').slideUp(); 248 jq('#whats-new-form textarea').animate({ 249 height:'2.2em' 250 }); 251 jq('#aw-whats-new-submit').prop('disabled', true).removeClass('loading'); 252 jq( '#whats-new-content' ).removeClass( 'active' ); 253 }); 254 255 return false; 256 }); 257 258 /* List tabs event delegation */ 259 jq('div.activity-type-tabs').on( 'click', function(event) { 260 var target = jq(event.target).parent(), 261 scope, filter; 262 263 if ( event.target.nodeName === 'STRONG' || event.target.nodeName === 'SPAN' ) { 264 target = target.parent(); 265 } else if ( event.target.nodeName !== 'A' ) { 266 return false; 267 } 268 269 /* Activity Stream Tabs */ 270 scope = target.attr('id').substr( 9, target.attr('id').length ); 271 filter = jq('#activity-filter-select select').val(); 272 273 if ( scope === 'mentions' ) { 274 jq( '#' + target.attr('id') + ' a strong' ).remove(); 275 } 276 277 bp_activity_request(scope, filter); 278 279 return false; 280 }); 281 282 /* Activity filter select */ 283 jq('#activity-filter-select select').change( function() { 284 var selected_tab = jq( 'div.activity-type-tabs li.selected' ), 285 filter = jq(this).val(), 286 scope; 287 288 if ( !selected_tab.length ) { 289 scope = null; 290 } else { 291 scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length ); 292 } 293 294 bp_activity_request(scope, filter); 295 296 return false; 297 }); 298 299 /* Stream event delegation */ 300 jq('div.activity').on( 'click', function(event) { 301 var target = jq(event.target), 302 type, parent, parent_id, 303 li, id, link_href, nonce, timestamp, 304 oldest_page, just_posted; 305 306 /* Favoriting activity stream items */ 307 if ( target.hasClass('fav') || target.hasClass('unfav') ) { 308 /* Bail if a request is in progress */ 309 if ( target.hasClass( 'loading' ) ) { 310 return false; 311 } 312 313 type = target.hasClass('fav') ? 'fav' : 'unfav'; 314 parent = target.closest('.activity-item'); 315 parent_id = parent.attr('id').substr( 9, parent.attr('id').length ); 316 nonce = bp_get_query_var( '_wpnonce', target.attr( 'href' ) ); 317 318 target.addClass('loading'); 319 320 jq.post( ajaxurl, { 321 action: 'activity_mark_' + type, 322 'cookie': bp_get_cookies(), 323 'id': parent_id, 324 nonce: nonce 325 }, 326 function(response) { 327 target.removeClass('loading'); 328 329 target.fadeOut( 200, function() { 330 jq(this).html(response); 331 jq(this).attr('title', 'fav' === type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav); 332 jq(this).fadeIn(200); 333 }); 334 335 if ( 'fav' === type ) { 336 if ( !jq('.item-list-tabs #activity-favs-personal-li').length ) { 337 if ( !jq('.item-list-tabs #activity-favorites').length ) { 338 jq('.item-list-tabs ul #activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>'); 339 } 340 341 jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) + 1 ); 342 } 343 344 target.removeClass('fav'); 345 target.addClass('unfav'); 346 347 } else { 348 target.removeClass('unfav'); 349 target.addClass('fav'); 350 351 jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) - 1 ); 352 353 if ( !Number( jq('.item-list-tabs ul #activity-favorites span').html() ) ) { 354 if ( jq('.item-list-tabs ul #activity-favorites').hasClass('selected') ) { 355 bp_activity_request( null, null ); 356 } 357 358 jq('.item-list-tabs ul #activity-favorites').remove(); 359 } 360 } 361 362 if ( 'activity-favorites' === jq( '.item-list-tabs li.selected').attr('id') ) { 363 target.closest( '.activity-item' ).slideUp( 100 ); 364 } 365 }); 366 367 return false; 368 } 369 370 // Spam activity stream items 371 if ( target.hasClass( 'spam-activity' ) ) { 372 li = target.parents( 'div.activity ul li' ); 373 timestamp = li.prop( 'class' ).match( /date-recorded-([0-9]+)/ ); 374 target.addClass( 'loading' ); 375 376 jq.post( ajaxurl, { 377 action: 'bp_spam_activity', 378 'cookie': encodeURIComponent( document.cookie ), 379 'id': li.attr( 'id' ).substr( 9, li.attr( 'id' ).length ), 380 '_wpnonce': target.attr( 'href' ).split( '_wpnonce=' )[1] 381 }, 382 383 function(response) { 384 if ( response[0] + response[1] === '-1' ) { 385 li.prepend( response.substr( 2, response.length ) ); 386 li.children( '#message' ).hide().fadeIn(300); 387 } else { 388 li.slideUp( 300 ); 389 // reset vars to get newest activities 390 if ( timestamp && activity_last_recorded === timestamp[1] ) { 391 newest_activities = ''; 392 activity_last_recorded = 0; 393 } 394 } 395 }); 396 397 return false; 398 } 399 400 /* Load more updates at the end of the page */ 401 if ( target.parent().hasClass('load-more') ) { 402 if ( bp_ajax_request ) { 403 bp_ajax_request.abort(); 404 } 405 406 jq('#youzify li.load-more').addClass('loading'); 407 408 oldest_page = activity_oldestpage + 1; 409 just_posted = []; 410 411 jq('.activity-list li.just-posted').each( function(){ 412 just_posted.push( jq(this).attr('id').replace( 'activity-','' ) ); 413 }); 414 415 let yz_cookies = bp_get_cookies(); 416 417 if ( ! yz_cookies ) { 418 var cookies = { 419 'bp-activity-filter': bp_get_directory_preference( 'activity', 'filter' ), 420 'bp-activity-scope': bp_get_directory_preference( 'activity', 'scope' ) 421 }; 422 423 yz_cookies = encodeURIComponent( jq.param( cookies ) ); 424 } 425 426 load_more_args = { 427 action: 'activity_get_older_updates', 428 'cookie': yz_cookies, 429 'page': parseInt( new URL( jq( target ).prop( 'href' ) ).searchParams.get( 'acpage' ), 10 ), 430 'place_id': new URL( jq( target ).prop( 'href' ) ).searchParams.get( 'place_id' ), 431 'exclude_just_posted': just_posted.join(',') 432 }; 433 434 load_more_search = bp_get_querystring('s'); 435 436 if ( load_more_search ) { 437 load_more_args.search_terms = load_more_search; 438 } 439 440 bp_ajax_request = jq.post( ajaxurl, load_more_args, 441 function(response) 442 { 443 jq('#youzify li.load-more').removeClass('loading'); 444 activity_oldestpage = oldest_page; 445 var new_activities = jq( response.contents ); 446 jq('#youzify ul.activity-list').append( new_activities ); 447 target.parent().hide(); 448 bp_legacy_theme_hide_comments( new_activities ); 449 new_activities = undefined; 450 if ( window.instgrm ) { 451 window.instgrm.Embeds.process(); 452 } 453 }, 'json' ); 454 455 return false; 456 } 457 458 /* Load newest updates at the top of the list */ 459 if ( target.parent().hasClass('load-newest') ) { 460 461 event.preventDefault(); 462 463 target.parent().hide(); 464 465 /** 466 * If a plugin is updating the recorded_date of an activity 467 * it will be loaded as a new one. We need to look in the 468 * stream and eventually remove similar ids to avoid "double". 469 */ 470 activity_html = jq.parseHTML( newest_activities ); 471 472 jq.each( activity_html, function( i, el ){ 473 if( 'LI' === el.nodeName && jq(el).hasClass( 'just-posted' ) ) { 474 if( jq( '#' + jq(el).attr( 'id' ) ).length ) { 475 jq( '#' + jq(el).attr( 'id' ) ).remove(); 476 } 477 } 478 } ); 479 480 // Now the stream is cleaned, prepend newest 481 jq( '#youzify ul.activity-list' ).prepend( newest_activities ); 482 483 // reset the newest activities now they're displayed 484 newest_activities = ''; 485 } 486 }); 487 488 // Activity "Read More" links 489 jq('div.activity').on('click', '.activity-read-more a', function(event) { 490 var target = jq(event.target), 491 link_id = target.parent().attr('id').split('-'), 492 a_id = link_id[3], 493 type = link_id[0], /* activity or acomment */ 494 inner_class, a_inner; 495 496 inner_class = type === 'acomment' ? 'acomment-content' : 'activity-inner'; 497 a_inner = jq('#' + type + '-' + a_id + ' .' + inner_class + ':first' ); 498 jq(target).addClass('loading'); 499 500 jq.post( ajaxurl, { 501 action: 'get_single_activity_content', 502 'activity_id': a_id 503 }, 504 function(response) { 505 jq(a_inner).slideUp(300).html(response).slideDown(300); 506 }); 507 508 return false; 509 }); 510 511 /**** Activity Comments *******************************************************/ 512 513 /* Hide all activity comment forms */ 514 jq('form.ac-form').hide(); 515 516 /* Hide excess comments */ 517 if ( jq('.activity-comments').length ) { 518 bp_legacy_theme_hide_comments(); 519 } 520 521 /* Activity list event delegation */ 522 jq('div.activity').on( 'click', function(event) { 523 var target = jq(event.target), 524 id, ids, a_id, c_id, form, 525 form_parent, form_id, 526 tmp_id, comment_id, comment, 527 ajaxdata, 528 ak_nonce, 529 show_all_a, new_count, 530 link_href, comment_li, nonce, activity; 531 532 activity = jq( this ).closest( '.activity' ); 533 534 /* Comment / comment reply links */ 535 if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) { 536 if ( target.parent().hasClass('acomment-reply') ) { 537 target = target.parent(); 538 } 539 540 id = target.attr('id'); 541 ids = id.split('-'); 542 543 a_id = ids[2]; 544 c_id = target.attr('href').substr( 10, target.attr('href').length ); 545 // alert('heros') 546 form = activity.find( '#ac-form-' + a_id ); 547 548 form.css( 'display', 'none' ); 549 form.removeClass('root'); 550 jq('.ac-form').hide(); 551 552 /* Hide any error messages */ 553 form.children('div').each( function() { 554 if ( jq(this).hasClass( 'error' ) ) { 555 jq(this).hide(); 556 } 557 }); 558 559 if ( ids[1] !== 'comment' ) { 560 activity.find('#acomment-' + c_id).append( form ); 561 } else { 562 activity.find('#activity-' + a_id + ' .activity-comments').append( form ); 563 } 564 565 if ( form.parent().hasClass( 'activity-comments' ) ) { 566 form.addClass('root'); 567 } 568 569 form.slideDown( 200 ); 570 jq.scrollTo( form, 500, { 571 offset:-100, 572 easing:'swing' 573 } ); 574 activity.find('#ac-form-' + ids[2] + ' textarea').focus(); 575 576 return false; 577 } 578 579 /* Activity comment posting */ 580 if ( target.attr('name') === 'ac_form_submit' ) { 581 form = target.parents( 'form' ); 582 form_parent = form.parent(); 583 form_id = form.attr('id').split('-'); 584 585 if ( !form_parent.hasClass('activity-comments') ) { 586 tmp_id = form_parent.attr('id').split('-'); 587 comment_id = tmp_id[1]; 588 } else { 589 comment_id = form_id[2]; 590 } 591 592 content = activity.find( '#' + form.attr('id') + ' textarea' ); 593 594 /* Hide any error messages */ 595 activity.find( '#' + form.attr('id') + ' div.error').hide(); 596 target.addClass('loading').prop('disabled', true); 597 content.addClass('loading').prop('disabled', true); 598 599 ajaxdata = { 600 action: 'new_activity_comment', 601 'cookie': bp_get_cookies(), 602 '_wpnonce_new_activity_comment': jq('#_wpnonce_new_activity_comment').val(), 603 'comment_id': comment_id, 604 'form_id': form_id[2], 605 'content': content.val() 606 }; 607 608 // Akismet 609 ak_nonce = jq('#_bp_as_nonce_' + comment_id).val(); 610 if ( ak_nonce ) { 611 ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce; 612 } 613 614 jq.post( ajaxurl, ajaxdata, function(response) { 615 target.removeClass('loading'); 616 content.removeClass('loading'); 617 618 /* Check for errors and append if found. */ 619 if ( response[0] + response[1] === '-1' ) { 620 form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 621 } else { 622 var activity_comments = form.parent(); 623 form.fadeOut( 200, function() { 624 if ( 0 === activity_comments.children('ul').length ) { 625 if ( activity_comments.hasClass('activity-comments') ) { 626 activity_comments.prepend('<ul></ul>'); 627 } else { 628 activity_comments.append('<ul></ul>'); 629 } 630 } 631 632 /* Preceding whitespace breaks output with jQuery 1.9.0 */ 633 var the_comment = jq.trim( response ); 634 635 activity_comments.children('ul').append( jq( the_comment ).hide().fadeIn( 200 ) ); 636 form.children('textarea').val(''); 637 activity_comments.parent().addClass('has-comments'); 638 } ); 639 activity.find( '#' + form.attr('id') + ' textarea').val(''); 640 641 /* Increase the "Reply (X)" button count */ 642 new_count = Number( jq('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1; 643 jq('#activity-' + form_id[2] + ' a.acomment-reply span').html( new_count ); 644 645 // Increment the 'Show all x comments' string, if present 646 show_all_a = activity_comments.parents('.activity-comments').find('.show-all a'); 647 if ( show_all_a ) { 648 649 var show_count = show_all_a.text().match(/\((.*)\)/); 650 show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', Number( show_count[1] ) + 1 ) ); 651 } 652 } 653 654 jq(target).prop('disabled', false); 655 jq(content).prop('disabled', false); 656 }); 657 658 return false; 659 } 660 661 /* Deleting an activity comment */ 662 if ( target.hasClass('acomment-delete') ) { 663 link_href = target.attr('href'); 664 comment_li = target.parent().parent(); 665 form = comment_li.parents('div.activity-comments').children('form'); 666 667 nonce = link_href.split('_wpnonce='); 668 nonce = nonce[1]; 669 670 comment_id = link_href.split('cid='); 671 comment_id = comment_id[1].split('&'); 672 comment_id = comment_id[0]; 673 674 target.addClass('loading'); 675 676 /* Remove any error messages */ 677 jq('.activity-comments ul .error').remove(); 678 679 /* Reset the form position */ 680 comment_li.parents('.activity-comments').append(form); 681 682 jq.post( ajaxurl, { 683 action: 'delete_activity_comment', 684 'cookie': bp_get_cookies(), 685 '_wpnonce': nonce, 686 'id': comment_id 687 }, 688 function(response) { 689 /* Check for errors and append if found. */ 690 if ( response[0] + response[1] === '-1' ) { 691 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 692 } else { 693 var children = jq( '#' + comment_li.attr('id') + ' ul' ).children('li'), 694 child_count = 0, 695 count_span, new_count, show_all_a; 696 697 jq(children).each( function() { 698 if ( !jq(this).is(':hidden') ) { 699 child_count++; 700 } 701 }); 702 comment_li.fadeOut(200, function() { 703 comment_li.remove(); 704 }); 705 706 /* Decrease the "Reply (X)" button count */ 707 count_span = jq('#' + comment_li.parents('#activity-stream > li').attr('id') + ' a.acomment-reply span'); 708 new_count = count_span.html() - ( 1 + child_count ); 709 count_span.html(new_count); 710 711 // Change the 'Show all x comments' text 712 show_all_a = comment_li.parents('.activity-comments').find('.show-all a'); 713 if ( show_all_a ) { 714 var show_count = show_all_a.text().match(/\((.*)\)/); 715 if ( show_count) { 716 show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', Number( show_count[1] ) - 1 ) ); 717 } 718 } 719 720 /* If that was the last comment for the item, remove the has-comments class to clean up the styling */ 721 if ( 0 === new_count ) { 722 jq(comment_li.parents('#activity-stream > li')).removeClass('has-comments'); 723 } 724 } 725 }); 726 727 return false; 728 } 729 730 // Spam an activity stream comment 731 if ( target.hasClass( 'spam-activity-comment' ) ) { 732 link_href = target.attr( 'href' ); 733 comment_li = target.parent().parent(); 734 735 target.addClass('loading'); 736 737 // Remove any error messages 738 jq( '.activity-comments ul div.error' ).remove(); 739 740 // Reset the form position 741 comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) ); 742 743 jq.post( ajaxurl, { 744 action: 'bp_spam_activity_comment', 745 'cookie': encodeURIComponent( document.cookie ), 746 '_wpnonce': link_href.split( '_wpnonce=' )[1], 747 'id': link_href.split( 'cid=' )[1].split( '&' )[0] 748 }, 749 750 function ( response ) { 751 // Check for errors and append if found. 752 if ( response[0] + response[1] === '-1' ) { 753 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 754 755 } else { 756 var children = jq( '#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' ), 757 child_count = 0, 758 parent_li; 759 760 jq(children).each( function() { 761 if ( !jq( this ).is( ':hidden' ) ) { 762 child_count++; 763 } 764 }); 765 comment_li.fadeOut( 200 ); 766 767 // Decrease the "Reply (X)" button count 768 parent_li = comment_li.parents( '#activity-stream > li' ); 769 jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) ); 770 } 771 }); 772 773 return false; 774 } 775 776 /* Showing hidden comments - pause for half a second */ 777 if ( target.parent().hasClass('show-all') ) { 778 target.parent().addClass('loading'); 779 780 setTimeout( function() { 781 target.parent().parent().children('li').fadeIn(200, function() { 782 target.parent().remove(); 783 }); 784 }, 600 ); 785 786 return false; 787 } 788 789 // Canceling an activity comment 790 if ( target.hasClass( 'ac-reply-cancel' ) ) { 791 jq(target).closest('.ac-form').slideUp( 200 ); 792 return false; 793 } 794 }); 795 796 /* Escape Key Press for cancelling comment forms */ 797 jq(document).keydown( function(e) { 798 e = e || window.event; 799 if (e.target) { 800 element = e.target; 801 } else if (e.srcElement) { 802 element = e.srcElement; 803 } 804 805 if( element.nodeType === 3) { 806 element = element.parentNode; 807 } 808 809 if( e.ctrlKey === true || e.altKey === true || e.metaKey === true ) { 810 return; 811 } 812 813 var keyCode = (e.keyCode) ? e.keyCode : e.which; 814 815 if ( keyCode === 27 ) { 816 if (element.tagName === 'TEXTAREA') { 817 if ( jq(element).hasClass('ac-input') ) { 818 jq(element).parent().parent().parent().slideUp( 200 ); 819 } 820 } 821 } 822 }); 823 824 /**** Directory Search ****************************************************/ 825 826 /* The search form on all directory pages */ 827 jq( '.dir-search, .groups-members-search' ).on( 'click', function(event) { 828 if ( jq(this).hasClass('no-ajax') ) { 829 return; 830 } 831 832 var target = jq(event.target), 833 css_id, object, template, search_terms; 834 835 if ( target.attr('type') === 'submit' ) { 836 837 if ( ! jq('.item-list-tabs li.selected')[0] ) { 838 jq( '.item-list-tabs li:first' ).addClass( 'selected' ); 839 } 840 841 css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' ); 842 object = css_id[0]; 843 template = null; 844 search_terms = target.parent().find( '#' + object + '_search' ).val(); 845 846 // The Group Members page specifies its own template 847 if ( event.currentTarget.className === 'groups-members-search' ) { 848 object = 'group_members'; 849 template = 'groups/single/members'; 850 } 851 852 var scope = bp_get_directory_preference( object, 'scope' ); 853 var filter = bp_get_directory_preference( object, 'filter' ); 854 var extras = bp_get_directory_preference( object, 'extras' ); 855 856 if ( ! scope ) { 857 scope = 'all'; 858 } 859 860 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template ); 861 862 return false; 863 } 864 }); 865 866 /**** Tabs and Filters ****************************************************/ 867 868 /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */ 869 jq('div.item-list-tabs').on( 'click', function(event) { 870 // If on a directory page with a type filter, add no-ajax class. 871 if ( jq( 'body' ).hasClass( 'type' ) && jq( 'body' ).hasClass( 'directory' ) ) { 872 jq(this).addClass( 'no-ajax' ); 873 } 874 875 if ( jq(this).hasClass('no-ajax') || jq( event.target ).hasClass('no-ajax') ) { 876 return; 877 } 878 879 var targetElem = ( event.target.nodeName === 'SPAN' ) ? event.target.parentNode : event.target, 880 target = jq( targetElem ).parent(), 881 css_id, object, scope, filter, search_terms; 882 883 if ( 'LI' === target[0].nodeName && !target.hasClass( 'last' ) ) { 884 css_id = target.attr('id').split( '-' ); 885 object = css_id[0]; 886 887 if ( 'activity' === object ) { 888 return false; 889 } 890 891 scope = css_id[1]; 892 filter = jq('#' + object + '-order-select select').val(); 893 search_terms = jq('#' + object + '_search').val(); 894 895 var extras = bp_get_directory_preference( object, 'extras' ); 896 897 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras ); 898 899 return false; 900 } 901 }); 902 903 /* When the filter select box is changed re-query */ 904 jq('li.filter select').change( function() { 905 var el, 906 css_id, object, scope, filter, search_terms, template, 907 $gm_search; 908 909 if ( jq('.item-list-tabs li.selected').length ) { 910 el = jq('.item-list-tabs li.selected'); 911 } else { 912 el = jq(this); 913 } 914 915 css_id = el.attr('id').split('-'); 916 object = css_id[0]; 917 scope = css_id[1]; 918 filter = jq(this).val(); 919 search_terms = false; 920 template = null; 921 922 if ( jq('.dir-search input').length ) { 923 search_terms = jq('.dir-search input').val(); 924 } 925 926 // The Group Members page has a different selector for its 927 // search terms box 928 $gm_search = jq( '.groups-members-search input' ); 929 if ( $gm_search.length ) { 930 search_terms = $gm_search.val(); 931 object = 'members'; 932 scope = 'groups'; 933 } 934 935 // On the Groups Members page, we specify a template 936 if ( 'members' === object && 'groups' === scope ) { 937 object = 'group_members'; 938 template = 'groups/single/members'; 939 } 940 941 if ( 'friends' === object ) { 942 object = 'members'; 943 } 944 945 var extras = bp_get_directory_preference( object, 'extras' ); 946 947 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template ); 948 949 return false; 950 }); 951 952 /* All pagination links run through this function */ 953 jq('#youzify').on( 'click', function(event) { 954 var target = jq(event.target), 955 el, 956 css_id, object, search_terms, pagination_id, template, 957 page_number, 958 $gm_search, 959 caller; 960 961 if ( target.hasClass('button') ) { 962 return true; 963 } 964 965 if ( target.parent().parent().hasClass('pagination') && !target.parent().parent().hasClass('no-ajax') ) { 966 if ( target.hasClass('dots') || target.hasClass('current') ) { 967 return false; 968 } 969 970 if ( jq('.item-list-tabs li.selected').length ) { 971 el = jq('.item-list-tabs li.selected'); 972 } else { 973 el = jq('li.filter select'); 974 } 975 976 css_id = el.attr('id').split( '-' ); 977 object = css_id[0]; 978 search_terms = false; 979 pagination_id = jq(target).closest('.pagination-links').attr('id'); 980 template = null; 981 982 // Search terms 983 if ( jq('div.dir-search input').length ) { 984 search_terms = jq('.dir-search input'); 985 986 if ( ! search_terms.val() && bp_get_querystring( search_terms.attr( 'name' ) ) ) { 987 search_terms = jq('.dir-search input').prop('placeholder'); 988 } else { 989 search_terms = search_terms.val(); 990 } 991 } 992 993 // Page number 994 if ( jq(target).hasClass('next') || jq(target).hasClass('prev') ) { 995 page_number = jq('.pagination span.current').html(); 996 } else { 997 page_number = jq(target).html(); 998 } 999 1000 // Remove any non-numeric characters from page number text (commas, etc.) 1001 page_number = Number( page_number.replace(/\D/g,'') ); 1002 1003 if ( jq(target).hasClass('next') ) { 1004 page_number++; 1005 } else if ( jq(target).hasClass('prev') ) { 1006 page_number--; 1007 } 1008 1009 // The Group Members page has a different selector for 1010 // its search terms box 1011 $gm_search = jq( '.groups-members-search input' ); 1012 if ( $gm_search.length ) { 1013 search_terms = $gm_search.val(); 1014 object = 'members'; 1015 } 1016 1017 // On the Groups Members page, we specify a template 1018 if ( 'members' === object && 'groups' === css_id[1] ) { 1019 object = 'group_members'; 1020 template = 'groups/single/members'; 1021 } 1022 1023 // On the Admin > Requests page, we need to reset the object, 1024 // since "admin" isn't specific enough 1025 if ( 'admin' === object && jq( 'body' ).hasClass( 'membership-requests' ) ) { 1026 object = 'requests'; 1027 } 1028 1029 if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) { 1030 caller = 'pag-bottom'; 1031 } else { 1032 caller = null; 1033 } 1034 1035 var scope = bp_get_directory_preference( object, 'scope' ); 1036 var filter = bp_get_directory_preference( object, 'filter' ); 1037 var extras = bp_get_directory_preference( object, 'extras' ); 1038 console.log( 'object' + object); 1039 console.log( 'scope' + scope); 1040 console.log( 'filter' + filter); 1041 console.log( 'extras' + extras); 1042 console.log( 'page_number' + page_number); 1043 1044 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, page_number, extras, caller, template ); 1045 1046 return false; 1047 } 1048 1049 }); 1050 1051 /** Invite Friends Interface ****************************************/ 1052 1053 /* Select a user from the list of friends and add them to the invite list */ 1054 jq('#send-invite-form').on( 'click', '#invite-list input', function() { 1055 // invites-loop template contains a div with the .invite class 1056 // We use the existence of this div to check for old- vs new- 1057 // style templates. 1058 var invites_new_template = jq( '#send-invite-form > .invite' ).length, 1059 friend_id, friend_action; 1060 1061 jq('.ajax-loader').toggle(); 1062 1063 // Dim the form until the response arrives 1064 if ( invites_new_template ) { 1065 jq( this ).parents( 'ul' ).find( 'input' ).prop( 'disabled', true ); 1066 } 1067 1068 friend_id = jq(this).val(); 1069 1070 if ( jq(this).prop('checked') === true ) { 1071 friend_action = 'invite'; 1072 } else { 1073 friend_action = 'uninvite'; 1074 } 1075 1076 if ( ! invites_new_template ) { 1077 jq( '.item-list-tabs li.selected' ).addClass( 'loading' ); 1078 } 1079 1080 jq.post( ajaxurl, { 1081 action: 'groups_invite_user', 1082 'friend_action': friend_action, 1083 'cookie': bp_get_cookies(), 1084 '_wpnonce': jq('#_wpnonce_invite_uninvite_user').val(), 1085 'friend_id': friend_id, 1086 'group_id': jq('#group_id').val() 1087 }, 1088 function(response) 1089 { 1090 if ( jq('#message') ) { 1091 jq('#message').hide(); 1092 } 1093 1094 if ( invites_new_template ) { 1095 // With new-style templates, we refresh the 1096 // entire list 1097 bp_filter_request( 'invite', 'bp-invite-filter', 'bp-invite-scope', 'div.invite', false, 1, '', '', '' ); 1098 } else { 1099 // Old-style templates manipulate only the 1100 // single invitation element 1101 jq('.ajax-loader').toggle(); 1102 1103 if ( friend_action === 'invite' ) { 1104 jq('#friend-list').append(response); 1105 } else if ( friend_action === 'uninvite' ) { 1106 jq('#friend-list li#uid-' + friend_id).remove(); 1107 } 1108 1109 jq('.item-list-tabs li.selected').removeClass('loading'); 1110 } 1111 }); 1112 }); 1113 1114 /* Remove a user from the list of users to invite to a group */ 1115 jq('#send-invite-form').on('click', 'a.remove', function() { 1116 // invites-loop template contains a div with the .invite class 1117 // We use the existence of this div to check for old- vs new- 1118 // style templates. 1119 var invites_new_template = jq('#send-invite-form > .invite').length, 1120 friend_id = jq(this).attr('id'); 1121 1122 jq('.ajax-loader').toggle(); 1123 1124 friend_id = friend_id.split('-'); 1125 friend_id = friend_id[1]; 1126 1127 jq.post( ajaxurl, { 1128 action: 'groups_invite_user', 1129 'friend_action': 'uninvite', 1130 'cookie': bp_get_cookies(), 1131 '_wpnonce': jq('#_wpnonce_invite_uninvite_user').val(), 1132 'friend_id': friend_id, 1133 'group_id': jq('#group_id').val() 1134 }, 1135 function(response) 1136 { 1137 if ( invites_new_template ) { 1138 // With new-style templates, we refresh the 1139 // entire list 1140 bp_filter_request( 'invite', 'bp-invite-filter', 'bp-invite-scope', 'div.invite', false, 1, '', '', '' ); 1141 } else { 1142 // Old-style templates manipulate only the 1143 // single invitation element 1144 jq('.ajax-loader').toggle(); 1145 jq('#friend-list #uid-' + friend_id).remove(); 1146 jq('#invite-list #f-' + friend_id).prop('checked', false); 1147 } 1148 }); 1149 1150 return false; 1151 }); 1152 1153 /** Profile Visibility Settings *********************************/ 1154 jq( '.visibility-toggle-link' ).on( 'click', function( event ) { 1155 event.preventDefault(); 1156 1157 jq( this ).attr( 'aria-expanded', 'true' ).parent().hide().addClass( 'field-visibility-settings-hide' ) 1158 .siblings( '.field-visibility-settings' ).show().addClass( 'field-visibility-settings-open' ); 1159 } ); 1160 1161 jq( '.field-visibility-settings-close' ).on( 'click', function( event ) { 1162 event.preventDefault(); 1163 1164 jq( '.visibility-toggle-link' ).attr( 'aria-expanded', 'false' ); 1165 1166 var settings_div = jq( this ).parent(), 1167 vis_setting_text = settings_div.find( 'input:checked' ).parent().text(); 1168 1169 settings_div.hide().removeClass( 'field-visibility-settings-open' ) 1170 .siblings( '.field-visibility-settings-toggle' ) 1171 .children( '.current-visibility-level' ).text( vis_setting_text ).end() 1172 .show().removeClass( 'field-visibility-settings-hide' ); 1173 } ); 1174 1175 jq('#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select').change( function() { 1176 var shouldconfirm = true; 1177 1178 jq('#profile-edit-form input:submit, #signup_form input:submit').on( 'click', function() { 1179 shouldconfirm = false; 1180 }); 1181 1182 window.onbeforeunload = function(e) { 1183 if ( shouldconfirm ) { 1184 return BP_DTheme.unsaved_changes; 1185 } 1186 }; 1187 }); 1188 1189 /** Friendship Requests **************************************/ 1190 1191 /* Accept and Reject friendship request buttons */ 1192 jq('#friend-list a.accept, #friend-list a.reject').on( 'click', function() { 1193 var button = jq(this), 1194 li = jq(this).parents('#friend-list li'), 1195 action_div = jq(this).parents('li div.action'), 1196 id = li.attr('id').substr( 11, li.attr('id').length ), 1197 link_href = button.attr('href'), 1198 nonce = link_href.split('_wpnonce=')[1], 1199 action; 1200 1201 if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') ) { 1202 return false; 1203 } 1204 1205 if ( jq(this).hasClass('accept') ) { 1206 action = 'accept_friendship'; 1207 action_div.children('a.reject').css( 'visibility', 'hidden' ); 1208 } else { 1209 action = 'reject_friendship'; 1210 action_div.children('a.accept').css( 'visibility', 'hidden' ); 1211 } 1212 1213 button.addClass('loading'); 1214 1215 jq.post( ajaxurl, { 1216 action: action, 1217 'cookie': bp_get_cookies(), 1218 'id': id, 1219 '_wpnonce': nonce 1220 }, 1221 function(response) { 1222 button.removeClass('loading'); 1223 1224 if ( response[0] + response[1] === '-1' ) { 1225 li.prepend( response.substr( 2, response.length ) ); 1226 li.children('#message').hide().fadeIn(200); 1227 } else { 1228 button.fadeOut( 100, function() { 1229 if ( jq(this).hasClass('accept') ) { 1230 action_div.children('a.reject').hide(); 1231 jq(this).html( BP_DTheme.accepted ).contents().unwrap(); 1232 } else { 1233 action_div.children('a.accept').hide(); 1234 jq(this).html( BP_DTheme.rejected ).contents().unwrap(); 1235 } 1236 }); 1237 } 1238 }); 1239 1240 return false; 1241 }); 1242 1243 /* Add / Remove friendship buttons */ 1244 jq( '#members-dir-list, #members-group-list, #item-header' ).on('click', '.friendship-button a', function() { 1245 1246 if ( jq( this ).hasClass( 'awaiting_response_friend' ) ) { 1247 return; 1248 } 1249 1250 jq(this).parent().addClass('loading'); 1251 var fid = jq(this).attr('id'), 1252 nonce = jq(this).attr('href'), 1253 thelink = jq(this); 1254 1255 fid = fid.split('-'); 1256 fid = fid[1]; 1257 1258 nonce = nonce.split('?_wpnonce='); 1259 nonce = nonce[1].split('&'); 1260 nonce = nonce[0]; 1261 1262 jq.post( ajaxurl, { 1263 action: 'addremove_friend', 1264 'cookie': bp_get_cookies(), 1265 'fid': fid, 1266 '_wpnonce': nonce 1267 }, 1268 function(response) 1269 { 1270 var action = thelink.attr('rel'); 1271 parentdiv = thelink.parent(); 1272 1273 if ( action === 'add' ) { 1274 jq(parentdiv).fadeOut(200, 1275 function() { 1276 parentdiv.removeClass('add_friend'); 1277 parentdiv.removeClass('loading'); 1278 parentdiv.addClass('pending_friend'); 1279 parentdiv.fadeIn(200).html(response); 1280 } 1281 ); 1282 1283 } else if ( action === 'remove' ) { 1284 jq(parentdiv).fadeOut(200, 1285 function() { 1286 parentdiv.removeClass('remove_friend'); 1287 parentdiv.removeClass('loading'); 1288 parentdiv.addClass('add'); 1289 parentdiv.fadeIn(200).html(response); 1290 } 1291 ); 1292 } 1293 }); 1294 return false; 1295 } ); 1296 1297 /** Group Join / Leave Buttons **************************************/ 1298 1299 // Confirmation when clicking Leave Group in group headers 1300 jq('#youzify').on('click', '.group-button .leave-group', function() { 1301 if ( false === confirm( BP_DTheme.leave_group_confirm ) ) { 1302 return false; 1303 } 1304 }); 1305 1306 jq('#groups-dir-list').on('click', '.group-button a', function() { 1307 var gid = jq(this).parent().attr('id'), 1308 nonce = jq(this).attr('href'), 1309 thelink = jq(this); 1310 1311 gid = gid.split('-'); 1312 gid = gid[1]; 1313 1314 nonce = nonce.split('?_wpnonce='); 1315 nonce = nonce[1].split('&'); 1316 nonce = nonce[0]; 1317 1318 // Leave Group confirmation within directories - must intercept 1319 // AJAX request 1320 if ( thelink.hasClass( 'leave-group' ) && false === confirm( BP_DTheme.leave_group_confirm ) ) { 1321 return false; 1322 } 1323 1324 jq.post( ajaxurl, { 1325 action: 'joinleave_group', 1326 'cookie': bp_get_cookies(), 1327 'gid': gid, 1328 '_wpnonce': nonce 1329 }, 1330 function(response) 1331 { 1332 var parentdiv = thelink.parent(); 1333 1334 // user groups page 1335 if ( ! jq('body.directory').length ) { 1336 window.location.reload(); 1337 1338 // groups directory 1339 } else { 1340 jq(parentdiv).fadeOut(200, 1341 function() { 1342 parentdiv.fadeIn(200).html(response); 1343 1344 var mygroups = jq('#groups-personal span'), 1345 add = 1; 1346 1347 if( thelink.hasClass( 'leave-group' ) ) { 1348 // hidden groups slide up 1349 if ( parentdiv.hasClass( 'hidden' ) ) { 1350 parentdiv.closest('li').slideUp( 200 ); 1351 } 1352 1353 add = 0; 1354 } else if ( thelink.hasClass( 'request-membership' ) ) { 1355 add = false; 1356 } 1357 1358 // change the "My Groups" value 1359 if ( mygroups.length && add !== false ) { 1360 if ( add ) { 1361 mygroups.text( ( mygroups.text() >> 0 ) + 1 ); 1362 } else { 1363 mygroups.text( ( mygroups.text() >> 0 ) - 1 ); 1364 } 1365 } 1366 1367 } 1368 ); 1369 } 1370 }); 1371 return false; 1372 } ); 1373 1374 // Fix hidden group visibility with themes using the .hidden CSS rule. 1375 jq('#groups-list li.hidden').each(function() { 1376 if ( jq(this).css('display') === 'none' ) { 1377 jq(this).css('cssText', 'display: list-item !important'); 1378 } 1379 }); 1380 1381 /** Button disabling ************************************************/ 1382 1383 jq('#youzify').on( 'click', '.pending', function() { 1384 return false; 1385 }); 1386 1387 /** Registration ***********************************************/ 1388 1389 if ( jq('body').hasClass('register') ) { 1390 var blog_checked = jq('#signup_with_blog'); 1391 1392 // hide "Blog Details" block if not checked by default 1393 if ( ! blog_checked.prop('checked') ) { 1394 jq('#blog-details').toggle(); 1395 } 1396 1397 // toggle "Blog Details" block whenever checkbox is checked 1398 blog_checked.change(function() { 1399 jq('#blog-details').toggle(); 1400 }); 1401 } 1402 1403 /** Private Messaging ******************************************/ 1404 1405 /** Message search */ 1406 jq('.message-search').on( 'click', function(event) { 1407 if ( jq(this).hasClass('no-ajax') ) { 1408 return; 1409 } 1410 1411 var target = jq(event.target), 1412 object; 1413 1414 if ( target.attr('type') === 'submit' || target.attr('type') === 'button' ) { 1415 object = 'messages'; 1416 1417 var scope = bp_get_directory_preference( object, 'scope' ); 1418 var filter = bp_get_directory_preference( object, 'filter' ); 1419 var extras = bp_get_directory_preference( object, 'extras' ); 1420 1421 bp_filter_request( 1422 object, 1423 filter, 1424 scope, 1425 'div.' + object, jq('#messages_search').val(), 1426 1, 1427 extras 1428 ); 1429 1430 return false; 1431 } 1432 }); 1433 1434 /* AJAX send reply functionality */ 1435 jq('#send_reply_button').click( 1436 function() { 1437 var order = jq('#messages_order').val() || 'ASC', 1438 offset = jq('#message-recipients').offset(), 1439 button = jq('#send_reply_button'); 1440 1441 jq(button).addClass('loading').prop( 'disabled', true ); 1442 1443 jq.post( ajaxurl, { 1444 action: 'messages_send_reply', 1445 'cookie': bp_get_cookies(), 1446 '_wpnonce': jq('#send_message_nonce').val(), 1447 1448 'content': jq('#message_content').val(), 1449 'send_to': jq('#send_to').val(), 1450 'subject': jq('#subject').val(), 1451 'thread_id': jq('#thread_id').val() 1452 }, 1453 function(response) 1454 { 1455 if ( response[0] + response[1] === '-1' ) { 1456 jq('#send-reply').prepend( response.substr( 2, response.length ) ); 1457 } else { 1458 jq('#send-reply #message').remove(); 1459 jq('#message_content').val(''); 1460 1461 if ( 'ASC' === order ) { 1462 jq('#send-reply').before( response ); 1463 } else { 1464 jq('#message-recipients').after( response ); 1465 jq(window).scrollTop(offset.top); 1466 } 1467 1468 jq('.new-message').hide().slideDown( 200, function() { 1469 jq('.new-message').removeClass('new-message'); 1470 }); 1471 } 1472 jq(button).removeClass('loading').prop( 'disabled', false ); 1473 }); 1474 1475 return false; 1476 } 1477 ); 1478 1479 /* Selecting unread and read messages in inbox */ 1480 jq( 'body.messages #item-body div.messages' ).on( 'change', '#message-type-select', function() { 1481 var selection = this.value, 1482 checkboxes = jq( 'td input[type="checkbox"]' ), 1483 checked_value = 'checked'; 1484 1485 checkboxes.each( function(i) { 1486 checkboxes[i].checked = ''; 1487 }); 1488 1489 switch ( selection ) { 1490 case 'unread': 1491 checkboxes = jq('tr.unread td input[type="checkbox"]'); 1492 break; 1493 case 'read': 1494 checkboxes = jq('tr.read td input[type="checkbox"]'); 1495 break; 1496 case '': 1497 checked_value = ''; 1498 break; 1499 } 1500 1501 checkboxes.each( function(i) { 1502 checkboxes[i].checked = checked_value; 1503 }); 1504 }); 1505 1506 /* Selecting/Deselecting all messages */ 1507 jq('#select-all-messages').click(function(event) { 1508 if( this.checked ) { 1509 jq('.message-check').each(function() { 1510 this.checked = true; 1511 }); 1512 } else { 1513 jq('.message-check').each(function() { 1514 this.checked = false; 1515 }); 1516 } 1517 }); 1518 1519 /* Make sure a 'Bulk Action' is selected before submitting the messages bulk action form */ 1520 jq('#messages-bulk-manage').attr('disabled', 'disabled'); 1521 1522 /* Remove the disabled attribute from the messages form submit button when bulk action has a value */ 1523 jq('#messages-select').on('change', function(){ 1524 jq('#messages-bulk-manage').attr('disabled', jq(this).val().length <= 0); 1525 }); 1526 1527 /* Star action function */ 1528 starAction = function() { 1529 var link = jq(this); 1530 1531 jq.post( ajaxurl, { 1532 action: 'messages_star', 1533 'message_id': link.data('message-id'), 1534 'star_status': link.data('star-status'), 1535 'nonce': link.data('star-nonce'), 1536 'bulk': link.data('star-bulk') 1537 }, 1538 function(response) { 1539 if ( 1 === parseInt( response, 10 ) ) { 1540 if ( 'unstar' === link.data('star-status') ) { 1541 link.data('star-status', 'star'); 1542 link.removeClass('message-action-unstar').addClass('message-action-star'); 1543 link.find('.bp-screen-reader-text').text( BP_PM_Star.strings.text_star ); 1544 1545 if ( 1 === BP_PM_Star.is_single_thread ) { 1546 link.attr('data-bp-tooltip', BP_PM_Star.strings.title_star ); 1547 } else { 1548 link.attr('data-bp-tooltip', BP_PM_Star.strings.title_star_thread ); 1549 } 1550 1551 } else { 1552 link.data('star-status', 'unstar'); 1553 link.removeClass('message-action-star').addClass('message-action-unstar'); 1554 link.find('.bp-screen-reader-text').text(BP_PM_Star.strings.text_unstar); 1555 1556 if ( 1 === BP_PM_Star.is_single_thread ) { 1557 link.attr('data-bp-tooltip', BP_PM_Star.strings.title_unstar ); 1558 } else { 1559 link.attr('data-bp-tooltip', BP_PM_Star.strings.title_unstar_thread ); 1560 } 1561 } 1562 } 1563 }); 1564 return false; 1565 }; 1566 1567 /* Star actions */ 1568 jq('#message-threads').on('click', 'td.thread-star a', starAction ); 1569 jq('#message-thread').on('click', '.message-star-actions a', starAction ); 1570 1571 /* Star bulk manage - Show only the valid action based on the starred item. */ 1572 jq('#message-threads td.bulk-select-check :checkbox').on('change', function() { 1573 var box = jq(this), 1574 star = box.closest('tr').find('.thread-star a'); 1575 1576 if ( box.prop('checked') ) { 1577 if( 'unstar' === star.data('star-status') ) { 1578 BP_PM_Star.star_counter++; 1579 } else { 1580 BP_PM_Star.unstar_counter++; 1581 } 1582 } else { 1583 if( 'unstar' === star.data('star-status') ) { 1584 BP_PM_Star.star_counter--; 1585 } else { 1586 BP_PM_Star.unstar_counter--; 1587 } 1588 } 1589 1590 if ( BP_PM_Star.star_counter > 0 && parseInt( BP_PM_Star.unstar_counter, 10 ) === 0 ) { 1591 jq('option[value="star"]').hide(); 1592 } else { 1593 jq('option[value="star"]').show(); 1594 } 1595 1596 if ( BP_PM_Star.unstar_counter > 0 && parseInt( BP_PM_Star.star_counter, 10 ) === 0 ) { 1597 jq('option[value="unstar"]').hide(); 1598 } else { 1599 jq('option[value="unstar"]').show(); 1600 } 1601 }); 1602 1603 /** Notifications **********************************************/ 1604 1605 /* Selecting/Deselecting all notifications */ 1606 jq('#select-all-notifications').click(function(event) { 1607 if( this.checked ) { 1608 jq('.notification-check').each(function() { 1609 this.checked = true; 1610 }); 1611 } else { 1612 jq('.notification-check').each(function() { 1613 this.checked = false; 1614 }); 1615 } 1616 }); 1617 1618 /* Make sure a 'Bulk Action' is selected before submitting the form */ 1619 jq('#notification-bulk-manage').attr('disabled', 'disabled'); 1620 1621 /* Remove the disabled attribute from the form submit button when bulk action has a value */ 1622 jq('#notification-select').on('change', function(){ 1623 jq('#notification-bulk-manage').attr('disabled', jq(this).val().length <= 0); 1624 }); 1625 1626 /** Members Invitations *****************************************/ 1627 1628 /* Selecting/Deselecting all invitations */ 1629 jq( '#select-all-invitations' ).on( 'click', function() { 1630 if ( this.checked ) { 1631 jq( '.invitation-check' ).each( function() { 1632 this.checked = true; 1633 } ); 1634 } else { 1635 jq( '.invitation-check' ).each( function() { 1636 this.checked = false; 1637 } ); 1638 } 1639 } ); 1640 1641 /* Make sure a 'Bulk Action' is selected before submitting the form */ 1642 jq('#invitation-bulk-manage').attr('disabled', 'disabled'); 1643 1644 /* Remove the disabled attribute from the form submit button when bulk action has a value */ 1645 jq('#invitation-select').on('change', function(){ 1646 jq('#invitation-bulk-manage').attr('disabled', jq(this).val().length <= 0); 1647 }); 1648 1649 /* Close site wide notices in the sidebar */ 1650 jq('#close-notice').on( 'click', function() { 1651 jq(this).addClass('loading'); 1652 jq('#sidebar div.error').remove(); 1653 1654 jq.post( ajaxurl, { 1655 action: 'messages_close_notice', 1656 'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length ), 1657 nonce: jq( '#close-notice-nonce' ).val() 1658 }, 1659 function(response) { 1660 jq('#close-notice').removeClass('loading'); 1661 1662 if ( response[0] + response[1] === '-1' ) { 1663 jq('.notice').prepend( response.substr( 2, response.length ) ); 1664 jq( '#sidebar div.error').hide().fadeIn( 200 ); 1665 } else { 1666 jq('.notice').slideUp( 100 ); 1667 } 1668 }); 1669 return false; 1670 }); 1671 1672 /* Toolbar & wp_list_pages JavaScript IE6 hover class */ 1673 jq('#wp-admin-bar ul.main-nav li, #nav li').mouseover( function() { 1674 jq(this).addClass('sfhover'); 1675 }); 1676 1677 jq('#wp-admin-bar ul.main-nav li, #nav li').mouseout( function() { 1678 jq(this).removeClass('sfhover'); 1679 }); 1680 1681 /* Clear BP cookies on logout */ 1682 jq('#wp-admin-bar-logout, a.logout').on( 'click', function() { 1683 jq.removeCookie('bp-activity-scope', { 1684 path: '/', 1685 secure: ( 'https:' === window.location.protocol ) 1686 }); 1687 jq.removeCookie('bp-activity-filter', { 1688 path: '/', 1689 secure: ( 'https:' === window.location.protocol ) 1690 }); 1691 jq.removeCookie('bp-activity-oldestpage', { 1692 path: '/', 1693 secure: ( 'https:' === window.location.protocol ) 1694 }); 1695 1696 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 1697 jq(objects).each( function(i) { 1698 jq.removeCookie('bp-' + objects[i] + '-scope', { 1699 path: '/', 1700 secure: ( 'https:' === window.location.protocol ) 1701 } ); 1702 jq.removeCookie('bp-' + objects[i] + '-filter', { 1703 path: '/', 1704 secure: ( 'https:' === window.location.protocol ) 1705 } ); 1706 jq.removeCookie('bp-' + objects[i] + '-extras', { 1707 path: '/', 1708 secure: ( 'https:' === window.location.protocol ) 1709 } ); 1710 }); 1711 }); 1712 1713 /* if js is enabled then replace the no-js class by a js one */ 1714 if( jq('body').hasClass('no-js') ) { 1715 jq('body').attr('class', jq('body').attr('class').replace( /no-js/,'js' ) ); 1716 } 1717 1718 /** Activity HeartBeat ************************************************/ 1719 1720 // Set the interval and the namespace event 1721 if ( typeof wp !== 'undefined' && typeof wp.heartbeat !== 'undefined' && typeof BP_DTheme.pulse !== 'undefined' ) { 1722 1723 wp.heartbeat.interval( Number( BP_DTheme.pulse ) ); 1724 1725 jq.fn.extend({ 1726 'heartbeat-send': function() { 1727 return this.bind( 'heartbeat-send.buddypress' ); 1728 } 1729 }); 1730 } 1731 1732 // Set the last id to request after 1733 var first_item_recorded = 0; 1734 jq( document ).on( 'heartbeat-send.buddypress', function( e, data ) { 1735 1736 first_item_recorded = 0; 1737 1738 // First row is default latest activity id 1739 if ( jq( '#youzify ul.activity-list li:not(.youzify-pinned-post)' ).first().prop( 'id' ) ) { 1740 // getting the timestamp 1741 timestamp = jq( '#youzify ul.activity-list li:not(.youzify-pinned-post)' ).first().prop( 'class' ).match( /date-recorded-([0-9]+)/ ); 1742 1743 if ( timestamp ) { 1744 first_item_recorded = timestamp[1]; 1745 } 1746 } 1747 1748 if ( 0 === activity_last_recorded || Number( first_item_recorded ) > activity_last_recorded ) { 1749 activity_last_recorded = Number( first_item_recorded ); 1750 } 1751 1752 data.bp_activity_last_recorded = activity_last_recorded; 1753 data.bp_heartbeat = bp_get_cookies() || encodeURIComponent( jq.param( { 'bp-activity-scope': null } ) ); 1754 1755 last_recorded_search = bp_get_querystring('s'); 1756 1757 if ( last_recorded_search ) { 1758 data.bp_activity_last_recorded_search_terms = last_recorded_search; 1759 } 1760 }); 1761 1762 // Increment newest_activities and activity_last_recorded if data has been returned 1763 jq( document ).on( 'heartbeat-tick', function( e, data ) { 1764 1765 // Only proceed if we have newest activities 1766 if ( ! data.bp_activity_newest_activities ) { 1767 return; 1768 } 1769 1770 newest_activities = data.bp_activity_newest_activities.activities + newest_activities; 1771 activity_last_recorded = Number( data.bp_activity_newest_activities.last_recorded ); 1772 1773 if ( jq( '#youzify ul.activity-list li' ).first().hasClass( 'load-newest' ) ) { 1774 return; 1775 } 1776 1777 jq( '#youzify ul.activity-list' ).prepend( '<li class="load-newest"><a href="#newest">' + BP_DTheme.newest + '</a></li>' ); 1778 }); 1779 }); 1780 1781 /** 1782 * Gets the user's current preference for a directory option. 1783 */ 1784 function bp_get_directory_preference( directoryType, pref ) { 1785 var defaultPrefs = { 1786 filter: '', 1787 scope: '', 1788 extras: '' 1789 }; 1790 1791 if ( ! directoryPreferences.hasOwnProperty( directoryType ) ) { 1792 var newPreferences = {}; 1793 for ( var prefName in defaultPrefs ) { 1794 if ( defaultPrefs.hasOwnProperty( prefName ) ) { 1795 newPreferences[ prefName ] = defaultPrefs[ prefName ]; 1796 } 1797 } 1798 directoryPreferences[ directoryType ] = newPreferences; 1799 } 1800 1801 if ( BP_DTheme.store_filter_settings ) { 1802 directoryPreferences[ directoryType ][ pref ] = jq.cookie( 'bp-' + directoryType + '-' + pref ); 1803 } 1804 1805 return directoryPreferences[ directoryType ][ pref ]; 1806 } 1807 1808 /** 1809 * Sets the user's current preference for a directory option. 1810 */ 1811 function bp_set_directory_preference( directoryType, pref, value ) { 1812 var defaultPrefs = { 1813 filter: '', 1814 scope: '', 1815 extras: '' 1816 }; 1817 1818 if ( ! directoryPreferences.hasOwnProperty( directoryType ) ) { 1819 var newPreferences = {}; 1820 for ( var prefName in defaultPrefs ) { 1821 if ( defaultPrefs.hasOwnProperty( prefName ) ) { 1822 newPreferences[ prefName ] = defaultPrefs[ prefName ]; 1823 } 1824 } 1825 directoryPreferences[ directoryType ] = newPreferences; 1826 } 1827 1828 if ( BP_DTheme.store_filter_settings ) { 1829 jq.cookie( 'bp-' + directoryType + '-' + pref, value, { 1830 path: '/', 1831 secure: ( 'https:' === window.location.protocol ) 1832 } ); 1833 } 1834 1835 directoryPreferences[ directoryType ][ pref ] = value; 1836 } 1837 1838 /* Setup activity scope and filter based on the current cookie settings. */ 1839 function bp_init_activity() { 1840 var scope = bp_get_directory_preference( 'activity', 'scope' ); 1841 var filter = bp_get_directory_preference( 'activity', 'filter' ); 1842 1843 if ( undefined !== filter && jq('#activity-filter-select').length ) { 1844 jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true ); 1845 } 1846 1847 /* Activity Tab Set */ 1848 if ( undefined !== scope && jq('.activity-type-tabs').length ) { 1849 jq('.activity-type-tabs li').each( function() { 1850 jq(this).removeClass('selected'); 1851 }); 1852 jq('#activity-' + scope + ', .item-list-tabs li.current').addClass('selected'); 1853 } 1854 } 1855 1856 /* Setup object scope and filter based on the current cookie settings for the object. */ 1857 function bp_init_objects(objects) { 1858 jq(objects).each( function(i) { 1859 var scope = bp_get_directory_preference( objects[i], 'scope' ); 1860 var filter = bp_get_directory_preference( objects[i], 'filter' ); 1861 1862 if ( undefined !== filter && jq('#' + objects[i] + '-order-select select').length ) { 1863 jq('#' + objects[i] + '-order-select select option[value="' + filter + '"]').prop( 'selected', true ); 1864 } 1865 1866 if ( undefined !== scope && jq('div.' + objects[i]).length ) { 1867 jq('.item-list-tabs li').each( function() { 1868 jq(this).removeClass('selected'); 1869 }); 1870 jq('#' + objects[i] + '-' + scope + ', #object-nav li.current').addClass('selected'); 1871 } 1872 }); 1873 } 1874 1875 /* Filter the current content list (groups/members/blogs/topics) */ 1876 function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller, template ) { 1877 if ( 'activity' === object ) { 1878 return false; 1879 } 1880 1881 if ( null === scope || scope === undefined ) { 1882 scope = 'all'; 1883 } 1884 1885 /* Save the settings we want to remain persistent */ 1886 bp_set_directory_preference( object, 'scope', scope ); 1887 bp_set_directory_preference( object, 'filter', filter ); 1888 bp_set_directory_preference( object, 'extras', extras ); 1889 1890 /* Set the correct selected nav and filter */ 1891 jq('.item-list-tabs li').each( function() { 1892 jq(this).removeClass('selected'); 1893 }); 1894 1895 jq('#' + object + '-' + scope + ', #object-nav li.current').addClass('selected'); 1896 jq('.item-list-tabs li.selected').addClass('loading'); 1897 jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true ); 1898 1899 if ( 'friends' === object || 'group_members' === object ) { 1900 object = 'members'; 1901 } 1902 1903 if ( bp_ajax_request ) { 1904 bp_ajax_request.abort(); 1905 } 1906 1907 // Get directory preferences (called "cookie" for legacy reasons). 1908 var cookies = {}; 1909 cookies['bp-' + object + '-filter'] = bp_get_directory_preference( object, 'filter' ); 1910 cookies['bp-' + object + '-scope'] = bp_get_directory_preference( object, 'scope' ); 1911 1912 var cookie = encodeURIComponent( jq.param( cookies ) ); 1913 1914 bp_ajax_request = jq.post( ajaxurl, { 1915 action: object + '_filter', 1916 'cookie': cookie, 1917 'object': object, 1918 'filter': filter, 1919 'search_terms': search_terms, 1920 'scope': scope, 1921 'page': page, 1922 'extras': extras, 1923 'template': template 1924 }, 1925 function(response) 1926 { 1927 /* animate to top if called from bottom pagination */ 1928 if ( caller === 'pag-bottom' && jq('#subnav').length ) { 1929 var top = jq('#subnav').parent(); 1930 jq('html,body').animate({scrollTop: top.offset().top}, 'slow', function() { 1931 jq(target).fadeOut( 100, function() { 1932 jq(this).html(response); 1933 jq(this).fadeIn(100); 1934 // Init Masonry 1935 youzify_init_directory_masonry(); 1936 }); 1937 }); 1938 } else { 1939 jq(target).fadeOut( 100, function() { 1940 jq(this).html(response); 1941 jq(this).fadeIn(100); 1942 // Init Masonry 1943 youzify_init_directory_masonry(); 1944 }); 1945 } 1946 1947 jq('.item-list-tabs li.selected').removeClass('loading'); 1948 1949 }); 1950 } 1951 1952 /** 1953 * Init Directory 1954 */ 1955 function youzify_init_directory_masonry() { 1956 1957 if ( jq( '#youzify-members-directory' )[0] && jq( '#youzify-members-list' )[0] ) { 1958 // Set the container that Masonry will be inside of in a var 1959 var members_container = document.querySelector( '#youzify-members-list' ); 1960 1961 // Create empty var msnry 1962 var members_msnry; 1963 1964 // Initialize Masonry after all images have loaded 1965 imagesLoaded( members_container, function() { 1966 members_msnry = new Masonry( members_container, { 1967 itemSelector: '#youzify-members-list > li' 1968 }); 1969 }); 1970 1971 } 1972 1973 // Activate Groups Masonry Layout. 1974 if ( jq( '#youzify-groups-directory' )[0] && jq( '#youzify-groups-list' )[0] ) { 1975 1976 // Set the container that Masonry will be inside of in a var 1977 var groups_container = document.querySelector( '#youzify-groups-list'); 1978 1979 // Create empty var msnry 1980 var groups_msnry; 1981 1982 // Initialize Masonry after all images have loaded 1983 imagesLoaded( groups_container, function() { 1984 groups_msnry = new Masonry( groups_container, { 1985 itemSelector: '#youzify-groups-list li' 1986 }); 1987 }); 1988 1989 } 1990 } 1991 1992 /* Activity Loop Requesting */ 1993 function bp_activity_request(scope, filter) { 1994 /* Save the type and filter */ 1995 bp_set_directory_preference( 'activity', 'scope', scope ); 1996 bp_set_directory_preference( 'activity', 'filter', filter ); 1997 1998 /* Remove selected and loading classes from tabs */ 1999 jq('.item-list-tabs li').each( function() { 2000 jq(this).removeClass('selected loading'); 2001 }); 2002 /* Set the correct selected nav and filter */ 2003 jq('#activity-' + scope + ', .item-list-tabs li.current').addClass('selected'); 2004 jq('#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading'); 2005 jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true ); 2006 2007 /* Reload the activity stream based on the selection */ 2008 jq('.widget_bp_activity_widget h2 span.ajax-loader').show(); 2009 2010 if ( bp_ajax_request ) { 2011 bp_ajax_request.abort(); 2012 } 2013 2014 // Get directory preferences (called "cookie" for legacy reasons). 2015 var cookies = { 2016 'bp-activity-filter': bp_get_directory_preference( 'activity', 'filter' ), 2017 'bp-activity-scope': bp_get_directory_preference( 'activity', 'scope' ) 2018 }; 2019 2020 var cookie = encodeURIComponent( jq.param( cookies ) ); 2021 2022 bp_ajax_request = jq.post( ajaxurl, { 2023 action: 'activity_widget_filter', 2024 'cookie': cookie, 2025 '_wpnonce_activity_filter': jq('#_wpnonce_activity_filter').val(), 2026 'scope': scope, 2027 'filter': filter 2028 }, 2029 function(response) 2030 { 2031 jq('.widget_bp_activity_widget h2 span.ajax-loader').hide(); 2032 2033 jq('div.activity').fadeOut( 100, function() { 2034 jq(this).html(response.contents); 2035 jq(this).fadeIn(100); 2036 2037 /* Selectively hide comments */ 2038 bp_legacy_theme_hide_comments(); 2039 }); 2040 2041 /* Update the feed link */ 2042 if ( undefined !== response.feed_url ) { 2043 jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url); 2044 } 2045 2046 jq('.item-list-tabs li.selected').removeClass('loading'); 2047 2048 }, 'json' ); 2049 } 2050 2051 /* Hide long lists of activity comments, only show the latest five root comments. */ 2052 function bp_legacy_theme_hide_comments( container ) { 2053 var comments_divs = jq('div.activity-comments'), 2054 parent_li, comment_lis, comment_count; 2055 2056 if ( container !== undefined) { 2057 comments_divs = container.find( 'div.activity-comments' ); 2058 } 2059 if ( !comments_divs.length ) { 2060 return false; 2061 } 2062 var comments_lengths = window.hasOwnProperty( 'youzify_comments_length' ) ? window.youzify_comments_length : 3; 2063 comments_divs.each( function() { 2064 2065 if ( jq(this).children('ul').children('li').length < comments_lengths) { 2066 return; 2067 } 2068 2069 comments_div = jq(this); 2070 // parent_li = comments_div.parents('#activity-stream > li'); 2071 parent_li = comments_div.parents('#activity-stream > li'); 2072 comment_lis = jq(this).children('ul').children('li'); 2073 comment_count = ' '; 2074 2075 if ( jq('#' + parent_li.attr('id') + ' .activity-comments li').length ) { 2076 comment_count = jq('#' + parent_li.attr('id') + ' .activity-comments li').length; 2077 } 2078 2079 comment_lis.each( function(i) { 2080 if ( i < comment_lis.length - comments_lengths ) { 2081 jq(this).hide(); 2082 2083 if ( !i ) { 2084 jq(this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/">' + BP_DTheme.show_x_comments.replace( '%d', comment_count ) + '</a></li>' ); 2085 } 2086 } 2087 }); 2088 2089 }); 2090 } 2091 2092 /* Helper Functions */ 2093 2094 function checkAll() { 2095 var checkboxes = document.getElementsByTagName('input'), 2096 i; 2097 2098 for(i=0; i<checkboxes.length; i++) { 2099 if(checkboxes[i].type === 'checkbox') { 2100 if($('check_all').checked === '') { 2101 checkboxes[i].checked = ''; 2102 } 2103 else { 2104 checkboxes[i].checked = 'checked'; 2105 } 2106 } 2107 } 2108 } 2109 2110 /** 2111 * Deselects any select options or input options for the specified field element. 2112 * 2113 * @param {String} container HTML ID of the field 2114 * @since 1.2.0 2115 */ 2116 function clear( container ) { 2117 container = document.getElementById( container ); 2118 if ( ! container ) { 2119 return; 2120 } 2121 2122 var radioButtons = container.getElementsByTagName( 'INPUT' ), 2123 options = container.getElementsByTagName( 'OPTION' ), 2124 i = 0; 2125 2126 if ( radioButtons ) { 2127 for ( i = 0; i < radioButtons.length; i++ ) { 2128 radioButtons[i].checked = ''; 2129 } 2130 } 2131 2132 if ( options ) { 2133 for ( i = 0; i < options.length; i++ ) { 2134 options[i].selected = false; 2135 } 2136 } 2137 } 2138 2139 /* Returns a querystring of BP cookies (cookies beginning with 'bp-') */ 2140 function bp_get_cookies() { 2141 var allCookies = document.cookie.split(';'), // get all cookies and split into an array 2142 bpCookies = {}, 2143 cookiePrefix = 'bp-', 2144 i, cookie, delimiter, name, value; 2145 2146 // loop through cookies 2147 for (i = 0; i < allCookies.length; i++) { 2148 cookie = allCookies[i]; 2149 delimiter = cookie.indexOf('='); 2150 name = jq.trim( unescape( cookie.slice(0, delimiter) ) ); 2151 value = unescape( cookie.slice(delimiter + 1) ); 2152 2153 // if BP cookie, store it 2154 if ( name.indexOf(cookiePrefix) === 0 ) { 2155 bpCookies[name] = value; 2156 } 2157 } 2158 2159 // returns BP cookies as querystring 2160 return encodeURIComponent( jq.param(bpCookies) ); 2161 } 2162 2163 /** 2164 * Get a querystring parameter from a URL. 2165 * 2166 * @param {String} Query string parameter name. 2167 * @param {String} URL to parse. Defaults to current URL. 2168 */ 2169 function bp_get_query_var( param, url ) { 2170 var qs = {}; 2171 2172 // Use current URL if no URL passed. 2173 if ( typeof url === 'undefined' ) { 2174 url = location.search.substr(1).split('&'); 2175 } else { 2176 url = url.split('?')[1].split('&'); 2177 } 2178 2179 // Parse querystring into object props. 2180 // http://stackoverflow.com/a/21152762 2181 url.forEach(function(item) { 2182 qs[item.split('=')[0]] = item.split('=')[1] && decodeURIComponent( item.split('=')[1] ); 2183 }); 2184 2185 if ( qs.hasOwnProperty( param ) && qs[param] != null ) { 2186 return qs[param]; 2187 } else { 2188 return false; 2189 } 2190 } 1 var jq=jQuery,bp_ajax_request=null,newest_activities="",activity_last_recorded=0,directoryPreferences={};function bp_get_directory_preference(e,t){var i={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var a,s={};for(a in i)i.hasOwnProperty(a)&&(s[a]=i[a]);directoryPreferences[e]=s}return BP_DTheme.store_filter_settings&&(directoryPreferences[e][t]=jq.cookie("bp-"+e+"-"+t)),directoryPreferences[e][t]}function bp_set_directory_preference(e,t,i){var a={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var s,n={};for(s in a)a.hasOwnProperty(s)&&(n[s]=a[s]);directoryPreferences[e]=n}BP_DTheme.store_filter_settings&&jq.cookie("bp-"+e+"-"+t,i,{path:"/",secure:"https:"===window.location.protocol}),directoryPreferences[e][t]=i}function bp_init_activity(){var e=bp_get_directory_preference("activity","scope"),t=bp_get_directory_preference("activity","filter");void 0!==t&&jq("#activity-filter-select").length&&jq('#activity-filter-select select option[value="'+t+'"]').prop("selected",!0),void 0!==e&&jq(".activity-type-tabs").length&&(jq(".activity-type-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#activity-"+e+", .item-list-tabs li.current").addClass("selected"))}function bp_init_objects(a){jq(a).each(function(e){var t=bp_get_directory_preference(a[e],"scope"),i=bp_get_directory_preference(a[e],"filter");void 0!==i&&jq("#"+a[e]+"-order-select select").length&&jq("#"+a[e]+'-order-select select option[value="'+i+'"]').prop("selected",!0),void 0!==t&&jq("div."+a[e]).length&&(jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+a[e]+"-"+t+", #object-nav li.current").addClass("selected"))})}function bp_filter_request(e,t,i,a,s,n,r,o,c){if("activity"===e)return!1;bp_set_directory_preference(e,"scope",i=null==i?"all":i),bp_set_directory_preference(e,"filter",t),bp_set_directory_preference(e,"extras",r),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+e+"-"+i+", #object-nav li.current").addClass("selected"),jq(".item-list-tabs li.selected").addClass("loading"),jq('.item-list-tabs select option[value="'+t+'"]').prop("selected",!0),"friends"!==e&&"group_members"!==e||(e="members"),bp_ajax_request&&bp_ajax_request.abort();var l={},l=(l["bp-"+e+"-filter"]=bp_get_directory_preference(e,"filter"),l["bp-"+e+"-scope"]=bp_get_directory_preference(e,"scope"),encodeURIComponent(jq.param(l)));bp_ajax_request=jq.post(ajaxurl,{action:e+"_filter",cookie:l,object:e,filter:t,search_terms:s,scope:i,page:n,extras:r,template:c},function(e){var t;"pag-bottom"===o&&jq("#subnav").length?(t=jq("#subnav").parent(),jq("html,body").animate({scrollTop:t.offset().top},"slow",function(){jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100),youzify_init_directory_masonry()})})):jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100),youzify_init_directory_masonry()}),jq(".item-list-tabs li.selected").removeClass("loading")})}function youzify_init_directory_masonry(){var e,t;jq("#youzify-members-directory")[0]&&jq("#youzify-members-list")[0]&&(e=document.querySelector("#youzify-members-list"),imagesLoaded(e,function(){new Masonry(e,{itemSelector:"#youzify-members-list > li"})})),jq("#youzify-groups-directory")[0]&&jq("#youzify-groups-list")[0]&&(t=document.querySelector("#youzify-groups-list"),imagesLoaded(t,function(){new Masonry(t,{itemSelector:"#youzify-groups-list li"})}))}function bp_activity_request(e,t){bp_set_directory_preference("activity","scope",e),bp_set_directory_preference("activity","filter",t),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected loading")}),jq("#activity-"+e+", .item-list-tabs li.current").addClass("selected"),jq("#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected").addClass("loading"),jq('#activity-filter-select select option[value="'+t+'"]').prop("selected",!0),jq(".widget_bp_activity_widget h2 span.ajax-loader").show(),bp_ajax_request&&bp_ajax_request.abort();var i={"bp-activity-filter":bp_get_directory_preference("activity","filter"),"bp-activity-scope":bp_get_directory_preference("activity","scope")},i=encodeURIComponent(jq.param(i));bp_ajax_request=jq.post(ajaxurl,{action:"activity_widget_filter",cookie:i,_wpnonce_activity_filter:jq("#_wpnonce_activity_filter").val(),scope:e,filter:t},function(e){jq(".widget_bp_activity_widget h2 span.ajax-loader").hide(),jq("div.activity").fadeOut(100,function(){jq(this).html(e.contents),jq(this).fadeIn(100),bp_legacy_theme_hide_comments()}),void 0!==e.feed_url&&jq(".directory #subnav li.feed a, .home-page #subnav li.feed a").attr("href",e.feed_url),jq(".item-list-tabs li.selected").removeClass("loading")},"json")}function bp_legacy_theme_hide_comments(e){var t,i,a,s=jq("div.activity-comments");if(!(s=void 0!==e?e.find("div.activity-comments"):s).length)return!1;var n=window.hasOwnProperty("youzify_comments_length")?window.youzify_comments_length:3;s.each(function(){jq(this).children("ul").children("li").length<n||(comments_div=jq(this),t=comments_div.parents("#activity-stream > li"),i=jq(this).children("ul").children("li"),a=" ",jq("#"+t.attr("id")+" .activity-comments li").length&&(a=jq("#"+t.attr("id")+" .activity-comments li").length),i.each(function(e){e<i.length-n&&(jq(this).hide(),e||jq(this).before('<li class="show-all"><a href="#'+t.attr("id")+'/show-all/">'+BP_DTheme.show_x_comments.replace("%d",a)+"</a></li>"))}))})}function checkAll(){for(var e=document.getElementsByTagName("input"),t=0;t<e.length;t++)"checkbox"===e[t].type&&(""===$("check_all").checked?e[t].checked="":e[t].checked="checked")}function clear(e){if(e=document.getElementById(e)){var t=e.getElementsByTagName("INPUT"),i=e.getElementsByTagName("OPTION"),a=0;if(t)for(a=0;a<t.length;a++)t[a].checked="";if(i)for(a=0;a<i.length;a++)i[a].selected=!1}}function bp_get_cookies(){for(var e,t,i,a=document.cookie.split(";"),s={},n=0;n<a.length;n++)e=(i=a[n]).indexOf("="),t=jq.trim(unescape(i.slice(0,e))),i=unescape(i.slice(e+1)),0===t.indexOf("bp-")&&(s[t]=i);return encodeURIComponent(jq.param(s))}function bp_get_query_var(e,t){var i={};return(t=(void 0===t?location.search.substr(1):t.split("?")[1]).split("&")).forEach(function(e){i[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}),!(!i.hasOwnProperty(e)||null==i[e])&&i[e]}jq(document).ready(function(){var i,e,a,l=1;"undefined"!=typeof BP_DTheme&&(bp_init_activity(),i=jq("#whats-new"),bp_init_objects(["members","groups","blogs","group_members"]),i.length&&bp_get_querystring("r")?(e=i.val(),jq("#whats-new-options").slideDown(),i.animate({height:"3.8em"}),jq.scrollTo(i,500,{offset:-125,easing:"swing"}),i.val("").focus().val(e)):jq("#whats-new-options").hide(),i.focus(function(){jq("#whats-new-options").slideDown(),jq(this).animate({height:"3.8em"}),jq("#aw-whats-new-submit").prop("disabled",!1),jq(this).parent().addClass("active"),jq("#whats-new-content").addClass("active");var e=jq("form#whats-new-form"),t=jq("#activity-all");e.hasClass("submitted")&&e.removeClass("submitted"),t.length&&(t.hasClass("selected")?"-1"!==jq("#activity-filter-select select").val()&&(jq("#activity-filter-select select").val("-1"),jq("#activity-filter-select select").trigger("change")):(jq("#activity-filter-select select").val("-1"),t.children("a").trigger("click")))}),jq("#whats-new-form").on("focusout",function(e){var t=jq(this);setTimeout(function(){t.find(":hover").length||""===i.val()&&(i.animate({height:"2.2em"}),jq("#whats-new-options").slideUp(),jq("#aw-whats-new-submit").prop("disabled",!0),jq("#whats-new-content").removeClass("active"),i.parent().removeClass("active"))},0)}),jq("#aw-whats-new-submit").on("click",function(){var a=0,e=jq(this),s=e.closest("form#whats-new-form"),i={};return jq.each(s.serializeArray(),function(e,t){"_"!==t.name.substr(0,1)&&"whats-new"!==t.name.substr(0,9)&&(i[t.name]?jq.isArray(i[t.name])?i[t.name].push(t.value):i[t.name]=new Array(i[t.name],t.value):i[t.name]=t.value)}),s.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),e.addClass("loading"),e.prop("disabled",!0),s.addClass("submitted"),object="",item_id=jq("#whats-new-post-in").val(),content=jq("#whats-new").val(),firstrow=jq("#youzify ul.activity-list li").first(),activity_row=firstrow,timestamp=null,firstrow.length&&(activity_row.hasClass("load-newest")&&(activity_row=firstrow.next()),timestamp=activity_row.prop("class").match(/date-recorded-([0-9]+)/)),timestamp&&(a=timestamp[1]),0<item_id&&(object=jq("#whats-new-post-object").val()),e=jq.extend({action:"post_update",cookie:bp_get_cookies(),_wpnonce_post_update:jq("#_wpnonce_post_update").val(),content:content,object:object,item_id:item_id,since:a,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},i),jq.post(ajaxurl,e,function(e){var t,i;s.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),e[0]+e[1]==="-1"?(s.prepend(e.substr(2,e.length)),jq("#"+s.attr("id")+" div.error").hide().fadeIn(200)):(0===jq("ul.activity-list").length&&(jq("div.error").slideUp(100).remove(),jq("#message").slideUp(100).remove(),jq("div.activity").append('<ul id="activity-stream" class="activity-list item-list">')),firstrow.hasClass("load-newest")&&firstrow.remove(),jq("#activity-stream").prepend(e),a||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length&&(e=jq("#activity-stream li.new-update .activity-content .activity-inner p").html(),t=jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr("href"),i=""!==jq("#activity-stream li.new-update .activity-content .activity-inner p").text()?e+" ":"",i+='<a href="'+t+'" rel="nofollow">'+BP_DTheme.view+"</a>",jq("#latest-update").slideUp(300,function(){jq("#latest-update").html(i),jq("#latest-update").slideDown(300)})),jq("li.new-update").hide().slideDown(300),jq("li.new-update").removeClass("new-update"),jq("#whats-new").val(""),s.get(0).reset(),newest_activities="",activity_last_recorded=0),jq("#whats-new-options").slideUp(),jq("#whats-new-form textarea").animate({height:"2.2em"}),jq("#aw-whats-new-submit").prop("disabled",!0).removeClass("loading"),jq("#whats-new-content").removeClass("active")}),!1}),jq("div.activity-type-tabs").on("click",function(e){var t,i=jq(e.target).parent();if("STRONG"===e.target.nodeName||"SPAN"===e.target.nodeName)i=i.parent();else if("A"!==e.target.nodeName)return!1;return e=i.attr("id").substr(9,i.attr("id").length),t=jq("#activity-filter-select select").val(),"mentions"===e&&jq("#"+i.attr("id")+" a strong").remove(),bp_activity_request(e,t),!1}),jq("#activity-filter-select select").change(function(){var e=jq("div.activity-type-tabs li.selected"),t=jq(this).val(),e=e.length?e.attr("id").substr(9,e.attr("id").length):null;return bp_activity_request(e,t),!1}),jq("div.activity").on("click",function(e){var t,i,a,s,n,r,o,c=jq(e.target);if(c.hasClass("fav")||c.hasClass("unfav"))return c.hasClass("loading")||(t=c.hasClass("fav")?"fav":"unfav",o=(o=c.closest(".activity-item")).attr("id").substr(9,o.attr("id").length),a=bp_get_query_var("_wpnonce",c.attr("href")),c.addClass("loading"),jq.post(ajaxurl,{action:"activity_mark_"+t,cookie:bp_get_cookies(),id:o,nonce:a},function(e){c.removeClass("loading"),c.fadeOut(200,function(){jq(this).html(e),jq(this).attr("title","fav"==t?BP_DTheme.remove_fav:BP_DTheme.mark_as_fav),jq(this).fadeIn(200)}),"fav"==t?(jq(".item-list-tabs #activity-favs-personal-li").length||(jq(".item-list-tabs #activity-favorites").length||jq(".item-list-tabs ul #activity-mentions").before('<li id="activity-favorites"><a href="#">'+BP_DTheme.my_favs+" <span>0</span></a></li>"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())+1)),c.removeClass("fav"),c.addClass("unfav")):(c.removeClass("unfav"),c.addClass("fav"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())-1),Number(jq(".item-list-tabs ul #activity-favorites span").html())||(jq(".item-list-tabs ul #activity-favorites").hasClass("selected")&&bp_activity_request(null,null),jq(".item-list-tabs ul #activity-favorites").remove())),"activity-favorites"===jq(".item-list-tabs li.selected").attr("id")&&c.closest(".activity-item").slideUp(100)})),!1;if(c.hasClass("spam-activity"))return i=c.parents("div.activity ul li"),s=i.prop("class").match(/date-recorded-([0-9]+)/),c.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:i.attr("id").substr(9,i.attr("id").length),_wpnonce:c.attr("href").split("_wpnonce=")[1]},function(e){e[0]+e[1]==="-1"?(i.prepend(e.substr(2,e.length)),i.children("#message").hide().fadeIn(300)):(i.slideUp(300),s&&activity_last_recorded===s[1]&&(newest_activities="",activity_last_recorded=0))}),!1;if(c.parent().hasClass("load-more")){bp_ajax_request&&bp_ajax_request.abort(),jq("#youzify li.load-more").addClass("loading"),n=l+1,r=[],jq(".activity-list li.just-posted").each(function(){r.push(jq(this).attr("id").replace("activity-",""))});let e=bp_get_cookies();return e||(o={"bp-activity-filter":bp_get_directory_preference("activity","filter"),"bp-activity-scope":bp_get_directory_preference("activity","scope")},e=encodeURIComponent(jq.param(o))),load_more_args={action:"activity_get_older_updates",cookie:e,page:parseInt(new URL(jq(c).prop("href")).searchParams.get("acpage"),10),place_id:new URL(jq(c).prop("href")).searchParams.get("place_id"),exclude_just_posted:r.join(",")},(load_more_search=bp_get_querystring("s"))&&(load_more_args.search_terms=load_more_search),bp_ajax_request=jq.post(ajaxurl,load_more_args,function(e){jq("#youzify li.load-more").removeClass("loading"),l=n;e=jq(e.contents);jq("#youzify ul.activity-list").append(e),c.parent().hide(),bp_legacy_theme_hide_comments(e),window.instgrm&&window.instgrm.Embeds.process()},"json"),!1}c.parent().hasClass("load-newest")&&(e.preventDefault(),c.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(e,t){"LI"===t.nodeName&&jq(t).hasClass("just-posted")&&jq("#"+jq(t).attr("id")).length&&jq("#"+jq(t).attr("id")).remove()}),jq("#youzify ul.activity-list").prepend(newest_activities),newest_activities="")}),jq("div.activity").on("click",".activity-read-more a",function(e){var e=jq(e.target),t=e.parent().attr("id").split("-"),i=t[3],t=t[0],a=jq("#"+t+"-"+i+" ."+("acomment"===t?"acomment-content":"activity-inner")+":first");return jq(e).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:i},function(e){jq(a).slideUp(300).html(e).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(e){var a,s,t,i,n,r,o,c,l=jq(e.target),d=jq(this).closest(".activity"),e=l.closest(".acomment-reply");return e.length?(i=(e=(l=e).attr("id").split("-"))[2],c=l.attr("href").substring(10),(a=d.find("#ac-form-"+i)).css("display","none"),a.removeClass("root"),jq(".ac-form").hide(),a.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),("comment"!==e[1]?d.find("#acomment-"+c):d.find("#activity-"+i+" .activity-comments")).append(a),a.parent().hasClass("activity-comments")&&a.addClass("root"),a.slideDown(200),jq.scrollTo(a,500,{offset:-100,easing:"swing"}),d.find("#ac-form-"+e[2]+" textarea").focus(),!1):"ac_form_submit"===l.attr("name")?(c=(a=l.parents("form")).parent(),s=a.attr("id").split("-"),t=c.hasClass("activity-comments")?s[2]:c.attr("id").split("-")[1],content=d.find("#"+a.attr("id")+" textarea"),d.find("#"+a.attr("id")+" div.error").hide(),l.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),i={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment").val(),comment_id:t,form_id:s[2],content:content.val()},(e=jq("#_bp_as_nonce_"+t).val())&&(i["_bp_as_nonce_"+t]=e),jq.post(ajaxurl,i,function(t){var i,e;l.removeClass("loading"),content.removeClass("loading"),t[0]+t[1]==="-1"?a.append(jq(t.substr(2,t.length)).hide().fadeIn(200)):(i=a.parent(),a.fadeOut(200,function(){0===i.children("ul").length&&(i.hasClass("activity-comments")?i.prepend("<ul></ul>"):i.append("<ul></ul>"));var e=jq.trim(t);i.children("ul").append(jq(e).hide().fadeIn(200)),a.children("textarea").val(""),i.parent().addClass("has-comments")}),d.find("#"+a.attr("id")+" textarea").val(""),n=Number(jq("#activity-"+s[2]+" a.acomment-reply span").html())+1,jq("#activity-"+s[2]+" a.acomment-reply span").html(n),(n=i.parents(".activity-comments").find(".show-all a"))&&(e=n.text().match(/\((.*)\)/),n.html(BP_DTheme.show_x_comments.replace("%d",Number(e[1])+1)))),jq(l).prop("disabled",!1),jq(content).prop("disabled",!1)}),!1):l.hasClass("acomment-delete")?(r=l.attr("href"),o=l.parent().parent(),a=o.parents("div.activity-comments").children("form"),c=r.split("_wpnonce=")[1],t=(t=(t=r.split("cid="))[1].split("&"))[0],l.addClass("loading"),jq(".activity-comments ul .error").remove(),o.parents(".activity-comments").append(a),jq.post(ajaxurl,{action:"delete_activity_comment",cookie:bp_get_cookies(),_wpnonce:c,id:t},function(e){var t,i,a;e[0]+e[1]==="-1"?o.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200)):(e=jq("#"+o.attr("id")+" ul").children("li"),t=0,jq(e).each(function(){jq(this).is(":hidden")||t++}),o.fadeOut(200,function(){o.remove()}),i=(e=jq("#"+o.parents("#activity-stream > li").attr("id")+" a.acomment-reply span")).html()-(1+t),e.html(i),(e=o.parents(".activity-comments").find(".show-all a"))&&(a=e.text().match(/\((.*)\)/))&&e.html(BP_DTheme.show_x_comments.replace("%d",Number(a[1])-1)),0==i&&jq(o.parents("#activity-stream > li")).removeClass("has-comments"))}),!1):l.hasClass("spam-activity-comment")?(r=l.attr("href"),o=l.parent().parent(),l.addClass("loading"),jq(".activity-comments ul div.error").remove(),o.parents(".activity-comments").append(o.parents(".activity-comments").children("form")),jq.post(ajaxurl,{action:"bp_spam_activity_comment",cookie:encodeURIComponent(document.cookie),_wpnonce:r.split("_wpnonce=")[1],id:r.split("cid=")[1].split("&")[0]},function(e){var t;e[0]+e[1]==="-1"?o.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200)):(e=jq("#"+o.attr("id")+" ul").children("li"),t=0,jq(e).each(function(){jq(this).is(":hidden")||t++}),o.fadeOut(200),e=o.parents("#activity-stream > li"),jq("#"+e.attr("id")+" a.acomment-reply span").html(jq("#"+e.attr("id")+" a.acomment-reply span").html()-(1+t)))}),!1):l.parent().hasClass("show-all")?(l.parent().addClass("loading"),setTimeout(function(){l.parent().parent().children("li").fadeIn(200,function(){l.parent().remove()})},600),!1):l.hasClass("ac-reply-cancel")?(jq(l).closest(".ac-form").slideUp(200),!1):void 0}),jq(document).keydown(function(e){(e=e||window.event).target?element=e.target:e.srcElement&&(element=e.srcElement),3===element.nodeType&&(element=element.parentNode),!0!==e.ctrlKey&&!0!==e.altKey&&!0!==e.metaKey&&27===(e.keyCode||e.which)&&"TEXTAREA"===element.tagName&&jq(element).hasClass("ac-input")&&jq(element).parent().parent().parent().slideUp(200)}),jq(".dir-search, .groups-members-search").on("click",function(e){var t,i,a;return!jq(this).hasClass("no-ajax")&&"submit"===(a=jq(e.target)).attr("type")?(jq(".item-list-tabs li.selected")[0]||jq(".item-list-tabs li:first").addClass("selected"),t=jq(".item-list-tabs li.selected").attr("id").split("-")[0],i=null,a=a.parent().find("#"+t+"_search").val(),"groups-members-search"===e.currentTarget.className&&(t="group_members",i="groups/single/members"),e=bp_get_directory_preference(t,"scope"),bp_filter_request(t,bp_get_directory_preference(t,"filter"),e=e||"all","div."+t,a,1,bp_get_directory_preference(t,"extras"),null,i),!1):void 0}),jq("div.item-list-tabs").on("click",function(e){var t;if(jq("body").hasClass("type")&&jq("body").hasClass("directory")&&jq(this).addClass("no-ajax"),!jq(this).hasClass("no-ajax")&&!jq(e.target).hasClass("no-ajax"))return e="SPAN"===e.target.nodeName?e.target.parentNode:e.target,"LI"!==(e=jq(e).parent())[0].nodeName||e.hasClass("last")?void 0:("activity"!==(t=(e=e.attr("id").split("-"))[0])&&(e=e[1],bp_filter_request(t,jq("#"+t+"-order-select select").val(),e,"div."+t,jq("#"+t+"_search").val(),1,bp_get_directory_preference(t,"extras"))),!1)}),jq("li.filter select").change(function(){var e,t=jq(".item-list-tabs li.selected").length?jq(".item-list-tabs li.selected"):jq(this),t=t.attr("id").split("-"),i=t[0],t=t[1],a=jq(this).val(),s=!1,n=null;return jq(".dir-search input").length&&(s=jq(".dir-search input").val()),(e=jq(".groups-members-search input")).length&&(s=e.val(),i="members",t="groups"),"members"===i&&"groups"===t&&(i="group_members",n="groups/single/members"),bp_filter_request(i="friends"===i?"members":i,a,t,"div."+i,s,1,bp_get_directory_preference(i,"extras"),null,n),!1}),jq("#youzify").on("click",function(e){var t,i,a,s,n,r,o,e=jq(e.target);return!!e.hasClass("button")||(e.parent().parent().hasClass("pagination")&&!e.parent().parent().hasClass("no-ajax")?(e.hasClass("dots")||e.hasClass("current")||(t=(n=(jq(".item-list-tabs li.selected").length?jq(".item-list-tabs li.selected"):jq("li.filter select")).attr("id").split("-"))[0],i=!1,r=jq(e).closest(".pagination-links").attr("id"),a=null,jq("div.dir-search input").length&&(i=!(i=jq(".dir-search input")).val()&&bp_get_querystring(i.attr("name"))?jq(".dir-search input").prop("placeholder"):i.val()),s=(jq(e).hasClass("next")||jq(e).hasClass("prev")?jq(".pagination span.current"):jq(e)).html(),s=Number(s.replace(/\D/g,"")),jq(e).hasClass("next")?s++:jq(e).hasClass("prev")&&s--,(e=jq(".groups-members-search input")).length&&(i=e.val(),t="members"),"members"===t&&"groups"===n[1]&&(t="group_members",a="groups/single/members"),"admin"===t&&jq("body").hasClass("membership-requests")&&(t="requests"),e=-1!==r.indexOf("pag-bottom")?"pag-bottom":null,n=bp_get_directory_preference(t,"scope"),r=bp_get_directory_preference(t,"filter"),o=bp_get_directory_preference(t,"extras"),console.log("object"+t),console.log("scope"+n),console.log("filter"+r),console.log("extras"+o),console.log("page_number"+s),bp_filter_request(t,r,n,"div."+t,i,s,o,e,a)),!1):void 0)}),jq("#send-invite-form").on("click","#invite-list input",function(){var t,i,a=jq("#send-invite-form > .invite").length;jq(".ajax-loader").toggle(),a&&jq(this).parents("ul").find("input").prop("disabled",!0),t=jq(this).val(),i=!0===jq(this).prop("checked")?"invite":"uninvite",a||jq(".item-list-tabs li.selected").addClass("loading"),jq.post(ajaxurl,{action:"groups_invite_user",friend_action:i,cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:t,group_id:jq("#group_id").val()},function(e){jq("#message")&&jq("#message").hide(),a?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),"invite"===i?jq("#friend-list").append(e):"uninvite"===i&&jq("#friend-list li#uid-"+t).remove(),jq(".item-list-tabs li.selected").removeClass("loading"))})}),jq("#send-invite-form").on("click","a.remove",function(){var t=jq("#send-invite-form > .invite").length,i=jq(this).attr("id");return jq(".ajax-loader").toggle(),i=(i=i.split("-"))[1],jq.post(ajaxurl,{action:"groups_invite_user",friend_action:"uninvite",cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:i,group_id:jq("#group_id").val()},function(e){t?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),jq("#friend-list #uid-"+i).remove(),jq("#invite-list #f-"+i).prop("checked",!1))}),!1}),jq(".visibility-toggle-link").on("click",function(e){e.preventDefault(),jq(this).attr("aria-expanded","true").parent().hide().addClass("field-visibility-settings-hide").siblings(".field-visibility-settings").show().addClass("field-visibility-settings-open")}),jq(".field-visibility-settings-close").on("click",function(e){e.preventDefault(),jq(".visibility-toggle-link").attr("aria-expanded","false");var e=jq(this).parent(),t=e.find("input:checked").parent().text();e.hide().removeClass("field-visibility-settings-open").siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(t).end().show().removeClass("field-visibility-settings-hide")}),jq("#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select").change(function(){var t=!0;jq("#profile-edit-form input:submit, #signup_form input:submit").on("click",function(){t=!1}),window.onbeforeunload=function(e){if(t)return BP_DTheme.unsaved_changes}}),jq("#friend-list a.accept, #friend-list a.reject").on("click",function(){var e,t=jq(this),i=jq(this).parents("#friend-list li"),a=jq(this).parents("li div.action"),s=i.attr("id").substr(11,i.attr("id").length),n=t.attr("href").split("_wpnonce=")[1];return jq(this).hasClass("accepted")||jq(this).hasClass("rejected")||((jq(this).hasClass("accept")?(e="accept_friendship",a.children("a.reject")):(e="reject_friendship",a.children("a.accept"))).css("visibility","hidden"),t.addClass("loading"),jq.post(ajaxurl,{action:e,cookie:bp_get_cookies(),id:s,_wpnonce:n},function(e){t.removeClass("loading"),e[0]+e[1]==="-1"?(i.prepend(e.substr(2,e.length)),i.children("#message").hide().fadeIn(200)):t.fadeOut(100,function(){(jq(this).hasClass("accept")?(a.children("a.reject").hide(),jq(this).html(BP_DTheme.accepted)):(a.children("a.accept").hide(),jq(this).html(BP_DTheme.rejected))).contents().unwrap()})})),!1}),jq("#members-dir-list, #members-group-list, #item-header").on("click",".friendship-button a",function(){var e,i,t;if(!jq(this).hasClass("awaiting_response_friend"))return jq(this).parent().addClass("loading"),t=jq(this).attr("id"),e=jq(this).attr("href"),i=jq(this),t=(t=t.split("-"))[1],e=(e=(e=e.split("?_wpnonce="))[1].split("&"))[0],jq.post(ajaxurl,{action:"addremove_friend",cookie:bp_get_cookies(),fid:t,_wpnonce:e},function(e){var t=i.attr("rel");parentdiv=i.parent(),"add"===t?jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("add_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("pending_friend"),parentdiv.fadeIn(200).html(e)}):"remove"===t&&jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("remove_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("add"),parentdiv.fadeIn(200).html(e)})}),!1}),jq("#youzify").on("click",".group-button .leave-group",function(){if(!1===confirm(BP_DTheme.leave_group_confirm))return!1}),jq("#groups-dir-list").on("click",".group-button a",function(){var e=jq(this).parent().attr("id"),t=jq(this).attr("href"),s=jq(this);return e=(e=e.split("-"))[1],t=(t=(t=t.split("?_wpnonce="))[1].split("&"))[0],s.hasClass("leave-group")&&!1===confirm(BP_DTheme.leave_group_confirm)||jq.post(ajaxurl,{action:"joinleave_group",cookie:bp_get_cookies(),gid:e,_wpnonce:t},function(i){var a=s.parent();jq("body.directory").length?jq(a).fadeOut(200,function(){a.fadeIn(200).html(i);var e=jq("#groups-personal span"),t=1;s.hasClass("leave-group")?(a.hasClass("hidden")&&a.closest("li").slideUp(200),t=0):s.hasClass("request-membership")&&(t=!1),e.length&&!1!==t&&(t?e.text(1+(e.text()>>0)):e.text((e.text()>>0)-1))}):window.location.reload()}),!1}),jq("#groups-list li.hidden").each(function(){"none"===jq(this).css("display")&&jq(this).css("cssText","display: list-item !important")}),jq("#youzify").on("click",".pending",function(){return!1}),jq("body").hasClass("register")&&((e=jq("#signup_with_blog")).prop("checked")||jq("#blog-details").toggle(),e.change(function(){jq("#blog-details").toggle()})),jq(".message-search").on("click",function(e){var t,i,a;return!jq(this).hasClass("no-ajax")&&("submit"===(e=jq(e.target)).attr("type")||"button"===e.attr("type"))?(t=bp_get_directory_preference(e="messages","scope"),i=bp_get_directory_preference(e,"filter"),a=bp_get_directory_preference(e,"extras"),bp_filter_request(e,i,t,"div."+e,jq("#messages_search").val(),1,a),!1):void 0}),jq("#send_reply_button").click(function(){var t=jq("#messages_order").val()||"ASC",i=jq("#message-recipients").offset(),a=jq("#send_reply_button");return jq(a).addClass("loading").prop("disabled",!0),jq.post(ajaxurl,{action:"messages_send_reply",cookie:bp_get_cookies(),_wpnonce:jq("#send_message_nonce").val(),content:jq("#message_content").val(),send_to:jq("#send_to").val(),subject:jq("#subject").val(),thread_id:jq("#thread_id").val()},function(e){e[0]+e[1]==="-1"?jq("#send-reply").prepend(e.substr(2,e.length)):(jq("#send-reply #message").remove(),jq("#message_content").val(""),"ASC"===t?jq("#send-reply").before(e):(jq("#message-recipients").after(e),jq(window).scrollTop(i.top)),jq(".new-message").hide().slideDown(200,function(){jq(".new-message").removeClass("new-message")})),jq(a).removeClass("loading").prop("disabled",!1)}),!1}),jq("body.messages #item-body div.messages").on("change","#message-type-select",function(){var e=this.value,t=jq('td input[type="checkbox"]'),i="checked";switch(t.each(function(e){t[e].checked=""}),e){case"unread":t=jq('tr.unread td input[type="checkbox"]');break;case"read":t=jq('tr.read td input[type="checkbox"]');break;case"":i=""}t.each(function(e){t[e].checked=i})}),jq("#select-all-messages").click(function(e){this.checked?jq(".message-check").each(function(){this.checked=!0}):jq(".message-check").each(function(){this.checked=!1})}),jq("#messages-bulk-manage").attr("disabled","disabled"),jq("#messages-select").on("change",function(){jq("#messages-bulk-manage").attr("disabled",jq(this).val().length<=0)}),starAction=function(){var t=jq(this);return jq.post(ajaxurl,{action:"messages_star",message_id:t.data("message-id"),star_status:t.data("star-status"),nonce:t.data("star-nonce"),bulk:t.data("star-bulk")},function(e){1===parseInt(e,10)&&("unstar"===t.data("star-status")?(t.data("star-status","star"),t.removeClass("message-action-unstar").addClass("message-action-star"),t.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_star),1===BP_PM_Star.is_single_thread?t.attr("data-bp-tooltip",BP_PM_Star.strings.title_star):t.attr("data-bp-tooltip",BP_PM_Star.strings.title_star_thread)):(t.data("star-status","unstar"),t.removeClass("message-action-star").addClass("message-action-unstar"),t.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_unstar),1===BP_PM_Star.is_single_thread?t.attr("data-bp-tooltip",BP_PM_Star.strings.title_unstar):t.attr("data-bp-tooltip",BP_PM_Star.strings.title_unstar_thread)))}),!1},jq("#message-threads").on("click","td.thread-star a",starAction),jq("#message-thread").on("click",".message-star-actions a",starAction),jq("#message-threads td.bulk-select-check :checkbox").on("change",function(){var e=jq(this),t=e.closest("tr").find(".thread-star a");e.prop("checked")?"unstar"===t.data("star-status")?BP_PM_Star.star_counter++:BP_PM_Star.unstar_counter++:"unstar"===t.data("star-status")?BP_PM_Star.star_counter--:BP_PM_Star.unstar_counter--,0<BP_PM_Star.star_counter&&0===parseInt(BP_PM_Star.unstar_counter,10)?jq('option[value="star"]').hide():jq('option[value="star"]').show(),0<BP_PM_Star.unstar_counter&&0===parseInt(BP_PM_Star.star_counter,10)?jq('option[value="unstar"]').hide():jq('option[value="unstar"]').show()}),jq("#select-all-notifications").click(function(e){this.checked?jq(".notification-check").each(function(){this.checked=!0}):jq(".notification-check").each(function(){this.checked=!1})}),jq("#notification-bulk-manage").attr("disabled","disabled"),jq("#notification-select").on("change",function(){jq("#notification-bulk-manage").attr("disabled",jq(this).val().length<=0)}),jq("#select-all-invitations").on("click",function(){this.checked?jq(".invitation-check").each(function(){this.checked=!0}):jq(".invitation-check").each(function(){this.checked=!1})}),jq("#invitation-bulk-manage").attr("disabled","disabled"),jq("#invitation-select").on("change",function(){jq("#invitation-bulk-manage").attr("disabled",jq(this).val().length<=0)}),jq("#close-notice").on("click",function(){return jq(this).addClass("loading"),jq("#sidebar div.error").remove(),jq.post(ajaxurl,{action:"messages_close_notice",notice_id:jq(".notice").attr("rel").substr(2,jq(".notice").attr("rel").length),nonce:jq("#close-notice-nonce").val()},function(e){jq("#close-notice").removeClass("loading"),e[0]+e[1]==="-1"?(jq(".notice").prepend(e.substr(2,e.length)),jq("#sidebar div.error").hide().fadeIn(200)):jq(".notice").slideUp(100)}),!1}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover(function(){jq(this).addClass("sfhover")}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout(function(){jq(this).removeClass("sfhover")}),jq("#wp-admin-bar-logout, a.logout").on("click",function(){jq.removeCookie("bp-activity-scope",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-oldestpage",{path:"/",secure:"https:"===window.location.protocol});var t=["members","groups","blogs","forums"];jq(t).each(function(e){jq.removeCookie("bp-"+t[e]+"-scope",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+t[e]+"-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+t[e]+"-extras",{path:"/",secure:"https:"===window.location.protocol})})}),jq("body").hasClass("no-js")&&jq("body").attr("class",jq("body").attr("class").replace(/no-js/,"js")),"undefined"!=typeof wp&&void 0!==wp.heartbeat&&void 0!==BP_DTheme.pulse&&(wp.heartbeat.interval(Number(BP_DTheme.pulse)),jq.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send.buddypress")}})),a=0,jq(document).on("heartbeat-send.buddypress",function(e,t){a=0,jq("#youzify ul.activity-list li:not(.youzify-pinned-post)").first().prop("id")&&(timestamp=jq("#youzify ul.activity-list li:not(.youzify-pinned-post)").first().prop("class").match(/date-recorded-([0-9]+)/))&&(a=timestamp[1]),(0===activity_last_recorded||Number(a)>activity_last_recorded)&&(activity_last_recorded=Number(a)),t.bp_activity_last_recorded=activity_last_recorded,t.bp_heartbeat=bp_get_cookies()||encodeURIComponent(jq.param({"bp-activity-scope":null})),(last_recorded_search=bp_get_querystring("s"))&&(t.bp_activity_last_recorded_search_terms=last_recorded_search)}),jq(document).on("heartbeat-tick",function(e,t){t.bp_activity_newest_activities&&(newest_activities=t.bp_activity_newest_activities.activities+newest_activities,activity_last_recorded=Number(t.bp_activity_newest_activities.last_recorded),jq("#youzify ul.activity-list li").first().hasClass("load-newest")||jq("#youzify ul.activity-list").prepend('<li class="load-newest"><a href="#newest">'+BP_DTheme.newest+"</a></li>"))}))}); -
youzify/trunk/includes/public/core/class-youzify-account.php
r3125439 r3440212 1204 1204 function save_notification( $notifications ) { 1205 1205 1206 youzify_log( $notifications );1207 1208 1206 // Init New Array(); 1209 1207 $bp_notification = array(); -
youzify/trunk/includes/public/core/class-youzify-attachments.php
r3166404 r3440212 149 149 } 150 150 151 151 152 /** 152 153 * Save Posts Embeds Videos. … … 169 170 170 171 foreach ( array_unique( $match[0] ) as $link ) { 172 173 if ( ! youzify_is_safe_url( $link ) ) { 174 continue; 175 } 171 176 172 177 foreach ( $supported_videos as $provider => $domain ) { … … 750 755 751 756 $attachment_id = ''; 757 758 // ---- SSRF Protection ---- 759 if ( is_string( $file_path ) && preg_match( '#^https?://#i', $file_path ) ) { 760 return new WP_Error( 'youzify_remote_file_not_allowed' ); 761 } 752 762 753 763 // Call Required Files -
youzify/trunk/includes/public/core/functions/live-preview/classes/LinkPreview.php
r2968299 r3440212 186 186 function getPage( $url ) { 187 187 188 $lang = apply_filters( 'youzify_live_preview_request_lang', 'en-US' ); 189 188 190 // Get Preview Args 189 191 $args = array( … … 191 193 'redirection' => 10, 192 194 'headers' => array( 193 'user-agent' => 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2)' 195 'user-agent' => 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2)', 196 'Accept-Language' => $lang 194 197 ) 195 198 ); -
youzify/trunk/includes/public/core/functions/youzify-general-functions.php
r3117964 r3440212 1071 1071 1072 1072 } 1073 1074 1075 /** 1076 * Check if a URL is safe for server-side requests. 1077 * Blocks internal IPs, loopbacks, and non-standard ports. 1078 */ 1079 function youzify_is_safe_url( $url ) { 1080 1081 // Define the security arguments for WordPress 1082 $args = array( 1083 'reject_unsafe_urls' => true, // Blocks internal/private IP ranges 1084 ); 1085 1086 // Pass the $args into the native WordPress validator 1087 // This is the most robust way to prevent SSRF in WordPress 1088 if ( ! wp_http_validate_url( $url, $args ) ) { 1089 return false; 1090 } 1091 1092 // Additional check: Ensure the IP doesn't resolve to a private range 1093 // (Protects against DNS Rebinding/Localhost bypasses) 1094 $host = parse_url( $url, PHP_URL_HOST ); 1095 1096 if ( ! $host ) { 1097 return false; 1098 } 1099 1100 $ip = gethostbyname( $host ); 1101 1102 if ( ! filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) { 1103 return false; 1104 } 1105 1106 return true; 1107 } -
youzify/trunk/includes/public/core/reviews/class-youzify-reviews-query.php
r3227855 r3440212 221 221 function delete_review( $review_id ) { 222 222 223 if ( ! youzify_is_user_can_delete_reviews() || ! youzify_is_user_review( $review_id ) ) { 224 return false; 223 if ( ! is_super_admin() ) { 224 if ( ! youzify_is_user_can_delete_reviews() || ! youzify_is_user_review( $review_id ) ) { 225 return false; 226 } 225 227 } 226 228 -
youzify/trunk/includes/public/core/wall/class-youzify-functions.php
r3185951 r3440212 342 342 $linkPreview = new LinkPreview(); 343 343 344 // youzify_log('siir') 344 345 // Print Preview. 345 346 echo $linkPreview->crawl( strip_tags( sanitize_text_field( $_POST['text'] ) ), -1, '' ); 346 347 347 SetUp::finish(); 348 348 -
youzify/trunk/includes/public/core/woocommerce/class-youzify-wc-redirects.php
r3105489 r3440212 53 53 case 'set-default-payment-method': 54 54 case 'delete-payment-method': 55 $url = add_query_arg( $endpoint, $value, $base_path . 'payment ' );55 $url = add_query_arg( $endpoint, $value, $base_path . 'payment-methods' ); 56 56 break; 57 57 -
youzify/trunk/includes/public/core/woocommerce/class-youzify-wc-templates.php
r3166404 r3440212 84 84 85 85 // Woocommerce Payments Scripts. 86 // $this->stripe_scritps(); 86 87 $this->woocommerce_scripts(); 87 88 88 89 // Stripe Script. 89 $this->stripe_scritps();90 90 91 91 woocommerce_account_add_payment_method(); … … 169 169 170 170 // Register Script. 171 wp_register_script( 'wc-add-payment-method', WC()->plugin_url() . 'assets/js/frontend/add-payment-method' . $suffix . '.js', array( 'jquery', 'woocommerce' ), WC()->versio , true );171 wp_register_script( 'wc-add-payment-method', WC()->plugin_url() . 'assets/js/frontend/add-payment-method' . $suffix . '.js', array( 'jquery', 'woocommerce' ), WC()->version, true ); 172 172 173 173 // Call Script. … … 189 189 if ( $payment_management->settings['enabled'] === 'yes' ) { 190 190 191 add_filter( 'woocommerce_is_checkout', '__return_true');191 // add_filter( 'woocommerce_is_checkout', '__return_true'); 192 192 193 if ( isset( $_GET['add-payment-method'] ) ) {194 $_GET['pay_for_order'] = 1;195 }193 // if ( isset( $_GET['add-payment-method'] ) ) { 194 // $_GET['pay_for_order'] = 1; 195 // } 196 196 197 197 $payment_management->payment_scripts(); -
youzify/trunk/includes/public/core/woocommerce/youzify-woocommerce-functions.php
r2848079 r3440212 98 98 return true; 99 99 } 100 101 102 add_filter( 'the_posts', function( $posts ) { 103 if ( function_exists('youzify_is_woocommerce_tab') && youzify_is_woocommerce_tab( 'payment-methods' ) && ( isset( $_GET['add-payment-method'] ) || isset( $_GET['delete-payment-method'] ) ) ) { 104 global $wp_query; 105 $wp_query->is_page = true; 106 $wp_query->queried_object_id = wc_get_page_id( 'myaccount' ); // ID 40 107 $wp_query->queried_object = get_post( $wp_query->queried_object_id ); 108 } 109 return $posts; 110 } ); -
youzify/trunk/readme.txt
r3257383 r3440212 1 1 === Youzify – BuddyPress Community, User Profile, Social Network & Membership Plugin for WordPress === 2 2 Contributors: youzify 3 Tags: buddypress, woocommerce, membership, community, user profile , bbpress, social networking, activity streams, messaging, friends, groups, notifications, member, intranet, forums3 Tags: buddypress, woocommerce, membership, community, user profile 4 4 Donate link: https://www.paypal.me/KaineLabs 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6 7 Tested up to: 6. 68 Stable tag: 1.3. 57 Tested up to: 6.9 8 Stable tag: 1.3.6 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 582 582 = 1.3.5 - 2025-03-18 = 583 583 Fix - Fixed Load More Content Inaccurate 584 585 = 1.3.6 - 2026-01-15 = 586 Security: Improved media handling validation to prevent a theoretical SSRF edge case. 587 588 Security: Added stricter request sanitization and validation checks. 589 590 Fix: Hardened internal request logic for better safety and stability. 591 592 Improvement: General code cleanup and minor performance optimizations. -
youzify/trunk/youzify.php
r3257383 r3440212 4 4 * Plugin URI: https://youzify.com 5 5 * Description: Youzify is a WordPress Community, Social Network and User Profiles management solution with a Secure Membership System, Front-end Account Settings, Powerful Admin Panel, Many Header Styles, +20 Profile Widgets, 16 Color Schemes, Advanced Author Widgets, Fully Responsive Design, Extremely Customizable and a Bunch of Unlimited Features provided by KaineLabs. 6 * Version: 1.3. 56 * Version: 1.3.6 7 7 * Author: KaineLabs 8 8 * Author URI: https://www.kainelabs.com … … 17 17 18 18 // Youzify Version. 19 define( 'YOUZIFY_VERSION', '1.3. 5' );19 define( 'YOUZIFY_VERSION', '1.3.6' ); 20 20 21 21 // Youzify Basename
Note: See TracChangeset
for help on using the changeset viewer.