/* global wc_orders_params */ jQuery( function( $ ) { if ( typeof wc_orders_params === 'undefined' ) { return false; } /** * WCOrdersTable class. */ var WCOrdersTable = function() { $( document ) .on( 'click', '.post-type-shop_order .wp-list-table tbody td, .woocommerce_page_wc-orders .wp-list-table.orders tbody td', this.onRowClick ) .on( 'click', '.order-preview:not(.disabled)', this.onPreview ); }; /** * Click a row. */ WCOrdersTable.prototype.onRowClick = function( e ) { if ( $( e.target ).filter( 'a, a *, .no-link, .no-link *, button, button *' ).length ) { return true; } if ( window.getSelection && window.getSelection().toString().length ) { return true; } var $row = $( this ).closest( 'tr' ), href = $row.find( 'a.order-view' ).attr( 'href' ); if ( href && href.length ) { e.preventDefault(); if ( e.metaKey || e.ctrlKey ) { window.open( href, '_blank' ); } else { window.location = href; } } }; /** * Preview an order. */ WCOrdersTable.prototype.onPreview = function() { var $previewButton = $( this ), $order_id = $previewButton.data( 'orderId' ); if ( $previewButton.data( 'order-data' ) ) { $( this ).WCBackboneModal({ template: 'wc-modal-view-order', variable : $previewButton.data( 'orderData' ) }); } else { $previewButton.addClass( 'disabled' ); $.ajax({ url: wc_orders_params.ajax_url, data: { order_id: $order_id, action : 'woocommerce_get_order_details', security: wc_orders_params.preview_nonce }, type: 'GET', success: function( response ) { $( '.order-preview' ).removeClass( 'disabled' ); if ( response.success ) { $previewButton.data( 'orderData', response.data ); $( this ).WCBackboneModal({ template: 'wc-modal-view-order', variable : response.data }); } } }); } return false; }; /** * Init WCOrdersTable. */ new WCOrdersTable(); } ); 1.0https://www.internationalyouthsociety.orgAdminhttps://www.internationalyouthsociety.org/?author=1<type>rich</type><width>600</width><height>338</height><html><blockquote class="wp-embedded-content" data-secret="XbVs6aC7q6"><a href="https://www.internationalyouthsociety.org/"></a></blockquote><iframe sandbox="allow-scripts" security="restricted" src="https://www.internationalyouthsociety.org/?embed=true#?secret=XbVs6aC7q6" width="600" height="338" title="“” — " data-secret="XbVs6aC7q6" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe><script> /*! This file is auto-generated */ !function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document); </script> </html></oembed>