From: Alan Date: Tue, 25 Apr 2023 05:19:32 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=1aec3e419db01b51451ee0d712f74576aa64fffe sync --- diff --git a/docs/json/roodata.json b/docs/json/roodata.json index e5929846a9..353c9cd9c5 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -134801,7 +134801,7 @@ "name" : "imagedelete", "type" : "function", "desc" : "Fires when on any editor when an image is deleted", - "sig" : "function (_self, img)\n{\n\n}", + "sig" : "function (_self, img, oldSrc)\n{\n\n}", "memberOf" : "", "example" : "", "deprecated" : "", @@ -134819,6 +134819,12 @@ "type" : "HTMLElement", "desc" : "could also be a figure if blocks are enabled", "isOptional" : false + }, + { + "name" : "oldSrc", + "type" : "HTMLElement", + "desc" : "source of image being replaced", + "isOptional" : false } ], "returns" : [] diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index ef5a76808f..2ae548c801 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -395,6 +395,7 @@ 'rowspan', 'data-display', 'data-width', + 'data-caption', 'start' , 'style', // youtube embed. diff --git a/docs/src/Roo_bootstrap_Component.js.html b/docs/src/Roo_bootstrap_Component.js.html index d4636f258f..90a1d6c12e 100644 --- a/docs/src/Roo_bootstrap_Component.js.html +++ b/docs/src/Roo_bootstrap_Component.js.html @@ -360,7 +360,7 @@ if (!skip_children) { for(var i =0;i < items.length;i++) { // Roo.log(['add child', items[i]]); - nitems.push(cn.addxtype(Roo.apply({}, items[i]))); + nitems.push(cn.addxtype(items[i].xns == false ? items[i] : Roo.apply({}, items[i]))); } } diff --git a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html index 653ba0127f..5cb881c7b2 100644 --- a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html +++ b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html @@ -122,6 +122,7 @@ * Fires when on any editor when an image is deleted * @param {Roo.bootstrap.form.HtmlEditor} this * @param {HTMLElement} img could also be a figure if blocks are enabled + * @param {HTMLElement} oldSrc source of image being replaced */ imagedelete: true }); @@ -184,6 +185,8 @@ bodyCls : '', + linkDialogCls : '', + toolbarContainer :function() { return this.wrap.select('.x-html-editor-tb',true).first(); }, diff --git a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html index e77a2a58f0..c265887009 100644 --- a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html +++ b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html @@ -253,12 +253,13 @@ var reader = new FileReader(); reader.addEventListener('load', (function() { if (bl) { + var oldSrc = bl.image_src; bl.image_src = reader.result; //bl.caption = f.name; bl.updateElement(sn); this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); // we only do the first file!! and replace. return; } @@ -274,10 +275,11 @@ } // just a standard img.. if (sn && sn.tagName.toUpperCase() == 'IMG') { + var oldSrc = sn.src; sn.src = reader.result; this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); return; } editor.insertAtCursor('<img src="' + reader.result +'">'); @@ -317,14 +319,16 @@ } if (url != '') { this.selectedNode.setAttribute('href', newurl); + this.editor.syncValue(); return; } if(newurl && newurl .match(/http(s):\/\/.+/)) { this.editorcore.relayCmd('createlink', newurl); } this.editorcore.focus(); - } - }); + }, + cls : this.editorcore.linkDialogCls + }); }, /** * Protected method that will not generally be called directly. It triggers diff --git a/docs/src/Roo_bootstrap_form_Input.js.html b/docs/src/Roo_bootstrap_form_Input.js.html index 2d1aba7667..2800b970d9 100644 --- a/docs/src/Roo_bootstrap_form_Input.js.html +++ b/docs/src/Roo_bootstrap_form_Input.js.html @@ -341,7 +341,7 @@ cls: 'glyphicon form-control-feedback' }; - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ inputblock = { cls : 'has-feedback', @@ -396,7 +396,7 @@ }); } - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ inputblock.cls += ' has-feedback'; inputblock.cn.push(feedback); } @@ -801,7 +801,9 @@ */ reset : function(){ this.setValue(this.originalValue); - this.validate(); + // this.validate(); + this.el.removeClass([this.invalidClass, this.validClass]); + this.inputEl().removeClass(['is-valid', 'is-invalid']); }, /** * Returns the name of the field @@ -815,9 +817,7 @@ * @return {Mixed} value The field value */ getValue : function(){ - var v = this.inputEl().getValue(); - return v; }, /** @@ -910,12 +910,14 @@ this.el.removeClass([this.invalidClass, 'is-invalid']); - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass(this.invalidFeedbackClass); + + feedback.update(''); } } @@ -944,6 +946,7 @@ if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]); + feedback.update(''); } if(this.indicator){ @@ -965,7 +968,7 @@ this.inputEl().addClass('is-valid'); } - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank && (this.getValue().length || this.forceFeedback)){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); @@ -997,6 +1000,7 @@ if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass( [this.invalidFeedbackClass, this.validFeedbackClass]); + feedback.update(''); } if(this.disabled){ @@ -1019,15 +1023,19 @@ - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]); - if(this.getValue().length || this.forceFeedback){ - this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); + this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); + + feedback.update(this.invalidText); + + if(!this.allowBlank && !this.getRawValue().length){ + feedback.update(this.blankText); } } diff --git a/docs/src/Roo_bootstrap_form_TextArea.js.html b/docs/src/Roo_bootstrap_form_TextArea.js.html index b39421f305..cf79eddf62 100644 --- a/docs/src/Roo_bootstrap_form_TextArea.js.html +++ b/docs/src/Roo_bootstrap_form_TextArea.js.html @@ -92,7 +92,7 @@ var inputblock = input; - if(this.hasFeedback && !this.allowBlank){ + if(this.hasFeedback){ var feedback = { tag: 'span', @@ -125,7 +125,7 @@ inputblock.cn.push(input); - if(this.hasFeedback && !this.allowBlank){ + if(this.hasFeedback){ inputblock.cls += ' has-feedback'; inputblock.cn.push(feedback); } @@ -179,12 +179,14 @@ this.el.removeClass( this.validClass); this.inputEl().removeClass('is-invalid'); - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass(this.invalidFeedbackClass); + + feedback.update(''); } } @@ -208,6 +210,7 @@ if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]); + feedback.update(''); } if(this.disabled || this.allowBlank){ @@ -227,7 +230,7 @@ } - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank && (this.getValue().length || this.forceFeedback)){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); @@ -258,9 +261,10 @@ if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]); + feedback.update(''); } - if(this.disabled || this.allowBlank){ + if(this.disabled){ return; } @@ -284,15 +288,19 @@ } // fixme ... this may be depricated need to test.. - if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){ + if(this.hasFeedback && this.inputType != 'hidden'){ var feedback = this.el.select('.form-control-feedback', true).first(); if(feedback){ this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]); - if(this.getValue().length || this.forceFeedback){ - this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); + this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); + + feedback.update(this.invalidText); + + if(!this.allowBlank && !this.getRawValue().length){ + feedback.update(this.blankText); } } diff --git a/docs/src/Roo_bootstrap_form_TimeField.js.html b/docs/src/Roo_bootstrap_form_TimeField.js.html index 60bf02e0f0..82547ff77c 100644 --- a/docs/src/Roo_bootstrap_form_TimeField.js.html +++ b/docs/src/Roo_bootstrap_form_TimeField.js.html @@ -280,7 +280,11 @@ update: function() { - + // default minute is a multiple of minuteStep + if(typeof(this.time) === 'undefined') { + this.time = new Date(); + this.time = this.time.add(Date.MINUTE, Math.round(parseInt(this.time.format('i')) / this.minuteStep) * this.minuteStep - parseInt(this.time.format('i'))); + } this.time = (typeof(this.time) === 'undefined') ? new Date() : this.time; this.fill(); diff --git a/docs/src/Roo_htmleditor_BlockFigure.js.html b/docs/src/Roo_htmleditor_BlockFigure.js.html index 7c012dfdf9..4991c1e3c3 100644 --- a/docs/src/Roo_htmleditor_BlockFigure.js.html +++ b/docs/src/Roo_htmleditor_BlockFigure.js.html @@ -405,7 +405,7 @@ this.caption_display = this.getVal(node, 'figcaption', 'data-display'); - var dc = this.getVal(node, 'figcaption', 'data-caption'); + var dc = this.getVal(node, true, 'data-caption'); if (dc && dc.length) { this.caption = dc; } diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json index ffaf9ea289..cb33a676ad 100644 --- a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json @@ -1967,7 +1967,7 @@ "name" : "imagedelete", "type" : "function", "desc" : "Fires when on any editor when an image is deleted", - "sig" : "function (_self, img)\n{\n\n}", + "sig" : "function (_self, img, oldSrc)\n{\n\n}", "memberOf" : "", "example" : "", "deprecated" : "", @@ -1985,6 +1985,12 @@ "type" : "HTMLElement", "desc" : "could also be a figure if blocks are enabled", "isOptional" : false + }, + { + "name" : "oldSrc", + "type" : "HTMLElement", + "desc" : "source of image being replaced", + "isOptional" : false } ], "returns" : []