##// END OF EJS Templates
Don't use JS and links in tag buttons. Use <button> instead
neko259 -
r1039:4008735b default
parent child Browse files
Show More
@@ -84,8 +84,10 b' textarea, input {'
84 84 display: inline;
85 85 }
86 86
87 .post-button-form > input[type="submit"] {
87 .post-button-form > button {
88 88 border: none;
89 margin: 0;
90 padding: 0;
89 margin: inherit;
90 padding: inherit;
91 background: none;
92 font-size: inherit;
91 93 }
@@ -509,3 +509,7 b' ul {'
509 509 .highlight {
510 510 background-color: #222;
511 511 }
512
513 .post-button-form > button:hover {
514 text-decoration: underline;
515 }
@@ -397,3 +397,7 b' li {'
397 397 .highlight {
398 398 background-color: #D4F0F9;
399 399 }
400
401 .dead_post {
402 border-right: 1ex solid #666;
403 }
@@ -81,21 +81,6 b' function translate_time(node) {'
81 81 });
82 82 }
83 83
84 /**
85 * We use buttons viewed as a form with link and hidden inputs to ensure
86 * the search crawlers don't index or click them.
87 *
88 * But we need to submit the form by clicking the links. That's why these
89 * handlers are here.
90 */
91 function addPostButtonActions() {
92 $('.post-button-form > a').each(function() {
93 $(this).click(function() {
94 $(this).parent().submit();
95 });
96 });
97 }
98
99 84 $( document ).ready(function() {
100 85 hideEmailFromForm();
101 86
@@ -111,6 +96,4 b' function addPostButtonActions() {'
111 96 highlightCode($(document));
112 97
113 98 translate_time(null);
114
115 addPostButtonActions();
116 99 });
@@ -41,22 +41,17 b''
41 41 <div class="tag_info">
42 42 <h2>
43 43 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
44 <input type="hidden" name="method"
45 44 {% if is_favorite %}
46 <input type="hidden" name="method" value="unsubscribe" />
47 <a class="fav" href="#"></a>
45 <button name="method" value="unsubscribe" class="fav"></button>
48 46 {% else %}
49 <input type="hidden" name="method" value="subscribe" />
50 <a class="not_fav" href="#"></a>
47 <button name="method" value="subscribe" class="not_fav"></button>
51 48 {% endif %}
52 49 </form>
53 50 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
54 51 {% if is_hidden %}
55 <input type="hidden" name="method" value="unhide" />
56 <a class="fav" href="#">H</a>
52 <button name="method" value="unhide" class="fav">H</button>
57 53 {% else %}
58 <input type="hidden" name="method" value="hide" />
59 <a class="not_fav" href="#">H</a>
54 <button name="method" value="hide" class="not_fav">H</button>
60 55 {% endif %}
61 56 </form>
62 57 {% autoescape off %}
General Comments 0
You need to be logged in to leave comments. Login now