2012-08-13 1 views

답변

0

이것은 가능하지만 이에 대한 지식이 필요합니다. switchStyle이

// url is the url to the stylesheet file to be added to the editor iframes head 
    // ed is the editor object or editor id 
    switchStyle: function(url, ed) { 

     if (typeof ed != 'object') { 
      ed = tinymce.get(ed); 
     } 

        //replace the custom content_css if set 
     var url_to_replace = ed.getParam('content_css'); 

     var doc = ed.getDoc(); 
     var $doc = $(doc); 

     var sheets_urls = []; 

     if (url_to_replace){ 
      sheets_urls.push(url_to_replace); 
     } 

     // remove all stylesheets from sheets_urls 
     $doc.find('link').each(function() { 
      if (tinymce.inArray(sheets_urls, $(this).attr('href').split('?')[0]) !== -1) { 
       $(this).remove(); 
      } 
     }); 

     var link = doc.createElement('link'); 
     link.type = 'text/css'; 
     link.rel = 'stylesheet'; 
     link.href = url; 

     // setstylesheet 
     $doc.find('head:first').append(link); 
    }, 
입니다

당신은

self.switchStyle(url, ed); 

처럼 뭔가를 호출해야합니다

관련 문제