diff --git a/node/src/documents/collections/form.html b/node/src/documents/collections/form.html index cfddd9bf8..9738efbcd 100755 --- a/node/src/documents/collections/form.html +++ b/node/src/documents/collections/form.html @@ -116,21 +116,40 @@ type : 'UI Collection'

Radio Box

Radio boxes are styled forms of standard form radio controls.

-
-
- -
- - -
+
+
+ +
-
- -
- - -
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ +
+
diff --git a/node/src/documents/modules/checkbox.html b/node/src/documents/modules/checkbox.html new file mode 100755 index 000000000..ecee1b326 --- /dev/null +++ b/node/src/documents/modules/checkbox.html @@ -0,0 +1,166 @@ +--- +layout : 'default' +css : 'button' + +title : 'Checkbox' +type : 'UI Module' +--- + +
+
+

Checkbox

+

Checkbox is a plugin for attaching form events to UI checkbox

+
+
+
+ + +

UI checkboxes do not need javascript to function correctly, checkboxs can be triggered by matching the label's for attribute to the id tag of an input field

+

However, there may be situations where it is less work to use javascript to initialize a checkbox then to manually assign ID tags to each field, or you might want to programmatically trigger the checkbox state. In these cases the checkbox module may be useful.

+ +

Examples

+ +

Initializing a check box

+
$('.ui.checkbox') + .checkbox() +; +
+ +
+

Check Box

+

The html required for a standard UI checkbox

+
+ + +
+
+ +
+

Radio Box

+

The html required for a standard UI radio box

+

A radio box is just a reskinned version of a checkbox, the initialization of the module is the same.

+
+ + +
+
+ + +

Getting Started

+ +

The plugin must be initialized once before methods can be accessed

+
$('.ui.checkbox') + .checkbox() +;
+ +

You can enable a checkbox programmatically using the enable method

+
$('.ui.checkbox') + .checkbox('enable') +;
+ +

You can enable all checkboxes initialized at the same time by calling the enableAll method

+
$('.ui.checkbox') + .checkbox('enableAll') +;
+ + +

You can disable a checkbox programmatically using the disable method

+
$('.ui.checkbox') + .checkbox('disable') +;
+ +

You can disable all checkboxes initialized at the same time by calling the disableAll method

+
$('.ui.checkbox') + .checkbox('disableAll') +;
+ +

Settings

+

Changing Settings

+
    +
  1. A settings object can be passed in when initializing the plugin +
    $('.foo') + .checkbox({ + moduleName: 'Godzilla' + }) +;
    +
  2. +
  3. Default settings for the module can be overridden by modifying $.fn.Checkbox.settings. +
    $.fn.Checkbox.settings.moduleName = 'Godzilla';
    +
  4. +
  5. Settings can be changed after a module is initialized by calling the 'settings' method on the module with either a settings object or a name, value pair. +
    $('.foo').checkbox('setting', 'moduleName', 'Godzilla');
    +
  6. +
+

Reading Settings

+

Settings can also be read programmatically:

$('.foo').checkbox('setting', 'moduleName');
+

Defaults

+ + + + + + + + + + + + + + + + + + + +
Callbacks
onChangeNoneCallback after a checkbox is either disabled or enabled.
onEnableNoneCallback after a checkbox is enabled.
onDisableNoneCallback after a checkbox is disabled.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UI Module Settings
moduleNameCheckboxName used in debug logs
debugTrueProvides standard debug output to console
performanceFalseProvides standard debug output to console
verboseFalseProvides ancillary debug output to console
namespacecheckboxEvent namespace. Makes sure module teardown does not effect other events attached to an element.
errors +
errors : { + method : 'The method you called is not defined.' +}
+
+ +
+ + + \ No newline at end of file diff --git a/node/src/files/components/semantic/src/elements/button.css b/node/src/files/components/semantic/src/elements/button.css index 101e50235..42652a2a9 100644 --- a/node/src/files/components/semantic/src/elements/button.css +++ b/node/src/files/components/semantic/src/elements/button.css @@ -32,7 +32,7 @@ line-height: 1; font-weight: bold; font-style: normal; - + color: #7A7A7A; text-align: center; @@ -90,7 +90,7 @@ *******************************/ /*-------------- - Hover + Hover ---------------*/ .ui.button:hover, @@ -99,7 +99,7 @@ } /*-------------- - Down (:active) + Down (:active) ---------------*/ /* Down */ @@ -113,7 +113,7 @@ /*-------------- - Active + Active ---------------*/ .ui.buttons .button.active, @@ -151,7 +151,7 @@ } /*-------------- - Loading + Loading ---------------*/ .ui.button.loading, @@ -230,7 +230,7 @@ /*-------------- - Error + Error ---------------*/ .ui.buttons .button.error, @@ -268,7 +268,7 @@ color: #DDDDDD; background-color: rgba(50, 50, 50, 0.05) !important; background-image: none !important; - + text-shadow: none !important; -webkit-box-shadow: none !important; @@ -540,11 +540,11 @@ Containing Icon .ui.icon.buttons .button i, .ui.icon.button i { margin: 0em; - vertical-align: text-top; + vertical-align: top; } /*-------------- - Toggle + Toggle ---------------*/ /* Toggle (Modifies active state to give affordances) */ @@ -602,62 +602,63 @@ Containing Icon .ui.button.attached.top { border: 1px solid rgba(0, 0, 0, 0.1); border-bottom: none; - - -webkit-border-radius: 0.3125em 0.3125em 0px 0px; - -moz-border-radius: 0.3125em 0.3125em 0px 0px; - border-radius: 0.3125em 0.3125em 0px 0px; + + -webkit-border-radius: 0.3125em 0.3125em 0em 0em; + -moz-border-radius: 0.3125em 0.3125em 0em 0em; + border-radius: 0.3125em 0.3125em 0em 0em; } .ui.button.attached.bottom { border: 1px solid rgba(0, 0, 0, 0.1); border-top: none; - -webkit-border-radius: 0px 0px 0.3125em 0.3125em; - -moz-border-radius: 0px 0px 0.3125em 0.3125em; - border-radius: 0px 0px 0.3125em 0.3125em; + -webkit-border-radius: 0em 0em 0.3125em 0.3125em; + -moz-border-radius: 0em 0em 0.3125em 0.3125em; + border-radius: 0em 0em 0.3125em 0.3125em; } .ui.button.attached.left { display: inline-block; border-left: none; + padding-right: 0.75em; border-right: 1px solid rgba(0, 0, 0, 0.1); - - -webkit-border-radius: 0.3125em 0px 0px 0.3125em; - -moz-border-radius: 0.3125em 0px 0px 0.3125em; - border-radius: 0.3125em 0px 0px 0.3125em; + + -webkit-border-radius: 0.3125em 0em 0em 0.3125em; + -moz-border-radius: 0.3125em 0em 0em 0.3125em; + border-radius: 0.3125em 0em 0em 0.3125em; } .ui.button.attached.right { display: inline-block; - + + padding-left: 0.75em; border-left: 1px solid rgba(0, 0, 0, 0.1); - -webkit-border-radius: 0px 0.3125em 0.3125em 0px; - -moz-border-radius: 0px 0.3125em 0.3125em 0px; - border-radius: 0px 0.3125em 0.3125em 0px; + -webkit-border-radius: 0em 0.3125em 0.3125em 0em; + -moz-border-radius: 0em 0.3125em 0.3125em 0em; + border-radius: 0em 0.3125em 0.3125em 0em; } /* Button attached to a form element */ input + .ui.attached.button { display: inline-block; - min-width: 40px; - margin: 0px 0px 0px -15px; - height: 14px; - padding: 8px 15px; - border: 1px solid #D0D0D0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + margin: 0 0 0 -1em; + padding: 0.68em 1em; + vertical-align: top; + + font-size: 0.825em; - -webkit-border-radius: 0px 0.3125em 0.3125em 0px; - -moz-border-radius: 0px 0.3125em 0.3125em 0px; - border-radius: 0px 0.3125em 0.3125em 0px; + -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; + -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; - vertical-align: top; + -webkit-border-radius: 0em 0.3125em 0.3125em 0em; + -moz-border-radius: 0em 0.3125em 0.3125em 0em; + border-radius: 0em 0.3125em 0.3125em 0em; } -input + .ui.attached.button.down { - -webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; - -moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; - box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; +input:focus + .ui.attached.button { + -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; + -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; } .ui.attached.button.loading, .ui.attached.button.loading.hover { @@ -921,7 +922,7 @@ input + .ui.attached.button.down { font-size: 15px; } -.ui.huge.buttons .or:after, +.ui.huge.buttons .or:after, .ui.buttons .huge.or:after { top: 6px; width: 6px; diff --git a/node/src/files/components/semantic/src/modules/checkbox.js b/node/src/files/components/semantic/src/modules/checkbox.js index 230b77017..75070e183 100644 --- a/node/src/files/components/semantic/src/modules/checkbox.js +++ b/node/src/files/components/semantic/src/modules/checkbox.js @@ -72,6 +72,19 @@ $.fn.checkbox = function(parameters) { } }, + enableAll: function() { + module.debug('Disabling all checkbox'); + $.each($allModules, function() { + $(this).checkbox('enable'); + }); + }, + disableAll: function() { + module.debug('Enabling all checkbox'); + $.each($allModules, function() { + $(this).checkbox('disable'); + }); + }, + enable: function() { module.debug('Enabling checkbox'); $module diff --git a/node/src/files/stylesheets/semantic.css b/node/src/files/stylesheets/semantic.css index e6bb25e61..5713337ff 100755 --- a/node/src/files/stylesheets/semantic.css +++ b/node/src/files/stylesheets/semantic.css @@ -561,7 +561,7 @@ box-shadow: 3px 0px 2px rgba(0, 0, 0, 0.2); */ } -@media only screen and (max-width : 1420px) { +@media only screen and (max-width : 1600px) { #example .container { width: auto; diff --git a/node/src/layouts/default.html.eco b/node/src/layouts/default.html.eco index 0279bae2f..54dc1000b 100755 --- a/node/src/layouts/default.html.eco +++ b/node/src/layouts/default.html.eco @@ -131,7 +131,7 @@
- + <%- @content %> diff --git a/src/elements/button.css b/src/elements/button.css index 101e50235..42652a2a9 100755 --- a/src/elements/button.css +++ b/src/elements/button.css @@ -32,7 +32,7 @@ line-height: 1; font-weight: bold; font-style: normal; - + color: #7A7A7A; text-align: center; @@ -90,7 +90,7 @@ *******************************/ /*-------------- - Hover + Hover ---------------*/ .ui.button:hover, @@ -99,7 +99,7 @@ } /*-------------- - Down (:active) + Down (:active) ---------------*/ /* Down */ @@ -113,7 +113,7 @@ /*-------------- - Active + Active ---------------*/ .ui.buttons .button.active, @@ -151,7 +151,7 @@ } /*-------------- - Loading + Loading ---------------*/ .ui.button.loading, @@ -230,7 +230,7 @@ /*-------------- - Error + Error ---------------*/ .ui.buttons .button.error, @@ -268,7 +268,7 @@ color: #DDDDDD; background-color: rgba(50, 50, 50, 0.05) !important; background-image: none !important; - + text-shadow: none !important; -webkit-box-shadow: none !important; @@ -540,11 +540,11 @@ Containing Icon .ui.icon.buttons .button i, .ui.icon.button i { margin: 0em; - vertical-align: text-top; + vertical-align: top; } /*-------------- - Toggle + Toggle ---------------*/ /* Toggle (Modifies active state to give affordances) */ @@ -602,62 +602,63 @@ Containing Icon .ui.button.attached.top { border: 1px solid rgba(0, 0, 0, 0.1); border-bottom: none; - - -webkit-border-radius: 0.3125em 0.3125em 0px 0px; - -moz-border-radius: 0.3125em 0.3125em 0px 0px; - border-radius: 0.3125em 0.3125em 0px 0px; + + -webkit-border-radius: 0.3125em 0.3125em 0em 0em; + -moz-border-radius: 0.3125em 0.3125em 0em 0em; + border-radius: 0.3125em 0.3125em 0em 0em; } .ui.button.attached.bottom { border: 1px solid rgba(0, 0, 0, 0.1); border-top: none; - -webkit-border-radius: 0px 0px 0.3125em 0.3125em; - -moz-border-radius: 0px 0px 0.3125em 0.3125em; - border-radius: 0px 0px 0.3125em 0.3125em; + -webkit-border-radius: 0em 0em 0.3125em 0.3125em; + -moz-border-radius: 0em 0em 0.3125em 0.3125em; + border-radius: 0em 0em 0.3125em 0.3125em; } .ui.button.attached.left { display: inline-block; border-left: none; + padding-right: 0.75em; border-right: 1px solid rgba(0, 0, 0, 0.1); - - -webkit-border-radius: 0.3125em 0px 0px 0.3125em; - -moz-border-radius: 0.3125em 0px 0px 0.3125em; - border-radius: 0.3125em 0px 0px 0.3125em; + + -webkit-border-radius: 0.3125em 0em 0em 0.3125em; + -moz-border-radius: 0.3125em 0em 0em 0.3125em; + border-radius: 0.3125em 0em 0em 0.3125em; } .ui.button.attached.right { display: inline-block; - + + padding-left: 0.75em; border-left: 1px solid rgba(0, 0, 0, 0.1); - -webkit-border-radius: 0px 0.3125em 0.3125em 0px; - -moz-border-radius: 0px 0.3125em 0.3125em 0px; - border-radius: 0px 0.3125em 0.3125em 0px; + -webkit-border-radius: 0em 0.3125em 0.3125em 0em; + -moz-border-radius: 0em 0.3125em 0.3125em 0em; + border-radius: 0em 0.3125em 0.3125em 0em; } /* Button attached to a form element */ input + .ui.attached.button { display: inline-block; - min-width: 40px; - margin: 0px 0px 0px -15px; - height: 14px; - padding: 8px 15px; - border: 1px solid #D0D0D0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + margin: 0 0 0 -1em; + padding: 0.68em 1em; + vertical-align: top; + + font-size: 0.825em; - -webkit-border-radius: 0px 0.3125em 0.3125em 0px; - -moz-border-radius: 0px 0.3125em 0.3125em 0px; - border-radius: 0px 0.3125em 0.3125em 0px; + -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; + -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.15) inset; - vertical-align: top; + -webkit-border-radius: 0em 0.3125em 0.3125em 0em; + -moz-border-radius: 0em 0.3125em 0.3125em 0em; + border-radius: 0em 0.3125em 0.3125em 0em; } -input + .ui.attached.button.down { - -webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; - -moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; - box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3) inset; +input:focus + .ui.attached.button { + -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; + -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.3) inset; } .ui.attached.button.loading, .ui.attached.button.loading.hover { @@ -921,7 +922,7 @@ input + .ui.attached.button.down { font-size: 15px; } -.ui.huge.buttons .or:after, +.ui.huge.buttons .or:after, .ui.buttons .huge.or:after { top: 6px; width: 6px; diff --git a/src/modules/checkbox.js b/src/modules/checkbox.js index 230b77017..75070e183 100755 --- a/src/modules/checkbox.js +++ b/src/modules/checkbox.js @@ -72,6 +72,19 @@ $.fn.checkbox = function(parameters) { } }, + enableAll: function() { + module.debug('Disabling all checkbox'); + $.each($allModules, function() { + $(this).checkbox('enable'); + }); + }, + disableAll: function() { + module.debug('Enabling all checkbox'); + $.each($allModules, function() { + $(this).checkbox('disable'); + }); + }, + enable: function() { module.debug('Enabling checkbox'); $module