Skip to content

Instantly share code, notes, and snippets.

@christianseel
Created April 10, 2014 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save christianseel/10421374 to your computer and use it in GitHub Desktop.
Save christianseel/10421374 to your computer and use it in GitHub Desktop.
Dieser JS Code fügt in die rechte Spalte einer Resource beliebigen HTML Code ein (z.B. Hinweise). Sollte per Plugin OnDocFormPreRender eingefügt werden.
var content = '';
content += '<h3>Hinweise</h3>';
content += '<p>Hinweistext</p>';
content += '<style>.hdkInfo-panel p {margin-bottom: 10px; line-height:1.6;} .hdkInfo-panel h4 {margin-top: 15px; margin-bottom: 5px;}</style>';
var hdkInfo = function(config) {
config = config || {};
};
Ext.extend(hdkInfo, Ext.Component, {
page: {}, window: {}, grid: {}, tree: {}, panel: {}, combo: {}, config: {}, view: {},
initialize: function() {
hdkInfo.addPanel();
},
addPanel: function() {
var fp = Ext.getCmp('modx-resource-main-right');
fp.add({
xtype: 'panel',
anchor: '100%',
border: false,
fieldLabel: _('hdkInfo.prevbox'),
layout: 'form',
items: [{
columnWidth: .67,
xtype: 'panel',
baseCls: 'hdkInfo-panel',
bodyStyle: 'padding: 15px 0px;',
border: false,
autoHeight: true,
items: [{
xtype: 'box',
html: content,
style: 'background-color: #fff; font-size:12px; display:block; color:#222;'
}]
}]
});
fp.doLayout();
}
});
Ext.reg('hdkinfo', hdkInfo);
hdkInfo = new hdkInfo();
Ext.onReady(function() {
hdkInfo.initialize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment