From a9d9e421ffd6fcb659ec250ab17f548c93fd04b9 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 16 Feb 2023 17:24:45 +0800 Subject: [PATCH] Fix #7581 - selection of blocks --- Roo/HtmlEditorCore.js | 2 + Roo/bootstrap/form/HtmlEditor.js | 47 +- .../form/HtmlEditorToolbar/Context.js | 492 +++++ .../form/HtmlEditorToolbar/Standard.js | 488 +++++ .../form/HtmlEditorToolbar/namespace.js | 1 + .../form/HtmlEditorToolbarStandard.js | 290 --- Roo/data/HttpProxy.js | 12 +- Roo/data/Store.js | 4 +- Roo/grid/Grid.js | 5 + buildSDK/dependancy_bootstrap.txt | 7 +- docs/json/roodata.json | 1922 ++++++++++++++--- docs/src/Roo_HtmlEditorCore.js.html | 4 +- .../src/Roo_bootstrap_form_HtmlEditor.js.html | 55 +- ...rap_form_HtmlEditorToolbar_Context.js.html | 492 +++++ ...ap_form_HtmlEditorToolbar_Standard.js.html | 489 +++++ ...p_form_HtmlEditorToolbar_namespace.js.html | 2 + docs/src/Roo_data_HttpProxy.js.html | 12 +- docs/src/Roo_data_Store.js.html | 4 +- docs/src/Roo_grid_Grid.js.html | 5 + docs/symbols/Roo.Component.json | 3 +- docs/symbols/Roo.bootstrap.Component.json | 3 +- .../Roo.bootstrap.form.HtmlEditor.json | 4 +- ...tstrap.form.HtmlEditorToolbar.Context.json | 1285 +++++++++++ ...strap.form.HtmlEditorToolbar.Standard.json | 1301 +++++++++++ .../Roo.bootstrap.form.HtmlEditorToolbar.json | 25 + docs/symbols/Roo.bootstrap.nav.Bar.json | 3 +- docs/symbols/Roo.bootstrap.nav.Simplebar.json | 3 +- docs/symbols/Roo.data.HttpProxy.json | 7 +- docs/symbols/Roo.data.JsonStore.json | 10 +- docs/symbols/Roo.data.SimpleStore.json | 10 +- docs/symbols/Roo.data.Store.json | 10 +- docs/symbols/Roo.grid.Calendar.json | 178 +- docs/symbols/Roo.grid.EditorGrid.json | 182 +- docs/symbols/Roo.grid.Grid.json | 8 + docs/symbols/Roo.grid.PropertyGrid.json | 16 +- docs/symbols/Roo.util.Observable.json | 3 +- docs/tree.json | 17 +- examples/bootstrap/Editor.html | 4 + examples/bootstrap/Editor.js | 1 + examples/bootstrap/htmleditor.js | 1 + roojs-bootstrap-debug.js | 422 +++- roojs-bootstrap.js | 61 +- roojs-debug.js | 23 +- roojs-ui-debug.js | 23 +- 44 files changed, 6933 insertions(+), 1003 deletions(-) create mode 100644 Roo/bootstrap/form/HtmlEditorToolbar/Context.js create mode 100644 Roo/bootstrap/form/HtmlEditorToolbar/Standard.js create mode 100644 Roo/bootstrap/form/HtmlEditorToolbar/namespace.js delete mode 100644 Roo/bootstrap/form/HtmlEditorToolbarStandard.js create mode 100644 docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Context.js.html create mode 100644 docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html create mode 100644 docs/src/Roo_bootstrap_form_HtmlEditorToolbar_namespace.js.html create mode 100644 docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Context.json create mode 100644 docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Standard.json create mode 100644 docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.json diff --git a/Roo/HtmlEditorCore.js b/Roo/HtmlEditorCore.js index 128ed4d0bb..a142913ed0 100644 --- a/Roo/HtmlEditorCore.js +++ b/Roo/HtmlEditorCore.js @@ -803,6 +803,8 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) { return; // we do not handle this.. (undo manager does..) } + // clicking a 'block'? + // in theory this detects if the last element is not a br, then we try and do that. // its so clicking in space at bottom triggers adding a br and moving the cursor. if (e && diff --git a/Roo/bootstrap/form/HtmlEditor.js b/Roo/bootstrap/form/HtmlEditor.js index af2252cadb..987a3d7533 100644 --- a/Roo/bootstrap/form/HtmlEditor.js +++ b/Roo/bootstrap/form/HtmlEditor.js @@ -105,9 +105,9 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { /** - * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one + * @cfg {Array|boolean} toolbars Array of toolbars, or names of toolbars. - true for standard, and false for none. */ - toolbars : false, + toolbars : true, /** * @cfg {Array} buttons Array of toolbar's buttons. - defaults to empty @@ -160,26 +160,35 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { * add custom toolbar buttons. * @param {HtmlEditor} editor */ - createToolbar : function(){ - Roo.log('renewing'); - Roo.log("create toolbars"); + createToolbar : function() + { + //Roo.log('renewing'); + //Roo.log("create toolbars"); + if (this.toolbars === false) { + return; + } + if (this.toolbars === true) { + this.toolbars = [ 'Standard' ]; + } - this.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor: this} ) ]; - this.toolbars[0].render(this.toolbarContainer()); + var ar = Array.from(this.toolbars); + this.toolbars = []; + ar.forEach(function(t,i) { + if (typeof(t) == 'string') { + t = { + xtype : t + }; + } + if (typeof(t) == 'object' && typeof(t.xtype) == 'string') { + t.editor = this; + t.xns = t.xns || Roo.bootstrap.form.HtmlEditorToolbar; + t = Roo.factory(t); + } + this.toolbars[i] = t; + this.toolbars[i].render(this.toolbarContainer()); + }, this); - return; -// if (!editor.toolbars || !editor.toolbars.length) { -// editor.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard() ]; // can be empty? -// } -// -// for (var i =0 ; i < editor.toolbars.length;i++) { -// editor.toolbars[i] = Roo.factory( -// typeof(editor.toolbars[i]) == 'string' ? -// { xtype: editor.toolbars[i]} : editor.toolbars[i], -// Roo.bootstrap.form.HtmlEditor); -// editor.toolbars[i].init(editor); -// } }, diff --git a/Roo/bootstrap/form/HtmlEditorToolbar/Context.js b/Roo/bootstrap/form/HtmlEditorToolbar/Context.js new file mode 100644 index 0000000000..e5598052bb --- /dev/null +++ b/Roo/bootstrap/form/HtmlEditorToolbar/Context.js @@ -0,0 +1,492 @@ + +/** + * @class Roo.bootstrap.form.HtmlEditorToolbar.Context + * @parent Roo.bootstrap.form.HtmlEditor + * @extends Roo.bootstrap.nav.Simplebar + * Basic Toolbar + * + * @example + * Usage: + * + new Roo.bootstrap.form.HtmlEditor({ + .... + toolbars : [ + { + xtyle: 'Standard', + disable : { fonts: 1 , format: 1, ..., ... , ...], + btns : [ .... ] + }, + { + xtyle : 'Context', + .... + } + } + + * + * + */ + +Roo.bootstrap.form.HtmlEditorToolbar.Context = function(config) +{ + + Roo.apply(this, config); + + + Roo.bootstrap.form.HtmlEditorToolbar.Context.superclass.constructor.call(this, config); + + this.editor = config.editor; + this.editorcore = config.editor.editorcore; + + this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.cmd; }); + +} + +Roo.bootstrap.form.HtmlEditorToolbar.Context.types = { + 'IMG' : [ + { + name : 'width', + title: "Width", + width: 40 + }, + { + name : 'height', + title: "Height", + width: 40 + }, + { + name : 'align', + title: "Align", + opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]], + width : 80 + + }, + { + name : 'border', + title: "Border", + width: 40 + }, + { + name : 'alt', + title: "Alt", + width: 120 + }, + { + name : 'src', + title: "Src", + width: 220 + } + + ], + + /* + 'A' : [ + { + name : 'name', + title: "Name", + width: 50 + }, + { + name : 'target', + title: "Target", + width: 120 + }, + { + name : 'href', + title: "Href", + width: 220 + } // border? + + ], + */ + /* + 'INPUT' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'value', + title: "Value", + width: 120 + }, + { + name : 'width', + title: "Width", + width: 40 + } + ], + 'LABEL' : [ + { + name : 'for', + title: "For", + width: 120 + } + ], + 'TEXTAREA' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'rows', + title: "Rows", + width: 20 + }, + { + name : 'cols', + title: "Cols", + width: 20 + } + ], + 'SELECT' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'selectoptions', + title: "Options", + width: 200 + } + ], + + // should we really allow this?? + // should this just be + 'BODY' : [ + + { + name : 'title', + title: "Title", + width: 200, + disabled : true + } + ], + */ + '*' : [ + // empty. + ] + +}; + +Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Context, Roo.bootstrap.nav.Simplebar, { + + editor : false, + editorcore : false, + buttons : false, + + button_groups : false, // subtoolbars... - buttson? + active_group : false, + + selectedNode : false, + + onRender : function(ct, position) + { + // Roo.log("Call onRender: " + this.xtype); + + this.constructor.superclass.onRender.call(this, ct, position); + + + + + + // disable everything... + var ty = this.constructor.types; + this.button_groups = {}; + // block toolbars are built in updateToolbar when needed. + for (var i in ty) { + this.button_groups[i] = this.buildToolbarGroup(ty[i],i); + } + this.buildToolbarDelete(); + this.hide(); + // the all the btns; + this.editor.on('editorevent', this.updateToolbar, this); + + }, + onFirstFocus: function() { + + }, + + + buildToolbarGroup: function(tlist, key ) + { + var editor = this.editor; + var editorcore = this.editorcore; + var tb = this; + + var ret = []; + + for (var i = 0; i < tlist.length; i++) { + + // newer versions will use xtype cfg to create menus. + if (typeof(tlist[i].xtype) != 'undefined') { + tb[typeof(tlist[i].name)== 'undefined' ? 'add' : 'addField'](Roo.factory(tlist[i])); + continue; + } + + var item = tlist[i]; + ret.push( + this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-context-label-' + key + '-' + item.name, + html : item.title + }) + ); + + // add a text entry!? + ret.push( + this.addxtypeChild({ + xtype : 'Input', + xns : Roo.bootstrap.form, + cls : 'roo-htmleditor-context-entry-' + key + '-' + item.name, + name: '-roo-edit-' + item.name, + attrname : item.name, + width: item.width, + //allowBlank:true, + value: '', + listeners: { + 'change' : function(f, nv, ov) { + tb.selectedNode.setAttribute(f.attrname, nv); + editorcore.syncValue(); + } + } + }) + ); + + } + // hide them all.. + ret.forEach(function(e) { + e.hide(); + }); + ret.name = key; + + return ret; + }, + buildToolbarDelete : function() + { + + this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-fill' + }); + + this.deleteBtn = this.addxtypeChild({ + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + fa: 'trash', + listeners : { + click : this.onDelete.createDelegate(this) + } + }); + this.deleteBtn.hide(); + + }, + + + onDelete : function() + { + var range = this.editorcore.createRange(); + var selection = this.editorcore.getSelection(); + var sn = this.selectedNode; + range.setStart(sn,0); + range.setEnd(sn,0); + + + if (sn.hasAttribute('data-block')) { + var block = Roo.htmleditor.Block.factory(tb.selectedNode); + if (block) { + block.removeNode(); + selection.removeAllRanges(); + selection.addRange(range); + this.updateToolbar(null, null, null); + } + + } + if (!sn) { + return; // should not really happen.. + } + if (sn && sn.tagName == 'BODY') { + return; + } + var stn = sn.childNodes[0] || sn.nextSibling || sn.previousSibling || sn.parentNode; + + // remove and keep parents. + a = new Roo.htmleditor.FilterKeepChildren({tag : false}); + a.replaceTag(sn); + + selection.removeAllRanges(); + selection.addRange(range); + this.editorcore.fireEditorEvent(false); + + + }, + /** + * Protected method that will not generally be called directly. It triggers + * a toolbar update by reading the markup state of the current selection in the editor. + * + * Note you can force an update by calling on('editorevent', scope, false) + */ + updateToolbar: function(editor ,ev, sel) + { + var ty = this.constructor.types; + + + if (ev) { + ev.stopEvent(); // se if we can stop this looping with mutiple events. + } + + + // capture mouse up - this is handy for selecting images.. + // perhaps should go somewhere else... + if(!this.editorcore.activated){ + this.editor.onFirstFocus(); + return; + } + //Roo.log(ev ? ev.target : 'NOTARGET'); + + + // http://developer.yahoo.com/yui/docs/simple-editor.js.html + // selectNode - might want to handle IE? + + if (ev && + (ev.type == 'mouseup' || ev.type == 'click' ) && + ev.target && ev.target.tagName != 'BODY' ) { // && ev.target.tagName == 'IMG') { + // they have click on an image... + // let's see if we can change the selection... + sel = ev.target; + + + } + + // this forces an id.. + Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e) { + e.classList.remove('roo-ed-selection'); + }); + + var ans = this.editorcore.getAllAncestors(); + + + if (!sel) { + sel = ans.length ? (ans[0] ? ans[0] : ans[1]) : this.editorcore.doc.body; + sel = sel ? sel : this.editorcore.doc.body; + sel = sel.tagName.length ? sel : this.editorcore.doc.body; + + } + + var tn = sel.tagName.toUpperCase(); + var lastSel = this.selectedNode; + this.selectedNode = sel; + var left_label = tn; + + // ok see if we are editing a block? + + var db = false; + // you are not actually selecting the block. + if (sel && sel.hasAttribute('data-block')) { + db = sel; + } else if (sel && sel.closest('[data-block]')) { + + db = sel.closest('[data-block]'); + + } + + + var block = false; + if (db && this.editorcore.enableBlocks) { + block = Roo.htmleditor.Block.factory(db); + + + if (block) { + db.className = ( + db.classList.length > 0 ? db.className + ' ' : '' + ) + 'roo-ed-selection'; + + // since we removed it earlier... its not there.. + tn = 'BLOCK.' + db.getAttribute('data-block'); + + //this.editorcore.selectNode(db); + if (typeof(this.button_groups[tn]) == 'undefined') { + this.button_groups[tn] = this.buildBlockToolbar( block ); + } + this.selectedNode = db; + left_label = block.friendly_name; + + } + + + } + + + if ( this.active_group !== false && this.active_group.name == tn && lastSel == this.selectedNode && ev !== false) { + return; // no change? + } + + if (tn == 'BODY') { + this.deleteBtn.hide(); + this.hide(); + this.hideActiveGroup(); + return; + + } + + + if (this.active_group) { + this.hideActiveGroup(); + } + this.showActiveGroup(tn); + this.show(); + this.deleteBtn.show(); + + }, + hideActiveGroup : function() + { + this.hide(); + if (this.active_group === false) { + return; + } + this.active_group.forEach(function(e) { + e.hide(); + }); + this.active_group = false; + }, + showActiveGroup : function(tn) + { + + if (typeof(this.button_groups[tn]) == 'undefined') { + + return; + } + + this.active_group = this.button_groups[tn]; + + this.active_group.forEach(function(e) { + e.show(); + }); + + // update attributes + if (this.selectedNode.hasAttribute('data-block') ) { + var block = Roo.htmleditor.Block.factory(this.selectedNode); + this.active_group.forEach(function(e) { + e.setValue(this.selectedNode.getAttribute(block[e.name])); + }, this); + + return; + + } + // based on attributes... + this.active_group.forEach(function(e) { + if (typeof(e.attrname) == 'undefined') { + return; + } + e.setValue(this.selectedNode.getAttribute(e.attrname)); + }, this); + + + } + +}); \ No newline at end of file diff --git a/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js new file mode 100644 index 0000000000..7c1bf13787 --- /dev/null +++ b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js @@ -0,0 +1,488 @@ + +/** + * @class Roo.bootstrap.form.HtmlEditorToolbar.Standard + * @parent Roo.bootstrap.form.HtmlEditor + * @extends Roo.bootstrap.nav.Simplebar + * Basic Toolbar + * + * @example + * Usage: + * + new Roo.bootstrap.form.HtmlEditor({ + .... + toolbars : [ + new Roo.bootstrap.form.HtmlEditorToolbar.Standard({ + disable : { fonts: 1 , format: 1, ..., ... , ...], + btns : [ .... ] + }) + } + + * + * @cfg {Object} disable List of elements to disable.. + * @cfg {Array} btns List of additional buttons. + * + * + * NEEDS Extra CSS? + * .x-html-editor-tb .x-edit-none .x-btn-text { background: none; } + */ + +Roo.bootstrap.form.HtmlEditorToolbar.Standard = function(config) +{ + + Roo.apply(this, config); + + // default disabled, based on 'good practice'.. + this.disable = this.disable || {}; + Roo.applyIf(this.disable, { + fontSize : true, + colors : true, + specialElements : true + }); + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.constructor.call(this, config); + + this.editor = config.editor; + this.editorcore = config.editor.editorcore; + + this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.btnid; }); + + //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config); + // dont call parent... till later. +} +Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simplebar, { + + bar : true, + + editor : false, + editorcore : false, + + + formats : [ + "p" , + "h1","h2","h3","h4","h5","h6", + "pre", "code", + "abbr", "acronym", "address", "cite", "samp", "var", + 'div','span' + ], + + + deleteBtn: false, + + onRender : function(ct, position) + { + // Roo.log("Call onRender: " + this.xtype); + + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.onRender.call(this, ct, position); + Roo.log(this.el); + this.el.dom.style.marginBottom = '0'; + var _this = this; + var editorcore = this.editorcore; + var editor= this.editor; + + var children = []; + var btn = function(id, cmd , toggle, handler, html){ + + var event = toggle ? 'toggle' : 'click'; + + var a = { + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + //glyphicon : id, + btnid : id, + fa: id, + cmd : cmd, // why id || cmd + enableToggle: toggle !== false, + html : html || '', + pressed : toggle ? false : null, + listeners : {} + }; + a.listeners[toggle ? 'toggle' : 'click'] = function() { + handler ? handler.call(_this,this) :_this.onBtnClick.call(_this, cmd || id); + }; + children.push(a); + return a; + } + + // var cb_box = function... + + var style = { + xtype: 'Button', + size : 'sm', + xns: Roo.bootstrap, + fa : 'font', + //html : 'submit' + menu : { + xtype: 'Menu', + xns: Roo.bootstrap, + items: [] + } + }; + Roo.each(this.formats, function(f) { + style.menu.items.push({ + xtype :'MenuItem', + xns: Roo.bootstrap, + html : '<'+ f+' style="margin:2px">'+f +'', + tagname : f, + listeners : { + click : function() + { + editorcore.insertTag(this.tagname); + editor.focus(); + } + } + + }); + }); + children.push(style); + + btn('bold', false,true); + btn('italic', false,true); + btn('align-left', 'justifyleft',true); + btn('align-center', 'justifycenter',true); + btn('align-right' , 'justifyright',true); + btn('link', false, true, this.onLinkClick); + + + btn('image', false, true, this.onImageClick); + btn('list','insertunorderedlist',true); + btn('list-ol','insertorderedlist',true); + + btn('pencil', false,true, function(btn){ + Roo.log(this); + this.toggleSourceEdit(btn.pressed); + }); + + if (this.editor.btns.length > 0) { + for (var i = 0; i'); + editor.owner.fireEvent('editorevent', editor, false); + + }).createDelegate(this)); + reader.readAsDataURL(f); + + + }, + + + onBtnClick : function(id) + { + this.editorcore.relayCmd(id); + this.editorcore.focus(); + }, + + onLinkClick : function(btn) { + var url = this.selectedNode && this.selectedNode.tagName.toUpperCase() == 'A' ? + this.selectedNode.getAttribute('href') : ''; + + Roo.bootstrap.MessageBox.show({ + title : "Add / Edit Link URL", + msg : "Enter the URL for the link", + buttons: Roo.bootstrap.MessageBox.OKCANCEL, + minWidth: 250, + scope : this, + prompt:true, + multiline: false, + modal : true, + value : url, + fn: function(pressed, newurl) { + if (pressed != 'ok') { + this.editorcore.focus(); + return; + } + if (url != '') { + this.selectedNode.setAttribute('href', newurl); + return; + } + if(newurl && newurl .match(/http(s):\/\/.+/)) { + this.editorcore.relayCmd('createlink', newurl); + } + this.editorcore.focus(); + } + }); + }, + /** + * Protected method that will not generally be called directly. It triggers + * a toolbar update by reading the markup state of the current selection in the editor. + */ + updateToolbar: function(editor ,ev, sel){ + + if(!this.editorcore.activated){ + this.editor.onFirstFocus(); // is this neeed? + return; + } + + var btns = this.buttons; + var doc = this.editorcore.doc; + var hasToggle = false; + btns.each(function(e) { + if (e.enableToggle && e.cmd) { + hasToggle = hasToggle || (['align-left', 'align-right', 'align-center'].indexOf(e.btnid) < 0 && doc.queryCommandState(e.cmd)); + e.setActive(doc.queryCommandState(e.cmd)); + } + }, this); + + + if (ev && + (ev.type == 'mouseup' || ev.type == 'click' ) && + ev.target && ev.target.tagName != 'BODY' ) { // && ev.target.tagName == 'IMG') { + // they have click on an image... + // let's see if we can change the selection... + sel = ev.target; + + } + + var ans = this.editorcore.getAllAncestors(); + if (!sel) { + sel = ans.length ? (ans[0] ? ans[0] : ans[1]) : this.editorcore.doc.body; + sel = sel ? sel : this.editorcore.doc.body; + sel = sel.tagName.length ? sel : this.editorcore.doc.body; + + } + + var lastSel = this.selectedNode; + this.selectedNode = sel; + + // ok see if we are editing a block? + + var db = false; + // you are not actually selecting the block. + if (sel && sel.hasAttribute('data-block')) { + db = sel; + } else if (sel && sel.closest('[data-block]')) { + db = sel.closest('[data-block]'); + } + + Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e) { + e.classList.remove('roo-ed-selection'); + }); + + var block = false; + if (db && this.editorcore.enableBlocks) { + block = Roo.htmleditor.Block.factory(db); + + if (block) { + db.className = (db.classList.length > 0 ? db.className + ' ' : '') + + ' roo-ed-selection'; + sel = this.selectedNode = db; + } + } + + // highlight the 'a'.. + var tn = sel && sel.tagName.toUpperCase() || ''; + if (!block && sel && tn != 'A') { + var asel = sel.closest('A'); + if (asel) { + sel = asel; + } + } + + btns.get('link').setActive(tn == 'A' && this.selectedNode.hasAttribute('href')); + + Roo.bootstrap.menu.Manager.hideAll(); + + + + + + // handle delete button.. + if (hasToggle || (tn.length && tn == 'BODY')) { + this.deleteBtn.hide(); + return; + + } + this.deleteBtn.show(); + + + + //this.editorsyncValue(); + }, + onFirstFocus: function() { + this.buttons.each(function(item){ + item.enable(); + }); + }, + + onDelete : function() + { + var range = this.editorcore.createRange(); + var selection = this.editorcore.getSelection(); + var sn = this.selectedNode; + range.setStart(sn,0); + range.setEnd(sn,0); + + + if (sn.hasAttribute('data-block')) { + var block = Roo.htmleditor.Block.factory(this.selectedNode); + if (block) { + sn = block.removeNode(); + sn.parentNode.removeChild(sn); + selection.removeAllRanges(); + selection.addRange(range); + this.updateToolbar(null, null, null); + this.editorcore.fireEditorEvent(false); + return; + } + + } + if (!sn) { + return; // should not really happen.. + } + if (sn && sn.tagName == 'BODY') { + return; + } + var stn = sn.childNodes[0] || sn.nextSibling || sn.previousSibling || sn.parentNode; + + // remove and keep parents. + a = new Roo.htmleditor.FilterKeepChildren({tag : false}); + a.replaceTag(sn); + + selection.removeAllRanges(); + selection.addRange(range); + this.editorcore.fireEditorEvent(false); + + + }, + + + toggleSourceEdit : function(sourceEditMode){ + + + if(sourceEditMode){ + Roo.log("disabling buttons"); + this.buttons.each( function(item){ + if(item.cmd != 'pencil'){ + item.disable(); + } + }); + + }else{ + Roo.log("enabling buttons"); + if(this.editorcore.initialized){ + this.buttons.each( function(item){ + item.enable(); + }); + } + + } + Roo.log("calling toggole on editor"); + // tell the editor that it's been pressed.. + this.editor.toggleSourceEdit(sourceEditMode); + + } +}); + + + + diff --git a/Roo/bootstrap/form/HtmlEditorToolbar/namespace.js b/Roo/bootstrap/form/HtmlEditorToolbar/namespace.js new file mode 100644 index 0000000000..a0c27d874a --- /dev/null +++ b/Roo/bootstrap/form/HtmlEditorToolbar/namespace.js @@ -0,0 +1 @@ +Roo.namespace('Roo.bootstrap.form.HtmlEditorToolbar'); diff --git a/Roo/bootstrap/form/HtmlEditorToolbarStandard.js b/Roo/bootstrap/form/HtmlEditorToolbarStandard.js deleted file mode 100644 index 5d72017362..0000000000 --- a/Roo/bootstrap/form/HtmlEditorToolbarStandard.js +++ /dev/null @@ -1,290 +0,0 @@ - -Roo.namespace('Roo.bootstrap.form.HtmlEditor'); -/** - * @class Roo.bootstrap.form.HtmlEditorToolbarStandard - * @parent Roo.bootstrap.form.HtmlEditor - * @extends Roo.bootstrap.nav.Simplebar - * Basic Toolbar - * - * @example - * Usage: - * - new Roo.bootstrap.form.HtmlEditor({ - .... - toolbars : [ - new Roo.bootstrap.form.HtmlEditorToolbarStandard({ - disable : { fonts: 1 , format: 1, ..., ... , ...], - btns : [ .... ] - }) - } - - * - * @cfg {Object} disable List of elements to disable.. - * @cfg {Array} btns List of additional buttons. - * - * - * NEEDS Extra CSS? - * .x-html-editor-tb .x-edit-none .x-btn-text { background: none; } - */ - -Roo.bootstrap.form.HtmlEditorToolbarStandard = function(config) -{ - - Roo.apply(this, config); - - // default disabled, based on 'good practice'.. - this.disable = this.disable || {}; - Roo.applyIf(this.disable, { - fontSize : true, - colors : true, - specialElements : true - }); - Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.constructor.call(this, config); - - this.editor = config.editor; - this.editorcore = config.editor.editorcore; - - this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.cmd; }); - - //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config); - // dont call parent... till later. -} -Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simplebar, { - - bar : true, - - editor : false, - editorcore : false, - - - formats : [ - "p" , - "h1","h2","h3","h4","h5","h6", - "pre", "code", - "abbr", "acronym", "address", "cite", "samp", "var", - 'div','span' - ], - - onRender : function(ct, position) - { - // Roo.log("Call onRender: " + this.xtype); - - Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.onRender.call(this, ct, position); - Roo.log(this.el); - this.el.dom.style.marginBottom = '0'; - var _this = this; - var editorcore = this.editorcore; - var editor= this.editor; - - var children = []; - var btn = function(id,cmd , toggle, handler, html){ - - var event = toggle ? 'toggle' : 'click'; - - var a = { - size : 'sm', - xtype: 'Button', - xns: Roo.bootstrap, - //glyphicon : id, - fa: id, - cmd : id || cmd, - enableToggle:toggle !== false, - html : html || '', - pressed : toggle ? false : null, - listeners : {} - }; - a.listeners[toggle ? 'toggle' : 'click'] = function() { - handler ? handler.call(_this,this) :_this.onBtnClick.call(_this, cmd || id); - }; - children.push(a); - return a; - } - - // var cb_box = function... - - var style = { - xtype: 'Button', - size : 'sm', - xns: Roo.bootstrap, - fa : 'font', - //html : 'submit' - menu : { - xtype: 'Menu', - xns: Roo.bootstrap, - items: [] - } - }; - Roo.each(this.formats, function(f) { - style.menu.items.push({ - xtype :'MenuItem', - xns: Roo.bootstrap, - html : '<'+ f+' style="margin:2px">'+f +'', - tagname : f, - listeners : { - click : function() - { - editorcore.insertTag(this.tagname); - editor.focus(); - } - } - - }); - }); - children.push(style); - - btn('bold',false,true); - btn('italic',false,true); - btn('align-left', 'justifyleft',true); - btn('align-center', 'justifycenter',true); - btn('align-right' , 'justifyright',true); - btn('link', false, false, function(btn) { - //Roo.log("create link?"); - var url = prompt(this.createLinkText, this.defaultLinkValue); - if(url && url != 'http:/'+'/'){ - this.editorcore.relayCmd('createlink', url); - } - }), - btn('list','insertunorderedlist',true); - btn('list-ol','insertorderedlist',true); - - btn('pencil', false,true, function(btn){ - Roo.log(this); - this.toggleSourceEdit(btn.pressed); - }); - - if (this.editor.btns.length > 0) { - for (var i = 0; iall added captures from the Observable.", + "sig" : "(o)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to release", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "removeListener", + "type" : "function", + "desc" : "Removes a listener", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "render", + "type" : "function", + "desc" : "If this is a lazy rendering component, render it to its container element.", + "sig" : "(container)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "container", + "type" : "String/HTMLElement/Element", + "desc" : "(optional) The element this component should be rendered into. If it is being applied to existing markup, this should be left off.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "reset", + "type" : "function", + "desc" : "Resets the current field value to the originally loaded value and clears any validation messages", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.form.Input", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setDisabled", + "type" : "function", + "desc" : "Convenience function for setting disabled/enabled by boolean.", + "sig" : "(disabled)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "disabled", + "type" : "Boolean", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "setRawValue", + "type" : "function", + "desc" : "Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see {@link #setValue}.", + "sig" : "(value)", + "static" : false, + "memberOf" : "Roo.bootstrap.form.Input", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "value", + "type" : "Mixed", + "desc" : "The value to set", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "setValue", + "type" : "function", + "desc" : "Sets a data value into the field and validates it. To set the value directly without validation see {@link #setRawValue}.", + "sig" : "(value)", + "static" : false, + "memberOf" : "Roo.bootstrap.form.Input", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "value", + "type" : "Mixed", + "desc" : "The value to set", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "setVisibilityEl", + "type" : "function", + "desc" : "Set the element that will be used to show or hide", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setVisible", + "type" : "function", + "desc" : "Convenience function to hide or show this component by boolean.", + "sig" : "(visible)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "visible", + "type" : "Boolean", + "desc" : "True to show, false to hide", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Show a component - removes 'hidden' class", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "toggleSourceEdit", + "type" : "function", + "desc" : "Toggles the editor between standard and source edit mode.", + "sig" : "(sourceEdit)", + "static" : false, + "memberOf" : "", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "sourceEdit", + "type" : "Boolean", + "desc" : "(optional) True for source edit, false for standard", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "tooltipEl", + "type" : "function", + "desc" : "Fetch the element to display the tooltip on.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "un", + "type" : "function", + "desc" : "Removes a listener (shorthand for removeListener)", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "validate", + "type" : "function", + "desc" : "Validates the field value", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.form.Input", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the value is valid, else false" + } + ] + }, + { + "name" : "validateValue", + "type" : "function", + "desc" : "Validates a value according to the field's validation rules and marks the field as invalid\nif the validation fails", + "sig" : "(value)", + "static" : false, + "memberOf" : "Roo.bootstrap.form.Input", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "value", + "type" : "Mixed", + "desc" : "The value to validate", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the value is valid, else false" + } + ] + } + ], + "isAbstract" : false, + "isBuilderTop" : false, + "implementations" : [], + "tree_children" : [], + "tree_parent" : [] + }, + "Roo.bootstrap.form.HtmlEditorToolbar" : { + "props" : [], + "events" : [], + "methods" : [], + "isAbstract" : false, + "isBuilderTop" : false, + "implementations" : [], + "tree_children" : [], + "tree_parent" : [] + }, + "Roo.bootstrap.form.HtmlEditorToolbar.Context" : { + "props" : [ + { + "name" : "actionMode", + "type" : "String", + "desc" : "which property holds the element that used for hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "align", + "type" : "String", + "desc" : "t) alignme", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "left", + "right" + ] + }, + { + "name" : "allowDomMove", + "type" : "Boolean", + "desc" : "Whether the component can move the Dom node when rendering (defaults to true).", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "arrangement", + "type" : "Boolean", + "desc" : "stacked | justified", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "can_build_overlaid", + "type" : "Boolean", + "desc" : "True if element can be rebuild from a HTML page", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "cls", + "type" : "String", + "desc" : "css class", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "container_method", + "type" : "string", + "desc" : "method to fetch parents container element (used by NavHeaderbar - getHeaderChildContainer)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "dataId", + "type" : "string", + "desc" : "cutomer id", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "disableClass", + "type" : "String", + "desc" : "CSS class added to the component when it is disabled (defaults to \"x-item-disabled\").", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "hideMode", + "type" : "String", + "desc" : "y)\nHow this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [ + "display", + "visibility" + ] + }, + { + "name" : "inverse", + "type" : "Boolean", + "desc" : "is inverted color", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "loadMask", + "type" : "Boolean", + "desc" : "e) loadMask on the b", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "main", + "type" : "Boolean", + "desc" : "e) main nav bar? default fal", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "name", + "type" : "string", + "desc" : "Specifies name attribute", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "style", + "type" : "String", + "desc" : "any extra css", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "tag", + "type" : "String", + "desc" : "v) default is n", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "header", + "footer", + "nav", + "div" + ] + }, + { + "name" : "tooltip", + "type" : "string", + "desc" : "Text for the tooltip", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "type", + "type" : "String", + "desc" : "", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "nav", + "pills", + "tabs" + ] + }, + { + "name" : "visibilityEl", + "type" : "string|object", + "desc" : "t) What element to use for visibility (@see getVisibilityEl(", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [ + "el", + "parent" + ] + }, + { + "name" : "weight", + "type" : "String", + "desc" : "e) default is ligh", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "light", + "primary", + "secondary", + "success", + "danger", + "warning", + "info", + "dark", + "white" + ] + }, + { + "name" : "xattr", + "type" : "Object", + "desc" : "extra attributes to add to 'element' (used by builder to store stuff.)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + } + ], + "events" : [ + { + "name" : "beforedestroy", + "type" : "function", + "desc" : "Fires before the component is destroyed. Return false to stop the destroy.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforehide", + "type" : "function", + "desc" : "Fires before the component is hidden. Return false to stop the hide.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforerender", + "type" : "function", + "desc" : "Fires before the component is rendered. Return false to stop the render.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforeshow", + "type" : "function", + "desc" : "Fires before the component is shown. Return false to stop the show.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforetoggle", + "type" : "function", + "desc" : "Fire before toggle the menu", + "sig" : "function (e)\n{\n\n}", + "memberOf" : "Roo.bootstrap.nav.Bar", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "e", + "type" : "Roo.EventObject", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "childrenrendered", + "type" : "function", + "desc" : "Fires when the children have been rendered..", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.bootstrap.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.bootstrap.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Fires after the component is destroyed.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Fires after the component is disabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Fires after the component is enabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "hide", + "type" : "function", + "desc" : "Fires after the component is hidden.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "render", + "type" : "function", + "desc" : "Fires after the component is rendered.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Fires after the component is shown.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + } + ], + "methods" : [ + { + "name" : "addEvents", + "type" : "function", + "desc" : "Used to define events on this Observable", + "sig" : "(object)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "object", + "type" : "Object", + "desc" : "The object with the events defined", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addListener", + "type" : "function", + "desc" : "Appends an event handler to this component", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:
    \n
  • scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.
  • \n
  • delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.
  • \n
  • single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.
  • \n
  • buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is not invoked, but the new handler is scheduled in its place.
  • \n

\n

\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t

\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t
\n

\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t
\n

\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t

\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t
", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "capture", + "type" : "function", + "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.", + "sig" : "(o, fn, scope)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to capture", + "isOptional" : false + }, + { + "name" : "fn", + "type" : "Function", + "desc" : "The function to call", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the fn", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "collapse", + "type" : "function", + "desc" : "Collapse the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Destroys this component by purging any event listeners, removing the component's element from the DOM,\nremoving the component from its {@link Roo.Container} (if applicable) and unregistering it from {@link Roo.ComponentMgr}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Disable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Enable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "expand", + "type" : "function", + "desc" : "Expand the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "fireEvent", + "type" : "function", + "desc" : "Fires the specified event with the passed parameters (minus the event name).", + "sig" : "(eventName, args)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "", + "isOptional" : false + }, + { + "name" : "args", + "type" : "Object...", + "desc" : "Variable number of parameters are passed to handlers", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "returns false if any of the handlers return false otherwise it returns true" + } + ] + }, + { + "name" : "focus", + "type" : "function", + "desc" : "Try to focus this component.", + "sig" : "(selectText)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "selectText", + "type" : "Boolean", + "desc" : "True to also select the text in this component (if applicable)", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "getChildContainer", + "type" : "function", + "desc" : "Fetch the element to add children to", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "getEl", + "type" : "function", + "desc" : "Returns the underlying {@link Roo.Element}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "The element" + } + ] + }, + { + "name" : "getId", + "type" : "function", + "desc" : "Returns the id of this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "String", + "desc" : "" + } + ] + }, { "name" : "getVisibilityEl", "type" : "function", @@ -135572,25 +137045,6 @@ "params" : [], "returns" : [] }, - { - "name" : "inputEl", - "type" : "function", - "desc" : "return the real textarea element.", - "sig" : "()\n{\n\n}", - "static" : false, - "memberOf" : "Roo.bootstrap.form.TextArea", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [], - "returns" : [] - }, { "name" : "isVisible", "type" : "function", @@ -135610,51 +137064,6 @@ "params" : [], "returns" : [] }, - { - "name" : "markInvalid", - "type" : "function", - "desc" : "Mark this field as invalid", - "sig" : "(msg)", - "static" : false, - "memberOf" : "Roo.bootstrap.form.TextArea", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [ - { - "name" : "msg", - "type" : "String", - "desc" : "The validation message", - "isOptional" : false - } - ], - "returns" : [] - }, - { - "name" : "markValid", - "type" : "function", - "desc" : "Mark this field as valid", - "sig" : "()\n{\n\n}", - "static" : false, - "memberOf" : "Roo.bootstrap.form.TextArea", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [], - "returns" : [] - }, { "name" : "on", "type" : "function", @@ -135808,25 +137217,6 @@ ], "returns" : [] }, - { - "name" : "reset", - "type" : "function", - "desc" : "Resets the current field value to the originally loaded value and clears any validation messages", - "sig" : "()\n{\n\n}", - "static" : false, - "memberOf" : "Roo.bootstrap.form.Input", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [], - "returns" : [] - }, { "name" : "setDisabled", "type" : "function", @@ -135853,58 +137243,6 @@ ], "returns" : [] }, - { - "name" : "setRawValue", - "type" : "function", - "desc" : "Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see {@link #setValue}.", - "sig" : "(value)", - "static" : false, - "memberOf" : "Roo.bootstrap.form.Input", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [ - { - "name" : "value", - "type" : "Mixed", - "desc" : "The value to set", - "isOptional" : false - } - ], - "returns" : [] - }, - { - "name" : "setValue", - "type" : "function", - "desc" : "Sets a data value into the field and validates it. To set the value directly without validation see {@link #setRawValue}.", - "sig" : "(value)", - "static" : false, - "memberOf" : "Roo.bootstrap.form.Input", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [ - { - "name" : "value", - "type" : "Mixed", - "desc" : "The value to set", - "isOptional" : false - } - ], - "returns" : [] - }, { "name" : "setVisibilityEl", "type" : "function", @@ -135975,32 +137313,6 @@ "params" : [], "returns" : [] }, - { - "name" : "toggleSourceEdit", - "type" : "function", - "desc" : "Toggles the editor between standard and source edit mode.", - "sig" : "(sourceEdit)", - "static" : false, - "memberOf" : "", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [ - { - "name" : "sourceEdit", - "type" : "Boolean", - "desc" : "(optional) True for source edit, false for standard", - "isOptional" : false - } - ], - "returns" : [] - }, { "name" : "tooltipEl", "type" : "function", @@ -136065,12 +137377,12 @@ "returns" : [] }, { - "name" : "validate", + "name" : "updateToolbar", "type" : "function", - "desc" : "Validates the field value", + "desc" : "Protected method that will not generally be called directly. It triggers\na toolbar update by reading the markup state of the current selection in the editor.\n\nNote you can force an update by calling on('editorevent', scope, false)", "sig" : "()\n{\n\n}", "static" : false, - "memberOf" : "Roo.bootstrap.form.Input", + "memberOf" : "", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, @@ -136081,54 +137393,18 @@ "exceptions" : "", "requires" : "", "params" : [], - "returns" : [ - { - "name" : "", - "type" : "Boolean", - "desc" : "True if the value is valid, else false" - } - ] - }, - { - "name" : "validateValue", - "type" : "function", - "desc" : "Validates a value according to the field's validation rules and marks the field as invalid\nif the validation fails", - "sig" : "(value)", - "static" : false, - "memberOf" : "Roo.bootstrap.form.Input", - "isStatic" : false, - "isConstructor" : false, - "isPrivate" : false, - "example" : "", - "deprecated" : "", - "since" : "", - "see" : "", - "exceptions" : "", - "requires" : "", - "params" : [ - { - "name" : "value", - "type" : "Mixed", - "desc" : "The value to validate", - "isOptional" : false - } - ], - "returns" : [ - { - "name" : "", - "type" : "Boolean", - "desc" : "True if the value is valid, else false" - } - ] + "returns" : [] } ], "isAbstract" : false, "isBuilderTop" : false, "implementations" : [], "tree_children" : [], - "tree_parent" : [] + "tree_parent" : [ + "Roo.bootstrap.form.HtmlEditor" + ] }, - "Roo.bootstrap.form.HtmlEditorToolbarStandard" : { + "Roo.bootstrap.form.HtmlEditorToolbar.Standard" : { "props" : [ { "name" : "actionMode", @@ -173550,7 +174826,8 @@ "implementations" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar", "Roo.bootstrap.nav.Sidebar", "Roo.bootstrap.nav.Simplebar" @@ -183650,7 +184927,8 @@ "implementations" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ], "tree_children" : [ @@ -189779,10 +191057,13 @@ { "name" : "method", "type" : "String", - "desc" : "The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)", + "desc" : "T) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GE", "memberOf" : "", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "GET", + "POST" + ] }, { "name" : "timeout", @@ -190731,7 +192012,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "Roo.data.Store", "example" : "", "deprecated" : "", @@ -190745,15 +192026,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { @@ -194472,7 +195753,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "Roo.data.Store", "example" : "", "deprecated" : "", @@ -194486,15 +195767,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { @@ -196294,7 +197575,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "", "example" : "", "deprecated" : "", @@ -196308,15 +197589,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { @@ -275449,6 +276730,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, { "name" : "listeners", "type" : "Object", @@ -279679,6 +280968,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, { "name" : "listeners", "type" : "Object", @@ -281506,6 +282803,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "listeners", "type" : "Object", @@ -285270,6 +286575,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, { "name" : "listeners", "type" : "Object", @@ -319567,7 +320880,8 @@ "Roo.bootstrap.form.FieldLabel", "Roo.bootstrap.form.Form", "Roo.bootstrap.form.HtmlEditor", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.form.Input", "Roo.bootstrap.form.Markdown", "Roo.bootstrap.form.MoneyField", diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index 44607c95b1..cfce2cea93 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -803,7 +803,9 @@ if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) { return; // we do not handle this.. (undo manager does..) } - // in theory this detects if the last element is not a br, then we try and do that. + // clicking a 'block'? + + // in theory this detects if the last element is not a br, then we try and do that. // its so clicking in space at bottom triggers adding a br and moving the cursor. if (e && e.target.nodeName == 'BODY' && diff --git a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html index 31bf14df95..52dbdb53cf 100644 --- a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html +++ b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html @@ -105,9 +105,9 @@ /** - * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one + * @cfg {Array|boolean} toolbars Array of toolbars, or names of toolbars. - true for standard, and false for none. */ - toolbars : false, + toolbars : true, /** * @cfg {Array} buttons Array of toolbar's buttons. - defaults to empty @@ -160,27 +160,36 @@ * add custom toolbar buttons. * @param {HtmlEditor} editor */ - createToolbar : function(){ - Roo.log('renewing'); - Roo.log("create toolbars"); - - this.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor: this} ) ]; - this.toolbars[0].render(this.toolbarContainer()); - - return; - -// if (!editor.toolbars || !editor.toolbars.length) { -// editor.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard() ]; // can be empty? -// } -// -// for (var i =0 ; i < editor.toolbars.length;i++) { -// editor.toolbars[i] = Roo.factory( -// typeof(editor.toolbars[i]) == 'string' ? -// { xtype: editor.toolbars[i]} : editor.toolbars[i], -// Roo.bootstrap.form.HtmlEditor); -// editor.toolbars[i].init(editor); -// } - }, + createToolbar : function() + { + //Roo.log('renewing'); + //Roo.log("create toolbars"); + if (this.toolbars === false) { + return; + } + if (this.toolbars === true) { + this.toolbars = [ 'Standard' ]; + } + + var ar = Array.from(this.toolbars); + this.toolbars = []; + ar.forEach(function(t,i) { + if (typeof(t) == 'string') { + t = { + xtype : t + }; + } + if (typeof(t) == 'object' && typeof(t.xtype) == 'string') { + t.editor = this; + t.xns = t.xns || Roo.bootstrap.form.HtmlEditorToolbar; + t = Roo.factory(t); + } + this.toolbars[i] = t; + this.toolbars[i].render(this.toolbarContainer()); + }, this); + + + }, // private diff --git a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Context.js.html b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Context.js.html new file mode 100644 index 0000000000..cb40213cb2 --- /dev/null +++ b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Context.js.html @@ -0,0 +1,492 @@ +Roo/bootstrap/form/HtmlEditorToolbar/Context.js +/** + * @class Roo.bootstrap.form.HtmlEditorToolbar.Context + * @parent Roo.bootstrap.form.HtmlEditor + * @extends Roo.bootstrap.nav.Simplebar + * Basic Toolbar + * + * @example + * Usage: + * + new Roo.bootstrap.form.HtmlEditor({ + .... + toolbars : [ + { + xtyle: 'Standard', + disable : { fonts: 1 , format: 1, ..., ... , ...], + btns : [ .... ] + }, + { + xtyle : 'Context', + .... + } + } + + * + * + */ + +Roo.bootstrap.form.HtmlEditorToolbar.Context = function(config) +{ + + Roo.apply(this, config); + + + Roo.bootstrap.form.HtmlEditorToolbar.Context.superclass.constructor.call(this, config); + + this.editor = config.editor; + this.editorcore = config.editor.editorcore; + + this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.cmd; }); + +} + +Roo.bootstrap.form.HtmlEditorToolbar.Context.types = { + 'IMG' : [ + { + name : 'width', + title: "Width", + width: 40 + }, + { + name : 'height', + title: "Height", + width: 40 + }, + { + name : 'align', + title: "Align", + opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]], + width : 80 + + }, + { + name : 'border', + title: "Border", + width: 40 + }, + { + name : 'alt', + title: "Alt", + width: 120 + }, + { + name : 'src', + title: "Src", + width: 220 + } + + ], + + /* + 'A' : [ + { + name : 'name', + title: "Name", + width: 50 + }, + { + name : 'target', + title: "Target", + width: 120 + }, + { + name : 'href', + title: "Href", + width: 220 + } // border? + + ], + */ + /* + 'INPUT' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'value', + title: "Value", + width: 120 + }, + { + name : 'width', + title: "Width", + width: 40 + } + ], + 'LABEL' : [ + { + name : 'for', + title: "For", + width: 120 + } + ], + 'TEXTAREA' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'rows', + title: "Rows", + width: 20 + }, + { + name : 'cols', + title: "Cols", + width: 20 + } + ], + 'SELECT' : [ + { + name : 'name', + title: "name", + width: 120 + }, + { + name : 'selectoptions', + title: "Options", + width: 200 + } + ], + + // should we really allow this?? + // should this just be + 'BODY' : [ + + { + name : 'title', + title: "Title", + width: 200, + disabled : true + } + ], + */ + '*' : [ + // empty. + ] + +}; + +Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Context, Roo.bootstrap.nav.Simplebar, { + + editor : false, + editorcore : false, + buttons : false, + + button_groups : false, // subtoolbars... - buttson? + active_group : false, + + selectedNode : false, + + onRender : function(ct, position) + { + // Roo.log("Call onRender: " + this.xtype); + + this.constructor.superclass.onRender.call(this, ct, position); + + + + + + // disable everything... + var ty = this.constructor.types; + this.button_groups = {}; + // block toolbars are built in updateToolbar when needed. + for (var i in ty) { + this.button_groups[i] = this.buildToolbarGroup(ty[i],i); + } + this.buildToolbarDelete(); + this.hide(); + // the all the btns; + this.editor.on('editorevent', this.updateToolbar, this); + + }, + onFirstFocus: function() { + + }, + + + buildToolbarGroup: function(tlist, key ) + { + var editor = this.editor; + var editorcore = this.editorcore; + var tb = this; + + var ret = []; + + for (var i = 0; i < tlist.length; i++) { + + // newer versions will use xtype cfg to create menus. + if (typeof(tlist[i].xtype) != 'undefined') { + tb[typeof(tlist[i].name)== 'undefined' ? 'add' : 'addField'](Roo.factory(tlist[i])); + continue; + } + + var item = tlist[i]; + ret.push( + this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-context-label-' + key + '-' + item.name, + html : item.title + }) + ); + + // add a text entry!? + ret.push( + this.addxtypeChild({ + xtype : 'Input', + xns : Roo.bootstrap.form, + cls : 'roo-htmleditor-context-entry-' + key + '-' + item.name, + name: '-roo-edit-' + item.name, + attrname : item.name, + width: item.width, + //allowBlank:true, + value: '', + listeners: { + 'change' : function(f, nv, ov) { + tb.selectedNode.setAttribute(f.attrname, nv); + editorcore.syncValue(); + } + } + }) + ); + + } + // hide them all.. + ret.forEach(function(e) { + e.hide(); + }); + ret.name = key; + + return ret; + }, + buildToolbarDelete : function() + { + + this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-fill' + }); + + this.deleteBtn = this.addxtypeChild({ + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + fa: 'trash', + listeners : { + click : this.onDelete.createDelegate(this) + } + }); + this.deleteBtn.hide(); + + }, + + + onDelete : function() + { + var range = this.editorcore.createRange(); + var selection = this.editorcore.getSelection(); + var sn = this.selectedNode; + range.setStart(sn,0); + range.setEnd(sn,0); + + + if (sn.hasAttribute('data-block')) { + var block = Roo.htmleditor.Block.factory(tb.selectedNode); + if (block) { + block.removeNode(); + selection.removeAllRanges(); + selection.addRange(range); + this.updateToolbar(null, null, null); + } + + } + if (!sn) { + return; // should not really happen.. + } + if (sn && sn.tagName == 'BODY') { + return; + } + var stn = sn.childNodes[0] || sn.nextSibling || sn.previousSibling || sn.parentNode; + + // remove and keep parents. + a = new Roo.htmleditor.FilterKeepChildren({tag : false}); + a.replaceTag(sn); + + selection.removeAllRanges(); + selection.addRange(range); + this.editorcore.fireEditorEvent(false); + + + }, + /** + * Protected method that will not generally be called directly. It triggers + * a toolbar update by reading the markup state of the current selection in the editor. + * + * Note you can force an update by calling on('editorevent', scope, false) + */ + updateToolbar: function(editor ,ev, sel) + { + var ty = this.constructor.types; + + + if (ev) { + ev.stopEvent(); // se if we can stop this looping with mutiple events. + } + + + // capture mouse up - this is handy for selecting images.. + // perhaps should go somewhere else... + if(!this.editorcore.activated){ + this.editor.onFirstFocus(); + return; + } + //Roo.log(ev ? ev.target : 'NOTARGET'); + + + // http://developer.yahoo.com/yui/docs/simple-editor.js.html + // selectNode - might want to handle IE? + + if (ev && + (ev.type == 'mouseup' || ev.type == 'click' ) && + ev.target && ev.target.tagName != 'BODY' ) { // && ev.target.tagName == 'IMG') { + // they have click on an image... + // let's see if we can change the selection... + sel = ev.target; + + + } + + // this forces an id.. + Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e) { + e.classList.remove('roo-ed-selection'); + }); + + var ans = this.editorcore.getAllAncestors(); + + + if (!sel) { + sel = ans.length ? (ans[0] ? ans[0] : ans[1]) : this.editorcore.doc.body; + sel = sel ? sel : this.editorcore.doc.body; + sel = sel.tagName.length ? sel : this.editorcore.doc.body; + + } + + var tn = sel.tagName.toUpperCase(); + var lastSel = this.selectedNode; + this.selectedNode = sel; + var left_label = tn; + + // ok see if we are editing a block? + + var db = false; + // you are not actually selecting the block. + if (sel && sel.hasAttribute('data-block')) { + db = sel; + } else if (sel && sel.closest('[data-block]')) { + + db = sel.closest('[data-block]'); + + } + + + var block = false; + if (db && this.editorcore.enableBlocks) { + block = Roo.htmleditor.Block.factory(db); + + + if (block) { + db.className = ( + db.classList.length > 0 ? db.className + ' ' : '' + ) + 'roo-ed-selection'; + + // since we removed it earlier... its not there.. + tn = 'BLOCK.' + db.getAttribute('data-block'); + + //this.editorcore.selectNode(db); + if (typeof(this.button_groups[tn]) == 'undefined') { + this.button_groups[tn] = this.buildBlockToolbar( block ); + } + this.selectedNode = db; + left_label = block.friendly_name; + + } + + + } + + + if ( this.active_group !== false && this.active_group.name == tn && lastSel == this.selectedNode && ev !== false) { + return; // no change? + } + + if (tn == 'BODY') { + this.deleteBtn.hide(); + this.hide(); + this.hideActiveGroup(); + return; + + } + + + if (this.active_group) { + this.hideActiveGroup(); + } + this.showActiveGroup(tn); + this.show(); + this.deleteBtn.show(); + + }, + hideActiveGroup : function() + { + this.hide(); + if (this.active_group === false) { + return; + } + this.active_group.forEach(function(e) { + e.hide(); + }); + this.active_group = false; + }, + showActiveGroup : function(tn) + { + + if (typeof(this.button_groups[tn]) == 'undefined') { + + return; + } + + this.active_group = this.button_groups[tn]; + + this.active_group.forEach(function(e) { + e.show(); + }); + + // update attributes + if (this.selectedNode.hasAttribute('data-block') ) { + var block = Roo.htmleditor.Block.factory(this.selectedNode); + this.active_group.forEach(function(e) { + e.setValue(this.selectedNode.getAttribute(block[e.name])); + }, this); + + return; + + } + // based on attributes... + this.active_group.forEach(function(e) { + if (typeof(e.attrname) == 'undefined') { + return; + } + e.setValue(this.selectedNode.getAttribute(e.attrname)); + }, this); + + + } + +}); \ No newline at end of file diff --git a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html new file mode 100644 index 0000000000..13316b80a2 --- /dev/null +++ b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html @@ -0,0 +1,489 @@ +Roo/bootstrap/form/HtmlEditorToolbar/Standard.js +/** + * @class Roo.bootstrap.form.HtmlEditorToolbar.Standard + * @parent Roo.bootstrap.form.HtmlEditor + * @extends Roo.bootstrap.nav.Simplebar + * Basic Toolbar + * + * @example + * Usage: + * + new Roo.bootstrap.form.HtmlEditor({ + .... + toolbars : [ + new Roo.bootstrap.form.HtmlEditorToolbar.Standard({ + disable : { fonts: 1 , format: 1, ..., ... , ...], + btns : [ .... ] + }) + } + + * + * @cfg {Object} disable List of elements to disable.. + * @cfg {Array} btns List of additional buttons. + * + * + * NEEDS Extra CSS? + * .x-html-editor-tb .x-edit-none .x-btn-text { background: none; } + */ + +Roo.bootstrap.form.HtmlEditorToolbar.Standard = function(config) +{ + + Roo.apply(this, config); + + // default disabled, based on 'good practice'.. + this.disable = this.disable || {}; + Roo.applyIf(this.disable, { + fontSize : true, + colors : true, + specialElements : true + }); + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.constructor.call(this, config); + + this.editor = config.editor; + this.editorcore = config.editor.editorcore; + + this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.btnid; }); + + //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config); + // dont call parent... till later. +} +Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simplebar, { + + bar : true, + + editor : false, + editorcore : false, + + + formats : [ + "p" , + "h1","h2","h3","h4","h5","h6", + "pre", "code", + "abbr", "acronym", "address", "cite", "samp", "var", + 'div','span' + ], + + + deleteBtn: false, + + onRender : function(ct, position) + { + // Roo.log("Call onRender: " + this.xtype); + + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.onRender.call(this, ct, position); + Roo.log(this.el); + this.el.dom.style.marginBottom = '0'; + var _this = this; + var editorcore = this.editorcore; + var editor= this.editor; + + var children = []; + var btn = function(id, cmd , toggle, handler, html){ + + var event = toggle ? 'toggle' : 'click'; + + var a = { + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + //glyphicon : id, + btnid : id, + fa: id, + cmd : cmd, // why id || cmd + enableToggle: toggle !== false, + html : html || '', + pressed : toggle ? false : null, + listeners : {} + }; + a.listeners[toggle ? 'toggle' : 'click'] = function() { + handler ? handler.call(_this,this) :_this.onBtnClick.call(_this, cmd || id); + }; + children.push(a); + return a; + } + + // var cb_box = function... + + var style = { + xtype: 'Button', + size : 'sm', + xns: Roo.bootstrap, + fa : 'font', + //html : 'submit' + menu : { + xtype: 'Menu', + xns: Roo.bootstrap, + items: [] + } + }; + Roo.each(this.formats, function(f) { + style.menu.items.push({ + xtype :'MenuItem', + xns: Roo.bootstrap, + html : '<'+ f+' style="margin:2px">'+f +'</'+ f+'>', + tagname : f, + listeners : { + click : function() + { + editorcore.insertTag(this.tagname); + editor.focus(); + } + } + + }); + }); + children.push(style); + + btn('bold', false,true); + btn('italic', false,true); + btn('align-left', 'justifyleft',true); + btn('align-center', 'justifycenter',true); + btn('align-right' , 'justifyright',true); + btn('link', false, true, this.onLinkClick); + + + btn('image', false, true, this.onImageClick); + btn('list','insertunorderedlist',true); + btn('list-ol','insertorderedlist',true); + + btn('pencil', false,true, function(btn){ + Roo.log(this); + this.toggleSourceEdit(btn.pressed); + }); + + if (this.editor.btns.length > 0) { + for (var i = 0; i<this.editor.btns.length; i++) { + children.push(this.editor.btns[i]); + } + } + + + + this.xtype = 'NavSimplebar'; // why? + + for(var i=0;i< children.length;i++) { + + this.buttons.add(this.addxtypeChild(children[i])); + + } + this.buildToolbarDelete(); + + editor.on('editorevent', this.updateToolbar, this); + }, + + buildToolbarDelete : function() + { + + /* this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-fill' + }); + */ + this.deleteBtn = this.addxtypeChild({ + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + fa: 'trash', + listeners : { + click : this.onDelete.createDelegate(this) + } + }); + this.deleteBtn.hide(); + + }, + + onImageClick : function() + { + if (this.input) { + this.input.un('change', this.onFileSelected, this); + } + this.input = Roo.get(document.body).createChild({ + tag: 'input', + type : 'file', + style : 'display:none', + multiple: 'multiple' + }); + this.input.on('change', this.onFileSelected, this); + this.input.dom.click(); + }, + + onFileSelected : function(e) + { + e.preventDefault(); + + if(typeof(this.input.dom.files) == 'undefined' || !this.input.dom.files.length){ + return; + } + + + this.addFiles(Array.prototype.slice.call(this.input.dom.files)); + }, + + addFiles : function(far) { + + if (!far.length) { + return; + } + + var f = far.pop(); + + if (!f.type.match(/^image/)) { + this.addFiles(far); + return; + } + + var sn = this.selectedNode; + + var bl = sn && this.editorcore.enableBlocks ? Roo.htmleditor.Block.factory(sn) : false; + + var editor = this.editorcore; + + var reader = new FileReader(); + reader.addEventListener('load', (function() { + if (bl) { + bl.image_src = reader.result; + //bl.caption = f.name; + bl.updateElement(sn); + editor.owner.fireEvent('editorevent', editor, false); + // we only do the first file!! and replace. + return; + } + if (this.editorcore.enableBlocks) { + var fig = new Roo.htmleditor.BlockFigure({ + image_src : reader.result, + caption : '', + caption_display : 'none' //default to hide captions.. + }); + editor.insertAtCursor(fig.toHTML()); + editor.owner.fireEvent('editorevent', editor, false); + return; + } + // just a standard img.. + if (sn && sn.tagName.toUpperCase() == 'IMG') { + sn.src = reader.result; + editor.owner.fireEvent('editorevent', editor, false); + return; + } + editor.insertAtCursor('<img src="' + reader.result +'">'); + editor.owner.fireEvent('editorevent', editor, false); + + }).createDelegate(this)); + reader.readAsDataURL(f); + + + }, + + + onBtnClick : function(id) + { + this.editorcore.relayCmd(id); + this.editorcore.focus(); + }, + + onLinkClick : function(btn) { + var url = this.selectedNode && this.selectedNode.tagName.toUpperCase() == 'A' ? + this.selectedNode.getAttribute('href') : ''; + + Roo.bootstrap.MessageBox.show({ + title : "Add / Edit Link URL", + msg : "Enter the URL for the link", + buttons: Roo.bootstrap.MessageBox.OKCANCEL, + minWidth: 250, + scope : this, + prompt:true, + multiline: false, + modal : true, + value : url, + fn: function(pressed, newurl) { + if (pressed != 'ok') { + this.editorcore.focus(); + return; + } + if (url != '') { + this.selectedNode.setAttribute('href', newurl); + return; + } + if(newurl && newurl .match(/http(s):\/\/.+/)) { + this.editorcore.relayCmd('createlink', newurl); + } + this.editorcore.focus(); + } + }); + }, + /** + * Protected method that will not generally be called directly. It triggers + * a toolbar update by reading the markup state of the current selection in the editor. + */ + updateToolbar: function(editor ,ev, sel){ + + if(!this.editorcore.activated){ + this.editor.onFirstFocus(); // is this neeed? + return; + } + + var btns = this.buttons; + var doc = this.editorcore.doc; + var hasToggle = false; + btns.each(function(e) { + if (e.enableToggle && e.cmd) { + hasToggle = hasToggle || (['align-left', 'align-right', 'align-center'].indexOf(e.btnid) < 0 && doc.queryCommandState(e.cmd)); + e.setActive(doc.queryCommandState(e.cmd)); + } + }, this); + + + if (ev && + (ev.type == 'mouseup' || ev.type == 'click' ) && + ev.target && ev.target.tagName != 'BODY' ) { // && ev.target.tagName == 'IMG') { + // they have click on an image... + // let's see if we can change the selection... + sel = ev.target; + + } + + var ans = this.editorcore.getAllAncestors(); + if (!sel) { + sel = ans.length ? (ans[0] ? ans[0] : ans[1]) : this.editorcore.doc.body; + sel = sel ? sel : this.editorcore.doc.body; + sel = sel.tagName.length ? sel : this.editorcore.doc.body; + + } + + var lastSel = this.selectedNode; + this.selectedNode = sel; + + // ok see if we are editing a block? + + var db = false; + // you are not actually selecting the block. + if (sel && sel.hasAttribute('data-block')) { + db = sel; + } else if (sel && sel.closest('[data-block]')) { + db = sel.closest('[data-block]'); + } + + Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e) { + e.classList.remove('roo-ed-selection'); + }); + + var block = false; + if (db && this.editorcore.enableBlocks) { + block = Roo.htmleditor.Block.factory(db); + + if (block) { + db.className = (db.classList.length > 0 ? db.className + ' ' : '') + + ' roo-ed-selection'; + sel = this.selectedNode = db; + } + } + + // highlight the 'a'.. + var tn = sel && sel.tagName.toUpperCase() || ''; + if (!block && sel && tn != 'A') { + var asel = sel.closest('A'); + if (asel) { + sel = asel; + } + } + + btns.get('link').setActive(tn == 'A' && this.selectedNode.hasAttribute('href')); + + Roo.bootstrap.menu.Manager.hideAll(); + + + + + + // handle delete button.. + if (hasToggle || (tn.length && tn == 'BODY')) { + this.deleteBtn.hide(); + return; + + } + this.deleteBtn.show(); + + + + //this.editorsyncValue(); + }, + onFirstFocus: function() { + this.buttons.each(function(item){ + item.enable(); + }); + }, + + onDelete : function() + { + var range = this.editorcore.createRange(); + var selection = this.editorcore.getSelection(); + var sn = this.selectedNode; + range.setStart(sn,0); + range.setEnd(sn,0); + + + if (sn.hasAttribute('data-block')) { + var block = Roo.htmleditor.Block.factory(this.selectedNode); + if (block) { + sn = block.removeNode(); + sn.parentNode.removeChild(sn); + selection.removeAllRanges(); + selection.addRange(range); + this.updateToolbar(null, null, null); + this.editorcore.fireEditorEvent(false); + return; + } + + } + if (!sn) { + return; // should not really happen.. + } + if (sn && sn.tagName == 'BODY') { + return; + } + var stn = sn.childNodes[0] || sn.nextSibling || sn.previousSibling || sn.parentNode; + + // remove and keep parents. + a = new Roo.htmleditor.FilterKeepChildren({tag : false}); + a.replaceTag(sn); + + selection.removeAllRanges(); + selection.addRange(range); + this.editorcore.fireEditorEvent(false); + + + }, + + + toggleSourceEdit : function(sourceEditMode){ + + + if(sourceEditMode){ + Roo.log("disabling buttons"); + this.buttons.each( function(item){ + if(item.cmd != 'pencil'){ + item.disable(); + } + }); + + }else{ + Roo.log("enabling buttons"); + if(this.editorcore.initialized){ + this.buttons.each( function(item){ + item.enable(); + }); + } + + } + Roo.log("calling toggole on editor"); + // tell the editor that it's been pressed.. + this.editor.toggleSourceEdit(sourceEditMode); + + } +}); + + + + + \ No newline at end of file diff --git a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_namespace.js.html b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_namespace.js.html new file mode 100644 index 0000000000..810137b1f2 --- /dev/null +++ b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_namespace.js.html @@ -0,0 +1,2 @@ +Roo/bootstrap/form/HtmlEditorToolbar/namespace.jsRoo.namespace('Roo.bootstrap.form.HtmlEditorToolbar'); + \ No newline at end of file diff --git a/docs/src/Roo_data_HttpProxy.js.html b/docs/src/Roo_data_HttpProxy.js.html index d0edc0139d..004c294f7b 100644 --- a/docs/src/Roo_data_HttpProxy.js.html +++ b/docs/src/Roo_data_HttpProxy.js.html @@ -38,24 +38,24 @@ // thse are take from connection... /** - * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined) + * @cfg {String} url The default URL to be used for requests to the server. (defaults to undefined) */ /** - * @cfg {Object} extraParams (Optional) An object containing properties which are used as + * @cfg {Object} extraParams An object containing properties which are used as * extra parameters to each request made by this object. (defaults to undefined) */ /** - * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added + * @cfg {Object} defaultHeaders An object containing request headers which are added * to each request made by this object. (defaults to undefined) */ /** - * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) + * @cfg {String} method (GET|POST) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) */ /** - * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) + * @cfg {Number} timeout The timeout in milliseconds to be used for requests. (defaults to 30000) */ /** - * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false) + * @cfg {Boolean} autoAbort Whether this request should abort any pending requests. (defaults to false) * @type Boolean */ diff --git a/docs/src/Roo_data_Store.js.html b/docs/src/Roo_data_Store.js.html index cb914e5011..dd3fab409e 100644 --- a/docs/src/Roo_data_Store.js.html +++ b/docs/src/Roo_data_Store.js.html @@ -147,8 +147,8 @@ * If you return Json { data: [] , success: false, .... } then this will be thrown with the following args * * @param {Proxy} - * @param {Object} return from JsonData.reader() - success, totalRecords, records - * @param {Object} load options + * @param {Object} ret return data from JsonData.reader() - success, totalRecords, records + * @param {Object} opts - load Options * @param {Object} jsonData from your request (normally this contains the Exception) */ loadexception : true diff --git a/docs/src/Roo_grid_Grid.js.html b/docs/src/Roo_grid_Grid.js.html index 1020e4c708..3b2993774b 100644 --- a/docs/src/Roo_grid_Grid.js.html +++ b/docs/src/Roo_grid_Grid.js.html @@ -332,6 +332,11 @@ /** * @cfg {Roo.Toolbar} toolbar a toolbar for buttons etc. */ + + /** + * @cfg {Roo.PagingToolbar} footer the paging toolbar + */ + /** * @cfg {String} ddGroup - drag drop group. */ diff --git a/docs/symbols/Roo.Component.json b/docs/symbols/Roo.Component.json index 22a82373f8..6cf0277b6a 100644 --- a/docs/symbols/Roo.Component.json +++ b/docs/symbols/Roo.Component.json @@ -20,7 +20,8 @@ "Roo.bootstrap.nav.Simplebar" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ], "Roo.bootstrap.Button" : [ diff --git a/docs/symbols/Roo.bootstrap.Component.json b/docs/symbols/Roo.bootstrap.Component.json index 0a2a72e122..d024040bc0 100644 --- a/docs/symbols/Roo.bootstrap.Component.json +++ b/docs/symbols/Roo.bootstrap.Component.json @@ -12,7 +12,8 @@ "Roo.bootstrap.nav.Simplebar" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ], "Roo.bootstrap.Button" : [ diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json index 959ee2420a..52eafc17a1 100644 --- a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json @@ -130,8 +130,8 @@ }, { "name" : "toolbars", - "type" : "Array", - "desc" : "Array of toolbars. - defaults to just the Standard one", + "type" : "Array|boolean", + "desc" : "Array of toolbars, or names of toolbars. - true for standard, and false for none.", "memberOf" : "", "isOptional" : false, "optvals" : [] diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Context.json b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Context.json new file mode 100644 index 0000000000..b7b734e0d7 --- /dev/null +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Context.json @@ -0,0 +1,1285 @@ +{ + "name" : "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "augments" : [ + "Roo.bootstrap.nav.Simplebar", + "Roo.bootstrap.nav.Bar", + "Roo.bootstrap.Component", + "Roo.Component", + "Roo.util.Observable" + ], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [ + "Roo.bootstrap.form.HtmlEditor" + ], + "desc" : "Basic Toolbar", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "Context", + "example" : "Usage:\n\n new Roo.bootstrap.form.HtmlEditor({\n ....\n toolbars : [\n {\n xtyle: 'Standard',\n disable : { fonts: 1 , format: 1, ..., ... , ...],\n btns : [ .... ]\n },\n {\n xtyle : 'Context',\n ....\n }\n }", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [ + { + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "tooltip", + "type" : "string", + "desc" : "Text for the tooltip", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "container_method", + "type" : "string", + "desc" : "method to fetch parents container element (used by NavHeaderbar - getHeaderChildContainer)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "visibilityEl", + "type" : "string|object", + "desc" : "t) What element to use for visibility (@see getVisibilityEl(", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [ + "el", + "parent" + ] + }, + { + "name" : "inverse", + "type" : "Boolean", + "desc" : "is inverted color", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "align", + "type" : "String", + "desc" : "t) alignme", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "left", + "right" + ] + }, + { + "name" : "can_build_overlaid", + "type" : "Boolean", + "desc" : "True if element can be rebuild from a HTML page", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "hideMode", + "type" : "String", + "desc" : "y)\nHow this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [ + "display", + "visibility" + ] + }, + { + "name" : "tag", + "type" : "String", + "desc" : "v) default is n", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "header", + "footer", + "nav", + "div" + ] + }, + { + "name" : "style", + "type" : "String", + "desc" : "any extra css", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "allowDomMove", + "type" : "Boolean", + "desc" : "Whether the component can move the Dom node when rendering (defaults to true).", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "cls", + "type" : "String", + "desc" : "css class", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "arrangement", + "type" : "Boolean", + "desc" : "stacked | justified", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "loadMask", + "type" : "Boolean", + "desc" : "e) loadMask on the b", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "xattr", + "type" : "Object", + "desc" : "extra attributes to add to 'element' (used by builder to store stuff.)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "actionMode", + "type" : "String", + "desc" : "which property holds the element that used for hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "main", + "type" : "Boolean", + "desc" : "e) main nav bar? default fal", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "dataId", + "type" : "string", + "desc" : "cutomer id", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "type", + "type" : "String", + "desc" : "", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "nav", + "pills", + "tabs" + ] + }, + { + "name" : "weight", + "type" : "String", + "desc" : "e) default is ligh", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "light", + "primary", + "secondary", + "success", + "danger", + "warning", + "info", + "dark", + "white" + ] + }, + { + "name" : "name", + "type" : "string", + "desc" : "Specifies name attribute", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "disableClass", + "type" : "String", + "desc" : "CSS class added to the component when it is disabled (defaults to \"x-item-disabled\").", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + } + ], + "methods" : [ + { + "name" : "updateToolbar", + "type" : "function", + "desc" : "Protected method that will not generally be called directly. It triggers\na toolbar update by reading the markup state of the current selection in the editor.\n\nNote you can force an update by calling on('editorevent', scope, false)", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "collapse", + "type" : "function", + "desc" : "Collapse the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "expand", + "type" : "function", + "desc" : "Expand the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "tooltipEl", + "type" : "function", + "desc" : "Fetch the element to display the tooltip on.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "hide", + "type" : "function", + "desc" : "Hide a component - adds 'hidden' class", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Show a component - removes 'hidden' class", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setVisibilityEl", + "type" : "function", + "desc" : "Set the element that will be used to show or hide", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "getVisibilityEl", + "type" : "function", + "desc" : "Get the element that will be used to show or hide", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "initEvents", + "type" : "function", + "desc" : "Initialize Events for the element", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "getChildContainer", + "type" : "function", + "desc" : "Fetch the element to add children to", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "getId", + "type" : "function", + "desc" : "Returns the id of this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "String", + "desc" : "" + } + ] + }, + { + "name" : "render", + "type" : "function", + "desc" : "If this is a lazy rendering component, render it to its container element.", + "sig" : "(container)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "container", + "type" : "String/HTMLElement/Element", + "desc" : "(optional) The element this component should be rendered into. If it is being applied to existing markup, this should be left off.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Destroys this component by purging any event listeners, removing the component's element from the DOM,\nremoving the component from its {@link Roo.Container} (if applicable) and unregistering it from {@link Roo.ComponentMgr}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "isVisible", + "type" : "function", + "desc" : "Returns true if this component is visible.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setDisabled", + "type" : "function", + "desc" : "Convenience function for setting disabled/enabled by boolean.", + "sig" : "(disabled)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "disabled", + "type" : "Boolean", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "focus", + "type" : "function", + "desc" : "Try to focus this component.", + "sig" : "(selectText)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "selectText", + "type" : "Boolean", + "desc" : "True to also select the text in this component (if applicable)", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Enable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "setVisible", + "type" : "function", + "desc" : "Convenience function to hide or show this component by boolean.", + "sig" : "(visible)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "visible", + "type" : "Boolean", + "desc" : "True to show, false to hide", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Disable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "getEl", + "type" : "function", + "desc" : "Returns the underlying {@link Roo.Element}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "The element" + } + ] + }, + { + "name" : "purgeListeners", + "type" : "function", + "desc" : "Removes all listeners for this object", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "on", + "type" : "function", + "desc" : "Appends an event handler to this element (shorthand for addListener)", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional)", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "un", + "type" : "function", + "desc" : "Removes a listener (shorthand for removeListener)", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addEvents", + "type" : "function", + "desc" : "Used to define events on this Observable", + "sig" : "(object)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "object", + "type" : "Object", + "desc" : "The object with the events defined", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "releaseCapture", + "type" : "function", + "desc" : "Removes all added captures from the Observable.", + "sig" : "(o)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to release", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "removeListener", + "type" : "function", + "desc" : "Removes a listener", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "fireEvent", + "type" : "function", + "desc" : "Fires the specified event with the passed parameters (minus the event name).", + "sig" : "(eventName, args)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "", + "isOptional" : false + }, + { + "name" : "args", + "type" : "Object...", + "desc" : "Variable number of parameters are passed to handlers", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "returns false if any of the handlers return false otherwise it returns true" + } + ] + }, + { + "name" : "hasListener", + "type" : "function", + "desc" : "Checks to see if this object has any listeners for a specified event", + "sig" : "(eventName)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The name of the event to check for", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the event is being listened for, else false" + } + ] + }, + { + "name" : "capture", + "type" : "function", + "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.", + "sig" : "(o, fn, scope)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to capture", + "isOptional" : false + }, + { + "name" : "fn", + "type" : "Function", + "desc" : "The function to call", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the fn", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addListener", + "type" : "function", + "desc" : "Appends an event handler to this component", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:
    \n
  • scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.
  • \n
  • delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.
  • \n
  • single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.
  • \n
  • buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is not invoked, but the new handler is scheduled in its place.
  • \n

\n

\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t

\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t
\n

\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t
\n

\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t

\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t
", + "isOptional" : false + } + ], + "returns" : [] + } + ], + "events" : [ + { + "name" : "beforetoggle", + "type" : "function", + "desc" : "Fire before toggle the menu", + "sig" : "function (e)\n{\n\n}", + "memberOf" : "Roo.bootstrap.nav.Bar", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "e", + "type" : "Roo.EventObject", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "childrenrendered", + "type" : "function", + "desc" : "Fires when the children have been rendered..", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.bootstrap.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.bootstrap.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforerender", + "type" : "function", + "desc" : "Fires before the component is rendered. Return false to stop the render.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Fires after the component is disabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "render", + "type" : "function", + "desc" : "Fires after the component is rendered.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Fires after the component is destroyed.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "hide", + "type" : "function", + "desc" : "Fires after the component is hidden.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforehide", + "type" : "function", + "desc" : "Fires before the component is hidden. Return false to stop the hide.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Fires after the component is shown.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforeshow", + "type" : "function", + "desc" : "Fires before the component is shown. Return false to stop the show.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Fires after the component is enabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforedestroy", + "type" : "function", + "desc" : "Fires before the component is destroyed. Return false to stop the destroy.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + } + ] +} \ No newline at end of file diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Standard.json b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Standard.json new file mode 100644 index 0000000000..1ad6b72303 --- /dev/null +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.Standard.json @@ -0,0 +1,1301 @@ +{ + "name" : "Roo.bootstrap.form.HtmlEditorToolbar.Standard", + "augments" : [ + "Roo.bootstrap.nav.Simplebar", + "Roo.bootstrap.nav.Bar", + "Roo.bootstrap.Component", + "Roo.Component", + "Roo.util.Observable" + ], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [ + "Roo.bootstrap.form.HtmlEditor" + ], + "desc" : "Basic Toolbar", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "Standard", + "example" : "Usage:\n\n new Roo.bootstrap.form.HtmlEditor({\n ....\n toolbars : [\n new Roo.bootstrap.form.HtmlEditorToolbar.Standard({\n disable : { fonts: 1 , format: 1, ..., ... , ...],\n btns : [ .... ]\n })\n }", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [ + { + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "btns", + "type" : "Array", + "desc" : "List of additional buttons.\n\n\nNEEDS Extra CSS? \n.x-html-editor-tb .x-edit-none .x-btn-text { background: none; }", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "container_method", + "type" : "string", + "desc" : "method to fetch parents container element (used by NavHeaderbar - getHeaderChildContainer)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "tooltip", + "type" : "string", + "desc" : "Text for the tooltip", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "visibilityEl", + "type" : "string|object", + "desc" : "t) What element to use for visibility (@see getVisibilityEl(", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [ + "el", + "parent" + ] + }, + { + "name" : "inverse", + "type" : "Boolean", + "desc" : "is inverted color", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "align", + "type" : "String", + "desc" : "t) alignme", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "left", + "right" + ] + }, + { + "name" : "can_build_overlaid", + "type" : "Boolean", + "desc" : "True if element can be rebuild from a HTML page", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "hideMode", + "type" : "String", + "desc" : "y)\nHow this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [ + "display", + "visibility" + ] + }, + { + "name" : "tag", + "type" : "String", + "desc" : "v) default is n", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "header", + "footer", + "nav", + "div" + ] + }, + { + "name" : "style", + "type" : "String", + "desc" : "any extra css", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "allowDomMove", + "type" : "Boolean", + "desc" : "Whether the component can move the Dom node when rendering (defaults to true).", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "cls", + "type" : "String", + "desc" : "css class", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "disable", + "type" : "Object", + "desc" : "List of elements to disable..", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "arrangement", + "type" : "Boolean", + "desc" : "stacked | justified", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "loadMask", + "type" : "Boolean", + "desc" : "e) loadMask on the b", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "xattr", + "type" : "Object", + "desc" : "extra attributes to add to 'element' (used by builder to store stuff.)", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "actionMode", + "type" : "String", + "desc" : "which property holds the element that used for hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "main", + "type" : "Boolean", + "desc" : "e) main nav bar? default fal", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, + { + "name" : "dataId", + "type" : "string", + "desc" : "cutomer id", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "type", + "type" : "String", + "desc" : "", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "nav", + "pills", + "tabs" + ] + }, + { + "name" : "weight", + "type" : "String", + "desc" : "e) default is ligh", + "memberOf" : "Roo.bootstrap.nav.Simplebar", + "isOptional" : false, + "optvals" : [ + "light", + "primary", + "secondary", + "success", + "danger", + "warning", + "info", + "dark", + "white" + ] + }, + { + "name" : "name", + "type" : "string", + "desc" : "Specifies name attribute", + "memberOf" : "Roo.bootstrap.Component", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "disableClass", + "type" : "String", + "desc" : "CSS class added to the component when it is disabled (defaults to \"x-item-disabled\").", + "memberOf" : "Roo.Component", + "isOptional" : false, + "optvals" : [] + } + ], + "methods" : [ + { + "name" : "updateToolbar", + "type" : "function", + "desc" : "Protected method that will not generally be called directly. It triggers\na toolbar update by reading the markup state of the current selection in the editor.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "collapse", + "type" : "function", + "desc" : "Collapse the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "expand", + "type" : "function", + "desc" : "Expand the navbar pulldown", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.nav.Bar", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "tooltipEl", + "type" : "function", + "desc" : "Fetch the element to display the tooltip on.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "hide", + "type" : "function", + "desc" : "Hide a component - adds 'hidden' class", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Show a component - removes 'hidden' class", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setVisibilityEl", + "type" : "function", + "desc" : "Set the element that will be used to show or hide", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "getVisibilityEl", + "type" : "function", + "desc" : "Get the element that will be used to show or hide", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "initEvents", + "type" : "function", + "desc" : "Initialize Events for the element", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "getChildContainer", + "type" : "function", + "desc" : "Fetch the element to add children to", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.bootstrap.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "defaults to this.el" + } + ] + }, + { + "name" : "getId", + "type" : "function", + "desc" : "Returns the id of this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "String", + "desc" : "" + } + ] + }, + { + "name" : "render", + "type" : "function", + "desc" : "If this is a lazy rendering component, render it to its container element.", + "sig" : "(container)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "container", + "type" : "String/HTMLElement/Element", + "desc" : "(optional) The element this component should be rendered into. If it is being applied to existing markup, this should be left off.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Destroys this component by purging any event listeners, removing the component's element from the DOM,\nremoving the component from its {@link Roo.Container} (if applicable) and unregistering it from {@link Roo.ComponentMgr}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "isVisible", + "type" : "function", + "desc" : "Returns true if this component is visible.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "setDisabled", + "type" : "function", + "desc" : "Convenience function for setting disabled/enabled by boolean.", + "sig" : "(disabled)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "disabled", + "type" : "Boolean", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "focus", + "type" : "function", + "desc" : "Try to focus this component.", + "sig" : "(selectText)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "selectText", + "type" : "Boolean", + "desc" : "True to also select the text in this component (if applicable)", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Enable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "setVisible", + "type" : "function", + "desc" : "Convenience function to hide or show this component by boolean.", + "sig" : "(visible)", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "visible", + "type" : "Boolean", + "desc" : "True to show, false to hide", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Disable this component.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Component", + "desc" : "this" + } + ] + }, + { + "name" : "getEl", + "type" : "function", + "desc" : "Returns the underlying {@link Roo.Element}.", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.Component", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Roo.Element", + "desc" : "The element" + } + ] + }, + { + "name" : "purgeListeners", + "type" : "function", + "desc" : "Removes all listeners for this object", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "on", + "type" : "function", + "desc" : "Appends an event handler to this element (shorthand for addListener)", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional)", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "un", + "type" : "function", + "desc" : "Removes a listener (shorthand for removeListener)", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addEvents", + "type" : "function", + "desc" : "Used to define events on this Observable", + "sig" : "(object)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "object", + "type" : "Object", + "desc" : "The object with the events defined", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "releaseCapture", + "type" : "function", + "desc" : "Removes all added captures from the Observable.", + "sig" : "(o)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to release", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "removeListener", + "type" : "function", + "desc" : "Removes a listener", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "fireEvent", + "type" : "function", + "desc" : "Fires the specified event with the passed parameters (minus the event name).", + "sig" : "(eventName, args)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "", + "isOptional" : false + }, + { + "name" : "args", + "type" : "Object...", + "desc" : "Variable number of parameters are passed to handlers", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "returns false if any of the handlers return false otherwise it returns true" + } + ] + }, + { + "name" : "hasListener", + "type" : "function", + "desc" : "Checks to see if this object has any listeners for a specified event", + "sig" : "(eventName)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The name of the event to check for", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the event is being listened for, else false" + } + ] + }, + { + "name" : "capture", + "type" : "function", + "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.", + "sig" : "(o, fn, scope)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to capture", + "isOptional" : false + }, + { + "name" : "fn", + "type" : "Function", + "desc" : "The function to call", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the fn", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addListener", + "type" : "function", + "desc" : "Appends an event handler to this component", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:
    \n
  • scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.
  • \n
  • delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.
  • \n
  • single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.
  • \n
  • buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is not invoked, but the new handler is scheduled in its place.
  • \n

\n

\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t

\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t
\n

\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t
\n

\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t

\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t
", + "isOptional" : false + } + ], + "returns" : [] + } + ], + "events" : [ + { + "name" : "beforetoggle", + "type" : "function", + "desc" : "Fire before toggle the menu", + "sig" : "function (e)\n{\n\n}", + "memberOf" : "Roo.bootstrap.nav.Bar", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "e", + "type" : "Roo.EventObject", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "childrenrendered", + "type" : "function", + "desc" : "Fires when the children have been rendered..", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.bootstrap.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.bootstrap.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforerender", + "type" : "function", + "desc" : "Fires before the component is rendered. Return false to stop the render.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "disable", + "type" : "function", + "desc" : "Fires after the component is disabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "render", + "type" : "function", + "desc" : "Fires after the component is rendered.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "destroy", + "type" : "function", + "desc" : "Fires after the component is destroyed.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "hide", + "type" : "function", + "desc" : "Fires after the component is hidden.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforehide", + "type" : "function", + "desc" : "Fires before the component is hidden. Return false to stop the hide.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "show", + "type" : "function", + "desc" : "Fires after the component is shown.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforeshow", + "type" : "function", + "desc" : "Fires before the component is shown. Return false to stop the show.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "enable", + "type" : "function", + "desc" : "Fires after the component is enabled.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforedestroy", + "type" : "function", + "desc" : "Fires before the component is destroyed. Return false to stop the destroy.", + "sig" : "function (_self)\n{\n\n}", + "memberOf" : "Roo.Component", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.Component", + "desc" : "", + "isOptional" : false + } + ], + "returns" : [] + } + ] +} \ No newline at end of file diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.json b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.json new file mode 100644 index 0000000000..83f5cb6835 --- /dev/null +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditorToolbar.json @@ -0,0 +1,25 @@ +{ + "name" : "Roo.bootstrap.form.HtmlEditorToolbar", + "augments" : [], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [], + "desc" : "", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "Roo.bootstrap.form.HtmlEditorToolbar", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [], + "methods" : [], + "events" : [] +} \ No newline at end of file diff --git a/docs/symbols/Roo.bootstrap.nav.Bar.json b/docs/symbols/Roo.bootstrap.nav.Bar.json index 36dbeae9f1..322ad0429f 100644 --- a/docs/symbols/Roo.bootstrap.nav.Bar.json +++ b/docs/symbols/Roo.bootstrap.nav.Bar.json @@ -13,7 +13,8 @@ "Roo.bootstrap.nav.Simplebar" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ] }, diff --git a/docs/symbols/Roo.bootstrap.nav.Simplebar.json b/docs/symbols/Roo.bootstrap.nav.Simplebar.json index 7c94edd0dd..1f7df53237 100644 --- a/docs/symbols/Roo.bootstrap.nav.Simplebar.json +++ b/docs/symbols/Roo.bootstrap.nav.Simplebar.json @@ -10,7 +10,8 @@ "Roo.bootstrap.nav.Simplebar" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ] }, diff --git a/docs/symbols/Roo.data.HttpProxy.json b/docs/symbols/Roo.data.HttpProxy.json index ef4d06b5ab..033c928fed 100644 --- a/docs/symbols/Roo.data.HttpProxy.json +++ b/docs/symbols/Roo.data.HttpProxy.json @@ -41,10 +41,13 @@ { "name" : "method", "type" : "String", - "desc" : "The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)", + "desc" : "T) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GE", "memberOf" : "", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "GET", + "POST" + ] }, { "name" : "timeout", diff --git a/docs/symbols/Roo.data.JsonStore.json b/docs/symbols/Roo.data.JsonStore.json index e55b37bb66..7771328643 100644 --- a/docs/symbols/Roo.data.JsonStore.json +++ b/docs/symbols/Roo.data.JsonStore.json @@ -1362,7 +1362,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "Roo.data.Store", "example" : "", "deprecated" : "", @@ -1376,15 +1376,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { diff --git a/docs/symbols/Roo.data.SimpleStore.json b/docs/symbols/Roo.data.SimpleStore.json index ec7ec41075..099456742a 100644 --- a/docs/symbols/Roo.data.SimpleStore.json +++ b/docs/symbols/Roo.data.SimpleStore.json @@ -1378,7 +1378,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "Roo.data.Store", "example" : "", "deprecated" : "", @@ -1392,15 +1392,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { diff --git a/docs/symbols/Roo.data.Store.json b/docs/symbols/Roo.data.Store.json index aa8141143e..552646d1cd 100644 --- a/docs/symbols/Roo.data.Store.json +++ b/docs/symbols/Roo.data.Store.json @@ -1358,7 +1358,7 @@ "name" : "loadexception", "type" : "function", "desc" : "Fires if an exception occurs in the Proxy during loading.\nCalled with the signature of the Proxy's \"loadexception\" event.\nIf you return Json { data: [] , success: false, .... } then this will be thrown with the following args", - "sig" : "function (, return, load, jsonData)\n{\n\n}", + "sig" : "function (, ret, opts, jsonData)\n{\n\n}", "memberOf" : "", "example" : "", "deprecated" : "", @@ -1372,15 +1372,15 @@ "isOptional" : false }, { - "name" : "return", + "name" : "ret", "type" : "Object", - "desc" : "from JsonData.reader() - success, totalRecords, records", + "desc" : "return data from JsonData.reader() - success, totalRecords, records", "isOptional" : false }, { - "name" : "load", + "name" : "opts", "type" : "Object", - "desc" : "options", + "desc" : "- load Options", "isOptional" : false }, { diff --git a/docs/symbols/Roo.grid.Calendar.json b/docs/symbols/Roo.grid.Calendar.json index d2d11a55b4..92bf980a60 100644 --- a/docs/symbols/Roo.grid.Calendar.json +++ b/docs/symbols/Roo.grid.Calendar.json @@ -36,6 +36,22 @@ "throws" : "", "requires" : "", "config" : [ + { + "name" : "trackMouseOver", + "type" : "Boolean", + "desc" : "True to highlight rows when the mouse is over. Default is true.", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "ddText", + "type" : "String", + "desc" : "Configures the text is the drag proxy (defaults to \"%0 selected row(s)\").\n%0 is replaced with the number of selected rows.", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, { "name" : "eventStore", "type" : "Store", @@ -45,33 +61,33 @@ "optvals" : [] }, { - "name" : "autoSizeColumns", - "type" : "Boolean", - "desc" : "True to automatically resize the columns to fit their content\non initial render. It is more efficient to explicitly size the columns\nthrough the ColumnModel's {@link Roo.grid.ColumnModel#width} config option. Default is false.", + "name" : "autoExpandMax", + "type" : "Number", + "desc" : "The maximum width the autoExpandColumn can have (if enabled). Default is 1000.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "listeners", - "type" : "Object", - "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", - "memberOf" : "Roo.util.Observable", + "name" : "cm[]", + "type" : "Roo.grid.ColumnModel", + "desc" : "The columns of the grid", + "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "cm[]", - "type" : "Roo.grid.ColumnModel", - "desc" : "The columns of the grid", + "name" : "view", + "type" : "Roo.grid.GridView", + "desc" : "The view that renders the grid (default = Roo.grid.GridView)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "maxRowsToMeasure", + "name" : "stripeRows", "type" : "Boolean", - "desc" : "If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of\nrows measured to get a columns size. Default is 0 (all rows).", + "desc" : "True to stripe the rows. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -85,81 +101,81 @@ "optvals" : [] }, { - "name" : "ddText", - "type" : "String", - "desc" : "Configures the text is the drag proxy (defaults to \"%0 selected row(s)\").\n%0 is replaced with the number of selected rows.", + "name" : "monitorWindowResize", + "type" : "Boolean", + "desc" : "True to autoSize the grid when the window resizes. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "toolbar", - "type" : "Roo.Toolbar", - "desc" : "a toolbar for buttons etc.", + "name" : "enableRowHeightSync", + "type" : "Boolean", + "desc" : "True to manually sync row heights across locked and not locked rows. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandColumn", - "type" : "String", - "desc" : "The id (or dataIndex) of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.", + "name" : "ds", + "type" : "Roo.data.Store", + "desc" : "The data store for the grid", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandMax", - "type" : "Number", - "desc" : "The maximum width the autoExpandColumn can have (if enabled). Default is 1000.", + "name" : "autoSizeHeaders", + "type" : "Boolean", + "desc" : "True to measure headers with column data when auto sizing columns. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableRowHeightSync", - "type" : "Boolean", - "desc" : "True to manually sync row heights across locked and not locked rows. Default is false.", + "name" : "toolbar", + "type" : "Roo.Toolbar", + "desc" : "a toolbar for buttons etc.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableDrop", - "type" : "Boolean", - "desc" : "True to enable drop of elements. Default is false. (double check if this is needed?)", + "name" : "sm", + "type" : "Roo.grid.AbstractSelectionModel", + "desc" : "The selection Model (default = Roo.grid.RowSelectionModel)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "monitorWindowResize", - "type" : "Boolean", - "desc" : "True to autoSize the grid when the window resizes. Default is true.", - "memberOf" : "Roo.grid.Grid", + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandMin", - "type" : "Number", - "desc" : "The minimum width the autoExpandColumn can have (if enabled).\nDefault is 50.", + "name" : "enableColumnHide", + "type" : "Boolean", + "desc" : "True to enable hiding of columns with the header context menu. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "view", - "type" : "Roo.grid.GridView", - "desc" : "The view that renders the grid (default = Roo.grid.GridView)", + "name" : "enableColumnMove", + "type" : "Boolean", + "desc" : "True to enable drag and drop reorder of columns. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "ds", - "type" : "Roo.data.Store", - "desc" : "The data store for the grid", + "name" : "dragGroup", + "type" : "String", + "desc" : "- drag group (?? not sure if needed.)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -173,89 +189,81 @@ "optvals" : [] }, { - "name" : "enableDrag", - "type" : "Boolean", - "desc" : "True to enable drag of rows. Default is false. (double check if this is needed?)", + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoWidth", + "name" : "enableDragDrop", "type" : "Boolean", - "desc" : "True to set the grid's width to the default total width of the grid's columns instead\nof a fixed width. Default is false.", - "memberOf" : "Roo.grid.Grid", - "isOptional" : false, - "optvals" : [] - }, - { - "name" : "maxHeight", - "type" : "Number", - "desc" : "Sets the maximum height of the grid - ignored if autoHeight is not on.", + "desc" : "True to enable drag and drop of rows. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "trackMouseOver", + "name" : "enableDrop", "type" : "Boolean", - "desc" : "True to highlight rows when the mouse is over. Default is true.", + "desc" : "True to enable drop of elements. Default is false. (double check if this is needed?)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "loadMask", - "type" : "Object", - "desc" : "An {@link Roo.LoadMask} config or true to mask the grid while loading. Default is false.", + "name" : "sortColMenu", + "type" : "boolean", + "desc" : "Sort the column order menu when it shows (usefull for long lists..) default false", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "stripeRows", - "type" : "Boolean", - "desc" : "True to stripe the rows. Default is true.", + "name" : "autoExpandColumn", + "type" : "String", + "desc" : "The id (or dataIndex) of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableColumnMove", + "name" : "maxRowsToMeasure", "type" : "Boolean", - "desc" : "True to enable drag and drop reorder of columns. Default is true.", + "desc" : "If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of\nrows measured to get a columns size. Default is 0 (all rows).", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableColumnHide", - "type" : "Boolean", - "desc" : "True to enable hiding of columns with the header context menu. Default is true.", + "name" : "loadMask", + "type" : "Object", + "desc" : "An {@link Roo.LoadMask} config or true to mask the grid while loading. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoSizeHeaders", + "name" : "autoHeight", "type" : "Boolean", - "desc" : "True to measure headers with column data when auto sizing columns. Default is true.", + "desc" : "True to fit the height of the grid container to the height of the data. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "sortColMenu", - "type" : "boolean", - "desc" : "Sort the column order menu when it shows (usefull for long lists..) default false", + "name" : "autoSizeColumns", + "type" : "Boolean", + "desc" : "True to automatically resize the columns to fit their content\non initial render. It is more efficient to explicitly size the columns\nthrough the ColumnModel's {@link Roo.grid.ColumnModel#width} config option. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableDragDrop", + "name" : "enableDrag", "type" : "Boolean", - "desc" : "True to enable drag and drop of rows. Default is false.", + "desc" : "True to enable drag of rows. Default is false. (double check if this is needed?)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -269,25 +277,25 @@ "optvals" : [] }, { - "name" : "sm", - "type" : "Roo.grid.AbstractSelectionModel", - "desc" : "The selection Model (default = Roo.grid.RowSelectionModel)", + "name" : "autoWidth", + "type" : "Boolean", + "desc" : "True to set the grid's width to the default total width of the grid's columns instead\nof a fixed width. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "dragGroup", - "type" : "String", - "desc" : "- drag group (?? not sure if needed.)", + "name" : "maxHeight", + "type" : "Number", + "desc" : "Sets the maximum height of the grid - ignored if autoHeight is not on.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoHeight", - "type" : "Boolean", - "desc" : "True to fit the height of the grid container to the height of the data. Default is false.", + "name" : "autoExpandMin", + "type" : "Number", + "desc" : "The minimum width the autoExpandColumn can have (if enabled).\nDefault is 50.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] diff --git a/docs/symbols/Roo.grid.EditorGrid.json b/docs/symbols/Roo.grid.EditorGrid.json index 533f82e0e2..d903a9c7da 100644 --- a/docs/symbols/Roo.grid.EditorGrid.json +++ b/docs/symbols/Roo.grid.EditorGrid.json @@ -47,17 +47,25 @@ "requires" : "", "config" : [ { - "name" : "listeners", - "type" : "Object", - "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", - "memberOf" : "Roo.util.Observable", + "name" : "trackMouseOver", + "type" : "Boolean", + "desc" : "True to highlight rows when the mouse is over. Default is true.", + "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoSizeColumns", - "type" : "Boolean", - "desc" : "True to automatically resize the columns to fit their content\non initial render. It is more efficient to explicitly size the columns\nthrough the ColumnModel's {@link Roo.grid.ColumnModel#width} config option. Default is false.", + "name" : "ddText", + "type" : "String", + "desc" : "Configures the text is the drag proxy (defaults to \"%0 selected row(s)\").\n%0 is replaced with the number of selected rows.", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "autoExpandMax", + "type" : "Number", + "desc" : "The maximum width the autoExpandColumn can have (if enabled). Default is 1000.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -71,9 +79,17 @@ "optvals" : [] }, { - "name" : "maxRowsToMeasure", + "name" : "view", + "type" : "Roo.grid.GridView", + "desc" : "The view that renders the grid (default = Roo.grid.GridView)", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "stripeRows", "type" : "Boolean", - "desc" : "If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of\nrows measured to get a columns size. Default is 0 (all rows).", + "desc" : "True to stripe the rows. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -87,81 +103,81 @@ "optvals" : [] }, { - "name" : "ddText", - "type" : "String", - "desc" : "Configures the text is the drag proxy (defaults to \"%0 selected row(s)\").\n%0 is replaced with the number of selected rows.", + "name" : "monitorWindowResize", + "type" : "Boolean", + "desc" : "True to autoSize the grid when the window resizes. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "toolbar", - "type" : "Roo.Toolbar", - "desc" : "a toolbar for buttons etc.", + "name" : "enableRowHeightSync", + "type" : "Boolean", + "desc" : "True to manually sync row heights across locked and not locked rows. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandColumn", - "type" : "String", - "desc" : "The id (or dataIndex) of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.", + "name" : "ds", + "type" : "Roo.data.Store", + "desc" : "The data store for the grid", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandMax", - "type" : "Number", - "desc" : "The maximum width the autoExpandColumn can have (if enabled). Default is 1000.", + "name" : "autoSizeHeaders", + "type" : "Boolean", + "desc" : "True to measure headers with column data when auto sizing columns. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableRowHeightSync", - "type" : "Boolean", - "desc" : "True to manually sync row heights across locked and not locked rows. Default is false.", + "name" : "toolbar", + "type" : "Roo.Toolbar", + "desc" : "a toolbar for buttons etc.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableDrop", - "type" : "Boolean", - "desc" : "True to enable drop of elements. Default is false. (double check if this is needed?)", + "name" : "sm", + "type" : "Roo.grid.AbstractSelectionModel", + "desc" : "The selection Model (default = Roo.grid.RowSelectionModel)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "monitorWindowResize", - "type" : "Boolean", - "desc" : "True to autoSize the grid when the window resizes. Default is true.", - "memberOf" : "Roo.grid.Grid", + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", "isOptional" : false, "optvals" : [] }, { - "name" : "autoExpandMin", - "type" : "Number", - "desc" : "The minimum width the autoExpandColumn can have (if enabled).\nDefault is 50.", + "name" : "enableColumnHide", + "type" : "Boolean", + "desc" : "True to enable hiding of columns with the header context menu. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "view", - "type" : "Roo.grid.GridView", - "desc" : "The view that renders the grid (default = Roo.grid.GridView)", + "name" : "enableColumnMove", + "type" : "Boolean", + "desc" : "True to enable drag and drop reorder of columns. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "ds", - "type" : "Roo.data.Store", - "desc" : "The data store for the grid", + "name" : "dragGroup", + "type" : "String", + "desc" : "- drag group (?? not sure if needed.)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -175,97 +191,89 @@ "optvals" : [] }, { - "name" : "enableDrag", - "type" : "Boolean", - "desc" : "True to enable drag of rows. Default is false. (double check if this is needed?)", + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoWidth", + "name" : "enableDragDrop", "type" : "Boolean", - "desc" : "True to set the grid's width to the default total width of the grid's columns instead\nof a fixed width. Default is false.", - "memberOf" : "Roo.grid.Grid", - "isOptional" : false, - "optvals" : [] - }, - { - "name" : "maxHeight", - "type" : "Number", - "desc" : "Sets the maximum height of the grid - ignored if autoHeight is not on.", + "desc" : "True to enable drag and drop of rows. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "trackMouseOver", + "name" : "enableDrop", "type" : "Boolean", - "desc" : "True to highlight rows when the mouse is over. Default is true.", + "desc" : "True to enable drop of elements. Default is false. (double check if this is needed?)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "loadMask", - "type" : "Object", - "desc" : "An {@link Roo.LoadMask} config or true to mask the grid while loading. Default is false.", + "name" : "sortColMenu", + "type" : "boolean", + "desc" : "Sort the column order menu when it shows (usefull for long lists..) default false", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "stripeRows", - "type" : "Boolean", - "desc" : "True to stripe the rows. Default is true.", - "memberOf" : "Roo.grid.Grid", + "name" : "clicksToEdit", + "type" : "Number", + "desc" : "The number of clicks on a cell required to display the cell's editor (defaults to 2)", + "memberOf" : "", "isOptional" : false, "optvals" : [] }, { - "name" : "enableColumnMove", - "type" : "Boolean", - "desc" : "True to enable drag and drop reorder of columns. Default is true.", + "name" : "autoExpandColumn", + "type" : "String", + "desc" : "The id (or dataIndex) of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableColumnHide", + "name" : "maxRowsToMeasure", "type" : "Boolean", - "desc" : "True to enable hiding of columns with the header context menu. Default is true.", + "desc" : "If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of\nrows measured to get a columns size. Default is 0 (all rows).", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "clicksToEdit", - "type" : "Number", - "desc" : "The number of clicks on a cell required to display the cell's editor (defaults to 2)", - "memberOf" : "", + "name" : "loadMask", + "type" : "Object", + "desc" : "An {@link Roo.LoadMask} config or true to mask the grid while loading. Default is false.", + "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoSizeHeaders", + "name" : "autoHeight", "type" : "Boolean", - "desc" : "True to measure headers with column data when auto sizing columns. Default is true.", + "desc" : "True to fit the height of the grid container to the height of the data. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "sortColMenu", - "type" : "boolean", - "desc" : "Sort the column order menu when it shows (usefull for long lists..) default false", + "name" : "autoSizeColumns", + "type" : "Boolean", + "desc" : "True to automatically resize the columns to fit their content\non initial render. It is more efficient to explicitly size the columns\nthrough the ColumnModel's {@link Roo.grid.ColumnModel#width} config option. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableDragDrop", + "name" : "enableDrag", "type" : "Boolean", - "desc" : "True to enable drag and drop of rows. Default is false.", + "desc" : "True to enable drag of rows. Default is false. (double check if this is needed?)", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -279,25 +287,25 @@ "optvals" : [] }, { - "name" : "sm", - "type" : "Roo.grid.AbstractSelectionModel", - "desc" : "The selection Model (default = Roo.grid.RowSelectionModel)", + "name" : "autoWidth", + "type" : "Boolean", + "desc" : "True to set the grid's width to the default total width of the grid's columns instead\nof a fixed width. Default is false.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "dragGroup", - "type" : "String", - "desc" : "- drag group (?? not sure if needed.)", + "name" : "maxHeight", + "type" : "Number", + "desc" : "Sets the maximum height of the grid - ignored if autoHeight is not on.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "autoHeight", - "type" : "Boolean", - "desc" : "True to fit the height of the grid container to the height of the data. Default is false.", + "name" : "autoExpandMin", + "type" : "Number", + "desc" : "The minimum width the autoExpandColumn can have (if enabled).\nDefault is 50.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] diff --git a/docs/symbols/Roo.grid.Grid.json b/docs/symbols/Roo.grid.Grid.json index bb616d9cc3..d819726cbd 100644 --- a/docs/symbols/Roo.grid.Grid.json +++ b/docs/symbols/Roo.grid.Grid.json @@ -43,6 +43,14 @@ "throws" : "", "requires" : "", "config" : [ + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "autoSizeColumns", "type" : "Boolean", diff --git a/docs/symbols/Roo.grid.PropertyGrid.json b/docs/symbols/Roo.grid.PropertyGrid.json index d5280e6f02..a5107cc352 100644 --- a/docs/symbols/Roo.grid.PropertyGrid.json +++ b/docs/symbols/Roo.grid.PropertyGrid.json @@ -158,17 +158,17 @@ "optvals" : [] }, { - "name" : "enableColumnHide", + "name" : "enableColumnMove", "type" : "Boolean", - "desc" : "True to enable hiding of columns with the header context menu. Default is true.", + "desc" : "True to enable drag and drop reorder of columns. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] }, { - "name" : "enableColumnMove", + "name" : "enableColumnHide", "type" : "Boolean", - "desc" : "True to enable drag and drop reorder of columns. Default is true.", + "desc" : "True to enable hiding of columns with the header context menu. Default is true.", "memberOf" : "Roo.grid.Grid", "isOptional" : false, "optvals" : [] @@ -189,6 +189,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footer", + "type" : "Roo.PagingToolbar", + "desc" : "the paging toolbar", + "memberOf" : "Roo.grid.Grid", + "isOptional" : false, + "optvals" : [] + }, { "name" : "enableDragDrop", "type" : "Boolean", diff --git a/docs/symbols/Roo.util.Observable.json b/docs/symbols/Roo.util.Observable.json index 290ec8786d..708212eddf 100644 --- a/docs/symbols/Roo.util.Observable.json +++ b/docs/symbols/Roo.util.Observable.json @@ -301,7 +301,8 @@ "Roo.bootstrap.nav.Simplebar" : [ "Roo.bootstrap.PagingToolbar", "Roo.bootstrap.PopoverNav", - "Roo.bootstrap.form.HtmlEditorToolbarStandard", + "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "Roo.bootstrap.form.HtmlEditorToolbar.Standard", "Roo.bootstrap.nav.Headerbar" ], "Roo.data.Connection" : [ diff --git a/docs/tree.json b/docs/tree.json index 3e60aa0b29..73006c1450 100644 --- a/docs/tree.json +++ b/docs/tree.json @@ -707,9 +707,20 @@ "is_class" : true }, { - "name" : "Roo.bootstrap.form.HtmlEditorToolbarStandard", - "cn" : [], - "is_class" : true + "name" : "Roo.bootstrap.form.HtmlEditorToolbar", + "cn" : [ + { + "name" : "Roo.bootstrap.form.HtmlEditorToolbar.Context", + "cn" : [], + "is_class" : true + }, + { + "name" : "Roo.bootstrap.form.HtmlEditorToolbar.Standard", + "cn" : [], + "is_class" : true + } + ], + "is_class" : false }, { "name" : "Roo.bootstrap.form.Input", diff --git a/examples/bootstrap/Editor.html b/examples/bootstrap/Editor.html index f38541f45a..f13a8f4564 100644 --- a/examples/bootstrap/Editor.html +++ b/examples/bootstrap/Editor.html @@ -17,6 +17,10 @@ + + + + diff --git a/examples/bootstrap/Editor.js b/examples/bootstrap/Editor.js index d20ca39983..537273182b 100644 --- a/examples/bootstrap/Editor.js +++ b/examples/bootstrap/Editor.js @@ -49,6 +49,7 @@ Roo.example.Editor = new Roo.XComponent({ width : 1000, height : 500, resize : 'vertical', + //toolbars : [ 'Standard', 'Context' ], stylesheets : (function(){ var css = []; diff --git a/examples/bootstrap/htmleditor.js b/examples/bootstrap/htmleditor.js index 76a4c7aec6..24b610684a 100644 --- a/examples/bootstrap/htmleditor.js +++ b/examples/bootstrap/htmleditor.js @@ -48,6 +48,7 @@ Roo.example.calendar = new Roo.XComponent({ fieldLabel : "Editor", labelAlign: 'top', name : "editor", + listeners : { render : function() { htmleditor = this; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index ee55272267..b6dfdfab99 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -17,7 +17,10 @@ Roo.bootstrap.version = ( function() { })(); Roo.bootstrap.menu = Roo.bootstrap.menu || {}; Roo.bootstrap.nav = {}; -Roo.bootstrap.form = {};Roo.bootstrap.panel = {};Roo.bootstrap.layout = {};/* +Roo.bootstrap.form = {};Roo.bootstrap.panel = {};Roo.bootstrap.layout = {}; +Roo.htmleditor = {}; +Roo.namespace('Roo.bootstrap.form.HtmlEditorToolbar'); +/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -15173,8 +15176,8 @@ Roo.data.Store = function(config){ * If you return Json { data: [] , success: false, .... } then this will be thrown with the following args * * @param {Proxy} - * @param {Object} return from JsonData.reader() - success, totalRecords, records - * @param {Object} load options + * @param {Object} ret return data from JsonData.reader() - success, totalRecords, records + * @param {Object} opts - load Options * @param {Object} jsonData from your request (normally this contains the Exception) */ loadexception : true @@ -16180,24 +16183,24 @@ Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, { // thse are take from connection... /** - * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined) + * @cfg {String} url The default URL to be used for requests to the server. (defaults to undefined) */ /** - * @cfg {Object} extraParams (Optional) An object containing properties which are used as + * @cfg {Object} extraParams An object containing properties which are used as * extra parameters to each request made by this object. (defaults to undefined) */ /** - * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added + * @cfg {Object} defaultHeaders An object containing request headers which are added * to each request made by this object. (defaults to undefined) */ /** - * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) + * @cfg {String} method (GET|POST) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) */ /** - * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) + * @cfg {Number} timeout The timeout in milliseconds to be used for requests. (defaults to 30000) */ /** - * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false) + * @cfg {Boolean} autoAbort Whether this request should abort any pending requests. (defaults to false) * @type Boolean */ @@ -26491,9 +26494,7 @@ Roo.rtf.Parser.prototype = { }); } -} ; -Roo.htmleditor = {}; - +} ; /** * @class Roo.htmleditor.Filter * Base Class for filtering htmleditor stuff. - do not use this directly - extend it. @@ -31575,6 +31576,8 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) { return; // we do not handle this.. (undo manager does..) } + // clicking a 'block'? + // in theory this detects if the last element is not a br, then we try and do that. // its so clicking in space at bottom triggers adding a br and moving the cursor. if (e && @@ -32550,9 +32553,9 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { /** - * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one + * @cfg {Array|boolean} toolbars Array of toolbars, or names of toolbars. - true for standard, and false for none. */ - toolbars : false, + toolbars : true, /** * @cfg {Array} buttons Array of toolbar's buttons. - defaults to empty @@ -32605,26 +32608,35 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { * add custom toolbar buttons. * @param {HtmlEditor} editor */ - createToolbar : function(){ - Roo.log('renewing'); - Roo.log("create toolbars"); + createToolbar : function() + { + //Roo.log('renewing'); + //Roo.log("create toolbars"); + if (this.toolbars === false) { + return; + } + if (this.toolbars === true) { + this.toolbars = [ 'Standard' ]; + } - this.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor: this} ) ]; - this.toolbars[0].render(this.toolbarContainer()); + var ar = Array.from(this.toolbars); + this.toolbars = []; + ar.forEach(function(t,i) { + if (typeof(t) == 'string') { + t = { + xtype : t + }; + } + if (typeof(t) == 'object' && typeof(t.xtype) == 'string') { + t.editor = this; + t.xns = t.xns || Roo.bootstrap.form.HtmlEditorToolbar; + t = Roo.factory(t); + } + this.toolbars[i] = t; + this.toolbars[i].render(this.toolbarContainer()); + }, this); - return; -// if (!editor.toolbars || !editor.toolbars.length) { -// editor.toolbars = [ new Roo.bootstrap.form.HtmlEditorToolbarStandard() ]; // can be empty? -// } -// -// for (var i =0 ; i < editor.toolbars.length;i++) { -// editor.toolbars[i] = Roo.factory( -// typeof(editor.toolbars[i]) == 'string' ? -// { xtype: editor.toolbars[i]} : editor.toolbars[i], -// Roo.bootstrap.form.HtmlEditor); -// editor.toolbars[i].init(editor); -// } }, @@ -32855,9 +32867,8 @@ Roo.extend(Roo.bootstrap.form.HtmlEditor, Roo.bootstrap.form.TextArea, { -Roo.namespace('Roo.bootstrap.form.HtmlEditor'); /** - * @class Roo.bootstrap.form.HtmlEditorToolbarStandard + * @class Roo.bootstrap.form.HtmlEditorToolbar.Standard * @parent Roo.bootstrap.form.HtmlEditor * @extends Roo.bootstrap.nav.Simplebar * Basic Toolbar @@ -32868,7 +32879,7 @@ Roo.namespace('Roo.bootstrap.form.HtmlEditor'); new Roo.bootstrap.form.HtmlEditor({ .... toolbars : [ - new Roo.bootstrap.form.HtmlEditorToolbarStandard({ + new Roo.bootstrap.form.HtmlEditorToolbar.Standard({ disable : { fonts: 1 , format: 1, ..., ... , ...], btns : [ .... ] }) @@ -32883,7 +32894,7 @@ Roo.namespace('Roo.bootstrap.form.HtmlEditor'); * .x-html-editor-tb .x-edit-none .x-btn-text { background: none; } */ -Roo.bootstrap.form.HtmlEditorToolbarStandard = function(config) +Roo.bootstrap.form.HtmlEditorToolbar.Standard = function(config) { Roo.apply(this, config); @@ -32895,17 +32906,17 @@ Roo.bootstrap.form.HtmlEditorToolbarStandard = function(config) colors : true, specialElements : true }); - Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.constructor.call(this, config); + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.constructor.call(this, config); this.editor = config.editor; this.editorcore = config.editor.editorcore; - this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.cmd; }); + this.buttons = new Roo.util.MixedCollection(false, function(o) { return o.btnid; }); //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config); // dont call parent... till later. } -Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simplebar, { +Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simplebar, { bar : true, @@ -32921,11 +32932,14 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl 'div','span' ], + + deleteBtn: false, + onRender : function(ct, position) { // Roo.log("Call onRender: " + this.xtype); - Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.onRender.call(this, ct, position); + Roo.bootstrap.form.HtmlEditorToolbar.Standard.superclass.onRender.call(this, ct, position); Roo.log(this.el); this.el.dom.style.marginBottom = '0'; var _this = this; @@ -32933,7 +32947,7 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl var editor= this.editor; var children = []; - var btn = function(id,cmd , toggle, handler, html){ + var btn = function(id, cmd , toggle, handler, html){ var event = toggle ? 'toggle' : 'click'; @@ -32942,9 +32956,10 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl xtype: 'Button', xns: Roo.bootstrap, //glyphicon : id, + btnid : id, fa: id, - cmd : id || cmd, - enableToggle:toggle !== false, + cmd : cmd, // why id || cmd + enableToggle: toggle !== false, html : html || '', pressed : toggle ? false : null, listeners : {} @@ -32988,18 +33003,15 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl }); children.push(style); - btn('bold',false,true); - btn('italic',false,true); - btn('align-left', 'justifyleft',true); + btn('bold', false,true); + btn('italic', false,true); + btn('align-left', 'justifyleft',true); btn('align-center', 'justifycenter',true); btn('align-right' , 'justifyright',true); - btn('link', false, false, function(btn) { - //Roo.log("create link?"); - var url = prompt(this.createLinkText, this.defaultLinkValue); - if(url && url != 'http:/'+'/'){ - this.editorcore.relayCmd('createlink', url); - } - }), + btn('link', false, true, this.onLinkClick); + + + btn('image', false, true, this.onImageClick); btn('list','insertunorderedlist',true); btn('list-ol','insertorderedlist',true); @@ -33014,58 +33026,165 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl } } - /* - var cog = { - xtype: 'Button', - size : 'sm', - xns: Roo.bootstrap, - glyphicon : 'cog', - //html : 'submit' - menu : { - xtype: 'Menu', - xns: Roo.bootstrap, - items: [] - } - }; - - cog.menu.items.push({ - xtype :'MenuItem', - xns: Roo.bootstrap, - html : Clean styles, - tagname : f, - listeners : { - click : function() - { - editorcore.insertTag(this.tagname); - editor.focus(); - } - } - - }); - */ - this.xtype = 'NavSimplebar'; + this.xtype = 'NavSimplebar'; // why? for(var i=0;i< children.length;i++) { this.buttons.add(this.addxtypeChild(children[i])); } - + this.buildToolbarDelete(); + editor.on('editorevent', this.updateToolbar, this); }, + + buildToolbarDelete : function() + { + + /* this.addxtypeChild({ + xtype : 'Element', + xns : Roo.bootstrap, + cls : 'roo-htmleditor-fill' + }); + */ + this.deleteBtn = this.addxtypeChild({ + size : 'sm', + xtype: 'Button', + xns: Roo.bootstrap, + fa: 'trash', + listeners : { + click : this.onDelete.createDelegate(this) + } + }); + this.deleteBtn.hide(); + + }, + + onImageClick : function() + { + if (this.input) { + this.input.un('change', this.onFileSelected, this); + } + this.input = Roo.get(document.body).createChild({ + tag: 'input', + type : 'file', + style : 'display:none', + multiple: 'multiple' + }); + this.input.on('change', this.onFileSelected, this); + this.input.dom.click(); + }, + + onFileSelected : function(e) + { + e.preventDefault(); + + if(typeof(this.input.dom.files) == 'undefined' || !this.input.dom.files.length){ + return; + } + + + this.addFiles(Array.prototype.slice.call(this.input.dom.files)); + }, + + addFiles : function(far) { + + if (!far.length) { + return; + } + + var f = far.pop(); + + if (!f.type.match(/^image/)) { + this.addFiles(far); + return; + } + + var sn = this.selectedNode; + + var bl = sn && this.editorcore.enableBlocks ? Roo.htmleditor.Block.factory(sn) : false; + + var editor = this.editorcore; + + var reader = new FileReader(); + reader.addEventListener('load', (function() { + if (bl) { + bl.image_src = reader.result; + //bl.caption = f.name; + bl.updateElement(sn); + editor.owner.fireEvent('editorevent', editor, false); + // we only do the first file!! and replace. + return; + } + if (this.editorcore.enableBlocks) { + var fig = new Roo.htmleditor.BlockFigure({ + image_src : reader.result, + caption : '', + caption_display : 'none' //default to hide captions.. + }); + editor.insertAtCursor(fig.toHTML()); + editor.owner.fireEvent('editorevent', editor, false); + return; + } + // just a standard img.. + if (sn && sn.tagName.toUpperCase() == 'IMG') { + sn.src = reader.result; + editor.owner.fireEvent('editorevent', editor, false); + return; + } + editor.insertAtCursor(''); + editor.owner.fireEvent('editorevent', editor, false); + + }).createDelegate(this)); + reader.readAsDataURL(f); + + + }, + + onBtnClick : function(id) { this.editorcore.relayCmd(id); this.editorcore.focus(); }, + onLinkClick : function(btn) { + var url = this.selectedNode && this.selectedNode.tagName.toUpperCase() == 'A' ? + this.selectedNode.getAttribute('href') : ''; + + Roo.bootstrap.MessageBox.show({ + title : "Add / Edit Link URL", + msg : "Enter the URL for the link", + buttons: Roo.bootstrap.MessageBox.OKCANCEL, + minWidth: 250, + scope : this, + prompt:true, + multiline: false, + modal : true, + value : url, + fn: function(pressed, newurl) { + if (pressed != 'ok') { + this.editorcore.focus(); + return; + } + if (url != '') { + this.selectedNode.setAttribute('href', newurl); + return; + } + if(newurl && newurl .match(/http(s):\/\/.+/)) { + this.editorcore.relayCmd('createlink', newurl); + } + this.editorcore.focus(); + } + }); + }, /** * Protected method that will not generally be called directly. It triggers * a toolbar update by reading the markup state of the current selection in the editor. */ - updateToolbar: function(){ + updateToolbar: function(editor ,ev, sel){ if(!this.editorcore.activated){ this.editor.onFirstFocus(); // is this neeed? @@ -33074,39 +33193,87 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl var btns = this.buttons; var doc = this.editorcore.doc; - btns.get('bold').setActive(doc.queryCommandState('bold')); - btns.get('italic').setActive(doc.queryCommandState('italic')); - //btns.get('underline').setActive(doc.queryCommandState('underline')); + var hasToggle = false; + btns.each(function(e) { + if (e.enableToggle && e.cmd) { + hasToggle = hasToggle || (['align-left', 'align-right', 'align-center'].indexOf(e.btnid) < 0 && doc.queryCommandState(e.cmd)); + e.setActive(doc.queryCommandState(e.cmd)); + } + }, this); - btns.get('align-left').setActive(doc.queryCommandState('justifyleft')); - btns.get('align-center').setActive(doc.queryCommandState('justifycenter')); - btns.get('align-right').setActive(doc.queryCommandState('justifyright')); - //btns[frameId + '-insertorderedlist').setActive(doc.queryCommandState('insertorderedlist')); - btns.get('list').setActive(doc.queryCommandState('insertunorderedlist')); - /* + if (ev && + (ev.type == 'mouseup' || ev.type == 'click' ) && + ev.target && ev.target.tagName != 'BODY' ) { // && ev.target.tagName == 'IMG') { + // they have click on an image... + // let's see if we can change the selection... + sel = ev.target; + + } var ans = this.editorcore.getAllAncestors(); - if (this.formatCombo) { + if (!sel) { + sel = ans.length ? (ans[0] ? ans[0] : ans[1]) : this.editorcore.doc.body; + sel = sel ? sel : this.editorcore.doc.body; + sel = sel.tagName.length ? sel : this.editorcore.doc.body; + } + + var lastSel = this.selectedNode; + this.selectedNode = sel; + + // ok see if we are editing a block? + + var db = false; + // you are not actually selecting the block. + if (sel && sel.hasAttribute('data-block')) { + db = sel; + } else if (sel && sel.closest('[data-block]')) { + db = sel.closest('[data-block]'); + } + + Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e) { + e.classList.remove('roo-ed-selection'); + }); + + var block = false; + if (db && this.editorcore.enableBlocks) { + block = Roo.htmleditor.Block.factory(db); - var store = this.formatCombo.store; - this.formatCombo.setValue(""); - for (var i =0; i < ans.length;i++) { - if (ans[i] && store.query('tag',ans[i].tagName.toLowerCase(), false).length) { - // select it.. - this.formatCombo.setValue(ans[i].tagName.toLowerCase()); - break; - } + if (block) { + db.className = (db.classList.length > 0 ? db.className + ' ' : '') + + ' roo-ed-selection'; + sel = this.selectedNode = db; } } + // highlight the 'a'.. + var tn = sel && sel.tagName.toUpperCase() || ''; + if (!block && sel && tn != 'A') { + var asel = sel.closest('A'); + if (asel) { + sel = asel; + } + } + + btns.get('link').setActive(tn == 'A' && this.selectedNode.hasAttribute('href')); - - // hides menus... - so this cant be on a menu... - Roo.bootstrap.MenuMgr.hideAll(); - */ Roo.bootstrap.menu.Manager.hideAll(); + + + + + + // handle delete button.. + if (hasToggle || (tn.length && tn == 'BODY')) { + this.deleteBtn.hide(); + return; + + } + this.deleteBtn.show(); + + + //this.editorsyncValue(); }, onFirstFocus: function() { @@ -33114,6 +33281,49 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard, Roo.bootstrap.nav.Simpl item.enable(); }); }, + + onDelete : function() + { + var range = this.editorcore.createRange(); + var selection = this.editorcore.getSelection(); + var sn = this.selectedNode; + range.setStart(sn,0); + range.setEnd(sn,0); + + + if (sn.hasAttribute('data-block')) { + var block = Roo.htmleditor.Block.factory(this.selectedNode); + if (block) { + sn = block.removeNode(); + sn.parentNode.removeChild(sn); + selection.removeAllRanges(); + selection.addRange(range); + this.updateToolbar(null, null, null); + this.editorcore.fireEditorEvent(false); + return; + } + + } + if (!sn) { + return; // should not really happen.. + } + if (sn && sn.tagName == 'BODY') { + return; + } + var stn = sn.childNodes[0] || sn.nextSibling || sn.previousSibling || sn.parentNode; + + // remove and keep parents. + a = new Roo.htmleditor.FilterKeepChildren({tag : false}); + a.replaceTag(sn); + + selection.removeAllRanges(); + selection.addRange(range); + this.editorcore.fireEditorEvent(false); + + + }, + + toggleSourceEdit : function(sourceEditMode){ diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6fb2fa9e88..fd03c37149 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -12,6 +12,10 @@ Roo.bootstrap.form={}; Roo.bootstrap.panel={}; // Roo/bootstrap/layout/namespace.js Roo.bootstrap.layout={}; +// Roo/htmleditor/namespace.js +Roo.htmleditor={}; +// Roo/bootstrap/form/HtmlEditorToolbar/namespace.js +Roo.namespace('Roo.bootstrap.form.HtmlEditorToolbar'); // Roo/Shadow.js Roo.Shadow=function(A){Roo.apply(this,A);if(typeof this.mode!="string"){this.mode=this.defaultMode;}var o=this.offset,a={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=o;a.t-=1;if(Roo.isIE){a.l-=this.offset+B; a.t-=this.offset+B;a.w-=B;a.h-=B;a.t+=1;}break;case "sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Roo.isIE){a.l-=(this.offset-B);a.t-=this.offset+B;a.l+=1;a.w-=(this.offset-B)*2;a.w-=B+1;a.h-=1;}break;case "frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Roo.isIE){a.l-=(this.offset-B); @@ -1146,8 +1150,6 @@ else{this.push({type:'controlword',value:this.controlWord,param:this.controlWord );},emitEndGroup:function(){this.emitText();this.push({type:'groupend',pos:this.cpos,row:this.row,col:this.col});},emitIgnorable:function(){this.emitText();this.push({type:'ignorable',pos:this.cpos,row:this.row,col:this.col});},emitHexChar:function(){this.emitText(); this.push({type:'hexchar',value:this.hexChar,pos:this.cpos,row:this.row,col:this.col});this.hexChar=''},emitError:function(A){this.emitText();this.push({type:'error',value:A,row:this.row,col:this.col,char:this.cpos});},emitEndParagraph:function(){this.emitText(); this.push({type:'endparagraph',pos:this.cpos,row:this.row,col:this.col});}}; -// Roo/htmleditor/namespace.js -Roo.htmleditor={}; // Roo/htmleditor/Filter.js Roo.htmleditor.Filter=function(A){Roo.apply(this.cfg);};Roo.htmleditor.Filter.prototype={node:false,tag:false,replaceComment:false,replaceTag:false,walk:function(A){Roo.each(Array.from(A.childNodes),function(e){switch(true){case e.nodeType==8&&this.replaceComment!==false:this.replaceComment(e); return;case e.nodeType!=1:return;case this.tag===true:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return; @@ -1399,28 +1401,41 @@ Roo.HtmlEditorCore.tag_remove=['FONT','TBODY'];Roo.HtmlEditorCore.ablack=['on']; // Roo/bootstrap/form/HtmlEditor.js Roo.bootstrap.form.HtmlEditor=function(A){Roo.bootstrap.form.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true} -);};Roo.extend(Roo.bootstrap.form.HtmlEditor,Roo.bootstrap.form.TextArea,{toolbars:false,btns:[],resize:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,bodyCls:'',toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first(); -},createToolbar:function(){Roo.log('renewing');Roo.log("create toolbars");this.toolbars=[new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor:this})];this.toolbars[0].render(this.toolbarContainer());return;},onRender:function(ct,A){var _t=this;Roo.bootstrap.form.HtmlEditor.superclass.onRender.call(this,ct,A); -this.wrap=this.inputEl().wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);this.createToolbar(this);},onResize:function(w,h){Roo.log('resize: '+w+','+h);Roo.bootstrap.form.HtmlEditor.superclass.onResize.apply(this,arguments); -var ew=false;var eh=false;if(this.inputEl()){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.inputEl().setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=-11;for(var i=0;i'+f+'',tagname:f,listeners:{click:function(){C.insertTag(this.tagname); -D.focus();}}});});E.push(style);F('bold',false,true);F('italic',false,true);F('align-left','justifyleft',true);F('align-center','justifycenter',true);F('align-right','justifyright',true);F('link',false,false,function(G){var H=prompt(this.createLinkText,this.defaultLinkValue); -if(H&&H!='http:/'+'/'){this.editorcore.relayCmd('createlink',H);}}),F('list','insertunorderedlist',true);F('list-ol','insertorderedlist',true);F('pencil',false,true,function(G){Roo.log(this);this.toggleSourceEdit(G.pressed);});if(this.editor.btns.length>0){for(var i=0; -i0){for(var i=0;i');B.owner.fireEvent('editorevent',B,false);}).createDelegate(this));C.readAsDataURL(f);},onBtnClick:function(id){this.editorcore.relayCmd(id); +this.editorcore.focus();},onLinkClick:function(A){var B=this.selectedNode&&this.selectedNode.tagName.toUpperCase()=='A'?this.selectedNode.getAttribute('href'):'';Roo.bootstrap.MessageBox.show({title:"Add / Edit Link URL",msg:"Enter the URL for the link",buttons:Roo.bootstrap.MessageBox.OKCANCEL,minWidth:250,scope:this,prompt:true,multiline:false,modal:true,value:B,fn:function(C,D){if(C!='ok'){this.editorcore.focus(); +return;}if(B!=''){this.selectedNode.setAttribute('href',D);return;}if(D&&D.match(/http(s):\/\/.+/)){this.editorcore.relayCmd('createlink',D);}this.editorcore.focus();}});},updateToolbar:function(A,ev,B){if(!this.editorcore.activated){this.editor.onFirstFocus(); +return;}var C=this.buttons;var D=this.editorcore.doc;var E=false;C.each(function(e){if(e.enableToggle&&e.cmd){E=E||(['align-left','align-right','align-center'].indexOf(e.btnid)<0&&D.queryCommandState(e.cmd));e.setActive(D.queryCommandState(e.cmd));}},this); +if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName!='BODY'){B=ev.target;}var F=this.editorcore.getAllAncestors();if(!B){B=F.length?(F[0]?F[0]:F[1]):this.editorcore.doc.body;B=B?B:this.editorcore.doc.body;B=B.tagName.length?B:this.editorcore.doc.body; +}var G=this.selectedNode;this.selectedNode=B;var db=false;if(B&&B.hasAttribute('data-block')){db=B;}else if(B&&B.closest('[data-block]')){db=B.closest('[data-block]');}Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e){e.classList.remove('roo-ed-selection'); +});var H=false;if(db&&this.editorcore.enableBlocks){H=Roo.htmleditor.Block.factory(db);if(H){db.className=(db.classList.length>0?db.className+' ':'')+' roo-ed-selection';B=this.selectedNode=db;}}var tn=B&&B.tagName.toUpperCase()||'';if(!H&&B&&tn!='A'){var I=B.closest('A'); +if(I){B=I;}}C.get('link').setActive(tn=='A'&&this.selectedNode.hasAttribute('href'));Roo.bootstrap.menu.Manager.hideAll();if(E||(tn.length&&tn=='BODY')){this.deleteBtn.hide();return;}this.deleteBtn.show();},onFirstFocus:function(){this.buttons.each(function(A){A.enable(); +});},onDelete:function(){var A=this.editorcore.createRange();var B=this.editorcore.getSelection();var sn=this.selectedNode;A.setStart(sn,0);A.setEnd(sn,0);if(sn.hasAttribute('data-block')){var C=Roo.htmleditor.Block.factory(this.selectedNode);if(C){sn=C.removeNode(); +sn.parentNode.removeChild(sn);B.removeAllRanges();B.addRange(A);this.updateToolbar(null,null,null);this.editorcore.fireEditorEvent(false);return;}}if(!sn){return;}if(sn&&sn.tagName=='BODY'){return;}var D=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode; +a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.replaceTag(sn);B.removeAllRanges();B.addRange(A);this.editorcore.fireEditorEvent(false);},toggleSourceEdit:function(A){if(A){Roo.log("disabling buttons");this.buttons.each(function(B){if(B.cmd!='pencil'){B.disable(); +}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.buttons.each(function(B){B.enable();});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);}}); // Roo/bootstrap/form/Markdown.js Roo.bootstrap.form.Markdown=function(A){Roo.bootstrap.form.Markdown.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.Markdown,Roo.bootstrap.form.TextArea,{editing:false,initEvents:function(){Roo.bootstrap.form.TextArea.prototype.initEvents.call(this); this.markdownEl=this.el.createChild({cls:'roo-markdown-area'});this.inputEl().addClass('d-none');if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('{0}',this.placeholder||'');}else{this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); diff --git a/roojs-debug.js b/roojs-debug.js index b2be9abe0a..c2673fe021 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -24983,8 +24983,8 @@ Roo.data.Store = function(config){ * If you return Json { data: [] , success: false, .... } then this will be thrown with the following args * * @param {Proxy} - * @param {Object} return from JsonData.reader() - success, totalRecords, records - * @param {Object} load options + * @param {Object} ret return data from JsonData.reader() - success, totalRecords, records + * @param {Object} opts - load Options * @param {Object} jsonData from your request (normally this contains the Exception) */ loadexception : true @@ -25990,24 +25990,24 @@ Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, { // thse are take from connection... /** - * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined) + * @cfg {String} url The default URL to be used for requests to the server. (defaults to undefined) */ /** - * @cfg {Object} extraParams (Optional) An object containing properties which are used as + * @cfg {Object} extraParams An object containing properties which are used as * extra parameters to each request made by this object. (defaults to undefined) */ /** - * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added + * @cfg {Object} defaultHeaders An object containing request headers which are added * to each request made by this object. (defaults to undefined) */ /** - * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) + * @cfg {String} method (GET|POST) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) */ /** - * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) + * @cfg {Number} timeout The timeout in milliseconds to be used for requests. (defaults to 30000) */ /** - * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false) + * @cfg {Boolean} autoAbort Whether this request should abort any pending requests. (defaults to false) * @type Boolean */ @@ -50742,6 +50742,8 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) { return; // we do not handle this.. (undo manager does..) } + // clicking a 'block'? + // in theory this detects if the last element is not a br, then we try and do that. // its so clicking in space at bottom triggers adding a br and moving the cursor. if (e && @@ -61990,6 +61992,11 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Roo.Toolbar} toolbar a toolbar for buttons etc. */ + + /** + * @cfg {Roo.PagingToolbar} footer the paging toolbar + */ + /** * @cfg {String} ddGroup - drag drop group. */ diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 2bf686eb8e..8b32c12b09 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -481,8 +481,8 @@ Roo.data.Store = function(config){ * If you return Json { data: [] , success: false, .... } then this will be thrown with the following args * * @param {Proxy} - * @param {Object} return from JsonData.reader() - success, totalRecords, records - * @param {Object} load options + * @param {Object} ret return data from JsonData.reader() - success, totalRecords, records + * @param {Object} opts - load Options * @param {Object} jsonData from your request (normally this contains the Exception) */ loadexception : true @@ -1488,24 +1488,24 @@ Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, { // thse are take from connection... /** - * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined) + * @cfg {String} url The default URL to be used for requests to the server. (defaults to undefined) */ /** - * @cfg {Object} extraParams (Optional) An object containing properties which are used as + * @cfg {Object} extraParams An object containing properties which are used as * extra parameters to each request made by this object. (defaults to undefined) */ /** - * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added + * @cfg {Object} defaultHeaders An object containing request headers which are added * to each request made by this object. (defaults to undefined) */ /** - * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) + * @cfg {String} method (GET|POST) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET) */ /** - * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) + * @cfg {Number} timeout The timeout in milliseconds to be used for requests. (defaults to 30000) */ /** - * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false) + * @cfg {Boolean} autoAbort Whether this request should abort any pending requests. (defaults to false) * @type Boolean */ @@ -26240,6 +26240,8 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) { return; // we do not handle this.. (undo manager does..) } + // clicking a 'block'? + // in theory this detects if the last element is not a br, then we try and do that. // its so clicking in space at bottom triggers adding a br and moving the cursor. if (e && @@ -37488,6 +37490,11 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Roo.Toolbar} toolbar a toolbar for buttons etc. */ + + /** + * @cfg {Roo.PagingToolbar} footer the paging toolbar + */ + /** * @cfg {String} ddGroup - drag drop group. */ -- 2.39.2