Dotclear

Changeset 1753:344c253dc891


Ignore:
Timestamp:
09/07/13 19:37:18 (11 years ago)
Author:
kevin@…
Branch:
Ticket #611
Message:

Ticket #611 : la barre d'édition ne disparaissait pas quand on passe du mode wiki ou XHTML à un autres mode en plugin. épisode 2

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/js/jsToolBar/jsToolBar.dotclear.js

    r723 r1753  
    377377 
    378378// Last space element 
    379 jsToolBar.prototype.elements.space3 = {type: 'space'}; 
     379jsToolBar.prototype.elements.space3 = { 
     380     type:'space',  
     381     format:{ 
     382          wysiwyg:true, 
     383          wiki:true, 
     384          xhtml:true 
     385     } 
     386}; 
  • admin/js/jsToolBar/jsToolBar.js

    r1047 r1753  
    152152      
    153153     switchMode: function(mode) { 
    154           mode = mode || 'xhtml'; 
    155154          this.draw(mode); 
    156155     }, 
     
    167166     space: function(toolName) { 
    168167          var tool = new jsSpace(toolName); 
     168          if (!this.elements[toolName].format[this.mode]) return null; 
    169169          if (this.elements[toolName].width !== undefined) { 
    170170               tool.width = this.elements[toolName].width; 
     
    174174     combo: function(toolName) { 
    175175          var tool = this.elements[toolName]; 
    176           var length = tool[this.mode].list.length; 
    177            
    178           if (typeof tool[this.mode].fn != 'function' || length == 0) { 
    179                return null; 
    180           } else { 
    181                var options = {}; 
    182                for (var i=0; i < length; i++) { 
    183                     var opt = tool[this.mode].list[i]; 
    184                     options[opt] = tool.options[opt]; 
     176           
     177          if( tool[this.mode] != undefined) { 
     178                
     179               var length = tool[this.mode].list.length; 
     180                
     181               if (typeof tool[this.mode].fn != 'function' || length == 0) { 
     182                    return null; 
     183               } else { 
     184                    var options = {}; 
     185                    for (var i=0; i < length; i++) { 
     186                         var opt = tool[this.mode].list[i]; 
     187                         options[opt] = tool.options[opt]; 
     188                    } 
     189                    return new jsCombo(tool.title, options, this, tool[this.mode].fn); 
    185190               } 
    186                return new jsCombo(tool.title, options, this, tool[this.mode].fn); 
    187           } 
     191                
     192          } 
     193           
    188194     }, 
    189195     draw: function(mode) { 
     
    347353 
    348354// spacer 
    349 jsToolBar.prototype.elements.space0 = {type: 'space'}; 
     355jsToolBar.prototype.elements.space0 = { 
     356     type:'space',  
     357     format:{ 
     358          wysiwyg:true, 
     359          wiki:true, 
     360          xhtml:true 
     361     } 
     362}; 
    350363 
    351364// strong 
     
    410423 
    411424// spacer 
    412 jsToolBar.prototype.elements.space1 = {type: 'space'}; 
     425jsToolBar.prototype.elements.space1 = { 
     426     type:'space',  
     427     format:{ 
     428          wysiwyg:true, 
     429          wiki:true, 
     430          xhtml:true 
     431     } 
     432}; 
    413433 
    414434// br 
     
    423443 
    424444// spacer 
    425 jsToolBar.prototype.elements.space2 = {type: 'space'}; 
     445jsToolBar.prototype.elements.space2 = { 
     446     type:'space',  
     447     format:{ 
     448          wysiwyg:true, 
     449          wiki:true, 
     450          xhtml:true 
     451     } 
     452}; 
    426453 
    427454// blockquote 
     
    494521 
    495522// spacer 
    496 jsToolBar.prototype.elements.space3 = {type: 'space'}; 
     523jsToolBar.prototype.elements.space3 = { 
     524     type:'space',  
     525     format:{ 
     526          wysiwyg:true, 
     527          wiki:true, 
     528          xhtml:true 
     529     } 
     530}; 
    497531 
    498532// link 
  • admin/js/jsToolBar/jsToolBar.wysiwyg.js

    r1750 r1753  
    4343 
    4444jsToolBar.prototype.switchMode = function(mode) { 
     45     mode = mode || 'xhtml'; 
     46      
    4547     if (mode == 'xhtml') { 
    4648          this.draw(mode); 
    47      } else if (mode == 'wiki')  { 
     49     } else { 
    4850          if (this.wwg_mode) { 
    4951               this.syncContents('iframe'); 
     
    5254          this.textarea.style.display = ''; 
    5355          this.drawToolBar(mode); 
    54      } else { 
    55           this.removeEditor(); 
    56           this.textarea.style.display = ''; 
    57           while (this.toolbar.hasChildNodes()) { 
    58                this.toolbar.removeChild(this.toolbar.firstChild) 
    59           } 
    6056     } 
    6157}; 
  • plugins/tags/js/post.js

    r1699 r1753  
    6767 
    6868// Toolbar button for tags 
    69 jsToolBar.prototype.elements.tagSpace = {type: 'space'}; 
     69jsToolBar.prototype.elements.tagSpace = { 
     70     type: 'space',  
     71     format:{ 
     72          wysiwyg:true, 
     73          wiki:true, 
     74          xhtml:true 
     75     } 
     76}; 
    7077 
    7178jsToolBar.prototype.elements.tag = {type: 'button', title: 'Keyword', fn:{} }; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map