supporting multiple bullet point styles
[roojs1] / roojs-bootstrap-debug.js
index 0a676f7..ee55272 100644 (file)
@@ -10335,7 +10335,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
             var id = false;
             
             if(typeof(renderer) !== 'undefined'){
-                value = renderer(d.data[cm.getDataIndex(i)], false, d);
+                value = renderer.call(config, d.data[cm.getDataIndex(i)], false, d);
             }
             // if object are returned, then they are expected to be Roo.bootstrap.Component instances
             // and are rendered into the cells after the row is rendered - using the id for the element.
@@ -27225,14 +27225,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';
                 }
                 
@@ -31373,26 +31378,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]);
-             var d = (new DOMParser().parseFromString('<img src="' + url + '">', 'text/html')).body;
-            // is insert asycn?
-            if (this.enableBlocks) {
+            
+            var r = new FileReader();
+            var t = this;
+            r.addEventListener('load',function()
+            {
                 
-                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..
+                var d = (new DOMParser().parseFromString('<img src="' + r.result+ '">', 'text/html')).body;
+                // is insert asycn?
+                if (t.enableBlocks) {
                     
-                });
-            }
-            this.insertAtCursor(d.innerHTML.replace(/&nbsp;/g,' '));
+                    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(/&nbsp;/g,' '));
+                t.owner.fireEvent('paste', this);
+            });
+            r.readAsDataURL(cd.files[0]);
+            
             e.preventDefault();
-            this.owner.fireEvent('paste', this);
+            
             return false;
         }
         if (cd.types.indexOf('text/html') < 0 ) {