Changeset 792

Show
Ignore:
Timestamp:
11/14/2007 04:57:34 PM (3 years ago)
Author:
OlivierBorowski
Message:

Some changes to take into account the new textarea container, this fixes the "textarea-width:100%" bug (fixes #576)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1.6.4/3rdparty/plugins/wikkaedit/wikkaedit.js

    r783 r792  
    3939        if (this.we_actionsMenuEnabled) 
    4040                this.initActions(); 
    41  
     41         
     42        //var we_ta_container = this.we_ta;             // without textarea_container (old method) 
     43        var we_ta_container = document.getElementById("textarea_container");    // with textarea_container 
     44         
    4245        // add a toolbar before textarea 
    4346        this.we_toolbar = document.createElement("div"); 
    4447        this.we_toolbar.id = "wikkatoolbar"; 
    4548        this.we_toolbar.innerHTML = this.genToolbar(); 
    46         this.we_ta.parentNode.insertBefore(this.we_toolbar, this.we_ta); 
     49        we_ta_container.parentNode.insertBefore(this.we_toolbar, we_ta_container); 
    4750 
    4851        // submenu 
     
    5053        this.we_submenu.id = "wikkasubmenu"; 
    5154        this.we_submenu.style.visibility = "hidden"; 
    52         this.we_ta.parentNode.insertBefore(this.we_submenu, this.we_ta); //this.we_help.nextSibling); 
     55        we_ta_container.parentNode.insertBefore(this.we_submenu, we_ta_container); //this.we_help.nextSibling); 
    5356 
    5457        // search & replace 
     
    6063                this.we_search.style.width = "500px"; // width & height can't be moved to the CSS, else JS can't read these values later 
    6164                this.we_search.style.height = "180px"; 
    62                 this.we_ta.parentNode.insertBefore(this.we_search, this.we_ta.nextSibling); 
    63  
    64                 // dummy textarea, used to scroll this.we_ta to the right position 
     65                we_ta_container.parentNode.insertBefore(this.we_search, we_ta_container.nextSibling); 
     66 
     67                // dummy textarea, used to scroll the textarea to the right position 
    6568                // it is hidden, but it needs to be inserted to the page to work 
    6669                this.we_searchTa = document.createElement("textarea"); 
     
    7073                this.we_searchTa.style.visibility = "hidden"; 
    7174                this.we_searchTa.style.scroll = "auto"; 
    72                 this.we_ta.parentNode.insertBefore(this.we_searchTa, this.we_ta.nextSibling); 
     75                we_ta_container.parentNode.insertBefore(this.we_searchTa, we_ta_container.nextSibling); 
    7376        } 
    7477 
     
    8184                this.we_help.innerHTML = this.we_helpPreviousContent;   // contains at least a character to keep constant height 
    8285                this.we_help.style.display = (this.we_actionsMenuEnabled ? "" : "none"); 
    83                 this.we_ta.parentNode.insertBefore(this.we_help, this.we_ta.nextSibling.nextSibling);   // next*2 to skip following <br/> 
     86                we_ta_container.parentNode.insertBefore(this.we_help, we_ta_container.nextSibling.nextSibling); // next*2 to skip following <br/> 
    8487                // tooltip 
    8588                this.we_tooltip = document.createElement("div"); 
    8689                this.we_tooltip.id = "wikkatooltip"; 
    8790                this.we_tooltip.style.visibility = "hidden" 
    88                 this.we_ta.parentNode.insertBefore(this.we_tooltip, this.we_help.nextSibling); 
     91                we_ta_container.parentNode.insertBefore(this.we_tooltip, this.we_help.nextSibling); 
    8992        } 
    9093 
     
    9497        this.we_log.innerHTML = "log<br/>"; 
    9598        this.we_log.style.display = "none"; 
    96         this.we_ta.parentNode.insertBefore(this.we_log, this.we_ta.nextSibling); 
     99        we_ta_container.parentNode.insertBefore(this.we_log, we_ta_container.nextSibling); 
    97100 
    98101        // make sure nothing is selectionned in the textarea