--- /dev/null
+/*
+ * - LGPL
+ *
+ * page contgainer.
+ *
+ */
+Roo.bootstrap.Body = function(config){
+ Roo.bootstrap.Body.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component, {
+
+ autoCreate : {
+ cls: 'container'
+ },
+ onRender : function(ct, position){
+ this.el = Roo.get(document.body);
+
+ //this.el.addClass([this.fieldClass, this.cls]);
+
+ }
+
+
+
+
+});
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * column
+ *
+ */
+Roo.bootstrap.Column = function(config){
+ Roo.bootstrap.Column.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
+
+ colspan : 6,
+
+ autoCreate : {
+ cls: 'column'
+ },
+
+ getAutoCreate : function(){
+ var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
+ cfg.cls += 'col-md-' + this.colspan;
+ return cfg;
+ },
+
+});
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * base class for bootstrap elements..
+ *
+ */
+Roo.bootstrap = Roo.bootstrap || {};
+Roo.bootstrap.Component = function(config){
+ Roo.bootstrap.Component.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, {
+
+
+ autoCreate : false,
+
+ initEvents : function() { },
+ // private
+ onRender : function(ct, position){
+ Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
+ if(!this.el){
+ var cfg = Roo.apply({}, this.getAutoCreate());
+ cfg.id = Roo.id();
+ //if(!cfg.name){
+ // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
+ //}
+ //if (!cfg.name.length) {
+ // delete cfg.name;
+ // }
+ if (this.cls) {
+ cfg.cls += ' ' + this.cls;
+ }
+ if (this.style) {
+ cfg.style = this.style;
+ }
+ this.el = ct.createChild(cfg, position);
+ }
+ //var type = this.el.dom.type;
+
+ if(this.tabIndex !== undefined){
+ this.el.dom.setAttribute('tabIndex', this.tabIndex);
+ }
+ this.initEvents();
+ //this.el.addClass([this.fieldClass, this.cls]);
+
+ },
+ getChildContainer : function()
+ {
+ return this.el;
+ },
+
+ addxtype : function (tree) {
+ var cn = this;
+ if (tree.xtype != 'Body') {
+ var tt = Roo.apply({}, tree);
+ delete tt.items;
+ cn = Roo.factory(tree);
+ cn.onRender(this.getChildContainer());
+ // then add the element..
+ }
+ if (!tree.items || !tree.items.length) {
+ return this;
+ }
+ // add the items..
+ for(var i =0;i < tree.items.length;i++) {
+ cn.addxtype(Roo.apply({}, tree.items[i]));
+
+ }
+ return this;
+ }
+
+
+
+
+});
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * page contgainer.
+ *
+ */
+Roo.bootstrap.Container = function(config){
+ Roo.bootstrap.Container.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
+
+ autoCreate : {
+ cls: 'container',
+ html : null
+ },
+ getAutoCreate : function(){
+
+ var cfg = Roo.apply({}, Roo.bootstrap.Container.superclass.getAutoCreate.call(this));
+
+ cfg.html = this.html || cfg.html;
+ return cfg;
+ }
+
+});
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * row
+ *
+ */
+Roo.bootstrap.Navbar.Dropdown.Item = function(config){
+ Roo.bootstrap.Navbar.Dropdown.Item.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Navbar.Dropdown.Item, Roo.bootstrap.Component, {
+
+ href : false,
+ html : false,
+
+ autoCreate : {
+ // cls: '',
+ tag : 'li',
+ cn : [
+ {
+ tag : 'a',
+ href : '#',
+ html : 'Link'
+ }
+ ]
+ },
+
+ getAutoCreate : function(){
+
+ var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Dropdown.Item.superclass.getAutoCreate.call(this));
+ cfg.cn[0].href = this.href || cfg.cn[0].href ;
+ cfg.cn[0].html = this.html || cfg.cn[0].html ;
+ return cfg;
+ }
+
+});
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * row
+ *
+ */
+Roo.bootstrap.Navbar.Dropdown = function(config){
+ Roo.bootstrap.Navbar.Dropdown.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Navbar.Dropdown, Roo.bootstrap.Component, {
+
+
+ html : false,
+
+ autoCreate : {
+ cls: 'dropdown',
+ tag : 'li',
+ cn : [
+ {
+ tag : 'a',
+ href : '#',
+ cls : 'dropdown-toggle',
+ 'data-toggle' : 'dropdown',
+ cn : [
+ 'Link',
+ {
+ tag: 'strong',
+ cls : 'caret'
+ },
+
+ ]
+
+ },
+ {
+ tag : 'ul',
+ cls : 'dropdown-menu',
+
+ }
+ ]
+ },
+
+ getChildContainer : function() {
+ return this.el.select('ul', true).first();
+ },
+
+ getAutoCreate : function(){
+ var cfg = Roo.bootstrap.Navbar.Dropdown.superclass.getAutoCreate.call(this);
+
+ cfg.cn[0].cn[0] = this.html || cfg.cn[0].cn[0];
+ return cfg;
+ },
+ initEvents : function() {
+ Roo.log("ADD event");
+ Roo.log(this.el.dom);
+ this.el.on('click', this.toggle, this);
+
+ },
+ toggle : function(e)
+ {
+ Roo.log(e.getTarget());
+ Roo.log(this.el.dom);
+ if (Roo.get(e.getTarget()).findParent('ul.dropdown-menu')) {
+ return;
+ }
+ var isActive = this.el.hasClass('open');
+ // if disabled.. ingore
+ this.clearMenus(e);
+ //if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+ // if mobile we use a backdrop because click events don't delegate
+ // $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
+ // }
+
+ //var relatedTarget = { relatedTarget: this }
+ //$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
+
+ //if (e.isDefaultPrevented()) return;
+
+ this.el.toggleClass('open');
+
+ // .trigger('shown.bs.dropdown', relatedTarget)
+
+ this.el.focus();
+ Roo.log(e);
+ e.preventDefault();
+
+
+ },
+ clearMenus : function()
+ {
+ //$(backdrop).remove()
+ this.el.select('a.dropdown-toggle',true).each(function(aa) {
+ if (!aa.hasClass('open')) {
+ return;
+ }
+ // triger close...
+ aa.removeClass('open');
+ //var parent = getParent($(this))
+ //var relatedTarget = { relatedTarget: this }
+
+ //$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+ //if (e.isDefaultPrevented()) return
+ //$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
+ })
+ }
+
+
+});
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * row
+ *
+ */
+Roo.bootstrap.Navbar.Item = function(config){
+ Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component, {
+
+ href : false,
+ html : false,
+
+ autoCreate : {
+ cls: 'nav navbar-nav',
+ tag : 'li',
+ cn : [
+ {
+ tag : 'a',
+ href : '#',
+ html : 'Link'
+ }
+ ]
+ },
+
+ getAutoCreate : function(){
+
+ var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
+ cfg.cn[0].href = this.href || cfg.cn[0].href ;
+ cfg.cn[0].html = this.html || cfg.cn[0].html ;
+ return cfg;
+ }
+
+});
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * row
+ *
+ */
+Roo.bootstrap.Navbar = function(config){
+ Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
+
+ autoCreate : {
+ cls: 'navbar navbar-default',
+ tag : 'nav',
+ role : 'navigation',
+ cn : [
+ {
+ cls: 'nav navbar-nav',
+ tag : 'ul'
+ }
+
+ ]
+ },
+ getChildContainer : function() {
+ return this.el.select('ul', true).first();
+ },
+
+});
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * - LGPL
+ *
+ * row
+ *
+ */
+Roo.bootstrap.Row = function(config){
+ Roo.bootstrap.Row.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, {
+
+ autoCreate : {
+ cls: 'row clearfix'
+ }
+
+
+});
+
+
+
+
\ No newline at end of file
this.id=id;this.addToGroup((C)?C:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(C,D,E,F){if(!D&&0!==D){this.padding=[C,C,C,C];}else if(!E&&0!==E){this.padding=[C,D,C,D];}else {this.padding=[C,D,E,F];}},setInitPosition:function(C,D){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=C||0;var dy=D||0;var p=B.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(C){var p=C||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}
this.DDM.removeDDFromGroup(this,C);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
-A.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){A.un(this.id,"mousedown",this.handleMouseDown);A.un(this.id,"touchstart",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},destroy:function(){this.unreg();},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,C){Roo.log(this);Roo.log(e);if(!Roo.isTouch&&this.primaryButtonOnly&&e.button!=0){Roo.log('not touch/ button !=0');return;}if(this.isLocked()){Roo.log('locked');return;}
-this.DDM.refreshCache(this.groups);Roo.log([Roo.lib.Event.getPageX(e),Roo.lib.Event.getPageY(e)]);var pt=new Roo.lib.Point(Roo.lib.Event.getPageX(e),Roo.lib.Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){Roo.log('no outer handes or not over target');}else {Roo.log('check validator');if(this.clickValidator(e)){Roo.log('validate success');this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else {}}},clickValidator:function(e){var C=e.getTarget();return (this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
+A.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){A.un(this.id,"mousedown",this.handleMouseDown);A.un(this.id,"touchstart",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},destroy:function(){this.unreg();},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,C){Roo.log(this);Roo.log(e);if(!Roo.isTouch&&this.primaryButtonOnly&&e.button!=0){return;}if(ev.browserEvent.touches&&ev.browserEvent.touches.length!=1){return;}if(this.isLocked()){return;}
+this.DDM.refreshCache(this.groups);Roo.log([Roo.lib.Event.getPageX(e),Roo.lib.Event.getPageY(e)]);var pt=new Roo.lib.Point(Roo.lib.Event.getPageX(e),Roo.lib.Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else {Roo.log('check validator');if(this.clickValidator(e)){Roo.log('validate success');this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else {}}},clickValidator:function(e){var C=e.getTarget();return (this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(C){for(var i=0,D=this.invalidHandleClasses.length;i<D;++i){if(this.invalidHandleClasses[i]==C){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(C){var D=true;var E;try{E=C.nodeName.toUpperCase();}catch(e){E=C.nodeName;}
D=D&&!this.invalidHandleTypes[E];D=D&&!this.invalidHandleIds[C.id];for(var i=0,F=this.invalidHandleClasses.length;D&&i<F;++i){D=!B.hasClass(C,this.invalidHandleClasses[i]);}return D;},setXTicks:function(C,D){this.xTicks=[];this.xTickSize=D;var E={};for(var i=this.initPageX;i>=this.minX;i=i-D){if(!E[i]){this.xTicks[this.xTicks.length]=i;E[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+D){if(!E[i]){this.xTicks[this.xTicks.length]=i;E[i]=true;}}
this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(C,D){this.yTicks=[];this.yTickSize=D;var E={};for(var i=this.initPageY;i>=this.minY;i=i-D){if(!E[i]){this.yTicks[this.yTicks.length]=i;E[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+D){if(!E[i]){this.yTicks[this.yTicks.length]=i;E[i]=true;}}
Roo.log(this);
Roo.log(e);
if (!Roo.isTouch && this.primaryButtonOnly && e.button != 0) {
- Roo.log('not touch/ button !=0');
+ //Roo.log('not touch/ button !=0');
return;
}
+ if (ev.browserEvent.touches && ev.browserEvent.touches.length != 1) {
+ return; // double touch..
+ }
+
if (this.isLocked()) {
- Roo.log('locked');
+ //Roo.log('locked');
return;
}
Roo.log([Roo.lib.Event.getPageX(e), Roo.lib.Event.getPageY(e)]);
var pt = new Roo.lib.Point(Roo.lib.Event.getPageX(e), Roo.lib.Event.getPageY(e));
if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) {
- Roo.log('no outer handes or not over target');
+ //Roo.log('no outer handes or not over target');
// do nothing.
} else {
Roo.log('check validator');