aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/form/CheckBox.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dijit/form/CheckBox.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/form/CheckBox.js')
-rw-r--r--includes/js/dijit/form/CheckBox.js133
1 files changed, 0 insertions, 133 deletions
diff --git a/includes/js/dijit/form/CheckBox.js b/includes/js/dijit/form/CheckBox.js
deleted file mode 100644
index 295a711..0000000
--- a/includes/js/dijit/form/CheckBox.js
+++ /dev/null
@@ -1,133 +0,0 @@
-if(!dojo._hasResource["dijit.form.CheckBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.form.CheckBox"] = true;
-dojo.provide("dijit.form.CheckBox");
-
-dojo.require("dijit.form.Button");
-
-dojo.declare(
- "dijit.form.CheckBox",
- dijit.form.ToggleButton,
- {
- // summary:
- // Same as an HTML checkbox, but with fancy styling.
- //
- // description:
- // User interacts with real html inputs.
- // On onclick (which occurs by mouse click, space-bar, or
- // using the arrow keys to switch the selected radio button),
- // we update the state of the checkbox/radio.
- //
- // There are two modes:
- // 1. High contrast mode
- // 2. Normal mode
- // In case 1, the regular html inputs are shown and used by the user.
- // In case 2, the regular html inputs are invisible but still used by
- // the user. They are turned quasi-invisible and overlay the background-image.
-
- templateString:"<div class=\"dijitReset dijitInline\" waiRole=\"presentation\"\n\t><input\n\t \ttype=\"${type}\" name=\"${name}\"\n\t\tclass=\"dijitReset dijitCheckBoxInput\"\n\t\tdojoAttachPoint=\"focusNode\"\n\t \tdojoAttachEvent=\"onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick\"\n/></div>\n",
-
- baseClass: "dijitCheckBox",
-
- // Value of "type" attribute for <input>
- type: "checkbox",
-
- // value: Value
- // equivalent to value field on normal checkbox (if checked, the value is passed as
- // the value when form is submitted)
- value: "on",
-
- setValue: function(/*String or Boolean*/ newValue){
- // summary:
- // When passed a boolean, controls whether or not the CheckBox is checked.
- // If passed a string, changes the value attribute of the CheckBox (the one
- // specified as "value" when the CheckBox was constructed (ex: <input
- // dojoType="dijit.CheckBox" value="chicken">)
- if(typeof newValue == "string"){
- this.setAttribute('value', newValue);
- newValue = true;
- }
- this.setAttribute('checked', newValue);
- },
-
- _getValueDeprecated: false, // remove when _FormWidget:_getValueDeprecated is removed
- getValue: function(){
- // summary:
- // If the CheckBox is checked, returns the value attribute.
- // Otherwise returns false.
- return (this.checked ? this.value : false);
- },
-
- reset: function(){
- this.inherited(arguments);
- this.setAttribute('value', this._resetValueAttr);
- },
-
- postCreate: function(){
- this.inherited(arguments);
- this._resetValueAttr = this.value;
- }
- }
-);
-
-dojo.declare(
- "dijit.form.RadioButton",
- dijit.form.CheckBox,
- {
- // summary:
- // Same as an HTML radio, but with fancy styling.
- //
- // description:
- // Implementation details
- //
- // Specialization:
- // We keep track of dijit radio groups so that we can update the state
- // of all the siblings (the "context") in a group based on input
- // events. We don't rely on browser radio grouping.
-
- type: "radio",
- baseClass: "dijitRadio",
-
- // This shared object keeps track of all widgets, grouped by name
- _groups: {},
-
- postCreate: function(){
- // add this widget to _groups
- (this._groups[this.name] = this._groups[this.name] || []).push(this);
-
- this.inherited(arguments);
- },
-
- uninitialize: function(){
- // remove this widget from _groups
- dojo.forEach(this._groups[this.name], function(widget, i, arr){
- if(widget === this){
- arr.splice(i, 1);
- return;
- }
- }, this);
- },
-
- setAttribute: function(/*String*/ attr, /*anything*/ value){
- // If I am being checked then have to deselect currently checked radio button
- this.inherited(arguments);
- switch(attr){
- case "checked":
- if(this.checked){
- dojo.forEach(this._groups[this.name], function(widget){
- if(widget != this && widget.checked){
- widget.setAttribute('checked', false);
- }
- }, this);
- }
- }
- },
-
- _clicked: function(/*Event*/ e){
- if(!this.checked){
- this.setAttribute('checked', true);
- }
- }
- }
-);
-
-}