start integrating SyntaxHighlighter

This commit is contained in:
Sebastian Sdorra
2011-06-13 17:16:34 +02:00
parent 7414b931f2
commit 7e96435cbe
3 changed files with 67 additions and 2 deletions

View File

@@ -68,6 +68,8 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, {
mainTabPanel: null,
infoPanels: [],
scripts: [],
stylesheets: [],
constructor : function(config) {
this.addEvents('login', 'logout', 'init');
@@ -372,6 +374,27 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, {
icon:Ext.MessageBox.ERROR
});
}
},
loadScript: function(url){
if ( this.scripts.indexOf(url) < 0 ){
var js = document.createElement('script');
js.type = "text/javascript";
js.src = url;
document.head.appendChild(js);
this.scripts.push(url);
}
},
loadStylesheet: function(url){
if ( this.stylesheets.indexOf(url) < 0 ){
var css = document.createElement('link');
css.rel = 'stylesheet';
css.type = 'text/css';
css.href = url;
document.head.appendChild(css);
this.stylesheets.push(url);
}
}
});