From ae614416a5d7f5cab6c5b82a0c45f587d7fa9c01 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 12 Jul 2015 19:05:43 +0100 Subject: changed all input type=submit buttons to button type=submit button for better stylability --- _test/tests/inc/form_form.test.php | 4 ++-- inc/form.php | 6 ++++-- inc/html.php | 18 +++++++++++------- inc/template.php | 4 ++-- install.php | 6 +++--- lib/plugins/acl/admin.php | 10 +++++----- lib/plugins/acl/script.js | 2 +- lib/plugins/config/admin.php | 4 ++-- lib/plugins/extension/helper/list.php | 2 +- lib/plugins/extension/script.js | 4 ++-- lib/plugins/extension/style.less | 4 ++-- lib/plugins/popularity/admin.php | 2 +- lib/plugins/revert/admin.php | 8 ++++---- lib/plugins/usermanager/admin.php | 22 +++++++++++----------- lib/plugins/usermanager/style.css | 2 +- lib/scripts/behaviour.js | 6 +++--- lib/scripts/editor.js | 2 +- lib/scripts/fileuploaderextended.js | 4 ++-- lib/scripts/hotkeys.js | 6 +++--- lib/scripts/media.js | 4 ++-- lib/tpl/dokuwiki/css/_edit.css | 4 ++-- lib/tpl/dokuwiki/css/_forms.css | 3 +-- lib/tpl/dokuwiki/css/_media_fullscreen.css | 2 +- lib/tpl/dokuwiki/css/_media_popup.css | 2 +- lib/tpl/dokuwiki/css/_modal.css | 2 +- lib/tpl/dokuwiki/css/design.less | 8 ++++---- lib/tpl/dokuwiki/css/mobile.less | 4 ++-- 27 files changed, 75 insertions(+), 70 deletions(-) diff --git a/_test/tests/inc/form_form.test.php b/_test/tests/inc/form_form.test.php index 02242a807..7f168b895 100644 --- a/_test/tests/inc/form_form.test.php +++ b/_test/tests/inc/form_form.test.php @@ -30,9 +30,9 @@ class form_test extends DokuWikiTest { $realoutput .= ' '; $realoutput .= 'Check'; $realoutput .= "\n"; - $realoutput .= ''; + $realoutput .= ''; $realoutput .= "\n"; - $realoutput .= ''; + $realoutput .= ''; $realoutput .= "\n"; $realoutput .= "\n\n"; return $realoutput; diff --git a/inc/form.php b/inc/form.php index 748983281..91a171555 100644 --- a/inc/form.php +++ b/inc/form.php @@ -400,7 +400,7 @@ function form_makeWikiText($text, $attrs=array()) { function form_makeButton($type, $act, $value='', $attrs=array()) { if ($value == '') $value = $act; $elem = array('_elem'=>'button', 'type'=>$type, '_action'=>$act, - 'value'=>$value, 'class'=>'button'); + 'value'=>$value); if (!empty($attrs['accesskey']) && empty($attrs['title'])) { $attrs['title'] = $value . ' ['.strtoupper($attrs['accesskey']).']'; } @@ -761,7 +761,9 @@ function form_wikitext($attrs) { */ function form_button($attrs) { $p = (!empty($attrs['_action'])) ? 'name="do['.$attrs['_action'].']" ' : ''; - return ''; + $value = $attrs['value']; + unset($attrs['value']); + return ''; } /** diff --git a/inc/html.php b/inc/html.php index 2f10e3c08..1ccc056de 100644 --- a/inc/html.php +++ b/inc/html.php @@ -183,7 +183,7 @@ function html_topbtn(){ * @param bool|string $label label text, false: lookup btn_$name in localization * @return string */ -function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false){ +function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label=false){ global $conf; global $lang; @@ -221,13 +221,15 @@ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false $tip = htmlspecialchars($label); } - $ret .= 'addElement(form_makeOpenTag('div', array('class' => 'pagenav-prev'))); - $form->addElement(form_makeTag('input', array( + $form->addElement(form_makeOpenTag('button', array( 'type' => 'submit', 'name' => 'first['.$first.']', - 'value' => $lang['btn_newer'], 'accesskey' => 'n', 'title' => $lang['btn_newer'].' [N]', 'class' => 'button show' ))); + $form->addElement($lang['btn_newer']); + $form->addElement(form_makeCloseTag('button')); $form->addElement(form_makeCloseTag('div')); } if ($hasNext) { $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-next'))); - $form->addElement(form_makeTag('input', array( + $form->addElement(form_makeOpenTag('button', array( 'type' => 'submit', 'name' => 'first['.$last.']', - 'value' => $lang['btn_older'], 'accesskey' => 'p', 'title' => $lang['btn_older'].' [P]', 'class' => 'button show' ))); + $form->addElement($lang['btn_older']); + $form->addElement(form_makeCloseTag('button')); $form->addElement(form_makeCloseTag('div')); } $form->addElement(form_makeCloseTag('div')); @@ -1005,7 +1009,7 @@ function html_li_default($item){ * @param callable $func callback to print an list item * @param callable $lifunc callback to the opening li tag * @param bool $forcewrapper Trigger building a wrapper ul if the first level is - 0 (we have a root object) or 1 (just the root content) + * 0 (we have a root object) or 1 (just the root content) * @return string html of an unordered list */ function html_buildlist($data,$class,$func,$lifunc='html_li_default',$forcewrapper=false){ diff --git a/inc/template.php b/inc/template.php index 95dc52deb..86f41d0ad 100644 --- a/inc/template.php +++ b/inc/template.php @@ -834,7 +834,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) { print 'placeholder="'.$lang['btn_search'].'" '; if(!$autocomplete) print 'autocomplete="off" '; print 'id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" />'; - print ''; + print ''; if($ajax) print '
'; print ''; return true; @@ -1667,7 +1667,7 @@ function tpl_actiondropdown($empty = '', $button = '>') { echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; } diff --git a/install.php b/install.php index 1a2d03dff..4de8093d6 100644 --- a/install.php +++ b/install.php @@ -243,7 +243,7 @@ function print_form($d){
- +
- +
'.$l.''; } echo ' '; - echo ''; + echo ''; echo ''; } diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php index 814bbfe9c..374205769 100644 --- a/lib/plugins/acl/admin.php +++ b/lib/plugins/acl/admin.php @@ -332,7 +332,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin { echo $this->getLang('acl_perms').' '; $inl = $this->_html_select(); echo ''.NL; - echo ''.NL; + echo ''.NL; echo ''.NL; echo '
'; @@ -391,10 +391,10 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin { echo $this->_html_checkboxes($current,empty($this->ns),'acl'); if(is_null($current)){ - echo ''.NL; + echo ''.NL; }else{ - echo ''.NL; - echo ''.NL; + echo ''.NL; + echo ''.NL; } echo ''; @@ -641,7 +641,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin { echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; echo ''; diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js index 58598b1e0..86badffdd 100644 --- a/lib/plugins/acl/script.js +++ b/lib/plugins/acl/script.js @@ -16,7 +16,7 @@ var dw_acl = { } jQuery('#acl__user select').change(dw_acl.userselhandler); - jQuery('#acl__user input[type=submit]').click(dw_acl.loadinfo); + jQuery('#acl__user button').click(dw_acl.loadinfo); $tree = jQuery('#acl__tree'); $tree.dw_tree({toggle_selector: 'img', diff --git a/lib/plugins/config/admin.php b/lib/plugins/config/admin.php index 2ef570b68..ec8ee0b84 100644 --- a/lib/plugins/config/admin.php +++ b/lib/plugins/config/admin.php @@ -212,8 +212,8 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin { if (!$this->_config->locked) { ptln(' '); - ptln(' '); - ptln(' '); + ptln(' '); + ptln(' '); } ptln('

'); diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 11aea1d0e..bf099d308 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -535,7 +535,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $classes = 'button '.$action; $name = 'fn['.$action.']['.hsc($extension->getID()).']'; - return ''; + return ' '; } /** diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index c74c44ad1..0c43de6ae 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -5,7 +5,7 @@ jQuery(function(){ /** * Confirm uninstalling */ - $extmgr.find('input.uninstall').click(function(e){ + $extmgr.find('button.uninstall').click(function(e){ if(!window.confirm(LANG.plugins.extension.reallydel)){ e.preventDefault(); return false; @@ -46,7 +46,7 @@ jQuery(function(){ /** * Enable/Disable extension via AJAX */ - $extmgr.find('input.disable, input.enable').click(function (e) { + $extmgr.find('button.disable, button.enable').click(function (e) { e.preventDefault(); var $btn = jQuery(this); diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index 86e540b0f..c400d649a 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -80,8 +80,8 @@ overflow: hidden; } - input.button { - margin: 0 .3em .3em 0; + button { + margin-bottom: .3em; } } diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php index a2c3c6c8b..0cf174e0d 100644 --- a/lib/plugins/popularity/admin.php +++ b/lib/plugins/popularity/admin.php @@ -144,7 +144,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { .'' .''; } - $form .= '' + $form .= '' .'' .''; return $form; diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php index b61615d00..1a0300585 100644 --- a/lib/plugins/revert/admin.php +++ b/lib/plugins/revert/admin.php @@ -64,9 +64,9 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { global $lang, $INPUT; echo '
'; echo ''; - echo ''; - echo ' '; - echo ' '.$this->getLang('note1').''; + echo ' '; + echo ' '; + echo ''.$this->getLang('note1').''; echo '


'; } @@ -173,7 +173,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { echo ''; echo '

'; - echo ' '; + echo ' '; printf($this->getLang('note2'),hsc($filter)); echo '

'; diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index 0d92e5cc1..86823ee2f 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -241,18 +241,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { ptln(" "); ptln(" "); ptln(" "); - ptln(" lang['delete_selected']."\" id=\"usrmgr__del\" />"); - ptln(" "); + ptln(" "); + ptln(" "); ptln(" "); - ptln(" lang['start']."\" />"); - ptln(" lang['prev']."\" />"); - ptln(" lang['next']."\" />"); - ptln(" lang['last']."\" />"); + ptln(" "); + ptln(" "); + ptln(" "); + ptln(" "); ptln(" "); if (!empty($this->_filter)) { - ptln(" lang['clear']."\" />"); + ptln(" "); } - ptln(" "); + ptln(" "); ptln(" "); ptln(" "); @@ -360,7 +360,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { $this->_htmlFilterSettings($indent+10); - ptln(" lang[$cmd]."\" />",$indent); + ptln(" ",$indent); ptln(" ",$indent); ptln(" ",$indent); ptln(" ",$indent); @@ -369,7 +369,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { if ($notes) { ptln(" "); } @@ -456,7 +456,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { ptln('
',$indent); formSecurityToken(); ptln(' ',$indent); - ptln(' ',$indent); + ptln(' ',$indent); ptln(' ',$indent); ptln(' ',$indent); diff --git a/lib/plugins/usermanager/style.css b/lib/plugins/usermanager/style.css index d119b195a..9028fed5e 100644 --- a/lib/plugins/usermanager/style.css +++ b/lib/plugins/usermanager/style.css @@ -17,7 +17,7 @@ padding-left: 0; padding-right: 1.4em; } -#user__manager input.button[disabled] { +#user__manager button[disabled] { color: #ccc!important; border-color: #ccc!important; } diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index fb61f6e48..97955dad9 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -107,7 +107,7 @@ var dw_behaviour = { quickSelect: function(){ jQuery('select.quickselect') .change(function(e){ e.target.form.submit(); }) - .closest('form').find('input[type=submit]').not('.show').hide(); + .closest('form').find(':button').not('.show').hide(); }, /** @@ -171,10 +171,10 @@ var dw_behaviour = { if($checked.length < 2){ $all.attr('disabled',false); - jQuery('#page__revisions input[type=submit]').attr('disabled',true); + jQuery('#page__revisions button').attr('disabled',true); }else{ $all.attr('disabled',true); - jQuery('#page__revisions input[type=submit]').attr('disabled',false); + jQuery('#page__revisions button').attr('disabled',false); for(var i=0; i<$checked.length; i++){ $checked[i].disabled = false; if(i>1){ diff --git a/lib/scripts/editor.js b/lib/scripts/editor.js index f4143f0bc..fac084489 100644 --- a/lib/scripts/editor.js +++ b/lib/scripts/editor.js @@ -146,7 +146,7 @@ var dw_editor = { if((e.keyCode == 13 || e.keyCode == 10) && e.ctrlKey) { // Ctrl-Enter (With Chrome workaround) // Submit current edit - jQuery('input#edbtn__save').click(); + jQuery('#edbtn__save').click(); e.preventDefault(); // prevent enter key return false; }else if(e.keyCode == 13){ // Enter diff --git a/lib/scripts/fileuploaderextended.js b/lib/scripts/fileuploaderextended.js index f5786c387..d6a82397d 100644 --- a/lib/scripts/fileuploaderextended.js +++ b/lib/scripts/fileuploaderextended.js @@ -82,7 +82,7 @@ qq.FileUploaderExtended = function(o){ '
' + LANG.media_select + '
' + '
    ' + '
    ' + - ' ' + + ' ' + ' ' + '
    ' + '
    ', @@ -189,7 +189,7 @@ qq.extend(qq.FileUploaderExtended.prototype, { var button = '
    '; button += ''; button += ''; - button += '
    '; + button += ''; jQuery('#mediamanager__uploader').append(button); } } diff --git a/lib/scripts/hotkeys.js b/lib/scripts/hotkeys.js index bff28530d..76a277aea 100644 --- a/lib/scripts/hotkeys.js +++ b/lib/scripts/hotkeys.js @@ -26,7 +26,7 @@ function Hotkeys() { * Initialization * * This function looks up all the accesskeys used in the current page - * (at anchor elements and input elements [type="submit"]) and registers + * (at anchor elements and button elements [type="submit"]) and registers * appropriate shortcuts. * * Secondly, initialization registers listeners on document to catch all @@ -59,10 +59,10 @@ function Hotkeys() { }); /** - * Lookup all input [type="submit"] with accesskey and register event - + * Lookup all button [type="submit"] with accesskey and register event - * perform "click" on a button. */ - var inputs = document.getElementsByTagName("input"); + var inputs = document.getElementsByTagName("button"); t.each(inputs, function(i) { if (i.type == "submit" && i.accessKey != "") { t.addShortcut(t.modifier + '+' + i.accessKey, function() { diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 8ca21ecab..2995addfd 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -119,7 +119,7 @@ var dw_mediamanager = { $both = $listType.add($sortBy); // Remove the submit button - $options.find('input[type=submit]').parent().hide(); + $options.find('button[type=submit]').parent().hide(); // Prepare HTML for jQuery UI buttonset $both.find('label').each(function () { @@ -435,7 +435,7 @@ var dw_mediamanager = { dw_mediamanager.$resizables().resizable('destroy'); if (update_list) { - dw_mediamanager.list.call(jQuery('#mediamanager__page form.options input[type="submit"]')[0]); + dw_mediamanager.list.call(jQuery('#mediamanager__page form.options button[type="submit"]')[0]); } $content.html(data); diff --git a/lib/tpl/dokuwiki/css/_edit.css b/lib/tpl/dokuwiki/css/_edit.css index f40aaa891..d6dcb93ab 100644 --- a/lib/tpl/dokuwiki/css/_edit.css +++ b/lib/tpl/dokuwiki/css/_edit.css @@ -88,7 +88,7 @@ div.picker button.toolbutton { margin-right: 0; margin-left: 1em; } -.dokuwiki .editBar .editButtons input { +.dokuwiki .editBar .editButtons button { } /* summary input and minor changes checkbox */ @@ -130,7 +130,7 @@ div.picker button.toolbutton { [dir=rtl] .dokuwiki .secedit { float: left; } -.dokuwiki .secedit input.button { +.dokuwiki .secedit button { font-size: 75%; } diff --git a/lib/tpl/dokuwiki/css/_forms.css b/lib/tpl/dokuwiki/css/_forms.css index 522f9ed4d..bf70fa24b 100644 --- a/lib/tpl/dokuwiki/css/_forms.css +++ b/lib/tpl/dokuwiki/css/_forms.css @@ -62,8 +62,7 @@ } -.dokuwiki input.button, -.dokuwiki button.button { +.dokuwiki button { vertical-align: middle; } /** diff --git a/lib/tpl/dokuwiki/css/_media_fullscreen.css b/lib/tpl/dokuwiki/css/_media_fullscreen.css index 31b71897b..71308ec85 100644 --- a/lib/tpl/dokuwiki/css/_media_fullscreen.css +++ b/lib/tpl/dokuwiki/css/_media_fullscreen.css @@ -394,7 +394,7 @@ width: 50%; } -#mediamanager__page form.meta input.button { +#mediamanager__page form.meta button { width: auto; } diff --git a/lib/tpl/dokuwiki/css/_media_popup.css b/lib/tpl/dokuwiki/css/_media_popup.css index 20d669c14..af536489c 100644 --- a/lib/tpl/dokuwiki/css/_media_popup.css +++ b/lib/tpl/dokuwiki/css/_media_popup.css @@ -204,7 +204,7 @@ html.popup { } #dw__mediasearch input.edit { } -#dw__mediasearch input.button { +#dw__mediasearch button { } diff --git a/lib/tpl/dokuwiki/css/_modal.css b/lib/tpl/dokuwiki/css/_modal.css index a46dff30e..37f64830f 100644 --- a/lib/tpl/dokuwiki/css/_modal.css +++ b/lib/tpl/dokuwiki/css/_modal.css @@ -88,7 +88,7 @@ cursor: default; } -#media__popup_content .button { +#media__popup_content button { margin-right: 1px; cursor: pointer; } diff --git a/lib/tpl/dokuwiki/css/design.less b/lib/tpl/dokuwiki/css/design.less index 548ba7228..ed643fb25 100644 --- a/lib/tpl/dokuwiki/css/design.less +++ b/lib/tpl/dokuwiki/css/design.less @@ -207,12 +207,12 @@ form.search { position: relative; margin-bottom: 0.5em; - input.edit { + input { width: 18em; padding: .35em 22px .35em .1em; } - input.button { + button { background: transparent url(images/search.png) no-repeat 0 0; border-width: 0; width: 19px; @@ -225,11 +225,11 @@ form.search { } [dir=rtl] form.search { - input.edit { + input { padding: .35em .1em .35em 22px; } - input.button { + button { background-position: 5px 0; margin-left: 0; margin-right: -20px; diff --git a/lib/tpl/dokuwiki/css/mobile.less b/lib/tpl/dokuwiki/css/mobile.less index e5e13e221..a52c723ca 100644 --- a/lib/tpl/dokuwiki/css/mobile.less +++ b/lib/tpl/dokuwiki/css/mobile.less @@ -237,7 +237,7 @@ body { margin: 0 0 .2em .2em; } -#dokuwiki__sitetools form.search input.edit { +#dokuwiki__sitetools form.search input { width: 100% !important; } .dokuwiki form.search div.ajax_qsearch { @@ -261,7 +261,7 @@ body { } /* force same height on search input and tools select */ -#dokuwiki__sitetools form.search input.edit, +#dokuwiki__sitetools form.search input, #dokuwiki__header .mobileTools select { height: 2.1em; line-height: 2.1em; -- cgit v1.2.3