mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
start integrating SyntaxHighlighter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user