Changeset 073081 in indico


Ignore:
Timestamp:
02/11/10 15:47:20 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
Children:
df3d1f
Parents:
dab490
Message:

[IMP] using and iframe for the description in GS

fixes #164

Location:
indico
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/fossils/conference.py

    rf25f07 r073081  
    3131        """Conference title""" 
    3232 
     33    def getDescription(self): 
     34        """Conference description""" 
     35 
    3336    def getLocation(self): 
    3437        """ Location (CERN/...) """ 
  • indico/MaKaC/webinterface/tpls/EventModifMainData.tpl

    r6884f0 r073081  
    1212for fact in wr.getFactoryList(): 
    1313    val = fact.getId() 
    14      
     14 
    1515    if val == 'simple_event': 
    1616        val = 'lecture' 
    17      
    18     typeList[fact.getId()] = val  
     17 
     18    typeList[fact.getId()] = val 
    1919 
    2020visibilityList = {} 
    2121topcat = confObj.getOwnerList()[0] 
    22 level = 0         
     22level = 0 
    2323visibilityList[0] = 'Nowhere' 
    2424while topcat: 
    25     level += 1                         
     25    level += 1 
    2626    if topcat.getId() != "0": 
    2727        from MaKaC.common.TemplateExec import truncateTitle 
    2828        visibilityList[level] = truncateTitle(topcat.getName(), 50) 
    29     topcat = topcat.getOwner()         
    30 visibilityList[999] = 'Everywhere'      
     29    topcat = topcat.getOwner() 
     30visibilityList[999] = 'Everywhere' 
    3131 
    3232numRows = 11 
     
    5656    </td> 
    5757    <td> 
    58         <div class="blacktext" id="inPlaceEditDescription"><%=description %></span> 
     58        <div class="blacktext" id="inPlaceEditDescription"><%=description %></div> 
    5959    </td> 
    6060</tr> 
     
    159159    <% if Config.getInstance().getShortEventURL() != "": %> 
    160160      <td class="dataCaptionTD"> 
    161         <span class="dataCaptionFormat"><%= _("Short display URL")%></span>    
    162       </td>      
    163       <% if shortURL == "" : %>     
    164         <td class="blacktext"><em><%= _("There is not any short url yet. Click \"Modify\" to setup.")%></em></td>       
     161        <span class="dataCaptionFormat"><%= _("Short display URL")%></span> 
     162      </td> 
     163      <% if shortURL == "" : %> 
     164        <td class="blacktext"><em><%= _("There is not any short url yet. Click \"Modify\" to setup.")%></em></td> 
    165165      <% end %> 
    166166      <% else : %> 
     
    249249$E('inPlaceEditStartEndDate').set(new StartEndDateWidget('event.main.changeDates', <%= jsonEncode({'conference': "%s"%conferenceId}) %>, {'startDate': confFossile.startDate, 'endDate': confFossile.endDate}).draw()); 
    250250 
    251 <%= macros.genericField(macros.FIELD_RICHTEXT, 'inPlaceEditDescription', 'event.main.changeDescription', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=(600,400)) %> 
     251$E('inPlaceEditDescription').set(new RichTextInlineEditWidget('event.main.changeDescription', <%= jsonEncode({'conference': "%s"%conferenceId}) %>, confFossile.description).draw()); 
    252252 
    253253<% if evtType == 'conference':%> 
  • indico/htdocs/js/indico/Core/Widgets/DateTime.js

    r6a51d1 r073081  
    8888                             Html.div("startEndDate", Html.span({},"ends "), 
    8989                                      end)); 
    90          }, 
    91  
    92          _buildFrame: function(modeChooser, switchChooser) { 
    93              return Html.div({}, 
    94                              modeChooser, 
    95                              Html.div({style:{marginTop: '5px'}}, 
    96                                       switchChooser)); 
    97  
    9890         }, 
    9991 
  • indico/htdocs/js/indico/Core/Widgets/Inline.js

    r6a51d1 r073081  
    6767         this.ready.set(false); 
    6868         this.loadOnStartup = loadOnStartup; 
    69          this.source = indicoSource(method, attributes, false, !loadOnStartup); 
     69         this.source = indicoSource(method, attributes, null, !loadOnStartup); 
    7070     }); 
    7171 
     
    826826     { 
    827827 
     828        _buildFrame: function(modeChooser, switchChooser) { 
     829            return Html.div({}, 
     830                            modeChooser, 
     831                            Html.div({style:{marginTop: '5px'}}, 
     832                                     switchChooser)); 
     833 
     834        }, 
     835 
    828836         _handleError: function(error) { 
    829837             this._error(error); 
     
    878886         }, 
    879887 
     888         /* By default, any input is accepted */ 
     889         _verifyInput: function() { 
     890             return true; 
     891         }, 
     892 
    880893 
    881894         /* Enables/disables saving */ 
  • indico/htdocs/js/indico/Core/Widgets/RichText.js

    r9033fd r073081  
    11var executeOnload = false; 
    2 var __globalEditorTable = {};  
     2var __globalEditorTable = {}; 
    33 
    44type("RichTextEditor", ["IWidget", "Accessor"], 
     
    2222         postDraw: function() { 
    2323             this.div.set(''); 
    24               
     24 
    2525             this.div.dom.innerHTML = this.editor.CreateHtml(); 
    2626 
    2727             var self = this; 
    2828 
    29              this.onLoadFunc = function() {                            
     29             this.onLoadFunc = function() { 
    3030 
    3131                 if (self.text) { 
     
    3636                      function(callback) { 
    3737                          callback(); 
    38                       });                 
    39  
    40                  self.editor.Events.AttachEvent( 'OnSelectionChange',  
     38                      }); 
     39 
     40                 self.editor.Events.AttachEvent( 'OnSelectionChange', 
    4141                                                 function() { 
    42                                                      if (!self.observing) {                                                       
     42                                                     if (!self.observing) { 
    4343                                                         self.startObserving(); 
    4444                                                     } 
    45                                                  } ) ;                         
     45                                                 } ) ; 
    4646             }; 
    47               
     47 
    4848             if (this.editor && this.editor.SetData) { 
    4949                 this.onLoadFunc(); 
     
    5353 
    5454         }, 
    55           
     55 
    5656         set: function(text) { 
    5757             var self = this; 
     
    127127             var self = this; 
    128128 
    129              var observeFunc = function(value) {                  
     129             var observeFunc = function(value) { 
    130130 
    131131                 self.plain.unbind(); 
     
    143143             }; 
    144144 
    145              this.selected.observe(observeFunc);             
     145             this.selected.observe(observeFunc); 
    146146             observeFunc(this.selected.get()); 
    147147         }, 
     
    234234             { 
    235235                 toPlain: command( 
    236                      toPlainFunc,  
     236                     toPlainFunc, 
    237237                     $T("switch to plain text")), 
    238238                 toRich: command( 
     
    250250             toPlainFunc(); 
    251251         } 
    252          
     252 
    253253         this.rich.onLoad(function() { 
    254254             self.loaded = true; 
     
    258258 
    259259 
     260type("RichTextInlineEditWidget", ["InlineEditWidget"], 
     261        { 
     262            _handleEditMode: function(value) { 
     263 
     264                this.description = new RichTextWidget(600, 400,{},'','rich','IndicoMinimal'); 
     265                this.description.set(value); 
     266                return this.description.draw(); 
     267            }, 
     268 
     269            _handleDisplayMode: function(value) { 
     270 
     271                var iframeId = "descFrame"; 
     272                var iframe = Html.iframe({id: iframeId,name: iframeId, style:{width: pixels(600), 
     273                                                                              height:pixels(100), 
     274                                                                              border: "1px dotted #ECECEC"}}); 
     275 
     276                var loadFunc = function() { 
     277                    var doc; 
     278 
     279                    if (Browser.IE) { 
     280                        doc = document.frames[iframeId].document; 
     281                    } else { 
     282                        doc = $E(iframeId).dom.contentDocument; 
     283                    } 
     284                    if (value == "") { 
     285                        value = '<em>No description</em>'; 
     286                    } 
     287                    doc.body.innerHTML = '<link href="css/Default.css" type="text/css" rel="stylesheet">' + value; 
     288                }; 
     289 
     290                if (Browser.IE) { 
     291                    iframe.dom.onreadystatechange = loadFunc; 
     292                } else { 
     293                    // for normal browsers 
     294                    iframe.observeEvent("load", loadFunc); 
     295                } 
     296 
     297                return iframe; 
     298            }, 
     299 
     300            _getNewValue: function() { 
     301                return this.description.get(); 
     302            } 
     303        }, 
     304        function(method, attributes, initValue) { 
     305            this.InlineEditWidget(method, attributes, initValue); 
     306        }); 
     307 
     308 
     309 
    260310function FCKeditor_OnComplete( editorInstance ) 
    261311{ 
     
    269319    if(value.editor.IsDirty()) { 
    270320        each(value.callbacks, function(func) { 
    271             func();          
     321            func(); 
    272322        }) 
    273323        value.editor.ResetIsDirty(); 
Note: See TracChangeset for help on using the changeset viewer.