X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui-debug.js;h=d9cf68f9bf49ec8f367ea7c66ad6f68bda852e15;hb=248c5cdd0fe1c3012360d530f5fd34ef516a79fb;hp=55c765320bf93ff20f1273abcef8a902d8c7fa25;hpb=033b515c313074785a53f256cf1d15791c6f58ca;p=roojs1 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 55c765320b..d9cf68f9bf 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 */ @@ -21661,7 +21661,7 @@ Roo.htmleditor.FilterWord = function(cfg) this.replaceAname(cfg.node); // this is disabled as the removal is done by other filters; // this.walk(cfg.node); - + this.replaceImageTable(cfg.node); } @@ -21890,14 +21890,19 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, if (!spans.length) { continue; } - var ff = spans[0].style.fontFamily; - if (!spans[0].hasAttribute('style') && spans.length > 1 && spans[1].hasAttribute('style')) { - - ff = spans[1].style.fontFamily; + var ff = ''; + var se = spans[0]; + for (var i = 0; i < spans.length;i++) { + se = spans[i]; + if (se.hasAttribute('style') && se.hasAttribute('style') && se.style.fontFamily != '') { + ff = se.style.fontFamily; + break; + } } - //var style = this.styleToObject(spans[0]); + + //Roo.log("got font family: " + ff); - if (typeof(ff) != 'undefined' && !ff.match(/Symbol/)) { + if (typeof(ff) != 'undefined' && !ff.match(/(Symbol|Wingdings)/) && "·o".indexOf(se.innerText.trim()) < 0) { listtype = 'ol'; } @@ -22015,9 +22020,63 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, - } - + }, + replaceImageTable : function(doc) + { + /* + + + + + + + + +
+ */ + var imgs = Array.from(doc.getElementsByTagName('img')); + Roo.each(imgs, function(img) { + var td = img.parentNode; + if (td.nodeName != 'TD') { + return; + } + var tr = td.parentNode; + if (tr.nodeName != 'TR') { + return; + } + var tbody = tr.parentNode; + if (tbody.nodeName != 'TBODY') { + return; + } + var table = tbody.parentNode; + if (table.nodeName != 'TABLE') { + return; + } + // first row.. + + if (table.getElementsByTagName('tr').length != 2) { + return; + } + if (table.getElementsByTagName('td').length != 3) { + return; + } + if (table.innerText.trim() != '') { + return; + } + var p = table.parentNode; + img.parentNode.removeChild(img); + p.insertBefore(img, table); + p.removeChild(table); + + + + }); + + + } }); /** @@ -23935,7 +23994,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { } }, - + { xtype : 'Button', text: 'Hide Caption', @@ -25984,9 +26043,34 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { var urlAPI = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL); - - var url = urlAPI.createObjectURL( cd.files[0]); - this.insertAtCursor(''); + + var r = new FileReader(); + var t = this; + r.addEventListener('load',function() + { + + var d = (new DOMParser().parseFromString('', 'text/html')).body; + // is insert asycn? + if (t.enableBlocks) { + + Array.from(d.getElementsByTagName('img')).forEach(function(img) { + if (img.closest('figure')) { // assume!! that it's aready + return; + } + var fig = new Roo.htmleditor.BlockFigure({ + image_src : img.src + }); + fig.updateElement(img); // replace it.. + + }); + } + t.insertAtCursor(d.innerHTML.replace(/ /g,' ')); + t.owner.fireEvent('paste', this); + }); + r.readAsDataURL(cd.files[0]); + + e.preventDefault(); + return false; } if (cd.types.indexOf('text/html') < 0 ) { @@ -26156,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 && @@ -26258,6 +26344,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { break; case 'bold': case 'italic': + case 'underline': // if there is no selection, then we insert, and set the curson inside it.. this.execCmd('styleWithCSS', false); break; @@ -37404,6 +37491,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. */