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])));
}
}
imgResponsive: true,
border: '',
- src: 'about:blank',
+ src: 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=',
href: false,
target: false,
xsUrl: '',
cls: 'glyphicon form-control-feedback'
};
- if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
+ if(this.hasFeedback && this.inputType != 'hidden'){
inputblock = {
cls : 'has-feedback',
});
}
- if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
+ if(this.hasFeedback && this.inputType != 'hidden'){
inputblock.cls += ' has-feedback';
inputblock.cn.push(feedback);
}
*/
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
* @return {Mixed} value The field value
*/
getValue : function(){
-
var v = this.inputEl().getValue();
-
return v;
},
/**
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('');
}
}
* Mark this field as valid
*/
markValid : function()
- {
+ {
if(!this.el || this.preventMark){ // not rendered...
return;
}
if(feedback){
this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]);
+ feedback.update('');
}
if(this.indicator){
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();
if(feedback){
this.el.select('.form-control-feedback', true).first().removeClass(
[this.invalidFeedbackClass, this.validFeedbackClass]);
+ feedback.update('');
}
if(this.disabled){
- 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);
}
}
var inputblock = input;
- if(this.hasFeedback && !this.allowBlank){
+ if(this.hasFeedback){
var feedback = {
tag: 'span',
inputblock.cn.push(input);
- if(this.hasFeedback && !this.allowBlank){
+ if(this.hasFeedback){
inputblock.cls += ' has-feedback';
inputblock.cn.push(feedback);
}
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('');
}
}
if(feedback){
this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]);
+ feedback.update('');
}
if(this.disabled || this.allowBlank){
}
- 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();
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;
}
}
// 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);
}
}
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();
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;
}
'rowspan',
'data-display',
'data-width',
+ 'data-caption',
'start' ,
'style',
// youtube embed.
var parser = new Roo.rtf.Parser(cd.getData('text/rtf'));
images = parser.doc ? parser.doc.getElementsByType('pict') : [];
}
- //Roo.log(images);
- //Roo.log(imgs);
+ // Roo.log(images);
+ // Roo.log(imgs);
// fixme..
images = images.filter(function(g) { return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/); }) // ignore headers/footers etc.
.map(function(g) { return g.toDataURL(); })
* 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
});
tbContainer : false,
bodyCls : '',
+
+ linkDialogCls : '',
toolbarContainer :function() {
return this.wrap.select('.x-html-editor-tb',true).first();
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;
}
}
// 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 +'">');
}
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
});
},
/**
{
tag : 'iframe',
style : 'border: 0px',
- src : 'about:blank'
+ src : 'data:text/html,%3Cbody%3E%3C%2Fbody%3E'
}
];
}