Catalyst-Controller-POD
view release on metacpan or search on metacpan
share/ext/ext-all-debug.js view on Meta::CPAN
this.createElement('tbar', bw);
this.createElement('body', bw);
this.createElement('bbar', bw);
this.createElement('footer', bw);
if(!this.header){
this.body.addClass(this.bodyCls + '-noheader');
if(this.tbar){
this.tbar.addClass(this.tbarCls + '-noheader');
}
}
}
if(Ext.isDefined(this.padding)){
this.body.setStyle('padding', this.body.addUnits(this.padding));
}
if(this.border === false){
this.el.addClass(this.baseCls + '-noborder');
this.body.addClass(this.bodyCls + '-noborder');
if(this.header){
this.header.addClass(this.headerCls + '-noborder');
}
if(this.footer){
this.footer.addClass(this.footerCls + '-noborder');
}
if(this.tbar){
this.tbar.addClass(this.tbarCls + '-noborder');
}
if(this.bbar){
this.bbar.addClass(this.bbarCls + '-noborder');
}
}
if(this.bodyBorder === false){
this.body.addClass(this.bodyCls + '-noborder');
}
this.bwrap.enableDisplayMode('block');
if(this.header){
this.header.unselectable();
if(this.headerAsText){
this.header.dom.innerHTML =
'<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>';
if(this.iconCls){
this.setIconClass(this.iconCls);
}
}
}
if(this.floating){
this.makeFloating(this.floating);
}
if(this.collapsible && this.titleCollapse && this.header){
this.mon(this.header, 'click', this.toggleCollapse, this);
this.header.setStyle('cursor', 'pointer');
}
if(ts){
this.addTool.apply(this, ts);
}
if(this.fbar){
this.footer.addClass('x-panel-btns');
this.fbar.ownerCt = this;
this.fbar.render(this.footer);
this.footer.createChild({cls:'x-clear'});
}
if(this.tbar && this.topToolbar){
this.topToolbar.ownerCt = this;
this.topToolbar.render(this.tbar);
}
if(this.bbar && this.bottomToolbar){
this.bottomToolbar.ownerCt = this;
this.bottomToolbar.render(this.bbar);
}
},
setIconClass : function(cls){
var old = this.iconCls;
this.iconCls = cls;
if(this.rendered && this.header){
if(this.frame){
this.header.addClass('x-panel-icon');
this.header.replaceClass(old, this.iconCls);
}else{
var hd = this.header,
img = hd.child('img.x-panel-inline-icon');
if(img){
Ext.fly(img).replaceClass(old, this.iconCls);
}else{
var hdspan = hd.child('span.' + this.headerTextCls);
if (hdspan) {
Ext.DomHelper.insertBefore(hdspan.dom, {
tag:'img', alt: '', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls
});
}
}
}
}
this.fireEvent('iconchange', this, cls, old);
},
makeFloating : function(cfg){
this.floating = true;
this.el = new Ext.Layer(Ext.apply({}, cfg, {
shadow: Ext.isDefined(this.shadow) ? this.shadow : 'sides',
shadowOffset: this.shadowOffset,
constrain:false,
shim: this.shim === false ? false : undefined
}), this.el);
},
share/ext/ext-all-debug.js view on Meta::CPAN
if (dropEvts.length) {
dc.b4DragDrop(e, dropEvts);
dc.onDragDrop(e, dropEvts);
}
} else {
var len = 0;
for (i=0, len=outEvts.length; i<len; ++i) {
dc.b4DragOut(e, outEvts[i].id);
dc.onDragOut(e, outEvts[i].id);
}
for (i=0,len=enterEvts.length; i<len; ++i) {
dc.onDragEnter(e, enterEvts[i].id);
}
for (i=0,len=overEvts.length; i<len; ++i) {
dc.b4DragOver(e, overEvts[i].id);
dc.onDragOver(e, overEvts[i].id);
}
for (i=0, len=dropEvts.length; i<len; ++i) {
dc.b4DragDrop(e, dropEvts[i].id);
dc.onDragDrop(e, dropEvts[i].id);
}
}
if (isDrop && !dropEvts.length) {
dc.onInvalidDrop(e);
}
},
getBestMatch: function(dds) {
var winner = null;
var len = dds.length;
if (len == 1) {
winner = dds[0];
} else {
for (var i=0; i<len; ++i) {
var dd = dds[i];
if (dd.cursorIsOver) {
winner = dd;
break;
} else {
if (!winner ||
winner.overlap.getArea() < dd.overlap.getArea()) {
winner = dd;
}
}
}
}
return winner;
},
refreshCache: function(groups) {
for (var sGroup in groups) {
if ("string" != typeof sGroup) {
continue;
}
for (var i in this.ids[sGroup]) {
var oDD = this.ids[sGroup][i];
if (this.isTypeOfDD(oDD)) {
var loc = this.getLocation(oDD);
if (loc) {
this.locationCache[oDD.id] = loc;
} else {
delete this.locationCache[oDD.id];
}
}
}
}
},
verifyEl: function(el) {
if (el) {
var parent;
if(Ext.isIE){
try{
parent = el.offsetParent;
}catch(e){}
}else{
parent = el.offsetParent;
}
if (parent) {
return true;
}
}
return false;
},
getLocation: function(oDD) {
if (! this.isTypeOfDD(oDD)) {
return null;
}
var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
try {
pos= Ext.lib.Dom.getXY(el);
} catch (e) { }
if (!pos) {
return null;
}
x1 = pos[0];
x2 = x1 + el.offsetWidth;
y1 = pos[1];
y2 = y1 + el.offsetHeight;
t = y1 - oDD.padding[0];
r = x2 + oDD.padding[1];
b = y2 + oDD.padding[2];
l = x1 - oDD.padding[3];
return new Ext.lib.Region( t, r, b, l );
},
isOverTarget: function(pt, oTarget, intersect) {
var loc = this.locationCache[oTarget.id];
if (!loc || !this.useCache) {
loc = this.getLocation(oTarget);
this.locationCache[oTarget.id] = loc;
}
if (!loc) {
return false;
}
oTarget.cursorIsOver = loc.contains( pt );
var dc = this.dragCurrent;
if (!dc || !dc.getTargetCoord ||
(!intersect && !dc.constrainX && !dc.constrainY)) {
return oTarget.cursorIsOver;
}
oTarget.overlap = null;
var pos = dc.getTargetCoord(pt.x, pt.y);
var el = dc.getDragEl();
var curRegion = new Ext.lib.Region( pos.y,
pos.x + el.offsetWidth,
pos.y + el.offsetHeight,
pos.x );
var overlap = curRegion.intersect(loc);
if (overlap) {
oTarget.overlap = overlap;
return (intersect) ? true : oTarget.cursorIsOver;
} else {
return false;
}
},
_onUnload: function(e, me) {
Ext.dd.DragDropMgr.unregAll();
},
unregAll: function() {
if (this.dragCurrent) {
this.stopDrag();
this.dragCurrent = null;
}
this._execOnAll("unreg", []);
for (var i in this.elementCache) {
delete this.elementCache[i];
}
this.elementCache = {};
this.ids = {};
},
elementCache: {},
getElWrapper: function(id) {
var oWrapper = this.elementCache[id];
if (!oWrapper || !oWrapper.el) {
oWrapper = this.elementCache[id] =
new this.ElementWrapper(Ext.getDom(id));
}
return oWrapper;
},
getElement: function(id) {
return Ext.getDom(id);
},
getCss: function(id) {
var el = Ext.getDom(id);
return (el) ? el.style : null;
},
ElementWrapper: function(el) {
this.el = el || null;
this.id = this.el && el.id;
this.css = this.el && el.style;
share/ext/ext-all-debug.js view on Meta::CPAN
b4MouseDown: function(e) {
this.autoOffset(e.getPageX(),
e.getPageY());
},
b4Drag: function(e) {
this.setDragElPos(e.getPageX(),
e.getPageY());
},
toString: function() {
return ("DD " + this.id);
}
});
Ext.dd.DDProxy = function(id, sGroup, config) {
if (id) {
this.init(id, sGroup, config);
this.initFrame();
}
};
Ext.dd.DDProxy.dragElId = "ygddfdiv";
Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
resizeFrame: true,
centerFrame: false,
createFrame: function() {
var self = this;
var body = document.body;
if (!body || !body.firstChild) {
setTimeout( function() { self.createFrame(); }, 50 );
return;
}
var div = this.getDragEl();
if (!div) {
div = document.createElement("div");
div.id = this.dragElId;
var s = div.style;
s.position = "absolute";
s.visibility = "hidden";
s.cursor = "move";
s.border = "2px solid #aaa";
s.zIndex = 999;
body.insertBefore(div, body.firstChild);
}
},
initFrame: function() {
this.createFrame();
},
applyConfig: function() {
Ext.dd.DDProxy.superclass.applyConfig.call(this);
this.resizeFrame = (this.config.resizeFrame !== false);
this.centerFrame = (this.config.centerFrame);
this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
},
showFrame: function(iPageX, iPageY) {
var el = this.getEl();
var dragEl = this.getDragEl();
var s = dragEl.style;
this._resizeProxy();
if (this.centerFrame) {
this.setDelta( Math.round(parseInt(s.width, 10)/2),
Math.round(parseInt(s.height, 10)/2) );
}
this.setDragElPos(iPageX, iPageY);
Ext.fly(dragEl).show();
},
_resizeProxy: function() {
if (this.resizeFrame) {
var el = this.getEl();
Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
}
},
b4MouseDown: function(e) {
var x = e.getPageX();
var y = e.getPageY();
this.autoOffset(x, y);
this.setDragElPos(x, y);
},
b4StartDrag: function(x, y) {
share/ext/ext-all-debug.js view on Meta::CPAN
handles : false,
multiDirectional : false,
height : null,
width : null,
heightIncrement : 0,
widthIncrement : 0,
minHeight : 5,
minWidth : 5,
maxHeight : 10000,
maxWidth : 10000,
minX: 0,
minY: 0,
pinned : false,
preserveRatio : false,
resizeChild : false,
transparent: false,
resizeTo : function(width, height){
this.el.setSize(width, height);
this.updateChildSize();
this.fireEvent('resize', this, width, height, null);
},
startSizing : function(e, handle){
this.fireEvent('beforeresize', this, e);
if(this.enabled){
if(!this.overlay){
this.overlay = this.el.createProxy({tag: 'div', cls: 'x-resizable-overlay', html: ' '}, Ext.getBody());
this.overlay.unselectable();
this.overlay.enableDisplayMode('block');
this.overlay.on({
scope: this,
mousemove: this.onMouseMove,
mouseup: this.onMouseUp
});
}
this.overlay.setStyle('cursor', handle.el.getStyle('cursor'));
this.resizing = true;
this.startBox = this.el.getBox();
this.startPoint = e.getXY();
this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0],
(this.startBox.y + this.startBox.height) - this.startPoint[1]];
this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
this.overlay.show();
if(this.constrainTo) {
var ct = Ext.get(this.constrainTo);
this.resizeRegion = ct.getRegion().adjust(
ct.getFrameWidth('t'),
ct.getFrameWidth('l'),
-ct.getFrameWidth('b'),
-ct.getFrameWidth('r')
);
}
this.proxy.setStyle('visibility', 'hidden');
this.proxy.show();
this.proxy.setBox(this.startBox);
if(!this.dynamic){
this.proxy.setStyle('visibility', 'visible');
}
}
},
onMouseDown : function(handle, e){
if(this.enabled){
e.stopEvent();
this.activeHandle = handle;
this.startSizing(e, handle);
}
},
onMouseUp : function(e){
this.activeHandle = null;
var size = this.resizeElement();
this.resizing = false;
this.handleOut();
this.overlay.hide();
this.proxy.hide();
this.fireEvent('resize', this, size.width, size.height, e);
},
updateChildSize : function(){
if(this.resizeChild){
var el = this.el;
var child = this.resizeChild;
var adj = this.adjustments;
if(el.dom.offsetWidth){
var b = el.getSize(true);
child.setSize(b.width+adj[0], b.height+adj[1]);
}
share/ext/ext-all-debug.js view on Meta::CPAN
cfg = b[name];
if(cfg){
btn.show();
btn.setText(Ext.isString(cfg) ? cfg : Ext.MessageBox.buttonText[name]);
width += btn.getEl().getWidth() + 15;
}else{
btn.hide();
}
});
return width;
};
return {
getDialog : function(titleText){
if(!dlg){
var btns = [];
buttons = {};
Ext.each(buttonNames, function(name){
btns.push(buttons[name] = new Ext.Button({
text: this.buttonText[name],
handler: handleButton.createCallback(name),
hideMode: 'offsets'
}));
}, this);
dlg = new Ext.Window({
autoCreate : true,
title:titleText,
resizable:false,
constrain:true,
constrainHeader:true,
minimizable : false,
maximizable : false,
stateful: false,
modal: true,
shim:true,
buttonAlign:"center",
width:400,
height:100,
minHeight: 80,
plain:true,
footer:true,
closable:true,
close : function(){
if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
handleButton("no");
}else{
handleButton("cancel");
}
},
fbar: new Ext.Toolbar({
items: btns,
enableOverflow: false
})
});
dlg.render(document.body);
dlg.getEl().addClass('x-window-dlg');
mask = dlg.mask;
bodyEl = dlg.body.createChild({
html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></...
});
iconEl = Ext.get(bodyEl.dom.firstChild);
var contentEl = bodyEl.dom.childNodes[1];
msgEl = Ext.get(contentEl.firstChild);
textboxEl = Ext.get(contentEl.childNodes[2].firstChild);
textboxEl.enableDisplayMode();
textboxEl.addKeyListener([10,13], function(){
if(dlg.isVisible() && opt && opt.buttons){
if(opt.buttons.ok){
handleButton("ok");
}else if(opt.buttons.yes){
handleButton("yes");
}
}
});
textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]);
textareaEl.enableDisplayMode();
progressBar = new Ext.ProgressBar({
renderTo:bodyEl
});
bodyEl.createChild({cls:'x-clear'});
}
return dlg;
},
updateText : function(text){
if(!dlg.isVisible() && !opt.width){
dlg.setSize(this.maxWidth, 100);
}
msgEl.update(text ? text + ' ' : ' ');
var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0,
mw = msgEl.getWidth() + msgEl.getMargins('lr'),
fw = dlg.getFrameWidth('lr'),
bw = dlg.body.getFrameWidth('lr'),
w;
w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),
Math.max(opt.minWidth || this.minWidth, bwidth || 0));
if(opt.prompt === true){
activeTextEl.setWidth(w-iw-fw-bw);
}
if(opt.progress === true || opt.wait === true){
progressBar.setSize(w-iw-fw-bw);
}
if(Ext.isIE && w == bwidth){
w += 4;
}
msgEl.update(text || ' ');
dlg.setSize(w, 'auto').center();
return this;
},
updateProgress : function(value, progressText, msg){
progressBar.updateProgress(value, progressText);
if(msg){
share/ext/ext-all-debug.js view on Meta::CPAN
getProxy : function(){
return this.proxy;
},
hide : function(){
if(this.ghost){
if(this.proxy){
this.proxy.remove();
delete this.proxy;
}
this.panel.el.dom.style.display = '';
this.ghost.remove();
delete this.ghost;
}
},
show : function(){
if(!this.ghost){
this.ghost = this.panel.createGhost(this.panel.initialConfig.cls, undefined, Ext.getBody());
this.ghost.setXY(this.panel.el.getXY());
if(this.insertProxy){
this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'});
this.proxy.setSize(this.panel.getSize());
}
this.panel.el.dom.style.display = 'none';
}
},
repair : function(xy, callback, scope){
this.hide();
if(typeof callback == "function"){
callback.call(scope || this);
}
},
moveProxy : function(parentNode, before){
if(this.proxy){
parentNode.insertBefore(this.proxy.dom, before);
}
}
});
Ext.Panel.DD = Ext.extend(Ext.dd.DragSource, {
constructor : function(panel, cfg){
this.panel = panel;
this.dragData = {panel: panel};
this.proxy = new Ext.dd.PanelProxy(panel, cfg);
Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg);
var h = panel.header,
el = panel.body;
if(h){
this.setHandleElId(h.id);
el = panel.header;
}
el.setStyle('cursor', 'move');
this.scroll = false;
},
showFrame: Ext.emptyFn,
startDrag: Ext.emptyFn,
b4StartDrag: function(x, y) {
this.proxy.show();
},
b4MouseDown: function(e) {
var x = e.getPageX(),
y = e.getPageY();
this.autoOffset(x, y);
},
onInitDrag : function(x, y){
this.onStartDrag(x, y);
return true;
},
createFrame : Ext.emptyFn,
getDragEl : function(e){
return this.proxy.ghost.dom;
},
endDrag : function(e){
this.proxy.hide();
this.panel.saveState();
},
autoOffset : function(x, y) {
x -= this.startPageX;
y -= this.startPageY;
this.setDelta(x, y);
}
});
Ext.state.Provider = Ext.extend(Ext.util.Observable, {
constructor : function(){
this.addEvents("statechange");
this.state = {};
Ext.state.Provider.superclass.constructor.call(this);
},
get : function(name, defaultValue){
return typeof this.state[name] == "undefined" ?
defaultValue : this.state[name];
},
clear : function(name){
delete this.state[name];
this.fireEvent("statechange", this, name, null);
},
set : function(name, value){
this.state[name] = value;
this.fireEvent("statechange", this, name, value);
},
share/ext/ext-all-debug.js view on Meta::CPAN
undefinedText: ' ',
constructor : function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
var t = this.trueText, f = this.falseText, u = this.undefinedText;
c.tpl.format = function(v){
if(v === undefined){
return u;
}
if(!v || v === 'false'){
return f;
}
return t;
};
Ext.list.DateColumn.superclass.constructor.call(this, c);
}
});
Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn);
Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {
minPct: .05,
constructor: function(config){
Ext.apply(this, config);
Ext.list.ColumnResizer.superclass.constructor.call(this);
},
init : function(listView){
this.view = listView;
listView.on('render', this.initEvents, this);
},
initEvents : function(view){
view.mon(view.innerHd, 'mousemove', this.handleHdMove, this);
this.tracker = new Ext.dd.DragTracker({
onBeforeStart: this.onBeforeStart.createDelegate(this),
onStart: this.onStart.createDelegate(this),
onDrag: this.onDrag.createDelegate(this),
onEnd: this.onEnd.createDelegate(this),
tolerance: 3,
autoStart: 300
});
this.tracker.initEl(view.innerHd);
view.on('beforedestroy', this.tracker.destroy, this.tracker);
},
handleHdMove : function(e, t){
var handleWidth = 5,
x = e.getPageX(),
header = e.getTarget('em', 3, true);
if(header){
var region = header.getRegion(),
style = header.dom.style,
parentNode = header.dom.parentNode;
if(x - region.left <= handleWidth && parentNode != parentNode.parentNode.firstChild){
this.activeHd = Ext.get(parentNode.previousSibling.firstChild);
style.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';
} else if(region.right - x <= handleWidth && parentNode != parentNode.parentNode.lastChild.previousSibling){
this.activeHd = header;
style.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';
} else{
delete this.activeHd;
style.cursor = '';
}
}
},
onBeforeStart : function(e){
this.dragHd = this.activeHd;
return !!this.dragHd;
},
onStart: function(e){
var me = this,
view = me.view,
dragHeader = me.dragHd,
x = me.tracker.getXY()[0];
me.proxy = view.el.createChild({cls:'x-list-resizer'});
me.dragX = dragHeader.getX();
me.headerIndex = view.findHeaderIndex(dragHeader);
me.headersDisabled = view.disableHeaders;
view.disableHeaders = true;
me.proxy.setHeight(view.el.getHeight());
me.proxy.setX(me.dragX);
me.proxy.setWidth(x - me.dragX);
this.setBoundaries();
},
setBoundaries: function(relativeX){
var view = this.view,
headerIndex = this.headerIndex,
width = view.innerHd.getWidth(),
relativeX = view.innerHd.getX(),
minWidth = Math.ceil(width * this.minPct),
maxWidth = width - minWidth,
numColumns = view.columns.length,
headers = view.innerHd.select('em', true),
minX = minWidth + relativeX,
maxX = maxWidth + relativeX,
header;
if (numColumns == 2) {
this.minX = minX;
this.maxX = maxX;
}else{
header = headers.item(headerIndex + 2);
this.minX = headers.item(headerIndex).getX() + minWidth;
this.maxX = header ? header.getX() - minWidth : maxX;
if (headerIndex == 0) {
this.minX = minX;
} else if (headerIndex == numColumns - 2) {
this.maxX = maxX;
}
}
},
onDrag: function(e){
var me = this,
cursorX = me.tracker.getXY()[0].constrain(me.minX, me.maxX);
me.proxy.setWidth(cursorX - this.dragX);
},
onEnd: function(e){
var newWidth = this.proxy.getWidth(),
index = this.headerIndex,
view = this.view,
columns = view.columns,
width = view.innerHd.getWidth(),
newPercent = Math.ceil(newWidth * view.maxColumnWidth / width) / 100,
disabled = this.headersDisabled,
headerCol = columns[index],
otherCol = columns[index + 1],
totalPercent = headerCol.width + otherCol.width;
this.proxy.remove();
headerCol.width = newPercent;
otherCol.width = totalPercent - newPercent;
delete this.dragHd;
view.setHdWidths();
view.refresh();
setTimeout(function(){
view.disableHeaders = disabled;
}, 100);
}
});
Ext.ListView.ColumnResizer = Ext.list.ColumnResizer;
Ext.list.Sorter = Ext.extend(Ext.util.Observable, {
sortClasses : ["sort-asc", "sort-desc"],
constructor: function(config){
Ext.apply(this, config);
Ext.list.Sorter.superclass.constructor.call(this);
},
init : function(listView){
this.view = listView;
listView.on('render', this.initEvents, this);
},
initEvents : function(view){
view.mon(view.innerHd, 'click', this.onHdClick, this);
view.innerHd.setStyle('cursor', 'pointer');
view.mon(view.store, 'datachanged', this.updateSortState, this);
this.updateSortState.defer(10, this, [view.store]);
},
updateSortState : function(store){
var state = store.getSortState();
if(!state){
return;
}
this.sortState = state;
var cs = this.view.columns, sortColumn = -1;
for(var i = 0, len = cs.length; i < len; i++){
if(cs[i].dataIndex == state.field){
sortColumn = i;
break;
}
}
if(sortColumn != -1){
var sortDir = state.direction;
this.updateSortIcon(sortColumn, sortDir);
}
},
updateSortIcon : function(col, dir){
var sc = this.sortClasses;
var hds = this.view.innerHd.select('em').removeClass(sc);
hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]);
},
onHdClick : function(e){
var hd = e.getTarget('em', 3);
if(hd && !this.view.disableHeaders){
var index = this.view.findHeaderIndex(hd);
this.view.store.sort(this.view.columns[index].dataIndex);
}
}
});
Ext.ListView.Sorter = Ext.list.Sorter;
Ext.TabPanel = Ext.extend(Ext.Panel, {
deferredRender : true,
tabWidth : 120,
minTabWidth : 30,
resizeTabs : false,
enableTabScroll : false,
scrollIncrement : 0,
scrollRepeatInterval : 400,
scrollDuration : 0.35,
share/ext/ext-all-debug.js view on Meta::CPAN
disabled: true,
handler: this.movePrevious,
scope: this
}), '-', this.beforePageText,
this.inputItem = new Ext.form.NumberField({
cls: 'x-tbar-page-number',
allowDecimals: false,
allowNegative: false,
enableKeyEvents: true,
selectOnFocus: true,
submitValue: false,
listeners: {
scope: this,
keydown: this.onPagingKeyDown,
blur: this.onPagingBlur
}
}), this.afterTextItem = new T.TextItem({
text: String.format(this.afterPageText, 1)
}), '-', this.next = new T.Button({
tooltip: this.nextText,
overflowText: this.nextText,
iconCls: 'x-tbar-page-next',
disabled: true,
handler: this.moveNext,
scope: this
}), this.last = new T.Button({
tooltip: this.lastText,
overflowText: this.lastText,
iconCls: 'x-tbar-page-last',
disabled: true,
handler: this.moveLast,
scope: this
}), '-', this.refresh = new T.Button({
tooltip: this.refreshText,
overflowText: this.refreshText,
iconCls: 'x-tbar-loading',
handler: this.doRefresh,
scope: this
})];
var userItems = this.items || this.buttons || [];
if (this.prependButtons) {
this.items = userItems.concat(pagingItems);
}else{
this.items = pagingItems.concat(userItems);
}
delete this.buttons;
if(this.displayInfo){
this.items.push('->');
this.items.push(this.displayItem = new T.TextItem({}));
}
Ext.PagingToolbar.superclass.initComponent.call(this);
this.addEvents(
'change',
'beforechange'
);
this.on('afterlayout', this.onFirstLayout, this, {single: true});
this.cursor = 0;
this.bindStore(this.store, true);
},
onFirstLayout : function(){
if(this.dsLoaded){
this.onLoad.apply(this, this.dsLoaded);
}
},
updateInfo : function(){
if(this.displayItem){
var count = this.store.getCount();
var msg = count == 0 ?
this.emptyMsg :
String.format(
this.displayMsg,
this.cursor+1, this.cursor+count, this.store.getTotalCount()
);
this.displayItem.setText(msg);
}
},
onLoad : function(store, r, o){
if(!this.rendered){
this.dsLoaded = [store, r, o];
return;
}
var p = this.getParams();
this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0;
var d = this.getPageData(), ap = d.activePage, ps = d.pages;
this.afterTextItem.setText(String.format(this.afterPageText, d.pages));
this.inputItem.setValue(ap);
this.first.setDisabled(ap == 1);
this.prev.setDisabled(ap == 1);
this.next.setDisabled(ap == ps);
this.last.setDisabled(ap == ps);
this.refresh.enable();
this.updateInfo();
this.fireEvent('change', this, d);
},
getPageData : function(){
var total = this.store.getTotalCount();
return {
total : total,
activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize),
pages : total < this.pageSize ? 1 : Math.ceil(total/this.pageSize)
};
},
changePage : function(page){
this.doLoad(((page-1) * this.pageSize).constrain(0, this.store.getTotalCount()));
},
onLoadError : function(){
if(!this.rendered){
return;
}
this.refresh.enable();
},
readPage : function(d){
var v = this.inputItem.getValue(), pageNum;
if (!v || isNaN(pageNum = parseInt(v, 10))) {
this.inputItem.setValue(d.activePage);
return false;
}
return pageNum;
},
onPagingFocus : function(){
this.inputItem.select();
},
onPagingBlur : function(e){
this.inputItem.setValue(this.getPageData().activePage);
},
onPagingKeyDown : function(field, e){
var k = e.getKey(), d = this.getPageData(), pageNum;
if (k == e.RETURN) {
e.stopEvent();
pageNum = this.readPage(d);
if(pageNum !== false){
pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1;
this.doLoad(pageNum * this.pageSize);
}
}else if (k == e.HOME || k == e.END){
e.stopEvent();
pageNum = k == e.HOME ? 1 : d.pages;
field.setValue(pageNum);
}else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){
e.stopEvent();
if((pageNum = this.readPage(d))){
var increment = e.shiftKey ? 10 : 1;
if(k == e.DOWN || k == e.PAGEDOWN){
increment *= -1;
}
pageNum += increment;
if(pageNum >= 1 & pageNum <= d.pages){
field.setValue(pageNum);
}
}
}
},
getParams : function(){
return this.paramNames || this.store.paramNames;
},
beforeLoad : function(){
if(this.rendered && this.refresh){
this.refresh.disable();
}
},
doLoad : function(start){
var o = {}, pn = this.getParams();
o[pn.start] = start;
o[pn.limit] = this.pageSize;
if(this.fireEvent('beforechange', this, o) !== false){
this.store.load({params:o});
}
},
moveFirst : function(){
this.doLoad(0);
},
movePrevious : function(){
this.doLoad(Math.max(0, this.cursor-this.pageSize));
},
moveNext : function(){
this.doLoad(this.cursor+this.pageSize);
},
moveLast : function(){
var total = this.store.getTotalCount(),
extra = total % this.pageSize;
this.doLoad(extra ? (total - extra) : total - this.pageSize);
},
doRefresh : function(){
this.doLoad(this.cursor);
},
bindStore : function(store, initial){
var doLoad;
if(!initial && this.store){
if(store !== this.store && this.store.autoDestroy){
this.store.destroy();
}else{
this.store.un('beforeload', this.beforeLoad, this);
this.store.un('load', this.onLoad, this);
this.store.un('exception', this.onLoadError, this);
}
if(!store){
this.store = null;
}
}
if(store){
store = Ext.StoreMgr.lookup(store);
store.on({
scope: this,
beforeload: this.beforeLoad,
load: this.onLoad,
exception: this.onLoadError
});
doLoad = true;
}
this.store = store;
if(doLoad){
this.onLoad(store, null, {});
}
},
unbind : function(store){
this.bindStore(null);
},
bind : function(store){
this.bindStore(store);
},
onDestroy : function(){
this.bindStore(null);
Ext.PagingToolbar.superclass.onDestroy.call(this);
}
});
})();
Ext.reg('paging', Ext.PagingToolbar);
Ext.History = (function () {
var iframe, hiddenField;
var ready = false;
var currentToken;
function getHash() {
var href = location.href, i = href.indexOf("#");
return i >= 0 ? href.substr(i + 1) : null;
share/ext/ext-all-debug.js view on Meta::CPAN
btn('insertorderedlist'),
btn('insertunorderedlist')
);
}
if(this.enableSourceEdit){
items.push(
'-',
btn('sourceedit', true, function(btn){
this.toggleSourceEdit(!this.sourceEditMode);
})
);
}
}
var tb = new Ext.Toolbar({
renderTo: this.wrap.dom.firstChild,
items: items
});
if (fontSelectItem) {
this.fontSelect = fontSelectItem.el;
this.mon(this.fontSelect, 'change', function(){
var font = this.fontSelect.dom.value;
this.relayCmd('fontname', font);
this.deferFocus();
}, this);
}
this.mon(tb.el, 'click', function(e){
e.preventDefault();
});
this.tb = tb;
this.tb.doLayout();
},
onDisable: function(){
this.wrap.mask();
Ext.form.HtmlEditor.superclass.onDisable.call(this);
},
onEnable: function(){
this.wrap.unmask();
Ext.form.HtmlEditor.superclass.onEnable.call(this);
},
setReadOnly: function(readOnly){
Ext.form.HtmlEditor.superclass.setReadOnly.call(this, readOnly);
if(this.initialized){
if(Ext.isIE){
this.getEditorBody().contentEditable = !readOnly;
}else{
this.setDesignMode(!readOnly);
}
var bd = this.getEditorBody();
if(bd){
bd.style.cursor = this.readOnly ? 'default' : 'text';
}
this.disableItems(readOnly);
}
},
getDocMarkup : function(){
var h = Ext.fly(this.iframe).getHeight() - this.iframePad * 2;
return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>', this.iframePad, h);
},
getEditorBody : function(){
var doc = this.getDoc();
return doc.body || doc.documentElement;
},
getDoc : function(){
return Ext.isIE ? this.getWin().document : (this.iframe.contentDocument || this.getWin().document);
},
getWin : function(){
return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name];
},
onRender : function(ct, position){
Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position);
this.el.dom.style.border = '0 none';
this.el.dom.setAttribute('tabIndex', -1);
this.el.addClass('x-hidden');
if(Ext.isIE){
this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;');
}
this.wrap = this.el.wrap({
cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'}
});
this.createToolbar(this);
this.disableItems(true);
this.tb.doLayout();
this.createIFrame();
if(!this.width){
var sz = this.el.getSize();
this.setSize(sz.width, this.height || sz.height);
}
this.resizeEl = this.positionEl = this.wrap;
},
createIFrame: function(){
var iframe = document.createElement('iframe');
iframe.name = Ext.id();
iframe.frameBorder = '0';
iframe.style.overflow = 'auto';
iframe.src = Ext.SSL_SECURE_URL;
this.wrap.dom.appendChild(iframe);
this.iframe = iframe;
this.monitorTask = Ext.TaskMgr.start({
run: this.checkDesignMode,
scope: this,
interval:100
share/ext/ext-all-debug.js view on Meta::CPAN
case 'desc':
store.sort(dataIndex, 'DESC');
break;
default:
this.handleHdMenuClickDefault(item);
}
return true;
},
handleHdMenuClickDefault: function(item) {
var colModel = this.cm,
itemId = item.getItemId(),
index = colModel.getIndexById(itemId.substr(4));
if (index != -1) {
if (item.checked && colModel.getColumnsBy(this.isHideableColumn, this).length <= 1) {
this.onDenyColumnHide();
return;
}
colModel.setHidden(index, item.checked);
}
},
handleHdDown : function(e, target) {
if (Ext.fly(target).hasClass('x-grid3-hd-btn')) {
e.stopEvent();
var colModel = this.cm,
header = this.findHeaderCell(target),
index = this.getCellIndex(header),
sortable = colModel.isSortable(index),
menu = this.hmenu,
menuItems = menu.items,
menuCls = this.headerMenuOpenCls;
this.hdCtxIndex = index;
Ext.fly(header).addClass(menuCls);
menuItems.get('asc').setDisabled(!sortable);
menuItems.get('desc').setDisabled(!sortable);
menu.on('hide', function() {
Ext.fly(header).removeClass(menuCls);
}, this, {single:true});
menu.show(target, 'tl-bl?');
}
},
handleHdMove : function(e) {
var header = this.findHeaderCell(this.activeHdRef);
if (header && !this.headersDisabled) {
var handleWidth = this.splitHandleWidth || 5,
activeRegion = this.activeHdRegion,
headerStyle = header.style,
colModel = this.cm,
cursor = '',
pageX = e.getPageX();
if (this.grid.enableColumnResize !== false) {
var activeHeaderIndex = this.activeHdIndex,
previousVisible = this.getPreviousVisible(activeHeaderIndex),
currentResizable = colModel.isResizable(activeHeaderIndex),
previousResizable = previousVisible && colModel.isResizable(previousVisible),
inLeftResizer = pageX - activeRegion.left <= handleWidth,
inRightResizer = activeRegion.right - pageX <= (!this.activeHdBtn ? handleWidth : 2);
if (inLeftResizer && previousResizable) {
cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize';
} else if (inRightResizer && currentResizable) {
cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize';
}
}
headerStyle.cursor = cursor;
}
},
getPreviousVisible: function(index) {
while (index > 0) {
if (!this.cm.isHidden(index - 1)) {
return index;
}
index--;
}
return undefined;
},
handleHdOver : function(e, target) {
var header = this.findHeaderCell(target);
if (header && !this.headersDisabled) {
var fly = this.fly(header);
this.activeHdRef = target;
this.activeHdIndex = this.getCellIndex(header);
this.activeHdRegion = fly.getRegion();
if (!this.isMenuDisabled(this.activeHdIndex, fly)) {
fly.addClass('x-grid3-hd-over');
this.activeHdBtn = fly.child('.x-grid3-hd-btn');
if (this.activeHdBtn) {
this.activeHdBtn.dom.style.height = (header.firstChild.offsetHeight - 1) + 'px';
}
}
}
},
handleHdOut : function(e, target) {
var header = this.findHeaderCell(target);
if (header && (!Ext.isIE || !e.within(header, true))) {
this.activeHdRef = null;
this.fly(header).removeClass('x-grid3-hd-over');
header.style.cursor = '';
}
},
isMenuDisabled: function(cellIndex, el) {
return this.cm.isMenuDisabled(cellIndex);
},
hasRows : function() {
var fc = this.mainBody.dom.firstChild;
return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty';
},
isHideableColumn : function(c) {
return !c.hidden;
},
bind : function(d, c) {
this.initData(d, c);
}
});
Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
constructor: function(grid, hd){
this.grid = grid;
this.view = grid.getView();
this.marker = this.view.resizeMarker;
this.proxy = this.view.resizeProxy;
Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd,
'gridSplitters' + this.grid.getGridEl().id, {
dragElId : Ext.id(this.proxy.dom), resizeFrame:false
});
this.scroll = false;
this.hw = this.view.splitHandleWidth || 5;
},
b4StartDrag : function(x, y){
this.dragHeadersDisabled = this.view.headersDisabled;
this.view.headersDisabled = true;
var h = this.view.mainWrap.getHeight();
this.marker.setHeight(h);
this.marker.show();
this.marker.alignTo(this.view.getHeaderCell(this.cellIndex), 'tl-tl', [-2, 0]);
this.proxy.setHeight(h);
var w = this.cm.getColumnWidth(this.cellIndex),
minw = Math.max(w-this.grid.minColumnWidth, 0);
this.resetConstraints();
this.setXConstraint(minw, 1000);
this.setYConstraint(0, 0);
this.minX = x - minw;
this.maxX = x + 1000;
this.startPos = x;
Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
( run in 0.461 second using v1.01-cache-2.11-cpan-39bf76dae61 )