roojs-core.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 18 Apr 2012 07:51:55 +0000 (15:51 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 18 Apr 2012 07:51:55 +0000 (15:51 +0800)
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-core-debug.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 48076be..f23cc54 100644 (file)
@@ -647,7 +647,7 @@ p.expandedChild=A;}},setRootNode:function(A){Roo.tree.TreePanel.superclass.setRo
 A.cascade(f);return r;},expandPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var E=this.root;if(E.attributes[B]!=D[1]){if(C){C(false,null);}return;}var F=1;var f=function(){if(++F==D.length){if(C){C(true,E);}return;}var c=E.findChild(B,D[F]);if(!c){if(C){C(false,E);}return;}
 E=c;c.expand(false,false,f);};E.expand(false,false,f);},selectPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var v=D.pop();if(D.length>0){var f=function(E,F){if(E&&F){var n=F.findChild(B,v);if(n){n.select();if(C){C(true,n);}}else if(C){C(false,n);}}else {if(C){C(false,n);}}};this.expandPath(D.join(this.pathSeparator),B,f);}else {this.root.select();if(C){C(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;}
 this.innerCt=this.el.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.lines?"x-tree-lines":"x-tree-no-lines")});if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Roo.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true});}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Roo.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll});}
-this.getSelectionModel().init(this);if(!this.root){console.log("ROOT not set in tree");return;}
+this.getSelectionModel().init(this);if(!this.root){Roo.log("ROOT not set in tree");return this;}
 this.root.render();if(!this.rootVisible){this.root.renderChildren();}return this;}});
 //Roo/tree/TreeSelectionModel.js
 Roo.tree.DefaultSelectionModel=function(A){this.selNode=null;this.addEvents({"selectionchange":true,"beforeselect":true});Roo.tree.DefaultSelectionModel.superclass.constructor.call(this,A);};Roo.extend(Roo.tree.DefaultSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(A,e){if(e.ctrlKey&&this.selNode==A){this.unselect(A);return;}
@@ -872,7 +872,7 @@ A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enabl
 //Roo/form/HtmlEditor/ToolbarContext.js
 Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);this.styles=this.styles||{};}
 Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:80},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:80},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:200,disabled:true}},'*':{}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,styles:false,toolbars:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function btn(id,E,F){var G=B+'-'+id;return {id:G,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:E!==false,scope:A,handler:F||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var D=A.wrap.createChild({tag:'div'},A.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);}
-this.tb=this.toolbars.BODY;this.tb.el.show();this.buildFooter();this.footer.show();this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(A,ev,B){if(!this.editor.activated){this.editor.onFirstFocus();return;}if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName=='IMG'){B=ev.target;var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(sel);}var s=A.win.getSelection();s.removeAllRanges();s.addRange(C);}var D=B?false:true;var E=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;if(!B){B=E.length?(E[0]?E[0]:E[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;}var tn=B.tagName.toUpperCase();tn=B.tagName.toUpperCase();var F=this.tb.selectedNode
+this.tb=this.toolbars.BODY;this.tb.el.show();this.buildFooter();this.footer.show();A.on('hide',function(){this.footer.hide()},this);A.on('show',function(){this.footer.show()},this);this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(A,ev,B){if(!this.editor.activated){this.editor.onFirstFocus();return;}if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName=='IMG'){B=ev.target;var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(sel);}var s=A.win.getSelection();s.removeAllRanges();s.addRange(C);}var D=B?false:true;var E=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;if(!B){B=E.length?(E[0]?E[0]:E[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;}var tn=B.tagName.toUpperCase();tn=B.tagName.toUpperCase();var F=this.tb.selectedNode
 this.tb.selectedNode=B;if((this.tb.name!=tn)||(F!=this.tb.selectedNode)){this.tb.el.hide();this.tb=typeof(ty[tn])!='undefined'?this.toolbars[tn]:this.toolbars['*'];this.tb.el.show();this.tb.items.first().el.innerHTML=tn+':&nbsp;';if(this.tb.fields){this.tb.fields.each(function(e){e.setValue(B.getAttribute(e.name));});}var G=false;for(var i in this.styles){G=true;break;}if(G){var st=this.tb.fields.item(0);st.store.removeAll();var cn=B.className.split(/\s+/);var H=[];if(this.styles['*']){Roo.each(this.styles['*'],function(v){H.push([v,cn.indexOf(v)>-1?1:0]);});}if(this.styles[tn]){Roo.each(this.styles[tn],function(v){H.push([v,cn.indexOf(v)>-1?1:0]);});}
 st.store.loadData(H);st.collapse();st.setValue(cn);}
 this.tb.selectedNode=B;Roo.menu.MenuMgr.hideAll();}if(!D){return;}var I='';this.footerEls=E.reverse();Roo.each(this.footerEls,function(a,i){if(!a){return;}
index 415bb5c..7428e15 100644 (file)
@@ -1774,11 +1774,28 @@ Date.prototype.add = function(interval, value){
  * <script type="text/javascript">
  */
 
+/**
+ * @class Roo.lib.Dom
+ * @static
+ * 
+ * Dom utils (from YIU afaik)
+ * 
+ **/
 Roo.lib.Dom = {
+    /**
+     * Get the view width
+     * @param {Boolean} full True will get the full document, otherwise it's the view width
+     * @return {Number} The width
+     */
+     
     getViewWidth : function(full) {
         return full ? this.getDocumentWidth() : this.getViewportWidth();
     },
-
+    /**
+     * Get the view height
+     * @param {Boolean} full True will get the full document, otherwise it's the view height
+     * @return {Number} The height
+     */
     getViewHeight : function(full) {
         return full ? this.getDocumentHeight() : this.getViewportHeight();
     },
index 0371e3c..cdec29b 100644 (file)
@@ -1774,11 +1774,28 @@ Date.prototype.add = function(interval, value){
  * <script type="text/javascript">
  */
 
+/**
+ * @class Roo.lib.Dom
+ * @static
+ * 
+ * Dom utils (from YIU afaik)
+ * 
+ **/
 Roo.lib.Dom = {
+    /**
+     * Get the view width
+     * @param {Boolean} full True will get the full document, otherwise it's the view width
+     * @return {Number} The width
+     */
+     
     getViewWidth : function(full) {
         return full ? this.getDocumentWidth() : this.getViewportWidth();
     },
-
+    /**
+     * Get the view height
+     * @param {Boolean} full True will get the full document, otherwise it's the view height
+     * @return {Number} The height
+     */
     getViewHeight : function(full) {
         return full ? this.getDocumentHeight() : this.getViewportHeight();
     },
@@ -21173,6 +21190,8 @@ Roo.data.Node = function(attributes){
         this.id = Roo.id(null, "ynode-");
         this.attributes.id = this.id;
     }
+     
+    
     /**
      * All child nodes of this node. @type Array
      */
@@ -31430,8 +31449,8 @@ Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
         }
         this.getSelectionModel().init(this);
         if (!this.root) {
-            console.log("ROOT not set in tree");
-            return;
+            Roo.log("ROOT not set in tree");
+            return this;
         }
         this.root.render();
         if(!this.rootVisible){
@@ -40890,6 +40909,9 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
         this.tb.el.show();
         this.buildFooter();
         this.footer.show();
+        editor.on('hide', function( ) { this.footer.hide() }, this);
+        editor.on('show', function( ) { this.footer.show() }, this);
+        
          
         this.rendered = true;
         
@@ -41557,7 +41579,7 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
                 (typeof(action.result) != 'undefined')  &&
                 (typeof(action.result.errors) != 'undefined')  &&
                 (typeof(action.result.errors.needs_confirm) != 'undefined')
-           ){
+          ){
                 var _t = this;
                 Roo.MessageBox.confirm(
                     "Change requires confirmation",
index 9fb39e9..faf7b5f 100644 (file)
@@ -6671,6 +6671,8 @@ Roo.data.Node = function(attributes){
         this.id = Roo.id(null, "ynode-");
         this.attributes.id = this.id;
     }
+     
+    
     /**
      * All child nodes of this node. @type Array
      */
@@ -16928,8 +16930,8 @@ Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
         }
         this.getSelectionModel().init(this);
         if (!this.root) {
-            console.log("ROOT not set in tree");
-            return;
+            Roo.log("ROOT not set in tree");
+            return this;
         }
         this.root.render();
         if(!this.rootVisible){
@@ -26388,6 +26390,9 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
         this.tb.el.show();
         this.buildFooter();
         this.footer.show();
+        editor.on('hide', function( ) { this.footer.hide() }, this);
+        editor.on('show', function( ) { this.footer.show() }, this);
+        
          
         this.rendered = true;
         
@@ -27055,7 +27060,7 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
                 (typeof(action.result) != 'undefined')  &&
                 (typeof(action.result.errors) != 'undefined')  &&
                 (typeof(action.result.errors.needs_confirm) != 'undefined')
-           ){
+          ){
                 var _t = this;
                 Roo.MessageBox.confirm(
                     "Change requires confirmation",
index 9a83d25..5309968 100644 (file)
@@ -354,7 +354,7 @@ p.expandedChild=A;}},setRootNode:function(A){Roo.tree.TreePanel.superclass.setRo
 A.cascade(f);return r;},expandPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var E=this.root;if(E.attributes[B]!=D[1]){if(C){C(false,null);}return;}var F=1;var f=function(){if(++F==D.length){if(C){C(true,E);}return;}var c=E.findChild(B,D[F]);if(!c){if(C){C(false,E);}return;}
 E=c;c.expand(false,false,f);};E.expand(false,false,f);},selectPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var v=D.pop();if(D.length>0){var f=function(E,F){if(E&&F){var n=F.findChild(B,v);if(n){n.select();if(C){C(true,n);}}else if(C){C(false,n);}}else {if(C){C(false,n);}}};this.expandPath(D.join(this.pathSeparator),B,f);}else {this.root.select();if(C){C(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;}
 this.innerCt=this.el.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.lines?"x-tree-lines":"x-tree-no-lines")});if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Roo.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true});}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Roo.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll});}
-this.getSelectionModel().init(this);if(!this.root){console.log("ROOT not set in tree");return;}
+this.getSelectionModel().init(this);if(!this.root){Roo.log("ROOT not set in tree");return this;}
 this.root.render();if(!this.rootVisible){this.root.renderChildren();}return this;}});
 //Roo/tree/TreeSelectionModel.js
 Roo.tree.DefaultSelectionModel=function(A){this.selNode=null;this.addEvents({"selectionchange":true,"beforeselect":true});Roo.tree.DefaultSelectionModel.superclass.constructor.call(this,A);};Roo.extend(Roo.tree.DefaultSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(A,e){if(e.ctrlKey&&this.selNode==A){this.unselect(A);return;}
@@ -579,7 +579,7 @@ A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enabl
 //Roo/form/HtmlEditor/ToolbarContext.js
 Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);this.styles=this.styles||{};}
 Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:80},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:80},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:200,disabled:true}},'*':{}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,styles:false,toolbars:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function btn(id,E,F){var G=B+'-'+id;return {id:G,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:E!==false,scope:A,handler:F||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var D=A.wrap.createChild({tag:'div'},A.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);}
-this.tb=this.toolbars.BODY;this.tb.el.show();this.buildFooter();this.footer.show();this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(A,ev,B){if(!this.editor.activated){this.editor.onFirstFocus();return;}if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName=='IMG'){B=ev.target;var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(sel);}var s=A.win.getSelection();s.removeAllRanges();s.addRange(C);}var D=B?false:true;var E=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;if(!B){B=E.length?(E[0]?E[0]:E[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;}var tn=B.tagName.toUpperCase();tn=B.tagName.toUpperCase();var F=this.tb.selectedNode
+this.tb=this.toolbars.BODY;this.tb.el.show();this.buildFooter();this.footer.show();A.on('hide',function(){this.footer.hide()},this);A.on('show',function(){this.footer.show()},this);this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(A,ev,B){if(!this.editor.activated){this.editor.onFirstFocus();return;}if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName=='IMG'){B=ev.target;var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(sel);}var s=A.win.getSelection();s.removeAllRanges();s.addRange(C);}var D=B?false:true;var E=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;if(!B){B=E.length?(E[0]?E[0]:E[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;}var tn=B.tagName.toUpperCase();tn=B.tagName.toUpperCase();var F=this.tb.selectedNode
 this.tb.selectedNode=B;if((this.tb.name!=tn)||(F!=this.tb.selectedNode)){this.tb.el.hide();this.tb=typeof(ty[tn])!='undefined'?this.toolbars[tn]:this.toolbars['*'];this.tb.el.show();this.tb.items.first().el.innerHTML=tn+':&nbsp;';if(this.tb.fields){this.tb.fields.each(function(e){e.setValue(B.getAttribute(e.name));});}var G=false;for(var i in this.styles){G=true;break;}if(G){var st=this.tb.fields.item(0);st.store.removeAll();var cn=B.className.split(/\s+/);var H=[];if(this.styles['*']){Roo.each(this.styles['*'],function(v){H.push([v,cn.indexOf(v)>-1?1:0]);});}if(this.styles[tn]){Roo.each(this.styles[tn],function(v){H.push([v,cn.indexOf(v)>-1?1:0]);});}
 st.store.loadData(H);st.collapse();st.setValue(cn);}
 this.tb.selectedNode=B;Roo.menu.MenuMgr.hideAll();}if(!D){return;}var I='';this.footerEls=E.reverse();Roo.each(this.footerEls,function(a,i){if(!a){return;}