From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: 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 --- includes/js/dijit/form/CheckBox.js | 133 ------------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 includes/js/dijit/form/CheckBox.js (limited to 'includes/js/dijit/form/CheckBox.js') 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:"
\n", - - baseClass: "dijitCheckBox", - - // Value of "type" attribute for - 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: ) - 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); - } - } - } -); - -} -- cgit v1.2.3