PDA

View Full Version : EXplain Code please



puran4singh
8 Apr 2010, 12:22 AM
Ext.onReady(function() {
Ext.get('mb1').on('click', function(e) {
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult);
});
function showResult(btn) {
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
Ext.example = function() {
var msgCt;

function createBox(t, s) {
return ['<div class="msg">',
'<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
'<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',
'<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
'</div>'].join('');
}
return {
msg: function(title, format) {
if (!msgCt) {
msgCt = Ext.DomHelper.insertFirst(document.body, { id: 'msg-div' }, true);
}
msgCt.alignTo(document, 't-t');
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
var m = Ext.DomHelper.append(msgCt, { html: createBox(title, s) }, true);
m.slideIn('t').pause(1).ghost("t", { remove: true });
},

init: function() {
var lb = Ext.get('lib-bar');
if (lb) {
lb.show();
}
}
};
} ();

});
if any one can explain it please explain

evant
8 Apr 2010, 12:25 AM
Which bit don't you understand?

Animal
8 Apr 2010, 1:45 AM
Unformatted like that, I doubt anybody is putting much effort into understanding it!