X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-debug.js;h=6e125677b4ccfa217eab4364585544cee9afdbd6;hp=e956860183116233b7b90207bfc4348535c8817a;hb=refs%2Fheads%2Fwip_alan_T6011_fixing_surrogate_characters;hpb=16d585588738895fd73db1cc2cf3754144012aab diff --git a/roojs-debug.js b/roojs-debug.js index e956860183..6e125677b4 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -39532,7 +39532,11 @@ Roo.extend(Roo.form.TextField, Roo.form.Field, { // private - clean the leading white space cleanLeadingSpace : function(e) { - this.setValue(this.getValue().replace(/^\s+/,'')); + if ( this.inputType == 'file') { + return; + } + + this.setValue((this.getValue() + '').replace(/^\s+/,'')); }, /** * Resets the current field value to the originally-loaded value and clears any validation messages. @@ -40293,7 +40297,8 @@ Roo.extend(Roo.form.NumberField, Roo.form.TextField, { * Create a new DateField * @param {Object} config */ -Roo.form.DateField = function(config){ +Roo.form.DateField = function(config) +{ Roo.form.DateField.superclass.constructor.call(this, config); this.addEvents({ @@ -40641,7 +40646,13 @@ dateField.setValue('2006-5-4'); return String(this.getValue()) !== String(this.startValue); + }, + // @overide + cleanLeadingSpace : function(e) + { + return; } + });/* * Based on: * Ext JS Library 1.1.1 @@ -42115,7 +42126,7 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, { this.view.select(match); var sn = Roo.get(this.view.getSelectedNodes()[0]); sn.scrollIntoView(sn.dom.parentNode, false); - } + } /** * @cfg {Boolean} grow @@ -43239,17 +43250,32 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { html = this.cleanHtml(html); // fix up the special chars.. normaly like back quotes in word... // however we do not want to do this with chinese.. - html = html.replace(/([\x80-\uffff])/g, function (a, b) { - var cc = b.charCodeAt(); - if ( + html = html.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g, function(match) { + + var cc = match.charCodeAt(); + + // Get the character value, handling surrogate pairs + if (match.length == 2) { + // It's a surrogate pair, calculate the Unicode code point + var high = match.charCodeAt(0) - 0xD800; + var low = match.charCodeAt(1) - 0xDC00; + cc = (high * 0x400) + low + 0x10000; + } else if ( (cc >= 0x4E00 && cc < 0xA000 ) || (cc >= 0x3400 && cc < 0x4E00 ) || (cc >= 0xf900 && cc < 0xfb00 ) ) { - return b; - } - return "&#"+cc+";" + return match; + } + + // No, use a numeric entity. Here we brazenly (and possibly mistakenly) + return "&#" + cc + ";"; + + }); + + + if(this.owner.fireEvent('beforesync', this, html) !== false){ this.el.dom.value = html; this.owner.fireEvent('sync', this, html); @@ -52580,7 +52606,7 @@ Roo.extend(Roo.LayoutRegion, Roo.BasicLayoutRegion, { * Collapses this region. * @param {Boolean} skipAnim (optional) true to collapse the element without animation (if animate is true) */ - collapse : function(skipAnim, skipCheck = false){ + collapse : function(skipAnim, skipCheck){ if(this.collapsed) { return; }