Changeset 378
- Timestamp:
- 07/26/12 16:03:40 (13 years ago)
- Location:
- Dev/branches/rest-dojo-ui/client/rft
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/run.js
r376 r378 42 42 'rft/ui/Selector', 43 43 'rft/ui/TitleGroup', 44 'rft/ui/PreviewWidgets/HeaderItem',45 'rft/ui/ PreviewWidgets/TextItem',44 /*PreviewWidgets*/ 45 'rft/ui/InnerWidgetFactory', 46 46 // pages -> load dynamically? 47 47 'rft/pages/index', -
Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
r376 r378 9 9 'dijit/_WidgetsInTemplateMixin', 10 10 'dijit/form/TextBox', 11 'rft/ui/PreviewWidgets/HeaderItem', 12 'rft/ui/PreviewWidgets/TextItem', 11 'rft/ui/InnerWidgetFactory', 13 12 'dojo/text!./templates/QuestionEditorPreviewItem.html', 14 ], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, HeaderItem, TextItem, templateFull) {13 ], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, InnerWidgetFactory, templateFull) { 15 14 return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { 16 15 … … 42 41 this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit"); 43 42 this.editButtonNode.set("label", "Edit"); 44 this.innerWidget.save();45 43 } 46 44 else { 47 45 this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept"); 48 46 this.editButtonNode.set("label", "Save"); 49 this.innerWidget.edit();50 47 } 51 48 this._editing = !this._editing; … … 84 81 }, 85 82 getContent: function() { 86 return { data: this.innerWidget.getContent(), 87 type: this.item.type }; 83 return this.innerWidget.getObject(); 88 84 }, 89 85 removeObject: function(widget) { … … 93 89 // This always creates a textbox as innerwidget pending creation of actual innerWidgets. 94 90 // Introduce a better way to create these widgets than a switch statement, based on item.widgetType? Perhaps "new eval(item.widgetType)({});" ? 91 92 this.innerWidget = new InnerWidgetFactory().createWidget( this.item ); 93 /* 95 94 this.innerWidget = eval("new "+ this.item.type + "({ disabled: true });"); 96 95 this.innerWidget.setContent(this.item.data); -
Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
r377 r378 135 135 label: "Header", 136 136 objectData: { 137 _id: null, 138 type: "HeaderItem", 139 widgetProps: {} 137 widgetType: "Header", 140 138 }, 141 139 icon: "Header" … … 144 142 label: "Text", 145 143 objectData: { 146 _id: null, 147 type: "TextItem", 148 widgetProps: {} 144 widgetType: "Text", 149 145 }, 150 146 icon: "TextBox" … … 153 149 label: "Image", 154 150 objectData: { 155 _id: null, 156 widgetType: "rft.surveyContent.ImageDialog", 157 widgetProps: {} 151 widgetType: "Image", 158 152 }, 159 153 icon: "Image" … … 162 156 label: "External media", 163 157 objectData: { 164 _id: null, 165 widgetType: "rft.surveyContent.ExternalDialog", 166 widgetProps: {} 158 widgetType: "ExternalMedia", 167 159 }, 168 160 icon: "External" … … 171 163 label: "Divider", 172 164 objectData: { 173 _id: null, 174 widgetType: "rft.surveyContent.Divider", 175 widgetProps: {} 165 widgetType: "Divider", 176 166 }, 177 167 icon: "Divider" … … 184 174 label: "Free text", 185 175 objectData: { 186 _id: null, 187 widgetType: "rft.surveyContent.TextInput", 188 widgetProps: {} 176 widgetType: "FreeTextInput", 189 177 }, 190 178 icon: "Text" … … 194 182 objectData: { 195 183 _id: null, 196 widgetType: " rft.surveyContent.IntegerInput",184 widgetType: "IntegerInput", 197 185 widgetProps: {} 198 186 }, … … 203 191 objectData: { 204 192 _id: null, 205 widgetType: " rft.surveyContent.ScaleInput",193 widgetType: "ScaleInput", 206 194 widgetProps: {} 207 195 }, … … 212 200 objectData: { 213 201 _id: null, 214 widgetType: " rft.surveyContent.CardsInput",202 widgetType: "CardsInput", 215 203 widgetProps: {} 216 204 }, … … 221 209 objectData: { 222 210 _id: null, 223 widgetType: " rft.surveyContent.MultipleChoiceInput",211 widgetType: "MultipleChoiceInput", 224 212 widgetProps: {} 225 213 },
Note: See TracChangeset
for help on using the changeset viewer.