Changeset 442
- Timestamp:
- 05/02/13 13:13:13 (12 years ago)
- Location:
- Dev/trunk/client/qed
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/client/qed/css/qed.css
r441 r442 1354 1354 padding: 0 0 0 0; 1355 1355 } 1356 /* line 19, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1357 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000319}} 1356 /* line 15, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1357 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000315}} 1358 #rft.claro .rftSelector .rftLineWithActions.dojoDndItem.dojoDndItemAnchor { 1359 background-color: #ffffff; 1360 } 1361 /* line 22, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1362 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000322}} 1358 1363 #rft.claro .rftSelector .rftSelectorSelected .rftSelectorIndicator { 1359 1364 margin: 0 0 0 0; … … 1364 1369 background-color: #bedead; 1365 1370 } 1366 /* line 2 6, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */1367 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\000032 6}}1371 /* line 29, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1372 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000329}} 1368 1373 #rft.claro .rftSelector .rftSelectorSelected .rftSelectorIndicator.conflict { 1369 1374 background-color: #ff0000; 1370 1375 } 1371 /* line 29, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */1372 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\00003 29}}1376 /* line 32, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1377 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000332}} 1373 1378 #rft.claro .rftSelector .rftSelectorSelected .rftSelectorIndicator.pending { 1374 1379 background-color: #ff8000; 1375 1380 } 1376 /* line 3 2, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */1377 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\000033 2}}1381 /* line 35, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1382 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000335}} 1378 1383 #rft.claro .rftSelector .rftSelectorSelected .rftSelectorIndicator.success { 1379 1384 background-color: #00ff00; 1380 1385 } 1381 /* line 4 1, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */1382 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\000034 1}}1386 /* line 44, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1387 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000344}} 1383 1388 #rft.claro .rftSelector .rftSelectorOptions .rftLineWithActions, 1384 1389 #rft.claro .rftSelector .rftSelectorSelected .rftLineWithActions { … … 1386 1391 color: #111111; 1387 1392 } 1388 /* line 5 0, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */1389 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\000035 0}}1393 /* line 53, /home/hendrik/gamelab/qed.svn/Dev/trunk/client/qed/css/widgets/Selector.less */ 1394 @media -sass-debug-info{filename{font-family:file\:\/\/\/home\/hendrik\/gamelab\/qed\.svn\/Dev\/trunk\/client\/qed\/css\/widgets\/Selector\.less}line{font-family:\0000353}} 1390 1395 #rft.claro .rftSelector .rftSelectorOptions .rftLineWithActions .rftInlineButton .rftIcon { 1391 1396 width: 16px; -
Dev/trunk/client/qed/css/widgets/Selector.less
r432 r442 13 13 .rftLineWithActions { 14 14 .noOffset; 15 &.dojoDndItem.dojoDndItemAnchor { 16 background-color: @text; 17 } 15 18 } 16 19 -
Dev/trunk/client/qed/model/widgets/QuestionEditorPreviewItem.js
r441 r442 55 55 return !this._editing || this.innerWidget.validate(); 56 56 }, 57 focus: function() { 58 if ( this._editing ) { 59 this.innerWidget.focus(); 60 } 61 }, 57 62 showView: function() { 58 63 if ( this._editing ) { … … 74 79 this.showEdit(); 75 80 } 76 evt && event.stop(evt);81 if ( evt ) { event.stop(evt); } 77 82 return false; 78 83 }, … … 141 146 } 142 147 } 143 evt && event.stop(evt);148 if ( evt ) { event.stop(evt); } 144 149 return false; 145 150 } -
Dev/trunk/client/qed/model/widgets/QuestionEditorToolkit.js
r441 r442 20 20 21 21 templateString: template, 22 _ list: null,22 _categoryList: null, 23 23 _categorySelect: null, 24 24 _categoryStore: null, … … 65 65 }, 66 66 67 postCreate: function(){67 buildRendering: function() { 68 68 this.inherited(arguments); 69 70 this._categoryList = new CategoryListView({ 71 name: "categories" 72 }).placeAt(this.categoryListNode); 73 74 this._categoryStore = new Memory({data: [] }); 75 this._categorySelect = new ComboBox( { 76 store: this._categoryStore, 77 searchAttr: "id" 78 }, this.categoryBoxNode); 79 80 this._topicStore = new Memory( {data: [] }); 81 this._topicSelect = new ComboBox({ 82 name: "topic", 83 store: this._topicStore, 84 searchAttr: "id" 85 }, this.topicBoxNode); 86 69 87 var creator = lang.hitch(this,"_creator"); 70 88 this.contentSource = new Source(this.ToolkitContentSourceNode, { … … 85 103 this.inputsSource.insertNodes(false, this._inputsItems); 86 104 }, 87 _setValueAttr: function(question) { 88 this._setupListView(); 89 this._setupCategories(); 90 this._setupTopic(question.topic); 91 this.propertiesForm.set('value', question); 92 this._list.set('value', question.categories); 105 startup: function() { 106 if ( this._started ) { return; } 107 this.inherited(arguments); 108 109 store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1}) 110 .forPairs(lang.hitch(this, function(value, key) { 111 this._categoryStore.put({ id: key[0] }); 112 })); 113 114 store.query("_design/questions/_view/all_topics", {reduce:true, group:true}) 115 .forPairs(lang.hitch(this, function(value, key) { 116 this._topicStore.put({ id: key }); 117 })); 93 118 }, 94 _getValueAttr: function() { 95 var value = this.propertiesForm.get('value'); 96 value.categories = this._list.get('value'); 97 return value; 98 }, 99 onCategoryAdd: function() { 100 this._addCategory(this._categorySelect.get('displayedValue')); 119 _onCategoryAdd: function() { 120 this._categoryList.appendItem(this._categorySelect.get('displayedValue')); 101 121 this._categorySelect.reset(); 102 122 }, … … 122 142 type: ["questionContent"] 123 143 }; 124 },125 _setupListView: function() {126 this._list = new CategoryListView({127 }).placeAt(this.listNode);128 this._list.startup();129 },130 _setupCategories: function() {131 this._categoryStore = new Memory({data: [] });132 store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})133 .forPairs(lang.hitch(this, function(value, key) {134 this._categoryStore.put({ id: key[0] });135 }));136 this._categorySelect = new ComboBox( {137 name: "categories",138 store: this._categoryStore,139 searchAttr: "id"140 }, this.categoriesBoxNode);141 },142 _setupTopic: function(topic) {143 this._topicStore = new Memory( {data: [] });144 store.query("_design/questions/_view/all_topics", {reduce:true, group:true})145 .forPairs(lang.hitch(this, function(value, key) {146 this._topicStore.put({ id: key });147 }));148 this._topicSelect = new ComboBox( {149 name: "topic",150 store: this._topicStore,151 searchAttr: "id",152 value: topic153 }, this.topicBoxNode);154 },155 _addCategory: function(item) {156 this._list.appendItem(item);157 144 } 158 145 -
Dev/trunk/client/qed/model/widgets/templates/QuestionEditorToolkit.html
r431 r442 1 1 <div> 2 <div data-dojo-type=" dojox/widget/TitleGroup">2 <div data-dojo-type="qed/widgets/TitleGroup"> 3 3 <div data-dojo-type="dijit/TitlePane" class="orange" data-dojo-props="open:true" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'"> 4 <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm"> 5 <fieldset class="align"> 6 <label>Title:</label><input data-dojo-type="dijit/form/TextBox" name="title"/> 7 <label>Code:</label><input data-dojo-type="dijit/form/TextBox" name= "code"/> 8 <label>Categories:</label> 9 <div data-dojo-attach-point="listNode" class="rftLineListView"></div> 10 <div data-dojo-attach-point="categoriesBoxNode"></div> 11 <button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br/> 12 <label>Topic:</label> 13 <div data-dojo-attach-point="topicBoxNode"></div> 14 <label>Description:</label><textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea> 15 </fieldset> 16 </div> 4 <fieldset class="align"> 5 <label>Title:</label><input data-dojo-type="dijit/form/ValidationTextBox" required="required" name="title"/> 6 <label>Code:</label><input data-dojo-type="dijit/form/ValidationTextBox" required="required" name="code"/> 7 <label>Categories:</label> 8 <div data-dojo-attach-point="categoryListNode" class="rftLineListView"></div> 9 <div data-dojo-attach-point="categoryBoxNode"></div> 10 <button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br/> 11 <label>Topic:</label> 12 <div data-dojo-attach-point="topicBoxNode"></div> 13 <label>Description:</label><textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea> 14 </fieldset> 17 15 </div> 18 16 19 17 <div data-dojo-type="dijit/TitlePane" title="Content" data-dojo-props="iconClass:'rftIcon rftIconPlus', open:false"> 20 <div data-dojo-attach-point="ToolkitContentSourceNode"> 21 22 </div> 18 <div data-dojo-attach-point="ToolkitContentSourceNode"></div> 23 19 </div> 24 20 25 21 <div data-dojo-type="dijit/TitlePane" title="Inputs" data-dojo-props="iconClass:'rftIcon rftIconInput', open:false"> 26 <div data-dojo-attach-point="ToolkitInputsSourceNode"> 27 28 </div> 22 <div data-dojo-attach-point="ToolkitInputsSourceNode"></div> 29 23 </div> 30 24 </div> -
Dev/trunk/client/qed/pages/question.js
r441 r442 1 1 define([ 2 'dojo/_base/declare', 3 'dojo/_base/event', 4 'dojo/_base/lang', 5 'dojo/when', 6 '../store', 7 '../app/Content', 8 '../app/Router', 9 '../app/Page', 10 '../model/classes/Question', 11 '../model/widgets/QuestionEditorPreview', 12 '../model/widgets/QuestionEditorToolkit', 13 'dojo/text!./templates/question.html' 14 ],function(declare, event, lang, when, store, Content, Router, Page, Question, QuestionEditorPreview, QuestionEditorToolkit, template){ 15 return declare([Page], { 2 "../app/Content", 3 "../app/Page", 4 "../app/Router", 5 "../model/classes/Question", 6 "../model/widgets/QuestionEditorPreview", 7 "../model/widgets/QuestionEditorToolkit", 8 "../store", 9 "../widgets/_ComplexValueMixin", 10 "dojo/_base/declare", 11 "dojo/_base/event", 12 "dojo/_base/lang", 13 "dojo/when", 14 "dojo/text!./templates/question.html" 15 ], function(Content, Page, Router, Question, QuestionEditorPreview, QuestionEditorToolkit, store, _ComplexValueMixin, declare, event, lang, when, template) { 16 return declare([Page,_ComplexValueMixin], { 16 17 templateString: template, 17 question: null,18 18 _toolkit: null, 19 19 _preview: null, 20 value: null, 20 21 22 buildRendering: function() { 23 this.inherited(arguments); 24 25 this._toolkit = new QuestionEditorToolkit({ 26 },this.QuestionEditorToolkitNode); 27 this._toolkit.on('submit',lang.hitch(this,"_onSave")); 28 this._toolkit.startup(); 29 30 this._preview = new QuestionEditorPreview({ 31 name: 'content', 32 delay: 5, 33 region: 'center' 34 }); 35 this._preview.startup(); 36 this.addChild(this._preview); 37 }, 21 38 startup: function() { 22 39 if ( this._started ) { return; } … … 25 42 throw new Error("Error: no reference to object set!"); 26 43 } 27 this._setupEditor();28 44 if (this.questionId === "new") { 29 this.question = Question.create(); 30 this._refresh(); 45 this.set('value', Question.create()); 31 46 } else { 32 47 when(store.get(this.questionId)) 33 .then(lang.hitch(this, function(obj) { 34 this.question = obj; 35 this._refresh(); 48 .then(lang.hitch(this, function(value) { 49 this.set('value', value); 36 50 })); 37 51 } 38 52 }, 39 onLeave: function() { 53 _setValueAttr: function(value) { 54 this.value = value; 40 55 this.inherited(arguments); 56 this.titleNode.innerHTML = Question.DisplayTitle.get(value); 41 57 }, 42 _ refresh: function() {43 this.titleNode.innerHTML = Question.DisplayTitle.get(this.question);44 this._toolkit.set('value', this.question);45 this._preview.set('value', Question.Content.get(this.question));58 _getValueAttr: function() { 59 var value = this.inherited(arguments); 60 lang.mixin(this.value, value); 61 return this.value; 46 62 }, 47 63 _onSave: function(evt) { 48 if ( this._preview.validate() ) { 49 lang.mixin(this.question, this._toolkit.get('value')); 50 Question.Content.set(this.question, this._preview.get('value')); 51 store.put(this.question) 64 if ( this.validate() ) { 65 var value = this.get('value'); 66 store.put(value) 52 67 .then(function() { 53 68 Router.go('/questions'); … … 62 77 Router.go('/questions'); 63 78 return true; 64 },65 _setupEditor: function() {66 this._toolkit = new QuestionEditorToolkit({67 },this.QuestionEditorToolkitNode);68 this._toolkit.on('submit',lang.hitch(this,"_onSave"));69 this._toolkit.startup();70 71 this._preview = new QuestionEditorPreview({72 name: 'content',73 delay: 5,74 region: 'center'75 });76 this._preview.startup();77 this.addChild(this._preview);78 79 } 79 80 }); -
Dev/trunk/client/qed/pages/session.js
r441 r442 51 51 onSave: function(evt) { 52 52 lang.mixin(this.session,this.propertiesForm.get('value')); 53 this.session.accounts = array.map(this._accountList.get('value'), 54 function(item){ 55 return store.getIdentity(item); 53 this.session.accounts = array.map(this._accountList.get('value'), function(item){ 54 return store.getIdentity(item); 56 55 }); 57 56 store.put(this.session) -
Dev/trunk/client/qed/widgets/ListWidget.js
r441 r442 90 90 _setValueAttr: function(value) { 91 91 this.clear(); 92 this.appendItems(value); 92 this.appendItems(value || []); 93 }, 94 _setDisabledAttr: function(value) { 95 this._set("disabled", value); 96 array.forEach(this.getChildren(), function(child){ 97 child.set("disabled", value); 98 }); 99 }, 100 _setReadOnlyAttr: function(value) { 101 this._set("readOnly", value); 102 array.forEach(this.getChildren(), function(child){ 103 child.set("readOnly", value); 104 }); 105 }, 106 focus: function() { 107 var children = this.getChildren(); 108 if ( children.length > 0 ) { 109 children[0].focus(); 110 } 93 111 }, 94 112 appendItems: function(items) { -
Dev/trunk/client/qed/widgets/TitleGroup.js
r417 r442 1 require(['dojo/_base/declare','dojo/_base/query','dijit/registry','dojox/widget/TitleGroup'], 2 function(declare,query,registry,TitleGroup){ 3 return declare([TitleGroup],{ 4 getChildren: function() { 5 return query("> .dijitTitlePane", this.domNode) 6 .map(function(node){ 7 return registry.byNode(node); 8 }); 9 } 10 }); 1 define([ 2 "dijit/registry", 3 "dojo/_base/declare", 4 "dojo/_base/query", 5 "dojox/widget/TitleGroup" 6 ], function(registry, declare, query, TitleGroup) { 7 return declare([TitleGroup],{ 8 getChildren: function() { 9 return query("> .dijitTitlePane", this.domNode) 10 .map(function(node){ 11 return registry.byNode(node); 12 }); 13 } 11 14 }); 15 });
Note: See TracChangeset
for help on using the changeset viewer.