Changeset 2068697
- Timestamp:
- 04/15/2019 08:20:20 AM (7 years ago)
- Location:
- here-mobility
- Files:
-
- 1 edited
- 26 copied
-
tags/1.0.11 (copied) (copied from here-mobility/trunk)
-
tags/1.0.11/css (copied) (copied from here-mobility/trunk/css)
-
tags/1.0.11/css/auto-complete.css (copied) (copied from here-mobility/trunk/css/auto-complete.css)
-
tags/1.0.11/css/gutenberg-here-block-editor.css (copied) (copied from here-mobility/trunk/css/gutenberg-here-block-editor.css)
-
tags/1.0.11/css/here-settings.css (copied) (copied from here-mobility/trunk/css/here-settings.css)
-
tags/1.0.11/css/mce-here-button.css (copied) (copied from here-mobility/trunk/css/mce-here-button.css)
-
tags/1.0.11/heremobility.php (copied) (copied from here-mobility/trunk/heremobility.php)
-
tags/1.0.11/heremobility_settings.php (copied) (copied from here-mobility/trunk/heremobility_settings.php)
-
tags/1.0.11/img (copied) (copied from here-mobility/trunk/img)
-
tags/1.0.11/img/addWidget.svg (copied) (copied from here-mobility/trunk/img/addWidget.svg)
-
tags/1.0.11/img/appKey.svg (copied) (copied from here-mobility/trunk/img/appKey.svg)
-
tags/1.0.11/img/appSecret.svg (copied) (copied from here-mobility/trunk/img/appSecret.svg)
-
tags/1.0.11/img/destination.svg (copied) (copied from here-mobility/trunk/img/destination.svg)
-
tags/1.0.11/img/hereLogo.svg (copied) (copied from here-mobility/trunk/img/hereLogo.svg)
-
tags/1.0.11/img/link.svg (copied) (copied from here-mobility/trunk/img/link.svg)
-
tags/1.0.11/img/passengers.svg (copied) (copied from here-mobility/trunk/img/passengers.svg)
-
tags/1.0.11/img/pickup.svg (copied) (copied from here-mobility/trunk/img/pickup.svg)
-
tags/1.0.11/img/show.svg (copied) (copied from here-mobility/trunk/img/show.svg)
-
tags/1.0.11/img/suitcases.svg (copied) (copied from here-mobility/trunk/img/suitcases.svg)
-
tags/1.0.11/img/user.svg (copied) (copied from here-mobility/trunk/img/user.svg)
-
tags/1.0.11/js (copied) (copied from here-mobility/trunk/js)
-
tags/1.0.11/js/gutenberg-here-widget.js (copied) (copied from here-mobility/trunk/js/gutenberg-here-widget.js) (9 diffs)
-
tags/1.0.11/js/here-link-button.js (copied) (copied from here-mobility/trunk/js/here-link-button.js)
-
tags/1.0.11/js/here-widget-button.js (copied) (copied from here-mobility/trunk/js/here-widget-button.js)
-
tags/1.0.11/js/loader.js (copied) (copied from here-mobility/trunk/js/loader.js)
-
tags/1.0.11/readme.txt (copied) (copied from here-mobility/trunk/readme.txt)
-
trunk/js/gutenberg-here-widget.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
here-mobility/tags/1.0.11/js/gutenberg-here-widget.js
r2062123 r2068697 306 306 RadioControl = _wp$components.RadioControl, 307 307 TextControl = _wp$components.TextControl, 308 SelectControl = _wp$components.SelectControl; 308 SelectControl = _wp$components.SelectControl, 309 Notice = _wp$components.Notice; 309 310 310 311 … … 407 408 type: 'string', 408 409 default: 'center' 410 }, 411 isShowNotice: { 412 type: 'boolean', 413 default: 'false' 409 414 } 410 415 }, … … 437 442 } 438 443 444 var checkSizeValid = function checkSizeValid() { 445 if (attributes.unit === 'px' && (attributes.width && parseInt(attributes.width, 10) < 360 || attributes.width && parseInt(attributes.height, 10) < 450)) { 446 setAttributes({ 447 isShowNotice: true 448 }); 449 } else { 450 setAttributes({ 451 isShowNotice: false 452 }); 453 } 454 }; 455 456 checkSizeValid(); 457 439 458 var onChangeSettings = function onChangeSettings(value) { 440 459 if (value === 'default') { … … 463 482 }; 464 483 465 // if (!attributes.width && !attributes.height) {466 // onChangeDisplay('default');467 // }484 var onBlur = function onBlur() { 485 checkSizeValid(); 486 }; 468 487 469 488 return [isSelected && wp.element.createElement( … … 517 536 wp.element.createElement( 518 537 'div', 519 null,538 { 'class': 'display-container' }, 520 539 wp.element.createElement( 521 540 'h2', … … 526 545 'p', 527 546 null, 528 'You can use the default size of the widget or set a custom size. Please note that HERE Mobility The widget\u2019s minimum size is ',547 'You can use the default size of the widget or set a custom size. Please note that HERE Mobility widget\'s minimum size is ', 529 548 wp.element.createElement( 530 549 'b', 531 550 null, 532 '360x 450'551 '360x450' 533 552 ), 534 553 '\u202Fpixels and its maximum size is ', … … 542 561 'b', 543 562 null, 544 '512 *450'563 '512x450' 545 564 ), 546 565 ' pixels.' 566 ), 567 attributes.isShowNotice && wp.element.createElement( 568 Notice, 569 { status: 'error', isDismissible: false }, 570 'Please set correct widget size. HERE Mobility widget\u2019s minimum size is ', 571 wp.element.createElement( 572 'b', 573 null, 574 '360x450' 575 ), 576 '\u202Fpixels.' 547 577 ), 548 578 wp.element.createElement(RadioControl, { … … 583 613 }, 584 614 585 save: function save(props ) {615 save: function save(props, prev) { 586 616 return null; 587 617 } … … 632 662 setAttributes = props.setAttributes; 633 663 664 var prevAttributes = Object.assign({}, attributes); 634 665 635 666 if (!attributes.id) { -
here-mobility/trunk/js/gutenberg-here-widget.js
r2062123 r2068697 306 306 RadioControl = _wp$components.RadioControl, 307 307 TextControl = _wp$components.TextControl, 308 SelectControl = _wp$components.SelectControl; 308 SelectControl = _wp$components.SelectControl, 309 Notice = _wp$components.Notice; 309 310 310 311 … … 407 408 type: 'string', 408 409 default: 'center' 410 }, 411 isShowNotice: { 412 type: 'boolean', 413 default: 'false' 409 414 } 410 415 }, … … 437 442 } 438 443 444 var checkSizeValid = function checkSizeValid() { 445 if (attributes.unit === 'px' && (attributes.width && parseInt(attributes.width, 10) < 360 || attributes.width && parseInt(attributes.height, 10) < 450)) { 446 setAttributes({ 447 isShowNotice: true 448 }); 449 } else { 450 setAttributes({ 451 isShowNotice: false 452 }); 453 } 454 }; 455 456 checkSizeValid(); 457 439 458 var onChangeSettings = function onChangeSettings(value) { 440 459 if (value === 'default') { … … 463 482 }; 464 483 465 // if (!attributes.width && !attributes.height) {466 // onChangeDisplay('default');467 // }484 var onBlur = function onBlur() { 485 checkSizeValid(); 486 }; 468 487 469 488 return [isSelected && wp.element.createElement( … … 517 536 wp.element.createElement( 518 537 'div', 519 null,538 { 'class': 'display-container' }, 520 539 wp.element.createElement( 521 540 'h2', … … 526 545 'p', 527 546 null, 528 'You can use the default size of the widget or set a custom size. Please note that HERE Mobility The widget\u2019s minimum size is ',547 'You can use the default size of the widget or set a custom size. Please note that HERE Mobility widget\'s minimum size is ', 529 548 wp.element.createElement( 530 549 'b', 531 550 null, 532 '360x 450'551 '360x450' 533 552 ), 534 553 '\u202Fpixels and its maximum size is ', … … 542 561 'b', 543 562 null, 544 '512 *450'563 '512x450' 545 564 ), 546 565 ' pixels.' 566 ), 567 attributes.isShowNotice && wp.element.createElement( 568 Notice, 569 { status: 'error', isDismissible: false }, 570 'Please set correct widget size. HERE Mobility widget\u2019s minimum size is ', 571 wp.element.createElement( 572 'b', 573 null, 574 '360x450' 575 ), 576 '\u202Fpixels.' 547 577 ), 548 578 wp.element.createElement(RadioControl, { … … 583 613 }, 584 614 585 save: function save(props ) {615 save: function save(props, prev) { 586 616 return null; 587 617 } … … 632 662 setAttributes = props.setAttributes; 633 663 664 var prevAttributes = Object.assign({}, attributes); 634 665 635 666 if (!attributes.id) {
Note: See TracChangeset
for help on using the changeset viewer.