Changeset 3127782
- Timestamp:
- 07/30/2024 04:39:42 AM (20 months ago)
- Location:
- svgator
- Files:
-
- 16 edited
-
tags/1.3.1/admin/css/svgator.css (modified) (6 diffs)
-
tags/1.3.1/admin/js/WP_SVGatorBlock.js (modified) (6 diffs)
-
tags/1.3.1/admin/js/WP_SVGatorMedia.js (modified) (2 diffs)
-
tags/1.3.1/admin/js/WP_SVGatorMenu.js (modified) (22 diffs)
-
tags/1.3.1/includes/class/WP_SVGator/Media.php (modified) (1 diff)
-
tags/1.3.1/includes/class/WP_SVGator/Svg_Support.php (modified) (3 diffs)
-
tags/1.3.1/includes/class/WP_SVGator/Widget_Media_SVGator.php (modified) (1 diff)
-
tags/1.3.1/readme.txt (modified) (1 diff)
-
trunk/admin/css/svgator.css (modified) (6 diffs)
-
trunk/admin/js/WP_SVGatorBlock.js (modified) (6 diffs)
-
trunk/admin/js/WP_SVGatorMedia.js (modified) (2 diffs)
-
trunk/admin/js/WP_SVGatorMenu.js (modified) (22 diffs)
-
trunk/includes/class/WP_SVGator/Media.php (modified) (1 diff)
-
trunk/includes/class/WP_SVGator/Svg_Support.php (modified) (3 diffs)
-
trunk/includes/class/WP_SVGator/Widget_Media_SVGator.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
svgator/tags/1.3.1/admin/css/svgator.css
r3123949 r3127782 165 165 Pagination 166 166 */ 167 #svgator-projects-pagination { 168 float: right; 169 max-width: 100%; 170 } 171 167 172 #svgator-projects-pagination ul { 168 173 display: inline-flex; 174 flex-wrap: wrap; 169 175 justify-content: center; 176 margin: 0; 170 177 width: 100%; 171 178 } … … 182 189 height: 34px; 183 190 line-height: 34px; 184 margin: 5px;191 margin: 0 5px 5px; 185 192 min-width: 34px; 186 193 padding: 0 5px; … … 315 322 } 316 323 317 .wp-block .wp-svgator-image. placeholder {324 .wp-block .wp-svgator-image.wp-svgator-placeholder { 318 325 background: #fff; 319 326 border: solid 1px #000; … … 323 330 } 324 331 325 .wp-block .wp-svgator-image . placeholder-title {332 .wp-block .wp-svgator-image .wp-svgator-placeholder-title { 326 333 font-weight: 600; 327 334 } 328 335 329 .wp-block .wp-svgator-image . placeholder-description {336 .wp-block .wp-svgator-image .wp-svgator-placeholder-description { 330 337 margin: 10px 0; 331 338 } 332 339 333 .wp-block .wp-svgator-image . placeholder-button {340 .wp-block .wp-svgator-image .wp-svgator-placeholder-button { 334 341 background-color: #007bb9; 335 342 border: none; … … 340 347 } 341 348 342 .wp-block .wp-svgator-image . placeholder-button:hover {349 .wp-block .wp-svgator-image .wp-svgator-placeholder-button:hover { 343 350 background-color: #006ba1; 344 351 } … … 441 448 word-break: break-word; 442 449 } 443 444 /**445 Pagination446 */447 448 #svgator-projects-pagination {449 float: right;450 }451 452 #svgator-projects-pagination ul {453 margin: 0;454 }455 456 #svgator-projects-pagination li {457 background-color: #fff;458 border-radius: 4px;459 box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2),460 0 2px 2px 0 rgba(0, 0, 0, .14),461 0 1px 5px 0 rgba(0, 0, 0, .12);462 color: rgba(0, 0, 0, .87);463 cursor: pointer;464 font-size: 16px;465 height: 34px;466 line-height: 34px;467 margin: 0 5px 5px;468 min-width: 34px;469 padding: 0 5px;470 text-align: center;471 transition: .3s cubic-bezier(0, 0, .2, 1);472 }473 474 #svgator-projects-pagination li.active {475 background-color: #1976d2;476 box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .2),477 0 4px 5px 0 rgba(0, 0, 0, .14),478 0 1px 10px 0 rgba(0, 0, 0, .12);479 color: #fff;480 } -
svgator/tags/1.3.1/admin/js/WP_SVGatorBlock.js
r3123949 r3127782 8 8 9 9 let plcHandler = { 10 empty: function(onSvgatorMediaOpen) {10 empty: function(onSvgatorMediaOpen) { 11 11 const placeholderContent = [ 12 12 createEl( 13 13 'div', 14 14 { 15 key: ' placeholder-title',16 className: ' placeholder-title',15 key: 'wp-svgator-placeholder-title', 16 className: 'wp-svgator-placeholder-title', 17 17 }, 18 18 'SVGator', … … 21 21 'div', 22 22 { 23 key: ' placeholder-description',24 className: ' placeholder-description',23 key: 'wp-svgator-placeholder-description', 24 className: 'wp-svgator-placeholder-description', 25 25 }, 26 26 'Import a SVG from your SVGator library, or add one from your WordPress library', … … 29 29 'button', 30 30 { 31 key: ' placeholder-content',32 className: ' placeholder-button',31 key: 'wp-svgator-placeholder-content', 32 className: 'wp-svgator-placeholder-button', 33 33 onClick: () => onSvgatorMediaOpen(), 34 34 }, … … 39 39 'div', 40 40 { 41 key: ' placeholder',42 className: 'wp-svgator-image placeholder',41 key: 'wp-svgator-placeholder', 42 className: 'wp-svgator-image wp-svgator-placeholder', 43 43 }, 44 44 placeholderContent, 45 45 ); 46 46 }, 47 preview: function(props) {48 let attr = props .attributes;49 if(! Object.keys(attr).length) {47 preview: function(props) { 48 let attr = props?.attributes; 49 if(!attr || !Object.keys(attr).length) { 50 50 return; 51 51 } … … 219 219 }; 220 220 221 let placeholder = plcHandler.preview(props) || plcHandler.empty(() => svgatorMedia.open(svgatorMediaOptions));221 const placeholder = plcHandler.preview(props) || plcHandler.empty(() => svgatorMedia.open(svgatorMediaOptions)); 222 222 223 223 if (props.isSelected && !props.attributes.src) { … … 230 230 childElements.push(createBlockControlButton( 231 231 'Select SVG', 232 function() {232 function() { 233 233 svgatorMedia.open(svgatorMediaOptions); 234 234 }) -
svgator/tags/1.3.1/admin/js/WP_SVGatorMedia.js
r3123949 r3127782 167 167 } 168 168 169 function open(options) {169 function open(options) { 170 170 setOptions(options); 171 171 frame.open(); … … 183 183 184 184 this.open = open; 185 this.setOptions = setOptions;186 185 } 187 186 -
svgator/tags/1.3.1/admin/js/WP_SVGatorMenu.js
r3123949 r3127782 13 13 }; 14 14 15 $dom.close.on('click', function () {15 $dom.close.on('click', function() { 16 16 close(); 17 17 }); … … 31 31 } 32 32 33 timeout = window.setTimeout(function () {33 timeout = window.setTimeout(function() { 34 34 close(); 35 35 timeout = false; … … 66 66 this._loginNonce = slf.$('#login-container input[name="svgator_logIn_nonce"]').val(); 67 67 68 slf.$('#svgator-filter').on('submit', function (e) {68 slf.$('#svgator-filter').on('submit', function(e) { 69 69 e.preventDefault(); 70 70 }); 71 71 72 slf.$('#svgator-filter [type="search"]').on('keyup search', function (e) {72 slf.$('#svgator-filter [type="search"]').on('keyup search', function(e) { 73 73 slf.filterProjects(e.target.value); 74 74 }); 75 75 76 slf.$('#login-to-svgator').on('click', function (e) {76 slf.$('#login-to-svgator').on('click', function(e) { 77 77 e.preventDefault(); 78 78 79 slf.updateAuthToken().then(function () {79 slf.updateAuthToken().then(function() { 80 80 let pr = slf.loadProjects(); 81 81 if (!pr) { … … 83 83 } 84 84 85 pr.then(function (data) {85 pr.then(function(data) { 86 86 slf.updateExports(data && data.limits && data.limits.exports); 87 87 slf.listProjects(data.response); 88 88 slf._importProjectNonce = data.nonce; 89 }).catch(function (err) {89 }).catch(function(err) { 90 90 slf.notice.show({ 91 91 msg: (err && err.error) || 'Failed to load projects', … … 97 97 } 98 98 }); 99 }).catch(function (json) {99 }).catch(function(json) { 100 100 let msg = json && json.error || json; 101 101 slf.notice.show({ … … 106 106 }); 107 107 108 slf.$('#svgator-header .logout').on('click', function (e) {108 slf.$('#svgator-header .logout').on('click', function(e) { 109 109 e.preventDefault(); 110 110 111 111 let pr = slf.logout(); 112 112 113 pr.finally(function () {113 pr.finally(function() { 114 114 slf.paginateVisibleProjects(); 115 115 }); … … 131 131 $lis.removeClass('on-filter'); 132 132 133 $lis.each(function (idx, li) {133 $lis.each(function(idx, li) { 134 134 let $li = slf.$(li); 135 135 let liText = $li.find('.svgator-title-container').text().toLowerCase(); … … 172 172 .text(page); 173 173 174 $li.on('click', function () {174 $li.on('click', function() { 175 175 $projects.removeClass('on-page'); 176 176 $projects.filter('[data-page="' + page + '"]').addClass('on-page'); … … 193 193 'action': 'svgator_logOut', 194 194 'svgator_logOut_nonce': this._logoutNonce, 195 }).then(function () {195 }).then(function() { 196 196 slf.notice.show({ 197 197 msg: 'Logged out successfully.', … … 201 201 202 202 slf.$('#svgator-projects').empty(); 203 }).catch(function (err) {203 }).catch(function(err) { 204 204 slf.notice.show({ 205 205 msg: err && err.error || 'Failed to log out.', … … 212 212 updateAuthToken() { 213 213 let slf = this; 214 return new Promise(function (resolve, reject) {214 return new Promise(function(resolve, reject) { 215 215 216 216 const host = ['wp.local', 'localhost'].includes(location.hostname) || location.hostname.includes('.svgator.net') … … 226 226 false, 227 227 endpoint, 228 ).then(function (resp) {228 ).then(function(resp) { 229 229 if (!resp || !resp.auth_code || !resp.app_id) { 230 230 if (reject) { … … 235 235 236 236 slf.saveToken(resp) 237 .then(function (data) {237 .then(function(data) { 238 238 if (!data || !data.success) { 239 239 reject(data && data.error || data); … … 246 246 } 247 247 }) 248 .catch(function (data) {248 .catch(function(data) { 249 249 if (reject) { 250 250 reject(data); 251 251 } 252 252 }); 253 }).catch(function (err) {253 }).catch(function(err) { 254 254 let eMsg = 'Failed to connect to SVGator.'; 255 255 if (err) { … … 337 337 .text('IMPORT TO MEDIA') 338 338 .addClass('svgator-commands-import') 339 .on('click', function (e) {339 .on('click', function(e) { 340 340 e.preventDefault(); 341 341 … … 364 364 }, { 365 365 hoverContainer: project.$dom, 366 }).then(function (data) {366 }).then(function(data) { 367 367 const exports = data 368 368 && data.response … … 374 374 msg: 'Project imported successfully.', 375 375 }); 376 }).catch(function (error) {376 }).catch(function(error) { 377 377 const exports = error 378 378 && error.data … … 392 392 makeRequest(data, options) { 393 393 let slf = this; 394 return new Promise(function (resolve, reject) {394 return new Promise(function(resolve, reject) { 395 395 let $loader = slf.$('<div>').addClass('svgator-loader'); 396 396 if (options && options.hoverContainer) { … … 405 405 null, 406 406 'json', 407 ).done(function (data) {407 ).done(function(data) { 408 408 if (data && data.success === false) { 409 409 if (reject) { … … 416 416 resolve.call(slf, data); 417 417 } 418 }).fail(function () {418 }).fail(function() { 419 419 if (reject) { 420 420 reject.call(slf, data); 421 421 } 422 }).always(function () {422 }).always(function() { 423 423 $loader.remove(); 424 424 }); … … 427 427 } 428 428 429 window.jQuery(function () {429 window.jQuery(function() { 430 430 let wpSvgator = new WP_SVGator(jQuery, SVGator); 431 431 … … 436 436 } 437 437 438 pr.then(function (data) {438 pr.then(function(data) { 439 439 wpSvgator.updateExports(data.limits && data.limits.exports); 440 440 wpSvgator.listProjects(data.response); 441 441 wpSvgator._importProjectNonce = data.nonce; 442 }).catch(function (err) {442 }).catch(function(err) { 443 443 wpSvgator.notice.show({ 444 444 msg: (err && err.error) || 'Failed to load projects', -
svgator/tags/1.3.1/includes/class/WP_SVGator/Media.php
r3123949 r3127782 36 36 } 37 37 38 //$params['content'] = self::fixResponsiveSvg( $params['content'] );39 40 38 // WP_Filesystem_Direct has an $args parameter that is mandatory, however it is not used 41 39 $fs = new WP_Filesystem_Direct( [] ); -
svgator/tags/1.3.1/includes/class/WP_SVGator/Svg_Support.php
r3123949 r3127782 35 35 36 36 function wp_svgInlineReplaceBlock( $content, $block_array, WP_Block $instance ) { 37 if ( ! $instance->block_type|| $instance->block_type->name !== Block::block_type_name ) {37 if ( empty($instance->block_type->name) || $instance->block_type->name !== Block::block_type_name ) { 38 38 return $content; 39 39 } … … 140 140 */ 141 141 public static function fixScript( string $svgContent ) { 142 //Remove CDATA, since Word press does not allow it inside the content142 //Remove CDATA, since WordPress does not allow it inside the content 143 143 $svgContent = str_replace( '<![CDATA[', '', $svgContent ); 144 144 $svgContent = str_replace( ']]>', '', $svgContent ); … … 189 189 } 190 190 191 global $wp_filesystem;192 193 191 // WP_Filesystem_Direct has an $args parameter that is mandatory, however it is not used 194 192 $fs = new WP_Filesystem_Direct( [] ); -
svgator/tags/1.3.1/includes/class/WP_SVGator/Widget_Media_SVGator.php
r3123949 r3127782 115 115 } 116 116 117 // building up $allowed_html list from the output bel low it (we know that only these tags and attributes appear in the output)117 // building up $allowed_html list from the output below it (we know that only these tags and attributes appear in the output) 118 118 $allowed_html = array( 119 119 'div' => array( -
svgator/tags/1.3.1/readme.txt
r3123949 r3127782 92 92 93 93 = 1.3.1 = 94 * Fixed an issue where sometimes selecting an SVG for an SVGator block would update the wrong SVGator block94 * Bugfix - Issue present since original release fixed: From time to time while adding a new SVG, another one on the page got replaced instead 95 95 96 96 = 1.3.0 = -
svgator/trunk/admin/css/svgator.css
r3123220 r3127782 165 165 Pagination 166 166 */ 167 #svgator-projects-pagination { 168 float: right; 169 max-width: 100%; 170 } 171 167 172 #svgator-projects-pagination ul { 168 173 display: inline-flex; 174 flex-wrap: wrap; 169 175 justify-content: center; 176 margin: 0; 170 177 width: 100%; 171 178 } … … 182 189 height: 34px; 183 190 line-height: 34px; 184 margin: 5px;191 margin: 0 5px 5px; 185 192 min-width: 34px; 186 193 padding: 0 5px; … … 315 322 } 316 323 317 .wp-block .wp-svgator-image. placeholder {324 .wp-block .wp-svgator-image.wp-svgator-placeholder { 318 325 background: #fff; 319 326 border: solid 1px #000; … … 323 330 } 324 331 325 .wp-block .wp-svgator-image . placeholder-title {332 .wp-block .wp-svgator-image .wp-svgator-placeholder-title { 326 333 font-weight: 600; 327 334 } 328 335 329 .wp-block .wp-svgator-image . placeholder-description {336 .wp-block .wp-svgator-image .wp-svgator-placeholder-description { 330 337 margin: 10px 0; 331 338 } 332 339 333 .wp-block .wp-svgator-image . placeholder-button {340 .wp-block .wp-svgator-image .wp-svgator-placeholder-button { 334 341 background-color: #007bb9; 335 342 border: none; … … 340 347 } 341 348 342 .wp-block .wp-svgator-image . placeholder-button:hover {349 .wp-block .wp-svgator-image .wp-svgator-placeholder-button:hover { 343 350 background-color: #006ba1; 344 351 } … … 441 448 word-break: break-word; 442 449 } 443 444 /**445 Pagination446 */447 448 #svgator-projects-pagination {449 float: right;450 }451 452 #svgator-projects-pagination ul {453 margin: 0;454 }455 456 #svgator-projects-pagination li {457 background-color: #fff;458 border-radius: 4px;459 box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2),460 0 2px 2px 0 rgba(0, 0, 0, .14),461 0 1px 5px 0 rgba(0, 0, 0, .12);462 color: rgba(0, 0, 0, .87);463 cursor: pointer;464 font-size: 16px;465 height: 34px;466 line-height: 34px;467 margin: 0 5px 5px;468 min-width: 34px;469 padding: 0 5px;470 text-align: center;471 transition: .3s cubic-bezier(0, 0, .2, 1);472 }473 474 #svgator-projects-pagination li.active {475 background-color: #1976d2;476 box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .2),477 0 4px 5px 0 rgba(0, 0, 0, .14),478 0 1px 10px 0 rgba(0, 0, 0, .12);479 color: #fff;480 } -
svgator/trunk/admin/js/WP_SVGatorBlock.js
r3123949 r3127782 8 8 9 9 let plcHandler = { 10 empty: function(onSvgatorMediaOpen) {10 empty: function(onSvgatorMediaOpen) { 11 11 const placeholderContent = [ 12 12 createEl( 13 13 'div', 14 14 { 15 key: ' placeholder-title',16 className: ' placeholder-title',15 key: 'wp-svgator-placeholder-title', 16 className: 'wp-svgator-placeholder-title', 17 17 }, 18 18 'SVGator', … … 21 21 'div', 22 22 { 23 key: ' placeholder-description',24 className: ' placeholder-description',23 key: 'wp-svgator-placeholder-description', 24 className: 'wp-svgator-placeholder-description', 25 25 }, 26 26 'Import a SVG from your SVGator library, or add one from your WordPress library', … … 29 29 'button', 30 30 { 31 key: ' placeholder-content',32 className: ' placeholder-button',31 key: 'wp-svgator-placeholder-content', 32 className: 'wp-svgator-placeholder-button', 33 33 onClick: () => onSvgatorMediaOpen(), 34 34 }, … … 39 39 'div', 40 40 { 41 key: ' placeholder',42 className: 'wp-svgator-image placeholder',41 key: 'wp-svgator-placeholder', 42 className: 'wp-svgator-image wp-svgator-placeholder', 43 43 }, 44 44 placeholderContent, 45 45 ); 46 46 }, 47 preview: function(props) {48 let attr = props .attributes;49 if(! Object.keys(attr).length) {47 preview: function(props) { 48 let attr = props?.attributes; 49 if(!attr || !Object.keys(attr).length) { 50 50 return; 51 51 } … … 219 219 }; 220 220 221 let placeholder = plcHandler.preview(props) || plcHandler.empty(() => svgatorMedia.open(svgatorMediaOptions));221 const placeholder = plcHandler.preview(props) || plcHandler.empty(() => svgatorMedia.open(svgatorMediaOptions)); 222 222 223 223 if (props.isSelected && !props.attributes.src) { … … 230 230 childElements.push(createBlockControlButton( 231 231 'Select SVG', 232 function() {232 function() { 233 233 svgatorMedia.open(svgatorMediaOptions); 234 234 }) -
svgator/trunk/admin/js/WP_SVGatorMedia.js
r3123949 r3127782 167 167 } 168 168 169 function open(options) {169 function open(options) { 170 170 setOptions(options); 171 171 frame.open(); … … 183 183 184 184 this.open = open; 185 this.setOptions = setOptions;186 185 } 187 186 -
svgator/trunk/admin/js/WP_SVGatorMenu.js
r3123949 r3127782 13 13 }; 14 14 15 $dom.close.on('click', function () {15 $dom.close.on('click', function() { 16 16 close(); 17 17 }); … … 31 31 } 32 32 33 timeout = window.setTimeout(function () {33 timeout = window.setTimeout(function() { 34 34 close(); 35 35 timeout = false; … … 66 66 this._loginNonce = slf.$('#login-container input[name="svgator_logIn_nonce"]').val(); 67 67 68 slf.$('#svgator-filter').on('submit', function (e) {68 slf.$('#svgator-filter').on('submit', function(e) { 69 69 e.preventDefault(); 70 70 }); 71 71 72 slf.$('#svgator-filter [type="search"]').on('keyup search', function (e) {72 slf.$('#svgator-filter [type="search"]').on('keyup search', function(e) { 73 73 slf.filterProjects(e.target.value); 74 74 }); 75 75 76 slf.$('#login-to-svgator').on('click', function (e) {76 slf.$('#login-to-svgator').on('click', function(e) { 77 77 e.preventDefault(); 78 78 79 slf.updateAuthToken().then(function () {79 slf.updateAuthToken().then(function() { 80 80 let pr = slf.loadProjects(); 81 81 if (!pr) { … … 83 83 } 84 84 85 pr.then(function (data) {85 pr.then(function(data) { 86 86 slf.updateExports(data && data.limits && data.limits.exports); 87 87 slf.listProjects(data.response); 88 88 slf._importProjectNonce = data.nonce; 89 }).catch(function (err) {89 }).catch(function(err) { 90 90 slf.notice.show({ 91 91 msg: (err && err.error) || 'Failed to load projects', … … 97 97 } 98 98 }); 99 }).catch(function (json) {99 }).catch(function(json) { 100 100 let msg = json && json.error || json; 101 101 slf.notice.show({ … … 106 106 }); 107 107 108 slf.$('#svgator-header .logout').on('click', function (e) {108 slf.$('#svgator-header .logout').on('click', function(e) { 109 109 e.preventDefault(); 110 110 111 111 let pr = slf.logout(); 112 112 113 pr.finally(function () {113 pr.finally(function() { 114 114 slf.paginateVisibleProjects(); 115 115 }); … … 131 131 $lis.removeClass('on-filter'); 132 132 133 $lis.each(function (idx, li) {133 $lis.each(function(idx, li) { 134 134 let $li = slf.$(li); 135 135 let liText = $li.find('.svgator-title-container').text().toLowerCase(); … … 172 172 .text(page); 173 173 174 $li.on('click', function () {174 $li.on('click', function() { 175 175 $projects.removeClass('on-page'); 176 176 $projects.filter('[data-page="' + page + '"]').addClass('on-page'); … … 193 193 'action': 'svgator_logOut', 194 194 'svgator_logOut_nonce': this._logoutNonce, 195 }).then(function () {195 }).then(function() { 196 196 slf.notice.show({ 197 197 msg: 'Logged out successfully.', … … 201 201 202 202 slf.$('#svgator-projects').empty(); 203 }).catch(function (err) {203 }).catch(function(err) { 204 204 slf.notice.show({ 205 205 msg: err && err.error || 'Failed to log out.', … … 212 212 updateAuthToken() { 213 213 let slf = this; 214 return new Promise(function (resolve, reject) {214 return new Promise(function(resolve, reject) { 215 215 216 216 const host = ['wp.local', 'localhost'].includes(location.hostname) || location.hostname.includes('.svgator.net') … … 226 226 false, 227 227 endpoint, 228 ).then(function (resp) {228 ).then(function(resp) { 229 229 if (!resp || !resp.auth_code || !resp.app_id) { 230 230 if (reject) { … … 235 235 236 236 slf.saveToken(resp) 237 .then(function (data) {237 .then(function(data) { 238 238 if (!data || !data.success) { 239 239 reject(data && data.error || data); … … 246 246 } 247 247 }) 248 .catch(function (data) {248 .catch(function(data) { 249 249 if (reject) { 250 250 reject(data); 251 251 } 252 252 }); 253 }).catch(function (err) {253 }).catch(function(err) { 254 254 let eMsg = 'Failed to connect to SVGator.'; 255 255 if (err) { … … 337 337 .text('IMPORT TO MEDIA') 338 338 .addClass('svgator-commands-import') 339 .on('click', function (e) {339 .on('click', function(e) { 340 340 e.preventDefault(); 341 341 … … 364 364 }, { 365 365 hoverContainer: project.$dom, 366 }).then(function (data) {366 }).then(function(data) { 367 367 const exports = data 368 368 && data.response … … 374 374 msg: 'Project imported successfully.', 375 375 }); 376 }).catch(function (error) {376 }).catch(function(error) { 377 377 const exports = error 378 378 && error.data … … 392 392 makeRequest(data, options) { 393 393 let slf = this; 394 return new Promise(function (resolve, reject) {394 return new Promise(function(resolve, reject) { 395 395 let $loader = slf.$('<div>').addClass('svgator-loader'); 396 396 if (options && options.hoverContainer) { … … 405 405 null, 406 406 'json', 407 ).done(function (data) {407 ).done(function(data) { 408 408 if (data && data.success === false) { 409 409 if (reject) { … … 416 416 resolve.call(slf, data); 417 417 } 418 }).fail(function () {418 }).fail(function() { 419 419 if (reject) { 420 420 reject.call(slf, data); 421 421 } 422 }).always(function () {422 }).always(function() { 423 423 $loader.remove(); 424 424 }); … … 427 427 } 428 428 429 window.jQuery(function () {429 window.jQuery(function() { 430 430 let wpSvgator = new WP_SVGator(jQuery, SVGator); 431 431 … … 436 436 } 437 437 438 pr.then(function (data) {438 pr.then(function(data) { 439 439 wpSvgator.updateExports(data.limits && data.limits.exports); 440 440 wpSvgator.listProjects(data.response); 441 441 wpSvgator._importProjectNonce = data.nonce; 442 }).catch(function (err) {442 }).catch(function(err) { 443 443 wpSvgator.notice.show({ 444 444 msg: (err && err.error) || 'Failed to load projects', -
svgator/trunk/includes/class/WP_SVGator/Media.php
r3123220 r3127782 36 36 } 37 37 38 //$params['content'] = self::fixResponsiveSvg( $params['content'] );39 40 38 // WP_Filesystem_Direct has an $args parameter that is mandatory, however it is not used 41 39 $fs = new WP_Filesystem_Direct( [] ); -
svgator/trunk/includes/class/WP_SVGator/Svg_Support.php
r3123220 r3127782 35 35 36 36 function wp_svgInlineReplaceBlock( $content, $block_array, WP_Block $instance ) { 37 if ( ! $instance->block_type|| $instance->block_type->name !== Block::block_type_name ) {37 if ( empty($instance->block_type->name) || $instance->block_type->name !== Block::block_type_name ) { 38 38 return $content; 39 39 } … … 140 140 */ 141 141 public static function fixScript( string $svgContent ) { 142 //Remove CDATA, since Word press does not allow it inside the content142 //Remove CDATA, since WordPress does not allow it inside the content 143 143 $svgContent = str_replace( '<![CDATA[', '', $svgContent ); 144 144 $svgContent = str_replace( ']]>', '', $svgContent ); … … 189 189 } 190 190 191 global $wp_filesystem;192 193 191 // WP_Filesystem_Direct has an $args parameter that is mandatory, however it is not used 194 192 $fs = new WP_Filesystem_Direct( [] ); -
svgator/trunk/includes/class/WP_SVGator/Widget_Media_SVGator.php
r3123220 r3127782 115 115 } 116 116 117 // building up $allowed_html list from the output bel low it (we know that only these tags and attributes appear in the output)117 // building up $allowed_html list from the output below it (we know that only these tags and attributes appear in the output) 118 118 $allowed_html = array( 119 119 'div' => array( -
svgator/trunk/readme.txt
r3123949 r3127782 92 92 93 93 = 1.3.1 = 94 * Fixed an issue where sometimes selecting an SVG for an SVGator block would update the wrong SVGator block94 * Bugfix - Issue present since original release fixed: From time to time while adding a new SVG, another one on the page got replaced instead 95 95 96 96 = 1.3.0 =
Note: See TracChangeset
for help on using the changeset viewer.