Changeset 22578
- Timestamp:
- 11/14/2012 09:51:41 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-models.js
r22541 r22578 81 81 evaluate: /<#([\s\S]+?)#>/g, 82 82 interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, 83 escape: /\{\{([^\}]+?)\}\}(?!\})/g 83 escape: /\{\{([^\}]+?)\}\}(?!\})/g, 84 variable: 'data' 84 85 }; 85 86 -
trunk/wp-includes/media.php
r22568 r22578 1391 1391 <script type="text/html" id="tmpl-media-modal"> 1392 1392 <div class="media-modal"> 1393 <h3 class="media-modal-title">{{ title }}</h3>1393 <h3 class="media-modal-title">{{ data.title }}</h3> 1394 1394 <a class="media-modal-close" href="" title="<?php esc_attr_e('Close'); ?>">×</a> 1395 1395 </div> … … 1425 1425 1426 1426 <script type="text/html" id="tmpl-attachment"> 1427 <div class="attachment-preview type-{{ type }} subtype-{{ subtype }} {{orientation }}">1428 <# if ( uploading ) { #>1427 <div class="attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> 1428 <# if ( data.uploading ) { #> 1429 1429 <div class="media-progress-bar"><div></div></div> 1430 <# } else if ( 'image' === type ) { #>1430 <# } else if ( 'image' === data.type ) { #> 1431 1431 <div class="thumbnail"> 1432 1432 <div class="centered"> 1433 <img src="{{ url }}" draggable="false" />1433 <img src="{{ data.url }}" draggable="false" /> 1434 1434 </div> 1435 1435 </div> 1436 1436 <# } else { #> 1437 <img src="{{ icon }}" class="icon" draggable="false" />1438 <div class="filename">{{ filename }}</div>1437 <img src="{{ data.icon }}" class="icon" draggable="false" /> 1438 <div class="filename">{{ data.filename }}</div> 1439 1439 <# } #> 1440 1440 1441 <# if ( buttons.close ) { #>1441 <# if ( data.buttons.close ) { #> 1442 1442 <a class="close button" href="#">×</a> 1443 1443 <# } #> 1444 1444 </div> 1445 <# if ( d escribe ) { #>1446 <# if ( 'image' === type ) { #>1445 <# if ( data.describe ) { #> 1446 <# if ( 'image' === data.type ) { #> 1447 1447 <textarea class="describe" 1448 1448 placeholder="<?php esc_attr_e('Describe this image…'); ?>" 1449 >{{ caption }}</textarea>1449 >{{ data.caption }}</textarea> 1450 1450 <# } else { #> 1451 1451 <textarea class="describe" 1452 <# if ( 'video' === type ) { #>1452 <# if ( 'video' === data.type ) { #> 1453 1453 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 1454 <# } else if ( 'audio' === type ) { #>1454 <# } else if ( 'audio' === data.type ) { #> 1455 1455 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 1456 1456 <# } else { #> 1457 1457 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 1458 1458 <# } #> 1459 >{{ title }}</textarea>1459 >{{ data.title }}</textarea> 1460 1460 <# } #> 1461 1461 <# } #> … … 1466 1466 <div class="attachment-info"> 1467 1467 <div class="thumbnail"> 1468 <# if ( uploading ) { #>1468 <# if ( data.uploading ) { #> 1469 1469 <div class="media-progress-bar"><div></div></div> 1470 <# } else if ( 'image' === type ) { #>1471 <img src="{{ url }}" draggable="false" />1470 <# } else if ( 'image' === data.type ) { #> 1471 <img src="{{ data.url }}" draggable="false" /> 1472 1472 <# } else { #> 1473 <img src="{{ icon }}" class="icon" draggable="false" />1473 <img src="{{ data.icon }}" class="icon" draggable="false" /> 1474 1474 <# } #> 1475 1475 </div> 1476 1476 <div class="details"> 1477 <div class="filename">{{ filename }}</div>1478 <div class="uploaded">{{ dat eFormatted }}</div>1479 <# if ( 'image' === type && !uploading ) { #>1480 <div class="dimensions">{{ width }} × {{height }}</div>1477 <div class="filename">{{ data.filename }}</div> 1478 <div class="uploaded">{{ data.dateFormatted }}</div> 1479 <# if ( 'image' === data.type && ! data.uploading ) { #> 1480 <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 1481 1481 <# } #> 1482 1482 </div> 1483 1483 <div class="compat-meta"> 1484 <# if ( compat &&compat.meta ) { #>1485 {{{ compat.meta }}}1484 <# if ( data.compat && data.compat.meta ) { #> 1485 {{{ data.compat.meta }}} 1486 1486 <# } #> 1487 1487 </div> 1488 1488 </div> 1489 1489 1490 <# if ( 'image' === type ) { #>1490 <# if ( 'image' === data.type ) { #> 1491 1491 <label class="setting" data-setting="title"> 1492 1492 <span><?php _e('Title'); ?></span> 1493 <input type="text" value="{{ title }}" />1493 <input type="text" value="{{ data.title }}" /> 1494 1494 </label> 1495 1495 <label class="setting" data-setting="caption"> … … 1497 1497 <textarea 1498 1498 placeholder="<?php esc_attr_e('Describe this image…'); ?>" 1499 >{{ caption }}</textarea>1499 >{{ data.caption }}</textarea> 1500 1500 </label> 1501 1501 <label class="setting" data-setting="alt"> 1502 1502 <span><?php _e('Alt Text'); ?></span> 1503 <input type="text" value="{{ alt }}" />1503 <input type="text" value="{{ data.alt }}" /> 1504 1504 </label> 1505 1505 <# } else { #> 1506 1506 <label class="setting" data-setting="title"> 1507 1507 <span><?php _e('Title'); ?></span> 1508 <input type="text" value="{{ title }}"1509 <# if ( 'video' === type ) { #>1508 <input type="text" value="{{ data.title }}" 1509 <# if ( 'video' === data.type ) { #> 1510 1510 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 1511 <# } else if ( 'audio' === type ) { #>1511 <# } else if ( 'audio' === data.type ) { #> 1512 1512 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 1513 1513 <# } else { #> … … 1521 1521 <div class="selection-info"> 1522 1522 <span class="count"></span> 1523 <# if ( clearable ) { #>1523 <# if ( data.clearable ) { #> 1524 1524 <a class="clear-selection" href="#"><?php _e('Clear'); ?></a> 1525 1525 <# } #> … … 1529 1529 1530 1530 <script type="text/html" id="tmpl-media-selection-preview"> 1531 <div class="selected-img selected-count-{{ count }}">1532 <# if ( thumbnail ) { #>1533 <img src="{{ thumbnail }}" draggable="false" />1531 <div class="selected-img selected-count-{{ data.count }}"> 1532 <# if ( data.thumbnail ) { #> 1533 <img src="{{ data.thumbnail }}" draggable="false" /> 1534 1534 <# } #> 1535 1535 1536 <span class="count">{{ count }}</span>1536 <span class="count">{{ data.count }}</span> 1537 1537 </div> 1538 <# if ( clearable ) { #>1538 <# if ( data.clearable ) { #> 1539 1539 <a class="clear-selection" href="#"><?php _e('Clear selection'); ?></a> 1540 1540 <# } #> … … 1548 1548 <select class="alignment" 1549 1549 data-setting="align" 1550 <# if ( userSettings ) { #>1550 <# if ( data.userSettings ) { #> 1551 1551 data-user-setting="align" 1552 1552 <# } #>> … … 1572 1572 <select class="link-to" 1573 1573 data-setting="link" 1574 <# if ( userSettings ) { #>1574 <# if ( data.userSettings ) { #> 1575 1575 data-user-setting="urlbutton" 1576 1576 <# } #>> … … 1593 1593 </div> 1594 1594 1595 <# if ( 'undefined' !== typeof sizes ) { #>1595 <# if ( 'undefined' !== typeof data.sizes ) { #> 1596 1596 <label class="setting"> 1597 1597 <span><?php _e('Size'); ?></span> 1598 1598 <select class="size" name="size" 1599 1599 data-setting="size" 1600 <# if ( userSettings ) { #>1600 <# if ( data.userSettings ) { #> 1601 1601 data-user-setting="imgsize" 1602 1602 <# } #>> … … 1614 1614 continue; 1615 1615 ?> 1616 <# if ( sizes['<?php echo esc_js( $value ); ?>'] ) { #>1616 <# if ( data.sizes['<?php echo esc_js( $value ); ?>'] ) { #> 1617 1617 <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'medium' ); ?>> 1618 1618 <?php echo esc_html( $name ); ?> … … 1638 1638 <select class="link-to" 1639 1639 data-setting="link" 1640 <# if ( userSettings ) { #>1640 <# if ( data.userSettings ) { #> 1641 1641 data-user-setting="urlbutton" 1642 1642 <# } #>> … … 1673 1673 <script type="text/html" id="tmpl-embed-image-settings"> 1674 1674 <div class="thumbnail"> 1675 <img src="{{ model.url }}" draggable="false" />1675 <img src="{{ data.model.url }}" draggable="false" /> 1676 1676 </div> 1677 1677 … … 1721 1721 </script> 1722 1722 1723 <script type="text/html" id="tmpl-editor-attachment">1724 <div class="editor-attachment-preview">1725 <# if ( url ) { #>1726 <img src="{{ url }}" width="{{ width }}" height="{{ height }}" draggable="false" />1727 <# } #>1728 1729 <# if ( uploading ) { #>1730 <div class="media-progress-bar"><div></div></div>1731 <# } #>1732 <div class="overlay">1733 <div class="button close">×</div>1734 </div>1735 </div>1736 <div class="describe"></div>1737 </script>1738 1739 <script type="text/html" id="tmpl-editor-gallery">1740 <# if ( url ) { #>1741 <img src="{{ url }}" draggable="false" />1742 <# } #>1743 1744 <div class="overlay">1745 <div class="button close">×</div>1746 <div class="button edit"><?php _e('Edit'); ?></div>1747 </div>1748 </script>1749 1750 1723 <script type="text/html" id="tmpl-attachments-css"> 1751 <style type="text/css" id="{{ id }}-css">1752 #{{ id }} {1753 padding: 0 {{ gutter }}px;1724 <style type="text/css" id="{{ data.id }}-css"> 1725 #{{ data.id }} { 1726 padding: 0 {{ data.gutter }}px; 1754 1727 } 1755 1728 1756 #{{ id }} .attachment {1757 margin: {{ gutter }}px;1758 width: {{ edge }}px;1729 #{{ data.id }} .attachment { 1730 margin: {{ data.gutter }}px; 1731 width: {{ data.edge }}px; 1759 1732 } 1760 1733 1761 #{{ id }} .attachment-preview,1762 #{{ id }} .attachment-preview .thumbnail {1763 width: {{ edge }}px;1764 height: {{ edge }}px;1734 #{{ data.id }} .attachment-preview, 1735 #{{ data.id }} .attachment-preview .thumbnail { 1736 width: {{ data.edge }}px; 1737 height: {{ data.edge }}px; 1765 1738 } 1766 1739 1767 #{{ id }} .portrait .thumbnail img {1768 width: {{ edge }}px;1740 #{{ data.id }} .portrait .thumbnail img { 1741 width: {{ data.edge }}px; 1769 1742 height: auto; 1770 1743 } 1771 1744 1772 #{{ id }} .landscape .thumbnail img {1745 #{{ data.id }} .landscape .thumbnail img { 1773 1746 width: auto; 1774 height: {{ edge }}px;1747 height: {{ data.edge }}px; 1775 1748 } 1776 1749 </style>
Note: See TracChangeset
for help on using the changeset viewer.