Commit 17a2aa62 authored by webchick's avatar webchick

Issue #1719640 by nod_, droplet, Wim Leers, SebCorbin: Use 'button' element instead of empty links.

parent 2212a5fe
......@@ -101,7 +101,8 @@ $.extend(CollapsibleDetails.prototype, {
.after(' ');
// .wrapInner() does not retain bound events.
var $link = $('<a class="details-title" href="#"></a>')
var $link = $('<a class="details-title"></a>')
.attr('href', '#' + this.$node.attr('id'))
.prepend($legend.contents())
.appendTo($legend)
.click($.proxy(this.onLegendClick, this));
......
......@@ -109,7 +109,7 @@ Drupal.behaviors.machineName = {
options: options
};
// If it is editable, append an edit link.
var $link = $('<span class="admin-link"><a href="#">' + Drupal.t('Edit') + '</a></span>').bind('click', eventData, clickEditHandler);
var $link = $('<span class="admin-link"><button type="button" class="link">' + Drupal.t('Edit') + '</button></span>').bind('click', eventData, clickEditHandler);
$suffix.append(' ').append($link);
// Preview the machine name in realtime when the human-readable name
......
......@@ -104,7 +104,7 @@ Drupal.tableDrag = function (table, tableSettings) {
$table.find('> tr.draggable, > tbody > tr.draggable').each(function () { self.makeDraggable(this); });
// Add a link before the table for users to show or hide weight columns.
$table.before($('<a href="#" class="tabledrag-toggle-weight"></a>')
$table.before($('<button type="button" class="link tabledrag-toggle-weight"></button>')
.attr('title', Drupal.t('Re-order rows by numerical weight instead of dragging.'))
.click($.proxy(function (e) {
e.preventDefault();
......
......@@ -35,7 +35,7 @@ function TableResponsive (table) {
// traversed only once to find them.
this.$headers = this.$table.find('th');
// Add a link before the table for users to show or hide weight columns.
this.$link = $('<a href="#" class="tableresponsive-toggle"></a>')
this.$link = $('<button type="button" class="link tableresponsive-toggle"></button>')
.attr('title', Drupal.t('Show table cells that were hidden to make the table fit within a small screen.'))
.on('click', $.proxy(this, 'eventhandlerToggleColumns'));
......
......@@ -86,6 +86,8 @@ Drupal.verticalTab = function (settings) {
var self = this;
$.extend(this, settings, Drupal.theme('verticalTab', settings));
this.link.attr('href', '#' + settings.fieldset.attr('id'));
this.link.click(function (e) {
e.preventDefault();
self.focus();
......
/**
* @file
* Basic styling for common markup.
......@@ -16,6 +15,9 @@ form {
margin: 0;
padding: 0;
}
button {
font-size: 1em;
}
hr {
border: 1px solid gray;
height: 1px;
......@@ -192,6 +194,21 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed {
}
/**
* Show buttons as links.
*/
button.link {
background: transparent;
border: 0;
cursor: pointer;
margin: 0;
padding: 0;
}
label button.link {
font-weight: bold;
}
/*
* Autocomplete.
*
* @see autocomplete.js
......
......@@ -22,18 +22,18 @@ Drupal.behaviors.textSummary = {
}
// Set up the edit/hide summary link.
var $link = $('<span class="field-edit-link">(<a class="link-edit-summary" href="#nogo">' + Drupal.t('Hide summary') + '</a>)</span>');
var $a = $link.find('a');
var $link = $('<span class="field-edit-link"> (<button type="button" class="link link-edit-summary">' + Drupal.t('Hide summary') + '</button>)</span>');
var $button = $link.find('button');
var toggleClick = true;
$link.on('click', function (e) {
if (toggleClick) {
$summary.hide();
$a.html(Drupal.t('Edit summary'));
$button.html(Drupal.t('Edit summary'));
$link.appendTo($fullLabel);
}
else {
$summary.show();
$a.html(Drupal.t('Hide summary'));
$button.html(Drupal.t('Hide summary'));
$link.appendTo($summaryLabel);
}
e.preventDefault();
......
/* ---------- Color Module Styles ----------- */
body,
......@@ -30,14 +29,18 @@ body.overlay {
background-image: -webkit-linear-gradient(top, #0779bf 0%, #48a9e4 100%);
background-image: linear-gradient(top, #0779bf 0%, #48a9e4 100%);
}
a {
a,
.link {
color: #0071b3;
}
a:hover,
a:focus {
a:focus,
.link:hover,
.link:focus {
color: #018fe2;
}
a:active {
a:active,
.link:active {
color: #23aeff;
}
.sidebar .block {
......
......@@ -15,7 +15,10 @@ a:visited {
}
a:hover,
a:active,
a:focus {
a:focus,
.link:hover,
.link:active,
.link:focus {
text-decoration: underline;
}
h1,
......@@ -122,14 +125,16 @@ div.messages,
div.meta,
p.comment-time,
table,
.breadcrumb {
.breadcrumb,
.link {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
input,
textarea,
select,
.form-button,
a.button {
a.button,
button {
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
}
......
......@@ -6,11 +6,13 @@ body {
background: #fff;
font: normal 81.3%/1.538em "Lucida Grande", "Lucida Sans Unicode", sans-serif;
}
a {
a,
.link {
color: #0074bd;
text-decoration: none;
}
a:hover {
a:hover,
.link:hover {
text-decoration: underline;
}
hr {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment