defaultAutoCreate : { // modified by initCompnoent..
tag: "textarea",
style:"width:500px;height:300px;",
- autocomplete: "off"
+ autocomplete: "new-password"
},
// private
* preview the saved version of htmlEditor
* @param {HtmlEditor} this
*/
- savedpreview: true
+ savedpreview: true,
+
+ /**
+ * @event stylesheetsclick
+ * Fires when press the Sytlesheets button
+ * @param {Roo.HtmlEditorCore} this
+ */
+ stylesheetsclick: true
});
this.defaultAutoCreate = {
tag: "textarea",
style:'width: ' + this.width + 'px;height: ' + this.height + 'px;',
- autocomplete: "off"
+ autocomplete: "new-password"
};
},
"tab" : function(e){
e.preventDefault();
- Roo.log('TAB');
var value = this.getValue();
var start = this.el.dom.selectionStart;
var end = this.el.dom.selectionEnd;
- this.setValue(value.substring(0, start) + "\t" + value.substring(end));
+ if(!e.shiftKey){
+
+ this.setValue(value.substring(0, start) + "\t" + value.substring(end));
+ this.el.dom.setSelectionRange(end + 1, end + 1);
+ return;
+ }
+
+ var f = value.substring(0, start).split("\t");
+
+ if(f.pop().length != 0){
+ return;
+ }
+
+ this.setValue(f.join("\t") + value.substring(end));
+ this.el.dom.setSelectionRange(start - 1, start - 1);
- this.el.dom.setSelectionRange(end + 1, end + 1);
},
"home" : function(e){
if(!lines.length){
return;
}
+
+ if(e.ctrlKey){
+ this.el.dom.setSelectionRange(0, 0);
+ return;
+ }
+
var pos = 0;
for (var i = 0; i < lines.length;i++) {
break;
}
- this.el.dom.setSelectionRange(pos, pos);
+ if(!e.shiftKey){
+ this.el.dom.setSelectionRange(pos, pos);
+ return;
+ }
+
+ this.el.dom.selectionStart = pos;
+ this.el.dom.selectionEnd = curr;
},
"end" : function(e){
if(!lines.length){
return;
}
+
+ if(e.ctrlKey){
+ this.el.dom.setSelectionRange(this.getValue().length, this.getValue().length);
+ return;
+ }
+
var pos = 0;
for (var i = 0; i < lines.length;i++) {
break;
}
- this.el.dom.setSelectionRange(pos, pos);
+ if(!e.shiftKey){
+ this.el.dom.setSelectionRange(pos, pos);
+ return;
+ }
+
+ this.el.dom.selectionStart = curr;
+ this.el.dom.selectionEnd = pos;
},
scope : this,
var ah = h - this.wrap.getFrameWidth('tb') - tbh;// this.tb.el.getHeight();
ah -= 5; // knock a few pixes off for look..
- Roo.log(ah);
+// Roo.log(ah);
this.el.setHeight(this.adjustWidth('textarea', ah));
var eh = ah;
}
pushValue : function()
{
this.editorcore.pushValue();
+ },
+
+ setStylesheets : function(stylesheets)
+ {
+ this.editorcore.setStylesheets(stylesheets);
+ },
+
+ removeStylesheets : function()
+ {
+ this.editorcore.removeStylesheets();
}