mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-24 00:09:07 +01:00
improve content panel
This commit is contained in:
@@ -56,7 +56,9 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, {
|
||||
var config = {
|
||||
title: name,
|
||||
tbar: [{
|
||||
text: 'Default'
|
||||
text: 'Default',
|
||||
handler: this.openSyntaxPanel,
|
||||
scope: this
|
||||
},{
|
||||
text: 'Raw',
|
||||
handler: this.downlaodFile,
|
||||
@@ -78,19 +80,31 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, {
|
||||
Sonia.repository.ContentPanel.superclass.initComponent.apply(this, arguments);
|
||||
},
|
||||
|
||||
openSyntaxPanel: function(){
|
||||
this.openPanel({
|
||||
xtype: 'syntaxHighlighterPanel',
|
||||
syntax: this.getExtension(this.path),
|
||||
contentUrl: this.contentUrl
|
||||
});
|
||||
},
|
||||
|
||||
openBlamePanel: function(){
|
||||
this.removeAll();
|
||||
this.add({
|
||||
this.openPanel({
|
||||
xtype: 'blamePanel',
|
||||
blameUrl: this.blameUrl
|
||||
});
|
||||
this.doLayout();
|
||||
},
|
||||
|
||||
downlaodFile: function(){
|
||||
window.open(this.contentUrl);
|
||||
},
|
||||
|
||||
openPanel: function(panel){
|
||||
this.removeAll();
|
||||
this.add(panel);
|
||||
this.doLayout();
|
||||
},
|
||||
|
||||
appendRepositoryProperties: function(bar){
|
||||
bar.push('->',this.repository.name);
|
||||
if ( this.revision != null ){
|
||||
|
||||
Reference in New Issue
Block a user