Changeset 156859 in indico
- Timestamp:
- 11/17/10 11:35:58 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- 55b3c5
- Parents:
- c04c53
- git-author:
- Leszek Syroka <leszek.marek.syroka@…> (11/16/10 17:51:20)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (11/17/10 11:35:58)
- File:
-
- 1 edited
-
indico/htdocs/js/indico/Admin/News.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/htdocs/js/indico/Admin/News.js
re8b0b5 r156859 4 4 return item.draw(); 5 5 }, 6 6 7 7 addItem: function() { 8 8 var addNews = new NewsItem('edit', this); … … 47 47 this.request(params); 48 48 }, 49 49 50 50 _saveResource: function() { 51 51 var params = {"id":this.id, "title": this.titleField.get(), "type": this.typeField.get(), "content": this.content.get()}; 52 52 var self = this; 53 53 var killProgress = IndicoUI.Dialogs.Util.progress(); 54 jsonRpc(Indico.Urls.JsonRpcService, 'news.save', params, 55 function(response, error){ 56 if (exists(error)) { 57 killProgress(); 58 IndicoUtil.errorReport(error); 59 } 60 else { 61 killProgress(); 62 self._success(response); 63 } 64 }); 54 if(self.content.clean()) 55 jsonRpc(Indico.Urls.JsonRpcService, 'news.save', params, 56 function(response, error){ 57 if (exists(error)) 58 IndicoUtil.errorReport(error); 59 else 60 self._success(response); 61 }); 62 killProgress() 65 63 }, 66 64 67 65 _success: function(response) { 68 66 this.creationDate = response.creationDate; … … 71 69 this.text = response.text; 72 70 this.id = response.id; 73 71 74 72 this.chooser.set('display'); 75 73 }, 76 74 77 75 draw: function() { 78 76 var self = this; 79 77 80 78 var titleField = Html.input('text',{'className':'newsEditTitle'},'Write a title'); 81 79 var typeField = Widget.select(self.parentList.newsTypesList); 82 80 typeField.set('general'); 83 81 84 82 this.titleField = titleField; 85 83 this.typeField = typeField; 86 84 87 85 var saveButton = null; 88 86 if (self.id) { … … 97 95 }, "Save")); 98 96 } 99 97 100 98 var cancelButton = Widget.button(command(function (){ 101 99 if (self.id) { … … 105 103 } 106 104 }, "Cancel")); 107 105 108 106 this.chooser = new Chooser(new Lookup({ 109 107 edit: function() { 110 var content = new RichTextEditor(500,200);108 var content = new ParsedRichTextEditor(600,400,'IndicoMinimal'); 111 109 self.content = content; 112 110 113 111 if (self.id) { 114 112 content.set(self.text); 115 113 } 116 114 117 115 return Html.div("newsItemEdit", titleField, typeField, content.draw(), 118 116 saveButton, cancelButton); }, … … 134 132 } 135 133 })); 136 134 137 135 this.chooser.set(this.choice); 138 136 139 137 return this.ServiceWidget.prototype.draw.call(this, Widget.block(this.chooser)); 140 138 }
Note: See TracChangeset
for help on using the changeset viewer.
