| 1550 | * 自訂 trac 0.12 版本的 accesskey |
| 1551 | {{{ |
| 1552 | #!diff |
| 1553 | diff -Naur /usr/share/pyshared/trac/admin/web_ui.py.org /usr/share/pyshared/trac/admin/web_ui.py |
| 1554 | --- /usr/share/pyshared/trac/admin/web_ui.py.org 2013-11-14 00:16:35.729482060 +0800 |
| 1555 | +++ /usr/share/pyshared/trac/admin/web_ui.py 2013-11-14 00:28:13.661458857 +0800 |
| 1556 | @@ -64,7 +64,7 @@ |
| 1557 | panels, providers = self._get_panels(req) |
| 1558 | if panels: |
| 1559 | yield 'mainnav', 'admin', tag.a(_('Admin'), href=req.href.admin(), |
| 1560 | - title=_('Administration')) |
| 1561 | + title=_('Administration'), accesskey='a') |
| 1562 | |
| 1563 | # IRequestHandler methods |
| 1564 | |
| 1565 | diff -Naur /usr/share/pyshared/trac/wiki/templates/wiki_edit_form.html.org /usr/share/pyshared/trac/wiki/templates/wiki_edit_form.html |
| 1566 | --- /usr/share/pyshared/trac/wiki/templates/wiki_edit_form.html.org 2013-11-14 00:25:06.765460600 +0800 |
| 1567 | +++ /usr/share/pyshared/trac/wiki/templates/wiki_edit_form.html 2013-11-14 00:26:22.117451981 +0800 |
| 1568 | @@ -65,14 +65,14 @@ |
| 1569 | </fieldset> |
| 1570 | <div class="buttons" py:choose="action"> |
| 1571 | <py:when test="'collision'"> |
| 1572 | - <input type="submit" name="preview" value="${_('Preview')}" disabled="disabled" /> |
| 1573 | + <input type="submit" name="preview" value="${_('Preview')}" disabled="disabled" accesskey="p"/> |
| 1574 | <input type="submit" name="merge" value="${_('Merge changes')}" accesskey="r" /> |
| 1575 | <input type="submit" name="save" value="${_('Submit changes')}" disabled="disabled" /> |
| 1576 | </py:when> |
| 1577 | <py:otherwise> |
| 1578 | <input type="submit" name="preview" value="${_('Preview Page')}" accesskey="p" /> |
| 1579 | <input type="submit" name="diff" value="${_('Review Changes')}" accesskey="r" /> |
| 1580 | - <input type="submit" id="save" name="save" value="${_('Submit changes')}" /> |
| 1581 | + <input type="submit" id="save" name="save" value="${_('Submit changes')}" accesskey="s"/> |
| 1582 | </py:otherwise> |
| 1583 | <input type="submit" name="cancel" value="${_('Cancel')}" /> |
| 1584 | </div> |
| 1585 | diff -Naur /usr/share/pyshared/trac/wiki/templates/wiki_edit.html.org /usr/share/pyshared/trac/wiki/templates/wiki_edit.html |
| 1586 | diff -Naur /usr/share/pyshared/trac/htdocs/css/trac.css.org /usr/share/pyshared/trac/htdocs/css/trac.css |
| 1587 | --- /usr/share/pyshared/trac/htdocs/css/trac.css.org 2013-11-14 00:16:51.205481694 +0800 |
| 1588 | +++ /usr/share/pyshared/trac/htdocs/css/trac.css 2013-11-14 00:29:44.193454972 +0800 |
| 1589 | @@ -1,6 +1,6 @@ |
| 1590 | body { background: #fff; color: #000; margin: 10px; padding: 0; } |
| 1591 | body, th, tr { |
| 1592 | - font: normal 13px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; |
| 1593 | + font: normal 14px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; |
| 1594 | } |
| 1595 | h1, h2, h3, h4 { |
| 1596 | font-family: Arial,Verdana,'Bitstream Vera Sans',Helvetica,sans-serif; |
| 1597 | diff -Naur /usr/share/pyshared/trac/prefs/web_ui.py.org /usr/share/pyshared/trac/prefs/web_ui.py |
| 1598 | --- /usr/share/pyshared/trac/prefs/web_ui.py.org 2013-11-14 00:16:42.301482867 +0800 |
| 1599 | +++ /usr/share/pyshared/trac/prefs/web_ui.py 2013-11-14 00:28:58.921450655 +0800 |
| 1600 | @@ -49,7 +49,7 @@ |
| 1601 | |
| 1602 | def get_navigation_items(self, req): |
| 1603 | yield ('metanav', 'prefs', |
| 1604 | - tag.a(_('Preferences'), href=req.href.prefs())) |
| 1605 | + tag.a(_('Preferences'), href=req.href.prefs(), accesskey='t')) |
| 1606 | |
| 1607 | # IRequestHandler methods |
| 1608 | |
| 1609 | diff -Naur /usr/share/pyshared/trac/web/auth.py.org /usr/share/pyshared/trac/web/auth.py |
| 1610 | diff -Naur /usr/share/pyshared/trac/web/chrome.py.org /usr/share/pyshared/trac/web/chrome.py |
| 1611 | --- /usr/share/pyshared/trac/web/chrome.py.org 2013-11-13 23:57:02.945531198 +0800 |
| 1612 | +++ /usr/share/pyshared/trac/web/chrome.py 2013-11-14 00:19:54.501481638 +0800 |
| 1613 | @@ -143,9 +143,11 @@ |
| 1614 | msg %= args |
| 1615 | req.chrome['notices'].append(msg) |
| 1616 | |
| 1617 | -def add_ctxtnav(req, elm_or_label, href=None, title=None): |
| 1618 | +def add_ctxtnav(req, elm_or_label, href=None, title=None, accesskey=None): |
| 1619 | """Add an entry to the current page's ctxtnav bar.""" |
| 1620 | - if href: |
| 1621 | + if accesskey: |
| 1622 | + elm = tag.a(elm_or_label, href=href, title=title, accesskey=accesskey) |
| 1623 | + elif href: |
| 1624 | elm = tag.a(elm_or_label, href=href, title=title) |
| 1625 | else: |
| 1626 | elm = elm_or_label |
| 1627 | @@ -855,8 +857,8 @@ |
| 1628 | if doctype: |
| 1629 | if req.form_token: |
| 1630 | stream |= self._add_form_token(req.form_token) |
| 1631 | - if not int(req.session.get('accesskeys', 0)): |
| 1632 | - stream |= self._strip_accesskeys |
| 1633 | + #if not int(req.session.get('accesskeys', 0)): |
| 1634 | + # stream |= self._strip_accesskeys |
| 1635 | |
| 1636 | links = req.chrome.get('links') |
| 1637 | scripts = req.chrome.get('scripts') |
| 1638 | diff -Naur /usr/share/pyshared/trac/versioncontrol/web_ui/browser.py.org /usr/share/pyshared/trac/versioncontrol/web_ui/browser.py |
| 1639 | --- /usr/share/pyshared/trac/versioncontrol/web_ui/browser.py.org 2013-11-14 00:16:26.529476663 +0800 |
| 1640 | +++ /usr/share/pyshared/trac/versioncontrol/web_ui/browser.py 2013-11-14 00:27:17.841454891 +0800 |
| 1641 | @@ -293,7 +293,7 @@ |
| 1642 | rm = RepositoryManager(self.env) |
| 1643 | if 'BROWSER_VIEW' in req.perm and rm.get_real_repositories(): |
| 1644 | yield ('mainnav', 'browser', |
| 1645 | - tag.a(_('Browse Source'), href=req.href.browser())) |
| 1646 | + tag.a(_('Browse Source'), href=req.href.browser(), accesskey='5')) |
| 1647 | |
| 1648 | # IPermissionRequestor methods |
| 1649 | |
| 1650 | }}} |