Changeset 426 for Dev/trunk/client/qed/widgets
- Timestamp:
- 03/13/13 17:07:58 (12 years ago)
- Location:
- Dev/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 data 2 2 nbproject 3 node_modules
-
- Property svn:ignore
-
Dev/trunk/client
- Property svn:externals
-
old new 1 dojo http://svn.dojotoolkit.org/src/tags/release-1.8. 0/dojo2 dijit http://svn.dojotoolkit.org/src/tags/release-1.8. 0/dijit3 dojox http://svn.dojotoolkit.org/src/tags/release-1.8. 0/dojox4 util http://svn.dojotoolkit.org/src/tags/release-1.8. 0/util1 dojo http://svn.dojotoolkit.org/src/tags/release-1.8.3/dojo 2 dijit http://svn.dojotoolkit.org/src/tags/release-1.8.3/dijit 3 dojox http://svn.dojotoolkit.org/src/tags/release-1.8.3/dojox 4 util http://svn.dojotoolkit.org/src/tags/release-1.8.3/util
-
- Property svn:externals
-
Dev/trunk/client/qed/widgets/LineWithActionsWidget.js
r417 r426 42 42 title: this.actions[action].properties.tooltip, 43 43 onClick: lang.hitch(this, function(action, e){ 44 action.callback && action.callback(e);44 if ( action.callback ) { action.callback(e); } 45 45 event.stop(e); 46 46 return false; … … 56 56 title: this.actions[action].properties.tooltip, 57 57 onClick: lang.hitch(this, function(action, e){ 58 action.callback && action.callback(e);58 if ( action.callback ) { action.callback(e); } 59 59 event.stop(e); 60 60 return false; … … 75 75 return !preventDefault; 76 76 }, 77 onClick: function( e) {77 onClick: function(/*e*/) { 78 78 }, 79 79 _setTitleAttr: function(value){ -
Dev/trunk/client/qed/widgets/MultipleChoiceWidget.js
r417 r426 3 3 'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dijit/_Container', 4 4 'dojo/text!./templates/MultipleChoiceWidget.html', 5 'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'], 6 function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin, 7 _WidgetsInTemplateMixin,_Container, 8 templateString,RadioButton,CheckBox,TextBox,Button){ 9 return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{ 10 templateString: templateString, 11 multiple: true, 12 baseClass: 'rftMultipleChoiceWidget', 13 14 allowMultiple: false, 15 name: '', 16 value: null, 17 18 _widgetCache: null, 19 constuctor: function() { 20 this.inherited(arguments); 21 this.value = []; 22 this._widgetCache = {}; 23 }, 24 _setValueAttr: function(value) { 25 this.reset(); 26 this.value = value; 27 array.forEach(this.value,lang.hitch(this,function(val){ 28 this._addRow(val); 29 })); 30 }, 31 _getValueAttr: function() { 32 var value = []; 33 registry.findWidgets(this.domNode).forEach(function(w){ 34 w.isInstanceOf(TextBox) && value.push(w.get('value')); 35 }); 36 this.value = value; 37 return value; 38 }, 39 reset: function() { 40 this._removeWidgetsBelowNode(this.rows); 41 domConstruct.empty(this.rows); 42 }, 43 _onAddRow: function() { 44 this._addRow(); 45 }, 46 _addRow: function(value,tagRow,pos) { 47 var row = domConstruct.create('div',{'class':'row'}); 48 if ( this.allowMultiple ) { 49 new CheckBox({ 50 name:this.name, 51 'class':'rowBox', 52 disabled: this.mode == 'edit' 53 }).placeAt(row); 54 } else { 55 new RadioButton({ 56 name:this.name, 57 'class':'rowBox', 58 disabled: this.mode == 'edit' 59 }).placeAt(row); 60 } 61 new TextBox({ 5 'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button' 6 ], function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin, 7 _WidgetsInTemplateMixin,_Container, templateString,RadioButton,CheckBox,TextBox,Button){ 8 return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{ 9 templateString: templateString, 10 multiple: true, 11 baseClass: 'rftMultipleChoiceWidget', 12 13 allowMultiple: false, 14 name: '', 15 value: null, 16 17 _widgetCache: null, 18 constuctor: function() { 19 this.inherited(arguments); 20 this.value = []; 21 this._widgetCache = {}; 22 }, 23 _setValueAttr: function(value) { 24 this.reset(); 25 this.value = value; 26 array.forEach(this.value,lang.hitch(this,function(val){ 27 this._addRow(val); 28 })); 29 }, 30 _getValueAttr: function() { 31 var value = []; 32 registry.findWidgets(this.domNode).forEach(function(w){ 33 if ( w.isInstanceOf(TextBox) ) { value.push(w.get('value')); } 34 }); 35 this.value = value; 36 return value; 37 }, 38 reset: function() { 39 this._removeWidgetsBelowNode(this.rows); 40 domConstruct.empty(this.rows); 41 }, 42 _onAddRow: function() { 43 this._addRow(); 44 }, 45 _addRow: function(value,tagRow,pos) { 46 var row = domConstruct.create('div',{'class':'row'}); 47 if ( this.allowMultiple ) { 48 new CheckBox({ 62 49 name:this.name, 63 value:value || '',64 'class':'rowText'50 'class':'rowBox', 51 disabled: this.mode === 'edit' 65 52 }).placeAt(row); 66 new Button({ 67 label:'-', 68 'class':'rowBtn', 69 onClick:lang.hitch(this,'_removeNodeWithWidgets',row) 53 } else { 54 new RadioButton({ 55 name:this.name, 56 'class':'rowBox', 57 disabled: this.mode === 'edit' 70 58 }).placeAt(row); 71 new Button({72 label:'+',73 'class':'rowBtn',74 onClick:lang.hitch(this,'_addRow','',row,'before')75 }).placeAt(row);76 domConstruct.place(row,tagRow || this.rows,pos||'last');77 },78 _removeNodeWithWidgets: function(node) {79 this._removeWidgetsBelowNode(node);80 domConstruct.destroy(node);81 },82 _removeWidgetsBelowNode: function(node) {83 registry.findWidgets(node).forEach(function(w){84 w.destroyRecursive();85 });86 },87 _onRowChange: function(row) {88 89 59 } 90 }); 60 new TextBox({ 61 name:this.name, 62 value:value || '', 63 'class':'rowText' 64 }).placeAt(row); 65 new Button({ 66 label:'-', 67 'class':'rowBtn', 68 onClick:lang.hitch(this,'_removeNodeWithWidgets',row) 69 }).placeAt(row); 70 new Button({ 71 label:'+', 72 'class':'rowBtn', 73 onClick:lang.hitch(this,'_addRow','',row,'before') 74 }).placeAt(row); 75 domConstruct.place(row,tagRow || this.rows,pos||'last'); 76 }, 77 _removeNodeWithWidgets: function(node) { 78 this._removeWidgetsBelowNode(node); 79 domConstruct.destroy(node); 80 }, 81 _removeWidgetsBelowNode: function(node) { 82 registry.findWidgets(node).forEach(function(w){ 83 w.destroyRecursive(); 84 }); 85 }, 86 _onRowChange: function(/*row*/) {} 91 87 }); 88 }); -
Dev/trunk/client/qed/widgets/ObjectBox.js
r417 r426 43 43 line3Actions[action] = { 44 44 callback: lang.hitch(this, function(callback){ 45 this.value && callback(this.value);45 if ( this.value ) { callback(this.value); } 46 46 }, this.actions[action]), 47 47 properties: { … … 54 54 return line3Actions; 55 55 }, 56 _showInfoBox: function() { 57 alert(this.value.description); 58 }, 56 _showInfoBox: function() {}, 59 57 _setValueAttr: function(value) { 60 58 this.value = value; -
Dev/trunk/client/qed/widgets/Selector.js
r417 r426 70 70 action.callback), 71 71 properties: { 72 73 74 75 76 72 blockButton: true, 73 label: action.title || actionName, 74 icon: action.icon, 75 tooltip: action.description 76 } 77 77 78 78 }; … … 145 145 this._folded = true; 146 146 } 147 evt && event.stop(evt);147 if ( evt ) { event.stop(evt); } 148 148 return false; 149 149 }, … … 174 174 }, 175 175 176 onSelect: function( item) {}176 onSelect: function(/*item*/) {} 177 177 }); 178 178 }); -
Dev/trunk/client/qed/widgets/ThresholdFilteringSelect.js
r417 r426 4 4 ], function(declare, FilteringSelect) { 5 5 return declare(FilteringSelect, { 6 7 6 // custom min input character count to trigger search 7 minKeyCount: 3, 8 8 9 10 11 12 13 14 15 16 9 // override search method, count the input length 10 _startSearch: function (/*String*/key) { 11 if (!key || key.length < this.minKeyCount) { 12 this.closeDropDown(); 13 return; 14 } 15 this.inherited(arguments); 16 } 17 17 }); 18 18 }); -
Dev/trunk/client/qed/widgets/list/List.js
r420 r426 52 52 }; 53 53 }, 54 _createListNode: function( item) {},55 _createAvatarNode: function( item) {},54 _createListNode: function(/*item*/) {}, 55 _createAvatarNode: function(/*item*/) {}, 56 56 57 57 appendItem: function(item) { … … 86 86 .forEach(lang.hitch(this,function(node){ 87 87 registry.byNode(node).destroyRecursive(); 88 this.removeCallback && this.removeCallback(item);88 if ( this.removeCallback ) { this.removeCallback(item); } 89 89 })); 90 90 this.source.sync(); -
Dev/trunk/client/qed/widgets/list/OrderedList.js
r407 r426 5 5 './List', 6 6 'dojo/text!./templates/OrderedList.html' 7 8 9 10 11 12 13 14 15 16 7 ],function( 8 declare, 9 lang, 10 Button, 11 List, 12 templateString 13 ){ 14 return declare([List],{ 15 templateString: templateString, 16 baseClass: 'rftLineListView', 17 17 18 19 20 18 startup: function() { 19 if ( this._started ){ return; } 20 this.inherited(arguments); 21 21 22 23 24 25 26 27 28 29 30 31 22 new Button({ 23 label: "Move up", 24 showLabel: false, 25 iconClass: "rftIcon rftIconFullArrowUp", 26 baseClass: "rftBlockButton", 27 'class': "trans", 28 onClick: lang.hitch(this, function() { 29 this._moveSelectedItem("up"); 30 }) 31 }, this.btnListMoveUp).startup(); 32 32 33 34 35 36 37 38 39 40 41 42 43 33 new Button({ 34 label: "Move down", 35 showLabel: false, 36 iconClass: "rftIcon rftIconFullArrowDown", 37 baseClass: "rftBlockButton", 38 'class': "trans", 39 onClick: lang.hitch(this, function() { 40 this._moveSelectedItem("down"); 41 }) 42 }, this.btnListMoveDown).startup(); 43 }, 44 44 45 46 47 48 49 50 51 52 53 45 _moveSelectedItem: function(dir) { 46 var node = this.source.getSelectedNodes()[0]; 47 if (node) { 48 if (dir === "up") { 49 if (node.previousSibling) { 50 return node.parentNode.insertBefore(node, node.previousSibling); 51 } else { 52 return false; 53 } 54 54 55 } else if (dir === "down") { 56 if (node.nextSibling) { 57 return node.parentNode.insertBefore(node.nextSibling, node); 58 } else { 59 return false; 60 } 55 } else if (dir === "down") { 56 if (node.nextSibling) { 57 return node.parentNode.insertBefore(node.nextSibling, node); 61 58 } else { 62 throw "Invalid move direction passed!";59 return false; 63 60 } 64 61 } else { 65 return false;62 throw "Invalid move direction passed!"; 66 63 } 67 }, 64 } else { 65 return false; 66 } 67 }, 68 68 69 insertItem: function(item) { 70 var anchor = this.source.getSelectedNodes()[0]; 71 if (anchor) { 72 this.source.insertNodes(false,[item], false, anchor); 73 } else { 74 this.appendItem(item); 75 } 69 insertItem: function(item) { 70 var anchor = this.source.getSelectedNodes()[0]; 71 if (anchor) { 72 this.source.insertNodes(false,[item], false, anchor); 73 } else { 74 this.appendItem(item); 76 75 } 76 } 77 77 78 });79 78 }); 79 }); -
Dev/trunk/client/qed/widgets/list/_EditableListMixin.js
r407 r426 9 9 .map(function(node){ 10 10 var value = registry.byId(node.id).get('value'); 11 this.source.setItem(node.id, value) 11 this.source.setItem(node.id, value); 12 12 return value; 13 13 },this);
Note: See TracChangeset
for help on using the changeset viewer.