mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-22 17:31:28 +00:00
update dojo to 1.7.3
This commit is contained in:
@@ -1,103 +1,2 @@
|
||||
/*
|
||||
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
|
||||
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.form.SimpleTextarea"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.form.SimpleTextarea"] = true;
|
||||
dojo.provide("dijit.form.SimpleTextarea");
|
||||
dojo.require("dijit.form.TextBox");
|
||||
|
||||
|
||||
dojo.declare("dijit.form.SimpleTextarea",
|
||||
dijit.form.TextBox,
|
||||
{
|
||||
// summary:
|
||||
// A simple textarea that degrades, and responds to
|
||||
// minimal LayoutContainer usage, and works with dijit.form.Form.
|
||||
// Doesn't automatically size according to input, like Textarea.
|
||||
//
|
||||
// example:
|
||||
// | <textarea dojoType="dijit.form.SimpleTextarea" name="foo" value="bar" rows=30 cols=40></textarea>
|
||||
//
|
||||
// example:
|
||||
// | new dijit.form.SimpleTextarea({ rows:20, cols:30 }, "foo");
|
||||
|
||||
baseClass: "dijitTextBox dijitTextArea",
|
||||
|
||||
attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, {
|
||||
rows:"textbox", cols: "textbox"
|
||||
}),
|
||||
|
||||
// rows: Number
|
||||
// The number of rows of text.
|
||||
rows: "3",
|
||||
|
||||
// rows: Number
|
||||
// The number of characters per line.
|
||||
cols: "20",
|
||||
|
||||
templateString: "<textarea ${!nameAttrSetting} dojoAttachPoint='focusNode,containerNode,textbox' autocomplete='off'></textarea>",
|
||||
|
||||
postMixInProperties: function(){
|
||||
// Copy value from srcNodeRef, unless user specified a value explicitly (or there is no srcNodeRef)
|
||||
// TODO: parser will handle this in 2.0
|
||||
if(!this.value && this.srcNodeRef){
|
||||
this.value = this.srcNodeRef.value;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
if(dojo.isIE && this.cols){ // attribute selectors is not supported in IE6
|
||||
dojo.addClass(this.textbox, "dijitTextAreaCols");
|
||||
}
|
||||
},
|
||||
|
||||
filter: function(/*String*/ value){
|
||||
// Override TextBox.filter to deal with newlines... specifically (IIRC) this is for IE which writes newlines
|
||||
// as \r\n instead of just \n
|
||||
if(value){
|
||||
value = value.replace(/\r/g,"");
|
||||
}
|
||||
return this.inherited(arguments);
|
||||
},
|
||||
|
||||
_previousValue: "",
|
||||
_onInput: function(/*Event?*/ e){
|
||||
// Override TextBox._onInput() to enforce maxLength restriction
|
||||
if(this.maxLength){
|
||||
var maxLength = parseInt(this.maxLength);
|
||||
var value = this.textbox.value.replace(/\r/g,'');
|
||||
var overflow = value.length - maxLength;
|
||||
if(overflow > 0){
|
||||
if(e){ dojo.stopEvent(e); }
|
||||
var textarea = this.textbox;
|
||||
if(textarea.selectionStart){
|
||||
var pos = textarea.selectionStart;
|
||||
var cr = 0;
|
||||
if(dojo.isOpera){
|
||||
cr = (this.textbox.value.substring(0,pos).match(/\r/g) || []).length;
|
||||
}
|
||||
this.textbox.value = value.substring(0,pos-overflow-cr)+value.substring(pos-cr);
|
||||
textarea.setSelectionRange(pos-overflow, pos-overflow);
|
||||
}else if(dojo.doc.selection){ //IE
|
||||
textarea.focus();
|
||||
var range = dojo.doc.selection.createRange();
|
||||
// delete overflow characters
|
||||
range.moveStart("character", -overflow);
|
||||
range.text = '';
|
||||
// show cursor
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
this._previousValue = this.textbox.value;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//>>built
|
||||
define("dijit/form/SimpleTextarea",["dojo/_base/declare","dojo/dom-class","dojo/_base/sniff","dojo/_base/window","./TextBox"],function(_1,_2,_3,_4,_5){return _1("dijit.form.SimpleTextarea",_5,{baseClass:"dijitTextBox dijitTextArea",rows:"3",cols:"20",templateString:"<textarea ${!nameAttrSetting} data-dojo-attach-point='focusNode,containerNode,textbox' autocomplete='off'></textarea>",postMixInProperties:function(){if(!this.value&&this.srcNodeRef){this.value=this.srcNodeRef.value;}this.inherited(arguments);},buildRendering:function(){this.inherited(arguments);if(_3("ie")&&this.cols){_2.add(this.textbox,"dijitTextAreaCols");}},filter:function(_6){if(_6){_6=_6.replace(/\r/g,"");}return this.inherited(arguments);},_onInput:function(e){if(this.maxLength){var _7=parseInt(this.maxLength);var _8=this.textbox.value.replace(/\r/g,"");var _9=_8.length-_7;if(_9>0){var _a=this.textbox;if(_a.selectionStart){var _b=_a.selectionStart;var cr=0;if(_3("opera")){cr=(this.textbox.value.substring(0,_b).match(/\r/g)||[]).length;}this.textbox.value=_8.substring(0,_b-_9-cr)+_8.substring(_b-cr);_a.setSelectionRange(_b-_9,_b-_9);}else{if(_4.doc.selection){_a.focus();var _c=_4.doc.selection.createRange();_c.moveStart("character",-_9);_c.text="";_c.select();}}}}this.inherited(arguments);}});});
|
||||
Reference in New Issue
Block a user