From 5581c618fcff1c669f81b75d0545de0200707599 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 27 Mar 2013 16:02:47 +0800 Subject: [PATCH] MDL-38751 usability: Different style for cancel button --- lib/form/cancel.php | 7 +++++++ theme/afterburner/style/afterburner_styles.css | 12 ++++++++++++ theme/anomaly/style/base.css | 12 ++++++++++++ theme/arialist/style/core.css | 12 ++++++++++++ theme/base/style/core.css | 5 +++++ theme/binarius/style/core.css | 12 ++++++++++++ theme/boxxie/style/core.css | 9 +++++++++ theme/brick/style/core.css | 8 ++++++++ theme/canvas/style/core.css | 9 +++++++++ theme/formal_white/style/core.css | 9 +++++++++ theme/formfactor/style/core.css | 2 ++ theme/fusion/style/core.css | 12 ++++++++++++ theme/leatherbound/style/core.css | 12 ++++++++++++ theme/magazine/style/core.css | 9 +++++++++ theme/nimble/style/core.css | 13 ++++++++++++- theme/nonzero/style/core.css | 11 +++++++++++ theme/overlay/style/core.css | 13 ++++++++++++- theme/serenity/style/core.css | 11 +++++++++++ theme/sky_high/style/core.css | 9 +++++++++ theme/splash/style/core.css | 5 +++++ theme/standard/style/core.css | 2 ++ theme/upgrade.txt | 1 + 22 files changed, 193 insertions(+), 2 deletions(-) diff --git a/lib/form/cancel.php b/lib/form/cancel.php index 58ad5710c41..6674377e911 100644 --- a/lib/form/cancel.php +++ b/lib/form/cancel.php @@ -62,6 +62,13 @@ class MoodleQuickForm_cancel extends MoodleQuickForm_submit } MoodleQuickForm_submit::MoodleQuickForm_submit($elementName, $value, $attributes); $this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;')); + + // Add the class btn-cancel. + $class = $this->getAttribute('class'); + if (empty($class)) { + $class = ''; + } + $this->updateAttributes(array('class' => $class . ' btn-cancel')); } /** diff --git a/theme/afterburner/style/afterburner_styles.css b/theme/afterburner/style/afterburner_styles.css index 990fe49ecf3..767cec6804d 100644 --- a/theme/afterburner/style/afterburner_styles.css +++ b/theme/afterburner/style/afterburner_styles.css @@ -479,3 +479,15 @@ tab styles for ie6 & ie7 body#page-course-view-topics.path-course div.moodle-dialogue-base div.yui3-widget{ z-index: 600!important; } + +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #007EBA; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #cc3300; + text-decoration: underline; +} diff --git a/theme/anomaly/style/base.css b/theme/anomaly/style/base.css index 35980ce1c2c..9a9e152a2dc 100644 --- a/theme/anomaly/style/base.css +++ b/theme/anomaly/style/base.css @@ -184,3 +184,15 @@ h6.main { .theme_description h2 { padding-top: 0.5em; } + +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #697F55; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #697F55; + text-decoration: underline; +} diff --git a/theme/arialist/style/core.css b/theme/arialist/style/core.css index 78490732d0a..e27579d5bcd 100644 --- a/theme/arialist/style/core.css +++ b/theme/arialist/style/core.css @@ -308,3 +308,15 @@ h2.headingblock { #custommenu .custom_menu_submenu .custom_menu_submenu .yui3-menu-content { border-top:1px solid #DDD; } + +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #F25F0F; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #333333; + text-decoration: none; +} diff --git a/theme/base/style/core.css b/theme/base/style/core.css index 8816b8eca86..c9ace3b1488 100644 --- a/theme/base/style/core.css +++ b/theme/base/style/core.css @@ -286,6 +286,11 @@ a.skip:active {position: static;display: block;} .dir-rtl.jsenabled .mform fieldset.collapsed {border-width: 1px 1px 0 0; } .dir-rtl .mform .fitem fieldset.felement {padding-right: 1%;margin-right: 15%;} +.mform .btn-cancel, .mform .btn-cancel:active, .mform .btn-cancel[disabled] { background-color: transparent; background-image: none; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; -ms-box-shadow: none; margin-left: .5em;} +.mform .btn-cancel { border-color: transparent; border-radius: 0 0 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; -o-border-radius: 0 0 0 0; -ms-border-radius: 0 0 0 0; color: #0088CC; cursor: pointer; } +.mform .btn-cancel:hover, .mform .btn-cancel:focus { background-color: transparent; color: #005580; text-decoration: underline; } +.mform .btn-cancel[disabled]:hover, .mform .btn-cancel[disabled]:focus { color: #333333; text-decoration: none; } + input#id_externalurl {direction:ltr;} /** Browser corrections for mforms **/ diff --git a/theme/binarius/style/core.css b/theme/binarius/style/core.css index 1f175eca665..fe5e354817f 100644 --- a/theme/binarius/style/core.css +++ b/theme/binarius/style/core.css @@ -321,3 +321,15 @@ body.has_dock { .pagelayout-redirect #content p, .pagelayout-redirect #content div {color:#FFF;} + +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #F14E16; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #FB961C; + text-decoration: none; +} \ No newline at end of file diff --git a/theme/boxxie/style/core.css b/theme/boxxie/style/core.css index 2a0420858a2..c93b5c00813 100644 --- a/theme/boxxie/style/core.css +++ b/theme/boxxie/style/core.css @@ -52,6 +52,15 @@ a:active { padding: 0 5px; } +.mform .btn-cancel { + color: #69804E; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #41512f; + text-decoration: none; +} + .generalbox { border-color: #e5e5e5; padding: 5px; diff --git a/theme/brick/style/core.css b/theme/brick/style/core.css index 6d935fef270..0a6c3e832d7 100644 --- a/theme/brick/style/core.css +++ b/theme/brick/style/core.css @@ -161,6 +161,14 @@ blockquote { background: #fff; } +.mform .btn-cancel { + color: #06365B; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #5487AD; + text-decoration: none; +} div.navbar { border-bottom: 1px solid #eee; diff --git a/theme/canvas/style/core.css b/theme/canvas/style/core.css index f1a86f39f72..f846a186f3d 100644 --- a/theme/canvas/style/core.css +++ b/theme/canvas/style/core.css @@ -509,6 +509,15 @@ input[type="radio"] { margin:0; } +.mform .btn-cancel { + color: #0000EE; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #0000EE; + text-decoration: none; +} + /* Comments -----------------------*/ diff --git a/theme/formal_white/style/core.css b/theme/formal_white/style/core.css index 128d66c69d4..2a5b3574c39 100644 --- a/theme/formal_white/style/core.css +++ b/theme/formal_white/style/core.css @@ -150,6 +150,15 @@ textarea { margin-top:0; } +.mform .btn-cancel { + color: #000000; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #000000; + text-decoration: underline; +} + /* Redirect -----------------------*/ .pagelayout-redirect #content {margin-bottom:10%;} diff --git a/theme/formfactor/style/core.css b/theme/formfactor/style/core.css index 460426835b8..bd316687460 100644 --- a/theme/formfactor/style/core.css +++ b/theme/formfactor/style/core.css @@ -48,6 +48,8 @@ body,h1,h2,h3,h4,h5,h6,p,ul,ol,dl,input,textarea { font-family: "Trebuchet MS", .mform fieldset {border-color: #ddd;} .mform legend {border: 1px solid #ddd;padding: 2px 7px;background: url([[pix:theme|gradient-sb]]) repeat-x 0 -25%;} +.mform .btn-cancel { color: #BF3503; text-decoration: none; } +.mform .btn-cancel:hover, .mform .btn-cancel:focus { color: #3f5c10; text-decoration: none; } /* Footer --------------------------*/ diff --git a/theme/fusion/style/core.css b/theme/fusion/style/core.css index ae3962ab536..d59134dc647 100644 --- a/theme/fusion/style/core.css +++ b/theme/fusion/style/core.css @@ -48,6 +48,18 @@ blockquote { color:#666; } +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #2d83d5; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #333333; + text-decoration: none; +} + .mform fieldset { border-color: #eee; } diff --git a/theme/leatherbound/style/core.css b/theme/leatherbound/style/core.css index 672d82467ae..80303bd59a5 100644 --- a/theme/leatherbound/style/core.css +++ b/theme/leatherbound/style/core.css @@ -351,3 +351,15 @@ h2.headingblock { #custommenu .yui3-menu.javascript-disabled .yui3-menu-content .ul { border-width:0; } + +/* Moodle forms +----------------*/ + +.mform .btn-cancel { + color: #DA5013; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #251c17; + text-decoration: none; +} diff --git a/theme/magazine/style/core.css b/theme/magazine/style/core.css index 02d075c09a8..f34952e7bc5 100644 --- a/theme/magazine/style/core.css +++ b/theme/magazine/style/core.css @@ -817,6 +817,15 @@ div.subscribelink { background: #f9f9f9; } +.mform .btn-cancel { + color: #32529A; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #4E2300; + text-decoration: none; +} + .ftoggler { font-size: 18px; color: #333333; diff --git a/theme/nimble/style/core.css b/theme/nimble/style/core.css index 2d35e8816e4..b0130dd45b4 100644 --- a/theme/nimble/style/core.css +++ b/theme/nimble/style/core.css @@ -223,4 +223,15 @@ h2.headingblock { #page-footer { margin-bottom: 25px; -} \ No newline at end of file +} + +/* Moodle forms +----------------*/ +.mform .btn-cancel { + color: #2A65B1; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #000000; + text-decoration: none; +} diff --git a/theme/nonzero/style/core.css b/theme/nonzero/style/core.css index fa3b2e1c456..9bd837ab453 100644 --- a/theme/nonzero/style/core.css +++ b/theme/nonzero/style/core.css @@ -221,5 +221,16 @@ a:active { border-width:0; } +/* Moodle forms +----------------*/ +.mform .btn-cancel { + color: #27608d; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #000000; + text-decoration: none; +} + /** Custom CSS **/ [[setting:customcss]] diff --git a/theme/overlay/style/core.css b/theme/overlay/style/core.css index d15772e5f88..c8b20b67f80 100644 --- a/theme/overlay/style/core.css +++ b/theme/overlay/style/core.css @@ -287,4 +287,15 @@ h1.headermain { } /** Dock **/ -#dock .firstdockitem {margin-top: 30px;} \ No newline at end of file +#dock .firstdockitem {margin-top: 30px;} + +/* Moodle forms +----------------*/ +.mform .btn-cancel { + color: #428AB5; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #428AB5; + text-decoration: none; +} \ No newline at end of file diff --git a/theme/serenity/style/core.css b/theme/serenity/style/core.css index 8753523fe7f..f06c6f3403c 100644 --- a/theme/serenity/style/core.css +++ b/theme/serenity/style/core.css @@ -309,4 +309,15 @@ body.has_dock { #page-mod-quiz-edit .questionbankwindow.block div.header { background-color: #9EB1BF; padding-top: 0; +} + +/* Moodle forms +----------------*/ +.mform .btn-cancel { + color: #336688; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #336688; + text-decoration: underline; } \ No newline at end of file diff --git a/theme/sky_high/style/core.css b/theme/sky_high/style/core.css index d491d14ea17..ad67242f882 100644 --- a/theme/sky_high/style/core.css +++ b/theme/sky_high/style/core.css @@ -337,3 +337,12 @@ body.has_dock { padding:4px; } /* @end */ + +.mform .btn-cancel { + color: #003466; + text-decoration: none; +} +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #4785ac; + text-decoration: none; +} \ No newline at end of file diff --git a/theme/splash/style/core.css b/theme/splash/style/core.css index 767b4f32318..fa35a343a38 100644 --- a/theme/splash/style/core.css +++ b/theme/splash/style/core.css @@ -185,6 +185,11 @@ body.lang-vi { padding:20px; text-align:center; } +.mform .btn-cancel, +.mform .btn-cancel:hover, .mform .btn-cancel:focus { + color: #853650; + text-decoration: underline; +} /* html editor fixed width -------------------------*/ textarea#id_summary_editor {width:420px;} diff --git a/theme/standard/style/core.css b/theme/standard/style/core.css index 42eb9be1cdf..7977fdf2b9a 100644 --- a/theme/standard/style/core.css +++ b/theme/standard/style/core.css @@ -219,6 +219,8 @@ form.popupform label {margin-right: 0.5em;} .mform .fitem fieldset.felement {margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;} .mform .fpassword .unmask input {margin-left:5px;margin-right:3px;} #page-admin-register .mform .fsubmit {padding:20px;text-align:center;} +.mform .btn-cancel {color: #0000ff;} +.mform .btn-cancel:hover, .mform .btn-cancel:focus {color: #ff0000;} /** * Filters diff --git a/theme/upgrade.txt b/theme/upgrade.txt index 56688c5998c..597c6853584 100644 --- a/theme/upgrade.txt +++ b/theme/upgrade.txt @@ -8,6 +8,7 @@ DOM changes: * new setting $THEME->yuicssmodules = array('cssreset', 'cssfonts', 'cssgrids', 'cssbase'); which allows themes to use different CSS reset normalisers such as cssnormalize YUI module * Re-wrote the user profile views to definition lists. +* Cancel buttons have the class btn-cancel. Renderer changes: * Mymobile theme changed to support more verbose move-block-here descriptions.