Changeset 3250534
- Timestamp:
- 03/04/2025 03:19:05 PM (13 months ago)
- Location:
- document-library-lite
- Files:
-
- 30 edited
- 1 copied
-
tags/1.1.3 (copied) (copied from document-library-lite/trunk)
-
tags/1.1.3/assets/js/document-library-main.js (modified) (1 diff)
-
tags/1.1.3/assets/js/src/document-library-main.js (modified) (1 diff)
-
tags/1.1.3/changelog.txt (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.asset.php (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.js (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/src/Admin/Notice.php (modified) (2 diffs)
-
tags/1.1.3/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/src/Plugin/License/EDD_Licensing.php (modified) (3 diffs)
-
tags/1.1.3/dependencies/barn2/barn2-lib/src/Service/Updater.php (modified) (1 diff)
-
tags/1.1.3/dependencies/barn2/barn2-lib/src/WooCommerce/Admin/Custom_Settings_Fields.php (modified) (1 diff)
-
tags/1.1.3/document-library-lite.php (modified) (2 diffs)
-
tags/1.1.3/readme.txt (modified) (2 diffs)
-
tags/1.1.3/src/Plugin.php (modified) (1 diff)
-
tags/1.1.3/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/assets/js/document-library-main.js (modified) (1 diff)
-
trunk/assets/js/src/document-library-main.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.asset.php (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.js (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/src/Admin/Notice.php (modified) (2 diffs)
-
trunk/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/src/Plugin/License/EDD_Licensing.php (modified) (3 diffs)
-
trunk/dependencies/barn2/barn2-lib/src/Service/Updater.php (modified) (1 diff)
-
trunk/dependencies/barn2/barn2-lib/src/WooCommerce/Admin/Custom_Settings_Fields.php (modified) (1 diff)
-
trunk/document-library-lite.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Plugin.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
document-library-lite/tags/1.1.3/assets/js/document-library-main.js
r3157590 r3250534 1 /*! License information is available at CREDITS.md *//******/ (() => { // webpackBootstrap 2 var __webpack_exports__ = {}; 3 /*!************************************************!*\ 4 !*** ./assets/js/src/document-library-main.js ***! 5 \************************************************/ 6 (function ($) { 7 $(document).ready(function () { 8 let tables = $('.document-library-table'); 9 const adminBar = $('#wpadminbar'); 10 const clickFilterColumns = ['doc_categories']; 11 tables.each(function () { 12 let $table = $(this), 13 config = { 14 responsive: true, 15 processing: true, 16 serverSide: document_library_params.lazy_load, 17 language: { 18 processing: '<div class="dots-loader">' + '<div class="dot"></div>' + '<div class="dot"></div>' + '<div class="dot"></div>' + '</div>' 19 } 20 }; 21 this.id = $table.attr('id'); 22 23 // Set language - defaults to English if not specified 24 if (typeof document_library !== 'undefined' && document_library.langurl) { 25 config.language = { 26 url: document_library.langurl 27 }; 28 } 29 30 // Set the ajax URL if the lazy load is enabled 31 if (document_library_params.lazy_load) { 32 config.ajax = { 33 url: document_library_params.ajax_url, 34 type: 'POST', 35 data: { 36 table_id: this.id, 37 action: document_library_params.ajax_action, 38 category: $(".category-search-" + this.id.replace('document-library-', '')).val(), 39 args: document_library_params.args, 40 _ajax_nonce: document_library_params.ajax_nonce 41 } 42 }; 43 } 44 45 // Set the column classes 46 let columns = document_library_params.columns; 47 if (typeof columns === 'object') { 48 columns = Object.values(columns); 49 } 50 let column_classes = []; 51 columns.forEach(column => { 52 column_classes.push({ 53 'className': 'col-' + column.trimStart(), 54 'data': column.trimStart() 55 }); 56 }); 57 config.columns = column_classes; 58 59 // Initialise DataTable 60 let table = $table.DataTable(config); 61 62 // If scroll offset defined, animate back to top of table on next/previous page event 63 $table.on('page.dt', function () { 64 if ($(this).data('scroll-offset') !== false) { 65 let tableOffset = $(this).parent().offset().top - $(this).data('scroll-offset'); 66 if (adminBar.length) { 67 // Adjust offset for WP admin bar 68 let adminBarHeight = adminBar.outerHeight(); 69 tableOffset -= adminBarHeight ? adminBarHeight : 32; 70 } 71 $('html,body').animate({ 72 scrollTop: tableOffset 73 }, 300); 74 } 75 }); 76 77 // Change the animation for the loading state 78 // Listen to the processing event 79 $table.on('processing.dt', function (e, settings, processing) { 80 if (processing) { 81 $table.find('tbody').addClass('loading'); // Show custom loader 82 } else { 83 $table.find('tbody').removeClass('loading'); // Hide custom loader 84 } 85 }); 86 87 // Add category parameter just before the AJAX request is sent 88 table.on('preXhr.dt', function (e, settings, data) { 89 data.category = $(".category-search-" + this.id.replace('document-library-', '')).val(); 90 }); 91 92 // If 'search on click' enabled then add click handler for links in category, author and tags columns. 93 // When clicked, the table will filter by that value. 94 if ($table.data('click-filter')) { 95 $table.on('click', 'a', function () { 96 // Don't filter the table when opening the lightbox 97 if ($(this).hasClass('dlw-lightbox')) { 98 return; 99 } 100 let $link = $(this), 101 idx = table.cell($link.closest('td').get(0)).index().column, 102 // get the column index 103 header = table.column(idx).header(), 104 // get the header cell 105 columnName = $(header).data('name'); // get the column name from header 106 // Is the column click filterable? 107 if (-1 !== clickFilterColumns.indexOf(columnName)) { 108 if (!document_library_params.lazy_load) { 109 table.search($link.text()).draw(); 110 } else { 111 $(".category-search-" + config.ajax.data.table_id.replace("document-library-", "")).val($link.text()); 112 table.draw(); 113 } 114 return false; 115 } 116 return true; 117 }); 118 } 119 }); // each table 120 121 /** 122 * Open Lightbox 123 */ 124 $(document).on('click', '.document-library-table a.dlw-lightbox', function (event) { 125 event.preventDefault(); 126 event.stopPropagation(); 127 const pswpElement = $('.pswp')[0]; 128 const $img = $(this).find('img'); 129 if ($img.length < 1) { 130 return; 131 } 132 const items = [{ 133 src: $img.attr('data-large_image'), 134 w: $img.attr('data-large_image_width'), 135 h: $img.attr('data-large_image_height'), 136 title: $img.attr('data-caption') && $img.attr('data-caption').length ? $img.attr('data-caption') : $img.attr('title') 137 }]; 138 const options = { 139 index: 0, 140 shareEl: false, 141 closeOnScroll: false, 142 history: false, 143 hideAnimationDuration: 0, 144 showAnimationDuration: 0 145 }; 146 147 // Initializes and opens PhotoSwipe 148 let photoswipe = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); 149 photoswipe.init(); 150 return false; 151 }); 152 }); // end document.ready 153 })(jQuery); 154 /******/ })() 155 ; 156 //# sourceMappingURL=document-library-main.js.map 1 (()=>{var a;(a=jQuery)(document).ready((function(){let t=a(".document-library-table");const e=a("#wpadminbar"),r=["doc_categories"];t.each((function(){let t=a(this),l={responsive:!0,processing:!0,serverSide:document_library_params.lazy_load,language:{processing:'<div class="dots-loader"><div class="dot"></div><div class="dot"></div><div class="dot"></div></div>'}};this.id=t.attr("id"),"undefined"!=typeof document_library&&document_library.langurl&&(l.language={url:document_library.langurl}),document_library_params.lazy_load&&(l.ajax={url:document_library_params.ajax_url,type:"POST",data:{table_id:this.id,action:document_library_params.ajax_action,category:a(".category-search-"+this.id.replace("document-library-","")).val(),args:document_library_params.args,_ajax_nonce:document_library_params.ajax_nonce}});let i=document_library_params.columns;"object"==typeof i&&(i=Object.values(i));let o=[];i.forEach((a=>{o.push({className:"col-"+a.trimStart(),data:a.trimStart()})})),l.columns=o;let n=t.DataTable(l);t.on("page.dt",(function(){if(!1!==a(this).data("scroll-offset")){let t=a(this).parent().offset().top-a(this).data("scroll-offset");if(e.length){t-=e.outerHeight()||32}a("html,body").animate({scrollTop:t},300)}})),t.on("processing.dt",(function(a,e,r){r?t.find("tbody").addClass("loading"):t.find("tbody").removeClass("loading")})),n.on("preXhr.dt",(function(t,e,r){r.category=a(".category-search-"+this.id.replace("document-library-","")).val()})),t.data("click-filter")&&t.on("click","a",(function(){if(a(this).hasClass("dlw-lightbox"))return;let t,e=a(this);if(n.cell(e.closest("td").get(0)).index()&&(t=n.cell(e.closest("td").get(0)).index().column),e.closest("td").hasClass("child")){let r=e.closest("li").attr("class").split(" ")[0];t=n.cell(a("td."+r)).index().column}let i=n.column(t).header(),o=a(i).data("name");return-1===r.indexOf(o)||(document_library_params.lazy_load?(a(".category-search-"+l.ajax.data.table_id.replace("document-library-","")).val(e.text()),n.draw()):n.search(e.text()).draw(),!1)}))})),a(document).on("click",".document-library-table a.dlw-lightbox",(function(t){t.preventDefault(),t.stopPropagation();const e=a(".pswp")[0],r=a(this).find("img");if(r.length<1)return;const l=[{src:r.attr("data-large_image"),w:r.attr("data-large_image_width"),h:r.attr("data-large_image_height"),title:r.attr("data-caption")&&r.attr("data-caption").length?r.attr("data-caption"):r.attr("title")}];return new PhotoSwipe(e,PhotoSwipeUI_Default,l,{index:0,shareEl:!1,closeOnScroll:!1,history:!1,hideAnimationDuration:0,showAnimationDuration:0}).init(),!1}))}))})(); -
document-library-lite/tags/1.1.3/assets/js/src/document-library-main.js
r3157590 r3250534 98 98 } 99 99 100 let $link = $( this ), 101 idx = table.cell( $link.closest( 'td' ).get( 0 ) ).index().column, // get the column index 102 header = table.column( idx ).header(), // get the header cell 103 columnName = $( header ).data( 'name' ); // get the column name from header 100 let $link = $( this ), idx; 101 if( table.cell( $link.closest( 'td' ).get( 0 ) ).index() ) { 102 idx = table.cell( $link.closest( 'td' ).get( 0 ) ).index().column; // get the column index 103 } 104 // If the element is in a child row 105 if( $link.closest( 'td' ).hasClass( 'child' ) ) { 106 let parentLi = $link.closest( 'li' ).attr('class').split(' ')[0]; 107 idx = table.cell( $('td.' + parentLi) ).index().column; // get the column index 108 } 109 let header = table.column( idx ).header(), // get the header cell 110 columnName = $( header ).data( 'name' ); // get the column name from header 104 111 // Is the column click filterable? 105 112 if ( -1 !== clickFilterColumns.indexOf( columnName ) ) { -
document-library-lite/tags/1.1.3/changelog.txt
r3197238 r3250534 1 = 1.1.3 = 2 Release date 27 February 2025 3 4 * Dev: Updated internal libraries and tested up to WordPress 6.7.2 5 * Fix: The free version should not register its classes when the pro version is activated 6 * Fix: Search on click was not working for the links in the collapsed columns 7 1 8 = 1.1.2 = 2 9 Release date 26 November 2024 -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css
r3197238 r3250534 1 1 .woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.color-size-field input[type=number]{width:60px}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle}.form-table .radio-image-boxes{display:grid;gap:20px;grid-template-columns:200px 200px 200px 200px;margin-top:25px}@media(max-width:1180px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr 1fr}}@media(max-width:820px){.form-table .radio-image-boxes{grid-template-columns:200px 200px 200px}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:680px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:520px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr}.form-table .radio-image-boxes label{max-width:200px}}.form-table .radio-image-boxes .radio-image{position:relative}.form-table .radio-image-boxes .radio-image>img{border-radius:16px 16px 0 0;height:100%;max-width:200px;width:100%}.form-table .radio-image-boxes .radio-image .image-hover{align-items:center;background:rgba(34,113,177,.8);border-radius:16px 16px 0 0;display:flex;height:100%;justify-content:center;left:0;opacity:1;position:absolute;top:0;visibility:hidden;width:100%}.form-table .radio-image-boxes .radio-image .image-hover img{width:40px}.form-table .radio-image-boxes .radio-image:hover .image-hover{opacity:1;visibility:visible}.form-table .radio-image-boxes .barn2-lightbox-image{display:none}.form-table .radio-image-boxes label{background-color:#fff;border-radius:16px;display:flex!important;flex-direction:column}.form-table .radio-image-boxes label:hover{cursor:pointer}.form-table .radio-image-boxes label span{border-top:1px solid #d9d9d9;box-sizing:border-box;display:inline-block;padding:10px 20px;width:100%} 2 .woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle} -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.asset.php
r3197238 r3250534 3 3 namespace Barn2\Plugin\Document_Library\Dependencies; 4 4 5 return array('dependencies' => array(), 'version' => ' b8f09ea45ef8b2f59d9e');5 return array('dependencies' => array(), 'version' => '72a6c2587a65c05051b9'); -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.js
r3197238 r3250534 1 !function(i, t,n,a){"use strict";i(n).ready((function(){i(n.body).on("click",".barn2-notice .notice-dismiss",(function(){var t=i(this).parent().data();t.id&&t.type&&(t.action="barn2_dismiss_notice",i.ajax({url:ajaxurl,type:"POST",data:t,xhrFields:{withCredentials:!0}}))}))}))}(jQuery,window,document);1 !function(i,n,t,a){"use strict";i(t).ready((function(){i(t.body).on("click",".barn2-notice .notice-dismiss",(function(){const n=i(this).parent(),t=n.data();t.id=t.id||n.prop("id"),t.action="barn2_dismiss_notice",i.ajax({url:ajaxurl,type:"POST",data:t,xhrFields:{withCredentials:!0}})}))}))}(jQuery,window,document); -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/src/Admin/Notice.php
r3197238 r3250534 74 74 \add_action('admin_enqueue_scripts', [$this, 'load_scripts']); 75 75 // Handle AJAX requests to dismiss the notice. 76 \add_action('wp_ajax_barn2_dismiss_ admin_notice', [$this, 'ajax_maybe_dismiss_notice']);76 \add_action('wp_ajax_barn2_dismiss_notice', [$this, 'ajax_maybe_dismiss_notice'], 1); 77 77 } 78 78 } … … 273 273 } 274 274 // Early exit if we're not on a barn2_dismiss_admin_notice action. 275 if (!isset($_POST['action']) || 'barn2_dismiss_ admin_notice' !== $_POST['action']) {275 if (!isset($_POST['action']) || 'barn2_dismiss_notice' !== $_POST['action']) { 276 276 return; 277 277 } -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php
r3197238 r3250534 194 194 // Check data is valid. 195 195 if (!$item_id || !\in_array($notice_type, [self::FIRST_ACTIVATION, self::EXPIRED, self::DISABLED, self::SITE_MOVED], \true)) { 196 \wp_die();196 return; 197 197 } 198 198 if ($item_id === $this->plugin->get_id()) { 199 199 $this->dismiss_notice($notice_type); 200 200 } 201 \wp_die();202 201 } 203 202 private function dismiss_notice($notice_type) -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/src/Plugin/License/EDD_Licensing.php
r3197238 r3250534 18 18 */ 19 19 const EDD_LICENSING_ENDPOINT = 'https://barn2.com/edd-sl'; 20 /** 21 * @var string A relay server which sends the same request when the primary one returns 403 22 */ 23 const EDD_LICENSING_SECONDARY_ENDPOINT = 'https://licensing.barn2.com/'; 20 24 /** 21 25 * @var int API timeout in seconds. … … 119 123 return $result; 120 124 } 121 private function api_request($params )125 private function api_request($params, $retry = \false) 122 126 { 127 // If we are already retrying, use the relay server 128 $endpoint = $retry ? self::EDD_LICENSING_SECONDARY_ENDPOINT : self::EDD_LICENSING_ENDPOINT; 123 129 /** 124 130 * Filter the EDD Software Licensing API endpoint. … … 131 137 * @param array $params The parameters to send to the API. 132 138 */ 133 $endpoint = \apply_filters('barn2_edd_licensing_api_endpoint', self::EDD_LICENSING_ENDPOINT, $this, $params);139 $endpoint = \apply_filters('barn2_edd_licensing_api_endpoint', $endpoint, $this, $params); 134 140 // Call the Software Licensing API. 135 141 $response = \wp_remote_post($endpoint, \apply_filters('barn2_edd_licensing_api_request_args', ['timeout' => self::API_TIMEOUT, 'body' => $params])); 136 142 // Build the result. 137 143 $result = new \stdClass(); 144 // Check if the response is a 403 error and if we should retry 145 if (\wp_remote_retrieve_response_code($response) === 403 && !$retry) { 146 return $this->api_request($params, \true); 147 } 138 148 if (self::is_api_error($response)) { 139 149 $result->success = \false; -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/src/Service/Updater.php
r3197238 r3250534 207 207 // If it needs an update. 208 208 if ($this->needs_update() && !$this->is_updating()) { 209 $script = "( function( \$, window, document, undefined ) {\ r\n\r\n\t\$( function() {\r\n\r\n\t\t\$( '#" . $this->plugin->get_slug() . "-update-db' ).on( 'click', function( e ) {\r\n e.preventDefault();\r\n\r\n \$( '#" . $this->plugin->get_slug() . "_needs_update_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).show();\r\n\r\n\t\t\tvar data = \$( this ).data();\r\n\t\t\tdata.action = '" . $this->plugin->get_slug() . "_update_db';\r\n\t\t\tdata.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_update_db') . "';\r\n\r\n\t\t\t\$.ajax( {\r\n\t\t\t\turl: ajaxurl, // always defined when running in WP Admin\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\tdata: data,\r\n\t\t\t\txhrFields: {\r\n\t\t\t\t\twithCredentials: true\r\n\t\t\t\t}\r\n\t\t\t} ).done(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\r\n\t\t\t}).fail(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\r\n\t\t\t});\r\n\t\t} );\r\n\t} );\r\n\r\n} )( jQuery, window, document );";209 $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n\t\t\$( '#" . $this->plugin->get_slug() . "-update-db' ).on( 'click', function( e ) {\n e.preventDefault();\n\n \$( '#" . $this->plugin->get_slug() . "_needs_update_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).show();\n\n\t\t\tvar data = \$( this ).data();\n\t\t\tdata.action = '" . $this->plugin->get_slug() . "_update_db';\n\t\t\tdata.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_update_db') . "';\n\n\t\t\t\$.ajax( {\n\t\t\t\turl: ajaxurl, // always defined when running in WP Admin\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: data,\n\t\t\t\txhrFields: {\n\t\t\t\t\twithCredentials: true\n\t\t\t\t}\n\t\t\t} ).done(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n\t\t\t}).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n\t\t\t});\n\t\t} );\n\t} );\n\n} )( jQuery, window, document );"; 210 210 } 211 211 // If it's already updating. 212 212 if ($this->needs_update() && $this->is_updating()) { 213 $script = "( function( \$, window, document, undefined ) {\ r\n\r\n\t\$( function() {\r\n\r\n var data = {};\r\n data.action = '" . $this->plugin->get_slug() . "_check_update_db';\r\n data.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_check_update_db') . "';\r\n\r\n \$.ajax( {\r\n url: ajaxurl, // always defined when running in WP Admin\r\n type: 'POST',\r\n data: data,\r\n xhrFields: {\r\n withCredentials: true\r\n }\r\n } ).done(function (out) {\r\n console.log('CHECKED');\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\r\n }).fail(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\r\n });\r\n\r\n\t} );\r\n\r\n} )( jQuery, window, document );";213 $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n var data = {};\n data.action = '" . $this->plugin->get_slug() . "_check_update_db';\n data.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_check_update_db') . "';\n\n \$.ajax( {\n url: ajaxurl, // always defined when running in WP Admin\n type: 'POST',\n data: data,\n xhrFields: {\n withCredentials: true\n }\n } ).done(function (out) {\n console.log('CHECKED');\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n }).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n });\n\n\t} );\n\n} )( jQuery, window, document );"; 214 214 } 215 215 if (isset($script)) { -
document-library-lite/tags/1.1.3/dependencies/barn2/barn2-lib/src/WooCommerce/Admin/Custom_Settings_Fields.php
r2953506 r3250534 563 563 public function register_scripts() 564 564 { 565 /** 566 * Filter to determine if the custom fields scripts should be loaded. 567 * 568 * @param bool $load_scripts Whether to load the custom fields scripts. 569 * @param Plugin $plugin The plugin object. 570 * @return bool 571 */ 572 $load_scripts = \apply_filters("barn2_wc_settings_custom_fields_load_scripts_{$this->plugin->get_slug()}", \true, $this->plugin); 573 if (!$load_scripts) { 574 return; 575 } 565 576 \wp_register_style('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css', [], $this->plugin->get_version()); 566 \wp_register_script('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/js/ wc-settings.js', ['jquery'], $this->plugin->get_version());577 \wp_register_script('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/js/admin/wc-settings.js', ['jquery'], $this->plugin->get_version()); 567 578 } 568 579 public function load_scripts($field) 569 580 { 581 /** 582 * Filter to determine if the custom fields scripts should be loaded. 583 * 584 * @param bool $load_scripts Whether to load the custom fields scripts. 585 * @param Plugin $plugin The plugin object. 586 * @return bool 587 */ 588 $load_scripts = \apply_filters("barn2_wc_settings_custom_fields_load_scripts_{$this->plugin->get_slug()}", \true, $this->plugin); 589 if (!$load_scripts) { 590 return; 591 } 570 592 if (\in_array($field, ['image_size', 'color_size', 'color_picker'], \true)) { 571 593 \wp_enqueue_style('barn2-wc-settings'); -
document-library-lite/tags/1.1.3/document-library-lite.php
r3197238 r3250534 12 12 * Plugin URI: https://wordpress.org/plugins/document-library-lite/ 13 13 * Description: Add documents and display them in a searchable document library. 14 * Version: 1.1. 214 * Version: 1.1.3 15 15 * Author: Barn2 Plugins 16 16 * Author URI: https://barn2.com … … 33 33 } 34 34 35 const PLUGIN_VERSION = '1.1. 2';35 const PLUGIN_VERSION = '1.1.3'; 36 36 const PLUGIN_FILE = __FILE__; 37 37 -
document-library-lite/tags/1.1.3/readme.txt
r3197258 r3250534 6 6 Tested up to: 6.7 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 28 Stable tag: 1.1.3 9 9 License: GPL-3.0 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 206 206 == Changelog == 207 207 208 = 1.1.2 = 209 Release date 26 November 2024 210 211 * Dev: Tested up to WordPress 6.7.1 212 * Dev: Updated the internal libraries 208 = 1.1.3 = 209 Release date 4 March 2025 210 211 * Dev: Updated internal libraries and tested up to WordPress 6.7.2 212 * Fix: The free version should not register its classes when the pro version is activated 213 * Fix: Search on click was not working for the links in the collapsed columns 213 214 214 215 See changelog.txt for more details. -
document-library-lite/tags/1.1.3/src/Plugin.php
r3157590 r3250534 51 51 public function maybe_load_plugin() { 52 52 // Don't load plugin if Pro version active 53 if ( ! Util::is_barn2_plugin_active( '\\Barn2\\Plugin\\ Posts_Table_Pro\\dlp' ) ) {53 if ( ! Util::is_barn2_plugin_active( '\\Barn2\\Plugin\\Document_Library_Pro\\document_library_pro' ) ) { 54 54 add_action( 'after_setup_theme', [ $this, 'start_standard_services' ] ); 55 55 } -
document-library-lite/tags/1.1.3/vendor/composer/installed.php
r3197238 r3250534 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' a46055c422f244c0245aa4c6b1d50066917a30a9',6 'reference' => '71f56d46da35ed0c7ceceedf5c043f5e216d7cd7', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' a46055c422f244c0245aa4c6b1d50066917a30a9',16 'reference' => '71f56d46da35ed0c7ceceedf5c043f5e216d7cd7', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
document-library-lite/trunk/assets/js/document-library-main.js
r3157590 r3250534 1 /*! License information is available at CREDITS.md *//******/ (() => { // webpackBootstrap 2 var __webpack_exports__ = {}; 3 /*!************************************************!*\ 4 !*** ./assets/js/src/document-library-main.js ***! 5 \************************************************/ 6 (function ($) { 7 $(document).ready(function () { 8 let tables = $('.document-library-table'); 9 const adminBar = $('#wpadminbar'); 10 const clickFilterColumns = ['doc_categories']; 11 tables.each(function () { 12 let $table = $(this), 13 config = { 14 responsive: true, 15 processing: true, 16 serverSide: document_library_params.lazy_load, 17 language: { 18 processing: '<div class="dots-loader">' + '<div class="dot"></div>' + '<div class="dot"></div>' + '<div class="dot"></div>' + '</div>' 19 } 20 }; 21 this.id = $table.attr('id'); 22 23 // Set language - defaults to English if not specified 24 if (typeof document_library !== 'undefined' && document_library.langurl) { 25 config.language = { 26 url: document_library.langurl 27 }; 28 } 29 30 // Set the ajax URL if the lazy load is enabled 31 if (document_library_params.lazy_load) { 32 config.ajax = { 33 url: document_library_params.ajax_url, 34 type: 'POST', 35 data: { 36 table_id: this.id, 37 action: document_library_params.ajax_action, 38 category: $(".category-search-" + this.id.replace('document-library-', '')).val(), 39 args: document_library_params.args, 40 _ajax_nonce: document_library_params.ajax_nonce 41 } 42 }; 43 } 44 45 // Set the column classes 46 let columns = document_library_params.columns; 47 if (typeof columns === 'object') { 48 columns = Object.values(columns); 49 } 50 let column_classes = []; 51 columns.forEach(column => { 52 column_classes.push({ 53 'className': 'col-' + column.trimStart(), 54 'data': column.trimStart() 55 }); 56 }); 57 config.columns = column_classes; 58 59 // Initialise DataTable 60 let table = $table.DataTable(config); 61 62 // If scroll offset defined, animate back to top of table on next/previous page event 63 $table.on('page.dt', function () { 64 if ($(this).data('scroll-offset') !== false) { 65 let tableOffset = $(this).parent().offset().top - $(this).data('scroll-offset'); 66 if (adminBar.length) { 67 // Adjust offset for WP admin bar 68 let adminBarHeight = adminBar.outerHeight(); 69 tableOffset -= adminBarHeight ? adminBarHeight : 32; 70 } 71 $('html,body').animate({ 72 scrollTop: tableOffset 73 }, 300); 74 } 75 }); 76 77 // Change the animation for the loading state 78 // Listen to the processing event 79 $table.on('processing.dt', function (e, settings, processing) { 80 if (processing) { 81 $table.find('tbody').addClass('loading'); // Show custom loader 82 } else { 83 $table.find('tbody').removeClass('loading'); // Hide custom loader 84 } 85 }); 86 87 // Add category parameter just before the AJAX request is sent 88 table.on('preXhr.dt', function (e, settings, data) { 89 data.category = $(".category-search-" + this.id.replace('document-library-', '')).val(); 90 }); 91 92 // If 'search on click' enabled then add click handler for links in category, author and tags columns. 93 // When clicked, the table will filter by that value. 94 if ($table.data('click-filter')) { 95 $table.on('click', 'a', function () { 96 // Don't filter the table when opening the lightbox 97 if ($(this).hasClass('dlw-lightbox')) { 98 return; 99 } 100 let $link = $(this), 101 idx = table.cell($link.closest('td').get(0)).index().column, 102 // get the column index 103 header = table.column(idx).header(), 104 // get the header cell 105 columnName = $(header).data('name'); // get the column name from header 106 // Is the column click filterable? 107 if (-1 !== clickFilterColumns.indexOf(columnName)) { 108 if (!document_library_params.lazy_load) { 109 table.search($link.text()).draw(); 110 } else { 111 $(".category-search-" + config.ajax.data.table_id.replace("document-library-", "")).val($link.text()); 112 table.draw(); 113 } 114 return false; 115 } 116 return true; 117 }); 118 } 119 }); // each table 120 121 /** 122 * Open Lightbox 123 */ 124 $(document).on('click', '.document-library-table a.dlw-lightbox', function (event) { 125 event.preventDefault(); 126 event.stopPropagation(); 127 const pswpElement = $('.pswp')[0]; 128 const $img = $(this).find('img'); 129 if ($img.length < 1) { 130 return; 131 } 132 const items = [{ 133 src: $img.attr('data-large_image'), 134 w: $img.attr('data-large_image_width'), 135 h: $img.attr('data-large_image_height'), 136 title: $img.attr('data-caption') && $img.attr('data-caption').length ? $img.attr('data-caption') : $img.attr('title') 137 }]; 138 const options = { 139 index: 0, 140 shareEl: false, 141 closeOnScroll: false, 142 history: false, 143 hideAnimationDuration: 0, 144 showAnimationDuration: 0 145 }; 146 147 // Initializes and opens PhotoSwipe 148 let photoswipe = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); 149 photoswipe.init(); 150 return false; 151 }); 152 }); // end document.ready 153 })(jQuery); 154 /******/ })() 155 ; 156 //# sourceMappingURL=document-library-main.js.map 1 (()=>{var a;(a=jQuery)(document).ready((function(){let t=a(".document-library-table");const e=a("#wpadminbar"),r=["doc_categories"];t.each((function(){let t=a(this),l={responsive:!0,processing:!0,serverSide:document_library_params.lazy_load,language:{processing:'<div class="dots-loader"><div class="dot"></div><div class="dot"></div><div class="dot"></div></div>'}};this.id=t.attr("id"),"undefined"!=typeof document_library&&document_library.langurl&&(l.language={url:document_library.langurl}),document_library_params.lazy_load&&(l.ajax={url:document_library_params.ajax_url,type:"POST",data:{table_id:this.id,action:document_library_params.ajax_action,category:a(".category-search-"+this.id.replace("document-library-","")).val(),args:document_library_params.args,_ajax_nonce:document_library_params.ajax_nonce}});let i=document_library_params.columns;"object"==typeof i&&(i=Object.values(i));let o=[];i.forEach((a=>{o.push({className:"col-"+a.trimStart(),data:a.trimStart()})})),l.columns=o;let n=t.DataTable(l);t.on("page.dt",(function(){if(!1!==a(this).data("scroll-offset")){let t=a(this).parent().offset().top-a(this).data("scroll-offset");if(e.length){t-=e.outerHeight()||32}a("html,body").animate({scrollTop:t},300)}})),t.on("processing.dt",(function(a,e,r){r?t.find("tbody").addClass("loading"):t.find("tbody").removeClass("loading")})),n.on("preXhr.dt",(function(t,e,r){r.category=a(".category-search-"+this.id.replace("document-library-","")).val()})),t.data("click-filter")&&t.on("click","a",(function(){if(a(this).hasClass("dlw-lightbox"))return;let t,e=a(this);if(n.cell(e.closest("td").get(0)).index()&&(t=n.cell(e.closest("td").get(0)).index().column),e.closest("td").hasClass("child")){let r=e.closest("li").attr("class").split(" ")[0];t=n.cell(a("td."+r)).index().column}let i=n.column(t).header(),o=a(i).data("name");return-1===r.indexOf(o)||(document_library_params.lazy_load?(a(".category-search-"+l.ajax.data.table_id.replace("document-library-","")).val(e.text()),n.draw()):n.search(e.text()).draw(),!1)}))})),a(document).on("click",".document-library-table a.dlw-lightbox",(function(t){t.preventDefault(),t.stopPropagation();const e=a(".pswp")[0],r=a(this).find("img");if(r.length<1)return;const l=[{src:r.attr("data-large_image"),w:r.attr("data-large_image_width"),h:r.attr("data-large_image_height"),title:r.attr("data-caption")&&r.attr("data-caption").length?r.attr("data-caption"):r.attr("title")}];return new PhotoSwipe(e,PhotoSwipeUI_Default,l,{index:0,shareEl:!1,closeOnScroll:!1,history:!1,hideAnimationDuration:0,showAnimationDuration:0}).init(),!1}))}))})(); -
document-library-lite/trunk/assets/js/src/document-library-main.js
r3157590 r3250534 98 98 } 99 99 100 let $link = $( this ), 101 idx = table.cell( $link.closest( 'td' ).get( 0 ) ).index().column, // get the column index 102 header = table.column( idx ).header(), // get the header cell 103 columnName = $( header ).data( 'name' ); // get the column name from header 100 let $link = $( this ), idx; 101 if( table.cell( $link.closest( 'td' ).get( 0 ) ).index() ) { 102 idx = table.cell( $link.closest( 'td' ).get( 0 ) ).index().column; // get the column index 103 } 104 // If the element is in a child row 105 if( $link.closest( 'td' ).hasClass( 'child' ) ) { 106 let parentLi = $link.closest( 'li' ).attr('class').split(' ')[0]; 107 idx = table.cell( $('td.' + parentLi) ).index().column; // get the column index 108 } 109 let header = table.column( idx ).header(), // get the header cell 110 columnName = $( header ).data( 'name' ); // get the column name from header 104 111 // Is the column click filterable? 105 112 if ( -1 !== clickFilterColumns.indexOf( columnName ) ) { -
document-library-lite/trunk/changelog.txt
r3197238 r3250534 1 = 1.1.3 = 2 Release date 27 February 2025 3 4 * Dev: Updated internal libraries and tested up to WordPress 6.7.2 5 * Fix: The free version should not register its classes when the pro version is activated 6 * Fix: Search on click was not working for the links in the collapsed columns 7 1 8 = 1.1.2 = 2 9 Release date 26 November 2024 -
document-library-lite/trunk/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css
r3197238 r3250534 1 1 .woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.color-size-field input[type=number]{width:60px}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle}.form-table .radio-image-boxes{display:grid;gap:20px;grid-template-columns:200px 200px 200px 200px;margin-top:25px}@media(max-width:1180px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr 1fr}}@media(max-width:820px){.form-table .radio-image-boxes{grid-template-columns:200px 200px 200px}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:680px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:520px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr}.form-table .radio-image-boxes label{max-width:200px}}.form-table .radio-image-boxes .radio-image{position:relative}.form-table .radio-image-boxes .radio-image>img{border-radius:16px 16px 0 0;height:100%;max-width:200px;width:100%}.form-table .radio-image-boxes .radio-image .image-hover{align-items:center;background:rgba(34,113,177,.8);border-radius:16px 16px 0 0;display:flex;height:100%;justify-content:center;left:0;opacity:1;position:absolute;top:0;visibility:hidden;width:100%}.form-table .radio-image-boxes .radio-image .image-hover img{width:40px}.form-table .radio-image-boxes .radio-image:hover .image-hover{opacity:1;visibility:visible}.form-table .radio-image-boxes .barn2-lightbox-image{display:none}.form-table .radio-image-boxes label{background-color:#fff;border-radius:16px;display:flex!important;flex-direction:column}.form-table .radio-image-boxes label:hover{cursor:pointer}.form-table .radio-image-boxes label span{border-top:1px solid #d9d9d9;box-sizing:border-box;display:inline-block;padding:10px 20px;width:100%} 2 .woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle} -
document-library-lite/trunk/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.asset.php
r3197238 r3250534 3 3 namespace Barn2\Plugin\Document_Library\Dependencies; 4 4 5 return array('dependencies' => array(), 'version' => ' b8f09ea45ef8b2f59d9e');5 return array('dependencies' => array(), 'version' => '72a6c2587a65c05051b9'); -
document-library-lite/trunk/dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.js
r3197238 r3250534 1 !function(i, t,n,a){"use strict";i(n).ready((function(){i(n.body).on("click",".barn2-notice .notice-dismiss",(function(){var t=i(this).parent().data();t.id&&t.type&&(t.action="barn2_dismiss_notice",i.ajax({url:ajaxurl,type:"POST",data:t,xhrFields:{withCredentials:!0}}))}))}))}(jQuery,window,document);1 !function(i,n,t,a){"use strict";i(t).ready((function(){i(t.body).on("click",".barn2-notice .notice-dismiss",(function(){const n=i(this).parent(),t=n.data();t.id=t.id||n.prop("id"),t.action="barn2_dismiss_notice",i.ajax({url:ajaxurl,type:"POST",data:t,xhrFields:{withCredentials:!0}})}))}))}(jQuery,window,document); -
document-library-lite/trunk/dependencies/barn2/barn2-lib/src/Admin/Notice.php
r3197238 r3250534 74 74 \add_action('admin_enqueue_scripts', [$this, 'load_scripts']); 75 75 // Handle AJAX requests to dismiss the notice. 76 \add_action('wp_ajax_barn2_dismiss_ admin_notice', [$this, 'ajax_maybe_dismiss_notice']);76 \add_action('wp_ajax_barn2_dismiss_notice', [$this, 'ajax_maybe_dismiss_notice'], 1); 77 77 } 78 78 } … … 273 273 } 274 274 // Early exit if we're not on a barn2_dismiss_admin_notice action. 275 if (!isset($_POST['action']) || 'barn2_dismiss_ admin_notice' !== $_POST['action']) {275 if (!isset($_POST['action']) || 'barn2_dismiss_notice' !== $_POST['action']) { 276 276 return; 277 277 } -
document-library-lite/trunk/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php
r3197238 r3250534 194 194 // Check data is valid. 195 195 if (!$item_id || !\in_array($notice_type, [self::FIRST_ACTIVATION, self::EXPIRED, self::DISABLED, self::SITE_MOVED], \true)) { 196 \wp_die();196 return; 197 197 } 198 198 if ($item_id === $this->plugin->get_id()) { 199 199 $this->dismiss_notice($notice_type); 200 200 } 201 \wp_die();202 201 } 203 202 private function dismiss_notice($notice_type) -
document-library-lite/trunk/dependencies/barn2/barn2-lib/src/Plugin/License/EDD_Licensing.php
r3197238 r3250534 18 18 */ 19 19 const EDD_LICENSING_ENDPOINT = 'https://barn2.com/edd-sl'; 20 /** 21 * @var string A relay server which sends the same request when the primary one returns 403 22 */ 23 const EDD_LICENSING_SECONDARY_ENDPOINT = 'https://licensing.barn2.com/'; 20 24 /** 21 25 * @var int API timeout in seconds. … … 119 123 return $result; 120 124 } 121 private function api_request($params )125 private function api_request($params, $retry = \false) 122 126 { 127 // If we are already retrying, use the relay server 128 $endpoint = $retry ? self::EDD_LICENSING_SECONDARY_ENDPOINT : self::EDD_LICENSING_ENDPOINT; 123 129 /** 124 130 * Filter the EDD Software Licensing API endpoint. … … 131 137 * @param array $params The parameters to send to the API. 132 138 */ 133 $endpoint = \apply_filters('barn2_edd_licensing_api_endpoint', self::EDD_LICENSING_ENDPOINT, $this, $params);139 $endpoint = \apply_filters('barn2_edd_licensing_api_endpoint', $endpoint, $this, $params); 134 140 // Call the Software Licensing API. 135 141 $response = \wp_remote_post($endpoint, \apply_filters('barn2_edd_licensing_api_request_args', ['timeout' => self::API_TIMEOUT, 'body' => $params])); 136 142 // Build the result. 137 143 $result = new \stdClass(); 144 // Check if the response is a 403 error and if we should retry 145 if (\wp_remote_retrieve_response_code($response) === 403 && !$retry) { 146 return $this->api_request($params, \true); 147 } 138 148 if (self::is_api_error($response)) { 139 149 $result->success = \false; -
document-library-lite/trunk/dependencies/barn2/barn2-lib/src/Service/Updater.php
r3197238 r3250534 207 207 // If it needs an update. 208 208 if ($this->needs_update() && !$this->is_updating()) { 209 $script = "( function( \$, window, document, undefined ) {\ r\n\r\n\t\$( function() {\r\n\r\n\t\t\$( '#" . $this->plugin->get_slug() . "-update-db' ).on( 'click', function( e ) {\r\n e.preventDefault();\r\n\r\n \$( '#" . $this->plugin->get_slug() . "_needs_update_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).show();\r\n\r\n\t\t\tvar data = \$( this ).data();\r\n\t\t\tdata.action = '" . $this->plugin->get_slug() . "_update_db';\r\n\t\t\tdata.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_update_db') . "';\r\n\r\n\t\t\t\$.ajax( {\r\n\t\t\t\turl: ajaxurl, // always defined when running in WP Admin\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\tdata: data,\r\n\t\t\t\txhrFields: {\r\n\t\t\t\t\twithCredentials: true\r\n\t\t\t\t}\r\n\t\t\t} ).done(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\r\n\t\t\t}).fail(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\r\n\t\t\t});\r\n\t\t} );\r\n\t} );\r\n\r\n} )( jQuery, window, document );";209 $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n\t\t\$( '#" . $this->plugin->get_slug() . "-update-db' ).on( 'click', function( e ) {\n e.preventDefault();\n\n \$( '#" . $this->plugin->get_slug() . "_needs_update_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).show();\n\n\t\t\tvar data = \$( this ).data();\n\t\t\tdata.action = '" . $this->plugin->get_slug() . "_update_db';\n\t\t\tdata.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_update_db') . "';\n\n\t\t\t\$.ajax( {\n\t\t\t\turl: ajaxurl, // always defined when running in WP Admin\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: data,\n\t\t\t\txhrFields: {\n\t\t\t\t\twithCredentials: true\n\t\t\t\t}\n\t\t\t} ).done(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n\t\t\t}).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n\t\t\t});\n\t\t} );\n\t} );\n\n} )( jQuery, window, document );"; 210 210 } 211 211 // If it's already updating. 212 212 if ($this->needs_update() && $this->is_updating()) { 213 $script = "( function( \$, window, document, undefined ) {\ r\n\r\n\t\$( function() {\r\n\r\n var data = {};\r\n data.action = '" . $this->plugin->get_slug() . "_check_update_db';\r\n data.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_check_update_db') . "';\r\n\r\n \$.ajax( {\r\n url: ajaxurl, // always defined when running in WP Admin\r\n type: 'POST',\r\n data: data,\r\n xhrFields: {\r\n withCredentials: true\r\n }\r\n } ).done(function (out) {\r\n console.log('CHECKED');\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\r\n }).fail(function (out) {\r\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\r\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\r\n });\r\n\r\n\t} );\r\n\r\n} )( jQuery, window, document );";213 $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n var data = {};\n data.action = '" . $this->plugin->get_slug() . "_check_update_db';\n data.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_check_update_db') . "';\n\n \$.ajax( {\n url: ajaxurl, // always defined when running in WP Admin\n type: 'POST',\n data: data,\n xhrFields: {\n withCredentials: true\n }\n } ).done(function (out) {\n console.log('CHECKED');\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n }).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n });\n\n\t} );\n\n} )( jQuery, window, document );"; 214 214 } 215 215 if (isset($script)) { -
document-library-lite/trunk/dependencies/barn2/barn2-lib/src/WooCommerce/Admin/Custom_Settings_Fields.php
r2953506 r3250534 563 563 public function register_scripts() 564 564 { 565 /** 566 * Filter to determine if the custom fields scripts should be loaded. 567 * 568 * @param bool $load_scripts Whether to load the custom fields scripts. 569 * @param Plugin $plugin The plugin object. 570 * @return bool 571 */ 572 $load_scripts = \apply_filters("barn2_wc_settings_custom_fields_load_scripts_{$this->plugin->get_slug()}", \true, $this->plugin); 573 if (!$load_scripts) { 574 return; 575 } 565 576 \wp_register_style('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css', [], $this->plugin->get_version()); 566 \wp_register_script('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/js/ wc-settings.js', ['jquery'], $this->plugin->get_version());577 \wp_register_script('barn2-wc-settings', $this->plugin->get_dir_url() . 'dependencies/barn2/barn2-lib/build/js/admin/wc-settings.js', ['jquery'], $this->plugin->get_version()); 567 578 } 568 579 public function load_scripts($field) 569 580 { 581 /** 582 * Filter to determine if the custom fields scripts should be loaded. 583 * 584 * @param bool $load_scripts Whether to load the custom fields scripts. 585 * @param Plugin $plugin The plugin object. 586 * @return bool 587 */ 588 $load_scripts = \apply_filters("barn2_wc_settings_custom_fields_load_scripts_{$this->plugin->get_slug()}", \true, $this->plugin); 589 if (!$load_scripts) { 590 return; 591 } 570 592 if (\in_array($field, ['image_size', 'color_size', 'color_picker'], \true)) { 571 593 \wp_enqueue_style('barn2-wc-settings'); -
document-library-lite/trunk/document-library-lite.php
r3197238 r3250534 12 12 * Plugin URI: https://wordpress.org/plugins/document-library-lite/ 13 13 * Description: Add documents and display them in a searchable document library. 14 * Version: 1.1. 214 * Version: 1.1.3 15 15 * Author: Barn2 Plugins 16 16 * Author URI: https://barn2.com … … 33 33 } 34 34 35 const PLUGIN_VERSION = '1.1. 2';35 const PLUGIN_VERSION = '1.1.3'; 36 36 const PLUGIN_FILE = __FILE__; 37 37 -
document-library-lite/trunk/readme.txt
r3197258 r3250534 6 6 Tested up to: 6.7 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 28 Stable tag: 1.1.3 9 9 License: GPL-3.0 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 206 206 == Changelog == 207 207 208 = 1.1.2 = 209 Release date 26 November 2024 210 211 * Dev: Tested up to WordPress 6.7.1 212 * Dev: Updated the internal libraries 208 = 1.1.3 = 209 Release date 4 March 2025 210 211 * Dev: Updated internal libraries and tested up to WordPress 6.7.2 212 * Fix: The free version should not register its classes when the pro version is activated 213 * Fix: Search on click was not working for the links in the collapsed columns 213 214 214 215 See changelog.txt for more details. -
document-library-lite/trunk/src/Plugin.php
r3157590 r3250534 51 51 public function maybe_load_plugin() { 52 52 // Don't load plugin if Pro version active 53 if ( ! Util::is_barn2_plugin_active( '\\Barn2\\Plugin\\ Posts_Table_Pro\\dlp' ) ) {53 if ( ! Util::is_barn2_plugin_active( '\\Barn2\\Plugin\\Document_Library_Pro\\document_library_pro' ) ) { 54 54 add_action( 'after_setup_theme', [ $this, 'start_standard_services' ] ); 55 55 } -
document-library-lite/trunk/vendor/composer/installed.php
r3197238 r3250534 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' a46055c422f244c0245aa4c6b1d50066917a30a9',6 'reference' => '71f56d46da35ed0c7ceceedf5c043f5e216d7cd7', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' a46055c422f244c0245aa4c6b1d50066917a30a9',16 'reference' => '71f56d46da35ed0c7ceceedf5c043f5e216d7cd7', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.