PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | admin/js/build/list.js +1 -1 2.2 → 3.4 View file →
@@ -1 +1 @@
1 -!function(){"use strict";var e=window.wp.i18n;const t=e=>"#"===e[0]?document.getElementById(e.slice(1)):document.querySelectorAll(e);document.querySelector(".tablepress-all-tables").addEventListener("click",(t=>{if(t.target){if(t.target.matches(".shortcode a"))return prompt((0,e.__)("To embed this table into a post or page, use this Shortcode:","tablepress"),t.target.title),void t.preventDefault();if(t.target.matches(".table-preview a")){const e=window.innerWidth-120,a=window.innerHeight-120;return tb_show(t.target.title,`${t.target.href}#TB_iframe=true&height=${a}&width=${e}`,!1),void t.preventDefault()}}})),t("#tablepress-page").addEventListener("click",(e=>{if(e.target)return e.target.matches(".ajax-link")?(fetch(`${ajaxurl}?${e.target.href.split("?")[1]}`).then((e=>e.text())).then((t=>{"1"===t&&"hide_message"===e.target.dataset.action&&e.target.closest("div").remove()})),void e.preventDefault()):void 0}));const a=t("#doaction");a&&a.addEventListener("click",(a=>{const r=t("#bulk-action-selector-top").value,l=t(".tablepress-all-tables tbody input:checked").length;"-1"!==r&&0!==l&&("delete"!==r||confirm((0,e._n)("Do you really want to delete this table?","Do you really want to delete these tables?",l,"tablepress")))||a.preventDefault()}))}();
1 +(()=>{"use strict";const e={n:t=>{const s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.i18n,s=e=>"#"===e[0]?document.getElementById(e.slice(1)):document.querySelectorAll(e),o=window.React,r=window.ReactDOM,l=window.wp.domReady;var n=e.n(l);window.wp.hooks;const i=window.ReactJSXRuntime,a=window.wp.components,c=window.wp.compose,d=window.wp.data,h=window.wp.primitives;var p=(0,i.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,i.jsx)(h.Path,{d:"M9.5 6.25H6.5C5.80964 6.25 5.25 6.80964 5.25 7.5V17.5C5.25 18.1904 5.80964 18.75 6.5 18.75H16.5C17.1904 18.75 17.75 18.1904 17.75 17.5V14.5M11.5 12.5L18.75 5.25M12.5 5.25H18.75V11.5",vectorEffect:"non-scaling-stroke"})}),v=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,i.jsx)(h.Rect,{x:"4.75",y:"4.75",width:"11.5",height:"11.5",rx:"0.875",vectorEffect:"non-scaling-stroke"}),(0,i.jsx)(h.Path,{d:"M19.25 8.281V17.281C19.25 18.3692 18.3546 19.25 17.251 19.25H6.25",vectorEffect:"non-scaling-stroke"})]});const u=window.wp.notices,w=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"-50 -50 100 100",fill:"#fff",children:[(0,i.jsx)(h.Circle,{r:"42",fill:"#16a34a"}),(0,i.jsx)(h.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,i.jsx)(h.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),x=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"-32 -32 64 64",fill:"#fff",children:[(0,i.jsx)(h.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,i.jsx)(h.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),f=()=>{const{removeNotice:e}=(0,d.useDispatch)(u.store),t=(0,d.useSelect)(e=>e(u.store).getNotices(),[]).filter(({type:e})=>"snackbar"===e);return 0===t.length?null:(0,i.jsx)(a.SnackbarList,{notices:t,onRemove:e})},m=({title:e,url:s,onRequestClose:o})=>(0,i.jsx)(a.Modal,{icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,className:"table-preview-modal",onRequestClose:o,size:"fill",headerActions:(0,i.jsx)(a.Button,{icon:p,size:"compact",label:(0,t.__)("Open the preview in a new tab","tablepress"),href:s,target:"_blank"}),children:(0,i.jsx)("iframe",{title:e,src:s})}),b=({shortcode:e,onRequestClose:s})=>{const{createSuccessNotice:o}=(0,d.useDispatch)(u.store),r=(0,c.useCopyToClipboard)(e,()=>{s(),o((0,t.__)("Copied Shortcode to clipboard.","tablepress"),{type:"snackbar",icon:(0,i.jsx)(a.Icon,{icon:x})})});return(0,i.jsx)(a.Modal,{icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:(0,t.__)("Table Shortcode","tablepress"),onRequestClose:s,children:(0,i.jsxs)(a.__experimentalVStack,{children:[(0,i.jsx)("span",{children:(0,t.__)("To embed this table into a post or page, use this Shortcode:","tablepress")}),(0,i.jsx)(a.__experimentalInputControl,{__next40pxDefaultSize:!0,type:"text",id:"table-information-shortcode",value:e,onFocus:e=>e.target.select(),readOnly:!0,suffix:(0,i.jsx)(a.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,i.jsx)(a.Button,{icon:v,ref:r,size:"small",label:(0,t.__)("Copy Shortcode to clipboard","tablepress")})})})]})})},g=({title:e,deleteUrl:s,closeConfirmDeleteModal:r})=>{const l=(0,o.useRef)(),n=(0,o.useRef)(),c=(0,o.useCallback)(e=>{e.target===l.current||e.target===n.current||"Enter"!==e.key||n.current.click()},[]);return(0,i.jsx)(a.Modal,{size:"medium",icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,isDismissible:!1,onKeyDown:c,onRequestClose:r,children:(0,i.jsxs)(a.__experimentalVStack,{spacing:8,children:[(0,i.jsxs)("span",{children:[(0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",1,"tablepress"),(0,i.jsx)("br",{}),(0,t.__)("Deleting a table is permanent and can not be undone!","tablepress")]}),(0,i.jsxs)(a.__experimentalHStack,{alignment:"right",children:[(0,i.jsx)(a.Button,{ref:l,variant:"tertiary",text:(0,t.__)("Cancel","tablepress"),onClick:r}),(0,i.jsx)(a.Button,{ref:n,variant:"primary",isDestructive:!0,href:s,text:(0,t.__)("Delete","tablepress"),onClick:r})]})]})})},M=()=>{const[e,t]=(0,o.useState)({previewIsOpen:!1,previewUrl:"",previewTitle:"",shortcode:"",shortcodeModalIsOpen:!1}),s=e=>{t(t=>({...t,...e}))};return(0,o.useEffect)(()=>{const e=e=>{if(e.target)return e.target.matches(".table-preview a")&&!(e.ctrlKey||e.metaKey||e.shiftKey)?(s({previewIsOpen:!0,previewUrl:e.target.href,previewTitle:e.target.title}),void e.preventDefault()):e.target.matches(".shortcode a")?(s({shortcode:e.target.title,shortcodeModalIsOpen:!0}),void e.preventDefault()):e.target.matches(".delete a")?(s({confirmDeleteUrl:e.target.href,confirmDeleteTitle:e.target.title,confirmDeleteModalIsOpen:!0}),void e.preventDefault()):void 0};return document.querySelector(".tablepress-all-tables").addEventListener("click",e),()=>{document.querySelector(".tablepress-all-tables").removeEventListener("click",e)}},[]),(0,i.jsxs)(i.Fragment,{children:[e.previewIsOpen&&(0,i.jsx)(m,{title:e.previewTitle,url:e.previewUrl,onRequestClose:()=>s({previewIsOpen:!1})}),e.shortcodeModalIsOpen&&(0,i.jsx)(b,{shortcode:e.shortcode,onRequestClose:()=>s({shortcodeModalIsOpen:!1})}),e.confirmDeleteModalIsOpen&&(0,i.jsx)(g,{title:e.confirmDeleteTitle,deleteUrl:e.confirmDeleteUrl,closeConfirmDeleteModal:()=>s({confirmDeleteModalIsOpen:!1})}),(0,i.jsx)(f,{})]})};document.querySelectorAll("#tablepress-page .ajax-link").forEach(e=>{e.addEventListener("click",e=>{fetch(`${ajaxurl}?${e.target.href.split("?")[1]}`).then(e=>e.text()).then(t=>{"1"===t&&"hide_message"===e.target.dataset.action&&e.target.closest(".notice").remove()}),e.preventDefault()})});const j=s("#doaction");var y;j&&j.addEventListener("click",e=>{window.bulkActionObserverIds.bulk_action="bulk-action-selector-top";const o=s("#bulk-action-selector-top").value,r=s(".tablepress-all-tables tbody input:checked").length;"delete"!==o||confirm((0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",r,"tablepress"))||e.preventDefault()}),y=(0,i.jsx)(M,{}),n()(()=>{const e=document.getElementById("tablepress-list-screen");e&&(0,r.createRoot)(e).render(y)})})();