Changeset 834


Ignore:
Timestamp:
05/10/07 19:44:33 (12 years ago)
Author:
wymsy
Message:

fix problems with loading skins - ticket:1026

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r826 r834  
    19981998  var editor = this;  // we'll need "this" in some nested functions 
    19991999  var url; 
     2000  var found = false; 
     2001  var links = document.getElementsByTagName("link"); 
     2002 
     2003  if (!document.getElementById("XinhaCoreDesign")) 
     2004  { 
     2005    _editor_css = (typeof _editor_css == "string") ? _editor_css : "Xinha.css"; 
     2006    for(i = 0; i<links.length; i++) 
     2007    { 
     2008      if ( ( links[i].rel == "stylesheet" ) && ( links[i].href == _editor_url + _editor_css ) ) 
     2009      { 
     2010        found = true; 
     2011      } 
     2012    } 
     2013    if ( !found ) 
     2014    { 
     2015      Xinha.loadStyle(_editor_css,null,"XinhaCoreDesign"); 
     2016    } 
     2017  } 
    20002018   
    2001   if (!document.getElementById("XinhaCoreDesign")) 
    2002   { 
    2003     Xinha.loadStyle(typeof _editor_css == "string" ? _editor_css : "Xinha.css",null,"XinhaCoreDesign"); 
     2019  if ( _editor_skin !== "" && !document.getElementById("XinhaSkin")) 
     2020  { 
     2021    found = false; 
     2022    for(i = 0; i<links.length; i++) 
     2023    { 
     2024      if ( ( links[i].rel == "stylesheet" ) && ( links[i].href == _editor_url + 'skins/' + _editor_skin + '/skin.css' ) ) 
     2025      { 
     2026        found = true; 
     2027      } 
     2028    } 
     2029    if ( !found ) 
     2030    { 
     2031      Xinha.loadStyle('skins/' + _editor_skin + '/skin.css',null,"XinhaSkin") 
     2032    } 
    20042033  } 
    20052034   
     
    21292158  else editor.registerPlugin('GetHtmlImplementation'); 
    21302159   
    2131  
    2132   if ( _editor_skin !== "" ) 
    2133   { 
    2134     var found = false; 
    2135     var head = document.getElementsByTagName("head")[0]; 
    2136     var links = document.getElementsByTagName("link"); 
    2137     for(i = 0; i<links.length; i++) 
    2138     { 
    2139       if ( ( links[i].rel == "stylesheet" ) && ( links[i].href == _editor_url + 'skins/' + _editor_skin + '/skin.css' ) ) 
    2140       { 
    2141         found = true; 
    2142       } 
    2143     } 
    2144     if ( !found ) 
    2145     { 
    2146       var link = document.createElement("link"); 
    2147       link.type = "text/css"; 
    2148       link.href = _editor_url + 'skins/' + _editor_skin + '/skin.css'; 
    2149       link.rel = "stylesheet"; 
    2150       head.appendChild(link); 
    2151     } 
    2152   } 
    2153    
    21542160  // create the editor framework, yah, table layout I know, but much easier 
    21552161  // to get it working correctly this way, sorry about that, patches welcome. 
     
    34853491  link.rel = "stylesheet"; 
    34863492  link.href = url; 
     3493  link.type = "text/css"; 
    34873494  if (id) link.id = id; 
    34883495  head.appendChild(link); 
Note: See TracChangeset for help on using the changeset viewer.