Fixes type/href attributes for button elements.
– <button> must have an explicit type="buttons" since it falls back to type="submit", which can have side effects – <button> must not have a href attribute, always use data-href
This commit is contained in:
parent
5f2c8eb9dd
commit
d0de74737e
@ -110,7 +110,7 @@
|
||||
<h4 id="c{$comment.id}">{($comment.type == 'NORMAL') ? $CONST.COMMENT : (($comment.type == 'TRACKBACK') ? $CONST.TRACKBACK : $CONST.PINGBACK )} #{$comment.id} - {$CONST.IN_REPLY_TO}
|
||||
<a href="{$comment.entry_url}">{$comment.title|escape}</a>
|
||||
{$CONST.ON} {$comment.timestamp|@formatTime:'%b %e %Y, %H:%M'}
|
||||
<button class="toggle_info button_link" data-href="#comment_data_{$comment.id}"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>
|
||||
<button class="toggle_info button_link" type="button" data-href="#comment_data_{$comment.id}"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>
|
||||
</h4>
|
||||
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
|
||||
<span class="comment_status">{$CONST.COMMENTS_FILTER_NEED_APPROVAL}</span>
|
||||
|
@ -13,7 +13,7 @@
|
||||
{if $config|@sizeof > 1}
|
||||
{if $allowToggle}
|
||||
<h3 class="toggle_headline">
|
||||
<button id="optionel{$category@iteration}" class="show_config_option icon_link" href="#el{$category@index}" title="{$CONST.TOGGLE_OPTION}"><span class="icon-plus"></span> {$category.title}</button>
|
||||
<button id="optionel{$category@iteration}" class="show_config_option icon_link" type="button" data-href="#el{$category@index}" title="{$CONST.TOGGLE_OPTION}"><span class="icon-plus"></span> {$category.title}</button>
|
||||
</h3>
|
||||
{else}
|
||||
<h3>{$category.title}</h3>
|
||||
@ -27,7 +27,7 @@
|
||||
{if $item.guessedInput}
|
||||
{if $item.type == 'bool'}
|
||||
<fieldset class="clearfix {$zebra_class}">
|
||||
<legend><span>{$item.title}{if $item.description != ''} <button class="toggle_info button_link" href="#{$item.var}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<legend><span>{$item.title}{if $item.description != ''} <button class="toggle_info button_link" type="button" data-href="#{$item.var}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<div class="clearfix grouped">
|
||||
{$item.guessedInput}
|
||||
</div>
|
||||
@ -37,7 +37,7 @@
|
||||
</fieldset>
|
||||
{else}
|
||||
<div class="clearfix {$zebra_class} form_{if $item.type == 'list'}select{elseif $item.type == 'multilist'}multiselect{elseif $item.type == 'textarea'}area{else}field{/if}">
|
||||
<label for="{$item.var}">{$item.title}{if $item.description != ''} <button class="toggle_info button_link" href="#{$item.var}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>{* i18n *}
|
||||
<label for="{$item.var}">{$item.title}{if $item.description != ''} <button class="toggle_info button_link" type="button" data-href="#{$item.var}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>{* i18n *}
|
||||
{$item.guessedInput}
|
||||
{if $item.description != ''}
|
||||
<span id="{$item.var}_info" class="field_info additional_info">{$item.description}</span>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<label for="serendipityNewTimestamp">{$CONST.DATE}</label>
|
||||
<input id="serendipityNewTimestamp" name="serendipity[new_timestamp]" type="datetime-local" value="{$entry_vars.timestamp|@formatTime:'o-m-d\TH:i':true:false:true}">
|
||||
|
||||
<button id="reset_timestamp" class="button_link" href="#serendipityNewTimestamp" data-currtime="{$entry_vars.reset_timestamp|@formatTime:'o-m-d\TH:i':true:false:true}" title="{$CONST.RESET_DATE_DESC}"><span class="icon-clock"></span><span class="visuallyhidden"> {$CONST.RESET_DATE}</span></button>
|
||||
<button id="reset_timestamp" class="button_link" type="button" href="#serendipityNewTimestamp" data-currtime="{$entry_vars.reset_timestamp|@formatTime:'o-m-d\TH:i':true:false:true}" title="{$CONST.RESET_DATE_DESC}"><span class="icon-clock"></span><span class="visuallyhidden"> {$CONST.RESET_DATE}</span></button>
|
||||
</div>
|
||||
{/if}
|
||||
<div id="edit_entry_category" class="form_select">
|
||||
|
@ -7,14 +7,14 @@
|
||||
</div>
|
||||
{/if}
|
||||
{if is_array($config_groups)}
|
||||
<button id="show_config_all" class="button_link" data-href="#serendipity_config_options" title="{$CONST.TOGGLE_ALL}">
|
||||
<button id="show_config_all" class="button_link" type="button" data-href="#serendipity_config_options" title="{$CONST.TOGGLE_ALL}">
|
||||
<span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span>
|
||||
</button>
|
||||
|
||||
<div id="serendipity_config_options">
|
||||
{foreach $config_groups AS $config_header => $config_groupkeys}
|
||||
<div class="configuration_group">
|
||||
<h3 class="toggle_headline"><button id="optionel{$config_groupkeys@iteration}" class="show_config_option" data-href="#el{$config_groupkeys@iteration}" title="{$CONST.TOGGLE_OPTION}"><span class="icon-plus"></span> {$config_header}</button></h3>
|
||||
<h3 class="toggle_headline"><button id="optionel{$config_groupkeys@iteration}" class="show_config_option" type="button" data-href="#el{$config_groupkeys@iteration}" title="{$CONST.TOGGLE_OPTION}"><span class="icon-plus"></span> {$config_header}</button></h3>
|
||||
|
||||
<fieldset id="el{$config_groupkeys@iteration}" class="config_optiongroup{if $config_groupkeys@last} config_optiongroup_last{/if} additional_info">
|
||||
{foreach $config_groupkeys AS $config_groupkey}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<hr>
|
||||
{elseif $ctype == 'select'}
|
||||
<div class="clearfix form_select">
|
||||
<label for="serendipity_{$config_item}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" data-href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
<label for="serendipity_{$config_item}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
{* Make sure id creation actually produces unique identifiers *}
|
||||
<select id="serendipity_{$config_item}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]{($is_multi_select) ? '[]' : ''}" {($is_multi_select) ? 'multiple' : ''} {($is_multi_select && ($select_size > 0)) ? "size='{$select_size}'" : ''}>
|
||||
{foreach $select AS $select_value => $select_desc}
|
||||
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
{elseif $ctype == 'radio'}
|
||||
<fieldset>
|
||||
<legend><span>{$cname}{if $cdesc != ''} <button class="toggle_info button_link" href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<legend><span>{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<div class="clearfix grouped">
|
||||
{foreach $radio_button AS $r}
|
||||
<div class="form_radio">
|
||||
@ -29,13 +29,13 @@
|
||||
</fieldset>
|
||||
{elseif $ctype == 'string'}
|
||||
<div class="clearfix form_field">
|
||||
<label for="serendipity_{$config_item}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
<label for="serendipity_{$config_item}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
<input id="serendipity_{$config_item}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]" type="{$input_type}" value="{$hvalue}">
|
||||
{if $cdesc != ''}<span id="{$config_item}_info" class="field_info additional_info">{$cdesc}</span>{/if}
|
||||
</div>
|
||||
{elseif (($ctype == 'html') || ($ctype == 'text'))}
|
||||
<div class="clearfix form_area">
|
||||
<label for="nuggets{$elcount}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link"" href="#nuggets{$elcount}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
<label for="nuggets{$elcount}">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#nuggets{$elcount}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
|
||||
<textarea id="nuggets{$elcount}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]" rows="{$text_rows}">{$hvalue}</textarea>
|
||||
{if $cdesc != ''}<span id="nuggets{$elcount}_info" class="field_info additional_info">{$cdesc}</span>{/if}
|
||||
@ -55,9 +55,9 @@
|
||||
</div>
|
||||
{elseif $ctype == 'media'}
|
||||
<div class="clearfix form_field media_choose">
|
||||
<label for="serendipity[{$postKey}][{$config_item}]">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" href="#{$postKey}_{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
<label for="serendipity[{$postKey}][{$config_item}]">{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#{$postKey}_{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</label>
|
||||
|
||||
<input id="serendipity[{$postKey}][{$config_item}]" class="change_preview" name="serendipity[{$postKey}][{$config_item}]" type="text" data-configitem="{$config_item}" data-pmwidth="{$preview_width}" data-pmheight="{$preview_height}" value="{$value}">{* This should be input[type=file] … *}
|
||||
<input id="serendipity[{$postKey}][{$config_item}]" class="change_preview" name="serendipity[{$postKey}][{$config_item}]" type="text" data-configitem="{$config_item}" data-pmwidth="{$preview_width}" data-pmheight="{$preview_height}" value="{$value}">{* This should maybe be input[type=file] *}
|
||||
|
||||
<a class="button_link choose_media" href="#serendipity[{$postKey}][{$config_item}]" title="{$CONST.MEDIA_LIBRARY}"><span class="icon-picture"></span><span class="visuallyhidden"> {$CONST.MEDIA_LIBRARY}</span></a>
|
||||
{if $cdesc != ''}<span id="{$postKey}_{$config_item}_info" class="field_info additional_info">{$cdesc}</span>{/if}
|
||||
@ -67,7 +67,7 @@
|
||||
<script src="{serendipity_getFile file="admin/js/dragdrop.js"}"></script>
|
||||
{/if}
|
||||
<fieldset>
|
||||
<legend><span>{$cname}{if $cdesc != ''} <button class="toggle_info button_link" href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<legend><span>{$cname}{if $cdesc != ''} <button class="toggle_info button_link" type="button" data-href="#{$config_item}_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>{/if}</span></legend>
|
||||
<input id="{$config_item}_value" name="serendipity[{$postKey}][{$config_item}]" type="hidden" value="{$value}">
|
||||
|
||||
<noscript>
|
||||
|
@ -399,7 +399,7 @@ window.log = function f(){ log.history = log.history || []; log.history.push(arg
|
||||
// this function got called on load of the editor
|
||||
var toggleButton = '#toggle_' + id;
|
||||
|
||||
$('#'+id).before('<button class="button_link" id="toggle_' + id + '" href="#' + id + '"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></button>');
|
||||
$('#'+id).before('<button id="toggle_' + id + '" class="button_link" type="button" href="#' + id + '"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></button>');
|
||||
|
||||
$(toggleButton).click(function(e) {
|
||||
e.preventDefault();
|
||||
|
@ -55,7 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="template_show_info button_link" data-href="#template_info_cur" title="Show template info"><span class="icon-info-circled"></span><span class="visuallyhidden"> Show template info</span></button>
|
||||
<button class="template_show_info button_link" type="button" data-href="#template_info_cur" title="Show template info"><span class="icon-info-circled"></span><span class="visuallyhidden"> Show template info</span></button>
|
||||
|
||||
<a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=editConfiguration" title="{$CONST.CONFIGURATION}">{$CONST.CONFIGURATION}</a>
|
||||
</article>
|
||||
@ -92,7 +92,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="template_show_info button_link" data-href="#template_info_{$info@key}" title="Show template info"><span class="icon-info-circled"></span><span class="visuallyhidden"> Show template info</span></button>
|
||||
<button class="template_show_info button_link" type="button" data-href="#template_info_{$info@key}" title="Show template info"><span class="icon-info-circled"></span><span class="visuallyhidden"> Show template info</span></button>
|
||||
|
||||
{if !$info.unmetRequirements}
|
||||
<a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=install&serendipity[theme]={$template}{$info.info.customURI}" title="{$CONST.SET_AS_TEMPLATE}">{$CONST.SET_AS_TEMPLATE}</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user