1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 21:25:55 +00:00

upgrade Dojo to 1.6.1

This commit is contained in:
Andrew Dolgov
2011-11-08 20:40:44 +04:00
parent 870a70e109
commit 81bea17aef
680 changed files with 51915 additions and 74107 deletions

View File

@@ -175,7 +175,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
if (treeNode) { if (treeNode) {
treeNode = treeNode[0]; treeNode = treeNode[0];
if (!is_cat) this._expandNode(treeNode); if (!is_cat) this._expandNode(treeNode);
this._selectNode(treeNode); this.set("selectedNodes", [treeNode]);
} }
}, },
setFeedIcon: function(feed, is_cat, src) { setFeedIcon: function(feed, is_cat, src) {

View File

@@ -1,11 +1,11 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Calendar"]){ if(!dojo._hasResource["dijit.Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Calendar"] = true; dojo._hasResource["dijit.Calendar"] = true;
dojo.provide("dijit.Calendar"); dojo.provide("dijit.Calendar");
dojo.require("dojo.cldr.supplemental"); dojo.require("dojo.cldr.supplemental");
@@ -14,252 +14,596 @@ dojo.require("dojo.date.locale");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dijit._CssStateMixin"); dojo.require("dijit._CssStateMixin");
dojo.declare("dijit.Calendar",[dijit._Widget,dijit._Templated,dijit._CssStateMixin],{templateString:dojo.cache("dijit","templates/Calendar.html","<table cellspacing=\"0\" cellpadding=\"0\" class=\"dijitCalendarContainer\" role=\"grid\" dojoAttachEvent=\"onkeypress: _onKeyPress\">\n\t<thead>\n\t\t<tr class=\"dijitReset dijitCalendarMonthContainer\" valign=\"top\">\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"decrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarDecrease\" waiRole=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"decreaseArrowNode\" class=\"dijitA11ySideArrow\">-</span>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' colspan=\"5\">\n\t\t\t\t<div class=\"dijitVisible\">\n\t\t\t\t\t<div class=\"dijitPopup dijitMenu dijitMenuPassive dijitHidden\" dojoAttachPoint=\"monthDropDown\" dojoAttachEvent=\"onmouseup: _onMonthSelect, onmouseover: _onMenuHover, onmouseout: _onMenuHover\">\n\t\t\t\t\t\t<div class=\"dijitCalendarMonthLabelTemplate dijitCalendarMonthLabel\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div dojoAttachPoint=\"monthLabelSpacer\" class=\"dijitSpacer\"></div>\n\t\t\t\t<div dojoAttachPoint=\"monthLabelNode\" class=\"dijitCalendarMonthLabel dijitInline dijitVisible\" dojoAttachEvent=\"onmousedown: _onMonthToggle\"></div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"incrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarIncrease\" waiRole=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"increaseArrowNode\" class=\"dijitA11ySideArrow\">+</span>\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th class=\"dijitReset dijitCalendarDayLabelTemplate\" role=\"columnheader\"><span class=\"dijitCalendarDayLabel\"></span></th>\n\t\t</tr>\n\t</thead>\n\t<tbody dojoAttachEvent=\"onclick: _onDayClick, onmouseover: _onDayMouseOver, onmouseout: _onDayMouseOut, onmousedown: _onDayMouseDown, onmouseup: _onDayMouseUp\" class=\"dijitReset dijitCalendarBodyContainer\">\n\t\t<tr class=\"dijitReset dijitCalendarWeekTemplate\" role=\"row\">\n\t\t\t<td class=\"dijitReset dijitCalendarDateTemplate\" role=\"gridcell\"><span class=\"dijitCalendarDateLabel\"></span></td>\n\t\t</tr>\n\t</tbody>\n\t<tfoot class=\"dijitReset dijitCalendarYearContainer\">\n\t\t<tr>\n\t\t\t<td class='dijitReset' valign=\"top\" colspan=\"7\">\n\t\t\t\t<h3 class=\"dijitCalendarYearLabel\">\n\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\" class=\"dijitInline dijitCalendarPreviousYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"currentYearLabelNode\" class=\"dijitInline dijitCalendarSelectedYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" class=\"dijitInline dijitCalendarNextYear\"></span>\n\t\t\t\t</h3>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\n"),value:new Date(),datePackage:"dojo.date",dayWidth:"narrow",tabIndex:"0",baseClass:"dijitCalendar",cssStateNodes:{"decrementMonth":"dijitCalendarArrow","incrementMonth":"dijitCalendarArrow","previousYearLabelNode":"dijitCalendarPreviousYear","nextYearLabelNode":"dijitCalendarNextYear"},attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{tabIndex:"domNode"}),setValue:function(_1){ dojo.require("dijit.form.DropDownButton");
dojo.declare(
"dijit.Calendar",
[dijit._Widget, dijit._Templated, dijit._CssStateMixin],
{
// summary:
// A simple GUI for choosing a date in the context of a monthly calendar.
//
// description:
// A simple GUI for choosing a date in the context of a monthly calendar.
// This widget can't be used in a form because it doesn't serialize the date to an
// `<input>` field. For a form element, use dijit.form.DateTextBox instead.
//
// Note that the parser takes all dates attributes passed in the
// [RFC 3339 format](http://www.faqs.org/rfcs/rfc3339.html), e.g. `2005-06-30T08:05:00-07:00`
// so that they are serializable and locale-independent.
//
// example:
// | var calendar = new dijit.Calendar({}, dojo.byId("calendarNode"));
//
// example:
// | <div dojoType="dijit.Calendar"></div>
templateString: dojo.cache("dijit", "templates/Calendar.html", "<table cellspacing=\"0\" cellpadding=\"0\" class=\"dijitCalendarContainer\" role=\"grid\" dojoAttachEvent=\"onkeypress: _onKeyPress\" aria-labelledby=\"${id}_year\">\n\t<thead>\n\t\t<tr class=\"dijitReset dijitCalendarMonthContainer\" valign=\"top\">\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"decrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarDecrease\" role=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"decreaseArrowNode\" class=\"dijitA11ySideArrow\">-</span>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' colspan=\"5\">\n\t\t\t\t<div dojoType=\"dijit.form.DropDownButton\" dojoAttachPoint=\"monthDropDownButton\"\n\t\t\t\t\tid=\"${id}_mddb\" tabIndex=\"-1\">\n\t\t\t\t</div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"incrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarIncrease\" role=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"increaseArrowNode\" class=\"dijitA11ySideArrow\">+</span>\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th class=\"dijitReset dijitCalendarDayLabelTemplate\" role=\"columnheader\"><span class=\"dijitCalendarDayLabel\"></span></th>\n\t\t</tr>\n\t</thead>\n\t<tbody dojoAttachEvent=\"onclick: _onDayClick, onmouseover: _onDayMouseOver, onmouseout: _onDayMouseOut, onmousedown: _onDayMouseDown, onmouseup: _onDayMouseUp\" class=\"dijitReset dijitCalendarBodyContainer\">\n\t\t<tr class=\"dijitReset dijitCalendarWeekTemplate\" role=\"row\">\n\t\t\t<td class=\"dijitReset dijitCalendarDateTemplate\" role=\"gridcell\"><span class=\"dijitCalendarDateLabel\"></span></td>\n\t\t</tr>\n\t</tbody>\n\t<tfoot class=\"dijitReset dijitCalendarYearContainer\">\n\t\t<tr>\n\t\t\t<td class='dijitReset' valign=\"top\" colspan=\"7\">\n\t\t\t\t<h3 class=\"dijitCalendarYearLabel\">\n\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\" class=\"dijitInline dijitCalendarPreviousYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"currentYearLabelNode\" class=\"dijitInline dijitCalendarSelectedYear\" id=\"${id}_year\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" class=\"dijitInline dijitCalendarNextYear\"></span>\n\t\t\t\t</h3>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\n"),
widgetsInTemplate: true,
// value: Date
// The currently selected Date, initially set to invalid date to indicate no selection.
value: new Date(""),
// TODO: for 2.0 make this a string (ISO format) rather than a Date
// datePackage: String
// JavaScript namespace to find Calendar routines. Uses Gregorian Calendar routines
// at dojo.date by default.
datePackage: "dojo.date",
// dayWidth: String
// How to represent the days of the week in the calendar header. See dojo.date.locale
dayWidth: "narrow",
// tabIndex: Integer
// Order fields are traversed when user hits the tab key
tabIndex: "0",
// currentFocus: Date
// Date object containing the currently focused date, or the date which would be focused
// if the calendar itself was focused. Also indicates which year and month to display,
// i.e. the current "page" the calendar is on.
currentFocus: new Date(),
baseClass:"dijitCalendar",
// Set node classes for various mouse events, see dijit._CssStateMixin for more details
cssStateNodes: {
"decrementMonth": "dijitCalendarArrow",
"incrementMonth": "dijitCalendarArrow",
"previousYearLabelNode": "dijitCalendarPreviousYear",
"nextYearLabelNode": "dijitCalendarNextYear"
},
_isValidDate: function(/*Date*/ value){
// summary:
// Runs various tests on the value, checking that it's a valid date, rather
// than blank or NaN.
// tags:
// private
return value && !isNaN(value) && typeof value == "object" &&
value.toString() != this.constructor.prototype.value.toString();
},
setValue: function(/*Date*/ value){
// summary:
// Deprecated. Use set('value', ...) instead.
// tags:
// deprecated
dojo.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0"); dojo.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
this.set("value",_1); this.set('value', value);
},_getValueAttr:function(){ },
var _2=new this.dateClassObj(this.value);
_2.setHours(0,0,0,0); _getValueAttr: function(){
if(_2.getDate()<this.value.getDate()){ // summary:
_2=this.dateFuncObj.add(_2,"hour",1); // Support get('value')
// this.value is set to 1AM, but return midnight, local time for back-compat
var value = new this.dateClassObj(this.value);
value.setHours(0, 0, 0, 0);
// If daylight savings pushes midnight to the previous date, fix the Date
// object to point at 1am so it will represent the correct day. See #9366
if(value.getDate() < this.value.getDate()){
value = this.dateFuncObj.add(value, "hour", 1);
} }
return _2; return value;
},_setValueAttr:function(_3){ },
if(!this.value||this.dateFuncObj.compare(_3,this.value)){
_3=new this.dateClassObj(_3); _setValueAttr: function(/*Date|Number*/ value, /*Boolean*/ priorityChange){
_3.setHours(1); // summary:
this.displayMonth=new this.dateClassObj(_3); // Support set("value", ...)
if(!this.isDisabledDate(_3,this.lang)){ // description:
this.value=_3; // Set the current date and update the UI. If the date is disabled, the value will
this.onChange(this.get("value")); // not change, but the display will change to the corresponding month.
// value:
// Either a Date or the number of seconds since 1970.
// tags:
// protected
if(value){
// convert from Number to Date, or make copy of Date object so that setHours() call below
// doesn't affect original value
value = new this.dateClassObj(value);
} }
dojo.attr(this.domNode,"aria-label",this.dateLocaleModule.format(_3,{selector:"date",formatLength:"full"})); if(this._isValidDate(value)){
this._populateGrid(); if(!this._isValidDate(this.value) || this.dateFuncObj.compare(value, this.value)){
value.setHours(1, 0, 0, 0); // round to nearest day (1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
if(!this.isDisabledDate(value, this.lang)){
this._set("value", value);
// Set focus cell to the new value. Arguably this should only happen when there isn't a current
// focus point. This will also repopulate the grid, showing the new selected value (and possibly
// new month/year).
this.set("currentFocus", value);
if(priorityChange || typeof priorityChange == "undefined"){
this.onChange(this.get('value'));
this.onValueSelected(this.get('value')); // remove in 2.0
} }
},_setText:function(_4,_5){
while(_4.firstChild){
_4.removeChild(_4.firstChild);
} }
_4.appendChild(dojo.doc.createTextNode(_5));
},_populateGrid:function(){
var _6=this.displayMonth;
_6.setDate(1);
var _7=_6.getDay(),_8=this.dateFuncObj.getDaysInMonth(_6),_9=this.dateFuncObj.getDaysInMonth(this.dateFuncObj.add(_6,"month",-1)),_a=new this.dateClassObj(),_b=dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
if(_b>_7){
_b-=7;
} }
dojo.query(".dijitCalendarDateTemplate",this.domNode).forEach(function(_c,i){ }else{
i+=_b; // clear value, and repopulate grid (to deselect the previously selected day) without changing currentFocus
var _d=new this.dateClassObj(_6),_e,_f="dijitCalendar",adj=0; this._set("value", null);
if(i<_7){ this.set("currentFocus", this.currentFocus);
_e=_9-_7+i+1; }
},
_setText: function(node, text){
// summary:
// This just sets the content of node to the specified text.
// Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
// tags:
// private
while(node.firstChild){
node.removeChild(node.firstChild);
}
node.appendChild(dojo.doc.createTextNode(text));
},
_populateGrid: function(){
// summary:
// Fills in the calendar grid with each day (1-31)
// tags:
// private
var month = new this.dateClassObj(this.currentFocus);
month.setDate(1);
var firstDay = month.getDay(),
daysInMonth = this.dateFuncObj.getDaysInMonth(month),
daysInPreviousMonth = this.dateFuncObj.getDaysInMonth(this.dateFuncObj.add(month, "month", -1)),
today = new this.dateClassObj(),
dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
if(dayOffset > firstDay){ dayOffset -= 7; }
// Iterate through dates in the calendar and fill in date numbers and style info
dojo.query(".dijitCalendarDateTemplate", this.domNode).forEach(function(template, i){
i += dayOffset;
var date = new this.dateClassObj(month),
number, clazz = "dijitCalendar", adj = 0;
if(i < firstDay){
number = daysInPreviousMonth - firstDay + i + 1;
adj = -1; adj = -1;
_f+="Previous"; clazz += "Previous";
}else{ }else if(i >= (firstDay + daysInMonth)){
if(i>=(_7+_8)){ number = i - firstDay - daysInMonth + 1;
_e=i-_7-_8+1;
adj = 1; adj = 1;
_f+="Next"; clazz += "Next";
}else{ }else{
_e=i-_7+1; number = i - firstDay + 1;
_f+="Current"; clazz += "Current";
}
} }
if(adj){ if(adj){
_d=this.dateFuncObj.add(_d,"month",adj); date = this.dateFuncObj.add(date, "month", adj);
} }
_d.setDate(_e); date.setDate(number);
if(!this.dateFuncObj.compare(_d,_a,"date")){
_f="dijitCalendarCurrentDate "+_f; if(!this.dateFuncObj.compare(date, today, "date")){
clazz = "dijitCalendarCurrentDate " + clazz;
} }
if(this._isSelectedDate(_d,this.lang)){
_f="dijitCalendarSelectedDate "+_f; if(this._isSelectedDate(date, this.lang)){
clazz = "dijitCalendarSelectedDate " + clazz;
} }
if(this.isDisabledDate(_d,this.lang)){
_f="dijitCalendarDisabledDate "+_f; if(this.isDisabledDate(date, this.lang)){
clazz = "dijitCalendarDisabledDate " + clazz;
} }
var _10=this.getClassForDate(_d,this.lang);
if(_10){ var clazz2 = this.getClassForDate(date, this.lang);
_f=_10+" "+_f; if(clazz2){
clazz = clazz2 + " " + clazz;
} }
_c.className=_f+"Month dijitCalendarDateTemplate";
_c.dijitDateValue=_d.valueOf(); template.className = clazz + "Month dijitCalendarDateTemplate";
var _11=dojo.query(".dijitCalendarDateLabel",_c)[0],_12=_d.getDateLocalized?_d.getDateLocalized(this.lang):_d.getDate(); template.dijitDateValue = date.valueOf(); // original code
this._setText(_11,_12); dojo.attr(template, "dijitDateValue", date.valueOf()); // so I can dojo.query() it
var label = dojo.query(".dijitCalendarDateLabel", template)[0],
text = date.getDateLocalized ? date.getDateLocalized(this.lang) : date.getDate();
this._setText(label, text);
}, this); }, this);
var _13=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,_6);
this._setText(this.monthLabelNode,_13[_6.getMonth()]); // Repopulate month drop down list based on current year.
dojo.query(".dijitCalendarMonthLabelTemplate",this.domNode).forEach(function(_14,i){ // Need to do this to hide leap months in Hebrew calendar.
dojo.toggleClass(_14,"dijitHidden",!(i in _13)); var monthNames = this.dateLocaleModule.getNames('months', 'wide', 'standAlone', this.lang, month);
this._setText(_14,_13[i]); this.monthDropDownButton.dropDown.set("months", monthNames);
},this);
var y=_6.getFullYear()-1; // Set name of current month and also fill in spacer element with all the month names
// (invisible) so that the maximum width will affect layout. But not on IE6 because then
// the center <TH> overlaps the right <TH> (due to a browser bug).
this.monthDropDownButton.containerNode.innerHTML =
(dojo.isIE == 6 ? "" : "<div class='dijitSpacer'>" + this.monthDropDownButton.dropDown.domNode.innerHTML + "</div>") +
"<div class='dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'>" + monthNames[month.getMonth()] + "</div>";
// Fill in localized prev/current/next years
var y = month.getFullYear() - 1;
var d = new this.dateClassObj(); var d = new this.dateClassObj();
dojo.forEach(["previous","current","next"],function(_15){ dojo.forEach(["previous", "current", "next"], function(name){
d.setFullYear(y++); d.setFullYear(y++);
this._setText(this[_15+"YearLabelNode"],this.dateLocaleModule.format(d,{selector:"year",locale:this.lang})); this._setText(this[name+"YearLabelNode"],
this.dateLocaleModule.format(d, {selector:'year', locale:this.lang}));
}, this); }, this);
var _16=this; },
var _17=function(_18,_19,adj){
_16._connects.push(dijit.typematic.addMouseListener(_16[_18],_16,function(_1a){ goToToday: function(){
if(_1a>=0){ // summary:
_16._adjustDisplay(_19,adj); // Sets calendar's value to today's date
} this.set('value', new this.dateClassObj());
},0.8,500)); },
};
_17("incrementMonth","month",1); constructor: function(/*Object*/args){
_17("decrementMonth","month",-1); var dateClass = (args.datePackage && (args.datePackage != "dojo.date"))? args.datePackage + ".Date" : "Date";
_17("nextYearLabelNode","year",1); this.dateClassObj = dojo.getObject(dateClass, false);
_17("previousYearLabelNode","year",-1); this.datePackage = args.datePackage || this.datePackage;
},goToToday:function(){
this.set("value",new this.dateClassObj());
},constructor:function(_1b){
var _1c=(_1b.datePackage&&(_1b.datePackage!="dojo.date"))?_1b.datePackage+".Date":"Date";
this.dateClassObj=dojo.getObject(_1c,false);
this.datePackage=_1b.datePackage||this.datePackage;
this.dateFuncObj = dojo.getObject(this.datePackage, false); this.dateFuncObj = dojo.getObject(this.datePackage, false);
this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false); this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false);
},postMixInProperties:function(){ },
if(isNaN(this.value)){
delete this.value; postMixInProperties: function(){
} // Parser.instantiate sometimes passes in NaN for IE. Use default value in prototype instead.
// TODO: remove this for 2.0 (thanks to #11511)
if(isNaN(this.value)){ delete this.value; }
this.inherited(arguments); this.inherited(arguments);
},postCreate:function(){ },
buildRendering: function(){
this.inherited(arguments); this.inherited(arguments);
dojo.setSelectable(this.domNode, false); dojo.setSelectable(this.domNode, false);
var _1d=dojo.hitch(this,function(_1e,n){
var _1f=dojo.query(_1e,this.domNode)[0]; var cloneClass = dojo.hitch(this, function(clazz, n){
var template = dojo.query(clazz, this.domNode)[0];
for(var i=0; i<n; i++){ for(var i=0; i<n; i++){
_1f.parentNode.appendChild(_1f.cloneNode(true)); template.parentNode.appendChild(template.cloneNode(true));
} }
}); });
_1d(".dijitCalendarDayLabelTemplate",6);
_1d(".dijitCalendarDateTemplate",6); // clone the day label and calendar day templates 6 times to make 7 columns
_1d(".dijitCalendarWeekTemplate",5); cloneClass(".dijitCalendarDayLabelTemplate", 6);
var _20=this.dateLocaleModule.getNames("days",this.dayWidth,"standAlone",this.lang); cloneClass(".dijitCalendarDateTemplate", 6);
var _21=dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
dojo.query(".dijitCalendarDayLabel",this.domNode).forEach(function(_22,i){ // now make 6 week rows
this._setText(_22,_20[(i+_21)%7]); cloneClass(".dijitCalendarWeekTemplate", 5);
// insert localized day names in the header
var dayNames = this.dateLocaleModule.getNames('days', this.dayWidth, 'standAlone', this.lang);
var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){
this._setText(label, dayNames[(i + dayOffset) % 7]);
}, this); }, this);
var _23=new this.dateClassObj(this.value);
var _24=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,_23); var dateObj = new this.dateClassObj(this.currentFocus);
_1d(".dijitCalendarMonthLabelTemplate",_24.length-1);
dojo.query(".dijitCalendarMonthLabelTemplate",this.domNode).forEach(function(_25,i){ this.monthDropDownButton.dropDown = new dijit.Calendar._MonthDropDown({
dojo.attr(_25,"month",i); id: this.id + "_mdd",
if(i in _24){ onChange: dojo.hitch(this, "_onMonthSelect")
this._setText(_25,_24[i]); });
}
dojo.place(_25.cloneNode(true),this.monthLabelSpacer); this.set('currentFocus', dateObj, false); // draw the grid to the month specified by currentFocus
},this);
this.value=null; // Set up repeating mouse behavior for increment/decrement of months/years
this.set("value",_23); var _this = this;
},_onMenuHover:function(e){ var typematic = function(nodeProp, dateProp, adj){
dojo.stopEvent(e); _this._connects.push(
dojo.toggleClass(e.target,"dijitMenuItemHover"); dijit.typematic.addMouseListener(_this[nodeProp], _this, function(count){
},_adjustDisplay:function(_26,_27){ if(count >= 0){ _this._adjustDisplay(dateProp, adj); }
this.displayMonth=this.dateFuncObj.add(this.displayMonth,_26,_27); }, 0.8, 500)
);
};
typematic("incrementMonth", "month", 1);
typematic("decrementMonth", "month", -1);
typematic("nextYearLabelNode", "year", 1);
typematic("previousYearLabelNode", "year", -1);
},
_adjustDisplay: function(/*String*/ part, /*int*/ amount){
// summary:
// Moves calendar forwards or backwards by months or years
// part:
// "month" or "year"
// amount:
// Number of months or years
// tags:
// private
this._setCurrentFocusAttr(this.dateFuncObj.add(this.currentFocus, part, amount));
},
_setCurrentFocusAttr: function(/*Date*/ date, /*Boolean*/ forceFocus){
// summary:
// If the calendar currently has focus, then focuses specified date,
// changing the currently displayed month/year if necessary.
// If the calendar doesn't have focus, updates currently
// displayed month/year, and sets the cell that will get focus.
// forceFocus:
// If true, will focus() the cell even if calendar itself doesn't have focus
var oldFocus = this.currentFocus,
oldCell = oldFocus ? dojo.query("[dijitDateValue=" + oldFocus.valueOf() + "]", this.domNode)[0] : null;
// round specified value to nearest day (1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
date = new this.dateClassObj(date);
date.setHours(1, 0, 0, 0);
this._set("currentFocus", date);
// TODO: only re-populate grid when month/year has changed
this._populateGrid(); this._populateGrid();
},_onMonthToggle:function(evt){
dojo.stopEvent(evt); // set tabIndex=0 on new cell, and focus it (but only if Calendar itself is focused)
if(evt.type=="mousedown"){ var newCell = dojo.query("[dijitDateValue=" + date.valueOf() + "]", this.domNode)[0];
var _28=dojo.position(this.monthLabelNode); newCell.setAttribute("tabIndex", this.tabIndex);
var dim={width:_28.w+"px",top:-this.displayMonth.getMonth()*_28.h+"px"}; if(this._focused || forceFocus){
if((dojo.isIE&&dojo.isQuirks)||dojo.isIE<7){ newCell.focus();
dim.left=-_28.w/2+"px";
} }
dojo.style(this.monthDropDown,dim);
this._popupHandler=this.connect(document,"onmouseup","_onMonthToggle"); // set tabIndex=-1 on old focusable cell
if(oldCell && oldCell != newCell){
if(dojo.isWebKit){ // see #11064 about webkit bug
oldCell.setAttribute("tabIndex", "-1");
}else{ }else{
this.disconnect(this._popupHandler); oldCell.removeAttribute("tabIndex");
delete this._popupHandler;
} }
dojo.toggleClass(this.monthDropDown,"dijitHidden"); }
dojo.toggleClass(this.monthLabelNode,"dijitVisible"); },
},_onMonthSelect:function(evt){
this._onMonthToggle(evt); focus: function(){
this.displayMonth.setMonth(dojo.attr(evt.target,"month")); // summary:
// Focus the calendar by focusing one of the calendar cells
this._setCurrentFocusAttr(this.currentFocus, true);
},
_onMonthSelect: function(/*Number*/ newMonth){
// summary:
// Handler for when user selects a month from the drop down list
// tags:
// protected
// move to selected month, bounding by the number of days in the month
// (ex: dec 31 --> jan 28, not jan 31)
this.currentFocus = this.dateFuncObj.add(this.currentFocus, "month",
newMonth - this.currentFocus.getMonth());
this._populateGrid(); this._populateGrid();
},_onDayClick:function(evt){ },
_onDayClick: function(/*Event*/ evt){
// summary:
// Handler for day clicks, selects the date if appropriate
// tags:
// protected
dojo.stopEvent(evt); dojo.stopEvent(evt);
for(var _29=evt.target;_29&&!_29.dijitDateValue;_29=_29.parentNode){ for(var node = evt.target; node && !node.dijitDateValue; node = node.parentNode);
if(node && !dojo.hasClass(node, "dijitCalendarDisabledDate")){
this.set('value', node.dijitDateValue);
} }
if(_29&&!dojo.hasClass(_29,"dijitCalendarDisabledDate")){ },
this.set("value",_29.dijitDateValue);
this.onValueSelected(this.get("value")); _onDayMouseOver: function(/*Event*/ evt){
// summary:
// Handler for mouse over events on days, sets hovered style
// tags:
// protected
// event can occur on <td> or the <span> inside the td,
// set node to the <td>.
var node =
dojo.hasClass(evt.target, "dijitCalendarDateLabel") ?
evt.target.parentNode :
evt.target;
if(node && (node.dijitDateValue || node == this.previousYearLabelNode || node == this.nextYearLabelNode) ){
dojo.addClass(node, "dijitCalendarHoveredDate");
this._currentNode = node;
} }
},_onDayMouseOver:function(evt){ },
var _2a=dojo.hasClass(evt.target,"dijitCalendarDateLabel")?evt.target.parentNode:evt.target;
if(_2a&&(_2a.dijitDateValue||_2a==this.previousYearLabelNode||_2a==this.nextYearLabelNode)){ _onDayMouseOut: function(/*Event*/ evt){
dojo.addClass(_2a,"dijitCalendarHoveredDate"); // summary:
this._currentNode=_2a; // Handler for mouse out events on days, clears hovered style
} // tags:
},_onDayMouseOut:function(evt){ // protected
if(!this._currentNode){
return; if(!this._currentNode){ return; }
}
if(evt.relatedTarget&&evt.relatedTarget.parentNode==this._currentNode){ // if mouse out occurs moving from <td> to <span> inside <td>, ignore it
return; if(evt.relatedTarget && evt.relatedTarget.parentNode == this._currentNode){ return; }
} var cls = "dijitCalendarHoveredDate";
dojo.removeClass(this._currentNode,"dijitCalendarHoveredDate");
if(dojo.hasClass(this._currentNode, "dijitCalendarActiveDate")) { if(dojo.hasClass(this._currentNode, "dijitCalendarActiveDate")) {
dojo.removeClass(this._currentNode,"dijitCalendarActiveDate"); cls += " dijitCalendarActiveDate";
} }
dojo.removeClass(this._currentNode, cls);
this._currentNode = null; this._currentNode = null;
},_onDayMouseDown:function(evt){ },
var _2b=evt.target.parentNode;
if(_2b&&_2b.dijitDateValue){ _onDayMouseDown: function(/*Event*/ evt){
dojo.addClass(_2b,"dijitCalendarActiveDate"); var node = evt.target.parentNode;
this._currentNode=_2b; if(node && node.dijitDateValue){
dojo.addClass(node, "dijitCalendarActiveDate");
this._currentNode = node;
} }
},_onDayMouseUp:function(evt){ },
var _2c=evt.target.parentNode;
if(_2c&&_2c.dijitDateValue){ _onDayMouseUp: function(/*Event*/ evt){
dojo.removeClass(_2c,"dijitCalendarActiveDate"); var node = evt.target.parentNode;
if(node && node.dijitDateValue){
dojo.removeClass(node, "dijitCalendarActiveDate");
} }
},_onKeyPress:function(evt){ },
var dk=dojo.keys,_2d=-1,_2e,_2f=this.value;
//TODO: use typematic
handleKey: function(/*Event*/ evt){
// summary:
// Provides keyboard navigation of calendar.
// description:
// Called from _onKeyPress() to handle keypress on a stand alone Calendar,
// and also from `dijit.form._DateTimeTextBox` to pass a keypress event
// from the `dijit.form.DateTextBox` to be handled in this widget
// returns:
// False if the key was recognized as a navigation key,
// to indicate that the event was handled by Calendar and shouldn't be propogated
// tags:
// protected
var dk = dojo.keys,
increment = -1,
interval,
newValue = this.currentFocus;
switch(evt.keyCode){ switch(evt.keyCode){
case dk.RIGHT_ARROW: case dk.RIGHT_ARROW:
_2d=1; increment = 1;
//fallthrough...
case dk.LEFT_ARROW: case dk.LEFT_ARROW:
_2e="day"; interval = "day";
if(!this.isLeftToRight()){ if(!this.isLeftToRight()){ increment *= -1; }
_2d*=-1;
}
break; break;
case dk.DOWN_ARROW: case dk.DOWN_ARROW:
_2d=1; increment = 1;
//fallthrough...
case dk.UP_ARROW: case dk.UP_ARROW:
_2e="week"; interval = "week";
break; break;
case dk.PAGE_DOWN: case dk.PAGE_DOWN:
_2d=1; increment = 1;
//fallthrough...
case dk.PAGE_UP: case dk.PAGE_UP:
_2e=evt.ctrlKey?"year":"month"; interval = evt.ctrlKey || evt.altKey ? "year" : "month";
break; break;
case dk.END: case dk.END:
_2f=this.dateFuncObj.add(_2f,"month",1); // go to the next month
_2e="day"; newValue = this.dateFuncObj.add(newValue, "month", 1);
// subtract a day from the result when we're done
interval = "day";
//fallthrough...
case dk.HOME: case dk.HOME:
_2f=new Date(_2f).setDate(1); newValue = new this.dateClassObj(newValue);
newValue.setDate(1);
break; break;
case dk.ENTER: case dk.ENTER:
this.onValueSelected(this.get("value")); case dk.SPACE:
this.set("value", this.currentFocus);
break; break;
case dk.ESCAPE:
default: default:
return; return true;
} }
if(interval){
newValue = this.dateFuncObj.add(newValue, interval, increment);
}
this._setCurrentFocusAttr(newValue);
return false;
},
_onKeyPress: function(/*Event*/ evt){
// summary:
// For handling keypress events on a stand alone calendar
if(!this.handleKey(evt)){
dojo.stopEvent(evt); dojo.stopEvent(evt);
if(_2e){
_2f=this.dateFuncObj.add(_2f,_2e,_2d);
} }
this.set("value",_2f); },
},onValueSelected:function(_30){
},onChange:function(_31){ onValueSelected: function(/*Date*/ date){
},_isSelectedDate:function(_32,_33){ // summary:
return !this.dateFuncObj.compare(_32,this.value,"date"); // Notification that a date cell was selected. It may be the same as the previous value.
},isDisabledDate:function(_34,_35){ // description:
},getClassForDate:function(_36,_37){ // Formerly used by `dijit.form._DateTimeTextBox` (and thus `dijit.form.DateTextBox`)
}}); // to get notification when the user has clicked a date. Now onExecute() (above) is used.
// tags:
// protected
},
onChange: function(/*Date*/ date){
// summary:
// Called only when the selected date has changed
},
_isSelectedDate: function(/*Date*/ dateObject, /*String?*/ locale){
// summary:
// Extension point so developers can subclass Calendar to
// support multiple (concurrently) selected dates
// tags:
// protected extension
return this._isValidDate(this.value) && !this.dateFuncObj.compare(dateObject, this.value, "date")
},
isDisabledDate: function(/*Date*/ dateObject, /*String?*/ locale){
// summary:
// May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
// tags:
// extension
/*=====
return false; // Boolean
=====*/
},
getClassForDate: function(/*Date*/ dateObject, /*String?*/ locale){
// summary:
// May be overridden to return CSS classes to associate with the date entry for the given dateObject,
// for example to indicate a holiday in specified locale.
// tags:
// extension
/*=====
return ""; // String
=====*/
}
}
);
dojo.declare("dijit.Calendar._MonthDropDown", [dijit._Widget, dijit._Templated], {
// summary:
// The month drop down
// months: String[]
// List of names of months, possibly w/some undefined entries for Hebrew leap months
// (ex: ["January", "February", undefined, "April", ...])
months: [],
templateString: "<div class='dijitCalendarMonthMenu dijitMenu' " +
"dojoAttachEvent='onclick:_onClick,onmouseover:_onMenuHover,onmouseout:_onMenuHover'></div>",
_setMonthsAttr: function(/*String[]*/ months){
this.domNode.innerHTML = dojo.map(months, function(month, idx){
return month ? "<div class='dijitCalendarMonthLabel' month='" + idx +"'>" + month + "</div>" : "";
}).join("");
},
_onClick: function(/*Event*/ evt){
this.onChange(dojo.attr(evt.target, "month"));
},
onChange: function(/*Number*/ month){
// summary:
// Callback when month is selected from drop down
},
_onMenuHover: function(evt){
dojo.toggleClass(evt.target, "dijitCalendarMonthLabelHover", evt.type == "mouseover");
}
});
} }

View File

@@ -1,24 +1,54 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.CheckedMenuItem"]){ if(!dojo._hasResource["dijit.CheckedMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.CheckedMenuItem"] = true; dojo._hasResource["dijit.CheckedMenuItem"] = true;
dojo.provide("dijit.CheckedMenuItem"); dojo.provide("dijit.CheckedMenuItem");
dojo.require("dijit.MenuItem"); dojo.require("dijit.MenuItem");
dojo.declare("dijit.CheckedMenuItem",dijit.MenuItem,{templateString:dojo.cache("dijit","templates/CheckedMenuItem.html","<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" waiRole=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" waiRole=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">&#10003;</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" waiRole=\"presentation\">&nbsp;</td>\n</tr>\n"),checked:false,_setCheckedAttr:function(_1){
dojo.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",_1);
dijit.setWaiState(this.domNode,"checked",_1); dojo.declare("dijit.CheckedMenuItem",
this.checked=_1; dijit.MenuItem,
},onChange:function(_2){ {
},_onClick:function(e){ // summary:
// A checkbox-like menu item for toggling on and off
templateString: dojo.cache("dijit", "templates/CheckedMenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">&#10003;</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">&nbsp;</td>\n</tr>\n"),
// checked: Boolean
// Our checked state
checked: false,
_setCheckedAttr: function(/*Boolean*/ checked){
// summary:
// Hook so attr('checked', bool) works.
// Sets the class and state for the check box.
dojo.toggleClass(this.domNode, "dijitCheckedMenuItemChecked", checked);
dijit.setWaiState(this.domNode, "checked", checked);
this._set("checked", checked);
},
onChange: function(/*Boolean*/ checked){
// summary:
// User defined function to handle check/uncheck events
// tags:
// callback
},
_onClick: function(/*Event*/ e){
// summary:
// Clicking this item just toggles its state
// tags:
// private
if(!this.disabled){ if(!this.disabled){
this.set("checked", !this.checked); this.set("checked", !this.checked);
this.onChange(this.checked); this.onChange(this.checked);
} }
this.inherited(arguments); this.inherited(arguments);
}}); }
});
} }

View File

@@ -1,31 +1,142 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.ColorPalette"]){ if(!dojo._hasResource["dijit.ColorPalette"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.ColorPalette"] = true; dojo._hasResource["dijit.ColorPalette"] = true;
dojo.provide("dijit.ColorPalette"); dojo.provide("dijit.ColorPalette");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dojo.colors"); dojo.require("dojo.colors");
dojo.require("dojo.i18n"); dojo.require("dojo.i18n");
dojo.require("dojo.string");
dojo.require("dijit._PaletteMixin"); dojo.require("dijit._PaletteMixin");
dojo.requireLocalization("dojo","colors",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); dojo.requireLocalization("dojo", "colors", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.declare("dijit.ColorPalette",[dijit._Widget,dijit._Templated,dijit._PaletteMixin],{palette:"7x10",_palettes:{"7x10":[["white","seashell","cornsilk","lemonchiffon","lightyellow","palegreen","paleturquoise","lightcyan","lavender","plum"],["lightgray","pink","bisque","moccasin","khaki","lightgreen","lightseagreen","lightskyblue","cornflowerblue","violet"],["silver","lightcoral","sandybrown","orange","palegoldenrod","chartreuse","mediumturquoise","skyblue","mediumslateblue","orchid"],["gray","red","orangered","darkorange","yellow","limegreen","darkseagreen","royalblue","slateblue","mediumorchid"],["dimgray","crimson","chocolate","coral","gold","forestgreen","seagreen","blue","blueviolet","darkorchid"],["darkslategray","firebrick","saddlebrown","sienna","olive","green","darkcyan","mediumblue","darkslateblue","darkmagenta"],["black","darkred","maroon","brown","darkolivegreen","darkgreen","midnightblue","navy","indigo","purple"]],"3x4":[["white","lime","green","blue"],["silver","yellow","fuchsia","navy"],["gray","red","purple","black"]]},_imagePaths:{"7x10":dojo.moduleUrl("dijit.themes","a11y/colors7x10.png"),"3x4":dojo.moduleUrl("dijit.themes","a11y/colors3x4.png"),"7x10-rtl":dojo.moduleUrl("dijit.themes","a11y/colors7x10-rtl.png"),"3x4-rtl":dojo.moduleUrl("dijit.themes","a11y/colors3x4-rtl.png")},templateString:dojo.cache("dijit","templates/ColorPalette.html","<div class=\"dijitInline dijitColorPalette\">\n\t<img class=\"dijitColorPaletteUnder\" dojoAttachPoint=\"imageNode\" waiRole=\"presentation\" alt=\"\"/>\n\t<table class=\"dijitPaletteTable\" cellSpacing=\"0\" cellPadding=\"0\">\n\t\t<tbody dojoAttachPoint=\"gridNode\"></tbody>\n\t</table>\n</div>\n"),baseClass:"dijitColorPalette",dyeClass:"dijit._Color",buildRendering:function(){
dojo.declare("dijit.ColorPalette",
[dijit._Widget, dijit._Templated, dijit._PaletteMixin],
{
// summary:
// A keyboard accessible color-picking widget
// description:
// Grid showing various colors, so the user can pick a certain color.
// Can be used standalone, or as a popup.
//
// example:
// | <div dojoType="dijit.ColorPalette"></div>
//
// example:
// | var picker = new dijit.ColorPalette({ },srcNode);
// | picker.startup();
// palette: [const] String
// Size of grid, either "7x10" or "3x4".
palette: "7x10",
// _palettes: [protected] Map
// This represents the value of the colors.
// The first level is a hashmap of the different palettes available.
// The next two dimensions represent the columns and rows of colors.
_palettes: {
"7x10": [["white", "seashell", "cornsilk", "lemonchiffon","lightyellow", "palegreen", "paleturquoise", "lightcyan", "lavender", "plum"],
["lightgray", "pink", "bisque", "moccasin", "khaki", "lightgreen", "lightseagreen", "lightskyblue", "cornflowerblue", "violet"],
["silver", "lightcoral", "sandybrown", "orange", "palegoldenrod", "chartreuse", "mediumturquoise", "skyblue", "mediumslateblue","orchid"],
["gray", "red", "orangered", "darkorange", "yellow", "limegreen", "darkseagreen", "royalblue", "slateblue", "mediumorchid"],
["dimgray", "crimson", "chocolate", "coral", "gold", "forestgreen", "seagreen", "blue", "blueviolet", "darkorchid"],
["darkslategray","firebrick","saddlebrown", "sienna", "olive", "green", "darkcyan", "mediumblue","darkslateblue", "darkmagenta" ],
["black", "darkred", "maroon", "brown", "darkolivegreen", "darkgreen", "midnightblue", "navy", "indigo", "purple"]],
"3x4": [["white", "lime", "green", "blue"],
["silver", "yellow", "fuchsia", "navy"],
["gray", "red", "purple", "black"]]
},
// templateString: String
// The template of this widget.
templateString: dojo.cache("dijit", "templates/ColorPalette.html", "<div class=\"dijitInline dijitColorPalette\">\n\t<table class=\"dijitPaletteTable\" cellSpacing=\"0\" cellPadding=\"0\">\n\t\t<tbody dojoAttachPoint=\"gridNode\"></tbody>\n\t</table>\n</div>\n"),
baseClass: "dijitColorPalette",
buildRendering: function(){
// Instantiate the template, which makes a skeleton into which we'll insert a bunch of
// <img> nodes
this.inherited(arguments); this.inherited(arguments);
this.imageNode.setAttribute("src",this._imagePaths[this.palette+(this.isLeftToRight()?"":"-rtl")].toString());
var _1=dojo.i18n.getLocalization("dojo","colors",this.lang); // Creates <img> nodes in each cell of the template.
this._preparePalette(this._palettes[this.palette],_1); // Pass in "customized" dijit._Color constructor for specified palette and high-contrast vs. normal mode
}}); this._preparePalette(
dojo.declare("dijit._Color",dojo.Color,{constructor:function(_2){ this._palettes[this.palette],
this._alias=_2; dojo.i18n.getLocalization("dojo", "colors", this.lang),
this.setColor(dojo.Color.named[_2]); dojo.declare(dijit._Color, {
},getValue:function(){ hc: dojo.hasClass(dojo.body(), "dijit_a11y"),
return this.toHex(); palette: this.palette
},fillCell:function(_3,_4){ })
dojo.create("img",{src:_4,"class":"dijitPaletteImg",alt:this._alias},_3); );
}}); }
});
dojo.declare("dijit._Color", dojo.Color, {
// summary:
// Object associated with each cell in a ColorPalette palette.
// Implements dijit.Dye.
// Template for each cell in normal (non-high-contrast mode). Each cell contains a wrapper
// node for showing the border (called dijitPaletteImg for back-compat), and dijitColorPaletteSwatch
// for showing the color.
template:
"<span class='dijitInline dijitPaletteImg'>" +
"<img src='${blankGif}' alt='${alt}' class='dijitColorPaletteSwatch' style='background-color: ${color}'/>" +
"</span>",
// Template for each cell in high contrast mode. Each cell contains an image with the whole palette,
// but scrolled and clipped to show the correct color only
hcTemplate:
"<span class='dijitInline dijitPaletteImg' style='position: relative; overflow: hidden; height: 12px; width: 14px;'>" +
"<img src='${image}' alt='${alt}' style='position: absolute; left: ${left}px; top: ${top}px; ${size}'/>" +
"</span>",
// _imagePaths: [protected] Map
// This is stores the path to the palette images used for high-contrast mode display
_imagePaths: {
"7x10": dojo.moduleUrl("dijit.themes", "a11y/colors7x10.png"),
"3x4": dojo.moduleUrl("dijit.themes", "a11y/colors3x4.png")
},
constructor: function(/*String*/alias, /*Number*/ row, /*Number*/ col){
this._alias = alias;
this._row = row;
this._col = col;
this.setColor(dojo.Color.named[alias]);
},
getValue: function(){
// summary:
// Note that although dijit._Color is initialized with a value like "white" getValue() always
// returns a hex value
return this.toHex();
},
fillCell: function(/*DOMNode*/ cell, /*String*/ blankGif){
var html = dojo.string.substitute(this.hc ? this.hcTemplate : this.template, {
// substitution variables for normal mode
color: this.toHex(),
blankGif: blankGif,
alt: this._alias,
// variables used for high contrast mode
image: this._imagePaths[this.palette].toString(),
left: this._col * -20 - 5,
top: this._row * -20 - 5,
size: this.palette == "7x10" ? "height: 145px; width: 206px" : "height: 64px; width: 86px"
});
dojo.place(html, cell);
}
});
} }

View File

@@ -1,36 +1,106 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Declaration"]){ if(!dojo._hasResource["dijit.Declaration"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Declaration"] = true; dojo._hasResource["dijit.Declaration"] = true;
dojo.provide("dijit.Declaration"); dojo.provide("dijit.Declaration");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit.Declaration",dijit._Widget,{_noScript:true,widgetClass:"",defaults:null,mixins:[],buildRendering:function(){
var _1=this.srcNodeRef.parentNode.removeChild(this.srcNodeRef),_2=dojo.query("> script[type^='dojo/method'][event]",_1).orphan(),_3=dojo.query("> script[type^='dojo/method']",_1).orphan(),_4=dojo.query("> script[type^='dojo/connect']",_1).orphan(),_5=_1.nodeName;
var _6=this.defaults||{}; dojo.declare(
dojo.forEach(_2,function(s){ "dijit.Declaration",
var _7=s.getAttribute("event"),_8=dojo.parser._functionFromScript(s); dijit._Widget,
_6[_7]=_8; {
}); // summary:
this.mixins=this.mixins.length?dojo.map(this.mixins,function(_9){ // The Declaration widget allows a developer to declare new widget
return dojo.getObject(_9); // classes directly from a snippet of markup.
}):[dijit._Widget,dijit._Templated];
_6.widgetsInTemplate=true; // _noScript: [private] Boolean
_6._skipNodeCache=true; // Flag to parser to leave alone the script tags contained inside of me
_6.templateString="<"+_5+" class='"+_1.className+"' dojoAttachPoint='"+(_1.getAttribute("dojoAttachPoint")||"")+"' dojoAttachEvent='"+(_1.getAttribute("dojoAttachEvent")||"")+"' >"+_1.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+_5+">"; _noScript: true,
dojo.query("[dojoType]",_1).forEach(function(_a){
_a.removeAttribute("dojoType"); // stopParser: [private] Boolean
}); // Flag to parser to not try and parse widgets declared inside of me
var wc=dojo.declare(this.widgetClass,this.mixins,_6); stopParser: true,
var _b=_4.concat(_3);
dojo.forEach(_b,function(s){ // widgetClass: [const] String
var _c=s.getAttribute("event")||"postscript",_d=dojo.parser._functionFromScript(s); // Name of class being declared, ex: "acme.myWidget"
dojo.connect(wc.prototype,_c,_d); widgetClass: "",
});
}}); // propList: [const] Object
// Set of attributes for this widget along with default values, ex:
// {delay: 100, title: "hello world"}
defaults: null,
// mixins: [const] String[]
// List containing the prototype for this widget, and also any mixins,
// ex: ["dijit._Widget", "dijit._Container"]
mixins: [],
buildRendering: function(){
var src = this.srcNodeRef.parentNode.removeChild(this.srcNodeRef),
methods = dojo.query("> script[type^='dojo/method']", src).orphan(),
connects = dojo.query("> script[type^='dojo/connect']", src).orphan(),
srcType = src.nodeName;
var propList = this.defaults || {};
// For all methods defined like <script type="dojo/method" data-dojo-event="foo">,
// add that method to prototype.
// If there's no "event" specified then it's code to run on instantiation,
// so it becomes a connection to "postscript" (handled below).
dojo.forEach(methods, function(s){
var evt = s.getAttribute("event") || s.getAttribute("data-dojo-event"),
func = dojo.parser._functionFromScript(s);
if(evt){
propList[evt] = func;
}else{
connects.push(s);
}
});
// map array of strings like [ "dijit.form.Button" ] to array of mixin objects
// (note that dojo.map(this.mixins, dojo.getObject) doesn't work because it passes
// a bogus third argument to getObject(), confusing it)
this.mixins = this.mixins.length ?
dojo.map(this.mixins, function(name){ return dojo.getObject(name); } ) :
[ dijit._Widget, dijit._Templated ];
propList.widgetsInTemplate = true;
propList._skipNodeCache = true;
propList.templateString = "<"+srcType+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint") || '')+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent") || '')+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+srcType+">";
// strip things so we don't create stuff under us in the initial setup phase
dojo.query("[dojoType]", src).forEach(function(node){
node.removeAttribute("dojoType");
});
// create the new widget class
var wc = dojo.declare(
this.widgetClass,
this.mixins,
propList
);
// Handle <script> blocks of form:
// <script type="dojo/connect" data-dojo-event="foo">
// and
// <script type="dojo/method">
// (Note that the second one is just shorthand for a dojo/connect to postscript)
// Since this is a connect in the declaration, we are actually connection to the method
// in the _prototype_.
dojo.forEach(connects, function(s){
var evt = s.getAttribute("event") || s.getAttribute("data-dojo-event") || "postscript",
func = dojo.parser._functionFromScript(s);
dojo.connect(wc.prototype, evt, func);
});
}
}
);
} }

View File

@@ -1,11 +1,11 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Dialog"]){ if(!dojo._hasResource["dijit.Dialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Dialog"] = true; dojo._hasResource["dijit.Dialog"] = true;
dojo.provide("dijit.Dialog"); dojo.provide("dijit.Dialog");
dojo.require("dojo.dnd.move"); dojo.require("dojo.dnd.move");
@@ -19,238 +19,593 @@ dojo.require("dijit.form._FormMixin");
dojo.require("dijit._DialogMixin"); dojo.require("dijit._DialogMixin");
dojo.require("dijit.DialogUnderlay"); dojo.require("dijit.DialogUnderlay");
dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.ContentPane");
dojo.requireLocalization("dijit","common",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); dojo.requireLocalization("dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.declare("dijit._DialogBase",[dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin,dijit._CssStateMixin],{templateString:dojo.cache("dijit","templates/Dialog.html","<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\"></span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\" title=\"${buttonCancel}\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\" title=\"${buttonCancel}\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n"),baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:dijit.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){ dojo.require("dijit.TooltipDialog");
var _1=dojo.i18n.getLocalization("dijit","common");
dojo.mixin(this,_1);
// dijit/TooltipDialog required for back-compat. TODO: remove in 2.0
/*=====
dijit._underlay = function(kwArgs){
// summary:
// A shared instance of a `dijit.DialogUnderlay`
//
// description:
// A shared instance of a `dijit.DialogUnderlay` created and
// used by `dijit.Dialog`, though never created until some Dialog
// or subclass thereof is shown.
};
=====*/
dojo.declare(
"dijit._DialogBase",
[dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin, dijit._CssStateMixin],
{
// summary:
// A modal dialog Widget
//
// description:
// Pops up a modal dialog window, blocking access to the screen
// and also graying out the screen Dialog is extended from
// ContentPane so it supports all the same parameters (href, etc.)
//
// example:
// | <div dojoType="dijit.Dialog" href="test.html"></div>
//
// example:
// | var foo = new dijit.Dialog({ title: "test dialog", content: "test content" };
// | dojo.body().appendChild(foo.domNode);
// | foo.startup();
templateString: dojo.cache("dijit", "templates/Dialog.html", "<div class=\"dijitDialog\" role=\"dialog\" aria-labelledby=\"${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\"></span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"ondijitclick: onCancel\" title=\"${buttonCancel}\" role=\"button\" tabIndex=\"-1\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\" title=\"${buttonCancel}\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n"),
baseClass: "dijitDialog",
cssStateNodes: {
closeButtonNode: "dijitDialogCloseIcon"
},
attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
title: [
{ node: "titleNode", type: "innerHTML" },
{ node: "titleBar", type: "attribute" }
],
"aria-describedby":""
}),
// open: [readonly] Boolean
// True if Dialog is currently displayed on screen.
open: false,
// duration: Integer
// The time in milliseconds it takes the dialog to fade in and out
duration: dijit.defaultDuration,
// refocus: Boolean
// A Toggle to modify the default focus behavior of a Dialog, which
// is to re-focus the element which had focus before being opened.
// False will disable refocusing. Default: true
refocus: true,
// autofocus: Boolean
// A Toggle to modify the default focus behavior of a Dialog, which
// is to focus on the first dialog element after opening the dialog.
// False will disable autofocusing. Default: true
autofocus: true,
// _firstFocusItem: [private readonly] DomNode
// The pointer to the first focusable node in the dialog.
// Set by `dijit._DialogMixin._getFocusItems`.
_firstFocusItem: null,
// _lastFocusItem: [private readonly] DomNode
// The pointer to which node has focus prior to our dialog.
// Set by `dijit._DialogMixin._getFocusItems`.
_lastFocusItem: null,
// doLayout: [protected] Boolean
// Don't change this parameter from the default value.
// This ContentPane parameter doesn't make sense for Dialog, since Dialog
// is never a child of a layout container, nor can you specify the size of
// Dialog in order to control the size of an inner widget.
doLayout: false,
// draggable: Boolean
// Toggles the moveable aspect of the Dialog. If true, Dialog
// can be dragged by it's title. If false it will remain centered
// in the viewport.
draggable: true,
//aria-describedby: String
// Allows the user to add an aria-describedby attribute onto the dialog. The value should
// be the id of the container element of text that describes the dialog purpose (usually
// the first text in the dialog).
// <div dojoType="dijit.Dialog" aria-describedby="intro" .....>
// <div id="intro">Introductory text</div>
// <div>rest of dialog contents</div>
// </div>
"aria-describedby":"",
postMixInProperties: function(){
var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
dojo.mixin(this, _nlsResources);
this.inherited(arguments); this.inherited(arguments);
},postCreate:function(){ },
dojo.style(this.domNode,{display:"none",position:"absolute"});
postCreate: function(){
dojo.style(this.domNode, {
display: "none",
position:"absolute"
});
dojo.body().appendChild(this.domNode); dojo.body().appendChild(this.domNode);
this.inherited(arguments); this.inherited(arguments);
this.connect(this, "onExecute", "hide"); this.connect(this, "onExecute", "hide");
this.connect(this, "onCancel", "hide"); this.connect(this, "onCancel", "hide");
this._modalconnects = []; this._modalconnects = [];
},onLoad:function(){ },
onLoad: function(){
// summary:
// Called when data has been loaded from an href.
// Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
// but should *not* be overridden.
// tags:
// callback
// when href is specified we need to reposition the dialog after the data is loaded
// and find the focusable elements
this._position(); this._position();
if(this.autofocus){ if(this.autofocus && dijit._DialogLevelManager.isTop(this)){
this._getFocusItems(this.domNode); this._getFocusItems(this.domNode);
dijit.focus(this._firstFocusItem); dijit.focus(this._firstFocusItem);
} }
this.inherited(arguments); this.inherited(arguments);
},_endDrag:function(e){ },
_endDrag: function(e){
// summary:
// Called after dragging the Dialog. Saves the position of the dialog in the viewport.
// tags:
// private
if(e && e.node && e.node === this.domNode){ if(e && e.node && e.node === this.domNode){
this._relativePosition = dojo.position(e.node); this._relativePosition = dojo.position(e.node);
} }
},_setup:function(){ },
var _2=this.domNode;
_setup: function(){
// summary:
// Stuff we need to do before showing the Dialog for the first
// time (but we defer it until right beforehand, for
// performance reasons).
// tags:
// private
var node = this.domNode;
if(this.titleBar && this.draggable){ if(this.titleBar && this.draggable){
this._moveable=(dojo.isIE==6)?new dojo.dnd.TimedMoveable(_2,{handle:this.titleBar}):new dojo.dnd.Moveable(_2,{handle:this.titleBar,timeout:0}); this._moveable = (dojo.isIE == 6) ?
dojo.subscribe("/dnd/move/stop",this,"_endDrag"); new dojo.dnd.TimedMoveable(node, { handle: this.titleBar }) : // prevent overload, see #5285
new dojo.dnd.Moveable(node, { handle: this.titleBar, timeout: 0 });
this._dndListener = dojo.subscribe("/dnd/move/stop",this,"_endDrag");
}else{ }else{
dojo.addClass(_2,"dijitDialogFixed"); dojo.addClass(node,"dijitDialogFixed");
} }
this.underlayAttrs={dialogId:this.id,"class":dojo.map(this["class"].split(/\s/),function(s){
return s+"_underlay"; this.underlayAttrs = {
}).join(" ")}; dialogId: this.id,
this._fadeIn=dojo.fadeIn({node:_2,duration:this.duration,beforeBegin:dojo.hitch(this,function(){ "class": dojo.map(this["class"].split(/\s/), function(s){ return s+"_underlay"; }).join(" ")
var _3=dijit._underlay; };
if(!_3){ },
_3=dijit._underlay=new dijit.DialogUnderlay(this.underlayAttrs);
}else{ _size: function(){
_3.set(this.underlayAttrs); // summary:
} // If necessary, shrink dialog contents so dialog fits in viewport
var ds=dijit._dialogStack,_4=948+ds.length*2; // tags:
if(ds.length==1){ // private
_3.show();
}
dojo.style(dijit._underlay.domNode,"zIndex",_4);
dojo.style(this.domNode,"zIndex",_4+1);
}),onEnd:dojo.hitch(this,function(){
if(this.autofocus){
this._getFocusItems(this.domNode);
dijit.focus(this._firstFocusItem);
}
})});
this._fadeOut=dojo.fadeOut({node:_2,duration:this.duration,onEnd:dojo.hitch(this,function(){
_2.style.display="none";
var ds=dijit._dialogStack;
if(ds.length==0){
dijit._underlay.hide();
}else{
dojo.style(dijit._underlay.domNode,"zIndex",948+ds.length*2);
dijit._underlay.set(ds[ds.length-1].underlayAttrs);
}
if(this.refocus){
var _5=this._savedFocus;
if(ds.length>0){
var pd=ds[ds.length-1];
if(!dojo.isDescendant(_5.node,pd.domNode)){
pd._getFocusItems(pd.domNode);
_5=pd._firstFocusItem;
}
}
dijit.focus(_5);
}
})});
},uninitialize:function(){
var _6=false;
if(this._fadeIn&&this._fadeIn.status()=="playing"){
_6=true;
this._fadeIn.stop();
}
if(this._fadeOut&&this._fadeOut.status()=="playing"){
_6=true;
this._fadeOut.stop();
}
if((this.open||_6)&&!dijit._underlay._destroyed){
dijit._underlay.hide();
}
if(this._moveable){
this._moveable.destroy();
}
this.inherited(arguments);
},_size:function(){
this._checkIfSingleChild(); this._checkIfSingleChild();
// If we resized the dialog contents earlier, reset them back to original size, so
// that if the user later increases the viewport size, the dialog can display w/out a scrollbar.
// Need to do this before the dojo.marginBox(this.domNode) call below.
if(this._singleChild){ if(this._singleChild){
if(this._singleChildOriginalStyle){ if(this._singleChildOriginalStyle){
this._singleChild.domNode.style.cssText = this._singleChildOriginalStyle; this._singleChild.domNode.style.cssText = this._singleChildOriginalStyle;
} }
delete this._singleChildOriginalStyle; delete this._singleChildOriginalStyle;
}else{ }else{
dojo.style(this.containerNode,{width:"auto",height:"auto"}); dojo.style(this.containerNode, {
width:"auto",
height:"auto"
});
} }
var mb=dojo.marginBox(this.domNode);
var _7=dojo.window.getBox(); var mb = dojo._getMarginSize(this.domNode);
if(mb.w>=_7.w||mb.h>=_7.h){ var viewport = dojo.window.getBox();
var w=Math.min(mb.w,Math.floor(_7.w*0.75)),h=Math.min(mb.h,Math.floor(_7.h*0.75)); if(mb.w >= viewport.w || mb.h >= viewport.h){
// Reduce size of dialog contents so that dialog fits in viewport
var w = Math.min(mb.w, Math.floor(viewport.w * 0.75)),
h = Math.min(mb.h, Math.floor(viewport.h * 0.75));
if(this._singleChild && this._singleChild.resize){ if(this._singleChild && this._singleChild.resize){
this._singleChildOriginalStyle = this._singleChild.domNode.style.cssText; this._singleChildOriginalStyle = this._singleChild.domNode.style.cssText;
this._singleChild.resize({w: w, h: h}); this._singleChild.resize({w: w, h: h});
}else{ }else{
dojo.style(this.containerNode,{width:w+"px",height:h+"px",overflow:"auto",position:"relative"}); dojo.style(this.containerNode, {
width: w + "px",
height: h + "px",
overflow: "auto",
position: "relative" // workaround IE bug moving scrollbar or dragging dialog
});
} }
}else{ }else{
if(this._singleChild && this._singleChild.resize){ if(this._singleChild && this._singleChild.resize){
this._singleChild.resize(); this._singleChild.resize();
} }
} }
},_position:function(){ },
_position: function(){
// summary:
// Position modal dialog in the viewport. If no relative offset
// in the viewport has been determined (by dragging, for instance),
// center the node. Otherwise, use the Dialog's stored relative offset,
// and position the node to top: left: values based on the viewport.
// tags:
// private
if(!dojo.hasClass(dojo.body(),"dojoMove")){ if(!dojo.hasClass(dojo.body(),"dojoMove")){
var _8=this.domNode,_9=dojo.window.getBox(),p=this._relativePosition,bb=p?null:dojo._getBorderBox(_8),l=Math.floor(_9.l+(p?p.x:(_9.w-bb.w)/2)),t=Math.floor(_9.t+(p?p.y:(_9.h-bb.h)/2)); var node = this.domNode,
dojo.style(_8,{left:l+"px",top:t+"px"}); viewport = dojo.window.getBox(),
p = this._relativePosition,
bb = p ? null : dojo._getBorderBox(node),
l = Math.floor(viewport.l + (p ? p.x : (viewport.w - bb.w) / 2)),
t = Math.floor(viewport.t + (p ? p.y : (viewport.h - bb.h) / 2))
;
dojo.style(node,{
left: l + "px",
top: t + "px"
});
} }
},_onKey:function(_a){ },
var ds=dijit._dialogStack;
if(ds[ds.length-1]!=this){ _onKey: function(/*Event*/ evt){
return; // summary:
} // Handles the keyboard events for accessibility reasons
if(_a.charOrCode){ // tags:
// private
if(evt.charOrCode){
var dk = dojo.keys; var dk = dojo.keys;
var _b=_a.target; var node = evt.target;
if(_a.charOrCode===dk.TAB){ if(evt.charOrCode === dk.TAB){
this._getFocusItems(this.domNode); this._getFocusItems(this.domNode);
} }
var _c=(this._firstFocusItem==this._lastFocusItem); var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
if(_b==this._firstFocusItem&&_a.shiftKey&&_a.charOrCode===dk.TAB){ // see if we are shift-tabbing from first focusable item on dialog
if(!_c){ if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
dijit.focus(this._lastFocusItem); if(!singleFocusItem){
dijit.focus(this._lastFocusItem); // send focus to last item in dialog
} }
dojo.stopEvent(_a); dojo.stopEvent(evt);
}else{ }else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
if(_b==this._lastFocusItem&&_a.charOrCode===dk.TAB&&!_a.shiftKey){ if(!singleFocusItem){
if(!_c){ dijit.focus(this._firstFocusItem); // send focus to first item in dialog
dijit.focus(this._firstFocusItem);
} }
dojo.stopEvent(_a); dojo.stopEvent(evt);
}else{ }else{
while(_b){ // see if the key is for the dialog
if(_b==this.domNode||dojo.hasClass(_b,"dijitPopup")){ while(node){
if(_a.charOrCode==dk.ESCAPE){ if(node == this.domNode || dojo.hasClass(node, "dijitPopup")){
if(evt.charOrCode == dk.ESCAPE){
this.onCancel(); this.onCancel();
}else{ }else{
return; return; // just let it go
} }
} }
_b=_b.parentNode; node = node.parentNode;
} }
if(_a.charOrCode!==dk.TAB){ // this key is for the disabled document window
dojo.stopEvent(_a); if(evt.charOrCode !== dk.TAB){ // allow tabbing into the dialog for a11y
}else{ dojo.stopEvent(evt);
if(!dojo.isOpera){ // opera won't tab to a div
}else if(!dojo.isOpera){
try{ try{
this._firstFocusItem.focus(); this._firstFocusItem.focus();
} }catch(e){ /*squelch*/ }
catch(e){
} }
} }
} }
},
show: function(){
// summary:
// Display the dialog
// returns: dojo.Deferred
// Deferred object that resolves when the display animation is complete
if(this.open){ return; }
if(!this._started){
this.startup();
} }
}
} // first time we show the dialog, there's some initialization stuff to do
},show:function(){
if(this.open){
return;
}
if(!this._alreadyInitialized){ if(!this._alreadyInitialized){
this._setup(); this._setup();
this._alreadyInitialized=true; this._alreadyInitialized=true;
} }
if(this._fadeOut.status()=="playing"){
this._fadeOut.stop(); if(this._fadeOutDeferred){
this._fadeOutDeferred.cancel();
} }
this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout")); this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout"));
this._modalconnects.push(dojo.connect(window, "onresize", this, function(){ this._modalconnects.push(dojo.connect(window, "onresize", this, function(){
var _d=dojo.window.getBox(); // IE gives spurious resize events and can actually get stuck
if(!this._oldViewport||_d.h!=this._oldViewport.h||_d.w!=this._oldViewport.w){ // in an infinite loop if we don't ignore them
var viewport = dojo.window.getBox();
if(!this._oldViewport ||
viewport.h != this._oldViewport.h ||
viewport.w != this._oldViewport.w){
this.layout(); this.layout();
this._oldViewport=_d; this._oldViewport = viewport;
} }
})); }));
this._modalconnects.push(dojo.connect(dojo.doc.documentElement,"onkeypress",this,"_onKey")); this._modalconnects.push(dojo.connect(this.domNode, "onkeypress", this, "_onKey"));
dojo.style(this.domNode,{opacity:0,display:""});
this.open=true; dojo.style(this.domNode, {
this._onShow(); opacity:0,
display:""
});
this._set("open", true);
this._onShow(); // lazy load trigger
this._size(); this._size();
this._position(); this._position();
dijit._dialogStack.push(this);
this._fadeIn.play(); // fade-in Animation object, setup below
this._savedFocus=dijit.getFocus(this); var fadeIn;
},hide:function(){
var ds=dijit._dialogStack; this._fadeInDeferred = new dojo.Deferred(dojo.hitch(this, function(){
if(!this._alreadyInitialized||this!=ds[ds.length-1]){ fadeIn.stop();
delete this._fadeInDeferred;
}));
fadeIn = dojo.fadeIn({
node: this.domNode,
duration: this.duration,
beforeBegin: dojo.hitch(this, function(){
dijit._DialogLevelManager.show(this, this.underlayAttrs);
}),
onEnd: dojo.hitch(this, function(){
if(this.autofocus && dijit._DialogLevelManager.isTop(this)){
// find focusable items each time dialog is shown since if dialog contains a widget the
// first focusable items can change
this._getFocusItems(this.domNode);
dijit.focus(this._firstFocusItem);
}
this._fadeInDeferred.callback(true);
delete this._fadeInDeferred;
})
}).play();
return this._fadeInDeferred;
},
hide: function(){
// summary:
// Hide the dialog
// returns: dojo.Deferred
// Deferred object that resolves when the hide animation is complete
// if we haven't been initialized yet then we aren't showing and we can just return
if(!this._alreadyInitialized){
return; return;
} }
if(this._fadeIn.status()=="playing"){ if(this._fadeInDeferred){
this._fadeIn.stop(); this._fadeInDeferred.cancel();
} }
ds.pop();
this._fadeOut.play(); // fade-in Animation object, setup below
var fadeOut;
this._fadeOutDeferred = new dojo.Deferred(dojo.hitch(this, function(){
fadeOut.stop();
delete this._fadeOutDeferred;
}));
fadeOut = dojo.fadeOut({
node: this.domNode,
duration: this.duration,
onEnd: dojo.hitch(this, function(){
this.domNode.style.display = "none";
dijit._DialogLevelManager.hide(this);
this.onHide();
this._fadeOutDeferred.callback(true);
delete this._fadeOutDeferred;
})
}).play();
if(this._scrollConnected){ if(this._scrollConnected){
this._scrollConnected = false; this._scrollConnected = false;
} }
dojo.forEach(this._modalconnects, dojo.disconnect); dojo.forEach(this._modalconnects, dojo.disconnect);
this._modalconnects = []; this._modalconnects = [];
if(this._relativePosition){ if(this._relativePosition){
delete this._relativePosition; delete this._relativePosition;
} }
this.open=false; this._set("open", false);
this.onHide();
},layout:function(){ return this._fadeOutDeferred;
},
layout: function(){
// summary:
// Position the Dialog and the underlay
// tags:
// private
if(this.domNode.style.display != "none"){ if(this.domNode.style.display != "none"){
if(dijit._underlay){ if(dijit._underlay){ // avoid race condition during show()
dijit._underlay.layout(); dijit._underlay.layout();
} }
this._position(); this._position();
} }
},destroy:function(){ },
destroy: function(){
if(this._fadeInDeferred){
this._fadeInDeferred.cancel();
}
if(this._fadeOutDeferred){
this._fadeOutDeferred.cancel();
}
if(this._moveable){
this._moveable.destroy();
}
if(this._dndListener){
dojo.unsubscribe(this._dndListener);
}
dojo.forEach(this._modalconnects, dojo.disconnect); dojo.forEach(this._modalconnects, dojo.disconnect);
if(this.refocus&&this.open){
setTimeout(dojo.hitch(dijit,"focus",this._savedFocus),25); dijit._DialogLevelManager.hide(this);
}
this.inherited(arguments); this.inherited(arguments);
}}); }
dojo.declare("dijit.Dialog",[dijit.layout.ContentPane,dijit._DialogBase],{}); }
dijit._dialogStack=[]; );
dojo.require("dijit.TooltipDialog");
dojo.declare(
"dijit.Dialog",
[dijit.layout.ContentPane, dijit._DialogBase],
{}
);
dijit._DialogLevelManager = {
// summary:
// Controls the various active "levels" on the page, starting with the
// stuff initially visible on the page (at z-index 0), and then having an entry for
// each Dialog shown.
show: function(/*dijit._Widget*/ dialog, /*Object*/ underlayAttrs){
// summary:
// Call right before fade-in animation for new dialog.
// Saves current focus, displays/adjusts underlay for new dialog,
// and sets the z-index of the dialog itself.
//
// New dialog will be displayed on top of all currently displayed dialogs.
//
// Caller is responsible for setting focus in new dialog after the fade-in
// animation completes.
var ds = dijit._dialogStack;
// Save current focus
ds[ds.length-1].focus = dijit.getFocus(dialog);
// Display the underlay, or if already displayed then adjust for this new dialog
var underlay = dijit._underlay;
if(!underlay || underlay._destroyed){
underlay = dijit._underlay = new dijit.DialogUnderlay(underlayAttrs);
}else{
underlay.set(dialog.underlayAttrs);
}
// Set z-index a bit above previous dialog
var zIndex = ds[ds.length-1].dialog ? ds[ds.length-1].zIndex + 2 : 950;
if(ds.length == 1){ // first dialog
underlay.show();
}
dojo.style(dijit._underlay.domNode, 'zIndex', zIndex - 1);
// Dialog
dojo.style(dialog.domNode, 'zIndex', zIndex);
ds.push({dialog: dialog, underlayAttrs: underlayAttrs, zIndex: zIndex});
},
hide: function(/*dijit._Widget*/ dialog){
// summary:
// Called when the specified dialog is hidden/destroyed, after the fade-out
// animation ends, in order to reset page focus, fix the underlay, etc.
// If the specified dialog isn't open then does nothing.
//
// Caller is responsible for either setting display:none on the dialog domNode,
// or calling dijit.popup.hide(), or removing it from the page DOM.
var ds = dijit._dialogStack;
if(ds[ds.length-1].dialog == dialog){
// Removing the top (or only) dialog in the stack, return focus
// to previous dialog
ds.pop();
var pd = ds[ds.length-1]; // the new active dialog (or the base page itself)
// Adjust underlay
if(ds.length == 1){
// Returning to original page.
// Hide the underlay, unless the underlay widget has already been destroyed
// because we are being called during page unload (when all widgets are destroyed)
if(!dijit._underlay._destroyed){
dijit._underlay.hide();
}
}else{
// Popping back to previous dialog, adjust underlay
dojo.style(dijit._underlay.domNode, 'zIndex', pd.zIndex - 1);
dijit._underlay.set(pd.underlayAttrs);
}
// Adjust focus
if(dialog.refocus){
// If we are returning control to a previous dialog but for some reason
// that dialog didn't have a focused field, set focus to first focusable item.
// This situation could happen if two dialogs appeared at nearly the same time,
// since a dialog doesn't set it's focus until the fade-in is finished.
var focus = pd.focus;
if(!focus || (pd.dialog && !dojo.isDescendant(focus.node, pd.dialog.domNode))){
pd.dialog._getFocusItems(pd.dialog.domNode);
focus = pd.dialog._firstFocusItem;
}
try{
dijit.focus(focus);
}catch(e){
/* focus() will fail if user opened the dialog by clicking a non-focusable element */
}
}
}else{
// Removing a dialog out of order (#9944, #10705).
// Don't need to mess with underlay or z-index or anything.
var idx = dojo.indexOf(dojo.map(ds, function(elem){return elem.dialog}), dialog);
if(idx != -1){
ds.splice(idx, 1);
}
}
},
isTop: function(/*dijit._Widget*/ dialog){
// summary:
// Returns true if specified Dialog is the top in the task
var ds = dijit._dialogStack;
return ds[ds.length-1].dialog == dialog;
}
};
// Stack representing the various active "levels" on the page, starting with the
// stuff initially visible on the page (at z-index 0), and then having an entry for
// each Dialog shown.
// Each element in stack has form {
// dialog: dialogWidget,
// focus: returnFromGetFocus(),
// underlayAttrs: attributes to set on underlay (when this widget is active)
// }
dijit._dialogStack = [
{dialog: null, focus: null, underlayAttrs: null} // entry for stuff at z-index: 0
];
} }

View File

@@ -1,42 +1,112 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.DialogUnderlay"]){ if(!dojo._hasResource["dijit.DialogUnderlay"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.DialogUnderlay"] = true; dojo._hasResource["dijit.DialogUnderlay"] = true;
dojo.provide("dijit.DialogUnderlay"); dojo.provide("dijit.DialogUnderlay");
dojo.require("dojo.window"); dojo.require("dojo.window");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit.DialogUnderlay",[dijit._Widget,dijit._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(id){
dojo.declare(
"dijit.DialogUnderlay",
[dijit._Widget, dijit._Templated],
{
// summary:
// The component that blocks the screen behind a `dijit.Dialog`
//
// description:
// A component used to block input behind a `dijit.Dialog`. Only a single
// instance of this widget is created by `dijit.Dialog`, and saved as
// a reference to be shared between all Dialogs as `dijit._underlay`
//
// The underlay itself can be styled based on and id:
// | #myDialog_underlay { background-color:red; }
//
// In the case of `dijit.Dialog`, this id is based on the id of the Dialog,
// suffixed with _underlay.
// Template has two divs; outer div is used for fade-in/fade-out, and also to hold background iframe.
// Inner div has opacity specified in CSS file.
templateString: "<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",
// Parameters on creation or updatable later
// dialogId: String
// Id of the dialog.... DialogUnderlay's id is based on this id
dialogId: "",
// class: String
// This class name is used on the DialogUnderlay node, in addition to dijitDialogUnderlay
"class": "",
attributeMap: { id: "domNode" },
_setDialogIdAttr: function(id){
dojo.attr(this.node, "id", id + "_underlay"); dojo.attr(this.node, "id", id + "_underlay");
},_setClassAttr:function(_1){ this._set("dialogId", id);
this.node.className="dijitDialogUnderlay "+_1; },
},postCreate:function(){
_setClassAttr: function(clazz){
this.node.className = "dijitDialogUnderlay " + clazz;
this._set("class", clazz);
},
postCreate: function(){
// summary:
// Append the underlay to the body
dojo.body().appendChild(this.domNode); dojo.body().appendChild(this.domNode);
},layout:function(){ },
var is=this.node.style,os=this.domNode.style;
layout: function(){
// summary:
// Sets the background to the size of the viewport
//
// description:
// Sets the background to the size of the viewport (rather than the size
// of the document) since we need to cover the whole browser window, even
// if the document is only a few lines long.
// tags:
// private
var is = this.node.style,
os = this.domNode.style;
// hide the background temporarily, so that the background itself isn't
// causing scrollbars to appear (might happen when user shrinks browser
// window and then we are called to resize)
os.display = "none"; os.display = "none";
var _2=dojo.window.getBox();
os.top=_2.t+"px"; // then resize and show
os.left=_2.l+"px"; var viewport = dojo.window.getBox();
is.width=_2.w+"px"; os.top = viewport.t + "px";
is.height=_2.h+"px"; os.left = viewport.l + "px";
is.width = viewport.w + "px";
is.height = viewport.h + "px";
os.display = "block"; os.display = "block";
},show:function(){ },
show: function(){
// summary:
// Show the dialog underlay
this.domNode.style.display = "block"; this.domNode.style.display = "block";
this.layout(); this.layout();
this.bgIframe = new dijit.BackgroundIframe(this.domNode); this.bgIframe = new dijit.BackgroundIframe(this.domNode);
},hide:function(){ },
hide: function(){
// summary:
// Hides the dialog underlay
this.bgIframe.destroy(); this.bgIframe.destroy();
delete this.bgIframe;
this.domNode.style.display = "none"; this.domNode.style.display = "none";
},uninitialize:function(){
if(this.bgIframe){
this.bgIframe.destroy();
} }
this.inherited(arguments); }
}}); );
} }

View File

@@ -1,11 +1,11 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Editor"]){ if(!dojo._hasResource["dijit.Editor"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Editor"] = true; dojo._hasResource["dijit.Editor"] = true;
dojo.provide("dijit.Editor"); dojo.provide("dijit.Editor");
dojo.require("dijit._editor.RichText"); dojo.require("dijit._editor.RichText");
@@ -17,42 +17,121 @@ dojo.require("dijit._editor.range");
dojo.require("dijit._Container"); dojo.require("dijit._Container");
dojo.require("dojo.i18n"); dojo.require("dojo.i18n");
dojo.require("dijit.layout._LayoutWidget"); dojo.require("dijit.layout._LayoutWidget");
dojo.require("dijit._editor.range"); dojo.requireLocalization("dijit._editor", "commands", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.requireLocalization("dijit._editor","commands",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.declare("dijit.Editor",dijit._editor.RichText,{plugins:null,extraPlugins:null,constructor:function(){
dojo.declare(
"dijit.Editor",
dijit._editor.RichText,
{
// summary:
// A rich text Editing widget
//
// description:
// This widget provides basic WYSIWYG editing features, based on the browser's
// underlying rich text editing capability, accompanied by a toolbar (`dijit.Toolbar`).
// A plugin model is available to extend the editor's capabilities as well as the
// the options available in the toolbar. Content generation may vary across
// browsers, and clipboard operations may have different results, to name
// a few limitations. Note: this widget should not be used with the HTML
// &lt;TEXTAREA&gt; tag -- see dijit._editor.RichText for details.
// plugins: [const] Object[]
// A list of plugin names (as strings) or instances (as objects)
// for this widget.
//
// When declared in markup, it might look like:
// | plugins="['bold',{name:'dijit._editor.plugins.FontChoice', command:'fontName', generic:true}]"
plugins: null,
// extraPlugins: [const] Object[]
// A list of extra plugin names which will be appended to plugins array
extraPlugins: null,
constructor: function(){
// summary:
// Runs on widget initialization to setup arrays etc.
// tags:
// private
if(!dojo.isArray(this.plugins)){ if(!dojo.isArray(this.plugins)){
this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull","dijit._editor.plugins.EnterKeyHandling"]; this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|",
"insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",
"dijit._editor.plugins.EnterKeyHandling" /*, "createLink"*/];
} }
this._plugins=[]; this._plugins=[];
this._editInterval = this.editActionInterval * 1000; this._editInterval = this.editActionInterval * 1000;
//IE will always lose focus when other element gets focus, while for FF and safari,
//when no iframe is used, focus will be lost whenever another element gets focus.
//For IE, we can connect to onBeforeDeactivate, which will be called right before
//the focus is lost, so we can obtain the selected range. For other browsers,
//no equivelent of onBeforeDeactivate, so we need to do two things to make sure
//selection is properly saved before focus is lost: 1) when user clicks another
//element in the page, in which case we listen to mousedown on the entire page and
//see whether user clicks out of a focus editor, if so, save selection (focus will
//only lost after onmousedown event is fired, so we can obtain correct caret pos.)
//2) when user tabs away from the editor, which is handled in onKeyDown below.
if(dojo.isIE){ if(dojo.isIE){
this.events.push("onBeforeDeactivate"); this.events.push("onBeforeDeactivate");
this.events.push("onBeforeActivate"); this.events.push("onBeforeActivate");
} }
},postCreate:function(){ },
postMixInProperties: function() {
// summary:
// Extension to make sure a deferred is in place before certain functions
// execute, like making sure all the plugins are properly inserted.
// Set up a deferred so that the value isn't applied to the editor
// until all the plugins load, needed to avoid timing condition
// reported in #10537.
this.setValueDeferred = new dojo.Deferred();
this.inherited(arguments);
},
postCreate: function(){
//for custom undo/redo, if enabled.
this._steps=this._steps.slice(0); this._steps=this._steps.slice(0);
this._undoedSteps=this._undoedSteps.slice(0); this._undoedSteps=this._undoedSteps.slice(0);
if(dojo.isArray(this.extraPlugins)){ if(dojo.isArray(this.extraPlugins)){
this.plugins=this.plugins.concat(this.extraPlugins); this.plugins=this.plugins.concat(this.extraPlugins);
} }
this.setValueDeferred=new dojo.Deferred();
this.inherited(arguments); this.inherited(arguments);
this.commands = dojo.i18n.getLocalization("dijit._editor", "commands", this.lang); this.commands = dojo.i18n.getLocalization("dijit._editor", "commands", this.lang);
if(!this.toolbar){ if(!this.toolbar){
this.toolbar=new dijit.Toolbar({dir:this.dir,lang:this.lang}); // if we haven't been assigned a toolbar, create one
this.toolbar = new dijit.Toolbar({
dir: this.dir,
lang: this.lang
});
this.header.appendChild(this.toolbar.domNode); this.header.appendChild(this.toolbar.domNode);
} }
dojo.forEach(this.plugins, this.addPlugin, this); dojo.forEach(this.plugins, this.addPlugin, this);
// Okay, denote the value can now be set.
this.setValueDeferred.callback(true); this.setValueDeferred.callback(true);
dojo.addClass(this.iframe.parentNode, "dijitEditorIFrameContainer"); dojo.addClass(this.iframe.parentNode, "dijitEditorIFrameContainer");
dojo.addClass(this.iframe, "dijitEditorIFrame"); dojo.addClass(this.iframe, "dijitEditorIFrame");
dojo.attr(this.iframe, "allowTransparency", true); dojo.attr(this.iframe, "allowTransparency", true);
if(dojo.isWebKit){ if(dojo.isWebKit){
// Disable selecting the entire editor by inadvertant double-clicks.
// on buttons, title bar, etc. Otherwise clicking too fast on
// a button such as undo/redo selects the entire editor.
dojo.style(this.domNode, "KhtmlUserSelect", "none"); dojo.style(this.domNode, "KhtmlUserSelect", "none");
} }
this.toolbar.startup(); this.toolbar.startup();
this.onNormalizedDisplayChanged(); this.onNormalizedDisplayChanged(); //update toolbar button status
},destroy:function(){ },
destroy: function(){
dojo.forEach(this._plugins, function(p){ dojo.forEach(this._plugins, function(p){
if(p && p.destroy){ if(p && p.destroy){
p.destroy(); p.destroy();
@@ -62,89 +141,189 @@ this._plugins=[];
this.toolbar.destroyRecursive(); this.toolbar.destroyRecursive();
delete this.toolbar; delete this.toolbar;
this.inherited(arguments); this.inherited(arguments);
},addPlugin:function(_1,_2){ },
var _3=dojo.isString(_1)?{name:_1}:_1; addPlugin: function(/*String||Object*/plugin, /*Integer?*/index){
if(!_3.setEditor){ // summary:
var o={"args":_3,"plugin":null,"editor":this}; // takes a plugin name as a string or a plugin instance and
// adds it to the toolbar and associates it with this editor
// instance. The resulting plugin is added to the Editor's
// plugins array. If index is passed, it's placed in the plugins
// array at that index. No big magic, but a nice helper for
// passing in plugin names via markup.
//
// plugin: String, args object or plugin instance
//
// args:
// This object will be passed to the plugin constructor
//
// index: Integer
// Used when creating an instance from
// something already in this.plugins. Ensures that the new
// instance is assigned to this.plugins at that index.
var args=dojo.isString(plugin)?{name:plugin}:plugin;
if(!args.setEditor){
var o={"args":args,"plugin":null,"editor":this};
dojo.publish(dijit._scopeName + ".Editor.getPlugin",[o]); dojo.publish(dijit._scopeName + ".Editor.getPlugin",[o]);
if(!o.plugin){ if(!o.plugin){
var pc=dojo.getObject(_3.name); var pc = dojo.getObject(args.name);
if(pc){ if(pc){
o.plugin=new pc(_3); o.plugin=new pc(args);
} }
} }
if(!o.plugin){ if(!o.plugin){
console.warn("Cannot find plugin",_1); console.warn('Cannot find plugin',plugin);
return; return;
} }
_1=o.plugin; plugin=o.plugin;
} }
if(arguments.length > 1){ if(arguments.length > 1){
this._plugins[_2]=_1; this._plugins[index] = plugin;
}else{ }else{
this._plugins.push(_1); this._plugins.push(plugin);
} }
_1.setEditor(this); plugin.setEditor(this);
if(dojo.isFunction(_1.setToolbar)){ if(dojo.isFunction(plugin.setToolbar)){
_1.setToolbar(this.toolbar); plugin.setToolbar(this.toolbar);
} }
},startup:function(){ },
},resize:function(_4){ //the following 3 functions are required to make the editor play nice under a layout widget, see #4070
if(_4){ startup: function(){
// summary:
// Exists to make Editor work as a child of a layout widget.
// Developers don't need to call this method.
// tags:
// protected
//console.log('startup',arguments);
},
resize: function(size){
// summary:
// Resize the editor to the specified size, see `dijit.layout._LayoutWidget.resize`
if(size){
// we've been given a height/width for the entire editor (toolbar + contents), calls layout()
// to split the allocated size between the toolbar and the contents
dijit.layout._LayoutWidget.prototype.resize.apply(this, arguments); dijit.layout._LayoutWidget.prototype.resize.apply(this, arguments);
} }
},layout:function(){ /*
var _5=(this._contentBox.h-(this.getHeaderHeight()+this.getFooterHeight()+dojo._getPadBorderExtents(this.iframe.parentNode).h+dojo._getMarginExtents(this.iframe.parentNode).h)); else{
this.editingArea.style.height=_5+"px"; // do nothing, the editor is already laid out correctly. The user has probably specified
// the height parameter, which was used to set a size on the iframe
}
*/
},
layout: function(){
// summary:
// Called from `dijit.layout._LayoutWidget.resize`. This shouldn't be called directly
// tags:
// protected
// Converts the iframe (or rather the <div> surrounding it) to take all the available space
// except what's needed for the header (toolbars) and footer (breadcrumbs, etc).
// A class was added to the iframe container and some themes style it, so we have to
// calc off the added margins and padding too. See tracker: #10662
var areaHeight = (this._contentBox.h -
(this.getHeaderHeight() + this.getFooterHeight() +
dojo._getPadBorderExtents(this.iframe.parentNode).h +
dojo._getMarginExtents(this.iframe.parentNode).h));
this.editingArea.style.height = areaHeight + "px";
if(this.iframe){ if(this.iframe){
this.iframe.style.height="100%"; this.iframe.style.height="100%";
} }
this._layoutMode = true; this._layoutMode = true;
},_onIEMouseDown:function(e){ },
var _6; _onIEMouseDown: function(/*Event*/ e){
// summary:
// IE only to prevent 2 clicks to focus
// tags:
// private
var outsideClientArea;
// IE 8's componentFromPoint is broken, which is a shame since it
// was smaller code, but oh well. We have to do this brute force
// to detect if the click was scroller or not.
var b = this.document.body; var b = this.document.body;
var _7=b.clientWidth; var clientWidth = b.clientWidth;
var _8=b.clientHeight; var clientHeight = b.clientHeight;
var _9=b.clientLeft; var clientLeft = b.clientLeft;
var _a=b.offsetWidth; var offsetWidth = b.offsetWidth;
var _b=b.offsetHeight; var offsetHeight = b.offsetHeight;
var _c=b.offsetLeft; var offsetLeft = b.offsetLeft;
//Check for vertical scroller click.
bodyDir = b.dir ? b.dir.toLowerCase() : ""; bodyDir = b.dir ? b.dir.toLowerCase() : "";
if(bodyDir != "rtl"){ if(bodyDir != "rtl"){
if(_7<_a&&e.x>_7&&e.x<_a){ if(clientWidth < offsetWidth && e.x > clientWidth && e.x < offsetWidth){
_6=true; // Check the click was between width and offset width, if so, scroller
outsideClientArea = true;
} }
}else{ }else{
if(e.x<_9&&e.x>_c){ // RTL mode, we have to go by the left offsets.
_6=true; if(e.x < clientLeft && e.x > offsetLeft){
// Check the click was between width and offset width, if so, scroller
outsideClientArea = true;
} }
} }
if(!_6){ if(!outsideClientArea){
if(_8<_b&&e.y>_8&&e.y<_b){ // Okay, might be horiz scroller, check that.
_6=true; if(clientHeight < offsetHeight && e.y > clientHeight && e.y < offsetHeight){
// Horizontal scroller.
outsideClientArea = true;
} }
} }
if(!_6){ if(!outsideClientArea){
delete this._cursorToStart; delete this._cursorToStart; // Remove the force to cursor to start position.
delete this._savedSelection; delete this._savedSelection; // new mouse position overrides old selection
if(e.target.tagName == "BODY"){ if(e.target.tagName == "BODY"){
setTimeout(dojo.hitch(this, "placeCursorAtEnd"), 0); setTimeout(dojo.hitch(this, "placeCursorAtEnd"), 0);
} }
this.inherited(arguments); this.inherited(arguments);
} }
},onBeforeActivate:function(e){ },
onBeforeActivate: function(e){
this._restoreSelection(); this._restoreSelection();
},onBeforeDeactivate:function(e){ },
onBeforeDeactivate: function(e){
// summary:
// Called on IE right before focus is lost. Saves the selected range.
// tags:
// private
if(this.customUndo){ if(this.customUndo){
this.endEditing(true); this.endEditing(true);
} }
//in IE, the selection will be lost when other elements get focus,
//let's save focus before the editor is deactivated
if(e.target.tagName != "BODY"){ if(e.target.tagName != "BODY"){
this._saveSelection(); this._saveSelection();
} }
},customUndo:dojo.isIE||dojo.isWebKit,editActionInterval:3,beginEditing:function(_d){ //console.log('onBeforeDeactivate',this);
},
/* beginning of custom undo/redo support */
// customUndo: Boolean
// Whether we shall use custom undo/redo support instead of the native
// browser support. By default, we now use custom undo. It works better
// than native browser support and provides a consistent behavior across
// browsers with a minimal performance hit. We already had the hit on
// the slowest browser, IE, anyway.
customUndo: true,
// editActionInterval: Integer
// When using customUndo, not every keystroke will be saved as a step.
// Instead typing (including delete) will be grouped together: after
// a user stops typing for editActionInterval seconds, a step will be
// saved; if a user resume typing within editActionInterval seconds,
// the timeout will be restarted. By default, editActionInterval is 3
// seconds.
editActionInterval: 3,
beginEditing: function(cmd){
// summary:
// Called to note that the user has started typing alphanumeric characters, if it's not already noted.
// Deals with saving undo; see editActionInterval parameter.
// tags:
// private
if(!this._inEditing){ if(!this._inEditing){
this._inEditing=true; this._inEditing=true;
this._beginEditing(_d); this._beginEditing(cmd);
} }
if(this.editActionInterval>0){ if(this.editActionInterval>0){
if(this._editTimer){ if(this._editTimer){
@@ -152,25 +331,40 @@ clearTimeout(this._editTimer);
} }
this._editTimer = setTimeout(dojo.hitch(this, this.endEditing), this._editInterval); this._editTimer = setTimeout(dojo.hitch(this, this.endEditing), this._editInterval);
} }
},_steps:[],_undoedSteps:[],execCommand:function(_e){ },
if(this.customUndo&&(_e=="undo"||_e=="redo")){
return this[_e](); // TODO: declaring these in the prototype is meaningless, just create in the constructor/postCreate
_steps:[],
_undoedSteps:[],
execCommand: function(cmd){
// summary:
// Main handler for executing any commands to the editor, like paste, bold, etc.
// Called by plugins, but not meant to be called by end users.
// tags:
// protected
if(this.customUndo && (cmd == 'undo' || cmd == 'redo')){
return this[cmd]();
}else{ }else{
if(this.customUndo){ if(this.customUndo){
this.endEditing(); this.endEditing();
this._beginEditing(); this._beginEditing();
} }
var r; var r;
var isClipboard = /copy|cut|paste/.test(cmd);
try{ try{
r=this.inherited("execCommand",arguments); r = this.inherited(arguments);
if(dojo.isWebKit&&_e=="paste"&&!r){ if(dojo.isWebKit && isClipboard && !r){ //see #4598: webkit does not guarantee clipboard support from js
throw {code:1011}; throw { code: 1011 }; // throw an object like Mozilla's error
} }
} }catch(e){
catch(e){ //TODO: when else might we get an exception? Do we need the Mozilla test below?
if(e.code==1011&&/copy|cut|paste/.test(_e)){ if(e.code == 1011 /* Mozilla: service denied */ && isClipboard){
var _f=dojo.string.substitute,_10={cut:"X",copy:"C",paste:"V"}; // Warn user of platform limitation. Cannot programmatically access clipboard. See ticket #4136
alert(_f(this.commands.systemShortcut,[this.commands[_e],_f(this.commands[dojo.isMac?"appleKey":"ctrlKey"],[_10[_e]])])); var sub = dojo.string.substitute,
accel = {cut:'X', copy:'C', paste:'V'};
alert(sub(this.commands.systemShortcut,
[this.commands[cmd], sub(this.commands[dojo.isMac ? 'appleKey' : 'ctrlKey'], [accel[cmd]])]));
} }
r = false; r = false;
} }
@@ -179,64 +373,94 @@ this._endEditing();
} }
return r; return r;
} }
},queryCommandEnabled:function(cmd){ },
if(this.customUndo&&(cmd=="undo"||cmd=="redo")){ queryCommandEnabled: function(cmd){
return cmd=="undo"?(this._steps.length>1):(this._undoedSteps.length>0); // summary:
// Returns true if specified editor command is enabled.
// Used by the plugins to know when to highlight/not highlight buttons.
// tags:
// protected
if(this.customUndo && (cmd == 'undo' || cmd == 'redo')){
return cmd == 'undo' ? (this._steps.length > 1) : (this._undoedSteps.length > 0);
}else{ }else{
return this.inherited("queryCommandEnabled",arguments); return this.inherited(arguments);
} }
},_moveToBookmark:function(b){ },
var _11=b.mark; _moveToBookmark: function(b){
var _12=b.mark; // summary:
// Selects the text specified in bookmark b
// tags:
// private
var bookmark = b.mark;
var mark = b.mark;
var col = b.isCollapsed; var col = b.isCollapsed;
var r,_13,_14,sel; var r, sNode, eNode, sel;
if(_12){ if(mark){
if(dojo.isIE){ if(dojo.isIE < 9){
if(dojo.isArray(_12)){ if(dojo.isArray(mark)){
_11=[]; //IE CONTROL, have to use the native bookmark.
dojo.forEach(_12,function(n){ bookmark = [];
_11.push(dijit.range.getNode(n,this.editNode)); dojo.forEach(mark,function(n){
bookmark.push(dijit.range.getNode(n,this.editNode));
},this); },this);
dojo.withGlobal(this.window,"moveToBookmark",dijit,[{mark:_11,isCollapsed:col}]); dojo.withGlobal(this.window,'moveToBookmark',dijit,[{mark: bookmark, isCollapsed: col}]);
}else{ }else{
if(_12.startContainer&&_12.endContainer){ if(mark.startContainer && mark.endContainer){
// Use the pseudo WC3 range API. This works better for positions
// than the IE native bookmark code.
sel = dijit.range.getSelection(this.window); sel = dijit.range.getSelection(this.window);
if(sel && sel.removeAllRanges){ if(sel && sel.removeAllRanges){
sel.removeAllRanges(); sel.removeAllRanges();
r = dijit.range.create(this.window); r = dijit.range.create(this.window);
_13=dijit.range.getNode(_12.startContainer,this.editNode); sNode = dijit.range.getNode(mark.startContainer,this.editNode);
_14=dijit.range.getNode(_12.endContainer,this.editNode); eNode = dijit.range.getNode(mark.endContainer,this.editNode);
if(_13&&_14){ if(sNode && eNode){
r.setStart(_13,_12.startOffset); // Okay, we believe we found the position, so add it into the selection
r.setEnd(_14,_12.endOffset); // There are cases where it may not be found, particularly in undo/redo, when
// IE changes the underlying DOM on us (wraps text in a <p> tag or similar.
// So, in those cases, don't bother restoring selection.
r.setStart(sNode,mark.startOffset);
r.setEnd(eNode,mark.endOffset);
sel.addRange(r); sel.addRange(r);
} }
} }
} }
} }
}else{ }else{//w3c range
sel = dijit.range.getSelection(this.window); sel = dijit.range.getSelection(this.window);
if(sel && sel.removeAllRanges){ if(sel && sel.removeAllRanges){
sel.removeAllRanges(); sel.removeAllRanges();
r = dijit.range.create(this.window); r = dijit.range.create(this.window);
_13=dijit.range.getNode(_12.startContainer,this.editNode); sNode = dijit.range.getNode(mark.startContainer,this.editNode);
_14=dijit.range.getNode(_12.endContainer,this.editNode); eNode = dijit.range.getNode(mark.endContainer,this.editNode);
if(_13&&_14){ if(sNode && eNode){
r.setStart(_13,_12.startOffset); // Okay, we believe we found the position, so add it into the selection
r.setEnd(_14,_12.endOffset); // There are cases where it may not be found, particularly in undo/redo, when
// formatting as been done and so on, so don't restore selection then.
r.setStart(sNode,mark.startOffset);
r.setEnd(eNode,mark.endOffset);
sel.addRange(r); sel.addRange(r);
} }
} }
} }
} }
},_changeToStep:function(_15,to){ },
_changeToStep: function(from, to){
// summary:
// Reverts editor to "to" setting, from the undo stack.
// tags:
// private
this.setValue(to.text); this.setValue(to.text);
var b=to.bookmark; var b=to.bookmark;
if(!b){ if(!b){ return; }
return;
}
this._moveToBookmark(b); this._moveToBookmark(b);
},undo:function(){ },
undo: function(){
// summary:
// Handler for editor undo (ex: ctrl-z) operation
// tags:
// private
//console.log('undo');
var ret = false; var ret = false;
if(!this._undoRedoActive){ if(!this._undoRedoActive){
this._undoRedoActive = true; this._undoRedoActive = true;
@@ -253,7 +477,13 @@ ret=true;
delete this._undoRedoActive; delete this._undoRedoActive;
} }
return ret; return ret;
},redo:function(){ },
redo: function(){
// summary:
// Handler for editor redo (ex: ctrl-y) operation
// tags:
// private
//console.log('redo');
var ret = false; var ret = false;
if(!this._undoRedoActive){ if(!this._undoRedoActive){
this._undoRedoActive = true; this._undoRedoActive = true;
@@ -269,34 +499,48 @@ ret=true;
delete this._undoRedoActive; delete this._undoRedoActive;
} }
return ret; return ret;
},endEditing:function(_16){ },
endEditing: function(ignore_caret){
// summary:
// Called to note that the user has stopped typing alphanumeric characters, if it's not already noted.
// Deals with saving undo; see editActionInterval parameter.
// tags:
// private
if(this._editTimer){ if(this._editTimer){
clearTimeout(this._editTimer); clearTimeout(this._editTimer);
} }
if(this._inEditing){ if(this._inEditing){
this._endEditing(_16); this._endEditing(ignore_caret);
this._inEditing=false; this._inEditing=false;
} }
},_getBookmark:function(){ },
_getBookmark: function(){
// summary:
// Get the currently selected text
// tags:
// protected
var b=dojo.withGlobal(this.window,dijit.getBookmark); var b=dojo.withGlobal(this.window,dijit.getBookmark);
var tmp=[]; var tmp=[];
if(b && b.mark){ if(b && b.mark){
var _17=b.mark; var mark = b.mark;
if(dojo.isIE){ if(dojo.isIE < 9){
// Try to use the pseudo range API on IE for better accuracy.
var sel = dijit.range.getSelection(this.window); var sel = dijit.range.getSelection(this.window);
if(!dojo.isArray(_17)){ if(!dojo.isArray(mark)){
if(sel){ if(sel){
var _18; var range;
if(sel.rangeCount){ if(sel.rangeCount){
_18=sel.getRangeAt(0); range = sel.getRangeAt(0);
} }
if(_18){ if(range){
b.mark=_18.cloneRange(); b.mark = range.cloneRange();
}else{ }else{
b.mark = dojo.withGlobal(this.window,dijit.getBookmark); b.mark = dojo.withGlobal(this.window,dijit.getBookmark);
} }
} }
}else{ }else{
// Control ranges (img, table, etc), handle differently.
dojo.forEach(b.mark,function(n){ dojo.forEach(b.mark,function(n){
tmp.push(dijit.range.getIndex(n,this.editNode).o); tmp.push(dijit.range.getIndex(n,this.editNode).o);
},this); },this);
@@ -306,23 +550,51 @@ b.mark=tmp;
try{ try{
if(b.mark && b.mark.startContainer){ if(b.mark && b.mark.startContainer){
tmp=dijit.range.getIndex(b.mark.startContainer,this.editNode).o; tmp=dijit.range.getIndex(b.mark.startContainer,this.editNode).o;
b.mark={startContainer:tmp,startOffset:b.mark.startOffset,endContainer:b.mark.endContainer===b.mark.startContainer?tmp:dijit.range.getIndex(b.mark.endContainer,this.editNode).o,endOffset:b.mark.endOffset}; b.mark={startContainer:tmp,
startOffset:b.mark.startOffset,
endContainer:b.mark.endContainer===b.mark.startContainer?tmp:dijit.range.getIndex(b.mark.endContainer,this.editNode).o,
endOffset:b.mark.endOffset};
} }
} }catch(e){
catch(e){
b.mark = null; b.mark = null;
} }
} }
return b; return b;
},_beginEditing:function(cmd){ },
_beginEditing: function(cmd){
// summary:
// Called when the user starts typing alphanumeric characters.
// Deals with saving undo; see editActionInterval parameter.
// tags:
// private
if(this._steps.length === 0){ if(this._steps.length === 0){
this._steps.push({"text":dijit._editor.getChildrenHtml(this.editNode),"bookmark":this._getBookmark()}); // You want to use the editor content without post filtering
// to make sure selection restores right for the 'initial' state.
// and undo is called. So not using this.value, as it was 'processed'
// and the line-up for selections may have been altered.
this._steps.push({'text':dijit._editor.getChildrenHtml(this.editNode),'bookmark':this._getBookmark()});
} }
},_endEditing:function(_19){ },
_endEditing: function(ignore_caret){
// summary:
// Called when the user stops typing alphanumeric characters.
// Deals with saving undo; see editActionInterval parameter.
// tags:
// private
// Avoid filtering to make sure selections restore.
var v = dijit._editor.getChildrenHtml(this.editNode); var v = dijit._editor.getChildrenHtml(this.editNode);
this._undoedSteps=[];
this._undoedSteps=[];//clear undoed steps
this._steps.push({text: v, bookmark: this._getBookmark()}); this._steps.push({text: v, bookmark: this._getBookmark()});
},onKeyDown:function(e){ },
onKeyDown: function(e){
// summary:
// Handler for onkeydown event.
// tags:
// private
//We need to save selection if the user TAB away from this editor
//no need to call _saveSelection for IE, as that will be taken care of in onBeforeDeactivate
if(!dojo.isIE && !this.iframe && e.keyCode == dojo.keys.TAB && !this.tabIndent){ if(!dojo.isIE && !this.iframe && e.keyCode == dojo.keys.TAB && !this.tabIndent){
this._saveSelection(); this._saveSelection();
} }
@@ -331,44 +603,47 @@ this.inherited(arguments);
return; return;
} }
var k = e.keyCode, ks = dojo.keys; var k = e.keyCode, ks = dojo.keys;
if(e.ctrlKey&&!e.altKey){ if(e.ctrlKey && !e.altKey){//undo and redo only if the special right Alt + z/y are not pressed #5892
if(k==90||k==122){ if(k == 90 || k == 122){ //z
dojo.stopEvent(e); dojo.stopEvent(e);
this.undo(); this.undo();
return; return;
}else{ }else if(k == 89 || k == 121){ //y
if(k==89||k==121){
dojo.stopEvent(e); dojo.stopEvent(e);
this.redo(); this.redo();
return; return;
} }
} }
}
this.inherited(arguments); this.inherited(arguments);
switch(k){ switch(k){
case ks.ENTER: case ks.ENTER:
case ks.BACKSPACE: case ks.BACKSPACE:
case ks.DELETE: case ks.DELETE:
this.beginEditing(); this.beginEditing();
break; break;
case 88: case 88: //x
case 86: case 86: //v
if(e.ctrlKey && !e.altKey && !e.metaKey){ if(e.ctrlKey && !e.altKey && !e.metaKey){
this.endEditing(); this.endEditing();//end current typing step if any
if(e.keyCode == 88){ if(e.keyCode == 88){
this.beginEditing("cut"); this.beginEditing('cut');
//use timeout to trigger after the cut is complete
setTimeout(dojo.hitch(this, this.endEditing), 1); setTimeout(dojo.hitch(this, this.endEditing), 1);
}else{ }else{
this.beginEditing("paste"); this.beginEditing('paste');
//use timeout to trigger after the paste is complete
setTimeout(dojo.hitch(this, this.endEditing), 1); setTimeout(dojo.hitch(this, this.endEditing), 1);
} }
break; break;
} }
//pass through
default: default:
if(!e.ctrlKey && !e.altKey && !e.metaKey && (e.keyCode<dojo.keys.F1 || e.keyCode>dojo.keys.F15)){ if(!e.ctrlKey && !e.altKey && !e.metaKey && (e.keyCode<dojo.keys.F1 || e.keyCode>dojo.keys.F15)){
this.beginEditing(); this.beginEditing();
break; break;
} }
//pass through
case ks.ALT: case ks.ALT:
this.endEditing(); this.endEditing();
break; break;
@@ -382,92 +657,138 @@ case ks.PAGE_UP:
case ks.PAGE_DOWN: case ks.PAGE_DOWN:
this.endEditing(true); this.endEditing(true);
break; break;
//maybe ctrl+backspace/delete, so don't endEditing when ctrl is pressed
case ks.CTRL: case ks.CTRL:
case ks.SHIFT: case ks.SHIFT:
case ks.TAB: case ks.TAB:
break; break;
} }
},_onBlur:function(){ },
this.inherited("_onBlur",arguments); _onBlur: function(){
// summary:
// Called from focus manager when focus has moved away from this editor
// tags:
// protected
//this._saveSelection();
this.inherited(arguments);
this.endEditing(true); this.endEditing(true);
},_saveSelection:function(){ },
_saveSelection: function(){
// summary:
// Save the currently selected text in _savedSelection attribute
// tags:
// private
try{
this._savedSelection=this._getBookmark(); this._savedSelection=this._getBookmark();
},_restoreSelection:function(){ }catch(e){ /* Squelch any errors that occur if selection save occurs due to being hidden simultaniously. */}
},
_restoreSelection: function(){
// summary:
// Re-select the text specified in _savedSelection attribute;
// see _saveSelection().
// tags:
// private
if(this._savedSelection){ if(this._savedSelection){
// Clear off cursor to start, we're deliberately going to a selection.
delete this._cursorToStart; delete this._cursorToStart;
if(dojo.withGlobal(this.window,"isCollapsed",dijit)){ // only restore the selection if the current range is collapsed
// if not collapsed, then it means the editor does not lose
// selection and there is no need to restore it
if(dojo.withGlobal(this.window,'isCollapsed',dijit)){
this._moveToBookmark(this._savedSelection); this._moveToBookmark(this._savedSelection);
} }
delete this._savedSelection; delete this._savedSelection;
} }
},onClick:function(){ },
onClick: function(){
// summary:
// Handler for when editor is clicked
// tags:
// protected
this.endEditing(true); this.endEditing(true);
this.inherited(arguments); this.inherited(arguments);
},_setDisabledAttr:function(_1a){ },
if(!this.disabled&&_1a){
this._buttonEnabledPlugins=dojo.filter(this._plugins,function(p){ replaceValue: function(/*String*/ html){
if(p&&p.button&&!p.button.get("disabled")){ // summary:
p.button.set("disabled",true); // over-ride of replaceValue to support custom undo and stack maintainence.
return true; // tags:
} // protected
return false; if(!this.customUndo){
}); this.inherited(arguments);
}else{ }else{
if(this.disabled&&!_1a){ if(this.isClosed){
dojo.forEach(this._buttonEnabledPlugins,function(p){ this.setValue(html);
p.button.attr("disabled",false); }else{
p.updateState&&p.updateState(); this.beginEditing();
if(!html){
html = "&nbsp;"
}
this.setValue(html);
this.endEditing();
}
}
},
_setDisabledAttr: function(/*Boolean*/ value){
var disableFunc = dojo.hitch(this, function(){
if((!this.disabled && value) || (!this._buttonEnabledPlugins && value)){
// Disable editor: disable all enabled buttons and remember that list
dojo.forEach(this._plugins, function(p){
p.set("disabled", true);
});
}else if(this.disabled && !value){
// Restore plugins to being active.
dojo.forEach(this._plugins, function(p){
p.set("disabled", false);
}); });
} }
} });
this.setValueDeferred.addCallback(disableFunc);
this.inherited(arguments); this.inherited(arguments);
},_setStateClass:function(){ },
_setStateClass: function(){
try{
this.inherited(arguments); this.inherited(arguments);
// Let theme set the editor's text color based on editor enabled/disabled state.
// We need to jump through hoops because the main document (where the theme CSS is)
// is separate from the iframe's document.
if(this.document && this.document.body){ if(this.document && this.document.body){
dojo.style(this.document.body, "color", dojo.style(this.iframe, "color")); dojo.style(this.document.body, "color", dojo.style(this.iframe, "color"));
} }
}}); }catch(e){ /* Squelch any errors caused by focus change if hidden during a state change */}
dojo.subscribe(dijit._scopeName+".Editor.getPlugin",null,function(o){
if(o.plugin){
return;
} }
var _1b=o.args,p; }
var _1c=dijit._editor._Plugin; );
var _1d=_1b.name;
switch(_1d){ // Register the "default plugins", ie, the built-in editor commands
case "undo": dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
case "redo": if(o.plugin){ return; }
case "cut": var args = o.args, p;
case "copy": var _p = dijit._editor._Plugin;
case "paste": var name = args.name;
case "insertOrderedList": switch(name){
case "insertUnorderedList": case "undo": case "redo": case "cut": case "copy": case "paste": case "insertOrderedList":
case "indent": case "insertUnorderedList": case "indent": case "outdent": case "justifyCenter":
case "outdent": case "justifyFull": case "justifyLeft": case "justifyRight": case "delete":
case "justifyCenter": case "selectAll": case "removeFormat": case "unlink":
case "justifyFull":
case "justifyLeft":
case "justifyRight":
case "delete":
case "selectAll":
case "removeFormat":
case "unlink":
case "insertHorizontalRule": case "insertHorizontalRule":
p=new _1c({command:_1d}); p = new _p({ command: name });
break; break;
case "bold":
case "italic": case "bold": case "italic": case "underline": case "strikethrough":
case "underline": case "subscript": case "superscript":
case "strikethrough": p = new _p({ buttonClass: dijit.form.ToggleButton, command: name });
case "subscript":
case "superscript":
p=new _1c({buttonClass:dijit.form.ToggleButton,command:_1d});
break; break;
case "|": case "|":
p=new _1c({button:new dijit.ToolbarSeparator(),setEditor:function(_1e){ p = new _p({ button: new dijit.ToolbarSeparator(), setEditor: function(editor) {this.editor = editor;} });
this.editor=_1e;
}});
} }
// console.log('name',name,p);
o.plugin=p; o.plugin=p;
}); });
} }

View File

@@ -1,11 +1,11 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.InlineEditBox"]){ if(!dojo._hasResource["dijit.InlineEditBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.InlineEditBox"] = true; dojo._hasResource["dijit.InlineEditBox"] = true;
dojo.provide("dijit.InlineEditBox"); dojo.provide("dijit.InlineEditBox");
dojo.require("dojo.i18n"); dojo.require("dojo.i18n");
@@ -13,219 +13,577 @@ dojo.require("dijit._Widget");
dojo.require("dijit._Container"); dojo.require("dijit._Container");
dojo.require("dijit.form.Button"); dojo.require("dijit.form.Button");
dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.TextBox");
dojo.requireLocalization("dijit","common",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); dojo.requireLocalization("dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.declare("dijit.InlineEditBox",dijit._Widget,{editing:false,autoSave:true,buttonSave:"",buttonCancel:"",renderAsHtml:false,editor:"dijit.form.TextBox",editorWrapper:"dijit._InlineEditor",editorParams:{},onChange:function(_1){
},onCancel:function(){
},width:"100%",value:"",noValueIndicator:dojo.isIE<=6?"<span style='font-family: wingdings; text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>":"<span style='text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>",constructor:function(){ dojo.declare("dijit.InlineEditBox",
dijit._Widget,
{
// summary:
// An element with in-line edit capabilites
//
// description:
// Behavior for an existing node (`<p>`, `<div>`, `<span>`, etc.) so that
// when you click it, an editor shows up in place of the original
// text. Optionally, Save and Cancel button are displayed below the edit widget.
// When Save is clicked, the text is pulled from the edit
// widget and redisplayed and the edit widget is again hidden.
// By default a plain Textarea widget is used as the editor (or for
// inline values a TextBox), but you can specify an editor such as
// dijit.Editor (for editing HTML) or a Slider (for adjusting a number).
// An edit widget must support the following API to be used:
// - displayedValue or value as initialization parameter,
// and available through set('displayedValue') / set('value')
// - void focus()
// - DOM-node focusNode = node containing editable text
// editing: [readonly] Boolean
// Is the node currently in edit mode?
editing: false,
// autoSave: Boolean
// Changing the value automatically saves it; don't have to push save button
// (and save button isn't even displayed)
autoSave: true,
// buttonSave: String
// Save button label
buttonSave: "",
// buttonCancel: String
// Cancel button label
buttonCancel: "",
// renderAsHtml: Boolean
// Set this to true if the specified Editor's value should be interpreted as HTML
// rather than plain text (ex: `dijit.Editor`)
renderAsHtml: false,
// editor: String|Function
// Class name (or reference to the Class) for Editor widget
editor: "dijit.form.TextBox",
// editorWrapper: String|Function
// Class name (or reference to the Class) for widget that wraps the editor widget, displaying save/cancel
// buttons.
editorWrapper: "dijit._InlineEditor",
// editorParams: Object
// Set of parameters for editor, like {required: true}
editorParams: {},
// disabled: Boolean
// If true, clicking the InlineEditBox to edit it will have no effect.
disabled: false,
onChange: function(value){
// summary:
// Set this handler to be notified of changes to value.
// tags:
// callback
},
onCancel: function(){
// summary:
// Set this handler to be notified when editing is cancelled.
// tags:
// callback
},
// width: String
// Width of editor. By default it's width=100% (ie, block mode).
width: "100%",
// value: String
// The display value of the widget in read-only mode
value: "",
// noValueIndicator: [const] String
// The text that gets displayed when there is no value (so that the user has a place to click to edit)
noValueIndicator: dojo.isIE <= 6 ? // font-family needed on IE6 but it messes up IE8
"<span style='font-family: wingdings; text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>" :
"<span style='text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>",
constructor: function(){
// summary:
// Sets up private arrays etc.
// tags:
// private
this.editorParams = {}; this.editorParams = {};
},postMixInProperties:function(){ },
postMixInProperties: function(){
this.inherited(arguments); this.inherited(arguments);
// save pointer to original source node, since Widget nulls-out srcNodeRef
this.displayNode = this.srcNodeRef; this.displayNode = this.srcNodeRef;
var _2={ondijitclick:"_onClick",onmouseover:"_onMouseOver",onmouseout:"_onMouseOut",onfocus:"_onMouseOver",onblur:"_onMouseOut"};
for(var _3 in _2){ // connect handlers to the display node
this.connect(this.displayNode,_3,_2[_3]); var events = {
ondijitclick: "_onClick",
onmouseover: "_onMouseOver",
onmouseout: "_onMouseOut",
onfocus: "_onMouseOver",
onblur: "_onMouseOut"
};
for(var name in events){
this.connect(this.displayNode, name, events[name]);
} }
dijit.setWaiRole(this.displayNode, "button"); dijit.setWaiRole(this.displayNode, "button");
if(!this.displayNode.getAttribute("tabIndex")){ if(!this.displayNode.getAttribute("tabIndex")){
this.displayNode.setAttribute("tabIndex", 0); this.displayNode.setAttribute("tabIndex", 0);
} }
if(!this.value&&!("value" in this.params)){
this.value=dojo.trim(this.renderAsHtml?this.displayNode.innerHTML:(this.displayNode.innerText||this.displayNode.textContent||"")); if(!this.value && !("value" in this.params)){ // "" is a good value if specified directly so check params){
this.value = dojo.trim(this.renderAsHtml ? this.displayNode.innerHTML :
(this.displayNode.innerText||this.displayNode.textContent||""));
} }
if(!this.value){ if(!this.value){
this.displayNode.innerHTML = this.noValueIndicator; this.displayNode.innerHTML = this.noValueIndicator;
} }
dojo.addClass(this.displayNode,"dijitInlineEditBoxDisplayMode");
},setDisabled:function(_4){ dojo.addClass(this.displayNode, 'dijitInlineEditBoxDisplayMode');
},
setDisabled: function(/*Boolean*/ disabled){
// summary:
// Deprecated. Use set('disabled', ...) instead.
// tags:
// deprecated
dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0"); dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
this.set("disabled",_4); this.set('disabled', disabled);
},_setDisabledAttr:function(_5){ },
this.disabled=_5;
dijit.setWaiState(this.domNode,"disabled",_5); _setDisabledAttr: function(/*Boolean*/ disabled){
if(_5){ // summary:
// Hook to make set("disabled", ...) work.
// Set disabled state of widget.
dijit.setWaiState(this.domNode, "disabled", disabled);
if(disabled){
this.displayNode.removeAttribute("tabIndex"); this.displayNode.removeAttribute("tabIndex");
}else{ }else{
this.displayNode.setAttribute("tabIndex", 0); this.displayNode.setAttribute("tabIndex", 0);
} }
dojo.toggleClass(this.displayNode,"dijitInlineEditBoxDisplayModeDisabled",_5); dojo.toggleClass(this.displayNode, "dijitInlineEditBoxDisplayModeDisabled", disabled);
},_onMouseOver:function(){ this._set("disabled", disabled);
},
_onMouseOver: function(){
// summary:
// Handler for onmouseover and onfocus event.
// tags:
// private
if(!this.disabled){ if(!this.disabled){
dojo.addClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover"); dojo.addClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
} }
},_onMouseOut:function(){ },
_onMouseOut: function(){
// summary:
// Handler for onmouseout and onblur event.
// tags:
// private
dojo.removeClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover"); dojo.removeClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
},_onClick:function(e){ },
if(this.disabled){
return; _onClick: function(/*Event*/ e){
} // summary:
if(e){ // Handler for onclick event.
dojo.stopEvent(e); // tags:
} // private
if(this.disabled){ return; }
if(e){ dojo.stopEvent(e); }
this._onMouseOut(); this._onMouseOut();
// Since FF gets upset if you move a node while in an event handler for that node...
setTimeout(dojo.hitch(this, "edit"), 0); setTimeout(dojo.hitch(this, "edit"), 0);
},edit:function(){ },
if(this.disabled||this.editing){
return; edit: function(){
} // summary:
// Display the editor widget in place of the original (read only) markup.
// tags:
// private
if(this.disabled || this.editing){ return; }
this.editing = true; this.editing = true;
// save some display node values that can be restored later
this._savedPosition = dojo.style(this.displayNode, "position") || "static"; this._savedPosition = dojo.style(this.displayNode, "position") || "static";
this._savedOpacity = dojo.style(this.displayNode, "opacity") || "1"; this._savedOpacity = dojo.style(this.displayNode, "opacity") || "1";
this._savedTabIndex = dojo.attr(this.displayNode, "tabIndex") || "0"; this._savedTabIndex = dojo.attr(this.displayNode, "tabIndex") || "0";
if(this.wrapperWidget){ if(this.wrapperWidget){
var ew = this.wrapperWidget.editWidget; var ew = this.wrapperWidget.editWidget;
ew.set("displayedValue" in ew ? "displayedValue" : "value", this.value); ew.set("displayedValue" in ew ? "displayedValue" : "value", this.value);
}else{ }else{
var _6=dojo.create("span",null,this.domNode,"before"); // Placeholder for edit widget
var _7=dojo.getObject(this.editorWrapper); // Put place holder (and eventually editWidget) before the display node so that it's positioned correctly
this.wrapperWidget=new _7({value:this.value,buttonSave:this.buttonSave,buttonCancel:this.buttonCancel,dir:this.dir,lang:this.lang,tabIndex:this._savedTabIndex,editor:this.editor,inlineEditBox:this,sourceStyle:dojo.getComputedStyle(this.displayNode),save:dojo.hitch(this,"save"),cancel:dojo.hitch(this,"cancel")},_6); // when Calendar dropdown appears, which happens automatically on focus.
var placeholder = dojo.create("span", null, this.domNode, "before");
// Create the editor wrapper (the thing that holds the editor widget and the save/cancel buttons)
var ewc = typeof this.editorWrapper == "string" ? dojo.getObject(this.editorWrapper) : this.editorWrapper;
this.wrapperWidget = new ewc({
value: this.value,
buttonSave: this.buttonSave,
buttonCancel: this.buttonCancel,
dir: this.dir,
lang: this.lang,
tabIndex: this._savedTabIndex,
editor: this.editor,
inlineEditBox: this,
sourceStyle: dojo.getComputedStyle(this.displayNode),
save: dojo.hitch(this, "save"),
cancel: dojo.hitch(this, "cancel")
}, placeholder);
if(!this._started){
this.startup();
}
} }
var ww = this.wrapperWidget; var ww = this.wrapperWidget;
if(dojo.isIE){ if(dojo.isIE){
dijit.focus(dijit.getFocus()); dijit.focus(dijit.getFocus()); // IE (at least 8) needs help with tab order changes
} }
dojo.style(this.displayNode,{position:"absolute",opacity:"0",display:"none"}); // to avoid screen jitter, we first create the editor with position:absolute, visibility:hidden,
// and then when it's finished rendering, we switch from display mode to editor
// position:absolute releases screen space allocated to the display node
// opacity:0 is the same as visibility:hidden but is still focusable
// visiblity:hidden removes focus outline
dojo.style(this.displayNode, { position: "absolute", opacity: "0", display: "none" }); // makes display node invisible, display style used for focus-ability
dojo.style(ww.domNode, { position: this._savedPosition, visibility: "visible", opacity: "1" }); dojo.style(ww.domNode, { position: this._savedPosition, visibility: "visible", opacity: "1" });
dojo.attr(this.displayNode,"tabIndex","-1"); dojo.attr(this.displayNode, "tabIndex", "-1"); // needed by WebKit for TAB from editor to skip displayNode
// Replace the display widget with edit widget, leaving them both displayed for a brief time so that
// focus can be shifted without incident. (browser may needs some time to render the editor.)
setTimeout(dojo.hitch(this, function(){ setTimeout(dojo.hitch(this, function(){
ww.focus(); ww.focus(); // both nodes are showing, so we can switch focus safely
ww._resetValue = ww.getValue(); ww._resetValue = ww.getValue();
}), 0); }), 0);
},_onBlur:function(){ },
_onBlur: function(){
// summary:
// Called when focus moves outside the InlineEditBox.
// Performs garbage collection.
// tags:
// private
this.inherited(arguments); this.inherited(arguments);
if(!this.editing){ if(!this.editing){
} /* causes IE focus problems, see TooltipDialog_a11y.html...
},destroy:function(){ setTimeout(dojo.hitch(this, function(){
if(this.wrapperWidget){ if(this.wrapperWidget){
this.wrapperWidget.destroy(); this.wrapperWidget.destroy();
delete this.wrapperWidget; delete this.wrapperWidget;
} }
}), 0);
*/
}
},
destroy: function(){
if(this.wrapperWidget && !this.wrapperWidget._destroyed){
this.wrapperWidget.destroy();
delete this.wrapperWidget;
}
this.inherited(arguments); this.inherited(arguments);
},_showText:function(_8){ },
_showText: function(/*Boolean*/ focus){
// summary:
// Revert to display mode, and optionally focus on display node
// tags:
// private
var ww = this.wrapperWidget; var ww = this.wrapperWidget;
dojo.style(ww.domNode,{position:"absolute",visibility:"hidden",opacity:"0"}); dojo.style(ww.domNode, { position: "absolute", visibility: "hidden", opacity: "0" }); // hide the editor from mouse/keyboard events
dojo.style(this.displayNode,{position:this._savedPosition,opacity:this._savedOpacity,display:""}); dojo.style(this.displayNode, { position: this._savedPosition, opacity: this._savedOpacity, display: "" }); // make the original text visible
dojo.attr(this.displayNode, "tabIndex", this._savedTabIndex); dojo.attr(this.displayNode, "tabIndex", this._savedTabIndex);
if(_8){ if(focus){
dijit.focus(this.displayNode); dijit.focus(this.displayNode);
} }
},save:function(_9){ },
if(this.disabled||!this.editing){
return; save: function(/*Boolean*/ focus){
} // summary:
// Save the contents of the editor and revert to display mode.
// focus: Boolean
// Focus on the display mode text
// tags:
// private
if(this.disabled || !this.editing){ return; }
this.editing = false; this.editing = false;
var ww = this.wrapperWidget; var ww = this.wrapperWidget;
var _a=ww.getValue(); var value = ww.getValue();
this.set("value",_a); this.set('value', value); // display changed, formatted value
setTimeout(dojo.hitch(this,"onChange",_a),0);
this._showText(_9); this._showText(focus); // set focus as needed
},setValue:function(_b){ },
setValue: function(/*String*/ val){
// summary:
// Deprecated. Use set('value', ...) instead.
// tags:
// deprecated
dojo.deprecated("dijit.InlineEditBox.setValue() is deprecated. Use set('value', ...) instead.", "", "2.0"); dojo.deprecated("dijit.InlineEditBox.setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
return this.set("value",_b); return this.set("value", val);
},_setValueAttr:function(_c){ },
this.value=_c=dojo.trim(_c);
if(!this.renderAsHtml){ _setValueAttr: function(/*String*/ val){
_c=_c.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;").replace(/\n/g,"<br>"); // summary:
// Hook to make set("value", ...) work.
// Inserts specified HTML value into this node, or an "input needed" character if node is blank.
val = dojo.trim(val);
var renderVal = this.renderAsHtml ? val : val.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;").replace(/"/gm, "&quot;").replace(/\n/g, "<br>");
this.displayNode.innerHTML = renderVal || this.noValueIndicator;
this._set("value", val);
if(this._started){
// tell the world that we have changed
setTimeout(dojo.hitch(this, "onChange", val), 0); // setTimeout prevents browser freeze for long-running event handlers
} }
this.displayNode.innerHTML=_c||this.noValueIndicator; },
},getValue:function(){
getValue: function(){
// summary:
// Deprecated. Use get('value') instead.
// tags:
// deprecated
dojo.deprecated("dijit.InlineEditBox.getValue() is deprecated. Use get('value') instead.", "", "2.0"); dojo.deprecated("dijit.InlineEditBox.getValue() is deprecated. Use get('value') instead.", "", "2.0");
return this.get("value"); return this.get("value");
},cancel:function(_d){ },
if(this.disabled||!this.editing){
return; cancel: function(/*Boolean*/ focus){
} // summary:
// Revert to display mode, discarding any changes made in the editor
// tags:
// private
if(this.disabled || !this.editing){ return; }
this.editing = false; this.editing = false;
setTimeout(dojo.hitch(this,"onCancel"),0);
this._showText(_d); // tell the world that we have no changes
}}); setTimeout(dojo.hitch(this, "onCancel"), 0); // setTimeout prevents browser freeze for long-running event handlers
dojo.declare("dijit._InlineEditor",[dijit._Widget,dijit._Templated],{templateString:dojo.cache("dijit","templates/InlineEditBox.html","<span dojoAttachPoint=\"editNode\" waiRole=\"presentation\" style=\"position: absolute; visibility:hidden\" class=\"dijitReset dijitInline\"\n\tdojoAttachEvent=\"onkeypress: _onKeyPress\"\n\t><span dojoAttachPoint=\"editorPlaceholder\"></span\n\t><span dojoAttachPoint=\"buttonContainer\"\n\t\t><button class='saveButton' dojoAttachPoint=\"saveButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:save\" label=\"${buttonSave}\"></button\n\t\t><button class='cancelButton' dojoAttachPoint=\"cancelButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:cancel\" label=\"${buttonCancel}\"></button\n\t></span\n></span>\n"),widgetsInTemplate:true,postMixInProperties:function(){
this._showText(focus);
}
});
dojo.declare(
"dijit._InlineEditor",
[dijit._Widget, dijit._Templated],
{
// summary:
// Internal widget used by InlineEditBox, displayed when in editing mode
// to display the editor and maybe save/cancel buttons. Calling code should
// connect to save/cancel methods to detect when editing is finished
//
// Has mainly the same parameters as InlineEditBox, plus these values:
//
// style: Object
// Set of CSS attributes of display node, to replicate in editor
//
// value: String
// Value as an HTML string or plain text string, depending on renderAsHTML flag
templateString: dojo.cache("dijit", "templates/InlineEditBox.html", "<span data-dojo-attach-point=\"editNode\" role=\"presentation\" style=\"position: absolute; visibility:hidden\" class=\"dijitReset dijitInline\"\n\tdata-dojo-attach-event=\"onkeypress: _onKeyPress\"\n\t><span data-dojo-attach-point=\"editorPlaceholder\"></span\n\t><span data-dojo-attach-point=\"buttonContainer\"\n\t\t><button data-dojo-type=\"dijit.form.Button\" data-dojo-props=\"label: '${buttonSave}', 'class': 'saveButton'\"\n\t\t\tdata-dojo-attach-point=\"saveButton\" data-dojo-attach-event=\"onClick:save\"></button\n\t\t><button data-dojo-type=\"dijit.form.Button\" data-dojo-props=\"label: '${buttonCancel}', 'class': 'cancelButton'\"\n\t\t\tdata-dojo-attach-point=\"cancelButton\" data-dojo-attach-event=\"onClick:cancel\"></button\n\t></span\n></span>\n"),
widgetsInTemplate: true,
postMixInProperties: function(){
this.inherited(arguments); this.inherited(arguments);
this.messages = dojo.i18n.getLocalization("dijit", "common", this.lang); this.messages = dojo.i18n.getLocalization("dijit", "common", this.lang);
dojo.forEach(["buttonSave","buttonCancel"],function(_e){ dojo.forEach(["buttonSave", "buttonCancel"], function(prop){
if(!this[_e]){ if(!this[prop]){ this[prop] = this.messages[prop]; }
this[_e]=this.messages[_e]; }, this);
},
buildRendering: function(){
this.inherited(arguments);
// Create edit widget in place in the template
var cls = typeof this.editor == "string" ? dojo.getObject(this.editor) : this.editor;
// Copy the style from the source
// Don't copy ALL properties though, just the necessary/applicable ones.
// wrapperStyle/destStyle code is to workaround IE bug where getComputedStyle().fontSize
// is a relative value like 200%, rather than an absolute value like 24px, and
// the 200% can refer *either* to a setting on the node or it's ancestor (see #11175)
var srcStyle = this.sourceStyle,
editStyle = "line-height:" + srcStyle.lineHeight + ";",
destStyle = dojo.getComputedStyle(this.domNode);
dojo.forEach(["Weight","Family","Size","Style"], function(prop){
var textStyle = srcStyle["font"+prop],
wrapperStyle = destStyle["font"+prop];
if(wrapperStyle != textStyle){
editStyle += "font-"+prop+":"+srcStyle["font"+prop]+";";
} }
}, this); }, this);
},postCreate:function(){ dojo.forEach(["marginTop","marginBottom","marginLeft", "marginRight"], function(prop){
var _f=dojo.getObject(this.editor); this.domNode.style[prop] = srcStyle[prop];
var _10=this.sourceStyle,_11="line-height:"+_10.lineHeight+";",_12=dojo.getComputedStyle(this.domNode);
dojo.forEach(["Weight","Family","Size","Style"],function(_13){
var _14=_10["font"+_13],_15=_12["font"+_13];
if(_15!=_14){
_11+="font-"+_13+":"+_10["font"+_13]+";";
}
}, this); }, this);
dojo.forEach(["marginTop","marginBottom","marginLeft","marginRight"],function(_16){ var width = this.inlineEditBox.width;
this.domNode.style[_16]=_10[_16]; if(width == "100%"){
},this); // block mode
var _17=this.inlineEditBox.width; editStyle += "width:100%;";
if(_17=="100%"){
_11+="width:100%;";
this.domNode.style.display = "block"; this.domNode.style.display = "block";
}else{ }else{
_11+="width:"+(_17+(Number(_17)==_17?"px":""))+";"; // inline-block mode
editStyle += "width:" + (width + (Number(width) == width ? "px" : "")) + ";";
} }
var _18=dojo.delegate(this.inlineEditBox.editorParams,{style:_11,dir:this.dir,lang:this.lang}); var editorParams = dojo.delegate(this.inlineEditBox.editorParams, {
_18["displayedValue" in _f.prototype?"displayedValue":"value"]=this.value; style: editStyle,
var ew=(this.editWidget=new _f(_18,this.editorPlaceholder)); dir: this.dir,
lang: this.lang
});
editorParams[ "displayedValue" in cls.prototype ? "displayedValue" : "value"] = this.value;
this.editWidget = new cls(editorParams, this.editorPlaceholder);
if(this.inlineEditBox.autoSave){ if(this.inlineEditBox.autoSave){
// Remove the save/cancel buttons since saving is done by simply tabbing away or
// selecting a value from the drop down list
dojo.destroy(this.buttonContainer); dojo.destroy(this.buttonContainer);
}
},
postCreate: function(){
this.inherited(arguments);
var ew = this.editWidget;
if(this.inlineEditBox.autoSave){
// Selecting a value from a drop down list causes an onChange event and then we save
this.connect(ew, "onChange", "_onChange"); this.connect(ew, "onChange", "_onChange");
// ESC and TAB should cancel and save. Note that edit widgets do a stopEvent() on ESC key (to
// prevent Dialog from closing when the user just wants to revert the value in the edit widget),
// so this is the only way we can see the key press event.
this.connect(ew, "onKeyPress", "_onKeyPress"); this.connect(ew, "onKeyPress", "_onKeyPress");
}else{ }else{
if("intermediateChanges" in _f.prototype){ // If possible, enable/disable save button based on whether the user has changed the value
if("intermediateChanges" in ew){
ew.set("intermediateChanges", true); ew.set("intermediateChanges", true);
this.connect(ew, "onChange", "_onIntermediateChange"); this.connect(ew, "onChange", "_onIntermediateChange");
this.saveButton.set("disabled", true); this.saveButton.set("disabled", true);
} }
} }
},_onIntermediateChange:function(val){ },
_onIntermediateChange: function(val){
// summary:
// Called for editor widgets that support the intermediateChanges=true flag as a way
// to detect when to enable/disabled the save button
this.saveButton.set("disabled", (this.getValue() == this._resetValue) || !this.enableSave()); this.saveButton.set("disabled", (this.getValue() == this._resetValue) || !this.enableSave());
},destroy:function(){ },
this.editWidget.destroy(true);
destroy: function(){
this.editWidget.destroy(true); // let the parent wrapper widget clean up the DOM
this.inherited(arguments); this.inherited(arguments);
},getValue:function(){ },
getValue: function(){
// summary:
// Return the [display] value of the edit widget
var ew = this.editWidget; var ew = this.editWidget;
return String(ew.get("displayedValue" in ew ? "displayedValue" : "value")); return String(ew.get("displayedValue" in ew ? "displayedValue" : "value"));
},_onKeyPress:function(e){ },
_onKeyPress: function(e){
// summary:
// Handler for keypress in the edit box in autoSave mode.
// description:
// For autoSave widgets, if Esc/Enter, call cancel/save.
// tags:
// private
if(this.inlineEditBox.autoSave && this.inlineEditBox.editing){ if(this.inlineEditBox.autoSave && this.inlineEditBox.editing){
if(e.altKey||e.ctrlKey){ if(e.altKey || e.ctrlKey){ return; }
return; // If Enter/Esc pressed, treat as save/cancel.
}
if(e.charOrCode == dojo.keys.ESCAPE){ if(e.charOrCode == dojo.keys.ESCAPE){
dojo.stopEvent(e); dojo.stopEvent(e);
this.cancel(true); this.cancel(true); // sets editing=false which short-circuits _onBlur processing
}else{ }else if(e.charOrCode == dojo.keys.ENTER && e.target.tagName == "INPUT"){
if(e.charOrCode==dojo.keys.ENTER&&e.target.tagName=="INPUT"){
dojo.stopEvent(e); dojo.stopEvent(e);
this._onChange(); this._onChange(); // fire _onBlur and then save
} }
// _onBlur will handle TAB automatically by allowing
// the TAB to change focus before we mess with the DOM: #6227
// Expounding by request:
// The current focus is on the edit widget input field.
// save() will hide and destroy this widget.
// We want the focus to jump from the currently hidden
// displayNode, but since it's hidden, it's impossible to
// unhide it, focus it, and then have the browser focus
// away from it to the next focusable element since each
// of these events is asynchronous and the focus-to-next-element
// is already queued.
// So we allow the browser time to unqueue the move-focus event
// before we do all the hide/show stuff.
} }
} },
},_onBlur:function(){
_onBlur: function(){
// summary:
// Called when focus moves outside the editor
// tags:
// private
this.inherited(arguments); this.inherited(arguments);
if(this.inlineEditBox.autoSave && this.inlineEditBox.editing){ if(this.inlineEditBox.autoSave && this.inlineEditBox.editing){
if(this.getValue() == this._resetValue){ if(this.getValue() == this._resetValue){
this.cancel(false); this.cancel(false);
}else{ }else if(this.enableSave()){
if(this.enableSave()){
this.save(false); this.save(false);
} }
} }
} },
},_onChange:function(){
_onChange: function(){
// summary:
// Called when the underlying widget fires an onChange event,
// such as when the user selects a value from the drop down list of a ComboBox,
// which means that the user has finished entering the value and we should save.
// tags:
// private
if(this.inlineEditBox.autoSave && this.inlineEditBox.editing && this.enableSave()){ if(this.inlineEditBox.autoSave && this.inlineEditBox.editing && this.enableSave()){
dojo.style(this.inlineEditBox.displayNode, { display: "" }); dojo.style(this.inlineEditBox.displayNode, { display: "" });
dijit.focus(this.inlineEditBox.displayNode); dijit.focus(this.inlineEditBox.displayNode); // fires _onBlur which will save the formatted value
} }
},enableSave:function(){ },
return (this.editWidget.isValid?this.editWidget.isValid():true);
},focus:function(){ enableSave: function(){
// summary:
// User overridable function returning a Boolean to indicate
// if the Save button should be enabled or not - usually due to invalid conditions
// tags:
// extension
return (
this.editWidget.isValid
? this.editWidget.isValid()
: true
);
},
focus: function(){
// summary:
// Focus the edit widget.
// tags:
// protected
this.editWidget.focus(); this.editWidget.focus();
setTimeout(dojo.hitch(this, function(){ setTimeout(dojo.hitch(this, function(){
if(this.editWidget.focusNode && this.editWidget.focusNode.tagName == "INPUT"){ if(this.editWidget.focusNode && this.editWidget.focusNode.tagName == "INPUT"){
dijit.selectInputText(this.editWidget.focusNode); dijit.selectInputText(this.editWidget.focusNode);
} }
}), 0); }), 0);
}}); }
});
} }

View File

@@ -13,7 +13,7 @@ The text of the AFL and BSD licenses is reproduced below.
The "New" BSD License: The "New" BSD License:
********************** **********************
Copyright (c) 2005-2010, The Dojo Foundation Copyright (c) 2005-2011, The Dojo Foundation
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -1,199 +1,457 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Menu"]){ if(!dojo._hasResource["dijit.Menu"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Menu"] = true; dojo._hasResource["dijit.Menu"] = true;
dojo.provide("dijit.Menu"); dojo.provide("dijit.Menu");
dojo.require("dojo.window"); dojo.require("dojo.window");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._KeyNavContainer"); dojo.require("dijit._KeyNavContainer");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit._MenuBase",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){ dojo.require("dijit.MenuItem");
if(this._started){ dojo.require("dijit.PopupMenuItem");
return; dojo.require("dijit.CheckedMenuItem");
} dojo.require("dijit.MenuSeparator");
dojo.forEach(this.getChildren(),function(_1){
_1.startup();
}); // "dijit/MenuItem", "dijit/PopupMenuItem", "dijit/CheckedMenuItem", "dijit/MenuSeparator" for Back-compat (TODO: remove in 2.0)
dojo.declare("dijit._MenuBase",
[dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
{
// summary:
// Base class for Menu and MenuBar
// parentMenu: [readonly] Widget
// pointer to menu that displayed me
parentMenu: null,
// popupDelay: Integer
// number of milliseconds before hovering (without clicking) causes the popup to automatically open.
popupDelay: 500,
startup: function(){
if(this._started){ return; }
dojo.forEach(this.getChildren(), function(child){ child.startup(); });
this.startupKeyNavChildren(); this.startupKeyNavChildren();
this.inherited(arguments); this.inherited(arguments);
},onExecute:function(){ },
},onCancel:function(_2){
},_moveToPopup:function(_3){ onExecute: function(){
// summary:
// Attach point for notification about when a menu item has been executed.
// This is an internal mechanism used for Menus to signal to their parent to
// close them, because they are about to execute the onClick handler. In
// general developers should not attach to or override this method.
// tags:
// protected
},
onCancel: function(/*Boolean*/ closeAll){
// summary:
// Attach point for notification about when the user cancels the current menu
// This is an internal mechanism used for Menus to signal to their parent to
// close them. In general developers should not attach to or override this method.
// tags:
// protected
},
_moveToPopup: function(/*Event*/ evt){
// summary:
// This handles the right arrow key (left arrow key on RTL systems),
// which will either open a submenu, or move to the next item in the
// ancestor MenuBar
// tags:
// private
if(this.focusedChild && this.focusedChild.popup && !this.focusedChild.disabled){ if(this.focusedChild && this.focusedChild.popup && !this.focusedChild.disabled){
this.focusedChild._onClick(_3); this.focusedChild._onClick(evt);
}else{ }else{
var _4=this._getTopMenu(); var topMenu = this._getTopMenu();
if(_4&&_4._isMenuBar){ if(topMenu && topMenu._isMenuBar){
_4.focusNext(); topMenu.focusNext();
} }
} }
},_onPopupHover:function(_5){ },
_onPopupHover: function(/*Event*/ evt){
// summary:
// This handler is called when the mouse moves over the popup.
// tags:
// private
// if the mouse hovers over a menu popup that is in pending-close state,
// then stop the close operation.
// This can't be done in onItemHover since some popup targets don't have MenuItems (e.g. ColorPicker)
if(this.currentPopup && this.currentPopup._pendingClose_timer){ if(this.currentPopup && this.currentPopup._pendingClose_timer){
var _6=this.currentPopup.parentMenu; var parentMenu = this.currentPopup.parentMenu;
if(_6.focusedChild){ // highlight the parent menu item pointing to this popup
_6.focusedChild._setSelected(false); if(parentMenu.focusedChild){
parentMenu.focusedChild._setSelected(false);
} }
_6.focusedChild=this.currentPopup.from_item; parentMenu.focusedChild = this.currentPopup.from_item;
_6.focusedChild._setSelected(true); parentMenu.focusedChild._setSelected(true);
// cancel the pending close
this._stopPendingCloseTimer(this.currentPopup); this._stopPendingCloseTimer(this.currentPopup);
} }
},onItemHover:function(_7){ },
onItemHover: function(/*MenuItem*/ item){
// summary:
// Called when cursor is over a MenuItem.
// tags:
// protected
// Don't do anything unless user has "activated" the menu by:
// 1) clicking it
// 2) opening it from a parent menu (which automatically focuses it)
if(this.isActive){ if(this.isActive){
this.focusChild(_7); this.focusChild(item);
if(this.focusedChild.popup && !this.focusedChild.disabled && !this.hover_timer){ if(this.focusedChild.popup && !this.focusedChild.disabled && !this.hover_timer){
this.hover_timer = setTimeout(dojo.hitch(this, "_openPopup"), this.popupDelay); this.hover_timer = setTimeout(dojo.hitch(this, "_openPopup"), this.popupDelay);
} }
} }
// if the user is mixing mouse and keyboard navigation,
// then the menu may not be active but a menu item has focus,
// but it's not the item that the mouse just hovered over.
// To avoid both keyboard and mouse selections, use the latest.
if(this.focusedChild){ if(this.focusedChild){
this.focusChild(_7); this.focusChild(item);
} }
this._hoveredChild=_7; this._hoveredChild = item;
},_onChildBlur:function(_8){ },
_onChildBlur: function(item){
// summary:
// Called when a child MenuItem becomes inactive because focus
// has been removed from the MenuItem *and* it's descendant menus.
// tags:
// private
this._stopPopupTimer(); this._stopPopupTimer();
_8._setSelected(false); item._setSelected(false);
var _9=_8.popup; // Close all popups that are open and descendants of this menu
if(_9){ var itemPopup = item.popup;
this._stopPendingCloseTimer(_9); if(itemPopup){
_9._pendingClose_timer=setTimeout(function(){ this._stopPendingCloseTimer(itemPopup);
_9._pendingClose_timer=null; itemPopup._pendingClose_timer = setTimeout(function(){
if(_9.parentMenu){ itemPopup._pendingClose_timer = null;
_9.parentMenu.currentPopup=null; if(itemPopup.parentMenu){
itemPopup.parentMenu.currentPopup = null;
} }
dijit.popup.close(_9); dijit.popup.close(itemPopup); // this calls onClose
}, this.popupDelay); }, this.popupDelay);
} }
},onItemUnhover:function(_a){ },
onItemUnhover: function(/*MenuItem*/ item){
// summary:
// Callback fires when mouse exits a MenuItem
// tags:
// protected
if(this.isActive){ if(this.isActive){
this._stopPopupTimer(); this._stopPopupTimer();
} }
if(this._hoveredChild==_a){ if(this._hoveredChild == item){ this._hoveredChild = null; }
this._hoveredChild=null; },
}
},_stopPopupTimer:function(){ _stopPopupTimer: function(){
// summary:
// Cancels the popup timer because the user has stop hovering
// on the MenuItem, etc.
// tags:
// private
if(this.hover_timer){ if(this.hover_timer){
clearTimeout(this.hover_timer); clearTimeout(this.hover_timer);
this.hover_timer = null; this.hover_timer = null;
} }
},_stopPendingCloseTimer:function(_b){ },
if(_b._pendingClose_timer){
clearTimeout(_b._pendingClose_timer); _stopPendingCloseTimer: function(/*dijit._Widget*/ popup){
_b._pendingClose_timer=null; // summary:
// Cancels the pending-close timer because the close has been preempted
// tags:
// private
if(popup._pendingClose_timer){
clearTimeout(popup._pendingClose_timer);
popup._pendingClose_timer = null;
} }
},_stopFocusTimer:function(){ },
_stopFocusTimer: function(){
// summary:
// Cancels the pending-focus timer because the menu was closed before focus occured
// tags:
// private
if(this._focus_timer){ if(this._focus_timer){
clearTimeout(this._focus_timer); clearTimeout(this._focus_timer);
this._focus_timer = null; this._focus_timer = null;
} }
},_getTopMenu:function(){ },
for(var _c=this;_c.parentMenu;_c=_c.parentMenu){
} _getTopMenu: function(){
return _c; // summary:
},onItemClick:function(_d,_e){ // Returns the top menu in this chain of Menus
if(typeof this.isShowingNow=="undefined"){ // tags:
// private
for(var top=this; top.parentMenu; top=top.parentMenu);
return top;
},
onItemClick: function(/*dijit._Widget*/ item, /*Event*/ evt){
// summary:
// Handle clicks on an item.
// tags:
// private
// this can't be done in _onFocus since the _onFocus events occurs asynchronously
if(typeof this.isShowingNow == 'undefined'){ // non-popup menu
this._markActive(); this._markActive();
} }
this.focusChild(_d);
if(_d.disabled){ this.focusChild(item);
return false;
} if(item.disabled){ return false; }
if(_d.popup){
if(item.popup){
this._openPopup(); this._openPopup();
}else{ }else{
// before calling user defined handler, close hierarchy of menus
// and restore focus to place it was when menu was opened
this.onExecute(); this.onExecute();
_d.onClick(_e);
// user defined handler for click
item.onClick(evt);
} }
},_openPopup:function(){ },
_openPopup: function(){
// summary:
// Open the popup to the side of/underneath the current menu item
// tags:
// protected
this._stopPopupTimer(); this._stopPopupTimer();
var _f=this.focusedChild; var from_item = this.focusedChild;
if(!_f){ if(!from_item){ return; } // the focused child lost focus since the timer was started
return; var popup = from_item.popup;
} if(popup.isShowingNow){ return; }
var _10=_f.popup;
if(_10.isShowingNow){
return;
}
if(this.currentPopup){ if(this.currentPopup){
this._stopPendingCloseTimer(this.currentPopup); this._stopPendingCloseTimer(this.currentPopup);
dijit.popup.close(this.currentPopup); dijit.popup.close(this.currentPopup);
} }
_10.parentMenu=this; popup.parentMenu = this;
_10.from_item=_f; popup.from_item = from_item; // helps finding the parent item that should be focused for this popup
var _11=this; var self = this;
dijit.popup.open({parent:this,popup:_10,around:_f.domNode,orient:this._orient||(this.isLeftToRight()?{"TR":"TL","TL":"TR","BR":"BL","BL":"BR"}:{"TL":"TR","TR":"TL","BL":"BR","BR":"BL"}),onCancel:function(){ dijit.popup.open({
_11.focusChild(_f); parent: this,
_11._cleanUp(); popup: popup,
_f._setSelected(true); around: from_item.domNode,
_11.focusedChild=_f; orient: this._orient || (this.isLeftToRight() ?
},onExecute:dojo.hitch(this,"_cleanUp")}); {'TR': 'TL', 'TL': 'TR', 'BR': 'BL', 'BL': 'BR'} :
this.currentPopup=_10; {'TL': 'TR', 'TR': 'TL', 'BL': 'BR', 'BR': 'BL'}),
_10.connect(_10.domNode,"onmouseenter",dojo.hitch(_11,"_onPopupHover")); onCancel: function(){ // called when the child menu is canceled
if(_10.focus){ // set isActive=false (_closeChild vs _cleanUp) so that subsequent hovering will NOT open child menus
_10._focus_timer=setTimeout(dojo.hitch(_10,function(){ // which seems aligned with the UX of most applications (e.g. notepad, wordpad, paint shop pro)
self.focusChild(from_item); // put focus back on my node
self._cleanUp(); // close the submenu (be sure this is done _after_ focus is moved)
from_item._setSelected(true); // oops, _cleanUp() deselected the item
self.focusedChild = from_item; // and unset focusedChild
},
onExecute: dojo.hitch(this, "_cleanUp")
});
this.currentPopup = popup;
// detect mouseovers to handle lazy mouse movements that temporarily focus other menu items
popup.connect(popup.domNode, "onmouseenter", dojo.hitch(self, "_onPopupHover")); // cleaned up when the popped-up widget is destroyed on close
if(popup.focus){
// If user is opening the popup via keyboard (right arrow, or down arrow for MenuBar),
// if the cursor happens to collide with the popup, it will generate an onmouseover event
// even though the mouse wasn't moved. Use a setTimeout() to call popup.focus so that
// our focus() call overrides the onmouseover event, rather than vice-versa. (#8742)
popup._focus_timer = setTimeout(dojo.hitch(popup, function(){
this._focus_timer = null; this._focus_timer = null;
this.focus(); this.focus();
}), 0); }), 0);
} }
},_markActive:function(){ },
_markActive: function(){
// summary:
// Mark this menu's state as active.
// Called when this Menu gets focus from:
// 1) clicking it (mouse or via space/arrow key)
// 2) being opened by a parent menu.
// This is not called just from mouse hover.
// Focusing a menu via TAB does NOT automatically set isActive
// since TAB is a navigation operation and not a selection one.
// For Windows apps, pressing the ALT key focuses the menubar
// menus (similar to TAB navigation) but the menu is not active
// (ie no dropdown) until an item is clicked.
this.isActive = true; this.isActive = true;
dojo.addClass(this.domNode,"dijitMenuActive"); dojo.replaceClass(this.domNode, "dijitMenuActive", "dijitMenuPassive");
dojo.removeClass(this.domNode,"dijitMenuPassive"); },
},onOpen:function(e){
onOpen: function(/*Event*/ e){
// summary:
// Callback when this menu is opened.
// This is called by the popup manager as notification that the menu
// was opened.
// tags:
// private
this.isShowingNow = true; this.isShowingNow = true;
this._markActive(); this._markActive();
},_markInactive:function(){ },
this.isActive=false;
dojo.removeClass(this.domNode,"dijitMenuActive"); _markInactive: function(){
dojo.addClass(this.domNode,"dijitMenuPassive"); // summary:
},onClose:function(){ // Mark this menu's state as inactive.
this.isActive = false; // don't do this in _onBlur since the state is pending-close until we get here
dojo.replaceClass(this.domNode, "dijitMenuPassive", "dijitMenuActive");
},
onClose: function(){
// summary:
// Callback when this menu is closed.
// This is called by the popup manager as notification that the menu
// was closed.
// tags:
// private
this._stopFocusTimer(); this._stopFocusTimer();
this._markInactive(); this._markInactive();
this.isShowingNow = false; this.isShowingNow = false;
this.parentMenu = null; this.parentMenu = null;
},_closeChild:function(){ },
_closeChild: function(){
// summary:
// Called when submenu is clicked or focus is lost. Close hierarchy of menus.
// tags:
// private
this._stopPopupTimer(); this._stopPopupTimer();
if(this.focusedChild){
var fromItem = this.focusedChild && this.focusedChild.from_item;
if(this.currentPopup){
// If focus is on my child menu then move focus to me,
// because IE doesn't like it when you display:none a node with focus
if(dijit._curFocus && dojo.isDescendant(dijit._curFocus, this.currentPopup.domNode)){
this.focusedChild.focusNode.focus();
}
// Close all popups that are open and descendants of this menu
dijit.popup.close(this.currentPopup);
this.currentPopup = null;
}
if(this.focusedChild){ // unhighlight the focused item
this.focusedChild._setSelected(false); this.focusedChild._setSelected(false);
this.focusedChild._onUnhover(); this.focusedChild._onUnhover();
this.focusedChild = null; this.focusedChild = null;
} }
if(this.currentPopup){ },
dijit.popup.close(this.currentPopup);
this.currentPopup=null; _onItemFocus: function(/*MenuItem*/ item){
// summary:
// Called when child of this Menu gets focus from:
// 1) clicking it
// 2) tabbing into it
// 3) being opened by a parent menu.
// This is not called just from mouse hover.
if(this._hoveredChild && this._hoveredChild != item){
this._hoveredChild._onUnhover(); // any previous mouse movement is trumped by focus selection
} }
},_onItemFocus:function(_12){ },
if(this._hoveredChild&&this._hoveredChild!=_12){
this._hoveredChild._onUnhover(); _onBlur: function(){
} // summary:
},_onBlur:function(){ // Called when focus is moved away from this Menu and it's submenus.
// tags:
// protected
this._cleanUp(); this._cleanUp();
this.inherited(arguments); this.inherited(arguments);
},_cleanUp:function(){ },
this._closeChild();
if(typeof this.isShowingNow=="undefined"){ _cleanUp: function(){
// summary:
// Called when the user is done with this menu. Closes hierarchy of menus.
// tags:
// private
this._closeChild(); // don't call this.onClose since that's incorrect for MenuBar's that never close
if(typeof this.isShowingNow == 'undefined'){ // non-popup menu doesn't call onClose
this._markInactive(); this._markInactive();
} }
}}); }
dojo.declare("dijit.Menu",dijit._MenuBase,{constructor:function(){ });
dojo.declare("dijit.Menu",
dijit._MenuBase,
{
// summary
// A context menu you can assign to multiple elements
// TODO: most of the code in here is just for context menu (right-click menu)
// support. In retrospect that should have been a separate class (dijit.ContextMenu).
// Split them for 2.0
constructor: function(){
this._bindings = []; this._bindings = [];
},templateString:dojo.cache("dijit","templates/Menu.html","<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" waiRole=\"menu\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress:_onKeyPress\" cellspacing=0>\n\t<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>\n</table>\n"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){ },
templateString: dojo.cache("dijit", "templates/Menu.html", "<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" role=\"menu\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress:_onKeyPress\" cellspacing=\"0\">\n\t<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>\n</table>\n"),
baseClass: "dijitMenu",
// targetNodeIds: [const] String[]
// Array of dom node ids of nodes to attach to.
// Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
targetNodeIds: [],
// contextMenuForWindow: [const] Boolean
// If true, right clicking anywhere on the window will cause this context menu to open.
// If false, must specify targetNodeIds.
contextMenuForWindow: false,
// leftClickToOpen: [const] Boolean
// If true, menu will open on left click instead of right click, similiar to a file menu.
leftClickToOpen: false,
// refocus: Boolean
// When this menu closes, re-focus the element which had focus before it was opened.
refocus: true,
postCreate: function(){
if(this.contextMenuForWindow){ if(this.contextMenuForWindow){
this.bindDomNode(dojo.body()); this.bindDomNode(dojo.body());
}else{ }else{
// TODO: should have _setTargetNodeIds() method to handle initialization and a possible
// later set('targetNodeIds', ...) call. There's also a problem that targetNodeIds[]
// gets stale after calls to bindDomNode()/unBindDomNode() as it still is just the original list (see #9610)
dojo.forEach(this.targetNodeIds, this.bindDomNode, this); dojo.forEach(this.targetNodeIds, this.bindDomNode, this);
} }
var k = dojo.keys, l = this.isLeftToRight(); var k = dojo.keys, l = this.isLeftToRight();
this._openSubMenuKey = l ? k.RIGHT_ARROW : k.LEFT_ARROW; this._openSubMenuKey = l ? k.RIGHT_ARROW : k.LEFT_ARROW;
this._closeSubMenuKey = l ? k.LEFT_ARROW : k.RIGHT_ARROW; this._closeSubMenuKey = l ? k.LEFT_ARROW : k.RIGHT_ARROW;
this.connectKeyNavHandlers([k.UP_ARROW], [k.DOWN_ARROW]); this.connectKeyNavHandlers([k.UP_ARROW], [k.DOWN_ARROW]);
},_onKeyPress:function(evt){ },
if(evt.ctrlKey||evt.altKey){
return; _onKeyPress: function(/*Event*/ evt){
} // summary:
// Handle keyboard based menu navigation.
// tags:
// protected
if(evt.ctrlKey || evt.altKey){ return; }
switch(evt.charOrCode){ switch(evt.charOrCode){
case this._openSubMenuKey: case this._openSubMenuKey:
this._moveToPopup(evt); this._moveToPopup(evt);
@@ -211,115 +469,248 @@ dojo.stopEvent(evt);
} }
break; break;
} }
},_iframeContentWindow:function(_13){ },
var win=dojo.window.get(this._iframeContentDocument(_13))||this._iframeContentDocument(_13)["__parent__"]||(_13.name&&dojo.doc.frames[_13.name])||null;
return win; // thanks burstlib!
},_iframeContentDocument:function(_14){ _iframeContentWindow: function(/* HTMLIFrameElement */iframe_el){
var doc=_14.contentDocument||(_14.contentWindow&&_14.contentWindow.document)||(_14.name&&dojo.doc.frames[_14.name]&&dojo.doc.frames[_14.name].document)||null; // summary:
return doc; // Returns the window reference of the passed iframe
},bindDomNode:function(_15){ // tags:
_15=dojo.byId(_15); // private
var cn; var win = dojo.window.get(this._iframeContentDocument(iframe_el)) ||
if(_15.tagName.toLowerCase()=="iframe"){ // Moz. TODO: is this available when defaultView isn't?
var _16=_15,win=this._iframeContentWindow(_16); this._iframeContentDocument(iframe_el)['__parent__'] ||
(iframe_el.name && dojo.doc.frames[iframe_el.name]) || null;
return win; // Window
},
_iframeContentDocument: function(/* HTMLIFrameElement */iframe_el){
// summary:
// Returns a reference to the document object inside iframe_el
// tags:
// protected
var doc = iframe_el.contentDocument // W3
|| (iframe_el.contentWindow && iframe_el.contentWindow.document) // IE
|| (iframe_el.name && dojo.doc.frames[iframe_el.name] && dojo.doc.frames[iframe_el.name].document)
|| null;
return doc; // HTMLDocument
},
bindDomNode: function(/*String|DomNode*/ node){
// summary:
// Attach menu to given node
node = dojo.byId(node);
var cn; // Connect node
// Support context menus on iframes. Rather than binding to the iframe itself we need
// to bind to the <body> node inside the iframe.
if(node.tagName.toLowerCase() == "iframe"){
var iframe = node,
win = this._iframeContentWindow(iframe);
cn = dojo.withGlobal(win, dojo.body); cn = dojo.withGlobal(win, dojo.body);
}else{ }else{
cn=(_15==dojo.body()?dojo.doc.documentElement:_15);
// To capture these events at the top level, attach to <html>, not <body>.
// Otherwise right-click context menu just doesn't work.
cn = (node == dojo.body() ? dojo.doc.documentElement : node);
} }
var _17={node:_15,iframe:_16};
dojo.attr(_15,"_dijitMenu"+this.id,this._bindings.push(_17));
var _18=dojo.hitch(this,function(cn){ // "binding" is the object to track our connection to the node (ie, the parameter to bindDomNode())
return [dojo.connect(cn,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(evt){ var binding = {
node: node,
iframe: iframe
};
// Save info about binding in _bindings[], and make node itself record index(+1) into
// _bindings[] array. Prefix w/_dijitMenu to avoid setting an attribute that may
// start with a number, which fails on FF/safari.
dojo.attr(node, "_dijitMenu" + this.id, this._bindings.push(binding));
// Setup the connections to monitor click etc., unless we are connecting to an iframe which hasn't finished
// loading yet, in which case we need to wait for the onload event first, and then connect
// On linux Shift-F10 produces the oncontextmenu event, but on Windows it doesn't, so
// we need to monitor keyboard events in addition to the oncontextmenu event.
var doConnects = dojo.hitch(this, function(cn){
return [
// TODO: when leftClickToOpen is true then shouldn't space/enter key trigger the menu,
// rather than shift-F10?
dojo.connect(cn, this.leftClickToOpen ? "onclick" : "oncontextmenu", this, function(evt){
// Schedule context menu to be opened unless it's already been scheduled from onkeydown handler
dojo.stopEvent(evt); dojo.stopEvent(evt);
this._scheduleOpen(evt.target,_16,{x:evt.pageX,y:evt.pageY}); this._scheduleOpen(evt.target, iframe, {x: evt.pageX, y: evt.pageY});
}),dojo.connect(cn,"onkeydown",this,function(evt){ }),
dojo.connect(cn, "onkeydown", this, function(evt){
if(evt.shiftKey && evt.keyCode == dojo.keys.F10){ if(evt.shiftKey && evt.keyCode == dojo.keys.F10){
dojo.stopEvent(evt); dojo.stopEvent(evt);
this._scheduleOpen(evt.target,_16); this._scheduleOpen(evt.target, iframe); // no coords - open near target node
} }
})]; })
];
}); });
_17.connects=cn?_18(cn):[]; binding.connects = cn ? doConnects(cn) : [];
if(_16){
_17.onloadHandler=dojo.hitch(this,function(){ if(iframe){
var win=this._iframeContentWindow(_16); // Setup handler to [re]bind to the iframe when the contents are initially loaded,
// and every time the contents change.
// Need to do this b/c we are actually binding to the iframe's <body> node.
// Note: can't use dojo.connect(), see #9609.
binding.onloadHandler = dojo.hitch(this, function(){
// want to remove old connections, but IE throws exceptions when trying to
// access the <body> node because it's already gone, or at least in a state of limbo
var win = this._iframeContentWindow(iframe);
cn = dojo.withGlobal(win, dojo.body); cn = dojo.withGlobal(win, dojo.body);
_17.connects=_18(cn); binding.connects = doConnects(cn);
}); });
if(_16.addEventListener){ if(iframe.addEventListener){
_16.addEventListener("load",_17.onloadHandler,false); iframe.addEventListener("load", binding.onloadHandler, false);
}else{ }else{
_16.attachEvent("onload",_17.onloadHandler); iframe.attachEvent("onload", binding.onloadHandler);
} }
} }
},unBindDomNode:function(_19){ },
var _1a;
unBindDomNode: function(/*String|DomNode*/ nodeName){
// summary:
// Detach menu from given node
var node;
try{ try{
_1a=dojo.byId(_19); node = dojo.byId(nodeName);
} }catch(e){
catch(e){ // On IE the dojo.byId() call will get an exception if the attach point was
// the <body> node of an <iframe> that has since been reloaded (and thus the
// <body> node is in a limbo state of destruction.
return; return;
} }
var _1b="_dijitMenu"+this.id;
if(_1a&&dojo.hasAttr(_1a,_1b)){ // node["_dijitMenu" + this.id] contains index(+1) into my _bindings[] array
var bid=dojo.attr(_1a,_1b)-1,b=this._bindings[bid]; var attrName = "_dijitMenu" + this.id;
if(node && dojo.hasAttr(node, attrName)){
var bid = dojo.attr(node, attrName)-1, b = this._bindings[bid];
dojo.forEach(b.connects, dojo.disconnect); dojo.forEach(b.connects, dojo.disconnect);
var _1c=b.iframe;
if(_1c){ // Remove listener for iframe onload events
if(_1c.removeEventListener){ var iframe = b.iframe;
_1c.removeEventListener("load",b.onloadHandler,false); if(iframe){
if(iframe.removeEventListener){
iframe.removeEventListener("load", b.onloadHandler, false);
}else{ }else{
_1c.detachEvent("onload",b.onloadHandler); iframe.detachEvent("onload", b.onloadHandler);
} }
} }
dojo.removeAttr(_1a,_1b);
dojo.removeAttr(node, attrName);
delete this._bindings[bid]; delete this._bindings[bid];
} }
},_scheduleOpen:function(_1d,_1e,_1f){ },
_scheduleOpen: function(/*DomNode?*/ target, /*DomNode?*/ iframe, /*Object?*/ coords){
// summary:
// Set timer to display myself. Using a timer rather than displaying immediately solves
// two problems:
//
// 1. IE: without the delay, focus work in "open" causes the system
// context menu to appear in spite of stopEvent.
//
// 2. Avoid double-shows on linux, where shift-F10 generates an oncontextmenu event
// even after a dojo.stopEvent(e). (Shift-F10 on windows doesn't generate the
// oncontextmenu event.)
if(!this._openTimer){ if(!this._openTimer){
this._openTimer = setTimeout(dojo.hitch(this, function(){ this._openTimer = setTimeout(dojo.hitch(this, function(){
delete this._openTimer; delete this._openTimer;
this._openMyself({target:_1d,iframe:_1e,coords:_1f}); this._openMyself({
target: target,
iframe: iframe,
coords: coords
});
}), 1); }), 1);
} }
},_openMyself:function(_20){ },
var _21=_20.target,_22=_20.iframe,_23=_20.coords;
if(_23){ _openMyself: function(args){
if(_22){ // summary:
var od=_21.ownerDocument,ifc=dojo.position(_22,true),win=this._iframeContentWindow(_22),_24=dojo.withGlobal(win,"_docScroll",dojo); // Internal function for opening myself when the user does a right-click or something similar.
var cs=dojo.getComputedStyle(_22),tp=dojo._toPixelValue,_25=(dojo.isIE&&dojo.isQuirks?0:tp(_22,cs.paddingLeft))+(dojo.isIE&&dojo.isQuirks?tp(_22,cs.borderLeftWidth):0),top=(dojo.isIE&&dojo.isQuirks?0:tp(_22,cs.paddingTop))+(dojo.isIE&&dojo.isQuirks?tp(_22,cs.borderTopWidth):0); // args:
_23.x+=ifc.x+_25-_24.x; // This is an Object containing:
_23.y+=ifc.y+top-_24.y; // * target:
// The node that is being clicked
// * iframe:
// If an <iframe> is being clicked, iframe points to that iframe
// * coords:
// Put menu at specified x/y position in viewport, or if iframe is
// specified, then relative to iframe.
//
// _openMyself() formerly took the event object, and since various code references
// evt.target (after connecting to _openMyself()), using an Object for parameters
// (so that old code still works).
var target = args.target,
iframe = args.iframe,
coords = args.coords;
// Get coordinates to open menu, either at specified (mouse) position or (if triggered via keyboard)
// then near the node the menu is assigned to.
if(coords){
if(iframe){
// Specified coordinates are on <body> node of an <iframe>, convert to match main document
var od = target.ownerDocument,
ifc = dojo.position(iframe, true),
win = this._iframeContentWindow(iframe),
scroll = dojo.withGlobal(win, "_docScroll", dojo);
var cs = dojo.getComputedStyle(iframe),
tp = dojo._toPixelValue,
left = (dojo.isIE && dojo.isQuirks ? 0 : tp(iframe, cs.paddingLeft)) + (dojo.isIE && dojo.isQuirks ? tp(iframe, cs.borderLeftWidth) : 0),
top = (dojo.isIE && dojo.isQuirks ? 0 : tp(iframe, cs.paddingTop)) + (dojo.isIE && dojo.isQuirks ? tp(iframe, cs.borderTopWidth) : 0);
coords.x += ifc.x + left - scroll.x;
coords.y += ifc.y + top - scroll.y;
} }
}else{ }else{
_23=dojo.position(_21,true); coords = dojo.position(target, true);
_23.x+=10; coords.x += 10;
_23.y+=10; coords.y += 10;
} }
var _26=this;
var _27=dijit.getFocus(this); var self=this;
function _28(){ var savedFocus = dijit.getFocus(this);
if(_26.refocus){ function closeAndRestoreFocus(){
dijit.focus(_27); // user has clicked on a menu or popup
if(self.refocus){
dijit.focus(savedFocus);
} }
dijit.popup.close(_26); dijit.popup.close(self);
}; }
dijit.popup.open({popup:this,x:_23.x,y:_23.y,onExecute:_28,onCancel:_28,orient:this.isLeftToRight()?"L":"R"}); dijit.popup.open({
popup: this,
x: coords.x,
y: coords.y,
onExecute: closeAndRestoreFocus,
onCancel: closeAndRestoreFocus,
orient: this.isLeftToRight() ? 'L' : 'R'
});
this.focus(); this.focus();
this._onBlur = function(){ this._onBlur = function(){
this.inherited("_onBlur",arguments); this.inherited('_onBlur', arguments);
// Usually the parent closes the child widget but if this is a context
// menu then there is no parent
dijit.popup.close(this); dijit.popup.close(this);
// don't try to restore focus; user has clicked another part of the screen
// and set focus there
}; };
},uninitialize:function(){ },
dojo.forEach(this._bindings,function(b){
if(b){ uninitialize: function(){
this.unBindDomNode(b.node); dojo.forEach(this._bindings, function(b){ if(b){ this.unBindDomNode(b.node); } }, this);
}
},this);
this.inherited(arguments); this.inherited(arguments);
}}); }
dojo.require("dijit.MenuItem"); }
dojo.require("dijit.PopupMenuItem"); );
dojo.require("dijit.CheckedMenuItem");
dojo.require("dijit.MenuSeparator");
} }

View File

@@ -1,38 +1,77 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.MenuBar"]){ if(!dojo._hasResource["dijit.MenuBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.MenuBar"] = true; dojo._hasResource["dijit.MenuBar"] = true;
dojo.provide("dijit.MenuBar"); dojo.provide("dijit.MenuBar");
dojo.require("dijit.Menu"); dojo.require("dijit.Menu");
dojo.declare("dijit.MenuBar",dijit._MenuBase,{templateString:dojo.cache("dijit","templates/MenuBar.html","<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" waiRole=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),baseClass:"dijitMenuBar",_isMenuBar:true,postCreate:function(){
dojo.declare("dijit.MenuBar", dijit._MenuBase, {
// summary:
// A menu bar, listing menu choices horizontally, like the "File" menu in most desktop applications
templateString: dojo.cache("dijit", "templates/MenuBar.html", "<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" role=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),
baseClass: "dijitMenuBar",
// _isMenuBar: [protected] Boolean
// This is a MenuBar widget, not a (vertical) Menu widget.
_isMenuBar: true,
postCreate: function(){
var k = dojo.keys, l = this.isLeftToRight(); var k = dojo.keys, l = this.isLeftToRight();
this.connectKeyNavHandlers(l?[k.LEFT_ARROW]:[k.RIGHT_ARROW],l?[k.RIGHT_ARROW]:[k.LEFT_ARROW]); this.connectKeyNavHandlers(
this._orient=this.isLeftToRight()?{BL:"TL"}:{BR:"TR"}; l ? [k.LEFT_ARROW] : [k.RIGHT_ARROW],
},focusChild:function(_1){ l ? [k.RIGHT_ARROW] : [k.LEFT_ARROW]
var _2=this.focusedChild,_3=_2&&_2.popup&&_2.popup.isShowingNow; );
// parameter to dijit.popup.open() about where to put popup (relative to this.domNode)
this._orient = this.isLeftToRight() ? {BL: 'TL'} : {BR: 'TR'};
},
focusChild: function(item){
// overload focusChild so that whenever the focus is moved to a new item,
// check the previous focused whether it has its popup open, if so, after
// focusing the new item, open its submenu immediately
var prev_item = this.focusedChild,
showpopup = prev_item && prev_item.popup && prev_item.popup.isShowingNow;
this.inherited(arguments); this.inherited(arguments);
if(_3&&_1.popup&&!_1.disabled){ if(showpopup && item.popup && !item.disabled){
this._openPopup(); this._openPopup(); // TODO: on down arrow, _openPopup() is called here and in onItemClick()
} }
},_onKeyPress:function(_4){ },
if(_4.ctrlKey||_4.altKey){
return; _onKeyPress: function(/*Event*/ evt){
} // summary:
switch(_4.charOrCode){ // Handle keyboard based menu navigation.
// tags:
// protected
if(evt.ctrlKey || evt.altKey){ return; }
switch(evt.charOrCode){
case dojo.keys.DOWN_ARROW: case dojo.keys.DOWN_ARROW:
this._moveToPopup(_4); this._moveToPopup(evt);
dojo.stopEvent(_4); dojo.stopEvent(evt);
} }
},onItemClick:function(_5,_6){ },
if(_5.popup&&_5.popup.isShowingNow){
_5.popup.onCancel(); onItemClick: function(/*dijit._Widget*/ item, /*Event*/ evt){
// summary:
// Handle clicks on an item. Cancels a dropdown if already open.
// tags:
// private
if(item.popup && item.popup.isShowingNow){
item.popup.onCancel();
}else{ }else{
this.inherited(arguments); this.inherited(arguments);
} }
}}); }
});
} }

View File

@@ -1,14 +1,29 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.MenuBarItem"]){ if(!dojo._hasResource["dijit.MenuBarItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.MenuBarItem"] = true; dojo._hasResource["dijit.MenuBarItem"] = true;
dojo.provide("dijit.MenuBarItem"); dojo.provide("dijit.MenuBarItem");
dojo.require("dijit.MenuItem"); dojo.require("dijit.MenuItem");
dojo.declare("dijit._MenuBarItemMixin",null,{templateString:dojo.cache("dijit","templates/MenuBarItem.html","<div class=\"dijitReset dijitInline dijitMenuItem dijitMenuItemLabel\" dojoAttachPoint=\"focusNode\" waiRole=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<span dojoAttachPoint=\"containerNode\"></span>\n</div>\n"),attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"}})});
dojo.declare("dijit.MenuBarItem",[dijit.MenuItem,dijit._MenuBarItemMixin],{});
dojo.declare("dijit._MenuBarItemMixin", null, {
templateString: dojo.cache("dijit", "templates/MenuBarItem.html", "<div class=\"dijitReset dijitInline dijitMenuItem dijitMenuItemLabel\" dojoAttachPoint=\"focusNode\" role=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<span dojoAttachPoint=\"containerNode\"></span>\n</div>\n"),
// overriding attributeMap because we don't have icon
attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" }
})
});
dojo.declare("dijit.MenuBarItem", [dijit.MenuItem, dijit._MenuBarItemMixin], {
// summary:
// Item in a MenuBar that's clickable, and doesn't spawn a submenu when pressed (or hovered)
});
} }

View File

@@ -1,69 +1,200 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.MenuItem"]){ if(!dojo._hasResource["dijit.MenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.MenuItem"] = true; dojo._hasResource["dijit.MenuItem"] = true;
dojo.provide("dijit.MenuItem"); dojo.provide("dijit.MenuItem");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dijit._Contained"); dojo.require("dijit._Contained");
dojo.require("dijit._CssStateMixin"); dojo.require("dijit._CssStateMixin");
dojo.declare("dijit.MenuItem",[dijit._Widget,dijit._Templated,dijit._Contained,dijit._CssStateMixin],{templateString:dojo.cache("dijit","templates/MenuItem.html","<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" waiRole=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" waiRole=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" waiRole=\"presentation\">\n\t\t<div dojoAttachPoint=\"arrowWrapper\" style=\"visibility: hidden\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuExpand\"/>\n\t\t\t<span class=\"dijitMenuExpandA11y\">+</span>\n\t\t</div>\n\t</td>\n</tr>\n"),attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",accelKey:"",disabled:false,_fillContent:function(_1){
if(_1&&!("label" in this.params)){
this.set("label",_1.innerHTML); dojo.declare("dijit.MenuItem",
[dijit._Widget, dijit._Templated, dijit._Contained, dijit._CssStateMixin],
{
// summary:
// A line item in a Menu Widget
// Make 3 columns
// icon, label, and expand arrow (BiDi-dependent) indicating sub-menu
templateString: dojo.cache("dijit", "templates/MenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">\n\t\t<div dojoAttachPoint=\"arrowWrapper\" style=\"visibility: hidden\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuExpand\"/>\n\t\t\t<span class=\"dijitMenuExpandA11y\">+</span>\n\t\t</div>\n\t</td>\n</tr>\n"),
attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" },
iconClass: { node: "iconNode", type: "class" }
}),
baseClass: "dijitMenuItem",
// label: String
// Menu text
label: '',
// iconClass: String
// Class to apply to DOMNode to make it display an icon.
iconClass: "",
// accelKey: String
// Text for the accelerator (shortcut) key combination.
// Note that although Menu can display accelerator keys there
// is no infrastructure to actually catch and execute these
// accelerators.
accelKey: "",
// disabled: Boolean
// If true, the menu item is disabled.
// If false, the menu item is enabled.
disabled: false,
_fillContent: function(/*DomNode*/ source){
// If button label is specified as srcNodeRef.innerHTML rather than
// this.params.label, handle it here.
if(source && !("label" in this.params)){
this.set('label', source.innerHTML);
} }
},postCreate:function(){ },
buildRendering: function(){
this.inherited(arguments); this.inherited(arguments);
dojo.setSelectable(this.domNode,false); var label = this.id+"_text";
var _2=this.id+"_text"; dojo.attr(this.containerNode, "id", label);
dojo.attr(this.containerNode,"id",_2);
if(this.accelKeyNode){ if(this.accelKeyNode){
dojo.attr(this.accelKeyNode, "id", this.id + "_accel"); dojo.attr(this.accelKeyNode, "id", this.id + "_accel");
_2+=" "+this.id+"_accel"; label += " " + this.id + "_accel";
} }
dijit.setWaiState(this.domNode,"labelledby",_2); dijit.setWaiState(this.domNode, "labelledby", label);
},_onHover:function(){ dojo.setSelectable(this.domNode, false);
},
_onHover: function(){
// summary:
// Handler when mouse is moved onto menu item
// tags:
// protected
this.getParent().onItemHover(this); this.getParent().onItemHover(this);
},_onUnhover:function(){ },
_onUnhover: function(){
// summary:
// Handler when mouse is moved off of menu item,
// possibly to a child menu, or maybe to a sibling
// menuitem or somewhere else entirely.
// tags:
// protected
// if we are unhovering the currently selected item
// then unselect it
this.getParent().onItemUnhover(this); this.getParent().onItemUnhover(this);
this._hovering=false;
this._setStateClass(); // When menu is hidden (collapsed) due to clicking a MenuItem and having it execute,
},_onClick:function(_3){ // FF and IE don't generate an onmouseout event for the MenuItem.
this.getParent().onItemClick(this,_3); // So, help out _CssStateMixin in this case.
dojo.stopEvent(_3); this._set("hovering", false);
},onClick:function(_4){ },
},focus:function(){
_onClick: function(evt){
// summary:
// Internal handler for click events on MenuItem.
// tags:
// private
this.getParent().onItemClick(this, evt);
dojo.stopEvent(evt);
},
onClick: function(/*Event*/ evt){
// summary:
// User defined function to handle clicks
// tags:
// callback
},
focus: function(){
// summary:
// Focus on this MenuItem
try{ try{
if(dojo.isIE == 8){ if(dojo.isIE == 8){
// needed for IE8 which won't scroll TR tags into view on focus yet calling scrollIntoView creates flicker (#10275)
this.containerNode.focus(); this.containerNode.focus();
} }
dijit.focus(this.focusNode); dijit.focus(this.focusNode);
}catch(e){
// this throws on IE (at least) in some scenarios
} }
catch(e){ },
}
},_onFocus:function(){ _onFocus: function(){
// summary:
// This is called by the focus manager when focus
// goes to this MenuItem or a child menu.
// tags:
// protected
this._setSelected(true); this._setSelected(true);
this.getParent()._onItemFocus(this); this.getParent()._onItemFocus(this);
this.inherited(arguments); this.inherited(arguments);
},_setSelected:function(_5){ },
dojo.toggleClass(this.domNode,"dijitMenuItemSelected",_5);
},setLabel:function(_6){ _setSelected: function(selected){
// summary:
// Indicate that this node is the currently selected one
// tags:
// private
/***
* TODO: remove this method and calls to it, when _onBlur() is working for MenuItem.
* Currently _onBlur() gets called when focus is moved from the MenuItem to a child menu.
* That's not supposed to happen, but the problem is:
* In order to allow dijit.popup's getTopPopup() to work,a sub menu's popupParent
* points to the parent Menu, bypassing the parent MenuItem... thus the
* MenuItem is not in the chain of active widgets and gets a premature call to
* _onBlur()
*/
dojo.toggleClass(this.domNode, "dijitMenuItemSelected", selected);
},
setLabel: function(/*String*/ content){
// summary:
// Deprecated. Use set('label', ...) instead.
// tags:
// deprecated
dojo.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.", "", "2.0"); dojo.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.", "", "2.0");
this.set("label",_6); this.set("label", content);
},setDisabled:function(_7){ },
setDisabled: function(/*Boolean*/ disabled){
// summary:
// Deprecated. Use set('disabled', bool) instead.
// tags:
// deprecated
dojo.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0"); dojo.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
this.set("disabled",_7); this.set('disabled', disabled);
},_setDisabledAttr:function(_8){ },
this.disabled=_8; _setDisabledAttr: function(/*Boolean*/ value){
dijit.setWaiState(this.focusNode,"disabled",_8?"true":"false"); // summary:
},_setAccelKeyAttr:function(_9){ // Hook for attr('disabled', ...) to work.
this.accelKey=_9; // Enable or disable this menu item.
this.accelKeyNode.style.display=_9?"":"none";
this.accelKeyNode.innerHTML=_9; dijit.setWaiState(this.focusNode, 'disabled', value ? 'true' : 'false');
dojo.attr(this.containerNode,"colSpan",_9?"1":"2"); this._set("disabled", value);
}}); },
_setAccelKeyAttr: function(/*String*/ value){
// summary:
// Hook for attr('accelKey', ...) to work.
// Set accelKey on this menu item.
this.accelKeyNode.style.display=value?"":"none";
this.accelKeyNode.innerHTML=value;
//have to use colSpan to make it work in IE
dojo.attr(this.containerNode,'colSpan',value?"1":"2");
this._set("accelKey", value);
}
});
} }

View File

@@ -1,19 +1,39 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.MenuSeparator"]){ if(!dojo._hasResource["dijit.MenuSeparator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.MenuSeparator"] = true; dojo._hasResource["dijit.MenuSeparator"] = true;
dojo.provide("dijit.MenuSeparator"); dojo.provide("dijit.MenuSeparator");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dijit._Contained"); dojo.require("dijit._Contained");
dojo.declare("dijit.MenuSeparator",[dijit._Widget,dijit._Templated,dijit._Contained],{templateString:dojo.cache("dijit","templates/MenuSeparator.html","<tr class=\"dijitMenuSeparator\">\n\t<td class=\"dijitMenuSeparatorIconCell\">\n\t\t<div class=\"dijitMenuSeparatorTop\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n\t<td colspan=\"3\" class=\"dijitMenuSeparatorLabelCell\">\n\t\t<div class=\"dijitMenuSeparatorTop dijitMenuSeparatorLabel\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n</tr>\n"),postCreate:function(){
dojo.declare("dijit.MenuSeparator",
[dijit._Widget, dijit._Templated, dijit._Contained],
{
// summary:
// A line between two menu items
templateString: dojo.cache("dijit", "templates/MenuSeparator.html", "<tr class=\"dijitMenuSeparator\">\n\t<td class=\"dijitMenuSeparatorIconCell\">\n\t\t<div class=\"dijitMenuSeparatorTop\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n\t<td colspan=\"3\" class=\"dijitMenuSeparatorLabelCell\">\n\t\t<div class=\"dijitMenuSeparatorTop dijitMenuSeparatorLabel\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n</tr>\n"),
buildRendering: function(){
this.inherited(arguments);
dojo.setSelectable(this.domNode, false); dojo.setSelectable(this.domNode, false);
},isFocusable:function(){ },
return false;
}}); isFocusable: function(){
// summary:
// Override to always return false
// tags:
// protected
return false; // Boolean
}
});
} }

View File

@@ -1,14 +1,20 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.PopupMenuBarItem"]){ if(!dojo._hasResource["dijit.PopupMenuBarItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.PopupMenuBarItem"] = true; dojo._hasResource["dijit.PopupMenuBarItem"] = true;
dojo.provide("dijit.PopupMenuBarItem"); dojo.provide("dijit.PopupMenuBarItem");
dojo.require("dijit.PopupMenuItem"); dojo.require("dijit.PopupMenuItem");
dojo.require("dijit.MenuBarItem"); dojo.require("dijit.MenuBarItem");
dojo.declare("dijit.PopupMenuBarItem",[dijit.PopupMenuItem,dijit._MenuBarItemMixin],{});
dojo.declare("dijit.PopupMenuBarItem", [dijit.PopupMenuItem, dijit._MenuBarItemMixin], {
// summary:
// Item in a MenuBar like "File" or "Edit", that spawns a submenu when pressed (or hovered)
});
} }

View File

@@ -1,43 +1,74 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.PopupMenuItem"]){ if(!dojo._hasResource["dijit.PopupMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.PopupMenuItem"] = true; dojo._hasResource["dijit.PopupMenuItem"] = true;
dojo.provide("dijit.PopupMenuItem"); dojo.provide("dijit.PopupMenuItem");
dojo.require("dijit.MenuItem"); dojo.require("dijit.MenuItem");
dojo.declare("dijit.PopupMenuItem",dijit.MenuItem,{_fillContent:function(){
dojo.declare("dijit.PopupMenuItem",
dijit.MenuItem,
{
_fillContent: function(){
// summary:
// When Menu is declared in markup, this code gets the menu label and
// the popup widget from the srcNodeRef.
// description:
// srcNodeRefinnerHTML contains both the menu item text and a popup widget
// The first part holds the menu item text and the second part is the popup
// example:
// | <div dojoType="dijit.PopupMenuItem">
// | <span>pick me</span>
// | <popup> ... </popup>
// | </div>
// tags:
// protected
if(this.srcNodeRef){ if(this.srcNodeRef){
var _1=dojo.query("*",this.srcNodeRef); var nodes = dojo.query("*", this.srcNodeRef);
dijit.PopupMenuItem.superclass._fillContent.call(this,_1[0]); dijit.PopupMenuItem.superclass._fillContent.call(this, nodes[0]);
// save pointer to srcNode so we can grab the drop down widget after it's instantiated
this.dropDownContainer = this.srcNodeRef; this.dropDownContainer = this.srcNodeRef;
} }
},startup:function(){ },
if(this._started){
return; startup: function(){
} if(this._started){ return; }
this.inherited(arguments); this.inherited(arguments);
// we didn't copy the dropdown widget from the this.srcNodeRef, so it's in no-man's
// land now. move it to dojo.doc.body.
if(!this.popup){ if(!this.popup){
var _2=dojo.query("[widgetId]",this.dropDownContainer)[0]; var node = dojo.query("[widgetId]", this.dropDownContainer)[0];
this.popup=dijit.byNode(_2); this.popup = dijit.byNode(node);
} }
dojo.body().appendChild(this.popup.domNode); dojo.body().appendChild(this.popup.domNode);
this.popup.startup(); this.popup.startup();
this.popup.domNode.style.display="none"; this.popup.domNode.style.display="none";
if(this.arrowWrapper){ if(this.arrowWrapper){
dojo.style(this.arrowWrapper, "visibility", ""); dojo.style(this.arrowWrapper, "visibility", "");
} }
dijit.setWaiState(this.focusNode, "haspopup", "true"); dijit.setWaiState(this.focusNode, "haspopup", "true");
},destroyDescendants:function(){ },
destroyDescendants: function(){
if(this.popup){ if(this.popup){
// Destroy the popup, unless it's already been destroyed. This can happen because
// the popup is a direct child of <body> even though it's logically my child.
if(!this.popup._destroyed){ if(!this.popup._destroyed){
this.popup.destroyRecursive(); this.popup.destroyRecursive();
} }
delete this.popup; delete this.popup;
} }
this.inherited(arguments); this.inherited(arguments);
}}); }
});
} }

View File

@@ -1,59 +1,168 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.ProgressBar"]){ if(!dojo._hasResource["dijit.ProgressBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.ProgressBar"] = true; dojo._hasResource["dijit.ProgressBar"] = true;
dojo.provide("dijit.ProgressBar"); dojo.provide("dijit.ProgressBar");
dojo.require("dojo.fx"); dojo.require("dojo.fx");
dojo.require("dojo.number"); dojo.require("dojo.number");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit.ProgressBar",[dijit._Widget,dijit._Templated],{progress:"0",maximum:100,places:0,indeterminate:false,name:"",templateString:dojo.cache("dijit","templates/ProgressBar.html","<div class=\"dijitProgressBar dijitProgressBarEmpty\"\n\t><div waiRole=\"progressbar\" dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\n\t\t><div class=\"dijitProgressBarTile\"></div\n\t\t><span style=\"visibility:hidden\">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint=\"label\" class=\"dijitProgressBarLabel\" id=\"${id}_label\">&nbsp;</div\n\t><img dojoAttachPoint=\"indeterminateHighContrastImage\" class=\"dijitProgressBarIndeterminateHighContrastImage\" alt=\"\"\n/></div>\n"),_indeterminateHighContrastImagePath:dojo.moduleUrl("dijit","themes/a11y/indeterminate_progress.gif"),postCreate:function(){
dojo.declare("dijit.ProgressBar", [dijit._Widget, dijit._Templated], {
// summary:
// A progress indication widget, showing the amount completed
// (often the percentage completed) of a task.
//
// example:
// | <div dojoType="ProgressBar"
// | places="0"
// | value="..." maximum="...">
// | </div>
// progress: [const] String (Percentage or Number)
// Number or percentage indicating amount of task completed.
// Deprecated. Use "value" instead.
progress: "0",
// value: String (Percentage or Number)
// Number or percentage indicating amount of task completed.
// With "%": percentage value, 0% <= progress <= 100%, or
// without "%": absolute value, 0 <= progress <= maximum.
// Infinity means that the progress bar is indeterminate.
value: "",
// maximum: [const] Float
// Max sample number
maximum: 100,
// places: [const] Number
// Number of places to show in values; 0 by default
places: 0,
// indeterminate: [const] Boolean
// If false: show progress value (number or percentage).
// If true: show that a process is underway but that the amount completed is unknown.
// Deprecated. Use "value" instead.
indeterminate: false,
// label: String?
// Label on progress bar. Defaults to percentage for determinate progress bar and
// blank for indeterminate progress bar.
label:"",
// name: String
// this is the field name (for a form) if set. This needs to be set if you want to use
// this widget in a dijit.form.Form widget (such as dijit.Dialog)
name: '',
templateString: dojo.cache("dijit", "templates/ProgressBar.html", "<div class=\"dijitProgressBar dijitProgressBarEmpty\" role=\"progressbar\"\n\t><div dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\n\t\t><div class=\"dijitProgressBarTile\" role=\"presentation\"></div\n\t\t><span style=\"visibility:hidden\">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint=\"labelNode\" class=\"dijitProgressBarLabel\" id=\"${id}_label\"></div\n\t><img dojoAttachPoint=\"indeterminateHighContrastImage\" class=\"dijitProgressBarIndeterminateHighContrastImage\" alt=\"\"\n/></div>\n"),
// _indeterminateHighContrastImagePath: [private] dojo._URL
// URL to image to use for indeterminate progress bar when display is in high contrast mode
_indeterminateHighContrastImagePath:
dojo.moduleUrl("dijit", "themes/a11y/indeterminate_progress.gif"),
postMixInProperties: function(){
this.inherited(arguments); this.inherited(arguments);
this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString()); if(!("value" in this.params)){
this.value = this.indeterminate ? Infinity : this.progress;
}
},
buildRendering: function(){
this.inherited(arguments);
this.indeterminateHighContrastImage.setAttribute("src",
this._indeterminateHighContrastImagePath.toString());
this.update(); this.update();
},update:function(_1){ },
dojo.mixin(this,_1||{});
var _2=this.internalProgress; update: function(/*Object?*/attributes){
var _3=1,_4; // summary:
// Internal method to change attributes of ProgressBar, similar to set(hash). Users should call
// set("value", ...) rather than calling this method directly.
// attributes:
// May provide progress and/or maximum properties on this parameter;
// see attribute specs for details.
// example:
// | myProgressBar.update({'indeterminate': true});
// | myProgressBar.update({'progress': 80});
// | myProgressBar.update({'indeterminate': true, label:"Loading ..." })
// tags:
// private
// TODO: deprecate this method and use set() instead
dojo.mixin(this, attributes || {});
var tip = this.internalProgress, ap = this.domNode;
var percent = 1;
if(this.indeterminate){ if(this.indeterminate){
_4="addClass"; dijit.removeWaiState(ap, "valuenow");
dijit.removeWaiState(_2,"valuenow"); dijit.removeWaiState(ap, "valuemin");
dijit.removeWaiState(_2,"valuemin"); dijit.removeWaiState(ap, "valuemax");
dijit.removeWaiState(_2,"valuemax");
}else{ }else{
_4="removeClass";
if(String(this.progress).indexOf("%") != -1){ if(String(this.progress).indexOf("%") != -1){
_3=Math.min(parseFloat(this.progress)/100,1); percent = Math.min(parseFloat(this.progress)/100, 1);
this.progress=_3*this.maximum; this.progress = percent * this.maximum;
}else{ }else{
this.progress = Math.min(this.progress, this.maximum); this.progress = Math.min(this.progress, this.maximum);
_3=this.progress/this.maximum; percent = this.progress / this.maximum;
} }
var _5=this.report(_3);
this.label.firstChild.nodeValue=_5; dijit.setWaiState(ap, "describedby", this.labelNode.id);
dijit.setWaiState(_2,"describedby",this.label.id); dijit.setWaiState(ap, "valuenow", this.progress);
dijit.setWaiState(_2,"valuenow",this.progress); dijit.setWaiState(ap, "valuemin", 0);
dijit.setWaiState(_2,"valuemin",0); dijit.setWaiState(ap, "valuemax", this.maximum);
dijit.setWaiState(_2,"valuemax",this.maximum);
} }
dojo[_4](this.domNode,"dijitProgressBarIndeterminate"); this.labelNode.innerHTML = this.report(percent);
_2.style.width=(_3*100)+"%";
dojo.toggleClass(this.domNode, "dijitProgressBarIndeterminate", this.indeterminate);
tip.style.width = (percent * 100) + "%";
this.onChange(); this.onChange();
},_setValueAttr:function(v){ },
_setValueAttr: function(v){
this._set("value", v);
if(v == Infinity){ if(v == Infinity){
this.update({indeterminate:true}); this.update({indeterminate:true});
}else{ }else{
this.update({indeterminate:false, progress:v}); this.update({indeterminate:false, progress:v});
} }
},_getValueAttr:function(){ },
return this.progress;
},report:function(_6){ _setLabelAttr: function(label){
return dojo.number.format(_6,{type:"percent",places:this.places,locale:this.lang}); this._set("label", label);
},onChange:function(){ this.update();
}}); },
_setIndeterminateAttr: function(indeterminate){
// Deprecated, use set("value", ...) instead
this.indeterminate = indeterminate;
this.update();
},
report: function(/*float*/percent){
// summary:
// Generates message to show inside progress bar (normally indicating amount of task completed).
// May be overridden.
// tags:
// extension
return this.label ? this.label :
(this.indeterminate ? "&nbsp;" : dojo.number.format(percent, { type: "percent", places: this.places, locale: this.lang }));
},
onChange: function(){
// summary:
// Callback fired when progress updates.
// tags:
// extension
}
});
} }

View File

@@ -1,110 +1,257 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.TitlePane"]){ if(!dojo._hasResource["dijit.TitlePane"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.TitlePane"] = true; dojo._hasResource["dijit.TitlePane"] = true;
dojo.provide("dijit.TitlePane"); dojo.provide("dijit.TitlePane");
dojo.require("dojo.fx"); dojo.require("dojo.fx");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.ContentPane");
dojo.require("dijit._CssStateMixin"); dojo.require("dijit._CssStateMixin");
dojo.declare("dijit.TitlePane",[dijit.layout.ContentPane,dijit._Templated,dijit._CssStateMixin],{title:"",open:true,toggleable:true,tabIndex:"0",duration:dijit.defaultDuration,baseClass:"dijitTitlePane",templateString:dojo.cache("dijit","templates/TitlePane.html","<div>\n\t<div dojoAttachEvent=\"onclick:_onTitleClick, onkeypress:_onTitleKey\"\n\t\t\tclass=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode\">\n\t\t<div class=\"dijitTitlePaneTitleFocus\" dojoAttachPoint=\"focusNode\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"arrowNode\" class=\"dijitArrowNode\" waiRole=\"presentation\"\n\t\t\t/><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span\n\t\t\t><span dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></span>\n\t\t</div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\" waiRole=\"presentation\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\" waiRole=\"presentation\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" waiRole=\"region\" tabindex=\"-1\" id=\"${id}_pane\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc. Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"),attributeMap:dojo.delegate(dijit.layout.ContentPane.prototype.attributeMap,{title:{node:"titleNode",type:"innerHTML"},tooltip:{node:"focusNode",type:"attribute",attribute:"title"},id:""}),postCreate:function(){
if(!this.open){
this.hideNode.style.display=this.wipeNode.style.display="none"; dojo.declare(
} "dijit.TitlePane",
[dijit.layout.ContentPane, dijit._Templated, dijit._CssStateMixin],
{
// summary:
// A pane with a title on top, that can be expanded or collapsed.
//
// description:
// An accessible container with a title Heading, and a content
// section that slides open and closed. TitlePane is an extension to
// `dijit.layout.ContentPane`, providing all the useful content-control aspects from it.
//
// example:
// | // load a TitlePane from remote file:
// | var foo = new dijit.TitlePane({ href: "foobar.html", title:"Title" });
// | foo.startup();
//
// example:
// | <!-- markup href example: -->
// | <div dojoType="dijit.TitlePane" href="foobar.html" title="Title"></div>
//
// example:
// | <!-- markup with inline data -->
// | <div dojoType="dijit.TitlePane" title="Title">
// | <p>I am content</p>
// | </div>
// title: String
// Title of the pane
title: "",
// open: Boolean
// Whether pane is opened or closed.
open: true,
// toggleable: Boolean
// Whether pane can be opened or closed by clicking the title bar.
toggleable: true,
// tabIndex: String
// Tabindex setting for the title (so users can tab to the title then
// use space/enter to open/close the title pane)
tabIndex: "0",
// duration: Integer
// Time in milliseconds to fade in/fade out
duration: dijit.defaultDuration,
// baseClass: [protected] String
// The root className to be placed on this widget's domNode.
baseClass: "dijitTitlePane",
templateString: dojo.cache("dijit", "templates/TitlePane.html", "<div>\n\t<div dojoAttachEvent=\"onclick:_onTitleClick, onkeypress:_onTitleKey\"\n\t\t\tclass=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode\">\n\t\t<div class=\"dijitTitlePaneTitleFocus\" dojoAttachPoint=\"focusNode\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"arrowNode\" class=\"dijitArrowNode\" role=\"presentation\"\n\t\t\t/><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span\n\t\t\t><span dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></span>\n\t\t</div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\" role=\"presentation\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\" role=\"presentation\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" role=\"region\" id=\"${id}_pane\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc. Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"),
attributeMap: dojo.delegate(dijit.layout.ContentPane.prototype.attributeMap, {
title: { node: "titleNode", type: "innerHTML" },
tooltip: {node: "focusNode", type: "attribute", attribute: "title"}, // focusNode spans the entire width, titleNode doesn't
id:""
}),
buildRendering: function(){
this.inherited(arguments);
dojo.setSelectable(this.titleNode, false);
},
postCreate: function(){
this.inherited(arguments);
// Hover and focus effect on title bar, except for non-toggleable TitlePanes
// This should really be controlled from _setToggleableAttr() but _CssStateMixin
// doesn't provide a way to disconnect a previous _trackMouseState() call
if(this.toggleable){ if(this.toggleable){
this._trackMouseState(this.titleBarNode, "dijitTitlePaneTitle"); this._trackMouseState(this.titleBarNode, "dijitTitlePaneTitle");
} }
this._setCss();
dojo.setSelectable(this.titleNode,false); // setup open/close animations
var _1=this.hideNode,_2=this.wipeNode; var hideNode = this.hideNode, wipeNode = this.wipeNode;
this._wipeIn=dojo.fx.wipeIn({node:this.wipeNode,duration:this.duration,beforeBegin:function(){ this._wipeIn = dojo.fx.wipeIn({
_1.style.display=""; node: this.wipeNode,
}}); duration: this.duration,
this._wipeOut=dojo.fx.wipeOut({node:this.wipeNode,duration:this.duration,onEnd:function(){ beforeBegin: function(){
_1.style.display="none"; hideNode.style.display="";
}});
this.inherited(arguments);
},_setOpenAttr:function(_3){
if(this.open!==_3){
this.toggle();
} }
dijit.setWaiState(this.containerNode,"hidden",this.open?"false":"true"); });
dijit.setWaiState(this.focusNode,"pressed",this.open?"true":"false"); this._wipeOut = dojo.fx.wipeOut({
},_setToggleableAttr:function(_4){ node: this.wipeNode,
this.toggleable=_4; duration: this.duration,
dijit.setWaiRole(this.focusNode,_4?"button":"heading"); onEnd: function(){
if(_4){ hideNode.style.display="none";
}
});
},
_setOpenAttr: function(/*Boolean*/ open, /*Boolean*/ animate){
// summary:
// Hook to make set("open", boolean) control the open/closed state of the pane.
// open: Boolean
// True if you want to open the pane, false if you want to close it.
dojo.forEach([this._wipeIn, this._wipeOut], function(animation){
if(animation && animation.status() == "playing"){
animation.stop();
}
});
if(animate){
var anim = this[open ? "_wipeIn" : "_wipeOut"];
anim.play();
}else{
this.hideNode.style.display = this.wipeNode.style.display = open ? "" : "none";
}
// load content (if this is the first time we are opening the TitlePane
// and content is specified as an href, or href was set when hidden)
if(this._started){
if(open){
this._onShow();
}else{
this.onHide();
}
}
this.arrowNodeInner.innerHTML = open ? "-" : "+";
dijit.setWaiState(this.containerNode,"hidden", open ? "false" : "true");
dijit.setWaiState(this.focusNode, "pressed", open ? "true" : "false");
this._set("open", open);
this._setCss();
},
_setToggleableAttr: function(/*Boolean*/ canToggle){
// summary:
// Hook to make set("toggleable", boolean) work.
// canToggle: Boolean
// True to allow user to open/close pane by clicking title bar.
dijit.setWaiRole(this.focusNode, canToggle ? "button" : "heading");
if(canToggle){
// TODO: if canToggle is switched from true to false shouldn't we remove this setting?
dijit.setWaiState(this.focusNode, "controls", this.id+"_pane"); dijit.setWaiState(this.focusNode, "controls", this.id+"_pane");
dojo.attr(this.focusNode, "tabIndex", this.tabIndex); dojo.attr(this.focusNode, "tabIndex", this.tabIndex);
}else{ }else{
dojo.removeAttr(this.focusNode, "tabIndex"); dojo.removeAttr(this.focusNode, "tabIndex");
} }
this._set("toggleable", canToggle);
this._setCss(); this._setCss();
},_setContentAttr:function(_5){ },
_setContentAttr: function(/*String|DomNode|Nodelist*/ content){
// summary:
// Hook to make set("content", ...) work.
// Typically called when an href is loaded. Our job is to make the animation smooth.
if(!this.open || !this._wipeOut || this._wipeOut.status() == "playing"){ if(!this.open || !this._wipeOut || this._wipeOut.status() == "playing"){
// we are currently *closing* the pane (or the pane is closed), so just let that continue
this.inherited(arguments); this.inherited(arguments);
}else{ }else{
if(this._wipeIn && this._wipeIn.status() == "playing"){ if(this._wipeIn && this._wipeIn.status() == "playing"){
this._wipeIn.stop(); this._wipeIn.stop();
} }
// freeze container at current height so that adding new content doesn't make it jump
dojo.marginBox(this.wipeNode, { h: dojo.marginBox(this.wipeNode).h }); dojo.marginBox(this.wipeNode, { h: dojo.marginBox(this.wipeNode).h });
// add the new content (erasing the old content, if any)
this.inherited(arguments); this.inherited(arguments);
// call _wipeIn.play() to animate from current height to new height
if(this._wipeIn){ if(this._wipeIn){
this._wipeIn.play(); this._wipeIn.play();
}else{ }else{
this.hideNode.style.display = ""; this.hideNode.style.display = "";
} }
} }
},toggle:function(){ },
dojo.forEach([this._wipeIn,this._wipeOut],function(_6){
if(_6&&_6.status()=="playing"){ toggle: function(){
_6.stop(); // summary:
} // Switches between opened and closed state
}); // tags:
var _7=this[this.open?"_wipeOut":"_wipeIn"]; // private
if(_7){
_7.play(); this._setOpenAttr(!this.open, true);
}else{ },
this.hideNode.style.display=this.open?"":"none";
} _setCss: function(){
this.open=!this.open; // summary:
if(this.open){ // Set the open/close css state for the TitlePane
this._onShow(); // tags:
}else{ // private
this.onHide();
} var node = this.titleBarNode || this.focusNode;
this._setCss(); var oldCls = this._titleBarClass;
},_setCss:function(){
var _8=this.titleBarNode||this.focusNode;
if(this._titleBarClass){
dojo.removeClass(_8,this._titleBarClass);
}
this._titleBarClass = "dijit" + (this.toggleable ? "" : "Fixed") + (this.open ? "Open" : "Closed"); this._titleBarClass = "dijit" + (this.toggleable ? "" : "Fixed") + (this.open ? "Open" : "Closed");
dojo.addClass(_8,this._titleBarClass); dojo.replaceClass(node, this._titleBarClass, oldCls || "");
this.arrowNodeInner.innerHTML = this.open ? "-" : "+"; this.arrowNodeInner.innerHTML = this.open ? "-" : "+";
},_onTitleKey:function(e){ },
if(e.charOrCode==dojo.keys.ENTER||e.charOrCode==" "){
_onTitleKey: function(/*Event*/ e){
// summary:
// Handler for when user hits a key
// tags:
// private
if(e.charOrCode == dojo.keys.ENTER || e.charOrCode == ' '){
if(this.toggleable){ if(this.toggleable){
this.toggle(); this.toggle();
} }
dojo.stopEvent(e); dojo.stopEvent(e);
}else{ }else if(e.charOrCode == dojo.keys.DOWN_ARROW && this.open){
if(e.charOrCode==dojo.keys.DOWN_ARROW&&this.open){
this.containerNode.focus(); this.containerNode.focus();
e.preventDefault(); e.preventDefault();
} }
} },
},_onTitleClick:function(){
_onTitleClick: function(){
// summary:
// Handler when user clicks the title bar
// tags:
// private
if(this.toggleable){ if(this.toggleable){
this.toggle(); this.toggle();
} }
},setTitle:function(_9){ },
setTitle: function(/*String*/ title){
// summary:
// Deprecated. Use set('title', ...) instead.
// tags:
// deprecated
dojo.deprecated("dijit.TitlePane.setTitle() is deprecated. Use set('title', ...) instead.", "", "2.0"); dojo.deprecated("dijit.TitlePane.setTitle() is deprecated. Use set('title', ...) instead.", "", "2.0");
this.set("title",_9); this.set("title", title);
}}); }
});
} }

View File

@@ -1,25 +1,53 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Toolbar"]){ if(!dojo._hasResource["dijit.Toolbar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Toolbar"] = true; dojo._hasResource["dijit.Toolbar"] = true;
dojo.provide("dijit.Toolbar"); dojo.provide("dijit.Toolbar");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._KeyNavContainer"); dojo.require("dijit._KeyNavContainer");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit.Toolbar",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{templateString:"<div class=\"dijit\" waiRole=\"toolbar\" tabIndex=\"${tabIndex}\" dojoAttachPoint=\"containerNode\">"+"</div>",baseClass:"dijitToolbar",postCreate:function(){
this.connectKeyNavHandlers(this.isLeftToRight()?[dojo.keys.LEFT_ARROW]:[dojo.keys.RIGHT_ARROW],this.isLeftToRight()?[dojo.keys.RIGHT_ARROW]:[dojo.keys.LEFT_ARROW]);
this.inherited(arguments);
},startup:function(){
if(this._started){
return;
}
this.startupKeyNavChildren();
this.inherited(arguments);
}});
dojo.require("dijit.ToolbarSeparator"); dojo.require("dijit.ToolbarSeparator");
// Note: require of ToolbarSeparator is for back-compat, remove for 2.0
dojo.declare("dijit.Toolbar",
[dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
{
// summary:
// A Toolbar widget, used to hold things like `dijit.Editor` buttons
templateString:
'<div class="dijit" role="toolbar" tabIndex="${tabIndex}" dojoAttachPoint="containerNode">' +
// '<table style="table-layout: fixed" class="dijitReset dijitToolbarTable">' + // factor out style
// '<tr class="dijitReset" dojoAttachPoint="containerNode"></tr>'+
// '</table>' +
'</div>',
baseClass: "dijitToolbar",
postCreate: function(){
this.inherited(arguments);
this.connectKeyNavHandlers(
this.isLeftToRight() ? [dojo.keys.LEFT_ARROW] : [dojo.keys.RIGHT_ARROW],
this.isLeftToRight() ? [dojo.keys.RIGHT_ARROW] : [dojo.keys.LEFT_ARROW]
);
},
startup: function(){
if(this._started){ return; }
this.startupKeyNavChildren();
this.inherited(arguments);
}
}
);
} }

View File

@@ -1,18 +1,35 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.ToolbarSeparator"]){ if(!dojo._hasResource["dijit.ToolbarSeparator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.ToolbarSeparator"] = true; dojo._hasResource["dijit.ToolbarSeparator"] = true;
dojo.provide("dijit.ToolbarSeparator"); dojo.provide("dijit.ToolbarSeparator");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit.ToolbarSeparator",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dijitToolbarSeparator dijitInline\" waiRole=\"presentation\"></div>",postCreate:function(){
dojo.declare("dijit.ToolbarSeparator",
[ dijit._Widget, dijit._Templated ],
{
// summary:
// A spacer between two `dijit.Toolbar` items
templateString: '<div class="dijitToolbarSeparator dijitInline" role="presentation"></div>',
buildRendering: function(){
this.inherited(arguments);
dojo.setSelectable(this.domNode, false); dojo.setSelectable(this.domNode, false);
},isFocusable:function(){ },
isFocusable: function(){
// summary:
// This widget isn't focusable, so pass along that fact.
// tags:
// protected
return false; return false;
}}); }
});
} }

View File

@@ -1,155 +1,440 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.Tooltip"]){ if(!dojo._hasResource["dijit.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Tooltip"] = true; dojo._hasResource["dijit.Tooltip"] = true;
dojo.provide("dijit.Tooltip"); dojo.provide("dijit.Tooltip");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.declare("dijit._MasterTooltip",[dijit._Widget,dijit._Templated],{duration:dijit.defaultDuration,templateString:dojo.cache("dijit","templates/Tooltip.html","<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\">\n\t<div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" waiRole='alert'></div>\n\t<div class=\"dijitTooltipConnector\"></div>\n</div>\n"),postCreate:function(){
dojo.declare(
"dijit._MasterTooltip",
[dijit._Widget, dijit._Templated],
{
// summary:
// Internal widget that holds the actual tooltip markup,
// which occurs once per page.
// Called by Tooltip widgets which are just containers to hold
// the markup
// tags:
// protected
// duration: Integer
// Milliseconds to fade in/fade out
duration: dijit.defaultDuration,
templateString: dojo.cache("dijit", "templates/Tooltip.html", "<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\n></div>\n"),
postCreate: function(){
dojo.body().appendChild(this.domNode); dojo.body().appendChild(this.domNode);
this.bgIframe = new dijit.BackgroundIframe(this.domNode); this.bgIframe = new dijit.BackgroundIframe(this.domNode);
// Setup fade-in and fade-out functions.
this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") }); this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") }); this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
},show:function(_1,_2,_3,_4){ },
if(this.aroundNode&&this.aroundNode===_2){
show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
// summary:
// Display tooltip w/specified contents to right of specified node
// (To left if there's no space on the right, or if rtl == true)
if(this.aroundNode && this.aroundNode === aroundNode){
return; return;
} }
// reset width; it may have been set by orient() on a previous tooltip show()
this.domNode.width = "auto";
if(this.fadeOut.status() == "playing"){ if(this.fadeOut.status() == "playing"){
// previous tooltip is being hidden; wait until the hide completes then show new one
this._onDeck=arguments; this._onDeck=arguments;
return; return;
} }
this.containerNode.innerHTML=_1; this.containerNode.innerHTML=innerHTML;
var _5=dijit.placeOnScreenAroundElement(this.domNode,_2,dijit.getPopupAroundAlignment((_3&&_3.length)?_3:dijit.Tooltip.defaultPosition,!_4),dojo.hitch(this,"orient"));
var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));
// show it
dojo.style(this.domNode, "opacity", 0); dojo.style(this.domNode, "opacity", 0);
this.fadeIn.play(); this.fadeIn.play();
this.isShowingNow = true; this.isShowingNow = true;
this.aroundNode=_2; this.aroundNode = aroundNode;
},orient:function(_6,_7,_8){ },
_6.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_7+"-"+_8];
},_onShow:function(){ orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
// summary:
// Private function to set CSS for tooltip node based on which position it's in.
// This is called by the dijit popup code. It will also reduce the tooltip's
// width to whatever width is available
// tags:
// protected
this.connectorNode.style.top = ""; //reset to default
//Adjust the spaceAvailable width, without changing the spaceAvailable object
var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;
node.className = "dijitTooltip " +
{
"BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
"TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
"BR-TR": "dijitTooltipBelow dijitTooltipABRight",
"TR-BR": "dijitTooltipAbove dijitTooltipABRight",
"BR-BL": "dijitTooltipRight",
"BL-BR": "dijitTooltipLeft"
}[aroundCorner + "-" + tooltipCorner];
// reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
this.domNode.style.width = "auto";
var size = dojo.contentBox(this.domNode);
var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
var widthWasReduced = width < size.w;
this.domNode.style.width = width+"px";
//Adjust width for tooltips that have a really long word or a nowrap setting
if(widthWasReduced){
this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
var scrollWidth = this.containerNode.scrollWidth;
this.containerNode.style.overflow = "visible"; //change it back
if(scrollWidth > width){
scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
this.domNode.style.width = scrollWidth + "px";
}
}
// Reposition the tooltip connector.
if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
var mb = dojo.marginBox(node);
var tooltipConnectorHeight = this.connectorNode.offsetHeight;
if(mb.h > spaceAvailable.h){
// The tooltip starts at the top of the page and will extend past the aroundNode
var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
this.connectorNode.style.top = aroundNodePlacement + "px";
this.connectorNode.style.bottom = "";
}else{
// Align center of connector with center of aroundNode, except don't let bottom
// of connector extend below bottom of tooltip content, or top of connector
// extend past top of tooltip content
this.connectorNode.style.bottom = Math.min(
Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
mb.h - tooltipConnectorHeight) + "px";
this.connectorNode.style.top = "";
}
}else{
// reset the tooltip back to the defaults
this.connectorNode.style.top = "";
this.connectorNode.style.bottom = "";
}
return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
},
_onShow: function(){
// summary:
// Called at end of fade-in operation
// tags:
// protected
if(dojo.isIE){ if(dojo.isIE){
// the arrow won't show up on a node w/an opacity filter
this.domNode.style.filter=""; this.domNode.style.filter="";
} }
},hide:function(_9){ },
if(this._onDeck&&this._onDeck[1]==_9){
hide: function(aroundNode){
// summary:
// Hide the tooltip
if(this._onDeck && this._onDeck[1] == aroundNode){
// this hide request is for a show() that hasn't even started yet;
// just cancel the pending show()
this._onDeck=null; this._onDeck=null;
}else{ }else if(this.aroundNode === aroundNode){
if(this.aroundNode===_9){ // this hide request is for the currently displayed tooltip
this.fadeIn.stop(); this.fadeIn.stop();
this.isShowingNow = false; this.isShowingNow = false;
this.aroundNode = null; this.aroundNode = null;
this.fadeOut.play(); this.fadeOut.play();
}else{ }else{
// just ignore the call, it's for a tooltip that has already been erased
} }
} },
},_onHide:function(){
this.domNode.style.cssText=""; _onHide: function(){
// summary:
// Called at end of fade-out operation
// tags:
// protected
this.domNode.style.cssText=""; // to position offscreen again
this.containerNode.innerHTML=""; this.containerNode.innerHTML="";
if(this._onDeck){ if(this._onDeck){
// a show request has been queued up; do it now
this.show.apply(this, this._onDeck); this.show.apply(this, this._onDeck);
this._onDeck=null; this._onDeck=null;
} }
}});
dijit.showTooltip=function(_a,_b,_c,_d){
if(!dijit._masterTT){
dijit._masterTT=new dijit._MasterTooltip();
} }
return dijit._masterTT.show(_a,_b,_c,_d);
}
);
dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
// summary:
// Display tooltip w/specified contents in specified position.
// See description of dijit.Tooltip.defaultPosition for details on position parameter.
// If position is not specified then dijit.Tooltip.defaultPosition is used.
if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
}; };
dijit.hideTooltip=function(_e){
if(!dijit._masterTT){ dijit.hideTooltip = function(aroundNode){
dijit._masterTT=new dijit._MasterTooltip(); // summary:
} // Hide the tooltip
return dijit._masterTT.hide(_e); if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
return dijit._masterTT.hide(aroundNode);
}; };
dojo.declare("dijit.Tooltip",dijit._Widget,{label:"",showDelay:400,connectId:[],position:[],constructor:function(){
this._nodeConnectionsById={}; dojo.declare(
},_setConnectIdAttr:function(_f){ "dijit.Tooltip",
for(var _10 in this._nodeConnectionsById){ dijit._Widget,
this.removeTarget(_10); {
// summary:
// Pops up a tooltip (a help message) when you hover over a node.
// label: String
// Text to display in the tooltip.
// Specified as innerHTML when creating the widget from markup.
label: "",
// showDelay: Integer
// Number of milliseconds to wait after hovering over/focusing on the object, before
// the tooltip is displayed.
showDelay: 400,
// connectId: String|String[]
// Id of domNode(s) to attach the tooltip to.
// When user hovers over specified dom node, the tooltip will appear.
connectId: [],
// position: String[]
// See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
position: [],
_setConnectIdAttr: function(/*String*/ newId){
// summary:
// Connect to node(s) (specified by id)
// Remove connections to old nodes (if there are any)
dojo.forEach(this._connections || [], function(nested){
dojo.forEach(nested, dojo.hitch(this, "disconnect"));
}, this);
// Make connections to nodes in newIds.
var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
this._connections = dojo.map(ary, function(id){
var node = dojo.byId(id);
return node ? [
this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
this.connect(node, "onfocus", "_onTargetFocus"),
this.connect(node, "onblur", "_onTargetBlur")
] : [];
}, this);
this._set("connectId", newId);
this._connectIds = ary; // save as array
},
addTarget: function(/*DOMNODE || String*/ node){
// summary:
// Attach tooltip to specified node if it's not already connected
// TODO: remove in 2.0 and just use set("connectId", ...) interface
var id = node.id || node;
if(dojo.indexOf(this._connectIds, id) == -1){
this.set("connectId", this._connectIds.concat(id));
} }
dojo.forEach(dojo.isArrayLike(_f)?_f:[_f],this.addTarget,this); },
},_getConnectIdAttr:function(){
var ary=[]; removeTarget: function(/*DOMNODE || String*/ node){
for(var id in this._nodeConnectionsById){ // summary:
ary.push(id); // Detach tooltip from specified node
// TODO: remove in 2.0 and just use set("connectId", ...) interface
var id = node.id || node, // map from DOMNode back to plain id string
idx = dojo.indexOf(this._connectIds, id);
if(idx >= 0){
// remove id (modifies original this._connectIds but that's OK in this case)
this._connectIds.splice(idx, 1);
this.set("connectId", this._connectIds);
} }
return ary; },
},addTarget:function(id){
var _11=dojo.byId(id); buildRendering: function(){
if(!_11){
return;
}
if(_11.id in this._nodeConnectionsById){
return;
}
this._nodeConnectionsById[_11.id]=[this.connect(_11,"onmouseenter","_onTargetMouseEnter"),this.connect(_11,"onmouseleave","_onTargetMouseLeave"),this.connect(_11,"onfocus","_onTargetFocus"),this.connect(_11,"onblur","_onTargetBlur")];
},removeTarget:function(_12){
var id=_12.id||_12;
if(id in this._nodeConnectionsById){
dojo.forEach(this._nodeConnectionsById[id],this.disconnect,this);
delete this._nodeConnectionsById[id];
}
},postCreate:function(){
dojo.addClass(this.domNode,"dijitTooltipData");
},startup:function(){
this.inherited(arguments); this.inherited(arguments);
dojo.addClass(this.domNode,"dijitTooltipData");
},
startup: function(){
this.inherited(arguments);
// If this tooltip was created in a template, or for some other reason the specified connectId[s]
// didn't exist during the widget's initialization, then connect now.
var ids = this.connectId; var ids = this.connectId;
dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this); dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
},_onTargetMouseEnter:function(e){ },
_onTargetMouseEnter: function(/*Event*/ e){
// summary:
// Handler for mouseenter event on the target node
// tags:
// private
this._onHover(e); this._onHover(e);
},_onTargetMouseLeave:function(e){ },
_onTargetMouseLeave: function(/*Event*/ e){
// summary:
// Handler for mouseleave event on the target node
// tags:
// private
this._onUnHover(e); this._onUnHover(e);
},_onTargetFocus:function(e){ },
_onTargetFocus: function(/*Event*/ e){
// summary:
// Handler for focus event on the target node
// tags:
// private
this._focus = true; this._focus = true;
this._onHover(e); this._onHover(e);
},_onTargetBlur:function(e){ },
_onTargetBlur: function(/*Event*/ e){
// summary:
// Handler for blur event on the target node
// tags:
// private
this._focus = false; this._focus = false;
this._onUnHover(e); this._onUnHover(e);
},_onHover:function(e){ },
_onHover: function(/*Event*/ e){
// summary:
// Despite the name of this method, it actually handles both hover and focus
// events on the target node, setting a timer to show the tooltip.
// tags:
// private
if(!this._showTimer){ if(!this._showTimer){
var _13=e.target; var target = e.target;
this._showTimer=setTimeout(dojo.hitch(this,function(){ this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
this.open(_13);
}),this.showDelay);
}
},_onUnHover:function(e){
if(this._focus){
return;
} }
},
_onUnHover: function(/*Event*/ e){
// summary:
// Despite the name of this method, it actually handles both mouseleave and blur
// events on the target node, hiding the tooltip.
// tags:
// private
// keep a tooltip open if the associated element still has focus (even though the
// mouse moved away)
if(this._focus){ return; }
if(this._showTimer){ if(this._showTimer){
clearTimeout(this._showTimer); clearTimeout(this._showTimer);
delete this._showTimer; delete this._showTimer;
} }
this.close(); this.close();
},open:function(_14){ },
open: function(/*DomNode*/ target){
// summary:
// Display the tooltip; usually not called directly.
// tags:
// private
if(this._showTimer){ if(this._showTimer){
clearTimeout(this._showTimer); clearTimeout(this._showTimer);
delete this._showTimer; delete this._showTimer;
} }
dijit.showTooltip(this.label||this.domNode.innerHTML,_14,this.position,!this.isLeftToRight()); dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position, !this.isLeftToRight());
this._connectNode=_14;
this.onShow(_14,this.position); this._connectNode = target;
},close:function(){ this.onShow(target, this.position);
},
close: function(){
// summary:
// Hide the tooltip or cancel timer for show of tooltip
// tags:
// private
if(this._connectNode){ if(this._connectNode){
// if tooltip is currently shown
dijit.hideTooltip(this._connectNode); dijit.hideTooltip(this._connectNode);
delete this._connectNode; delete this._connectNode;
this.onHide(); this.onHide();
} }
if(this._showTimer){ if(this._showTimer){
// if tooltip is scheduled to be shown (after a brief delay)
clearTimeout(this._showTimer); clearTimeout(this._showTimer);
delete this._showTimer; delete this._showTimer;
} }
},onShow:function(_15,_16){ },
},onHide:function(){
},uninitialize:function(){ onShow: function(target, position){
// summary:
// Called when the tooltip is shown
// tags:
// callback
},
onHide: function(){
// summary:
// Called when the tooltip is hidden
// tags:
// callback
},
uninitialize: function(){
this.close(); this.close();
this.inherited(arguments); this.inherited(arguments);
}}); }
dijit.Tooltip.defaultPosition=["after","before"]; }
);
// dijit.Tooltip.defaultPosition: String[]
// This variable controls the position of tooltips, if the position is not specified to
// the Tooltip widget or *TextBox widget itself. It's an array of strings with the following values:
//
// * before: places tooltip to the left of the target node/widget, or to the right in
// the case of RTL scripts like Hebrew and Arabic
// * after: places tooltip to the right of the target node/widget, or to the left in
// the case of RTL scripts like Hebrew and Arabic
// * above: tooltip goes above target node
// * below: tooltip goes below target node
//
// The list is positions is tried, in order, until a position is found where the tooltip fits
// within the viewport.
//
// Be careful setting this parameter. A value of "above" may work fine until the user scrolls
// the screen so that there's no room above the target node. Nodes with drop downs, like
// DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
// that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
// is only room below (or above) the target node, but not both.
dijit.Tooltip.defaultPosition = ["after", "before"];
} }

View File

@@ -1,66 +1,146 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit.TooltipDialog"]){ if(!dojo._hasResource["dijit.TooltipDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.TooltipDialog"] = true; dojo._hasResource["dijit.TooltipDialog"] = true;
dojo.provide("dijit.TooltipDialog"); dojo.provide("dijit.TooltipDialog");
dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.ContentPane");
dojo.require("dijit._Templated"); dojo.require("dijit._Templated");
dojo.require("dijit.form._FormMixin"); dojo.require("dijit.form._FormMixin");
dojo.require("dijit._DialogMixin"); dojo.require("dijit._DialogMixin");
dojo.declare("dijit.TooltipDialog",[dijit.layout.ContentPane,dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:dojo.cache("dijit","templates/TooltipDialog.html","<div waiRole=\"presentation\">\n\t<div class=\"dijitTooltipContainer\" waiRole=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" tabindex=\"-1\" waiRole=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" waiRole=\"presentation\"></div>\n</div>\n"),postCreate:function(){
dojo.declare(
"dijit.TooltipDialog",
[dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
{
// summary:
// Pops up a dialog that appears like a Tooltip
// title: String
// Description of tooltip dialog (required for a11y)
title: "",
// doLayout: [protected] Boolean
// Don't change this parameter from the default value.
// This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
// is never a child of a layout container, nor can you specify the size of
// TooltipDialog in order to control the size of an inner widget.
doLayout: false,
// autofocus: Boolean
// A Toggle to modify the default focus behavior of a Dialog, which
// is to focus on the first dialog element after opening the dialog.
// False will disable autofocusing. Default: true
autofocus: true,
// baseClass: [protected] String
// The root className to use for the various states of this widget
baseClass: "dijitTooltipDialog",
// _firstFocusItem: [private] [readonly] DomNode
// The pointer to the first focusable node in the dialog.
// Set by `dijit._DialogMixin._getFocusItems`.
_firstFocusItem: null,
// _lastFocusItem: [private] [readonly] DomNode
// The pointer to which node has focus prior to our dialog.
// Set by `dijit._DialogMixin._getFocusItems`.
_lastFocusItem: null,
templateString: dojo.cache("dijit", "templates/TooltipDialog.html", "<div role=\"presentation\" tabIndex=\"-1\">\n\t<div class=\"dijitTooltipContainer\" role=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" role=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" role=\"presentation\"></div>\n</div>\n"),
_setTitleAttr: function(/*String*/ title){
this.containerNode.title = title;
this._set("title", title)
},
postCreate: function(){
this.inherited(arguments); this.inherited(arguments);
this.connect(this.containerNode, "onkeypress", "_onKey"); this.connect(this.containerNode, "onkeypress", "_onKey");
this.containerNode.title=this.title; },
},orient:function(_1,_2,_3){
var c=this._currentOrientClass; orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ corner){
if(c){ // summary:
dojo.removeClass(this.domNode,c); // Configure widget to be displayed in given position relative to the button.
} // This is called from the dijit.popup code, and should not be called
c="dijitTooltipAB"+(_3.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(_3.charAt(0)=="T"?"Below":"Above"); // directly.
dojo.addClass(this.domNode,c); // tags:
this._currentOrientClass=c; // protected
},onOpen:function(_4){ var newC = "dijitTooltipAB" + (corner.charAt(1) == 'L' ? "Left" : "Right")
this.orient(this.domNode,_4.aroundCorner,_4.corner); + " dijitTooltip"
this._onShow(); + (corner.charAt(0) == 'T' ? "Below" : "Above");
if(this.autofocus){
dojo.replaceClass(this.domNode, newC, this._currentOrientClass || "");
this._currentOrientClass = newC;
},
focus: function(){
// summary:
// Focus on first field
this._getFocusItems(this.containerNode); this._getFocusItems(this.containerNode);
dijit.focus(this._firstFocusItem); dijit.focus(this._firstFocusItem);
} },
},onClose:function(){
onOpen: function(/*Object*/ pos){
// summary:
// Called when dialog is displayed.
// This is called from the dijit.popup code, and should not be called directly.
// tags:
// protected
this.orient(this.domNode,pos.aroundCorner, pos.corner);
this._onShow(); // lazy load trigger
},
onClose: function(){
// summary:
// Called when dialog is hidden.
// This is called from the dijit.popup code, and should not be called directly.
// tags:
// protected
this.onHide(); this.onHide();
},_onKey:function(_5){ },
var _6=_5.target;
_onKey: function(/*Event*/ evt){
// summary:
// Handler for keyboard events
// description:
// Keep keyboard focus in dialog; close dialog on escape key
// tags:
// private
var node = evt.target;
var dk = dojo.keys; var dk = dojo.keys;
if(_5.charOrCode===dk.TAB){ if(evt.charOrCode === dk.TAB){
this._getFocusItems(this.containerNode); this._getFocusItems(this.containerNode);
} }
var _7=(this._firstFocusItem==this._lastFocusItem); var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
if(_5.charOrCode==dk.ESCAPE){ if(evt.charOrCode == dk.ESCAPE){
// Use setTimeout to avoid crash on IE, see #10396.
setTimeout(dojo.hitch(this, "onCancel"), 0); setTimeout(dojo.hitch(this, "onCancel"), 0);
dojo.stopEvent(_5); dojo.stopEvent(evt);
}else{ }else if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
if(_6==this._firstFocusItem&&_5.shiftKey&&_5.charOrCode===dk.TAB){ if(!singleFocusItem){
if(!_7){ dijit.focus(this._lastFocusItem); // send focus to last item in dialog
dijit.focus(this._lastFocusItem);
} }
dojo.stopEvent(_5); dojo.stopEvent(evt);
}else{ }else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
if(_6==this._lastFocusItem&&_5.charOrCode===dk.TAB&&!_5.shiftKey){ if(!singleFocusItem){
if(!_7){ dijit.focus(this._firstFocusItem); // send focus to first item in dialog
dijit.focus(this._firstFocusItem);
} }
dojo.stopEvent(_5); dojo.stopEvent(evt);
}else{ }else if(evt.charOrCode === dk.TAB){
if(_5.charOrCode===dk.TAB){ // we want the browser's default tab handling to move focus
_5.stopPropagation(); // but we don't want the tab to propagate upwards
evt.stopPropagation();
} }
} }
} }
} );
}});
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,20 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._Calendar"]){ if(!dojo._hasResource["dijit._Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._Calendar"] = true; dojo._hasResource["dijit._Calendar"] = true;
dojo.provide("dijit._Calendar"); dojo.provide("dijit._Calendar");
dojo.require("dijit.Calendar"); dojo.require("dijit.Calendar");
dojo.deprecated("dijit._Calendar is deprecated", "dijit._Calendar moved to dijit.Calendar", 1.5); dojo.deprecated("dijit._Calendar is deprecated", "dijit._Calendar moved to dijit.Calendar", 1.5);
// dijit._Calendar had an underscore all this time merely because it did
// not satisfy dijit's a11y policy.
dijit._Calendar = dijit.Calendar; dijit._Calendar = dijit.Calendar;
} }

View File

@@ -1,31 +1,76 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._Contained"]){ if(!dojo._hasResource["dijit._Contained"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._Contained"] = true; dojo._hasResource["dijit._Contained"] = true;
dojo.provide("dijit._Contained"); dojo.provide("dijit._Contained");
dojo.declare("dijit._Contained",null,{getParent:function(){
var _1=dijit.getEnclosingWidget(this.domNode.parentNode);
return _1&&_1.isContainer?_1:null; dojo.declare("dijit._Contained",
},_getSibling:function(_2){ null,
var _3=this.domNode; {
// summary:
// Mixin for widgets that are children of a container widget
//
// example:
// | // make a basic custom widget that knows about it's parents
// | dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
getParent: function(){
// summary:
// Returns the parent widget of this widget, assuming the parent
// specifies isContainer
var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
return parent && parent.isContainer ? parent : null;
},
_getSibling: function(/*String*/ which){
// summary:
// Returns next or previous sibling
// which:
// Either "next" or "previous"
// tags:
// private
var node = this.domNode;
do{ do{
_3=_3[_2+"Sibling"]; node = node[which+"Sibling"];
}while(_3&&_3.nodeType!=1); }while(node && node.nodeType != 1);
return _3&&dijit.byNode(_3); return node && dijit.byNode(node); // dijit._Widget
},getPreviousSibling:function(){ },
return this._getSibling("previous");
},getNextSibling:function(){ getPreviousSibling: function(){
return this._getSibling("next"); // summary:
},getIndexInParent:function(){ // Returns null if this is the first child of the parent,
// otherwise returns the next element sibling to the "left".
return this._getSibling("previous"); // dijit._Widget
},
getNextSibling: function(){
// summary:
// Returns null if this is the last child of the parent,
// otherwise returns the next element sibling to the "right".
return this._getSibling("next"); // dijit._Widget
},
getIndexInParent: function(){
// summary:
// Returns the index of this widget within its container parent.
// It returns -1 if the parent does not exist, or if the parent
// is not a dijit._Container
var p = this.getParent(); var p = this.getParent();
if(!p || !p.getIndexOfChild){ if(!p || !p.getIndexOfChild){
return -1; return -1; // int
} }
return p.getIndexOfChild(this); return p.getIndexOfChild(this); // int
}}); }
}
);
} }

View File

@@ -1,62 +1,144 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._Container"]){ if(!dojo._hasResource["dijit._Container"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._Container"] = true; dojo._hasResource["dijit._Container"] = true;
dojo.provide("dijit._Container"); dojo.provide("dijit._Container");
dojo.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){
dojo.declare("dijit._Container",
null,
{
// summary:
// Mixin for widgets that contain a set of widget children.
// description:
// Use this mixin for widgets that needs to know about and
// keep track of their widget children. Suitable for widgets like BorderContainer
// and TabContainer which contain (only) a set of child widgets.
//
// It's not suitable for widgets like ContentPane
// which contains mixed HTML (plain DOM nodes in addition to widgets),
// and where contained widgets are not necessarily directly below
// this.containerNode. In that case calls like addChild(node, position)
// wouldn't make sense.
// isContainer: [protected] Boolean
// Indicates that this widget acts as a "parent" to the descendant widgets.
// When the parent is started it will call startup() on the child widgets.
// See also `isLayoutContainer`.
isContainer: true,
buildRendering: function(){
this.inherited(arguments); this.inherited(arguments);
if(!this.containerNode){ if(!this.containerNode){
// all widgets with descendants must set containerNode
this.containerNode = this.domNode; this.containerNode = this.domNode;
} }
},addChild:function(_1,_2){ },
var _3=this.containerNode;
if(_2&&typeof _2=="number"){ addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
var _4=this.getChildren(); // summary:
if(_4&&_4.length>=_2){ // Makes the given widget a child of this widget.
_3=_4[_2-1].domNode; // description:
_2="after"; // Inserts specified child widget's dom node as a child of this widget's
// container node, and possibly does other processing (such as layout).
var refNode = this.containerNode;
if(insertIndex && typeof insertIndex == "number"){
var children = this.getChildren();
if(children && children.length >= insertIndex){
refNode = children[insertIndex-1].domNode;
insertIndex = "after";
} }
} }
dojo.place(_1.domNode,_3,_2); dojo.place(widget.domNode, refNode, insertIndex);
if(this._started&&!_1._started){
_1.startup(); // If I've been started but the child widget hasn't been started,
// start it now. Make sure to do this after widget has been
// inserted into the DOM tree, so it can see that it's being controlled by me,
// so it doesn't try to size itself.
if(this._started && !widget._started){
widget.startup();
} }
},removeChild:function(_5){ },
if(typeof _5=="number"&&_5>0){
_5=this.getChildren()[_5]; removeChild: function(/*Widget or int*/ widget){
// summary:
// Removes the passed widget instance from this widget but does
// not destroy it. You can also pass in an integer indicating
// the index within the container to remove
if(typeof widget == "number"){
widget = this.getChildren()[widget];
} }
if(_5){
var _6=_5.domNode; if(widget){
if(_6&&_6.parentNode){ var node = widget.domNode;
_6.parentNode.removeChild(_6); if(node && node.parentNode){
node.parentNode.removeChild(node); // detach but don't destroy
} }
} }
},hasChildren:function(){ },
return this.getChildren().length>0;
},destroyDescendants:function(_7){ hasChildren: function(){
dojo.forEach(this.getChildren(),function(_8){ // summary:
_8.destroyRecursive(_7); // Returns true if widget has children, i.e. if this.containerNode contains something.
}); return this.getChildren().length > 0; // Boolean
},_getSiblingOfChild:function(_9,_a){ },
var _b=_9.domNode,_c=(_a>0?"nextSibling":"previousSibling");
destroyDescendants: function(/*Boolean*/ preserveDom){
// summary:
// Destroys all the widgets inside this.containerNode,
// but not this widget itself
dojo.forEach(this.getChildren(), function(child){ child.destroyRecursive(preserveDom); });
},
_getSiblingOfChild: function(/*dijit._Widget*/ child, /*int*/ dir){
// summary:
// Get the next or previous widget sibling of child
// dir:
// if 1, get the next sibling
// if -1, get the previous sibling
// tags:
// private
var node = child.domNode,
which = (dir>0 ? "nextSibling" : "previousSibling");
do{ do{
_b=_b[_c]; node = node[which];
}while(_b&&(_b.nodeType!=1||!dijit.byNode(_b))); }while(node && (node.nodeType != 1 || !dijit.byNode(node)));
return _b&&dijit.byNode(_b); return node && dijit.byNode(node); // dijit._Widget
},getIndexOfChild:function(_d){ },
return dojo.indexOf(this.getChildren(),_d);
},startup:function(){ getIndexOfChild: function(/*dijit._Widget*/ child){
if(this._started){ // summary:
return; // Gets the index of the child in this container or -1 if not found
} return dojo.indexOf(this.getChildren(), child); // int
dojo.forEach(this.getChildren(),function(_e){ },
_e.startup();
}); startup: function(){
// summary:
// Called after all the widgets have been instantiated and their
// dom nodes have been inserted somewhere under dojo.doc.body.
//
// Widgets should override this method to do any initialization
// dependent on other widgets existing, and then call
// this superclass method to finish things off.
//
// startup() in subclasses shouldn't do anything
// size related because the size of the widget hasn't been set yet.
if(this._started){ return; }
// Startup all children of this widget
dojo.forEach(this.getChildren(), function(child){ child.startup(); });
this.inherited(arguments); this.inherited(arguments);
}}); }
}
);
} }

View File

@@ -1,149 +1,264 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._CssStateMixin"]){ if(!dojo._hasResource["dijit._CssStateMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._CssStateMixin"] = true; dojo._hasResource["dijit._CssStateMixin"] = true;
dojo.provide("dijit._CssStateMixin"); dojo.provide("dijit._CssStateMixin");
dojo.declare("dijit._CssStateMixin",[],{cssStateNodes:{},postCreate:function(){
dojo.declare("dijit._CssStateMixin", [], {
// summary:
// Mixin for widgets to set CSS classes on the widget DOM nodes depending on hover/mouse press/focus
// state changes, and also higher-level state changes such becoming disabled or selected.
//
// description:
// By mixing this class into your widget, and setting the this.baseClass attribute, it will automatically
// maintain CSS classes on the widget root node (this.domNode) depending on hover,
// active, focus, etc. state. Ex: with a baseClass of dijitButton, it will apply the classes
// dijitButtonHovered and dijitButtonActive, as the user moves the mouse over the widget and clicks it.
//
// It also sets CSS like dijitButtonDisabled based on widget semantic state.
//
// By setting the cssStateNodes attribute, a widget can also track events on subnodes (like buttons
// within the widget).
// cssStateNodes: [protected] Object
// List of sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus
//.
// Each entry in the hash is a an attachpoint names (like "upArrowButton") mapped to a CSS class names
// (like "dijitUpArrowButton"). Example:
// | {
// | "upArrowButton": "dijitUpArrowButton",
// | "downArrowButton": "dijitDownArrowButton"
// | }
// The above will set the CSS class dijitUpArrowButton to the this.upArrowButton DOMNode when it
// is hovered, etc.
cssStateNodes: {},
// hovering: [readonly] Boolean
// True if cursor is over this widget
hovering: false,
// active: [readonly] Boolean
// True if mouse was pressed while over this widget, and hasn't been released yet
active: false,
_applyAttributes: function(){
// This code would typically be in postCreate(), but putting in _applyAttributes() for
// performance: so the class changes happen before DOM is inserted into the document.
// Change back to postCreate() in 2.0. See #11635.
this.inherited(arguments); this.inherited(arguments);
// Automatically monitor mouse events (essentially :hover and :active) on this.domNode
dojo.forEach(["onmouseenter", "onmouseleave", "onmousedown"], function(e){ dojo.forEach(["onmouseenter", "onmouseleave", "onmousedown"], function(e){
this.connect(this.domNode, e, "_cssMouseEvent"); this.connect(this.domNode, e, "_cssMouseEvent");
}, this); }, this);
this.connect(this,"set",function(_1,_2){
if(arguments.length>=2&&{disabled:true,readOnly:true,checked:true,selected:true}[_1]){ // Monitoring changes to disabled, readonly, etc. state, and update CSS class of root node
this._setStateClass(); dojo.forEach(["disabled", "readOnly", "checked", "selected", "focused", "state", "hovering", "active"], function(attr){
} this.watch(attr, dojo.hitch(this, "_setStateClass"));
});
dojo.forEach(["_onFocus","_onBlur"],function(ap){
this.connect(this,ap,"_setStateClass");
}, this); }, this);
// Events on sub nodes within the widget
for(var ap in this.cssStateNodes){ for(var ap in this.cssStateNodes){
this._trackMouseState(this[ap], this.cssStateNodes[ap]); this._trackMouseState(this[ap], this.cssStateNodes[ap]);
} }
// Set state initially; there's probably no hover/active/focus state but widget might be
// disabled/readonly/checked/selected so we want to set CSS classes for those conditions.
this._setStateClass(); this._setStateClass();
},_cssMouseEvent:function(_3){ },
_cssMouseEvent: function(/*Event*/ event){
// summary:
// Sets hovering and active properties depending on mouse state,
// which triggers _setStateClass() to set appropriate CSS classes for this.domNode.
if(!this.disabled){ if(!this.disabled){
switch(_3.type){ switch(event.type){
case "mouseenter": case "mouseenter":
case "mouseover": case "mouseover": // generated on non-IE browsers even though we connected to mouseenter
this._hovering=true; this._set("hovering", true);
this._active=this._mouseDown; this._set("active", this._mouseDown);
break; break;
case "mouseleave": case "mouseleave":
case "mouseout": case "mouseout": // generated on non-IE browsers even though we connected to mouseleave
this._hovering=false; this._set("hovering", false);
this._active=false; this._set("active", false);
break; break;
case "mousedown" : case "mousedown" :
this._active=true; this._set("active", true);
this._mouseDown = true; this._mouseDown = true;
var _4=this.connect(dojo.body(),"onmouseup",function(){ // Set a global event to handle mouseup, so it fires properly
this._active=false; // even if the cursor leaves this.domNode before the mouse up event.
// Alternately could set active=false on mouseout.
var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
this._mouseDown = false; this._mouseDown = false;
this._setStateClass(); this._set("active", false);
this.disconnect(_4); this.disconnect(mouseUpConnector);
}); });
break; break;
} }
this._setStateClass();
} }
},_setStateClass:function(){ },
var _5=this.baseClass.split(" ");
function _6(_7){ _setStateClass: function(){
_5=_5.concat(dojo.map(_5,function(c){ // summary:
return c+_7; // Update the visual state of the widget by setting the css classes on this.domNode
}),"dijit"+_7); // (or this.stateNode if defined) by combining this.baseClass with
}; // various suffixes that represent the current widget state(s).
//
// description:
// In the case where a widget has multiple
// states, it sets the class based on all possible
// combinations. For example, an invalid form widget that is being hovered
// will be "dijitInput dijitInputInvalid dijitInputHover dijitInputInvalidHover".
//
// The widget may have one or more of the following states, determined
// by this.state, this.checked, this.valid, and this.selected:
// - Error - ValidationTextBox sets this.state to "Error" if the current input value is invalid
// - Incomplete - ValidationTextBox sets this.state to "Incomplete" if the current input value is not finished yet
// - Checked - ex: a checkmark or a ToggleButton in a checked state, will have this.checked==true
// - Selected - ex: currently selected tab will have this.selected==true
//
// In addition, it may have one or more of the following states,
// based on this.disabled and flags set in _onMouse (this.active, this.hovering) and from focus manager (this.focused):
// - Disabled - if the widget is disabled
// - Active - if the mouse (or space/enter key?) is being pressed down
// - Focused - if the widget has focus
// - Hover - if the mouse is over the widget
// Compute new set of classes
var newStateClasses = this.baseClass.split(" ");
function multiply(modifier){
newStateClasses = newStateClasses.concat(dojo.map(newStateClasses, function(c){ return c+modifier; }), "dijit"+modifier);
}
if(!this.isLeftToRight()){ if(!this.isLeftToRight()){
_6("Rtl"); // For RTL mode we need to set an addition class like dijitTextBoxRtl.
multiply("Rtl");
} }
if(this.checked){ if(this.checked){
_6("Checked"); multiply("Checked");
} }
if(this.state){ if(this.state){
_6(this.state); multiply(this.state);
} }
if(this.selected){ if(this.selected){
_6("Selected"); multiply("Selected");
} }
if(this.disabled){ if(this.disabled){
_6("Disabled"); multiply("Disabled");
}else if(this.readOnly){
multiply("ReadOnly");
}else{ }else{
if(this.readOnly){ if(this.active){
_6("ReadOnly"); multiply("Active");
}else{ }else if(this.hovering){
if(this._active){ multiply("Hover");
_6("Active");
}else{
if(this._hovering){
_6("Hover");
}
}
} }
} }
if(this._focused){ if(this._focused){
_6("Focused"); multiply("Focused");
} }
var tn=this.stateNode||this.domNode,_8={};
dojo.forEach(tn.className.split(" "),function(c){ // Remove old state classes and add new ones.
_8[c]=true; // For performance concerns we only write into domNode.className once.
}); var tn = this.stateNode || this.domNode,
classHash = {}; // set of all classes (state and otherwise) for node
dojo.forEach(tn.className.split(" "), function(c){ classHash[c] = true; });
if("_stateClasses" in this){ if("_stateClasses" in this){
dojo.forEach(this._stateClasses,function(c){ dojo.forEach(this._stateClasses, function(c){ delete classHash[c]; });
delete _8[c];
});
} }
dojo.forEach(_5,function(c){
_8[c]=true; dojo.forEach(newStateClasses, function(c){ classHash[c] = true; });
});
var _9=[]; var newClasses = [];
for(var c in _8){ for(var c in classHash){
_9.push(c); newClasses.push(c);
} }
tn.className=_9.join(" "); tn.className = newClasses.join(" ");
this._stateClasses=_5;
},_trackMouseState:function(_a,_b){ this._stateClasses = newStateClasses;
var _c=false,_d=false,_e=false; },
var _f=this,cn=dojo.hitch(this,"connect",_a);
function _10(){ _trackMouseState: function(/*DomNode*/ node, /*String*/ clazz){
var _11=("disabled" in _f&&_f.disabled)||("readonly" in _f&&_f.readonly); // summary:
dojo.toggleClass(_a,_b+"Hover",_c&&!_d&&!_11); // Track mouse/focus events on specified node and set CSS class on that node to indicate
dojo.toggleClass(_a,_b+"Active",_d&&!_11); // current state. Usually not called directly, but via cssStateNodes attribute.
dojo.toggleClass(_a,_b+"Focused",_e&&!_11); // description:
}; // Given class=foo, will set the following CSS class on the node
// - fooActive: if the user is currently pressing down the mouse button while over the node
// - fooHover: if the user is hovering the mouse over the node, but not pressing down a button
// - fooFocus: if the node is focused
//
// Note that it won't set any classes if the widget is disabled.
// node: DomNode
// Should be a sub-node of the widget, not the top node (this.domNode), since the top node
// is handled specially and automatically just by mixing in this class.
// clazz: String
// CSS class name (ex: dijitSliderUpArrow).
// Current state of node (initially false)
// NB: setting specifically to false because dojo.toggleClass() needs true boolean as third arg
var hovering=false, active=false, focused=false;
var self = this,
cn = dojo.hitch(this, "connect", node);
function setClass(){
var disabled = ("disabled" in self && self.disabled) || ("readonly" in self && self.readonly);
dojo.toggleClass(node, clazz+"Hover", hovering && !active && !disabled);
dojo.toggleClass(node, clazz+"Active", active && !disabled);
dojo.toggleClass(node, clazz+"Focused", focused && !disabled);
}
// Mouse
cn("onmouseenter", function(){ cn("onmouseenter", function(){
_c=true; hovering = true;
_10(); setClass();
}); });
cn("onmouseleave", function(){ cn("onmouseleave", function(){
_c=false; hovering = false;
_d=false; active = false;
_10(); setClass();
}); });
cn("onmousedown", function(){ cn("onmousedown", function(){
_d=true; active = true;
_10(); setClass();
}); });
cn("onmouseup", function(){ cn("onmouseup", function(){
_d=false; active = false;
_10(); setClass();
}); });
// Focus
cn("onfocus", function(){ cn("onfocus", function(){
_e=true; focused = true;
_10(); setClass();
}); });
cn("onblur", function(){ cn("onblur", function(){
_e=false; focused = false;
_10(); setClass();
}); });
this.connect(this,"set",function(_12,_13){
if(_12=="disabled"||_12=="readOnly"){ // Just in case widget is enabled/disabled while it has focus/hover/active state.
_10(); // Maybe this is overkill.
this.watch("disabled", setClass);
this.watch("readOnly", setClass);
} }
}); });
}});
} }

View File

@@ -1,27 +1,80 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._DialogMixin"]){ if(!dojo._hasResource["dijit._DialogMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._DialogMixin"] = true; dojo._hasResource["dijit._DialogMixin"] = true;
dojo.provide("dijit._DialogMixin"); dojo.provide("dijit._DialogMixin");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.declare("dijit._DialogMixin",null,{attributeMap:dijit._Widget.prototype.attributeMap,execute:function(_1){
},onCancel:function(){
},onExecute:function(){ dojo.declare("dijit._DialogMixin", null,
},_onSubmit:function(){ {
this.onExecute(); // summary:
this.execute(this.get("value")); // This provides functions useful to Dialog and TooltipDialog
},_getFocusItems:function(_2){
var _3=dijit._getTabNavigable(dojo.byId(_2)); attributeMap: dijit._Widget.prototype.attributeMap,
this._firstFocusItem=_3.lowest||_3.first||_2;
this._lastFocusItem=_3.last||_3.highest||this._firstFocusItem; execute: function(/*Object*/ formContents){
if(dojo.isMoz&&this._firstFocusItem.tagName.toLowerCase()=="input"&&dojo.getNodeProp(this._firstFocusItem,"type").toLowerCase()=="file"){ // summary:
dojo.attr(_2,"tabIndex","0"); // Callback when the user hits the submit button.
this._firstFocusItem=_2; // Override this method to handle Dialog execution.
// description:
// After the user has pressed the submit button, the Dialog
// first calls onExecute() to notify the container to hide the
// dialog and restore focus to wherever it used to be.
//
// *Then* this method is called.
// type:
// callback
},
onCancel: function(){
// summary:
// Called when user has pressed the Dialog's cancel button, to notify container.
// description:
// Developer shouldn't override or connect to this method;
// it's a private communication device between the TooltipDialog
// and the thing that opened it (ex: `dijit.form.DropDownButton`)
// type:
// protected
},
onExecute: function(){
// summary:
// Called when user has pressed the dialog's OK button, to notify container.
// description:
// Developer shouldn't override or connect to this method;
// it's a private communication device between the TooltipDialog
// and the thing that opened it (ex: `dijit.form.DropDownButton`)
// type:
// protected
},
_onSubmit: function(){
// summary:
// Callback when user hits submit button
// type:
// protected
this.onExecute(); // notify container that we are about to execute
this.execute(this.get('value'));
},
_getFocusItems: function(){
// summary:
// Finds focusable items in dialog,
// and sets this._firstFocusItem and this._lastFocusItem
// tags:
// protected
var elems = dijit._getTabNavigable(this.containerNode);
this._firstFocusItem = elems.lowest || elems.first || this.closeButtonNode || this.domNode;
this._lastFocusItem = elems.last || elems.highest || this._firstFocusItem;
} }
}}); }
);
} }

View File

@@ -1,125 +1,297 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._HasDropDown"]){ if(!dojo._hasResource["dijit._HasDropDown"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._HasDropDown"] = true; dojo._hasResource["dijit._HasDropDown"] = true;
dojo.provide("dijit._HasDropDown"); dojo.provide("dijit._HasDropDown");
dojo.require("dijit._base.place");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(e){
if(this.disabled||this.readOnly){
return; dojo.declare("dijit._HasDropDown",
} null,
{
// summary:
// Mixin for widgets that need drop down ability.
// _buttonNode: [protected] DomNode
// The button/icon/node to click to display the drop down.
// Can be set via a dojoAttachPoint assignment.
// If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
_buttonNode: null,
// _arrowWrapperNode: [protected] DomNode
// Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
// on where the drop down is set to be positioned.
// Can be set via a dojoAttachPoint assignment.
// If missing, then _buttonNode will be used.
_arrowWrapperNode: null,
// _popupStateNode: [protected] DomNode
// The node to set the popupActive class on.
// Can be set via a dojoAttachPoint assignment.
// If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
_popupStateNode: null,
// _aroundNode: [protected] DomNode
// The node to display the popup around.
// Can be set via a dojoAttachPoint assignment.
// If missing, then domNode will be used.
_aroundNode: null,
// dropDown: [protected] Widget
// The widget to display as a popup. This widget *must* be
// defined before the startup function is called.
dropDown: null,
// autoWidth: [protected] Boolean
// Set to true to make the drop down at least as wide as this
// widget. Set to false if the drop down should just be its
// default width
autoWidth: true,
// forceWidth: [protected] Boolean
// Set to true to make the drop down exactly as wide as this
// widget. Overrides autoWidth.
forceWidth: false,
// maxHeight: [protected] Integer
// The max height for our dropdown.
// Any dropdown taller than this will have scrollbars.
// Set to 0 for no max height, or -1 to limit height to available space in viewport
maxHeight: 0,
// dropDownPosition: [const] String[]
// This variable controls the position of the drop down.
// It's an array of strings with the following values:
//
// * before: places drop down to the left of the target node/widget, or to the right in
// the case of RTL scripts like Hebrew and Arabic
// * after: places drop down to the right of the target node/widget, or to the left in
// the case of RTL scripts like Hebrew and Arabic
// * above: drop down goes above target node
// * below: drop down goes below target node
//
// The list is positions is tried, in order, until a position is found where the drop down fits
// within the viewport.
//
dropDownPosition: ["below","above"],
// _stopClickEvents: Boolean
// When set to false, the click events will not be stopped, in
// case you want to use them in your subwidget
_stopClickEvents: true,
_onDropDownMouseDown: function(/*Event*/ e){
// summary:
// Callback when the user mousedown's on the arrow icon
if(this.disabled || this.readOnly){ return; }
dojo.stopEvent(e);
this._docHandler = this.connect(dojo.doc, "onmouseup", "_onDropDownMouseUp"); this._docHandler = this.connect(dojo.doc, "onmouseup", "_onDropDownMouseUp");
this.toggleDropDown(); this.toggleDropDown();
},_onDropDownMouseUp:function(e){ },
_onDropDownMouseUp: function(/*Event?*/ e){
// summary:
// Callback when the user lifts their mouse after mouse down on the arrow icon.
// If the drop is a simple menu and the mouse is over the menu, we execute it, otherwise, we focus our
// dropDown node. If the event is missing, then we are not
// a mouseup event.
//
// This is useful for the common mouse movement pattern
// with native browser <select> nodes:
// 1. mouse down on the select node (probably on the arrow)
// 2. move mouse to a menu item while holding down the mouse button
// 3. mouse up. this selects the menu item as though the user had clicked it.
if(e && this._docHandler){ if(e && this._docHandler){
this.disconnect(this._docHandler); this.disconnect(this._docHandler);
} }
var _1=this.dropDown,_2=false; var dropDown = this.dropDown, overMenu = false;
if(e && this._opened){ if(e && this._opened){
// This code deals with the corner-case when the drop down covers the original widget,
// because it's so large. In that case mouse-up shouldn't select a value from the menu.
// Find out if our target is somewhere in our dropdown widget,
// but not over our _buttonNode (the clickable node)
var c = dojo.position(this._buttonNode, true); var c = dojo.position(this._buttonNode, true);
if(!(e.pageX>=c.x&&e.pageX<=c.x+c.w)||!(e.pageY>=c.y&&e.pageY<=c.y+c.h)){ if(!(e.pageX >= c.x && e.pageX <= c.x + c.w) ||
!(e.pageY >= c.y && e.pageY <= c.y + c.h)){
var t = e.target; var t = e.target;
while(t&&!_2){ while(t && !overMenu){
if(dojo.hasClass(t, "dijitPopup")){ if(dojo.hasClass(t, "dijitPopup")){
_2=true; overMenu = true;
}else{ }else{
t = t.parentNode; t = t.parentNode;
} }
} }
if(_2){ if(overMenu){
t = e.target; t = e.target;
if(_1.onItemClick){ if(dropDown.onItemClick){
var _3; var menuItem;
while(t&&!(_3=dijit.byNode(t))){ while(t && !(menuItem = dijit.byNode(t))){
t = t.parentNode; t = t.parentNode;
} }
if(_3&&_3.onClick&&_3.getParent){ if(menuItem && menuItem.onClick && menuItem.getParent){
_3.getParent().onItemClick(_3,e); menuItem.getParent().onItemClick(menuItem, e);
} }
} }
return; return;
} }
} }
} }
if(this._opened&&_1.focus){ if(this._opened && dropDown.focus && dropDown.autoFocus !== false){
window.setTimeout(dojo.hitch(_1,"focus"),1); // Focus the dropdown widget - do it on a delay so that we
// don't steal our own focus.
window.setTimeout(dojo.hitch(dropDown, "focus"), 1);
} }
},_onDropDownClick:function(e){ },
_onDropDownClick: function(/*Event*/ e){
// the drop down was already opened on mousedown/keydown; just need to call stopEvent()
if(this._stopClickEvents){ if(this._stopClickEvents){
dojo.stopEvent(e); dojo.stopEvent(e);
} }
},_setupDropdown:function(){ },
buildRendering: function(){
this.inherited(arguments);
this._buttonNode = this._buttonNode || this.focusNode || this.domNode; this._buttonNode = this._buttonNode || this.focusNode || this.domNode;
this._popupStateNode = this._popupStateNode || this.focusNode || this._buttonNode; this._popupStateNode = this._popupStateNode || this.focusNode || this._buttonNode;
this._aroundNode=this._aroundNode||this.domNode;
// Add a class to the "dijitDownArrowButton" type class to _buttonNode so theme can set direction of arrow
// based on where drop down will normally appear
var defaultPos = {
"after" : this.isLeftToRight() ? "Right" : "Left",
"before" : this.isLeftToRight() ? "Left" : "Right",
"above" : "Up",
"below" : "Down",
"left" : "Left",
"right" : "Right"
}[this.dropDownPosition[0]] || this.dropDownPosition[0] || "Down";
dojo.addClass(this._arrowWrapperNode || this._buttonNode, "dijit" + defaultPos + "ArrowButton");
},
postCreate: function(){
// summary:
// set up nodes and connect our mouse and keypress events
this.inherited(arguments);
this.connect(this._buttonNode, "onmousedown", "_onDropDownMouseDown"); this.connect(this._buttonNode, "onmousedown", "_onDropDownMouseDown");
this.connect(this._buttonNode, "onclick", "_onDropDownClick"); this.connect(this._buttonNode, "onclick", "_onDropDownClick");
this.connect(this._buttonNode,"onkeydown","_onDropDownKeydown"); this.connect(this.focusNode, "onkeypress", "_onKey");
this.connect(this._buttonNode,"onkeyup","_onKey"); this.connect(this.focusNode, "onkeyup", "_onKeyUp");
if(this._setStateClass){ },
this.connect(this,"openDropDown","_setStateClass");
this.connect(this,"closeDropDown","_setStateClass"); destroy: function(){
}
var _4={"after":this.isLeftToRight()?"Right":"Left","before":this.isLeftToRight()?"Left":"Right","above":"Up","below":"Down","left":"Left","right":"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";
dojo.addClass(this._arrowWrapperNode||this._buttonNode,"dijit"+_4+"ArrowButton");
},postCreate:function(){
this._setupDropdown();
this.inherited(arguments);
},destroyDescendants:function(){
if(this.dropDown){ if(this.dropDown){
// Destroy the drop down, unless it's already been destroyed. This can happen because
// the drop down is a direct child of <body> even though it's logically my child.
if(!this.dropDown._destroyed){ if(!this.dropDown._destroyed){
this.dropDown.destroyRecursive(); this.dropDown.destroyRecursive();
} }
delete this.dropDown; delete this.dropDown;
} }
this.inherited(arguments); this.inherited(arguments);
},_onDropDownKeydown:function(e){ },
if(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE){
e.preventDefault(); _onKey: function(/*Event*/ e){
} // summary:
},_onKey:function(e){ // Callback when the user presses a key while focused on the button node
if(this.disabled||this.readOnly){
return; if(this.disabled || this.readOnly){ return; }
}
var d=this.dropDown; var d = this.dropDown, target = e.target;
if(d && this._opened && d.handleKey){ if(d && this._opened && d.handleKey){
if(d.handleKey(e) === false){ if(d.handleKey(e) === false){
/* false return code means that the drop down handled the key */
dojo.stopEvent(e);
return; return;
} }
} }
if(d&&this._opened&&e.keyCode==dojo.keys.ESCAPE){ if(d && this._opened && e.charOrCode == dojo.keys.ESCAPE){
this.closeDropDown();
dojo.stopEvent(e);
}else if(!this._opened &&
(e.charOrCode == dojo.keys.DOWN_ARROW ||
( (e.charOrCode == dojo.keys.ENTER || e.charOrCode == " ") &&
//ignore enter and space if the event is for a text input
((target.tagName || "").toLowerCase() !== 'input' ||
(target.type && target.type.toLowerCase() !== 'text'))))){
// Toggle the drop down, but wait until keyup so that the drop down doesn't
// get a stray keyup event, or in the case of key-repeat (because user held
// down key for too long), stray keydown events
this._toggleOnKeyUp = true;
dojo.stopEvent(e);
}
},
_onKeyUp: function(){
if(this._toggleOnKeyUp){
delete this._toggleOnKeyUp;
this.toggleDropDown(); this.toggleDropDown();
}else{ var d = this.dropDown; // drop down may not exist until toggleDropDown() call
if(d&&!this._opened&&(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE)){ if(d && d.focus){
this.toggleDropDown();
if(d.focus){
setTimeout(dojo.hitch(d, "focus"), 1); setTimeout(dojo.hitch(d, "focus"), 1);
} }
} }
} },
},_onBlur:function(){
this.closeDropDown(); _onBlur: function(){
// summary:
// Called magically when focus has shifted away from this widget and it's dropdown
// Don't focus on button if the user has explicitly focused on something else (happens
// when user clicks another control causing the current popup to close)..
// But if focus is inside of the drop down then reset focus to me, because IE doesn't like
// it when you display:none a node with focus.
var focusMe = dijit._curFocus && this.dropDown && dojo.isDescendant(dijit._curFocus, this.dropDown.domNode);
this.closeDropDown(focusMe);
this.inherited(arguments); this.inherited(arguments);
},isLoaded:function(){ },
isLoaded: function(){
// summary:
// Returns whether or not the dropdown is loaded. This can
// be overridden in order to force a call to loadDropDown().
// tags:
// protected
return true; return true;
},loadDropDown:function(_5){ },
_5();
},toggleDropDown:function(){ loadDropDown: function(/* Function */ loadCallback){
if(this.disabled||this.readOnly){ // summary:
return; // Loads the data for the dropdown, and at some point, calls
} // the given callback. This is basically a callback when the
this.focus(); // user presses the down arrow button to open the drop down.
var _6=this.dropDown; // tags:
if(!_6){ // protected
return;
} loadCallback();
},
toggleDropDown: function(){
// summary:
// Callback when the user presses the down arrow button or presses
// the down arrow key to open/close the drop down.
// Toggle the drop-down widget; if it is up, close it, if not, open it
// tags:
// protected
if(this.disabled || this.readOnly){ return; }
if(!this._opened){ if(!this._opened){
// If we aren't loaded, load it first so there isn't a flicker
if(!this.isLoaded()){ if(!this.isLoaded()){
this.loadDropDown(dojo.hitch(this, "openDropDown")); this.loadDropDown(dojo.hitch(this, "openDropDown"));
return; return;
@@ -129,80 +301,143 @@ this.openDropDown();
}else{ }else{
this.closeDropDown(); this.closeDropDown();
} }
},openDropDown:function(){ },
var _7=this.dropDown;
var _8=_7.domNode; openDropDown: function(){
var _9=this; // summary:
// Opens the dropdown for this widget. To be called only when this.dropDown
// has been created and is ready to display (ie, it's data is loaded).
// returns:
// return value of dijit.popup.open()
// tags:
// protected
var dropDown = this.dropDown,
ddNode = dropDown.domNode,
aroundNode = this._aroundNode || this.domNode,
self = this;
// Prepare our popup's height and honor maxHeight if it exists.
// TODO: isn't maxHeight dependent on the return value from dijit.popup.open(),
// ie, dependent on how much space is available (BK)
if(!this._preparedNode){ if(!this._preparedNode){
dijit.popup.moveOffScreen(_8);
this._preparedNode = true; this._preparedNode = true;
if(_8.style.width){ // Check if we have explicitly set width and height on the dropdown widget dom node
if(ddNode.style.width){
this._explicitDDWidth = true; this._explicitDDWidth = true;
} }
if(_8.style.height){ if(ddNode.style.height){
this._explicitDDHeight = true; this._explicitDDHeight = true;
} }
} }
// Code for resizing dropdown (height limitation, or increasing width to match my width)
if(this.maxHeight || this.forceWidth || this.autoWidth){ if(this.maxHeight || this.forceWidth || this.autoWidth){
var _a={display:"",visibility:"hidden"}; var myStyle = {
display: "",
visibility: "hidden"
};
if(!this._explicitDDWidth){ if(!this._explicitDDWidth){
_a.width=""; myStyle.width = "";
} }
if(!this._explicitDDHeight){ if(!this._explicitDDHeight){
_a.height=""; myStyle.height = "";
} }
dojo.style(_8,_a); dojo.style(ddNode, myStyle);
var mb=dojo.marginBox(_8);
var _b=(this.maxHeight&&mb.h>this.maxHeight); // Figure out maximum height allowed (if there is a height restriction)
dojo.style(_8,{overflowX:"hidden",overflowY:_b?"auto":"hidden"}); var maxHeight = this.maxHeight;
if(_b){ if(maxHeight == -1){
mb.h=this.maxHeight; // limit height to space available in viewport either above or below my domNode
// (whichever side has more room)
var viewport = dojo.window.getBox(),
position = dojo.position(aroundNode, false);
maxHeight = Math.floor(Math.max(position.y, viewport.h - (position.y + position.h)));
}
// Attach dropDown to DOM and make make visibility:hidden rather than display:none
// so we call startup() and also get the size
if(dropDown.startup && !dropDown._started){
dropDown.startup();
}
dijit.popup.moveOffScreen(dropDown);
// Get size of drop down, and determine if vertical scroll bar needed
var mb = dojo._getMarginSize(ddNode);
var overHeight = (maxHeight && mb.h > maxHeight);
dojo.style(ddNode, {
overflowX: "hidden",
overflowY: overHeight ? "auto" : "hidden"
});
if(overHeight){
mb.h = maxHeight;
if("w" in mb){ if("w" in mb){
mb.w+=16; mb.w += 16; // room for vertical scrollbar
} }
}else{ }else{
delete mb.h; delete mb.h;
} }
delete mb.t;
delete mb.l; // Adjust dropdown width to match or be larger than my width
if(this.forceWidth){ if(this.forceWidth){
mb.w=this.domNode.offsetWidth; mb.w = aroundNode.offsetWidth;
}else{ }else if(this.autoWidth){
if(this.autoWidth){ mb.w = Math.max(mb.w, aroundNode.offsetWidth);
mb.w=Math.max(mb.w,this.domNode.offsetWidth);
}else{ }else{
delete mb.w; delete mb.w;
} }
}
if(dojo.isFunction(_7.resize)){ // And finally, resize the dropdown to calculated height and width
_7.resize(mb); if(dojo.isFunction(dropDown.resize)){
dropDown.resize(mb);
}else{ }else{
dojo.marginBox(_8,mb); dojo.marginBox(ddNode, mb);
} }
} }
var _c=dijit.popup.open({parent:this,popup:_7,around:this._aroundNode,orient:dijit.getPopupAroundAlignment((this.dropDownPosition&&this.dropDownPosition.length)?this.dropDownPosition:["below"],this.isLeftToRight()),onExecute:function(){
_9.closeDropDown(true); var retVal = dijit.popup.open({
},onCancel:function(){ parent: this,
_9.closeDropDown(true); popup: dropDown,
},onClose:function(){ around: aroundNode,
dojo.attr(_9._popupStateNode,"popupActive",false); orient: dijit.getPopupAroundAlignment((this.dropDownPosition && this.dropDownPosition.length) ? this.dropDownPosition : ["below"],this.isLeftToRight()),
dojo.removeClass(_9._popupStateNode,"dijitHasDropDownOpen"); onExecute: function(){
_9._opened=false; self.closeDropDown(true);
_9.state=""; },
}}); onCancel: function(){
self.closeDropDown(true);
},
onClose: function(){
dojo.attr(self._popupStateNode, "popupActive", false);
dojo.removeClass(self._popupStateNode, "dijitHasDropDownOpen");
self._opened = false;
}
});
dojo.attr(this._popupStateNode, "popupActive", "true"); dojo.attr(this._popupStateNode, "popupActive", "true");
dojo.addClass(_9._popupStateNode,"dijitHasDropDownOpen"); dojo.addClass(self._popupStateNode, "dijitHasDropDownOpen");
this._opened=true; this._opened=true;
this.state="Opened";
return _c; // TODO: set this.checked and call setStateClass(), to affect button look while drop down is shown
},closeDropDown:function(_d){ return retVal;
},
closeDropDown: function(/*Boolean*/ focus){
// summary:
// Closes the drop down on this widget
// focus:
// If true, refocuses the button widget
// tags:
// protected
if(this._opened){ if(this._opened){
if(_d){ if(focus){ this.focus(); }
this.focus();
}
dijit.popup.close(this.dropDown); dijit.popup.close(this.dropDown);
this._opened = false; this._opened = false;
this.state="";
} }
}}); }
}
);
} }

View File

@@ -1,95 +1,261 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._KeyNavContainer"]){ if(!dojo._hasResource["dijit._KeyNavContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._KeyNavContainer"] = true; dojo._hasResource["dijit._KeyNavContainer"] = true;
dojo.provide("dijit._KeyNavContainer"); dojo.provide("dijit._KeyNavContainer");
dojo.require("dijit._Container"); dojo.require("dijit._Container");
dojo.declare("dijit._KeyNavContainer",dijit._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(_1,_2){
var _3=(this._keyNavCodes={});
var _4=dojo.hitch(this,this.focusPrev); dojo.declare("dijit._KeyNavContainer",
var _5=dojo.hitch(this,this.focusNext); dijit._Container,
dojo.forEach(_1,function(_6){ {
_3[_6]=_4;
}); // summary:
dojo.forEach(_2,function(_7){ // A _Container with keyboard navigation of its children.
_3[_7]=_5; // description:
}); // To use this mixin, call connectKeyNavHandlers() in
// postCreate() and call startupKeyNavChildren() in startup().
// It provides normalized keyboard and focusing code for Container
// widgets.
/*=====
// focusedChild: [protected] Widget
// The currently focused child widget, or null if there isn't one
focusedChild: null,
=====*/
// tabIndex: Integer
// Tab index of the container; same as HTML tabIndex attribute.
// Note then when user tabs into the container, focus is immediately
// moved to the first item in the container.
tabIndex: "0",
_keyNavCodes: {},
connectKeyNavHandlers: function(/*dojo.keys[]*/ prevKeyCodes, /*dojo.keys[]*/ nextKeyCodes){
// summary:
// Call in postCreate() to attach the keyboard handlers
// to the container.
// preKeyCodes: dojo.keys[]
// Key codes for navigating to the previous child.
// nextKeyCodes: dojo.keys[]
// Key codes for navigating to the next child.
// tags:
// protected
var keyCodes = (this._keyNavCodes = {});
var prev = dojo.hitch(this, this.focusPrev);
var next = dojo.hitch(this, this.focusNext);
dojo.forEach(prevKeyCodes, function(code){ keyCodes[code] = prev; });
dojo.forEach(nextKeyCodes, function(code){ keyCodes[code] = next; });
keyCodes[dojo.keys.HOME] = dojo.hitch(this, "focusFirstChild");
keyCodes[dojo.keys.END] = dojo.hitch(this, "focusLastChild");
this.connect(this.domNode, "onkeypress", "_onContainerKeypress"); this.connect(this.domNode, "onkeypress", "_onContainerKeypress");
this.connect(this.domNode, "onfocus", "_onContainerFocus"); this.connect(this.domNode, "onfocus", "_onContainerFocus");
},startupKeyNavChildren:function(){ },
startupKeyNavChildren: function(){
// summary:
// Call in startup() to set child tabindexes to -1
// tags:
// protected
dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild")); dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild"));
},addChild:function(_8,_9){ },
addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
// summary:
// Add a child to our _Container
dijit._KeyNavContainer.superclass.addChild.apply(this, arguments); dijit._KeyNavContainer.superclass.addChild.apply(this, arguments);
this._startupChild(_8); this._startupChild(widget);
},focus:function(){ },
focus: function(){
// summary:
// Default focus() implementation: focus the first child.
this.focusFirstChild(); this.focusFirstChild();
},focusFirstChild:function(){ },
var _a=this._getFirstFocusableChild();
if(_a){ focusFirstChild: function(){
this.focusChild(_a); // summary:
// Focus the first focusable child in the container.
// tags:
// protected
var child = this._getFirstFocusableChild();
if(child){ // edge case: Menu could be empty or hidden
this.focusChild(child);
} }
},focusNext:function(){ },
var _b=this._getNextFocusableChild(this.focusedChild,1);
this.focusChild(_b); focusLastChild: function(){
},focusPrev:function(){ // summary:
var _c=this._getNextFocusableChild(this.focusedChild,-1); // Focus the last focusable child in the container.
this.focusChild(_c,true); // tags:
},focusChild:function(_d,_e){ // protected
if(this.focusedChild&&_d!==this.focusedChild){ var child = this._getLastFocusableChild();
if(child){ // edge case: Menu could be empty or hidden
this.focusChild(child);
}
},
focusNext: function(){
// summary:
// Focus the next widget
// tags:
// protected
var child = this._getNextFocusableChild(this.focusedChild, 1);
this.focusChild(child);
},
focusPrev: function(){
// summary:
// Focus the last focusable node in the previous widget
// (ex: go to the ComboButton icon section rather than button section)
// tags:
// protected
var child = this._getNextFocusableChild(this.focusedChild, -1);
this.focusChild(child, true);
},
focusChild: function(/*dijit._Widget*/ widget, /*Boolean*/ last){
// summary:
// Focus widget.
// widget:
// Reference to container's child widget
// last:
// If true and if widget has multiple focusable nodes, focus the
// last one instead of the first one
// tags:
// protected
if(this.focusedChild && widget !== this.focusedChild){
this._onChildBlur(this.focusedChild); this._onChildBlur(this.focusedChild);
} }
_d.focus(_e?"end":"start"); widget.set("tabIndex", this.tabIndex); // for IE focus outline to appear, must set tabIndex before focs
this.focusedChild=_d; widget.focus(last ? "end" : "start");
},_startupChild:function(_f){ this._set("focusedChild", widget);
_f.set("tabIndex","-1"); },
this.connect(_f,"_onFocus",function(){
_f.set("tabIndex",this.tabIndex); _startupChild: function(/*dijit._Widget*/ widget){
// summary:
// Setup for each child widget
// description:
// Sets tabIndex=-1 on each child, so that the tab key will
// leave the container rather than visiting each child.
// tags:
// private
widget.set("tabIndex", "-1");
this.connect(widget, "_onFocus", function(){
// Set valid tabIndex so tabbing away from widget goes to right place, see #10272
widget.set("tabIndex", this.tabIndex);
}); });
this.connect(_f,"_onBlur",function(){ this.connect(widget, "_onBlur", function(){
_f.set("tabIndex","-1"); widget.set("tabIndex", "-1");
}); });
},_onContainerFocus:function(evt){ },
if(evt.target!==this.domNode){
return; _onContainerFocus: function(evt){
} // summary:
// Handler for when the container gets focus
// description:
// Initially the container itself has a tabIndex, but when it gets
// focus, switch focus to first child...
// tags:
// private
// Note that we can't use _onFocus() because switching focus from the
// _onFocus() handler confuses the focus.js code
// (because it causes _onFocusNode() to be called recursively)
// focus bubbles on Firefox,
// so just make sure that focus has really gone to the container
if(evt.target !== this.domNode){ return; }
this.focusFirstChild(); this.focusFirstChild();
// and then set the container's tabIndex to -1,
// (don't remove as that breaks Safari 4)
// so that tab or shift-tab will go to the fields after/before
// the container, rather than the container itself
dojo.attr(this.domNode, "tabIndex", "-1"); dojo.attr(this.domNode, "tabIndex", "-1");
},_onBlur:function(evt){ },
_onBlur: function(evt){
// When focus is moved away the container, and its descendant (popup) widgets,
// then restore the container's tabIndex so that user can tab to it again.
// Note that using _onBlur() so that this doesn't happen when focus is shifted
// to one of my child widgets (typically a popup)
if(this.tabIndex){ if(this.tabIndex){
dojo.attr(this.domNode, "tabIndex", this.tabIndex); dojo.attr(this.domNode, "tabIndex", this.tabIndex);
} }
this.inherited(arguments); this.inherited(arguments);
},_onContainerKeypress:function(evt){ },
if(evt.ctrlKey||evt.altKey){
return; _onContainerKeypress: function(evt){
} // summary:
var _10=this._keyNavCodes[evt.charOrCode]; // When a key is pressed, if it's an arrow key etc. then
if(_10){ // it's handled here.
_10(); // tags:
// private
if(evt.ctrlKey || evt.altKey){ return; }
var func = this._keyNavCodes[evt.charOrCode];
if(func){
func();
dojo.stopEvent(evt); dojo.stopEvent(evt);
} }
},_onChildBlur:function(_11){ },
},_getFirstFocusableChild:function(){
return this._getNextFocusableChild(null,1); _onChildBlur: function(/*dijit._Widget*/ widget){
},_getNextFocusableChild:function(_12,dir){ // summary:
if(_12){ // Called when focus leaves a child widget to go
_12=this._getSiblingOfChild(_12,dir); // to a sibling widget.
// tags:
// protected
},
_getFirstFocusableChild: function(){
// summary:
// Returns first child that can be focused
return this._getNextFocusableChild(null, 1); // dijit._Widget
},
_getLastFocusableChild: function(){
// summary:
// Returns last child that can be focused
return this._getNextFocusableChild(null, -1); // dijit._Widget
},
_getNextFocusableChild: function(child, dir){
// summary:
// Returns the next or previous focusable child, compared
// to "child"
// child: Widget
// The current widget
// dir: Integer
// * 1 = after
// * -1 = before
if(child){
child = this._getSiblingOfChild(child, dir);
} }
var _13=this.getChildren(); var children = this.getChildren();
for(var i=0;i<_13.length;i++){ for(var i=0; i < children.length; i++){
if(!_12){ if(!child){
_12=_13[(dir>0)?0:(_13.length-1)]; child = children[(dir>0) ? 0 : (children.length-1)];
} }
if(_12.isFocusable()){ if(child.isFocusable()){
return _12; return child; // dijit._Widget
} }
_12=this._getSiblingOfChild(_12,dir); child = this._getSiblingOfChild(child, dir);
} }
return null; // no focusable child found
}}); return null; // dijit._Widget
}
}
);
} }

View File

@@ -1,98 +1,326 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._PaletteMixin"]){ if(!dojo._hasResource["dijit._PaletteMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._PaletteMixin"] = true; dojo._hasResource["dijit._PaletteMixin"] = true;
dojo.provide("dijit._PaletteMixin"); dojo.provide("dijit._PaletteMixin");
dojo.require("dijit._CssStateMixin"); dojo.require("dijit._CssStateMixin");
dojo.declare("dijit._PaletteMixin",[dijit._CssStateMixin],{defaultTimeout:500,timeoutChangeRate:0.9,value:null,_selectedCell:-1,tabIndex:"0",cellClass:"dijitPaletteCell",dyeClass:"",_preparePalette:function(_1,_2){
dojo.declare("dijit._PaletteMixin",
[dijit._CssStateMixin],
{
// summary:
// A keyboard accessible palette, for picking a color/emoticon/etc.
// description:
// A mixin for a grid showing various entities, so the user can pick a certain entity.
// defaultTimeout: Number
// Number of milliseconds before a held key or button becomes typematic
defaultTimeout: 500,
// timeoutChangeRate: Number
// Fraction of time used to change the typematic timer between events
// 1.0 means that each typematic event fires at defaultTimeout intervals
// < 1.0 means that each typematic event fires at an increasing faster rate
timeoutChangeRate: 0.90,
// value: String
// Currently selected color/emoticon/etc.
value: null,
// _selectedCell: [private] Integer
// Index of the currently selected cell. Initially, none selected
_selectedCell: -1,
/*=====
// _currentFocus: [private] DomNode
// The currently focused cell (if the palette itself has focus), or otherwise
// the cell to be focused when the palette itself gets focus.
// Different from value, which represents the selected (i.e. clicked) cell.
_currentFocus: null,
=====*/
/*=====
// _xDim: [protected] Integer
// This is the number of cells horizontally across.
_xDim: null,
=====*/
/*=====
// _yDim: [protected] Integer
// This is the number of cells vertically down.
_yDim: null,
=====*/
// tabIndex: String
// Widget tab index.
tabIndex: "0",
// cellClass: [protected] String
// CSS class applied to each cell in the palette
cellClass: "dijitPaletteCell",
// dyeClass: [protected] String
// Name of javascript class for Object created for each cell of the palette.
// dyeClass should implements dijit.Dye interface
dyeClass: '',
_preparePalette: function(choices, titles, dyeClassObj) {
// summary:
// Subclass must call _preparePalette() from postCreate(), passing in the tooltip
// for each cell
// choices: String[][]
// id's for each cell of the palette, used to create Dye JS object for each cell
// titles: String[]
// Localized tooltip for each cell
// dyeClassObj: Constructor?
// If specified, use this constructor rather than this.dyeClass
this._cells = []; this._cells = [];
var _3=this._blankGif; var url = this._blankGif;
var _4=dojo.getObject(this.dyeClass);
for(var _5=0;_5<_1.length;_5++){ dyeClassObj = dyeClassObj || dojo.getObject(this.dyeClass);
var _6=dojo.create("tr",{tabIndex:"-1"},this.gridNode);
for(var _7=0;_7<_1[_5].length;_7++){ for(var row=0; row < choices.length; row++){
var _8=_1[_5][_7]; var rowNode = dojo.create("tr", {tabIndex: "-1"}, this.gridNode);
if(_8){ for(var col=0; col < choices[row].length; col++){
var _9=new _4(_8); var value = choices[row][col];
var _a=dojo.create("td",{"class":this.cellClass,tabIndex:"-1",title:_2[_8]}); if(value){
_9.fillCell(_a,_3); var cellObject = new dyeClassObj(value, row, col);
this.connect(_a,"ondijitclick","_onCellClick");
this._trackMouseState(_a,this.cellClass); var cellNode = dojo.create("td", {
dojo.place(_a,_6); "class": this.cellClass,
_a.index=this._cells.length; tabIndex: "-1",
this._cells.push({node:_a,dye:_9}); title: titles[value]
});
// prepare cell inner structure
cellObject.fillCell(cellNode, url);
this.connect(cellNode, "ondijitclick", "_onCellClick");
this._trackMouseState(cellNode, this.cellClass);
dojo.place(cellNode, rowNode);
cellNode.index = this._cells.length;
// save cell info into _cells
this._cells.push({node:cellNode, dye:cellObject});
} }
} }
} }
this._xDim=_1[0].length; this._xDim = choices[0].length;
this._yDim=_1.length; this._yDim = choices.length;
var _b={UP_ARROW:-this._xDim,DOWN_ARROW:this._xDim,RIGHT_ARROW:this.isLeftToRight()?1:-1,LEFT_ARROW:this.isLeftToRight()?-1:1};
for(var _c in _b){ // Now set all events
this._connects.push(dijit.typematic.addKeyListener(this.domNode,{charOrCode:dojo.keys[_c],ctrlKey:false,altKey:false,shiftKey:false},this,function(){ // The palette itself is navigated to with the tab key on the keyboard
var _d=_b[_c]; // Keyboard navigation within the Palette is with the arrow keys
return function(_e){ // Spacebar selects the cell.
this._navigateByKey(_d,_e); // For the up key the index is changed by negative the x dimension.
var keyIncrementMap = {
UP_ARROW: -this._xDim,
// The down key the index is increase by the x dimension.
DOWN_ARROW: this._xDim,
// Right and left move the index by 1.
RIGHT_ARROW: this.isLeftToRight() ? 1 : -1,
LEFT_ARROW: this.isLeftToRight() ? -1 : 1
}; };
}(),this.timeoutChangeRate,this.defaultTimeout)); for(var key in keyIncrementMap){
this._connects.push(
dijit.typematic.addKeyListener(
this.domNode,
{charOrCode:dojo.keys[key], ctrlKey:false, altKey:false, shiftKey:false},
this,
function(){
var increment = keyIncrementMap[key];
return function(count){ this._navigateByKey(increment, count); };
}(),
this.timeoutChangeRate,
this.defaultTimeout
)
);
} }
},postCreate:function(){ },
postCreate: function(){
this.inherited(arguments); this.inherited(arguments);
// Set initial navigable node.
this._setCurrent(this._cells[0].node); this._setCurrent(this._cells[0].node);
},focus:function(){ },
focus: function(){
// summary:
// Focus this widget. Puts focus on the most recently focused cell.
// The cell already has tabIndex set, just need to set CSS and focus it
dijit.focus(this._currentFocus); dijit.focus(this._currentFocus);
},_onCellClick:function(_f){ },
var _10=_f.currentTarget,_11=this._getDye(_10).getValue();
this._setCurrent(_10); _onCellClick: function(/*Event*/ evt){
// summary:
// Handler for click, enter key & space key. Selects the cell.
// evt:
// The event.
// tags:
// private
var target = evt.currentTarget,
value = this._getDye(target).getValue();
// First focus the clicked cell, and then send onChange() notification.
// onChange() (via _setValueAttr) must be after the focus call, because
// it may trigger a refocus to somewhere else (like the Editor content area), and that
// second focus should win.
// Use setTimeout because IE doesn't like changing focus inside of an event handler.
this._setCurrent(target);
setTimeout(dojo.hitch(this, function(){ setTimeout(dojo.hitch(this, function(){
dijit.focus(_10); dijit.focus(target);
this._setValueAttr(_11,true); this._setValueAttr(value, true);
})); }));
dojo.removeClass(_10,"dijitPaletteCellHover");
dojo.stopEvent(_f); // workaround bug where hover class is not removed on popup because the popup is
},_setCurrent:function(_12){ // closed and then there's no onblur event on the cell
dojo.removeClass(target, "dijitPaletteCellHover");
dojo.stopEvent(evt);
},
_setCurrent: function(/*DomNode*/ node){
// summary:
// Sets which node is the focused cell.
// description:
// At any point in time there's exactly one
// cell with tabIndex != -1. If focus is inside the palette then
// focus is on that cell.
//
// After calling this method, arrow key handlers and mouse click handlers
// should focus the cell in a setTimeout().
// tags:
// protected
if("_currentFocus" in this){ if("_currentFocus" in this){
// Remove tabIndex on old cell
dojo.attr(this._currentFocus, "tabIndex", "-1"); dojo.attr(this._currentFocus, "tabIndex", "-1");
} }
this._currentFocus=_12;
if(_12){ // Set tabIndex of new cell
dojo.attr(_12,"tabIndex",this.tabIndex); this._currentFocus = node;
if(node){
dojo.attr(node, "tabIndex", this.tabIndex);
} }
},_setValueAttr:function(_13,_14){ },
this.value=null;
_setValueAttr: function(value, priorityChange){
// summary:
// This selects a cell. It triggers the onChange event.
// value: String value of the cell to select
// tags:
// protected
// priorityChange:
// Optional parameter used to tell the select whether or not to fire
// onChange event.
// clear old selected cell
if(this._selectedCell >= 0){ if(this._selectedCell >= 0){
dojo.removeClass(this._cells[this._selectedCell].node, "dijitPaletteCellSelected"); dojo.removeClass(this._cells[this._selectedCell].node, "dijitPaletteCellSelected");
} }
this._selectedCell = -1; this._selectedCell = -1;
if(_13){
// search for cell matching specified value
if(value){
for(var i = 0; i < this._cells.length; i++){ for(var i = 0; i < this._cells.length; i++){
if(_13==this._cells[i].dye.getValue()){ if(value == this._cells[i].dye.getValue()){
this._selectedCell = i; this._selectedCell = i;
this.value=_13;
dojo.addClass(this._cells[i].node, "dijitPaletteCellSelected"); dojo.addClass(this._cells[i].node, "dijitPaletteCellSelected");
if(_14||_14===undefined){
this.onChange(_13);
}
break; break;
} }
} }
} }
},onChange:function(_15){
},_navigateByKey:function(_16,_17){ // record new value, or null if no matching cell
if(_17==-1){ this._set("value", this._selectedCell >= 0 ? value : null);
return;
if(priorityChange || priorityChange === undefined){
this.onChange(value);
} }
var _18=this._currentFocus.index+_16; },
if(_18<this._cells.length&&_18>-1){
var _19=this._cells[_18].node; onChange: function(value){
this._setCurrent(_19); // summary:
setTimeout(dojo.hitch(dijit,"focus",_19),0); // Callback when a cell is selected.
// value: String
// Value corresponding to cell.
},
_navigateByKey: function(increment, typeCount){
// summary:
// This is the callback for typematic.
// It changes the focus and the highlighed cell.
// increment:
// How much the key is navigated.
// typeCount:
// How many times typematic has fired.
// tags:
// private
// typecount == -1 means the key is released.
if(typeCount == -1){ return; }
var newFocusIndex = this._currentFocus.index + increment;
if(newFocusIndex < this._cells.length && newFocusIndex > -1){
var focusNode = this._cells[newFocusIndex].node;
this._setCurrent(focusNode);
// Actually focus the node, for the benefit of screen readers.
// Use setTimeout because IE doesn't like changing focus inside of an event handler
setTimeout(dojo.hitch(dijit, "focus", focusNode), 0);
} }
},_getDye:function(_1a){ },
return this._cells[_1a.index].dye;
}}); _getDye: function(/*DomNode*/ cell){
// summary:
// Get JS object for given cell DOMNode
return this._cells[cell.index].dye;
}
});
/*=====
dojo.declare("dijit.Dye",
null,
{
// summary:
// Interface for the JS Object associated with a palette cell (i.e. DOMNode)
constructor: function(alias, row, col){
// summary:
// Initialize according to value or alias like "white"
// alias: String
},
getValue: function(){
// summary:
// Return "value" of cell; meaning of "value" varies by subclass.
// description:
// For example color hex value, emoticon ascii value etc, entity hex value.
},
fillCell: function(cell, blankGif){
// summary:
// Add cell DOMNode inner structure
// cell: DomNode
// The surrounding cell
// blankGif: String
// URL for blank cell image
}
}
);
=====*/
} }

View File

@@ -1,184 +1,351 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._Templated"]){ if(!dojo._hasResource["dijit._Templated"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._Templated"] = true; dojo._hasResource["dijit._Templated"] = true;
dojo.provide("dijit._Templated"); dojo.provide("dijit._Templated");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dojo.string"); dojo.require("dojo.string");
dojo.require("dojo.parser"); dojo.require("dojo.parser");
dojo.require("dojo.cache"); dojo.require("dojo.cache");
dojo.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){
dojo.declare("dijit._Templated",
null,
{
// summary:
// Mixin for widgets that are instantiated from a template
// templateString: [protected] String
// A string that represents the widget template. Pre-empts the
// templatePath. In builds that have their strings "interned", the
// templatePath is converted to an inline templateString, thereby
// preventing a synchronous network call.
//
// Use in conjunction with dojo.cache() to load from a file.
templateString: null,
// templatePath: [protected deprecated] String
// Path to template (HTML file) for this widget relative to dojo.baseUrl.
// Deprecated: use templateString with dojo.cache() instead.
templatePath: null,
// widgetsInTemplate: [protected] Boolean
// Should we parse the template to find widgets that might be
// declared in markup inside it? False by default.
widgetsInTemplate: false,
// skipNodeCache: [protected] Boolean
// If using a cached widget template node poses issues for a
// particular widget class, it can set this property to ensure
// that its template is always re-built from a string
_skipNodeCache: false,
// _earlyTemplatedStartup: Boolean
// A fallback to preserve the 1.0 - 1.3 behavior of children in
// templates having their startup called before the parent widget
// fires postCreate. Defaults to 'false', causing child widgets to
// have their .startup() called immediately before a parent widget
// .startup(), but always after the parent .postCreate(). Set to
// 'true' to re-enable to previous, arguably broken, behavior.
_earlyTemplatedStartup: false,
/*=====
// _attachPoints: [private] String[]
// List of widget attribute names associated with dojoAttachPoint=... in the
// template, ex: ["containerNode", "labelNode"]
_attachPoints: [],
=====*/
/*=====
// _attachEvents: [private] Handle[]
// List of connections associated with dojoAttachEvent=... in the
// template
_attachEvents: [],
=====*/
constructor: function(){
this._attachPoints = []; this._attachPoints = [];
},_stringRepl:function(_1){ this._attachEvents = [];
var _2=this.declaredClass,_3=this; },
return dojo.string.substitute(_1,this,function(_4,_5){
if(_5.charAt(0)=="!"){ _stringRepl: function(tmpl){
_4=dojo.getObject(_5.substr(1),false,_3); // summary:
} // Does substitution of ${foo} type properties in template string
if(typeof _4=="undefined"){ // tags:
throw new Error(_2+" template:"+_5); // private
} var className = this.declaredClass, _this = this;
if(_4==null){ // Cache contains a string because we need to do property replacement
return ""; // do the property replacement
} return dojo.string.substitute(tmpl, this, function(value, key){
return _5.charAt(0)=="!"?_4:_4.toString().replace(/"/g,"&quot;"); if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
if(value == null){ return ""; }
// Substitution keys beginning with ! will skip the transform step,
// in case a user wishes to insert unescaped markup, e.g. ${!foo}
return key.charAt(0) == "!" ? value :
// Safer substitution, see heading "Attribute values" in
// http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
}, this); }, this);
},buildRendering:function(){ },
var _6=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);
var _7; buildRendering: function(){
if(dojo.isString(_6)){ // summary:
_7=dojo._toDom(this._stringRepl(_6)); // Construct the UI for this widget from a template, setting this.domNode.
if(_7.nodeType!=1){ // tags:
throw new Error("Invalid template: "+_6); // protected
// Lookup cached version of template, and download to cache if it
// isn't there already. Returns either a DomNode or a string, depending on
// whether or not the template contains ${foo} replacement parameters.
var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
var node;
if(dojo.isString(cached)){
node = dojo._toDom(this._stringRepl(cached));
if(node.nodeType != 1){
// Flag common problems such as templates with multiple top level nodes (nodeType == 11)
throw new Error("Invalid template: " + cached);
} }
}else{ }else{
_7=_6.cloneNode(true); // if it's a node, all we have to do is clone it
node = cached.cloneNode(true);
} }
this.domNode=_7;
this._attachTemplateNodes(_7); this.domNode = node;
// Call down to _Widget.buildRendering() to get base classes assigned
// TODO: change the baseClass assignment to attributeMap
this.inherited(arguments);
// recurse through the node, looking for, and attaching to, our
// attachment points and events, which should be defined on the template node.
this._attachTemplateNodes(node);
if(this.widgetsInTemplate){ if(this.widgetsInTemplate){
var _8=dojo.parser,_9,_a; // Store widgets that we need to start at a later point in time
if(_8._query!="[dojoType]"){ var cw = (this._startupWidgets = dojo.parser.parse(node, {
_9=_8._query; noStart: !this._earlyTemplatedStartup,
_a=_8._attrName; template: true,
_8._query="[dojoType]"; inherited: {dir: this.dir, lang: this.lang},
_8._attrName="dojoType"; propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me
} scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type
var cw=(this._startupWidgets=dojo.parser.parse(_7,{noStart:!this._earlyTemplatedStartup,inherited:{dir:this.dir,lang:this.lang}})); }));
if(_9){
_8._query=_9; this._supportingWidgets = dijit.findWidgets(node);
_8._attrName=_a;
}
this._supportingWidgets=dijit.findWidgets(_7);
this._attachTemplateNodes(cw, function(n,p){ this._attachTemplateNodes(cw, function(n,p){
return n[p]; return n[p];
}); });
} }
this._fillContent(this.srcNodeRef); this._fillContent(this.srcNodeRef);
},_fillContent:function(_b){ },
var _c=this.containerNode;
if(_b&&_c){ _fillContent: function(/*DomNode*/ source){
while(_b.hasChildNodes()){ // summary:
_c.appendChild(_b.firstChild); // Relocate source contents to templated container node.
// this.containerNode must be able to receive children, or exceptions will be thrown.
// tags:
// protected
var dest = this.containerNode;
if(source && dest){
while(source.hasChildNodes()){
dest.appendChild(source.firstChild);
} }
} }
},_attachTemplateNodes:function(_d,_e){ },
_e=_e||function(n,p){
return n.getAttribute(p); _attachTemplateNodes: function(rootNode, getAttrFunc){
}; // summary:
var _f=dojo.isArray(_d)?_d:(_d.all||_d.getElementsByTagName("*")); // Iterate through the template and attach functions and nodes accordingly.
var x=dojo.isArray(_d)?0:-1; // Alternately, if rootNode is an array of widgets, then will process dojoAttachPoint
for(;x<_f.length;x++){ // etc. for those widgets.
var _10=(x==-1)?_d:_f[x]; // description:
if(this.widgetsInTemplate&&_e(_10,"dojoType")){ // Map widget properties and functions to the handlers specified in
// the dom node and it's descendants. This function iterates over all
// nodes and looks for these properties:
// * dojoAttachPoint
// * dojoAttachEvent
// * waiRole
// * waiState
// rootNode: DomNode|Array[Widgets]
// the node to search for properties. All children will be searched.
// getAttrFunc: Function?
// a function which will be used to obtain property for a given
// DomNode/Widget
// tags:
// private
getAttrFunc = getAttrFunc || function(n,p){ return n.getAttribute(p); };
var nodes = dojo.isArray(rootNode) ? rootNode : (rootNode.all || rootNode.getElementsByTagName("*"));
var x = dojo.isArray(rootNode) ? 0 : -1;
for(; x<nodes.length; x++){
var baseNode = (x == -1) ? rootNode : nodes[x];
if(this.widgetsInTemplate && (getAttrFunc(baseNode, "dojoType") || getAttrFunc(baseNode, "data-dojo-type"))){
continue; continue;
} }
var _11=_e(_10,"dojoAttachPoint"); // Process dojoAttachPoint
if(_11){ var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
var _12,_13=_11.split(/\s*,\s*/); if(attachPoint){
while((_12=_13.shift())){ var point, points = attachPoint.split(/\s*,\s*/);
if(dojo.isArray(this[_12])){ while((point = points.shift())){
this[_12].push(_10); if(dojo.isArray(this[point])){
this[point].push(baseNode);
}else{ }else{
this[_12]=_10; this[point]=baseNode;
} }
this._attachPoints.push(_12); this._attachPoints.push(point);
} }
} }
var _14=_e(_10,"dojoAttachEvent");
if(_14){ // Process dojoAttachEvent
var _15,_16=_14.split(/\s*,\s*/); var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");;
var _17=dojo.trim; if(attachEvent){
while((_15=_16.shift())){ // NOTE: we want to support attributes that have the form
if(_15){ // "domEvent: nativeEvent; ..."
var _18=null; var event, events = attachEvent.split(/\s*,\s*/);
if(_15.indexOf(":")!=-1){ var trim = dojo.trim;
var _19=_15.split(":"); while((event = events.shift())){
_15=_17(_19[0]); if(event){
_18=_17(_19[1]); var thisFunc = null;
if(event.indexOf(":") != -1){
// oh, if only JS had tuple assignment
var funcNameArr = event.split(":");
event = trim(funcNameArr[0]);
thisFunc = trim(funcNameArr[1]);
}else{ }else{
_15=_17(_15); event = trim(event);
} }
if(!_18){ if(!thisFunc){
_18=_15; thisFunc = event;
} }
this.connect(_10,_15,_18); this._attachEvents.push(this.connect(baseNode, event, thisFunc));
} }
} }
} }
var _1a=_e(_10,"waiRole");
if(_1a){ // waiRole, waiState
dijit.setWaiRole(_10,_1a); // TODO: remove this in 2.0, templates are now using role=... and aria-XXX=... attributes directicly
var role = getAttrFunc(baseNode, "waiRole");
if(role){
dijit.setWaiRole(baseNode, role);
} }
var _1b=_e(_10,"waiState"); var values = getAttrFunc(baseNode, "waiState");
if(_1b){ if(values){
dojo.forEach(_1b.split(/\s*,\s*/),function(_1c){ dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
if(_1c.indexOf("-")!=-1){ if(stateValue.indexOf('-') != -1){
var _1d=_1c.split("-"); var pair = stateValue.split('-');
dijit.setWaiState(_10,_1d[0],_1d[1]); dijit.setWaiState(baseNode, pair[0], pair[1]);
} }
}); });
} }
} }
},startup:function(){ },
startup: function(){
dojo.forEach(this._startupWidgets, function(w){ dojo.forEach(this._startupWidgets, function(w){
if(w && !w._started && w.startup){ if(w && !w._started && w.startup){
w.startup(); w.startup();
} }
}); });
this.inherited(arguments); this.inherited(arguments);
},destroyRendering:function(){ },
dojo.forEach(this._attachPoints,function(_1e){
delete this[_1e]; destroyRendering: function(){
// Delete all attach points to prevent IE6 memory leaks.
dojo.forEach(this._attachPoints, function(point){
delete this[point];
}, this); }, this);
this._attachPoints = []; this._attachPoints = [];
// And same for event handlers
dojo.forEach(this._attachEvents, this.disconnect, this);
this._attachEvents = [];
this.inherited(arguments); this.inherited(arguments);
}}); }
}
);
// key is either templatePath or templateString; object is either string or DOM tree
dijit._Templated._templateCache = {}; dijit._Templated._templateCache = {};
dijit._Templated.getCachedTemplate=function(_1f,_20,_21){
var _22=dijit._Templated._templateCache; dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
var key=_20||_1f; // summary:
var _23=_22[key]; // Static method to get a template based on the templatePath or
if(_23){ // templateString key
// templatePath: String||dojo.uri.Uri
// The URL to get the template from.
// templateString: String?
// a string to use in lieu of fetching the template from a URL. Takes precedence
// over templatePath
// returns: Mixed
// Either string (if there are ${} variables that need to be replaced) or just
// a DOM tree (if the node can be cloned directly)
// is it already cached?
var tmplts = dijit._Templated._templateCache;
var key = templateString || templatePath;
var cached = tmplts[key];
if(cached){
try{ try{
if(!_23.ownerDocument||_23.ownerDocument==dojo.doc){ // if the cached value is an innerHTML string (no ownerDocument) or a DOM tree created within the current document, then use the current cached value
return _23; if(!cached.ownerDocument || cached.ownerDocument == dojo.doc){
// string or node of the same document
return cached;
} }
}catch(e){ /* squelch */ } // IE can throw an exception if cached.ownerDocument was reloaded
dojo.destroy(cached);
} }
catch(e){
// If necessary, load template string from template path
if(!templateString){
templateString = dojo.cache(templatePath, {sanitize: true});
} }
dojo.destroy(_23); templateString = dojo.string.trim(templateString);
}
if(!_20){ if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
_20=dojo.cache(_1f,{sanitize:true}); // there are variables in the template so all we can do is cache the string
} return (tmplts[key] = templateString); //String
_20=dojo.string.trim(_20);
if(_21||_20.match(/\$\{([^\}]+)\}/g)){
return (_22[key]=_20);
}else{ }else{
var _24=dojo._toDom(_20); // there are no variables in the template so we can cache the DOM tree
if(_24.nodeType!=1){ var node = dojo._toDom(templateString);
throw new Error("Invalid template: "+_20); if(node.nodeType != 1){
throw new Error("Invalid template: " + templateString);
} }
return (_22[key]=_24); return (tmplts[key] = node); //Node
} }
}; };
if(dojo.isIE){ if(dojo.isIE){
dojo.addOnWindowUnload(function(){ dojo.addOnWindowUnload(function(){
var _25=dijit._Templated._templateCache; var cache = dijit._Templated._templateCache;
for(var key in _25){ for(var key in cache){
var _26=_25[key]; var value = cache[key];
if(typeof _26=="object"){ if(typeof value == "object"){ // value is either a string or a DOM node template
dojo.destroy(_26); dojo.destroy(value);
} }
delete _25[key]; delete cache[key];
} }
}); });
} }
dojo.extend(dijit._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});
// These arguments can be specified for widgets which are used in templates.
// Since any widget can be specified as sub widgets in template, mix it
// into the base widget class. (This is a hack, but it's effective.)
dojo.extend(dijit._Widget,{
dojoAttachEvent: "",
dojoAttachPoint: "",
waiRole: "",
waiState:""
});
} }

View File

@@ -1,138 +1,306 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._TimePicker"]){ if(!dojo._hasResource["dijit._TimePicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._TimePicker"] = true; dojo._hasResource["dijit._TimePicker"] = true;
dojo.provide("dijit._TimePicker"); dojo.provide("dijit._TimePicker");
dojo.require("dijit.form._FormWidget"); dojo.require("dijit.form._FormWidget");
dojo.require("dojo.date.locale"); dojo.require("dojo.date.locale");
dojo.declare("dijit._TimePicker",[dijit._Widget,dijit._Templated],{templateString:dojo.cache("dijit","templates/TimePicker.html","<div id=\"widget_${id}\" class=\"dijitMenu\"\n ><div dojoAttachPoint=\"upArrow\" class=\"dijitButtonNode dijitUpArrowButton\" dojoAttachEvent=\"onmouseenter:_buttonMouse,onmouseleave:_buttonMouse\"\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" wairole=\"presentation\" role=\"presentation\">&nbsp;</div\n\t\t><div class=\"dijitArrowButtonChar\">&#9650;</div></div\n ><div dojoAttachPoint=\"timeMenu,focusNode\" dojoAttachEvent=\"onclick:_onOptionSelected,onmouseover,onmouseout\"></div\n ><div dojoAttachPoint=\"downArrow\" class=\"dijitButtonNode dijitDownArrowButton\" dojoAttachEvent=\"onmouseenter:_buttonMouse,onmouseleave:_buttonMouse\"\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" wairole=\"presentation\" role=\"presentation\">&nbsp;</div\n\t\t><div class=\"dijitArrowButtonChar\">&#9660;</div></div\n></div>\n"),baseClass:"dijitTimePicker",clickableIncrement:"T00:15:00",visibleIncrement:"T01:00:00",visibleRange:"T05:00:00",value:new Date(),_visibleIncrement:2,_clickableIncrement:1,_totalIncrements:10,constraints:{},serialize:dojo.date.stamp.toISOString,_filterString:"",setValue:function(_1){
/*=====
dojo.declare(
"dijit._TimePicker.__Constraints",
dojo.date.locale.__FormatOptions,
{
// clickableIncrement: String
// See `dijit._TimePicker.clickableIncrement`
clickableIncrement: "T00:15:00",
// visibleIncrement: String
// See `dijit._TimePicker.visibleIncrement`
visibleIncrement: "T01:00:00",
// visibleRange: String
// See `dijit._TimePicker.visibleRange`
visibleRange: "T05:00:00"
}
);
=====*/
dojo.declare("dijit._TimePicker",
[dijit._Widget, dijit._Templated],
{
// summary:
// A graphical time picker.
// This widget is used internally by other widgets and is not available
// as a standalone widget due to lack of accessibility support.
templateString: dojo.cache("dijit", "templates/TimePicker.html", "<div id=\"widget_${id}\" class=\"dijitMenu\"\n ><div dojoAttachPoint=\"upArrow\" class=\"dijitButtonNode dijitUpArrowButton\" dojoAttachEvent=\"onmouseenter:_buttonMouse,onmouseleave:_buttonMouse\"\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" role=\"presentation\">&nbsp;</div\n\t\t><div class=\"dijitArrowButtonChar\">&#9650;</div></div\n ><div dojoAttachPoint=\"timeMenu,focusNode\" dojoAttachEvent=\"onclick:_onOptionSelected,onmouseover,onmouseout\"></div\n ><div dojoAttachPoint=\"downArrow\" class=\"dijitButtonNode dijitDownArrowButton\" dojoAttachEvent=\"onmouseenter:_buttonMouse,onmouseleave:_buttonMouse\"\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" role=\"presentation\">&nbsp;</div\n\t\t><div class=\"dijitArrowButtonChar\">&#9660;</div></div\n></div>\n"),
// baseClass: [protected] String
// The root className to use for the various states of this widget
baseClass: "dijitTimePicker",
// clickableIncrement: String
// ISO-8601 string representing the amount by which
// every clickable element in the time picker increases.
// Set in local time, without a time zone.
// Example: `T00:15:00` creates 15 minute increments
// Must divide dijit._TimePicker.visibleIncrement evenly
clickableIncrement: "T00:15:00",
// visibleIncrement: String
// ISO-8601 string representing the amount by which
// every element with a visible time in the time picker increases.
// Set in local time, without a time zone.
// Example: `T01:00:00` creates text in every 1 hour increment
visibleIncrement: "T01:00:00",
// visibleRange: String
// ISO-8601 string representing the range of this TimePicker.
// The TimePicker will only display times in this range.
// Example: `T05:00:00` displays 5 hours of options
visibleRange: "T05:00:00",
// value: String
// Date to display.
// Defaults to current time and date.
// Can be a Date object or an ISO-8601 string.
// If you specify the GMT time zone (`-01:00`),
// the time will be converted to the local time in the local time zone.
// Otherwise, the time is considered to be in the local time zone.
// If you specify the date and isDate is true, the date is used.
// Example: if your local time zone is `GMT -05:00`,
// `T10:00:00` becomes `T10:00:00-05:00` (considered to be local time),
// `T10:00:00-01:00` becomes `T06:00:00-05:00` (4 hour difference),
// `T10:00:00Z` becomes `T05:00:00-05:00` (5 hour difference between Zulu and local time)
// `yyyy-mm-ddThh:mm:ss` is the format to set the date and time
// Example: `2007-06-01T09:00:00`
value: new Date(),
_visibleIncrement:2,
_clickableIncrement:1,
_totalIncrements:10,
// constraints: dijit._TimePicker.__Constraints
// Specifies valid range of times (start time, end time)
constraints:{},
/*=====
serialize: function(val, options){
// summary:
// User overridable function used to convert the attr('value') result to a String
// val: Date
// The current value
// options: Object?
// tags:
// protected
},
=====*/
serialize: dojo.date.stamp.toISOString,
/*=====
// filterString: string
// The string to filter by
filterString: "",
=====*/
setValue: function(/*Date*/ value){
// summary:
// Deprecated. Used set('value') instead.
// tags:
// deprecated
dojo.deprecated("dijit._TimePicker:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0"); dojo.deprecated("dijit._TimePicker:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
this.set("value",_1); this.set('value', value);
},_setValueAttr:function(_2){ },
this.value=_2;
_setValueAttr: function(/*Date*/ date){
// summary:
// Hook so set('value', ...) works.
// description:
// Set the value of the TimePicker.
// Redraws the TimePicker around the new date.
// tags:
// protected
this._set("value", date);
this._showText(); this._showText();
},onOpen:function(_3){ },
if(this._beenOpened&&this.domNode.parentNode){
var p=dijit.byId(this.domNode.parentNode.dijitPopupParent); _setFilterStringAttr: function(val){
if(p){ // summary:
var _4=p.get("displayedValue"); // Called by TimeTextBox to filter the values shown in my list
if(_4&&!p.parse(_4,p.constraints)){ this._set("filterString", val);
this._filterString=_4;
}else{
this._filterString="";
}
this._showText(); this._showText();
} },
}
this._beenOpened=true; isDisabledDate: function(/*Date*/ dateObject, /*String?*/ locale){
},isDisabledDate:function(_5,_6){ // summary:
return false; // May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend`
},_getFilteredNodes:function(_7,_8,_9){ // type:
var _a=[],n,i=_7,_b=this._maxIncrement+Math.abs(i),_c=_9?-1:1,_d=_9?1:0,_e=_9?0:1; // extension
return false; // Boolean
},
_getFilteredNodes: function(/*number*/ start, /*number*/ maxNum, /*Boolean*/ before, /*DOMnode*/ lastNode){
// summary:
// Returns an array of nodes with the filter applied. At most maxNum nodes
// will be returned - but fewer may be returned as well. If the
// before parameter is set to true, then it will return the elements
// before the given index
// tags:
// private
var
nodes = [],
lastValue = lastNode ? lastNode.date : this._refDate,
n,
i = start,
max = this._maxIncrement + Math.abs(i),
chk = before ? -1 : 1,
dec = before ? 1 : 0,
inc = 1 - dec;
do{ do{
i=i-_d; i = i - dec;
n = this._createOption(i); n = this._createOption(i);
if(n){ if(n){
_a.push(n); if((before && n.date > lastValue) || (!before && n.date < lastValue)){
break; // don't wrap
} }
i=i+_e; nodes[before ? "unshift" : "push"](n);
}while(_a.length<_8&&(i*_c)<_b); lastValue = n.date;
if(_9){
_a.reverse();
} }
return _a; i = i + inc;
},_showText:function(){ }while(nodes.length < maxNum && (i*chk) < max);
return nodes;
},
_showText: function(){
// summary:
// Displays the relevant choices in the drop down list
// tags:
// private
var fromIso = dojo.date.stamp.fromISOString;
this.timeMenu.innerHTML = ""; this.timeMenu.innerHTML = "";
var _f=dojo.date.stamp.fromISOString; this._clickableIncrementDate=fromIso(this.clickableIncrement);
this._clickableIncrementDate=_f(this.clickableIncrement); this._visibleIncrementDate=fromIso(this.visibleIncrement);
this._visibleIncrementDate=_f(this.visibleIncrement); this._visibleRangeDate=fromIso(this.visibleRange);
this._visibleRangeDate=_f(this.visibleRange); // get the value of the increments and the range in seconds (since 00:00:00) to find out how many divs to create
var _10=function(_11){ var
return _11.getHours()*60*60+_11.getMinutes()*60+_11.getSeconds(); sinceMidnight = function(/*Date*/ date){
}; return date.getHours() * 60 * 60 + date.getMinutes() * 60 + date.getSeconds();
var _12=_10(this._clickableIncrementDate); },
var _13=_10(this._visibleIncrementDate); clickableIncrementSeconds = sinceMidnight(this._clickableIncrementDate),
var _14=_10(this._visibleRangeDate); visibleIncrementSeconds = sinceMidnight(this._visibleIncrementDate),
var _15=this.value.getTime(); visibleRangeSeconds = sinceMidnight(this._visibleRangeDate),
this._refDate=new Date(_15-_15%(_13*1000));
this._refDate.setFullYear(1970,0,1); // round reference date to previous visible increment
time = (this.value || this.currentFocus).getTime();
this._refDate = new Date(time - time % (visibleIncrementSeconds*1000));
this._refDate.setFullYear(1970,0,1); // match parse defaults
// assume clickable increment is the smallest unit
this._clickableIncrement = 1; this._clickableIncrement = 1;
this._totalIncrements=_14/_12; // divide the visible range by the clickable increment to get the number of divs to create
this._visibleIncrement=_13/_12; // example: 10:00:00/00:15:00 -> display 40 divs
this._maxIncrement=(60*60*24)/_12; this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds;
var _16=this._getFilteredNodes(0,this._totalIncrements>>1,true); // divide the visible increments by the clickable increments to get how often to display the time inline
var _17=this._getFilteredNodes(0,this._totalIncrements>>1,false); // example: 01:00:00/00:15:00 -> display the time every 4 divs
if(_16.length<this._totalIncrements>>1){ this._visibleIncrement = visibleIncrementSeconds / clickableIncrementSeconds;
_16=_16.slice(_16.length/2); // divide the number of seconds in a day by the clickable increment in seconds to get the
_17=_17.slice(0,_17.length/2); // absolute max number of increments.
} this._maxIncrement = (60 * 60 * 24) / clickableIncrementSeconds;
dojo.forEach(_16.concat(_17),function(n){
this.timeMenu.appendChild(n); var
},this); // Find the nodes we should display based on our filter.
},postCreate:function(){ // Limit to 10 nodes displayed as a half-hearted attempt to stop drop down from overlapping <input>.
if(this.constraints===dijit._TimePicker.prototype.constraints){ after = this._getFilteredNodes(0, Math.min(this._totalIncrements >> 1, 10) - 1),
this.constraints={}; before = this._getFilteredNodes(0, Math.min(this._totalIncrements, 10) - after.length, true, after[0]);
} dojo.forEach(before.concat(after), function(n){this.timeMenu.appendChild(n);}, this);
dojo.mixin(this,this.constraints); },
if(!this.constraints.locale){
this.constraints.locale=this.lang; constructor: function(){
} this.constraints = {}; // create instance object
this.connect(this.timeMenu,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled"); },
var _18=this;
var _19=function(){ postMixInProperties: function(){
_18._connects.push(dijit.typematic.addMouseListener.apply(null,arguments));
};
_19(this.upArrow,this,this._onArrowUp,1,50);
_19(this.downArrow,this,this._onArrowDown,1,50);
var _1a=function(cb){
return function(cnt){
if(cnt>0){
cb.call(this,arguments);
}
};
};
var _1b=function(_1c,cb){
return function(e){
dojo.stopEvent(e);
dijit.typematic.trigger(e,this,_1c,_1a(cb),_1c,1,50);
};
};
this.connect(this.upArrow,"onmouseover",_1b(this.upArrow,this._onArrowUp));
this.connect(this.downArrow,"onmouseover",_1b(this.downArrow,this._onArrowDown));
this.inherited(arguments); this.inherited(arguments);
},_buttonMouse:function(e){ this._setConstraintsAttr(this.constraints); // this needs to happen now (and later) due to codependency on _set*Attr calls
dojo.toggleClass(e.currentTarget,e.currentTarget==this.upArrow?"dijitUpArrowHover":"dijitDownArrowHover",e.type=="mouseenter"||e.type=="mouseover"); },
},_createOption:function(_1d){
var _1e=new Date(this._refDate); _setConstraintsAttr: function(/* Object */ constraints){
var _1f=this._clickableIncrementDate; // brings in visibleRange, increments, etc.
_1e.setHours(_1e.getHours()+_1f.getHours()*_1d,_1e.getMinutes()+_1f.getMinutes()*_1d,_1e.getSeconds()+_1f.getSeconds()*_1d); dojo.mixin(this, constraints);
if(this.constraints.selector=="time"){
_1e.setFullYear(1970,0,1); // dojo.date.locale needs the lang in the constraints as locale
if(!constraints.locale){
constraints.locale = this.lang;
} }
var _20=dojo.date.locale.format(_1e,this.constraints); },
if(this._filterString&&_20.toLowerCase().indexOf(this._filterString)!==0){
postCreate: function(){
// assign typematic mouse listeners to the arrow buttons
this.connect(this.timeMenu, dojo.isIE ? "onmousewheel" : 'DOMMouseScroll', "_mouseWheeled");
this._connects.push(dijit.typematic.addMouseListener(this.upArrow, this, "_onArrowUp", 33, 250));
this._connects.push(dijit.typematic.addMouseListener(this.downArrow, this, "_onArrowDown", 33, 250));
this.inherited(arguments);
},
_buttonMouse: function(/*Event*/ e){
// summary:
// Handler for hover (and unhover) on up/down arrows
// tags:
// private
// in non-IE browser the "mouseenter" event will become "mouseover",
// but in IE it's still "mouseenter"
dojo.toggleClass(e.currentTarget, e.currentTarget == this.upArrow ? "dijitUpArrowHover" : "dijitDownArrowHover",
e.type == "mouseenter" || e.type == "mouseover");
},
_createOption: function(/*Number*/ index){
// summary:
// Creates a clickable time option
// tags:
// private
var date = new Date(this._refDate);
var incrementDate = this._clickableIncrementDate;
date.setHours(date.getHours() + incrementDate.getHours() * index,
date.getMinutes() + incrementDate.getMinutes() * index,
date.getSeconds() + incrementDate.getSeconds() * index);
if(this.constraints.selector == "time"){
date.setFullYear(1970,0,1); // make sure each time is for the same date
}
var dateString = dojo.date.locale.format(date, this.constraints);
if(this.filterString && dateString.toLowerCase().indexOf(this.filterString) !== 0){
// Doesn't match the filter - return null
return null; return null;
} }
var div = dojo.create("div", {"class": this.baseClass+"Item"}); var div = dojo.create("div", {"class": this.baseClass+"Item"});
div.date=_1e; div.date = date;
div.index=_1d; div.index = index;
dojo.create("div",{"class":this.baseClass+"ItemInner",innerHTML:_20},div); dojo.create('div',{
if(_1d%this._visibleIncrement<1&&_1d%this._visibleIncrement>-1){ "class": this.baseClass + "ItemInner",
innerHTML: dateString
}, div);
if(index%this._visibleIncrement<1 && index%this._visibleIncrement>-1){
dojo.addClass(div, this.baseClass+"Marker"); dojo.addClass(div, this.baseClass+"Marker");
}else{ }else if(!(index%this._clickableIncrement)){
if(!(_1d%this._clickableIncrement)){
dojo.addClass(div, this.baseClass+"Tick"); dojo.addClass(div, this.baseClass+"Tick");
} }
}
if(this.isDisabledDate(_1e)){ if(this.isDisabledDate(date)){
// set disabled
dojo.addClass(div, this.baseClass+"ItemDisabled"); dojo.addClass(div, this.baseClass+"ItemDisabled");
} }
if(!dojo.date.compare(this.value,_1e,this.constraints.selector)){ if(this.value && !dojo.date.compare(this.value, date, this.constraints.selector)){
div.selected = true; div.selected = true;
dojo.addClass(div, this.baseClass+"ItemSelected"); dojo.addClass(div, this.baseClass+"ItemSelected");
if(dojo.hasClass(div, this.baseClass+"Marker")){ if(dojo.hasClass(div, this.baseClass+"Marker")){
@@ -140,126 +308,174 @@ dojo.addClass(div,this.baseClass+"MarkerSelected");
}else{ }else{
dojo.addClass(div, this.baseClass+"TickSelected"); dojo.addClass(div, this.baseClass+"TickSelected");
} }
// Initially highlight the current value. User can change highlight by up/down arrow keys
// or mouse movement.
this._highlightOption(div, true);
} }
return div; return div;
},_onOptionSelected:function(tgt){ },
var _21=tgt.target.date||tgt.target.parentNode.date;
if(!_21||this.isDisabledDate(_21)){ _onOptionSelected: function(/*Object*/ tgt){
return; // summary:
} // Called when user clicks an option in the drop down list
// tags:
// private
var tdate = tgt.target.date || tgt.target.parentNode.date;
if(!tdate || this.isDisabledDate(tdate)){ return; }
this._highlighted_option = null; this._highlighted_option = null;
this.set("value",_21); this.set('value', tdate);
this.onValueSelected(_21); this.onChange(tdate);
},onValueSelected:function(_22){ },
},_highlightOption:function(_23,_24){
if(!_23){ onChange: function(/*Date*/ time){
return; // summary:
} // Notification that a time was selected. It may be the same as the previous value.
if(_24){ // tags:
// public
},
_highlightOption: function(/*node*/ node, /*Boolean*/ highlight){
// summary:
// Turns on/off highlight effect on a node based on mouse out/over event
// tags:
// private
if(!node){return;}
if(highlight){
if(this._highlighted_option){ if(this._highlighted_option){
this._highlightOption(this._highlighted_option, false); this._highlightOption(this._highlighted_option, false);
} }
this._highlighted_option=_23; this._highlighted_option = node;
}else{ }else if(this._highlighted_option !== node){
if(this._highlighted_option!==_23){
return; return;
}else{ }else{
this._highlighted_option = null; this._highlighted_option = null;
} }
} dojo.toggleClass(node, this.baseClass+"ItemHover", highlight);
dojo.toggleClass(_23,this.baseClass+"ItemHover",_24); if(dojo.hasClass(node, this.baseClass+"Marker")){
if(dojo.hasClass(_23,this.baseClass+"Marker")){ dojo.toggleClass(node, this.baseClass+"MarkerHover", highlight);
dojo.toggleClass(_23,this.baseClass+"MarkerHover",_24);
}else{ }else{
dojo.toggleClass(_23,this.baseClass+"TickHover",_24); dojo.toggleClass(node, this.baseClass+"TickHover", highlight);
} }
},onmouseover:function(e){ },
onmouseover: function(/*Event*/ e){
// summary:
// Handler for onmouseover event
// tags:
// private
this._keyboardSelected = null; this._keyboardSelected = null;
var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode; var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
if(!dojo.hasClass(tgr,this.baseClass+"Item")){ // if we aren't targeting an item, then we return
return; if(!dojo.hasClass(tgr, this.baseClass+"Item")){return;}
}
this._highlightOption(tgr, true); this._highlightOption(tgr, true);
},onmouseout:function(e){ },
onmouseout: function(/*Event*/ e){
// summary:
// Handler for onmouseout event
// tags:
// private
this._keyboardSelected = null; this._keyboardSelected = null;
var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode; var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
this._highlightOption(tgr, false); this._highlightOption(tgr, false);
},_mouseWheeled:function(e){ },
_mouseWheeled: function(/*Event*/ e){
// summary:
// Handle the mouse wheel events
// tags:
// private
this._keyboardSelected = null; this._keyboardSelected = null;
dojo.stopEvent(e); dojo.stopEvent(e);
var _25=(dojo.isIE?e.wheelDelta:-e.detail); // we're not _measuring_ the scroll amount, just direction
this[(_25>0?"_onArrowUp":"_onArrowDown")](); var scrollAmount = (dojo.isIE ? e.wheelDelta : -e.detail);
},_onArrowUp:function(_26){ this[(scrollAmount>0 ? "_onArrowUp" : "_onArrowDown")](); // yes, we're making a new dom node every time you mousewheel, or click
if(typeof _26=="number"&&_26==-1){ },
return;
} _onArrowUp: function(count){
if(!this.timeMenu.childNodes.length){ // summary:
return; // Handler for up arrow key.
} // description:
var _27=this.timeMenu.childNodes[0].index; // Removes the bottom time and add one to the top
var _28=this._getFilteredNodes(_27,1,true); // tags:
if(_28.length){ // private
if(typeof count == "number" && count == -1){ return; } // typematic end
if(!this.timeMenu.childNodes.length){ return; }
var index = this.timeMenu.childNodes[0].index;
var divs = this._getFilteredNodes(index, 1, true, this.timeMenu.childNodes[0]);
if(divs.length){
this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1]); this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1]);
this.timeMenu.insertBefore(_28[0],this.timeMenu.childNodes[0]); this.timeMenu.insertBefore(divs[0], this.timeMenu.childNodes[0]);
} }
},_onArrowDown:function(_29){ },
if(typeof _29=="number"&&_29==-1){
return; _onArrowDown: function(count){
} // summary:
if(!this.timeMenu.childNodes.length){ // Handler for up arrow key.
return; // description:
} // Remove the top time and add one to the bottom
var _2a=this.timeMenu.childNodes[this.timeMenu.childNodes.length-1].index+1; // tags:
var _2b=this._getFilteredNodes(_2a,1,false); // private
if(_2b.length){ if(typeof count == "number" && count == -1){ return; } // typematic end
if(!this.timeMenu.childNodes.length){ return; }
var index = this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1].index + 1;
var divs = this._getFilteredNodes(index, 1, false, this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1]);
if(divs.length){
this.timeMenu.removeChild(this.timeMenu.childNodes[0]); this.timeMenu.removeChild(this.timeMenu.childNodes[0]);
this.timeMenu.appendChild(_2b[0]); this.timeMenu.appendChild(divs[0]);
} }
},handleKey:function(e){ },
handleKey: function(/*Event*/ e){
// summary:
// Called from `dijit.form._DateTimeTextBox` to pass a keypress event
// from the `dijit.form.TimeTextBox` to be handled in this widget
// tags:
// protected
var dk = dojo.keys; var dk = dojo.keys;
if(e.keyChar||e.charOrCode===dk.BACKSPACE||e.charOrCode==dk.DELETE){
setTimeout(dojo.hitch(this,function(){
this._filterString=e.target.value.toLowerCase();
this._showText();
}),1);
}else{
if(e.charOrCode == dk.DOWN_ARROW || e.charOrCode == dk.UP_ARROW){ if(e.charOrCode == dk.DOWN_ARROW || e.charOrCode == dk.UP_ARROW){
dojo.stopEvent(e); dojo.stopEvent(e);
// Figure out which option to highlight now and then highlight it
if(this._highlighted_option && !this._highlighted_option.parentNode){ if(this._highlighted_option && !this._highlighted_option.parentNode){
this._highlighted_option = null; this._highlighted_option = null;
} }
var _2c=this.timeMenu,tgt=this._highlighted_option||dojo.query("."+this.baseClass+"ItemSelected",_2c)[0]; var timeMenu = this.timeMenu,
tgt = this._highlighted_option || dojo.query("." + this.baseClass + "ItemSelected", timeMenu)[0];
if(!tgt){ if(!tgt){
tgt=_2c.childNodes[0]; tgt = timeMenu.childNodes[0];
}else{ }else if(timeMenu.childNodes.length){
if(_2c.childNodes.length){
if(e.charOrCode == dk.DOWN_ARROW && !tgt.nextSibling){ if(e.charOrCode == dk.DOWN_ARROW && !tgt.nextSibling){
this._onArrowDown(); this._onArrowDown();
}else{ }else if(e.charOrCode == dk.UP_ARROW && !tgt.previousSibling){
if(e.charOrCode==dk.UP_ARROW&&!tgt.previousSibling){
this._onArrowUp(); this._onArrowUp();
} }
}
if(e.charOrCode == dk.DOWN_ARROW){ if(e.charOrCode == dk.DOWN_ARROW){
tgt = tgt.nextSibling; tgt = tgt.nextSibling;
}else{ }else{
tgt = tgt.previousSibling; tgt = tgt.previousSibling;
} }
} }
}
this._highlightOption(tgt, true); this._highlightOption(tgt, true);
this._keyboardSelected = tgt; this._keyboardSelected = tgt;
}else{ return false;
if(this._highlighted_option&&(e.charOrCode==dk.ENTER||e.charOrCode===dk.TAB)){ }else if(e.charOrCode == dk.ENTER || e.charOrCode === dk.TAB){
// mouse hover followed by TAB is NO selection
if(!this._keyboardSelected && e.charOrCode === dk.TAB){ if(!this._keyboardSelected && e.charOrCode === dk.TAB){
return; return true; // true means don't call stopEvent()
}
if(e.charOrCode==dk.ENTER){
dojo.stopEvent(e);
} }
// Accept the currently-highlighted option as the value
if(this._highlighted_option){
this._onOptionSelected({target: this._highlighted_option}); this._onOptionSelected({target: this._highlighted_option});
} }
// Call stopEvent() for ENTER key so that form doesn't submit,
// but not for TAB, so that TAB does switch focus
return e.charOrCode === dk.TAB;
} }
} }
}}); }
);
} }

View File

@@ -1,345 +1,492 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._Widget"]){ if(!dojo._hasResource["dijit._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._Widget"] = true; dojo._hasResource["dijit._Widget"] = true;
dojo.provide("dijit._Widget"); dojo.provide("dijit._Widget");
dojo.require("dijit._WidgetBase");
dojo.require("dijit._base"); dojo.require("dijit._base");
dojo.connect(dojo,"_connect",function(_1,_2){
if(_1&&dojo.isFunction(_1._onConnect)){
_1._onConnect(_2);
////////////////// DEFERRED CONNECTS ///////////////////
// This code is to assist deferring dojo.connect() calls in widgets (connecting to events on the widgets'
// DOM nodes) until someone actually needs to monitor that event.
dojo.connect(dojo, "_connect",
function(/*dijit._Widget*/ widget, /*String*/ event){
if(widget && dojo.isFunction(widget._onConnect)){
widget._onConnect(event);
} }
}); });
dijit._connectOnUseEventHandler=function(_3){
}; dijit._connectOnUseEventHandler = function(/*Event*/ event){};
////////////////// ONDIJITCLICK SUPPORT ///////////////////
// Keep track of where the last keydown event was, to help avoid generating
// spurious ondijitclick events when:
// 1. focus is on a <button> or <a>
// 2. user presses then releases the ENTER key
// 3. onclick handler fires and shifts focus to another node, with an ondijitclick handler
// 4. onkeyup event fires, causing the ondijitclick handler to fire
dijit._lastKeyDownNode = null; dijit._lastKeyDownNode = null;
if(dojo.isIE){ if(dojo.isIE){
(function(){ (function(){
var _4=function(_5){ var keydownCallback = function(evt){
dijit._lastKeyDownNode=_5.srcElement; dijit._lastKeyDownNode = evt.srcElement;
}; };
dojo.doc.attachEvent("onkeydown",_4); dojo.doc.attachEvent('onkeydown', keydownCallback);
dojo.addOnWindowUnload(function(){ dojo.addOnWindowUnload(function(){
dojo.doc.detachEvent("onkeydown",_4); dojo.doc.detachEvent('onkeydown', keydownCallback);
}); });
})(); })();
}else{ }else{
dojo.doc.addEventListener("keydown",function(_6){ dojo.doc.addEventListener('keydown', function(evt){
dijit._lastKeyDownNode=_6.target; dijit._lastKeyDownNode = evt.target;
}, true); }, true);
} }
(function(){ (function(){
var _7={},_8=function(_9){
var dc=_9.declaredClass; dojo.declare("dijit._Widget", dijit._WidgetBase, {
if(!_7[dc]){ // summary:
var r=[],_a,_b=_9.constructor.prototype; // Base class for all Dijit widgets.
for(var _c in _b){ //
if(dojo.isFunction(_b[_c])&&(_a=_c.match(/^_set([a-zA-Z]*)Attr$/))&&_a[1]){ // Extends _WidgetBase, adding support for:
r.push(_a[1].charAt(0).toLowerCase()+_a[1].substr(1)); // - deferred connections
} // A call like dojo.connect(myWidget, "onMouseMove", func)
} // will essentially do a dojo.connect(myWidget.domNode, "onMouseMove", func)
_7[dc]=r; // - ondijitclick
} // Support new dojoAttachEvent="ondijitclick: ..." that is triggered by a mouse click or a SPACE/ENTER keypress
return _7[dc]||[]; // - focus related functions
}; // In particular, the onFocus()/onBlur() callbacks. Driven internally by
dojo.declare("dijit._Widget",null,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:dijit._connectOnUseEventHandler,onDblClick:dijit._connectOnUseEventHandler,onKeyDown:dijit._connectOnUseEventHandler,onKeyPress:dijit._connectOnUseEventHandler,onKeyUp:dijit._connectOnUseEventHandler,onMouseDown:dijit._connectOnUseEventHandler,onMouseMove:dijit._connectOnUseEventHandler,onMouseOut:dijit._connectOnUseEventHandler,onMouseOver:dijit._connectOnUseEventHandler,onMouseLeave:dijit._connectOnUseEventHandler,onMouseEnter:dijit._connectOnUseEventHandler,onMouseUp:dijit._connectOnUseEventHandler,_blankGif:(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_d,_e){ // dijit/_base/focus.js.
this.create(_d,_e); // - deprecated methods
},create:function(_f,_10){ // - onShow(), onHide(), onClose()
this.srcNodeRef=dojo.byId(_10); //
this._connects=[]; // Also, by loading code in dijit/_base, turns on:
this._subscribes=[]; // - browser sniffing (putting browser id like .dj_ie on <html> node)
// - high contrast mode sniffing (add .dijit_a11y class to <body> if machine is in high contrast mode)
////////////////// DEFERRED CONNECTS ///////////////////
// _deferredConnects: [protected] Object
// attributeMap addendum for event handlers that should be connected only on first use
_deferredConnects: {
onClick: "",
onDblClick: "",
onKeyDown: "",
onKeyPress: "",
onKeyUp: "",
onMouseMove: "",
onMouseDown: "",
onMouseOut: "",
onMouseOver: "",
onMouseLeave: "",
onMouseEnter: "",
onMouseUp: ""
},
onClick: dijit._connectOnUseEventHandler,
/*=====
onClick: function(event){
// summary:
// Connect to this function to receive notifications of mouse click events.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onDblClick: dijit._connectOnUseEventHandler,
/*=====
onDblClick: function(event){
// summary:
// Connect to this function to receive notifications of mouse double click events.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onKeyDown: dijit._connectOnUseEventHandler,
/*=====
onKeyDown: function(event){
// summary:
// Connect to this function to receive notifications of keys being pressed down.
// event:
// key Event
// tags:
// callback
},
=====*/
onKeyPress: dijit._connectOnUseEventHandler,
/*=====
onKeyPress: function(event){
// summary:
// Connect to this function to receive notifications of printable keys being typed.
// event:
// key Event
// tags:
// callback
},
=====*/
onKeyUp: dijit._connectOnUseEventHandler,
/*=====
onKeyUp: function(event){
// summary:
// Connect to this function to receive notifications of keys being released.
// event:
// key Event
// tags:
// callback
},
=====*/
onMouseDown: dijit._connectOnUseEventHandler,
/*=====
onMouseDown: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse button is pressed down.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseMove: dijit._connectOnUseEventHandler,
/*=====
onMouseMove: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseOut: dijit._connectOnUseEventHandler,
/*=====
onMouseOut: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseOver: dijit._connectOnUseEventHandler,
/*=====
onMouseOver: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseLeave: dijit._connectOnUseEventHandler,
/*=====
onMouseLeave: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse moves off of this widget.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseEnter: dijit._connectOnUseEventHandler,
/*=====
onMouseEnter: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse moves onto this widget.
// event:
// mouse Event
// tags:
// callback
},
=====*/
onMouseUp: dijit._connectOnUseEventHandler,
/*=====
onMouseUp: function(event){
// summary:
// Connect to this function to receive notifications of when the mouse button is released.
// event:
// mouse Event
// tags:
// callback
},
=====*/
create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
// To avoid double-connects, remove entries from _deferredConnects
// that have been setup manually by a subclass (ex, by dojoAttachEvent).
// If a subclass has redefined a callback (ex: onClick) then assume it's being
// connected to manually.
this._deferredConnects = dojo.clone(this._deferredConnects); this._deferredConnects = dojo.clone(this._deferredConnects);
for(var _11 in this.attributeMap){ for(var attr in this.attributeMap){
delete this._deferredConnects[_11]; delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects
} }
for(_11 in this._deferredConnects){ for(attr in this._deferredConnects){
if(this[_11]!==dijit._connectOnUseEventHandler){ if(this[attr] !== dijit._connectOnUseEventHandler){
delete this._deferredConnects[_11]; delete this._deferredConnects[attr]; // redefined, probably dojoAttachEvent exists
} }
} }
if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){
this.id=this.srcNodeRef.id; this.inherited(arguments);
}
if(_f){
this.params=_f;
dojo.mixin(this,_f);
}
this.postMixInProperties();
if(!this.id){
this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
}
dijit.registry.add(this);
this.buildRendering();
if(this.domNode){ if(this.domNode){
this._applyAttributes(); // If the developer has specified a handler as a widget parameter
var _12=this.srcNodeRef; // (ex: new Button({onClick: ...})
if(_12&&_12.parentNode){ // then naturally need to connect from DOM node to that handler immediately,
_12.parentNode.replaceChild(this.domNode,_12); for(attr in this.params){
} this._onConnect(attr);
for(_11 in this.params){
this._onConnect(_11);
} }
} }
if(this.domNode){ },
this.domNode.setAttribute("widgetId",this.id);
_onConnect: function(/*String*/ event){
// summary:
// Called when someone connects to one of my handlers.
// "Turn on" that handler if it isn't active yet.
//
// This is also called for every single initialization parameter
// so need to do nothing for parameters like "id".
// tags:
// private
if(event in this._deferredConnects){
var mapNode = this[this._deferredConnects[event] || 'domNode'];
this.connect(mapNode, event.toLowerCase(), event);
delete this._deferredConnects[event];
} }
this.postCreate(); },
if(this.srcNodeRef&&!this.srcNodeRef.parentNode){
delete this.srcNodeRef; ////////////////// FOCUS RELATED ///////////////////
} // _onFocus() and _onBlur() are called by the focus manager
this._created=true;
},_applyAttributes:function(){ // focused: [readonly] Boolean
var _13=function(_14,_15){ // This widget or a widget it contains has focus, or is "active" because
if((_15.params&&_14 in _15.params)||_15[_14]){ // it was recently clicked.
_15.set(_14,_15[_14]); focused: false,
}
}; isFocusable: function(){
for(var _16 in this.attributeMap){ // summary:
_13(_16,this); // Return true if this widget can currently be focused
} // and false if not
dojo.forEach(_8(this),function(a){ return this.focus && (dojo.style(this.domNode, "display") != "none");
if(!(a in this.attributeMap)){ },
_13(a,this);
} onFocus: function(){
},this); // summary:
},postMixInProperties:function(){ // Called when the widget becomes "active" because
},buildRendering:function(){ // it or a widget inside of it either has focus, or has recently
this.domNode=this.srcNodeRef||dojo.create("div"); // been clicked.
},postCreate:function(){ // tags:
if(this.baseClass){ // callback
var _17=this.baseClass.split(" "); },
if(!this.isLeftToRight()){
_17=_17.concat(dojo.map(_17,function(_18){ onBlur: function(){
return _18+"Rtl"; // summary:
})); // Called when the widget stops being "active" because
} // focus moved to something outside of it, or the user
dojo.addClass(this.domNode,_17); // clicked somewhere outside of it, or the widget was
} // hidden.
},startup:function(){ // tags:
this._started=true; // callback
},destroyRecursive:function(_19){ },
this._beingDestroyed=true;
this.destroyDescendants(_19); _onFocus: function(e){
this.destroy(_19); // summary:
},destroy:function(_1a){ // This is where widgets do processing for when they are active,
this._beingDestroyed=true; // such as changing CSS classes. See onFocus() for more details.
this.uninitialize(); // tags:
var d=dojo,dfe=d.forEach,dun=d.unsubscribe; // protected
dfe(this._connects,function(_1b){
dfe(_1b,d.disconnect);
});
dfe(this._subscribes,function(_1c){
dun(_1c);
});
dfe(this._supportingWidgets||[],function(w){
if(w.destroyRecursive){
w.destroyRecursive();
}else{
if(w.destroy){
w.destroy();
}
}
});
this.destroyRendering(_1a);
dijit.registry.remove(this.id);
this._destroyed=true;
},destroyRendering:function(_1d){
if(this.bgIframe){
this.bgIframe.destroy(_1d);
delete this.bgIframe;
}
if(this.domNode){
if(_1d){
dojo.removeAttr(this.domNode,"widgetId");
}else{
dojo.destroy(this.domNode);
}
delete this.domNode;
}
if(this.srcNodeRef){
if(!_1d){
dojo.destroy(this.srcNodeRef);
}
delete this.srcNodeRef;
}
},destroyDescendants:function(_1e){
dojo.forEach(this.getChildren(),function(_1f){
if(_1f.destroyRecursive){
_1f.destroyRecursive(_1e);
}
});
},uninitialize:function(){
return false;
},onFocus:function(){
},onBlur:function(){
},_onFocus:function(e){
this.onFocus(); this.onFocus();
},_onBlur:function(){ },
_onBlur: function(){
// summary:
// This is where widgets do processing for when they stop being active,
// such as changing CSS classes. See onBlur() for more details.
// tags:
// protected
this.onBlur(); this.onBlur();
},_onConnect:function(_20){ },
if(_20 in this._deferredConnects){
var _21=this[this._deferredConnects[_20]||"domNode"]; ////////////////// DEPRECATED METHODS ///////////////////
this.connect(_21,_20.toLowerCase(),_20);
delete this._deferredConnects[_20]; setAttribute: function(/*String*/ attr, /*anything*/ value){
} // summary:
},_setClassAttr:function(_22){ // Deprecated. Use set() instead.
var _23=this[this.attributeMap["class"]||"domNode"]; // tags:
dojo.removeClass(_23,this["class"]); // deprecated
this["class"]=_22;
dojo.addClass(_23,_22);
},_setStyleAttr:function(_24){
var _25=this[this.attributeMap.style||"domNode"];
if(dojo.isObject(_24)){
dojo.style(_25,_24);
}else{
if(_25.style.cssText){
_25.style.cssText+="; "+_24;
}else{
_25.style.cssText=_24;
}
}
this.style=_24;
},setAttribute:function(_26,_27){
dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0"); dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0");
this.set(_26,_27); this.set(attr, value);
},_attrToDom:function(_28,_29){ },
var _2a=this.attributeMap[_28];
dojo.forEach(dojo.isArray(_2a)?_2a:[_2a],function(_2b){ attr: function(/*String|Object*/name, /*Object?*/value){
var _2c=this[_2b.node||_2b||"domNode"]; // summary:
var _2d=_2b.type||"attribute"; // Set or get properties on a widget instance.
switch(_2d){ // name:
case "attribute": // The property to get or set. If an object is passed here and not
if(dojo.isFunction(_29)){ // a string, its keys are used as names of attributes to be set
_29=dojo.hitch(this,_29); // and the value of the object as values to set in the widget.
} // value:
var _2e=_2b.attribute?_2b.attribute:(/^on[A-Z][a-zA-Z]*$/.test(_28)?_28.toLowerCase():_28); // Optional. If provided, attr() operates as a setter. If omitted,
dojo.attr(_2c,_2e,_29); // the current value of the named property is returned.
break; // description:
case "innerText": // This method is deprecated, use get() or set() directly.
_2c.innerHTML="";
_2c.appendChild(dojo.doc.createTextNode(_29)); // Print deprecation warning but only once per calling function
break;
case "innerHTML":
_2c.innerHTML=_29;
break;
case "class":
dojo.removeClass(_2c,this[_28]);
dojo.addClass(_2c,_29);
break;
}
},this);
this[_28]=_29;
},attr:function(_2f,_30){
if(dojo.config.isDebug){ if(dojo.config.isDebug){
var _31=arguments.callee._ach||(arguments.callee._ach={}),_32=(arguments.callee.caller||"unknown caller").toString(); var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
if(!_31[_32]){ caller = (arguments.callee.caller || "unknown caller").toString();
dojo.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_32,"","2.0"); if(!alreadyCalledHash[caller]){
_31[_32]=true; dojo.deprecated(this.declaredClass + "::attr() is deprecated. Use get() or set() instead, called from " +
caller, "", "2.0");
alreadyCalledHash[caller] = true;
} }
} }
var _33=arguments.length;
if(_33>=2||typeof _2f==="object"){ var args = arguments.length;
if(args >= 2 || typeof name === "object"){ // setter
return this.set.apply(this, arguments); return this.set.apply(this, arguments);
}else{ }else{ // getter
return this.get(_2f); return this.get(name);
} }
},get:function(_34){ },
var _35=this._getAttrNames(_34);
return this[_35.g]?this[_35.g]():this[_34]; ////////////////// ONDIJITCLICK SUPPORT ///////////////////
},set:function(_36,_37){
if(typeof _36==="object"){ // nodesWithKeyClick: [private] String[]
for(var x in _36){ // List of nodes that correctly handle click events via native browser support,
this.set(x,_36[x]); // and don't need dijit's help
} nodesWithKeyClick: ["input", "button"],
return this;
} connect: function(
var _38=this._getAttrNames(_36); /*Object|null*/ obj,
if(this[_38.s]){ /*String|Function*/ event,
var _39=this[_38.s].apply(this,Array.prototype.slice.call(arguments,1)); /*String|Function*/ method){
}else{ // summary:
if(_36 in this.attributeMap){ // Connects specified obj/event to specified method of this object
this._attrToDom(_36,_37); // and registers for disconnect() on widget destroy.
} // description:
var _3a=this[_36]; // Provide widget-specific analog to dojo.connect, except with the
this[_36]=_37; // implicit use of this widget as the target object.
} // This version of connect also provides a special "ondijitclick"
return _39||this; // event which triggers on a click or space or enter keyup.
},_attrPairNames:{},_getAttrNames:function(_3b){ // Events connected with `this.connect` are disconnected upon
var apn=this._attrPairNames; // destruction.
if(apn[_3b]){ // returns:
return apn[_3b]; // A handle that can be passed to `disconnect` in order to disconnect before
} // the widget is destroyed.
var uc=_3b.charAt(0).toUpperCase()+_3b.substr(1); // example:
return (apn[_3b]={n:_3b+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"}); // | var btn = new dijit.form.Button();
},toString:function(){ // | // when foo.bar() is called, call the listener we're going to
return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"; // | // provide in the scope of btn
},getDescendants:function(){ // | btn.connect(foo, "bar", function(){
return this.containerNode?dojo.query("[widgetId]",this.containerNode).map(dijit.byNode):[]; // | console.debug(this.toString());
},getChildren:function(){ // | });
return this.containerNode?dijit.findWidgets(this.containerNode):[]; // tags:
},nodesWithKeyClick:["input","button"],connect:function(obj,_3c,_3d){ // protected
var d=dojo,dc=d._connect,_3e=[];
if(_3c=="ondijitclick"){ var d = dojo,
if(dojo.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){ dc = d._connect,
var m=d.hitch(this,_3d); handles = this.inherited(arguments, [obj, event == "ondijitclick" ? "onclick" : event, method]);
_3e.push(dc(obj,"onkeydown",this,function(e){
if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){ if(event == "ondijitclick"){
// add key based click activation for unsupported nodes.
// do all processing onkey up to prevent spurious clicks
// for details see comments at top of this file where _lastKeyDownNode is defined
if(d.indexOf(this.nodesWithKeyClick, obj.nodeName.toLowerCase()) == -1){ // is NOT input or button
var m = d.hitch(this, method);
handles.push(
dc(obj, "onkeydown", this, function(e){
//console.log(this.id + ": onkeydown, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
if((e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
!e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
// needed on IE for when focus changes between keydown and keyup - otherwise dropdown menus do not work
dijit._lastKeyDownNode = e.target; dijit._lastKeyDownNode = e.target;
// Stop event to prevent scrolling on space key in IE.
// But don't do this for _HasDropDown because it surpresses the onkeypress
// event needed to open the drop down when the user presses the SPACE key.
if(!("openDropDown" in this && obj == this._buttonNode)){
e.preventDefault(); e.preventDefault();
} }
}),dc(obj,"onkeyup",this,function(e){ }
if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target===dijit._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){ }),
dc(obj, "onkeyup", this, function(e){
//console.log(this.id + ": onkeyup, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
if( (e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
e.target == dijit._lastKeyDownNode && // === breaks greasemonkey
!e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
//need reset here or have problems in FF when focus returns to trigger element after closing popup/alert
dijit._lastKeyDownNode = null; dijit._lastKeyDownNode = null;
return m(e); return m(e);
} }
})); })
} );
_3c="onclick";
}
_3e.push(dc(obj,_3c,this,_3d));
this._connects.push(_3e);
return _3e;
},disconnect:function(_3f){
for(var i=0;i<this._connects.length;i++){
if(this._connects[i]==_3f){
dojo.forEach(_3f,dojo.disconnect);
this._connects.splice(i,1);
return;
} }
} }
},subscribe:function(_40,_41){
var d=dojo,_42=d.subscribe(_40,this,_41); return handles; // _Widget.Handle
this._subscribes.push(_42); },
return _42;
},unsubscribe:function(_43){ ////////////////// MISCELLANEOUS METHODS ///////////////////
for(var i=0;i<this._subscribes.length;i++){
if(this._subscribes[i]==_43){ _onShow: function(){
dojo.unsubscribe(_43); // summary:
this._subscribes.splice(i,1); // Internal method called when this widget is made visible.
return; // See `onShow` for details.
}
}
},isLeftToRight:function(){
return this.dir?(this.dir=="ltr"):dojo._isBodyLtr();
},isFocusable:function(){
return this.focus&&(dojo.style(this.domNode,"display")!="none");
},placeAt:function(_44,_45){
if(_44.declaredClass&&_44.addChild){
_44.addChild(this,_45);
}else{
dojo.place(this.domNode,_44,_45);
}
return this;
},_onShow:function(){
this.onShow(); this.onShow();
},onShow:function(){ },
},onHide:function(){
},onClose:function(){ onShow: function(){
return true; // summary:
}}); // Called when this widget becomes the selected pane in a
})(); // `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
// `dijit.layout.AccordionContainer`, etc.
//
// Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
// tags:
// callback
},
onHide: function(){
// summary:
// Called when another widget becomes the selected pane in a
// `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
// `dijit.layout.AccordionContainer`, etc.
//
// Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
// tags:
// callback
},
onClose: function(){
// summary:
// Called when this widget is being displayed as a popup (ex: a Calendar popped
// up from a DateTextBox), and it is hidden.
// This is called from the dijit.popup code, and should not be called directly.
//
// Also used as a parameter for children of `dijit.layout.StackContainer` or subclasses.
// Callback if a user tries to close the child. Child will be closed if this function returns true.
// tags:
// extension
return true; // Boolean
}
});
})();
} }

826
lib/dijit/_WidgetBase.js Normal file
View File

@@ -0,0 +1,826 @@
/*
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._WidgetBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._WidgetBase"] = true;
dojo.provide("dijit._WidgetBase");
dojo.require("dijit._base.manager");
dojo.require("dojo.Stateful");
(function(){
dojo.declare("dijit._WidgetBase", dojo.Stateful, {
// summary:
// Future base class for all Dijit widgets.
// _Widget extends this class adding support for various features needed by desktop.
// id: [const] String
// A unique, opaque ID string that can be assigned by users or by the
// system. If the developer passes an ID which is known not to be
// unique, the specified ID is ignored and the system-generated ID is
// used instead.
id: "",
// lang: [const] String
// Rarely used. Overrides the default Dojo locale used to render this widget,
// as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
// Value must be among the list of locales specified during by the Dojo bootstrap,
// formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
lang: "",
// dir: [const] String
// Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
// attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
// default direction.
dir: "",
// class: String
// HTML class attribute
"class": "",
// style: String||Object
// HTML style attributes as cssText string or name/value hash
style: "",
// title: String
// HTML title attribute.
//
// For form widgets this specifies a tooltip to display when hovering over
// the widget (just like the native HTML title attribute).
//
// For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
// etc., it's used to specify the tab label, accordion pane title, etc.
title: "",
// tooltip: String
// When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
// this specifies the tooltip to appear when the mouse is hovered over that text.
tooltip: "",
// baseClass: [protected] String
// Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
// widget state.
baseClass: "",
// srcNodeRef: [readonly] DomNode
// pointer to original DOM node
srcNodeRef: null,
// domNode: [readonly] DomNode
// This is our visible representation of the widget! Other DOM
// Nodes may by assigned to other properties, usually through the
// template system's dojoAttachPoint syntax, but the domNode
// property is the canonical "top level" node in widget UI.
domNode: null,
// containerNode: [readonly] DomNode
// Designates where children of the source DOM node will be placed.
// "Children" in this case refers to both DOM nodes and widgets.
// For example, for myWidget:
//
// | <div dojoType=myWidget>
// | <b> here's a plain DOM node
// | <span dojoType=subWidget>and a widget</span>
// | <i> and another plain DOM node </i>
// | </div>
//
// containerNode would point to:
//
// | <b> here's a plain DOM node
// | <span dojoType=subWidget>and a widget</span>
// | <i> and another plain DOM node </i>
//
// In templated widgets, "containerNode" is set via a
// dojoAttachPoint assignment.
//
// containerNode must be defined for any widget that accepts innerHTML
// (like ContentPane or BorderContainer or even Button), and conversely
// is null for widgets that don't, like TextBox.
containerNode: null,
/*=====
// _started: Boolean
// startup() has completed.
_started: false,
=====*/
// attributeMap: [protected] Object
// attributeMap sets up a "binding" between attributes (aka properties)
// of the widget and the widget's DOM.
// Changes to widget attributes listed in attributeMap will be
// reflected into the DOM.
//
// For example, calling set('title', 'hello')
// on a TitlePane will automatically cause the TitlePane's DOM to update
// with the new title.
//
// attributeMap is a hash where the key is an attribute of the widget,
// and the value reflects a binding to a:
//
// - DOM node attribute
// | focus: {node: "focusNode", type: "attribute"}
// Maps this.focus to this.focusNode.focus
//
// - DOM node innerHTML
// | title: { node: "titleNode", type: "innerHTML" }
// Maps this.title to this.titleNode.innerHTML
//
// - DOM node innerText
// | title: { node: "titleNode", type: "innerText" }
// Maps this.title to this.titleNode.innerText
//
// - DOM node CSS class
// | myClass: { node: "domNode", type: "class" }
// Maps this.myClass to this.domNode.className
//
// If the value is an array, then each element in the array matches one of the
// formats of the above list.
//
// There are also some shorthands for backwards compatibility:
// - string --> { node: string, type: "attribute" }, for example:
// | "focusNode" ---> { node: "focusNode", type: "attribute" }
// - "" --> { node: "domNode", type: "attribute" }
attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
// _blankGif: [protected] String
// Path to a blank 1x1 image.
// Used by <img> nodes in templates that really get their image via CSS background-image.
_blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
//////////// INITIALIZATION METHODS ///////////////////////////////////////
postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
// summary:
// Kicks off widget instantiation. See create() for details.
// tags:
// private
this.create(params, srcNodeRef);
},
create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
// summary:
// Kick off the life-cycle of a widget
// params:
// Hash of initialization parameters for widget, including
// scalar values (like title, duration etc.) and functions,
// typically callbacks like onClick.
// srcNodeRef:
// If a srcNodeRef (DOM node) is specified:
// - use srcNodeRef.innerHTML as my contents
// - if this is a behavioral widget then apply behavior
// to that srcNodeRef
// - otherwise, replace srcNodeRef with my generated DOM
// tree
// description:
// Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate,
// etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget
// for a discussion of the widget creation lifecycle.
//
// Of course, adventurous developers could override create entirely, but this should
// only be done as a last resort.
// tags:
// private
// store pointer to original DOM tree
this.srcNodeRef = dojo.byId(srcNodeRef);
// For garbage collection. An array of handles returned by Widget.connect()
// Each handle returned from Widget.connect() is an array of handles from dojo.connect()
this._connects = [];
// For garbage collection. An array of handles returned by Widget.subscribe()
// The handle returned from Widget.subscribe() is the handle returned from dojo.subscribe()
this._subscribes = [];
// mix in our passed parameters
if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
if(params){
this.params = params;
dojo._mixin(this, params);
}
this.postMixInProperties();
// generate an id for the widget if one wasn't specified
// (be sure to do this before buildRendering() because that function might
// expect the id to be there.)
if(!this.id){
this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
}
dijit.registry.add(this);
this.buildRendering();
if(this.domNode){
// Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
// Also calls custom setters for all attributes with custom setters.
this._applyAttributes();
// If srcNodeRef was specified, then swap out original srcNode for this widget's DOM tree.
// For 2.0, move this after postCreate(). postCreate() shouldn't depend on the
// widget being attached to the DOM since it isn't when a widget is created programmatically like
// new MyWidget({}). See #11635.
var source = this.srcNodeRef;
if(source && source.parentNode && this.domNode !== source){
source.parentNode.replaceChild(this.domNode, source);
}
}
if(this.domNode){
// Note: for 2.0 may want to rename widgetId to dojo._scopeName + "_widgetId",
// assuming that dojo._scopeName even exists in 2.0
this.domNode.setAttribute("widgetId", this.id);
}
this.postCreate();
// If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
if(this.srcNodeRef && !this.srcNodeRef.parentNode){
delete this.srcNodeRef;
}
this._created = true;
},
_applyAttributes: function(){
// summary:
// Step during widget creation to copy all widget attributes to the
// DOM as per attributeMap and _setXXXAttr functions.
// description:
// Skips over blank/false attribute values, unless they were explicitly specified
// as parameters to the widget, since those are the default anyway,
// and setting tabIndex="" is different than not setting tabIndex at all.
//
// It processes the attributes in the attribute map first, and then
// it goes through and processes the attributes for the _setXXXAttr
// functions that have been specified
// tags:
// private
var condAttrApply = function(attr, scope){
if((scope.params && attr in scope.params) || scope[attr]){
scope.set(attr, scope[attr]);
}
};
// Do the attributes in attributeMap
for(var attr in this.attributeMap){
condAttrApply(attr, this);
}
// And also any attributes with custom setters
dojo.forEach(this._getSetterAttributes(), function(a){
if(!(a in this.attributeMap)){
condAttrApply(a, this);
}
}, this);
},
_getSetterAttributes: function(){
// summary:
// Returns list of attributes with custom setters for this widget
var ctor = this.constructor;
if(!ctor._setterAttrs){
var r = (ctor._setterAttrs = []),
attrs,
proto = ctor.prototype;
for(var fxName in proto){
if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
}
}
}
return ctor._setterAttrs; // String[]
},
postMixInProperties: function(){
// summary:
// Called after the parameters to the widget have been read-in,
// but before the widget template is instantiated. Especially
// useful to set properties that are referenced in the widget
// template.
// tags:
// protected
},
buildRendering: function(){
// summary:
// Construct the UI for this widget, setting this.domNode
// description:
// Most widgets will mixin `dijit._Templated`, which implements this
// method.
// tags:
// protected
if(!this.domNode){
// Create root node if it wasn't created by _Templated
this.domNode = this.srcNodeRef || dojo.create('div');
}
// baseClass is a single class name or occasionally a space-separated list of names.
// Add those classes to the DOMNode. If RTL mode then also add with Rtl suffix.
// TODO: make baseClass custom setter
if(this.baseClass){
var classes = this.baseClass.split(" ");
if(!this.isLeftToRight()){
classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
}
dojo.addClass(this.domNode, classes);
}
},
postCreate: function(){
// summary:
// Processing after the DOM fragment is created
// description:
// Called after the DOM fragment has been created, but not necessarily
// added to the document. Do not include any operations which rely on
// node dimensions or placement.
// tags:
// protected
},
startup: function(){
// summary:
// Processing after the DOM fragment is added to the document
// description:
// Called after a widget and its children have been created and added to the page,
// and all related widgets have finished their create() cycle, up through postCreate().
// This is useful for composite widgets that need to control or layout sub-widgets.
// Many layout widgets can use this as a wiring phase.
this._started = true;
},
//////////// DESTROY FUNCTIONS ////////////////////////////////
destroyRecursive: function(/*Boolean?*/ preserveDom){
// summary:
// Destroy this widget and its descendants
// description:
// This is the generic "destructor" function that all widget users
// should call to cleanly discard with a widget. Once a widget is
// destroyed, it is removed from the manager object.
// preserveDom:
// If true, this method will leave the original DOM structure
// alone of descendant Widgets. Note: This will NOT work with
// dijit._Templated widgets.
this._beingDestroyed = true;
this.destroyDescendants(preserveDom);
this.destroy(preserveDom);
},
destroy: function(/*Boolean*/ preserveDom){
// summary:
// Destroy this widget, but not its descendants.
// This method will, however, destroy internal widgets such as those used within a template.
// preserveDom: Boolean
// If true, this method will leave the original DOM structure alone.
// Note: This will not yet work with _Templated widgets
this._beingDestroyed = true;
this.uninitialize();
var d = dojo,
dfe = d.forEach,
dun = d.unsubscribe;
dfe(this._connects, function(array){
dfe(array, d.disconnect);
});
dfe(this._subscribes, function(handle){
dun(handle);
});
// destroy widgets created as part of template, etc.
dfe(this._supportingWidgets || [], function(w){
if(w.destroyRecursive){
w.destroyRecursive();
}else if(w.destroy){
w.destroy();
}
});
this.destroyRendering(preserveDom);
dijit.registry.remove(this.id);
this._destroyed = true;
},
destroyRendering: function(/*Boolean?*/ preserveDom){
// summary:
// Destroys the DOM nodes associated with this widget
// preserveDom:
// If true, this method will leave the original DOM structure alone
// during tear-down. Note: this will not work with _Templated
// widgets yet.
// tags:
// protected
if(this.bgIframe){
this.bgIframe.destroy(preserveDom);
delete this.bgIframe;
}
if(this.domNode){
if(preserveDom){
dojo.removeAttr(this.domNode, "widgetId");
}else{
dojo.destroy(this.domNode);
}
delete this.domNode;
}
if(this.srcNodeRef){
if(!preserveDom){
dojo.destroy(this.srcNodeRef);
}
delete this.srcNodeRef;
}
},
destroyDescendants: function(/*Boolean?*/ preserveDom){
// summary:
// Recursively destroy the children of this widget and their
// descendants.
// preserveDom:
// If true, the preserveDom attribute is passed to all descendant
// widget's .destroy() method. Not for use with _Templated
// widgets.
// get all direct descendants and destroy them recursively
dojo.forEach(this.getChildren(), function(widget){
if(widget.destroyRecursive){
widget.destroyRecursive(preserveDom);
}
});
},
uninitialize: function(){
// summary:
// Stub function. Override to implement custom widget tear-down
// behavior.
// tags:
// protected
return false;
},
////////////////// GET/SET, CUSTOM SETTERS, ETC. ///////////////////
_setClassAttr: function(/*String*/ value){
// summary:
// Custom setter for the CSS "class" attribute
// tags:
// protected
var mapNode = this[this.attributeMap["class"] || 'domNode'];
dojo.replaceClass(mapNode, value, this["class"]);
this._set("class", value);
},
_setStyleAttr: function(/*String||Object*/ value){
// summary:
// Sets the style attribute of the widget according to value,
// which is either a hash like {height: "5px", width: "3px"}
// or a plain string
// description:
// Determines which node to set the style on based on style setting
// in attributeMap.
// tags:
// protected
var mapNode = this[this.attributeMap.style || 'domNode'];
// Note: technically we should revert any style setting made in a previous call
// to his method, but that's difficult to keep track of.
if(dojo.isObject(value)){
dojo.style(mapNode, value);
}else{
if(mapNode.style.cssText){
mapNode.style.cssText += "; " + value;
}else{
mapNode.style.cssText = value;
}
}
this._set("style", value);
},
_attrToDom: function(/*String*/ attr, /*String*/ value){
// summary:
// Reflect a widget attribute (title, tabIndex, duration etc.) to
// the widget DOM, as specified in attributeMap.
// Note some attributes like "type"
// cannot be processed this way as they are not mutable.
//
// tags:
// private
var commands = this.attributeMap[attr];
dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
// Get target node and what we are doing to that node
var mapNode = this[command.node || command || "domNode"]; // DOM node
var type = command.type || "attribute"; // class, innerHTML, innerText, or attribute
switch(type){
case "attribute":
if(dojo.isFunction(value)){ // functions execute in the context of the widget
value = dojo.hitch(this, value);
}
// Get the name of the DOM node attribute; usually it's the same
// as the name of the attribute in the widget (attr), but can be overridden.
// Also maps handler names to lowercase, like onSubmit --> onsubmit
var attrName = command.attribute ? command.attribute :
(/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
dojo.attr(mapNode, attrName, value);
break;
case "innerText":
mapNode.innerHTML = "";
mapNode.appendChild(dojo.doc.createTextNode(value));
break;
case "innerHTML":
mapNode.innerHTML = value;
break;
case "class":
dojo.replaceClass(mapNode, value, this[attr]);
break;
}
}, this);
},
get: function(name){
// summary:
// Get a property from a widget.
// name:
// The property to get.
// description:
// Get a named property from a widget. The property may
// potentially be retrieved via a getter method. If no getter is defined, this
// just retrieves the object's property.
// For example, if the widget has a properties "foo"
// and "bar" and a method named "_getFooAttr", calling:
// | myWidget.get("foo");
// would be equivalent to writing:
// | widget._getFooAttr();
// and:
// | myWidget.get("bar");
// would be equivalent to writing:
// | widget.bar;
var names = this._getAttrNames(name);
return this[names.g] ? this[names.g]() : this[name];
},
set: function(name, value){
// summary:
// Set a property on a widget
// name:
// The property to set.
// value:
// The value to set in the property.
// description:
// Sets named properties on a widget which may potentially be handled by a
// setter in the widget.
// For example, if the widget has a properties "foo"
// and "bar" and a method named "_setFooAttr", calling:
// | myWidget.set("foo", "Howdy!");
// would be equivalent to writing:
// | widget._setFooAttr("Howdy!");
// and:
// | myWidget.set("bar", 3);
// would be equivalent to writing:
// | widget.bar = 3;
//
// set() may also be called with a hash of name/value pairs, ex:
// | myWidget.set({
// | foo: "Howdy",
// | bar: 3
// | })
// This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
if(typeof name === "object"){
for(var x in name){
this.set(x, name[x]);
}
return this;
}
var names = this._getAttrNames(name);
if(this[names.s]){
// use the explicit setter
var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
}else{
// if param is specified as DOM node attribute, copy it
if(name in this.attributeMap){
this._attrToDom(name, value);
}
this._set(name, value);
}
return result || this;
},
_attrPairNames: {}, // shared between all widgets
_getAttrNames: function(name){
// summary:
// Helper function for get() and set().
// Caches attribute name values so we don't do the string ops every time.
// tags:
// private
var apn = this._attrPairNames;
if(apn[name]){ return apn[name]; }
var uc = name.charAt(0).toUpperCase() + name.substr(1);
return (apn[name] = {
n: name+"Node",
s: "_set"+uc+"Attr",
g: "_get"+uc+"Attr"
});
},
_set: function(/*String*/ name, /*anything*/ value){
// summary:
// Helper function to set new value for specified attribute, and call handlers
// registered with watch() if the value has changed.
var oldValue = this[name];
this[name] = value;
if(this._watchCallbacks && this._created && value !== oldValue){
this._watchCallbacks(name, oldValue, value);
}
},
toString: function(){
// summary:
// Returns a string that represents the widget
// description:
// When a widget is cast to a string, this method will be used to generate the
// output. Currently, it does not implement any sort of reversible
// serialization.
return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
},
getDescendants: function(){
// summary:
// Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
// This method should generally be avoided as it returns widgets declared in templates, which are
// supposed to be internal/hidden, but it's left here for back-compat reasons.
return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : []; // dijit._Widget[]
},
getChildren: function(){
// summary:
// Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
// Does not return nested widgets, nor widgets that are part of this widget's template.
return this.containerNode ? dijit.findWidgets(this.containerNode) : []; // dijit._Widget[]
},
connect: function(
/*Object|null*/ obj,
/*String|Function*/ event,
/*String|Function*/ method){
// summary:
// Connects specified obj/event to specified method of this object
// and registers for disconnect() on widget destroy.
// description:
// Provide widget-specific analog to dojo.connect, except with the
// implicit use of this widget as the target object.
// Events connected with `this.connect` are disconnected upon
// destruction.
// returns:
// A handle that can be passed to `disconnect` in order to disconnect before
// the widget is destroyed.
// example:
// | var btn = new dijit.form.Button();
// | // when foo.bar() is called, call the listener we're going to
// | // provide in the scope of btn
// | btn.connect(foo, "bar", function(){
// | console.debug(this.toString());
// | });
// tags:
// protected
var handles = [dojo._connect(obj, event, this, method)];
this._connects.push(handles);
return handles; // _Widget.Handle
},
disconnect: function(/* _Widget.Handle */ handles){
// summary:
// Disconnects handle created by `connect`.
// Also removes handle from this widget's list of connects.
// tags:
// protected
for(var i=0; i<this._connects.length; i++){
if(this._connects[i] == handles){
dojo.forEach(handles, dojo.disconnect);
this._connects.splice(i, 1);
return;
}
}
},
subscribe: function(
/*String*/ topic,
/*String|Function*/ method){
// summary:
// Subscribes to the specified topic and calls the specified method
// of this object and registers for unsubscribe() on widget destroy.
// description:
// Provide widget-specific analog to dojo.subscribe, except with the
// implicit use of this widget as the target object.
// example:
// | var btn = new dijit.form.Button();
// | // when /my/topic is published, this button changes its label to
// | // be the parameter of the topic.
// | btn.subscribe("/my/topic", function(v){
// | this.set("label", v);
// | });
var handle = dojo.subscribe(topic, this, method);
// return handles for Any widget that may need them
this._subscribes.push(handle);
return handle;
},
unsubscribe: function(/*Object*/ handle){
// summary:
// Unsubscribes handle created by this.subscribe.
// Also removes handle from this widget's list of subscriptions
for(var i=0; i<this._subscribes.length; i++){
if(this._subscribes[i] == handle){
dojo.unsubscribe(handle);
this._subscribes.splice(i, 1);
return;
}
}
},
isLeftToRight: function(){
// summary:
// Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
// tags:
// protected
return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr(); //Boolean
},
placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
// summary:
// Place this widget's domNode reference somewhere in the DOM based
// on standard dojo.place conventions, or passing a Widget reference that
// contains and addChild member.
//
// description:
// A convenience function provided in all _Widgets, providing a simple
// shorthand mechanism to put an existing (or newly created) Widget
// somewhere in the dom, and allow chaining.
//
// reference:
// The String id of a domNode, a domNode reference, or a reference to a Widget posessing
// an addChild method.
//
// position:
// If passed a string or domNode reference, the position argument
// accepts a string just as dojo.place does, one of: "first", "last",
// "before", or "after".
//
// If passed a _Widget reference, and that widget reference has an ".addChild" method,
// it will be called passing this widget instance into that method, supplying the optional
// position index passed.
//
// returns:
// dijit._Widget
// Provides a useful return of the newly created dijit._Widget instance so you
// can "chain" this function by instantiating, placing, then saving the return value
// to a variable.
//
// example:
// | // create a Button with no srcNodeRef, and place it in the body:
// | var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
// | // now, 'button' is still the widget reference to the newly created button
// | dojo.connect(button, "onClick", function(e){ console.log('click'); });
//
// example:
// | // create a button out of a node with id="src" and append it to id="wrapper":
// | var button = new dijit.form.Button({},"src").placeAt("wrapper");
//
// example:
// | // place a new button as the first element of some div
// | var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
//
// example:
// | // create a contentpane and add it to a TabContainer
// | var tc = dijit.byId("myTabs");
// | new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
if(reference.declaredClass && reference.addChild){
reference.addChild(this, position);
}else{
dojo.place(this.domNode, reference, position);
}
return this;
}
});
})();
}

View File

@@ -1,11 +1,11 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base"]){ if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base"] = true; dojo._hasResource["dijit._base"] = true;
dojo.provide("dijit._base"); dojo.provide("dijit._base");
dojo.require("dijit._base.focus"); dojo.require("dijit._base.focus");
@@ -17,4 +17,7 @@ dojo.require("dijit._base.sniff");
dojo.require("dijit._base.typematic"); dojo.require("dijit._base.typematic");
dojo.require("dijit._base.wai"); dojo.require("dijit._base.wai");
dojo.require("dijit._base.window"); dojo.require("dijit._base.window");
} }

View File

@@ -1,63 +1,119 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.focus"]){ if(!dojo._hasResource["dijit._base.focus"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.focus"] = true; dojo._hasResource["dijit._base.focus"] = true;
dojo.provide("dijit._base.focus"); dojo.provide("dijit._base.focus");
dojo.require("dojo.window"); dojo.require("dojo.window");
dojo.require("dijit._base.manager"); dojo.require("dijit._base.manager");
dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){
// summary:
// These functions are used to query or set the focus and selection.
//
// Also, they trace when widgets become activated/deactivated,
// so that the widget can fire _onFocus/_onBlur events.
// "Active" here means something similar to "focused", but
// "focus" isn't quite the right word because we keep track of
// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
// on the Menu or a MenuItem, since they are considered part of the
// ComboButton widget. It only happens when focus is shifted
// somewhere completely different.
dojo.mixin(dijit, {
// _curFocus: DomNode
// Currently focused item on screen
_curFocus: null,
// _prevFocus: DomNode
// Previously focused item on screen
_prevFocus: null,
isCollapsed: function(){
// summary:
// Returns true if there is no text selected
return dijit.getBookmark().isCollapsed; return dijit.getBookmark().isCollapsed;
},getBookmark:function(){ },
var bm,rg,tg,_1=dojo.doc.selection,cf=dijit._curFocus;
getBookmark: function(){
// summary:
// Retrieves a bookmark that can be used with moveToBookmark to return to the same range
var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
if(dojo.global.getSelection){ if(dojo.global.getSelection){
_1=dojo.global.getSelection(); //W3C Range API for selections.
if(_1){ sel = dojo.global.getSelection();
if(_1.isCollapsed){ if(sel){
if(sel.isCollapsed){
tg = cf? cf.tagName : ""; tg = cf? cf.tagName : "";
if(tg){ if(tg){
//Create a fake rangelike item to restore selections.
tg = tg.toLowerCase(); tg = tg.toLowerCase();
if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){ if(tg == "textarea" ||
_1={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true}; (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
return {isCollapsed:(_1.end<=_1.start),mark:_1}; sel = {
start: cf.selectionStart,
end: cf.selectionEnd,
node: cf,
pRange: true
};
return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
} }
} }
bm = {isCollapsed:true}; bm = {isCollapsed:true};
if(sel.rangeCount){
bm.mark = sel.getRangeAt(0).cloneRange();
}
}else{ }else{
rg=_1.getRangeAt(0); rg = sel.getRangeAt(0);
bm = {isCollapsed: false, mark: rg.cloneRange()}; bm = {isCollapsed: false, mark: rg.cloneRange()};
} }
} }
}else{ }else if(sel){
if(_1){ // If the current focus was a input of some sort and no selection, don't bother saving
// a native bookmark. This is because it causes issues with dialog/page selection restore.
// So, we need to create psuedo bookmarks to work with.
tg = cf ? cf.tagName : ""; tg = cf ? cf.tagName : "";
tg = tg.toLowerCase(); tg = tg.toLowerCase();
if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){ if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
if(_1.type&&_1.type.toLowerCase()=="none"){ if(sel.type && sel.type.toLowerCase() == "none"){
return {isCollapsed:true,mark:null}; return {
isCollapsed: true,
mark: null
}
}else{ }else{
rg=_1.createRange(); rg = sel.createRange();
return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}}; return {
isCollapsed: rg.text && rg.text.length?false:true,
mark: {
range: rg,
pRange: true
}
};
} }
} }
bm = {}; bm = {};
//'IE' way for selections.
try{ try{
rg=_1.createRange(); // createRange() throws exception when dojo in iframe
bm.isCollapsed=!(_1.type=="Text"?rg.htmlText.length:rg.length); //and nothing selected, see #9632
} rg = sel.createRange();
catch(e){ bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
}catch(e){
bm.isCollapsed = true; bm.isCollapsed = true;
return bm; return bm;
} }
if(_1.type.toUpperCase()=="CONTROL"){ if(sel.type.toUpperCase() == 'CONTROL'){
if(rg.length){ if(rg.length){
bm.mark=[]; bm.mark=[];
var i=0,_2=rg.length; var i=0,len=rg.length;
while(i<_2){ while(i<len){
bm.mark.push(rg.item(i++)); bm.mark.push(rg.item(i++));
} }
}else{ }else{
@@ -70,138 +126,266 @@ bm.mark=rg.getBookmark();
}else{ }else{
console.warn("No idea how to store the current selection for this browser!"); console.warn("No idea how to store the current selection for this browser!");
} }
} return bm; // Object
return bm; },
},moveToBookmark:function(_3){
var _4=dojo.doc,_5=_3.mark; moveToBookmark: function(/*Object*/bookmark){
if(_5){ // summary:
// Moves current selection to a bookmark
// bookmark:
// This should be a returned object from dijit.getBookmark()
var _doc = dojo.doc,
mark = bookmark.mark;
if(mark){
if(dojo.global.getSelection){ if(dojo.global.getSelection){
var _6=dojo.global.getSelection(); //W3C Rangi API (FF, WebKit, Opera, etc)
if(_6&&_6.removeAllRanges){ var sel = dojo.global.getSelection();
if(_5.pRange){ if(sel && sel.removeAllRanges){
var r=_5; if(mark.pRange){
var r = mark;
var n = r.node; var n = r.node;
n.selectionStart = r.start; n.selectionStart = r.start;
n.selectionEnd = r.end; n.selectionEnd = r.end;
}else{ }else{
_6.removeAllRanges(); sel.removeAllRanges();
_6.addRange(_5); sel.addRange(mark);
} }
}else{ }else{
console.warn("No idea how to restore selection for this browser!"); console.warn("No idea how to restore selection for this browser!");
} }
}else{ }else if(_doc.selection && mark){
if(_4.selection&&_5){ //'IE' way.
var rg; var rg;
if(_5.pRange){ if(mark.pRange){
rg=_5.range; rg = mark.range;
}else{ }else if(dojo.isArray(mark)){
if(dojo.isArray(_5)){ rg = _doc.body.createControlRange();
rg=_4.body.createControlRange(); //rg.addElement does not have call/apply method, so can not call it directly
dojo.forEach(_5,function(n){ //rg is not available in "range.addElement(item)", so can't use that either
dojo.forEach(mark, function(n){
rg.addElement(n); rg.addElement(n);
}); });
}else{ }else{
rg=_4.body.createTextRange(); rg = _doc.body.createTextRange();
rg.moveToBookmark(_5); rg.moveToBookmark(mark);
}
} }
rg.select(); rg.select();
} }
} }
} },
},getFocus:function(_7,_8){
var _9=!dijit._curFocus||(_7&&dojo.isDescendant(dijit._curFocus,_7.domNode))?dijit._prevFocus:dijit._curFocus; getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
return {node:_9,bookmark:(_9==dijit._curFocus)&&dojo.withGlobal(_8||dojo.global,dijit.getBookmark),openedForWindow:_8}; // summary:
},focus:function(_a){ // Called as getFocus(), this returns an Object showing the current focus
if(!_a){ // and selected text.
return; //
} // Called as getFocus(widget), where widget is a (widget representing) a button
var _b="node" in _a?_a.node:_a,_c=_a.bookmark,_d=_a.openedForWindow,_e=_c?_c.isCollapsed:false; // that was just pressed, it returns where focus was before that button
if(_b){ // was pressed. (Pressing the button may have either shifted focus to the button,
var _f=(_b.tagName.toLowerCase()=="iframe")?_b.contentWindow:_b; // or removed focus altogether.) In this case the selected text is not returned,
if(_f&&_f.focus){ // since it can't be accurately determined.
//
// menu: dijit._Widget or {domNode: DomNode} structure
// The button that was just pressed. If focus has disappeared or moved
// to this button, returns the previous focus. In this case the bookmark
// information is already lost, and null is returned.
//
// openedForWindow:
// iframe in which menu was opened
//
// returns:
// A handle to restore focus/selection, to be passed to `dijit.focus`
var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
return {
node: node,
bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
openedForWindow: openedForWindow
}; // Object
},
focus: function(/*Object || DomNode */ handle){
// summary:
// Sets the focused node and the selection according to argument.
// To set focus to an iframe's content, pass in the iframe itself.
// handle:
// object returned by get(), or a DomNode
if(!handle){ return; }
var node = "node" in handle ? handle.node : handle, // because handle is either DomNode or a composite object
bookmark = handle.bookmark,
openedForWindow = handle.openedForWindow,
collapsed = bookmark ? bookmark.isCollapsed : false;
// Set the focus
// Note that for iframe's we need to use the <iframe> to follow the parentNode chain,
// but we need to set focus to iframe.contentWindow
if(node){
var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
if(focusNode && focusNode.focus){
try{ try{
_f.focus(); // Gecko throws sometimes if setting focus is impossible,
// node not displayed or something like that
focusNode.focus();
}catch(e){/*quiet*/}
} }
catch(e){ dijit._onFocusNode(node);
} }
}
dijit._onFocusNode(_b); // set the selection
} // do not need to restore if current selection is not empty
if(_c&&dojo.withGlobal(_d||dojo.global,dijit.isCollapsed)&&!_e){ // (use keyboard to select a menu item) or if previous selection was collapsed
if(_d){ // as it may cause focus shift (Esp in IE).
_d.focus(); if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
if(openedForWindow){
openedForWindow.focus();
} }
try{ try{
dojo.withGlobal(_d||dojo.global,dijit.moveToBookmark,null,[_c]); dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
} }catch(e2){
catch(e2){ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
} }
} }
},_activeStack:[],registerIframe:function(_10){ },
return dijit.registerWin(_10.contentWindow,_10);
},unregisterIframe:function(_11){ // _activeStack: dijit._Widget[]
dijit.unregisterWin(_11); // List of currently active widgets (focused widget and it's ancestors)
},registerWin:function(_12,_13){ _activeStack: [],
var _14=function(evt){
registerIframe: function(/*DomNode*/ iframe){
// summary:
// Registers listeners on the specified iframe so that any click
// or focus event on that iframe (or anything in it) is reported
// as a focus/click event on the <iframe> itself.
// description:
// Currently only used by editor.
// returns:
// Handle to pass to unregisterIframe()
return dijit.registerWin(iframe.contentWindow, iframe);
},
unregisterIframe: function(/*Object*/ handle){
// summary:
// Unregisters listeners on the specified iframe created by registerIframe.
// After calling be sure to delete or null out the handle itself.
// handle:
// Handle returned by registerIframe()
dijit.unregisterWin(handle);
},
registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
// summary:
// Registers listeners on the specified window (either the main
// window or an iframe's window) to detect when the user has clicked somewhere
// or focused somewhere.
// description:
// Users should call registerIframe() instead of this method.
// targetWindow:
// If specified this is the window associated with the iframe,
// i.e. iframe.contentWindow.
// effectiveNode:
// If specified, report any focus events inside targetWindow as
// an event on effectiveNode, rather than on evt.target.
// returns:
// Handle to pass to unregisterWin()
// TODO: make this function private in 2.0; Editor/users should call registerIframe(),
var mousedownListener = function(evt){
dijit._justMouseDowned = true; dijit._justMouseDowned = true;
setTimeout(function(){ setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
dijit._justMouseDowned=false;
},0); // workaround weird IE bug where the click is on an orphaned node
// (first time clicking a Select/DropDownButton inside a TooltipDialog)
if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){ if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
return; return;
} }
dijit._onTouchNode(_13||evt.target||evt.srcElement,"mouse");
dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
}; };
var doc=dojo.isIE?_12.document.documentElement:_12.document; //dojo.connect(targetWindow, "onscroll", ???);
// Listen for blur and focus events on targetWindow's document.
// IIRC, I'm using attachEvent() rather than dojo.connect() because focus/blur events don't bubble
// through dojo.connect(), and also maybe to catch the focus events early, before onfocus handlers
// fire.
// Connect to <html> (rather than document) on IE to avoid memory leaks, but document on other browsers because
// (at least for FF) the focus event doesn't fire on <html> or <body>.
var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
if(doc){ if(doc){
if(dojo.isIE){ if(dojo.isIE){
doc.attachEvent("onmousedown",_14); targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
var _15=function(evt){ var activateListener = function(evt){
if(evt.srcElement.tagName.toLowerCase()!="#document"&&dijit.isTabNavigable(evt.srcElement)){ // IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
dijit._onFocusNode(_13||evt.srcElement); // Should consider those more like a mouse-click than a focus....
if(evt.srcElement.tagName.toLowerCase() != "#document" &&
dijit.isTabNavigable(evt.srcElement)){
dijit._onFocusNode(effectiveNode || evt.srcElement);
}else{ }else{
dijit._onTouchNode(_13||evt.srcElement); dijit._onTouchNode(effectiveNode || evt.srcElement);
} }
}; };
doc.attachEvent("onactivate",_15); doc.attachEvent('onactivate', activateListener);
var _16=function(evt){ var deactivateListener = function(evt){
dijit._onBlurNode(_13||evt.srcElement); dijit._onBlurNode(effectiveNode || evt.srcElement);
}; };
doc.attachEvent("ondeactivate",_16); doc.attachEvent('ondeactivate', deactivateListener);
return function(){ return function(){
doc.detachEvent("onmousedown",_14); targetWindow.document.detachEvent('onmousedown', mousedownListener);
doc.detachEvent("onactivate",_15); doc.detachEvent('onactivate', activateListener);
doc.detachEvent("ondeactivate",_16); doc.detachEvent('ondeactivate', deactivateListener);
doc=null; doc = null; // prevent memory leak (apparent circular reference via closure)
}; };
}else{ }else{
doc.addEventListener("mousedown",_14,true); doc.body.addEventListener('mousedown', mousedownListener, true);
var _17=function(evt){ var focusListener = function(evt){
dijit._onFocusNode(_13||evt.target); dijit._onFocusNode(effectiveNode || evt.target);
}; };
doc.addEventListener("focus",_17,true); doc.addEventListener('focus', focusListener, true);
var _18=function(evt){ var blurListener = function(evt){
dijit._onBlurNode(_13||evt.target); dijit._onBlurNode(effectiveNode || evt.target);
}; };
doc.addEventListener("blur",_18,true); doc.addEventListener('blur', blurListener, true);
return function(){ return function(){
doc.removeEventListener("mousedown",_14,true); doc.body.removeEventListener('mousedown', mousedownListener, true);
doc.removeEventListener("focus",_17,true); doc.removeEventListener('focus', focusListener, true);
doc.removeEventListener("blur",_18,true); doc.removeEventListener('blur', blurListener, true);
doc=null; doc = null; // prevent memory leak (apparent circular reference via closure)
}; };
} }
} }
},unregisterWin:function(_19){ },
_19&&_19();
},_onBlurNode:function(_1a){ unregisterWin: function(/*Handle*/ handle){
// summary:
// Unregisters listeners on the specified window (either the main
// window or an iframe's window) according to handle returned from registerWin().
// After calling be sure to delete or null out the handle itself.
// Currently our handle is actually a function
handle && handle();
},
_onBlurNode: function(/*DomNode*/ node){
// summary:
// Called when focus leaves a node.
// Usually ignored, _unless_ it *isn't* follwed by touching another node,
// which indicates that we tabbed off the last field on the page,
// in which case every widget is marked inactive
dijit._prevFocus = dijit._curFocus; dijit._prevFocus = dijit._curFocus;
dijit._curFocus = null; dijit._curFocus = null;
if(dijit._justMouseDowned){ if(dijit._justMouseDowned){
// the mouse down caused a new widget to be marked as active; this blur event
// is coming late, so ignore it.
return; return;
} }
// if the blur event isn't followed by a focus event then mark all widgets as inactive.
if(dijit._clearActiveWidgetsTimer){ if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer); clearTimeout(dijit._clearActiveWidgetsTimer);
} }
@@ -210,90 +394,137 @@ delete dijit._clearActiveWidgetsTimer;
dijit._setStack([]); dijit._setStack([]);
dijit._prevFocus = null; dijit._prevFocus = null;
}, 100); }, 100);
},_onTouchNode:function(_1b,by){ },
_onTouchNode: function(/*DomNode*/ node, /*String*/ by){
// summary:
// Callback when node is focused or mouse-downed
// node:
// The node that was touched.
// by:
// "mouse" if the focus/touch was caused by a mouse down event
// ignore the recent blurNode event
if(dijit._clearActiveWidgetsTimer){ if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer); clearTimeout(dijit._clearActiveWidgetsTimer);
delete dijit._clearActiveWidgetsTimer; delete dijit._clearActiveWidgetsTimer;
} }
var _1c=[];
// compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
var newStack=[];
try{ try{
while(_1b){ while(node){
var _1d=dojo.attr(_1b,"dijitPopupParent"); var popupParent = dojo.attr(node, "dijitPopupParent");
if(_1d){ if(popupParent){
_1b=dijit.byId(_1d).domNode; node=dijit.byId(popupParent).domNode;
}else{ }else if(node.tagName && node.tagName.toLowerCase() == "body"){
if(_1b.tagName&&_1b.tagName.toLowerCase()=="body"){ // is this the root of the document or just the root of an iframe?
if(_1b===dojo.body()){ if(node === dojo.body()){
// node is the root of the main document
break; break;
} }
_1b=dojo.window.get(_1b.ownerDocument).frameElement; // otherwise, find the iframe this node refers to (can't access it via parentNode,
// need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
node=dojo.window.get(node.ownerDocument).frameElement;
}else{ }else{
var id=_1b.getAttribute&&_1b.getAttribute("widgetId"),_1e=id&&dijit.byId(id); // if this node is the root node of a widget, then add widget id to stack,
if(_1e&&!(by=="mouse"&&_1e.get("disabled"))){ // except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
_1c.unshift(id); // to support MenuItem)
var id = node.getAttribute && node.getAttribute("widgetId"),
widget = id && dijit.byId(id);
if(widget && !(by == "mouse" && widget.get("disabled"))){
newStack.unshift(id);
} }
_1b=_1b.parentNode; node=node.parentNode;
} }
} }
} }catch(e){ /* squelch */ }
}
catch(e){ dijit._setStack(newStack, by);
} },
dijit._setStack(_1c,by);
},_onFocusNode:function(_1f){ _onFocusNode: function(/*DomNode*/ node){
if(!_1f){ // summary:
// Callback when node is focused
if(!node){
return; return;
} }
if(_1f.nodeType==9){
return; if(node.nodeType == 9){
} // Ignore focus events on the document itself. This is here so that
dijit._onTouchNode(_1f); // (for example) clicking the up/down arrows of a spinner
if(_1f==dijit._curFocus){ // (which don't get focus) won't cause that widget to blur. (FF issue)
return; return;
} }
dijit._onTouchNode(node);
if(node == dijit._curFocus){ return; }
if(dijit._curFocus){ if(dijit._curFocus){
dijit._prevFocus = dijit._curFocus; dijit._prevFocus = dijit._curFocus;
} }
dijit._curFocus=_1f; dijit._curFocus = node;
dojo.publish("focusNode",[_1f]); dojo.publish("focusNode", [node]);
},_setStack:function(_20,by){ },
var _21=dijit._activeStack;
dijit._activeStack=_20; _setStack: function(/*String[]*/ newStack, /*String*/ by){
for(var _22=0;_22<Math.min(_21.length,_20.length);_22++){ // summary:
if(_21[_22]!=_20[_22]){ // The stack of active widgets has changed. Send out appropriate events and records new stack.
// newStack:
// array of widget id's, starting from the top (outermost) widget
// by:
// "mouse" if the focus/touch was caused by a mouse down event
var oldStack = dijit._activeStack;
dijit._activeStack = newStack;
// compare old stack to new stack to see how many elements they have in common
for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
if(oldStack[nCommon] != newStack[nCommon]){
break; break;
} }
} }
var _23;
for(var i=_21.length-1;i>=_22;i--){ var widget;
_23=dijit.byId(_21[i]); // for all elements that have gone out of focus, send blur event
if(_23){ for(var i=oldStack.length-1; i>=nCommon; i--){
_23._focused=false; widget = dijit.byId(oldStack[i]);
_23._hasBeenBlurred=true; if(widget){
if(_23._onBlur){ widget._focused = false;
_23._onBlur(by); widget.set("focused", false);
widget._hasBeenBlurred = true;
if(widget._onBlur){
widget._onBlur(by);
} }
dojo.publish("widgetBlur",[_23,by]); dojo.publish("widgetBlur", [widget, by]);
} }
} }
for(i=_22;i<_20.length;i++){
_23=dijit.byId(_20[i]); // for all element that have come into focus, send focus event
if(_23){ for(i=nCommon; i<newStack.length; i++){
_23._focused=true; widget = dijit.byId(newStack[i]);
if(_23._onFocus){ if(widget){
_23._onFocus(by); widget._focused = true;
widget.set("focused", true);
if(widget._onFocus){
widget._onFocus(by);
} }
dojo.publish("widgetFocus",[_23,by]); dojo.publish("widgetFocus", [widget, by]);
} }
} }
}}); }
});
// register top window and all the iframes it contains
dojo.addOnLoad(function(){ dojo.addOnLoad(function(){
var _24=dijit.registerWin(window); var handle = dijit.registerWin(window);
if(dojo.isIE){ if(dojo.isIE){
dojo.addOnWindowUnload(function(){ dojo.addOnWindowUnload(function(){
dijit.unregisterWin(_24); dijit.unregisterWin(handle);
_24=null; handle = null;
}); })
} }
}); });
} }

View File

@@ -1,245 +1,493 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.manager"]){ if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.manager"] = true; dojo._hasResource["dijit._base.manager"] = true;
dojo.provide("dijit._base.manager"); dojo.provide("dijit._base.manager");
dojo.declare("dijit.WidgetSet",null,{constructor:function(){
dojo.declare("dijit.WidgetSet", null, {
// summary:
// A set of widgets indexed by id. A default instance of this class is
// available as `dijit.registry`
//
// example:
// Create a small list of widgets:
// | var ws = new dijit.WidgetSet();
// | ws.add(dijit.byId("one"));
// | ws.add(dijit.byId("two"));
// | // destroy both:
// | ws.forEach(function(w){ w.destroy(); });
//
// example:
// Using dijit.registry:
// | dijit.registry.forEach(function(w){ /* do something */ });
constructor: function(){
this._hash = {}; this._hash = {};
this.length = 0; this.length = 0;
},add:function(_1){ },
if(this._hash[_1.id]){
throw new Error("Tried to register widget with id=="+_1.id+" but that id is already registered"); add: function(/*dijit._Widget*/ widget){
// summary:
// Add a widget to this list. If a duplicate ID is detected, a error is thrown.
//
// widget: dijit._Widget
// Any dijit._Widget subclass.
if(this._hash[widget.id]){
throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
} }
this._hash[_1.id]=_1; this._hash[widget.id] = widget;
this.length++; this.length++;
},remove:function(id){ },
remove: function(/*String*/ id){
// summary:
// Remove a widget from this WidgetSet. Does not destroy the widget; simply
// removes the reference.
if(this._hash[id]){ if(this._hash[id]){
delete this._hash[id]; delete this._hash[id];
this.length--; this.length--;
} }
},forEach:function(_2,_3){ },
_3=_3||dojo.global;
forEach: function(/*Function*/ func, /* Object? */thisObj){
// summary:
// Call specified function for each widget in this set.
//
// func:
// A callback function to run for each item. Is passed the widget, the index
// in the iteration, and the full hash, similar to `dojo.forEach`.
//
// thisObj:
// An optional scope parameter
//
// example:
// Using the default `dijit.registry` instance:
// | dijit.registry.forEach(function(widget){
// | console.log(widget.declaredClass);
// | });
//
// returns:
// Returns self, in order to allow for further chaining.
thisObj = thisObj || dojo.global;
var i = 0, id; var i = 0, id;
for(id in this._hash){ for(id in this._hash){
_2.call(_3,this._hash[id],i++,this._hash); func.call(thisObj, this._hash[id], i++, this._hash);
} }
return this; return this; // dijit.WidgetSet
},filter:function(_4,_5){ },
_5=_5||dojo.global;
var _6=new dijit.WidgetSet(),i=0,id; filter: function(/*Function*/ filter, /* Object? */thisObj){
// summary:
// Filter down this WidgetSet to a smaller new WidgetSet
// Works the same as `dojo.filter` and `dojo.NodeList.filter`
//
// filter:
// Callback function to test truthiness. Is passed the widget
// reference and the pseudo-index in the object.
//
// thisObj: Object?
// Option scope to use for the filter function.
//
// example:
// Arbitrary: select the odd widgets in this list
// | dijit.registry.filter(function(w, i){
// | return i % 2 == 0;
// | }).forEach(function(w){ /* odd ones */ });
thisObj = thisObj || dojo.global;
var res = new dijit.WidgetSet(), i = 0, id;
for(id in this._hash){ for(id in this._hash){
var w = this._hash[id]; var w = this._hash[id];
if(_4.call(_5,w,i++,this._hash)){ if(filter.call(thisObj, w, i++, this._hash)){
_6.add(w); res.add(w);
} }
} }
return _6; return res; // dijit.WidgetSet
},byId:function(id){ },
return this._hash[id];
},byClass:function(_7){ byId: function(/*String*/ id){
var _8=new dijit.WidgetSet(),id,_9; // summary:
// Find a widget in this list by it's id.
// example:
// Test if an id is in a particular WidgetSet
// | var ws = new dijit.WidgetSet();
// | ws.add(dijit.byId("bar"));
// | var t = ws.byId("bar") // returns a widget
// | var x = ws.byId("foo"); // returns undefined
return this._hash[id]; // dijit._Widget
},
byClass: function(/*String*/ cls){
// summary:
// Reduce this widgetset to a new WidgetSet of a particular `declaredClass`
//
// cls: String
// The Class to scan for. Full dot-notated string.
//
// example:
// Find all `dijit.TitlePane`s in a page:
// | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); });
var res = new dijit.WidgetSet(), id, widget;
for(id in this._hash){ for(id in this._hash){
_9=this._hash[id]; widget = this._hash[id];
if(_9.declaredClass==_7){ if(widget.declaredClass == cls){
_8.add(_9); res.add(widget);
} }
} }
return _8; return res; // dijit.WidgetSet
},toArray:function(){ },
toArray: function(){
// summary:
// Convert this WidgetSet into a true Array
//
// example:
// Work with the widget .domNodes in a real Array
// | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; });
var ar = []; var ar = [];
for(var id in this._hash){ for(var id in this._hash){
ar.push(this._hash[id]); ar.push(this._hash[id]);
} }
return ar; return ar; // dijit._Widget[]
},map:function(_a,_b){ },
return dojo.map(this.toArray(),_a,_b);
},every:function(_c,_d){ map: function(/* Function */func, /* Object? */thisObj){
_d=_d||dojo.global; // summary:
// Create a new Array from this WidgetSet, following the same rules as `dojo.map`
// example:
// | var nodes = dijit.registry.map(function(w){ return w.domNode; });
//
// returns:
// A new array of the returned values.
return dojo.map(this.toArray(), func, thisObj); // Array
},
every: function(func, thisObj){
// summary:
// A synthetic clone of `dojo.every` acting explicitly on this WidgetSet
//
// func: Function
// A callback function run for every widget in this list. Exits loop
// when the first false return is encountered.
//
// thisObj: Object?
// Optional scope parameter to use for the callback
thisObj = thisObj || dojo.global;
var x = 0, i; var x = 0, i;
for(i in this._hash){ for(i in this._hash){
if(!_c.call(_d,this._hash[i],x++,this._hash)){ if(!func.call(thisObj, this._hash[i], x++, this._hash)){
return false; return false; // Boolean
} }
} }
return true; return true; // Boolean
},some:function(_e,_f){ },
_f=_f||dojo.global;
some: function(func, thisObj){
// summary:
// A synthetic clone of `dojo.some` acting explictly on this WidgetSet
//
// func: Function
// A callback function run for every widget in this list. Exits loop
// when the first true return is encountered.
//
// thisObj: Object?
// Optional scope parameter to use for the callback
thisObj = thisObj || dojo.global;
var x = 0, i; var x = 0, i;
for(i in this._hash){ for(i in this._hash){
if(_e.call(_f,this._hash[i],x++,this._hash)){ if(func.call(thisObj, this._hash[i], x++, this._hash)){
return true; return true; // Boolean
} }
} }
return false; return false; // Boolean
}}); }
});
(function(){ (function(){
dijit.registry=new dijit.WidgetSet();
var _10=dijit.registry._hash,_11=dojo.attr,_12=dojo.hasAttr,_13=dojo.style; /*=====
dijit.byId=function(id){ dijit.registry = {
return typeof id=="string"?_10[id]:id; // summary:
// A list of widgets on a page.
// description:
// Is an instance of `dijit.WidgetSet`
}; };
var _14={}; =====*/
dijit.getUniqueId=function(_15){ dijit.registry = new dijit.WidgetSet();
var hash = dijit.registry._hash,
attr = dojo.attr,
hasAttr = dojo.hasAttr,
style = dojo.style;
dijit.byId = function(/*String|dijit._Widget*/ id){
// summary:
// Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
return typeof id == "string" ? hash[id] : id; // dijit._Widget
};
var _widgetTypeCtr = {};
dijit.getUniqueId = function(/*String*/widgetType){
// summary:
// Generates a unique id for a given widgetType
var id; var id;
do{ do{
id=_15+"_"+(_15 in _14?++_14[_15]:_14[_15]=0); id = widgetType + "_" +
}while(_10[id]); (widgetType in _widgetTypeCtr ?
return dijit._scopeName=="dijit"?id:dijit._scopeName+"_"+id; ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
}while(hash[id]);
return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
}; };
dijit.findWidgets=function(_16){
var _17=[]; dijit.findWidgets = function(/*DomNode*/ root){
function _18(_19){ // summary:
for(var _1a=_19.firstChild;_1a;_1a=_1a.nextSibling){ // Search subtree under root returning widgets found.
if(_1a.nodeType==1){ // Doesn't search for nested widgets (ie, widgets inside other widgets).
var _1b=_1a.getAttribute("widgetId");
if(_1b){ var outAry = [];
_17.push(_10[_1b]);
function getChildrenHelper(root){
for(var node = root.firstChild; node; node = node.nextSibling){
if(node.nodeType == 1){
var widgetId = node.getAttribute("widgetId");
if(widgetId){
var widget = hash[widgetId];
if(widget){ // may be null on page w/multiple dojo's loaded
outAry.push(widget);
}
}else{ }else{
_18(_1a); getChildrenHelper(node);
} }
} }
} }
}
getChildrenHelper(root);
return outAry;
}; };
_18(_16);
return _17;
};
dijit._destroyAll = function(){ dijit._destroyAll = function(){
// summary:
// Code to destroy all widgets and do other cleanup on page unload
// Clean up focus manager lingering references to widgets and nodes
dijit._curFocus = null; dijit._curFocus = null;
dijit._prevFocus = null; dijit._prevFocus = null;
dijit._activeStack = []; dijit._activeStack = [];
dojo.forEach(dijit.findWidgets(dojo.body()),function(_1c){
if(!_1c._destroyed){ // Destroy all the widgets, top down
if(_1c.destroyRecursive){ dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
_1c.destroyRecursive(); // Avoid double destroy of widgets like Menu that are attached to <body>
}else{ // even though they are logically children of other widgets.
if(_1c.destroy){ if(!widget._destroyed){
_1c.destroy(); if(widget.destroyRecursive){
} widget.destroyRecursive();
}else if(widget.destroy){
widget.destroy();
} }
} }
}); });
}; };
if(dojo.isIE){ if(dojo.isIE){
// Only run _destroyAll() for IE because we think it's only necessary in that case,
// and because it causes problems on FF. See bug #3531 for details.
dojo.addOnWindowUnload(function(){ dojo.addOnWindowUnload(function(){
dijit._destroyAll(); dijit._destroyAll();
}); });
} }
dijit.byNode=function(_1d){
return _10[_1d.getAttribute("widgetId")]; dijit.byNode = function(/*DOMNode*/ node){
// summary:
// Returns the widget corresponding to the given DOMNode
return hash[node.getAttribute("widgetId")]; // dijit._Widget
}; };
dijit.getEnclosingWidget=function(_1e){
while(_1e){ dijit.getEnclosingWidget = function(/*DOMNode*/ node){
var id=_1e.getAttribute&&_1e.getAttribute("widgetId"); // summary:
// Returns the widget whose DOM tree contains the specified DOMNode, or null if
// the node is not contained within the DOM tree of any widget
while(node){
var id = node.getAttribute && node.getAttribute("widgetId");
if(id){ if(id){
return _10[id]; return hash[id];
} }
_1e=_1e.parentNode; node = node.parentNode;
} }
return null; return null;
}; };
var _1f=(dijit._isElementShown=function(_20){
var s=_13(_20); var shown = (dijit._isElementShown = function(/*Element*/ elem){
return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_11(_20,"type")!="hidden"); var s = style(elem);
return (s.visibility != "hidden")
&& (s.visibility != "collapsed")
&& (s.display != "none")
&& (attr(elem, "type") != "hidden");
}); });
dijit.hasDefaultTabStop=function(_21){
switch(_21.nodeName.toLowerCase()){ dijit.hasDefaultTabStop = function(/*Element*/ elem){
// summary:
// Tests if element is tab-navigable even without an explicit tabIndex setting
// No explicit tabIndex setting, need to investigate node type
switch(elem.nodeName.toLowerCase()){
case "a": case "a":
return _12(_21,"href"); // An <a> w/out a tabindex is only navigable if it has an href
return hasAttr(elem, "href");
case "area": case "area":
case "button": case "button":
case "input": case "input":
case "object": case "object":
case "select": case "select":
case "textarea": case "textarea":
// These are navigable by default
return true; return true;
case "iframe": case "iframe":
if(dojo.isMoz){ // If it's an editor <iframe> then it's tab navigable.
var body;
try{ try{
return _21.contentDocument.designMode=="on"; // non-IE
var contentDocument = elem.contentDocument;
if("designMode" in contentDocument && contentDocument.designMode == "on"){
return true;
} }
catch(err){ body = contentDocument.body;
return false; }catch(e1){
} // contentWindow.document isn't accessible within IE7/8
}else{ // if the iframe.src points to a foreign url and this
if(dojo.isWebKit){ // page contains an element, that could get focus
var doc=_21.contentDocument,_22=doc&&doc.body;
return _22&&_22.contentEditable=="true";
}else{
try{ try{
doc=_21.contentWindow.document; body = elem.contentWindow.document.body;
_22=doc&&doc.body; }catch(e2){
return _22&&_22.firstChild&&_22.firstChild.contentEditable=="true";
}
catch(e){
return false; return false;
} }
} }
} return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
default: default:
return _21.contentEditable=="true"; return elem.contentEditable == 'true';
} }
}; };
var _23=(dijit.isTabNavigable=function(_24){
if(_11(_24,"disabled")){ var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
// summary:
// Tests if an element is tab-navigable
// TODO: convert (and rename method) to return effective tabIndex; will save time in _getTabNavigable()
if(attr(elem, "disabled")){
return false; return false;
}else if(hasAttr(elem, "tabIndex")){
// Explicit tab index setting
return attr(elem, "tabIndex") >= 0; // boolean
}else{ }else{
if(_12(_24,"tabIndex")){ // No explicit tabIndex setting, so depends on node type
return _11(_24,"tabIndex")>=0; return dijit.hasDefaultTabStop(elem);
}else{
return dijit.hasDefaultTabStop(_24);
}
} }
}); });
dijit._getTabNavigable=function(_25){
var _26,_27,_28,_29,_2a,_2b; dijit._getTabNavigable = function(/*DOMNode*/ root){
var _2c=function(_2d){ // summary:
dojo.query("> *",_2d).forEach(function(_2e){ // Finds descendants of the specified root node.
if((dojo.isIE&&_2e.scopeName!=="HTML")||!_1f(_2e)){ //
// description:
// Finds the following descendants of the specified root node:
// * the first tab-navigable element in document order
// without a tabIndex or with tabIndex="0"
// * the last tab-navigable element in document order
// without a tabIndex or with tabIndex="0"
// * the first element in document order with the lowest
// positive tabIndex value
// * the last element in document order with the highest
// positive tabIndex value
var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
function radioName(node) {
// If this element is part of a radio button group, return the name for that group.
return node && node.tagName.toLowerCase() == "input" &&
node.type && node.type.toLowerCase() == "radio" &&
node.name && node.name.toLowerCase();
}
var walkTree = function(/*DOMNode*/parent){
dojo.query("> *", parent).forEach(function(child){
// Skip hidden elements, and also non-HTML elements (those in custom namespaces) in IE,
// since show() invokes getAttribute("type"), which crash on VML nodes in IE.
if((dojo.isIE && child.scopeName!=="HTML") || !shown(child)){
return; return;
} }
if(_23(_2e)){
var _2f=_11(_2e,"tabIndex"); if(isTabNavigable(child)){
if(!_12(_2e,"tabIndex")||_2f==0){ var tabindex = attr(child, "tabIndex");
if(!_26){ if(!hasAttr(child, "tabIndex") || tabindex == 0){
_26=_2e; if(!first){ first = child; }
last = child;
}else if(tabindex > 0){
if(!lowest || tabindex < lowestTabindex){
lowestTabindex = tabindex;
lowest = child;
} }
_27=_2e; if(!highest || tabindex >= highestTabindex){
}else{ highestTabindex = tabindex;
if(_2f>0){ highest = child;
if(!_28||_2f<_29){
_29=_2f;
_28=_2e;
}
if(!_2a||_2f>=_2b){
_2b=_2f;
_2a=_2e;
} }
} }
var rn = radioName(child);
if(dojo.attr(child, "checked") && rn) {
radioSelected[rn] = child;
} }
} }
if(_2e.nodeName.toUpperCase()!="SELECT"){ if(child.nodeName.toUpperCase() != 'SELECT'){
_2c(_2e); walkTree(child);
} }
}); });
}; };
if(_1f(_25)){ if(shown(root)){ walkTree(root) }
_2c(_25); function rs(node) {
// substitute checked radio button for unchecked one, if there is a checked one with the same name.
return radioSelected[radioName(node)] || node;
} }
return {first:_26,last:_27,lowest:_28,highest:_2a}; return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
}
dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
// summary:
// Finds the descendant of the specified root node
// that is first in the tabbing order
var elems = dijit._getTabNavigable(dojo.byId(root));
return elems.lowest ? elems.lowest : elems.first; // DomNode
}; };
dijit.getFirstInTabbingOrder=function(_30){
var _31=dijit._getTabNavigable(dojo.byId(_30)); dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
return _31.lowest?_31.lowest:_31.first; // summary:
}; // Finds the descendant of the specified root node
dijit.getLastInTabbingOrder=function(_32){ // that is last in the tabbing order
var _33=dijit._getTabNavigable(dojo.byId(_32)); var elems = dijit._getTabNavigable(dojo.byId(root));
return _33.last?_33.last:_33.highest; return elems.last ? elems.last : elems.highest; // DomNode
}; };
/*=====
dojo.mixin(dijit, {
// defaultDuration: Integer
// The default animation speed (in ms) to use for all Dijit
// transitional animations, unless otherwise specified
// on a per-instance basis. Defaults to 200, overrided by
// `djConfig.defaultDuration`
defaultDuration: 200
});
=====*/
dijit.defaultDuration = dojo.config["defaultDuration"] || 200; dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
})(); })();
} }

View File

@@ -1,111 +1,376 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.place"]){ if(!dojo._hasResource["dijit._base.place"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.place"] = true; dojo._hasResource["dijit._base.place"] = true;
dojo.provide("dijit._base.place"); dojo.provide("dijit._base.place");
dojo.require("dojo.window"); dojo.require("dojo.window");
dojo.require("dojo.AdapterRegistry"); dojo.require("dojo.AdapterRegistry");
dijit.getViewport = function(){ dijit.getViewport = function(){
// summary:
// Returns the dimensions and scroll position of the viewable area of a browser window
return dojo.window.getBox(); return dojo.window.getBox();
}; };
dijit.placeOnScreen=function(_1,_2,_3,_4){
var _5=dojo.map(_3,function(_6){ /*=====
var c={corner:_6,pos:{x:_2.x,y:_2.y}}; dijit.__Position = function(){
if(_4){ // x: Integer
c.pos.x+=_6.charAt(1)=="L"?_4.x:-_4.x; // horizontal coordinate in pixels, relative to document body
c.pos.y+=_6.charAt(0)=="T"?_4.y:-_4.y; // y: Integer
// vertical coordinate in pixels, relative to document body
thix.x = x;
this.y = y;
}
=====*/
dijit.placeOnScreen = function(
/* DomNode */ node,
/* dijit.__Position */ pos,
/* String[] */ corners,
/* dijit.__Position? */ padding){
// summary:
// Positions one of the node's corners at specified position
// such that node is fully visible in viewport.
// description:
// NOTE: node is assumed to be absolutely or relatively positioned.
// pos:
// Object like {x: 10, y: 20}
// corners:
// Array of Strings representing order to try corners in, like ["TR", "BL"].
// Possible values are:
// * "BL" - bottom left
// * "BR" - bottom right
// * "TL" - top left
// * "TR" - top right
// padding:
// set padding to put some buffer around the element you want to position.
// example:
// Try to place node's top right corner at (10,20).
// If that makes node go (partially) off screen, then try placing
// bottom left corner at (10,20).
// | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])
var choices = dojo.map(corners, function(corner){
var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
if(padding){
c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
} }
return c; return c;
}); });
return dijit._place(_1,_5);
return dijit._place(node, choices);
}
dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
// summary:
// Given a list of spots to put node, put it at the first spot where it fits,
// of if it doesn't fit anywhere then the place with the least overflow
// choices: Array
// Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }
// Above example says to put the top-left corner of the node at (10,20)
// layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)
// for things like tooltip, they are displayed differently (and have different dimensions)
// based on their orientation relative to the parent. This adjusts the popup based on orientation.
// It also passes in the available size for the popup, which is useful for tooltips to
// tell them that their width is limited to a certain amount. layoutNode() may return a value expressing
// how much the popup had to be modified to fit into the available space. This is used to determine
// what the best placement is.
// aroundNodeCoords: Object
// Size of aroundNode, ex: {w: 200, h: 50}
// get {x: 10, y: 10, w: 100, h:100} type obj representing position of
// viewport over document
var view = dojo.window.getBox();
// This won't work if the node is inside a <div style="position: relative">,
// so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong
// and also it might get cutoff)
if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
dojo.body().appendChild(node);
}
var best = null;
dojo.some(choices, function(choice){
var corner = choice.corner;
var pos = choice.pos;
var overflow = 0;
// calculate amount of space available given specified position of node
var spaceAvailable = {
w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
}; };
dijit._place=function(_7,_8,_9){
var _a=dojo.window.getBox(); // configure node to be displayed in given position relative to button
if(!_7.parentNode||String(_7.parentNode.tagName).toLowerCase()!="body"){ // (need to do this in order to get an accurate size for the node, because
dojo.body().appendChild(_7); // a tooltip's size changes based on position, due to triangle)
if(layoutNode){
var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
overflow = typeof res == "undefined" ? 0 : res;
} }
var _b=null;
dojo.some(_8,function(_c){ // get node's size
var _d=_c.corner; var style = node.style;
var _e=_c.pos; var oldDisplay = style.display;
if(_9){ var oldVis = style.visibility;
_9(_7,_c.aroundCorner,_d); style.visibility = "hidden";
style.display = "";
var mb = dojo.marginBox(node);
style.display = oldDisplay;
style.visibility = oldVis;
// coordinates and size of node with specified corner placed at pos,
// and clipped by viewport
var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
width = endX - startX,
height = endY - startY;
overflow += (mb.w - width) + (mb.h - height);
if(best == null || overflow < best.overflow){
best = {
corner: corner,
aroundCorner: choice.aroundCorner,
x: startX,
y: startY,
w: width,
h: height,
overflow: overflow,
spaceAvailable: spaceAvailable
};
} }
var _f=_7.style;
var _10=_f.display; return !overflow;
var _11=_f.visibility;
_f.visibility="hidden";
_f.display="";
var mb=dojo.marginBox(_7);
_f.display=_10;
_f.visibility=_11;
var _12=Math.max(_a.l,_d.charAt(1)=="L"?_e.x:(_e.x-mb.w)),_13=Math.max(_a.t,_d.charAt(0)=="T"?_e.y:(_e.y-mb.h)),_14=Math.min(_a.l+_a.w,_d.charAt(1)=="L"?(_12+mb.w):_e.x),_15=Math.min(_a.t+_a.h,_d.charAt(0)=="T"?(_13+mb.h):_e.y),_16=_14-_12,_17=_15-_13,_18=(mb.w-_16)+(mb.h-_17);
if(_b==null||_18<_b.overflow){
_b={corner:_d,aroundCorner:_c.aroundCorner,x:_12,y:_13,w:_16,h:_17,overflow:_18};
}
return !_18;
}); });
_7.style.left=_b.x+"px";
_7.style.top=_b.y+"px"; // In case the best position is not the last one we checked, need to call
if(_b.overflow&&_9){ // layoutNode() again.
_9(_7,_b.aroundCorner,_b.corner); if(best.overflow && layoutNode){
layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
} }
return _b;
}; // And then position the node. Do this last, after the layoutNode() above
dijit.placeOnScreenAroundNode=function(_19,_1a,_1b,_1c){ // has sized the node, due to browser quirks when the viewport is scrolled
_1a=dojo.byId(_1a); // (specifically that a Tooltip will shrink to fit as though the window was
var _1d=_1a.style.display; // scrolled to the left).
_1a.style.display=""; //
var _1e=dojo.position(_1a,true); // In RTL mode, set style.right rather than style.left so in the common case,
_1a.style.display=_1d; // window resizes move the popup along with the aroundNode.
return dijit._placeOnScreenAroundRect(_19,_1e.x,_1e.y,_1e.w,_1e.h,_1b,_1c); var l = dojo._isBodyLtr(),
}; s = node.style;
dijit.placeOnScreenAroundRectangle=function(_1f,_20,_21,_22){ s.top = best.y + "px";
return dijit._placeOnScreenAroundRect(_1f,_20.x,_20.y,_20.width,_20.height,_21,_22); s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
};
dijit._placeOnScreenAroundRect=function(_23,x,y,_24,_25,_26,_27){ return best;
var _28=[];
for(var _29 in _26){
_28.push({aroundCorner:_29,corner:_26[_29],pos:{x:x+(_29.charAt(1)=="L"?0:_24),y:y+(_29.charAt(0)=="T"?0:_25)}});
} }
return dijit._place(_23,_28,_27);
dijit.placeOnScreenAroundNode = function(
/* DomNode */ node,
/* DomNode */ aroundNode,
/* Object */ aroundCorners,
/* Function? */ layoutNode){
// summary:
// Position node adjacent or kitty-corner to aroundNode
// such that it's fully visible in viewport.
//
// description:
// Place node such that corner of node touches a corner of
// aroundNode, and that node is fully visible.
//
// aroundCorners:
// Ordered list of pairs of corners to try matching up.
// Each pair of corners is represented as a key/value in the hash,
// where the key corresponds to the aroundNode's corner, and
// the value corresponds to the node's corner:
//
// | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...}
//
// The following strings are used to represent the four corners:
// * "BL" - bottom left
// * "BR" - bottom right
// * "TL" - top left
// * "TR" - top right
//
// layoutNode: Function(node, aroundNodeCorner, nodeCorner)
// For things like tooltip, they are displayed differently (and have different dimensions)
// based on their orientation relative to the parent. This adjusts the popup based on orientation.
//
// example:
// | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});
// This will try to position node such that node's top-left corner is at the same position
// as the bottom left corner of the aroundNode (ie, put node below
// aroundNode, with left edges aligned). If that fails it will try to put
// the bottom-right corner of node where the top right corner of aroundNode is
// (ie, put node above aroundNode, with right edges aligned)
//
// get coordinates of aroundNode
aroundNode = dojo.byId(aroundNode);
var aroundNodePos = dojo.position(aroundNode, true);
// place the node around the calculated rectangle
return dijit._placeOnScreenAroundRect(node,
aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h, // rectangle
aroundCorners, layoutNode);
}; };
/*=====
dijit.__Rectangle = function(){
// x: Integer
// horizontal offset in pixels, relative to document body
// y: Integer
// vertical offset in pixels, relative to document body
// width: Integer
// width in pixels
// height: Integer
// height in pixels
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
=====*/
dijit.placeOnScreenAroundRectangle = function(
/* DomNode */ node,
/* dijit.__Rectangle */ aroundRect,
/* Object */ aroundCorners,
/* Function */ layoutNode){
// summary:
// Like dijit.placeOnScreenAroundNode(), except that the "around"
// parameter is an arbitrary rectangle on the screen (x, y, width, height)
// instead of a dom node.
return dijit._placeOnScreenAroundRect(node,
aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
aroundCorners, layoutNode);
};
dijit._placeOnScreenAroundRect = function(
/* DomNode */ node,
/* Number */ x,
/* Number */ y,
/* Number */ width,
/* Number */ height,
/* Object */ aroundCorners,
/* Function */ layoutNode){
// summary:
// Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
// of a rectangle to place node adjacent to.
// TODO: combine with placeOnScreenAroundRectangle()
// Generate list of possible positions for node
var choices = [];
for(var nodeCorner in aroundCorners){
choices.push( {
aroundCorner: nodeCorner,
corner: aroundCorners[nodeCorner],
pos: {
x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
}
});
}
return dijit._place(node, choices, layoutNode, {w: width, h: height});
};
dijit.placementRegistry= new dojo.AdapterRegistry(); dijit.placementRegistry= new dojo.AdapterRegistry();
dijit.placementRegistry.register("node",function(n,x){ dijit.placementRegistry.register("node",
return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined"; function(n, x){
},dijit.placeOnScreenAroundNode); return typeof x == "object" &&
dijit.placementRegistry.register("rect",function(n,x){ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x; },
},dijit.placeOnScreenAroundRectangle); dijit.placeOnScreenAroundNode);
dijit.placeOnScreenAroundElement=function(_2a,_2b,_2c,_2d){ dijit.placementRegistry.register("rect",
function(n, x){
return typeof x == "object" &&
"x" in x && "y" in x && "width" in x && "height" in x;
},
dijit.placeOnScreenAroundRectangle);
dijit.placeOnScreenAroundElement = function(
/* DomNode */ node,
/* Object */ aroundElement,
/* Object */ aroundCorners,
/* Function */ layoutNode){
// summary:
// Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
// for the "around" argument and finds a proper processor to place a node.
return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments); return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
}; };
dijit.getPopupAroundAlignment=function(_2e,_2f){
var _30={}; dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
dojo.forEach(_2e,function(pos){ // summary:
// Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit.placeOnScreenAroundElement.
//
// position: String[]
// This variable controls the position of the drop down.
// It's an array of strings with the following values:
//
// * before: places drop down to the left of the target node/widget, or to the right in
// the case of RTL scripts like Hebrew and Arabic
// * after: places drop down to the right of the target node/widget, or to the left in
// the case of RTL scripts like Hebrew and Arabic
// * above: drop down goes above target node
// * below: drop down goes below target node
//
// The list is positions is tried, in order, until a position is found where the drop down fits
// within the viewport.
//
// leftToRight: Boolean
// Whether the popup will be displaying in leftToRight mode.
//
var align = {};
dojo.forEach(position, function(pos){
switch(pos){ switch(pos){
case "after": case "after":
_30[_2f?"BR":"BL"]=_2f?"BL":"BR"; align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
break; break;
case "before": case "before":
_30[_2f?"BL":"BR"]=_2f?"BR":"BL"; align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
break; break;
case "below-alt":
leftToRight = !leftToRight;
// fall through
case "below": case "below":
_30[_2f?"BL":"BR"]=_2f?"TL":"TR"; // first try to align left borders, next try to align right borders (or reverse for RTL mode)
_30[_2f?"BR":"BL"]=_2f?"TR":"TL"; align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
break; break;
case "above-alt":
leftToRight = !leftToRight;
// fall through
case "above": case "above":
default: default:
_30[_2f?"TL":"TR"]=_2f?"BL":"BR"; // first try to align left borders, next try to align right borders (or reverse for RTL mode)
_30[_2f?"TR":"TL"]=_2f?"BR":"BL"; align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
break; break;
} }
}); });
return _30; return align;
}; };
} }

View File

@@ -1,151 +1,396 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.popup"]){ if(!dojo._hasResource["dijit._base.popup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.popup"] = true; dojo._hasResource["dijit._base.popup"] = true;
dojo.provide("dijit._base.popup"); dojo.provide("dijit._base.popup");
dojo.require("dijit._base.focus"); dojo.require("dijit._base.focus");
dojo.require("dijit._base.place"); dojo.require("dijit._base.place");
dojo.require("dijit._base.window"); dojo.require("dijit._base.window");
dijit.popup={_stack:[],_beginZIndex:1000,_idGen:1,moveOffScreen:function(_1){
var _2=_1.parentNode;
if(!_2||!dojo.hasClass(_2,"dijitPopup")){ /*=====
_2=dojo.create("div",{"class":"dijitPopup",style:{visibility:"hidden",top:"-9999px"}},dojo.body()); dijit.popup.__OpenArgs = function(){
dijit.setWaiRole(_2,"presentation"); // popup: Widget
_2.appendChild(_1); // widget to display
// parent: Widget
// the button etc. that is displaying this popup
// around: DomNode
// DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
// x: Integer
// Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
// y: Integer
// Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
// orient: Object|String
// When the around parameter is specified, orient should be an
// ordered list of tuples of the form (around-node-corner, popup-node-corner).
// dijit.popup.open() tries to position the popup according to each tuple in the list, in order,
// until the popup appears fully within the viewport.
//
// The default value is {BL:'TL', TL:'BL'}, which represents a list of two tuples:
// 1. (BL, TL)
// 2. (TL, BL)
// where BL means "bottom left" and "TL" means "top left".
// So by default, it first tries putting the popup below the around node, left-aligning them,
// and then tries to put it above the around node, still left-aligning them. Note that the
// default is horizontally reversed when in RTL mode.
//
// When an (x,y) position is specified rather than an around node, orient is either
// "R" or "L". R (for right) means that it tries to put the popup to the right of the mouse,
// specifically positioning the popup's top-right corner at the mouse position, and if that doesn't
// fit in the viewport, then it tries, in order, the bottom-right corner, the top left corner,
// and the top-right corner.
// onCancel: Function
// callback when user has canceled the popup by
// 1. hitting ESC or
// 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
// i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
// onClose: Function
// callback whenever this popup is closed
// onExecute: Function
// callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
// padding: dijit.__Position
// adding a buffer around the opening position. This is only useful when around is not set.
this.popup = popup;
this.parent = parent;
this.around = around;
this.x = x;
this.y = y;
this.orient = orient;
this.onCancel = onCancel;
this.onClose = onClose;
this.onExecute = onExecute;
this.padding = padding;
} }
var s=_1.style; =====*/
dijit.popup = {
// summary:
// This singleton is used to show/hide widgets as popups.
// _stack: dijit._Widget[]
// Stack of currently popped up widgets.
// (someone opened _stack[0], and then it opened _stack[1], etc.)
_stack: [],
// _beginZIndex: Number
// Z-index of the first popup. (If first popup opens other
// popups they get a higher z-index.)
_beginZIndex: 1000,
_idGen: 1,
_createWrapper: function(/*Widget || DomNode*/ widget){
// summary:
// Initialization for widgets that will be used as popups.
// Puts widget inside a wrapper DIV (if not already in one),
// and returns pointer to that wrapper DIV.
var wrapper = widget.declaredClass ? widget._popupWrapper : (widget.parentNode && dojo.hasClass(widget.parentNode, "dijitPopup")),
node = widget.domNode || widget;
if(!wrapper){
// Create wrapper <div> for when this widget [in the future] will be used as a popup.
// This is done early because of IE bugs where creating/moving DOM nodes causes focus
// to go wonky, see tests/robot/Toolbar.html to reproduce
wrapper = dojo.create("div",{
"class":"dijitPopup",
style:{ display: "none"},
role: "presentation"
}, dojo.body());
wrapper.appendChild(node);
var s = node.style;
s.display = ""; s.display = "";
s.visibility = ""; s.visibility = "";
s.position = ""; s.position = "";
s.top = "0px"; s.top = "0px";
dojo.style(_2,{visibility:"hidden",top:"-9999px"});
},getTopPopup:function(){ if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
var _3=this._stack; widget._popupWrapper = wrapper;
for(var pi=_3.length-1;pi>0&&_3[pi].parent===_3[pi-1].widget;pi--){ dojo.connect(widget, "destroy", function(){
dojo.destroy(wrapper);
delete widget._popupWrapper;
});
} }
return _3[pi];
},open:function(_4){
var _5=this._stack,_6=_4.popup,_7=_4.orient||((_4.parent?_4.parent.isLeftToRight():dojo._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_8=_4.around,id=(_4.around&&_4.around.id)?(_4.around.id+"_dropdown"):("popup_"+this._idGen++);
var _9=_6.domNode.parentNode;
if(!_9||!dojo.hasClass(_9,"dijitPopup")){
this.moveOffScreen(_6.domNode);
_9=_6.domNode.parentNode;
} }
dojo.attr(_9,{id:id,style:{zIndex:this._beginZIndex+_5.length},"class":"dijitPopup "+(_6.baseClass||_6["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_4.parent?_4.parent.id:""});
return wrapper;
},
moveOffScreen: function(/*Widget || DomNode*/ widget){
// summary:
// Moves the popup widget off-screen.
// Do not use this method to hide popups when not in use, because
// that will create an accessibility issue: the offscreen popup is
// still in the tabbing order.
// Create wrapper if not already there
var wrapper = this._createWrapper(widget);
dojo.style(wrapper, {
visibility: "hidden",
top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
display: ""
});
},
hide: function(/*dijit._Widget*/ widget){
// summary:
// Hide this popup widget (until it is ready to be shown).
// Initialization for widgets that will be used as popups
//
// Also puts widget inside a wrapper DIV (if not already in one)
//
// If popup widget needs to layout it should
// do so when it is made visible, and popup._onShow() is called.
// Create wrapper if not already there
var wrapper = this._createWrapper(widget);
dojo.style(wrapper, "display", "none");
},
getTopPopup: function(){
// summary:
// Compute the closest ancestor popup that's *not* a child of another popup.
// Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
var stack = this._stack;
for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
/* do nothing, just trying to get right value for pi */
}
return stack[pi];
},
open: function(/*dijit.popup.__OpenArgs*/ args){
// summary:
// Popup the widget at the specified position
//
// example:
// opening at the mouse position
// | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
//
// example:
// opening the widget as a dropdown
// | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
//
// Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
// (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
var stack = this._stack,
widget = args.popup,
orient = args.orient || (
(args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
{'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
{'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
),
around = args.around,
id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
// If we are opening a new popup that isn't a child of a currently opened popup, then
// close currently opened popup(s). This should happen automatically when the old popups
// gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
dijit.popup.close(stack[stack.length-1].widget);
}
// Get pointer to popup wrapper, and create wrapper if it doesn't exist
var wrapper = this._createWrapper(widget);
dojo.attr(wrapper, {
id: id,
style: {
zIndex: this._beginZIndex + stack.length
},
"class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
dijitPopupParent: args.parent ? args.parent.id : ""
});
if(dojo.isIE || dojo.isMoz){ if(dojo.isIE || dojo.isMoz){
var _a=_9.childNodes[1]; if(!widget.bgIframe){
if(!_a){ // setting widget.bgIframe triggers cleanup in _Widget.destroy()
_a=new dijit.BackgroundIframe(_9); widget.bgIframe = new dijit.BackgroundIframe(wrapper);
} }
} }
var _b=_8?dijit.placeOnScreenAroundElement(_9,_8,_7,_6.orient?dojo.hitch(_6,"orient"):null):dijit.placeOnScreen(_9,_4,_7=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_4.padding);
_9.style.visibility="visible"; // position the wrapper node and make it visible
_6.domNode.style.visibility="visible"; var best = around ?
var _c=[]; dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
_c.push(dojo.connect(_9,"onkeypress",this,function(_d){ dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
if(_d.charOrCode==dojo.keys.ESCAPE&&_4.onCancel){
dojo.stopEvent(_d); wrapper.style.display = "";
_4.onCancel(); wrapper.style.visibility = "visible";
}else{ widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
if(_d.charOrCode===dojo.keys.TAB){
dojo.stopEvent(_d); var handlers = [];
var _e=this.getTopPopup();
if(_e&&_e.onCancel){ // provide default escape and tab key handling
_e.onCancel(); // (this will work for any widget, not just menu)
} handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
dojo.stopEvent(evt);
args.onCancel();
}else if(evt.charOrCode === dojo.keys.TAB){
dojo.stopEvent(evt);
var topPopup = this.getTopPopup();
if(topPopup && topPopup.onCancel){
topPopup.onCancel();
} }
} }
})); }));
if(_6.onCancel){
_c.push(dojo.connect(_6,"onCancel",_4.onCancel)); // watch for cancel/execute events on the popup and notify the caller
// (for a menu, "execute" means clicking an item)
if(widget.onCancel){
handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
} }
_c.push(dojo.connect(_6,_6.onExecute?"onExecute":"onChange",this,function(){
var _f=this.getTopPopup(); handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
if(_f&&_f.onExecute){ var topPopup = this.getTopPopup();
_f.onExecute(); if(topPopup && topPopup.onExecute){
topPopup.onExecute();
} }
})); }));
_5.push({wrapper:_9,iframe:_a,widget:_6,parent:_4.parent,onExecute:_4.onExecute,onCancel:_4.onCancel,onClose:_4.onClose,handlers:_c});
if(_6.onOpen){ stack.push({
_6.onOpen(_b); widget: widget,
parent: args.parent,
onExecute: args.onExecute,
onCancel: args.onCancel,
onClose: args.onClose,
handlers: handlers
});
if(widget.onOpen){
// TODO: in 2.0 standardize onShow() (used by StackContainer) and onOpen() (used here)
widget.onOpen(best);
} }
return _b;
},close:function(_10){ return best;
var _11=this._stack; },
while(dojo.some(_11,function(_12){
return _12.widget==_10; close: function(/*dijit._Widget?*/ popup){
})){ // summary:
var top=_11.pop(),_13=top.wrapper,_14=top.iframe,_15=top.widget,_16=top.onClose; // Close specified popup and any popups that it parented.
if(_15.onClose){ // If no popup is specified, closes all popups.
_15.onClose();
var stack = this._stack;
// Basically work backwards from the top of the stack closing popups
// until we hit the specified popup, but IIRC there was some issue where closing
// a popup would cause others to close too. Thus if we are trying to close B in [A,B,C]
// closing C might close B indirectly and then the while() condition will run where stack==[A]...
// so the while condition is constructed defensively.
while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
(!popup && stack.length)){
var top = stack.pop(),
widget = top.widget,
onClose = top.onClose;
if(widget.onClose){
// TODO: in 2.0 standardize onHide() (used by StackContainer) and onClose() (used here)
widget.onClose();
} }
dojo.forEach(top.handlers, dojo.disconnect); dojo.forEach(top.handlers, dojo.disconnect);
if(_15&&_15.domNode){
this.moveOffScreen(_15.domNode); // Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
}else{ if(widget && widget.domNode){
dojo.destroy(_13); this.hide(widget);
} }
if(_16){
_16(); if(onClose){
onClose();
} }
} }
}}; }
};
// TODO: remove dijit._frames, it isn't being used much, since popups never release their
// iframes (see [22236])
dijit._frames = new function(){ dijit._frames = new function(){
var _17=[]; // summary:
// cache of iframes
var queue = [];
this.pop = function(){ this.pop = function(){
var _18; var iframe;
if(_17.length){ if(queue.length){
_18=_17.pop(); iframe = queue.pop();
_18.style.display=""; iframe.style.display="";
}else{ }else{
if(dojo.isIE){ if(dojo.isIE < 9){
var _19=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\""; var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
var _1a="<iframe src='"+_19+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>"; var html="<iframe src='" + burl + "'"
_18=dojo.doc.createElement(_1a); + " style='position: absolute; left: 0px; top: 0px;"
+ "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
iframe = dojo.doc.createElement(html);
}else{ }else{
_18=dojo.create("iframe"); iframe = dojo.create("iframe");
_18.src="javascript:\"\""; iframe.src = 'javascript:""';
_18.className="dijitBackgroundIframe"; iframe.className = "dijitBackgroundIframe";
dojo.style(_18,"opacity",0.1); dojo.style(iframe, "opacity", 0.1);
} }
_18.tabIndex=-1; iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
dijit.setWaiRole(_18,"presentation"); dijit.setWaiRole(iframe,"presentation");
} }
return _18; return iframe;
};
this.push=function(_1b){
_1b.style.display="none";
_17.push(_1b);
}; };
this.push = function(iframe){
iframe.style.display="none";
queue.push(iframe);
}
}(); }();
dijit.BackgroundIframe=function(_1c){
if(!_1c.id){
throw new Error("no id"); dijit.BackgroundIframe = function(/*DomNode*/ node){
} // summary:
// For IE/FF z-index schenanigans. id attribute is required.
//
// description:
// new dijit.BackgroundIframe(node)
// Makes a background iframe as a child of node, that fills
// area (and position) of node
if(!node.id){ throw new Error("no id"); }
if(dojo.isIE || dojo.isMoz){ if(dojo.isIE || dojo.isMoz){
var _1d=dijit._frames.pop(); var iframe = (this.iframe = dijit._frames.pop());
_1c.appendChild(_1d); node.appendChild(iframe);
if(dojo.isIE<7){ if(dojo.isIE<7 || dojo.isQuirks){
this.resize(_1c); this.resize(node);
this._conn=dojo.connect(_1c,"onresize",this,function(){ this._conn = dojo.connect(node, 'onresize', this, function(){
this.resize(_1c); this.resize(node);
}); });
}else{ }else{
dojo.style(_1d,{width:"100%",height:"100%"}); dojo.style(iframe, {
width: '100%',
height: '100%'
});
} }
this.iframe=_1d;
} }
}; };
dojo.extend(dijit.BackgroundIframe,{resize:function(_1e){
if(this.iframe&&dojo.isIE<7){ dojo.extend(dijit.BackgroundIframe, {
dojo.style(this.iframe,{width:_1e.offsetWidth+"px",height:_1e.offsetHeight+"px"}); resize: function(node){
// summary:
// Resize the iframe so it's the same size as node.
// Needed on IE6 and IE/quirks because height:100% doesn't work right.
if(this.iframe){
dojo.style(this.iframe, {
width: node.offsetWidth + 'px',
height: node.offsetHeight + 'px'
});
} }
},destroy:function(){ },
destroy: function(){
// summary:
// destroy the iframe
if(this._conn){ if(this._conn){
dojo.disconnect(this._conn); dojo.disconnect(this._conn);
this._conn = null; this._conn = null;
@@ -154,5 +399,7 @@ if(this.iframe){
dijit._frames.push(this.iframe); dijit._frames.push(this.iframe);
delete this.iframe; delete this.iframe;
} }
}}); }
});
} }

View File

@@ -1,15 +1,22 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.scroll"]){ if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.scroll"] = true; dojo._hasResource["dijit._base.scroll"] = true;
dojo.provide("dijit._base.scroll"); dojo.provide("dijit._base.scroll");
dojo.require("dojo.window"); dojo.require("dojo.window");
dijit.scrollIntoView=function(_1,_2){
dojo.window.scrollIntoView(_1,_2);
dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
// summary:
// Scroll the passed node into view, if it is not already.
// Deprecated, use `dojo.window.scrollIntoView` instead.
dojo.window.scrollIntoView(node, pos);
}; };
} }

View File

@@ -1,12 +1,21 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.sniff"]){ if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.sniff"] = true; dojo._hasResource["dijit._base.sniff"] = true;
dojo.provide("dijit._base.sniff"); dojo.provide("dijit._base.sniff");
dojo.require("dojo.uacss"); dojo.require("dojo.uacss");
// summary:
// Applies pre-set CSS classes to the top-level HTML node, see
// `dojo.uacss` for details.
//
// Simply doing a require on this module will
// establish this CSS. Modified version of Morris' CSS hack.
} }

View File

@@ -1,34 +1,83 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.typematic"]){ if(!dojo._hasResource["dijit._base.typematic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.typematic"] = true; dojo._hasResource["dijit._base.typematic"] = true;
dojo.provide("dijit._base.typematic"); dojo.provide("dijit._base.typematic");
dijit.typematic={_fireEventAndReload:function(){
dijit.typematic = {
// summary:
// These functions are used to repetitively call a user specified callback
// method when a specific key or mouse click over a specific DOM node is
// held down for a specific amount of time.
// Only 1 such event is allowed to occur on the browser page at 1 time.
_fireEventAndReload: function(){
this._timer = null; this._timer = null;
this._callback(++this._count, this._node, this._evt); this._callback(++this._count, this._node, this._evt);
this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);
// Schedule next event, timer is at most minDelay (default 10ms) to avoid
// browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
this._currentTimeout = Math.max(
this._currentTimeout < 0 ? this._initialDelay :
(this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
this._minDelay);
this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout); this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
},trigger:function(_1,_2,_3,_4,_5,_6,_7,_8){ },
if(_5!=this._obj){
trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
// summary:
// Start a timed, repeating callback sequence.
// If already started, the function call is ignored.
// This method is not normally called by the user but can be
// when the normal listener code is insufficient.
// evt:
// key or mouse event object to pass to the user callback
// _this:
// pointer to the user's widget space.
// node:
// the DOM node object to pass the the callback function
// callback:
// function to call until the sequence is stopped called with 3 parameters:
// count:
// integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
// node:
// the DOM node object passed in
// evt:
// key or mouse event object
// obj:
// user space object used to uniquely identify each typematic sequence
// subsequentDelay (optional):
// if > 1, the number of milliseconds until the 3->n events occur
// or else the fractional time multiplier for the next event's delay, default=0.9
// initialDelay (optional):
// the number of milliseconds until the 2nd event occurs, default=500ms
// minDelay (optional):
// the maximum delay in milliseconds for event to fire, default=10ms
if(obj != this._obj){
this.stop(); this.stop();
this._initialDelay=_7||500; this._initialDelay = initialDelay || 500;
this._subsequentDelay=_6||0.9; this._subsequentDelay = subsequentDelay || 0.90;
this._minDelay=_8||10; this._minDelay = minDelay || 10;
this._obj=_5; this._obj = obj;
this._evt=_1; this._evt = evt;
this._node=_3; this._node = node;
this._currentTimeout = -1; this._currentTimeout = -1;
this._count = -1; this._count = -1;
this._callback=dojo.hitch(_2,_4); this._callback = dojo.hitch(_this, callback);
this._fireEventAndReload(); this._fireEventAndReload();
this._evt=dojo.mixin({faux:true},_1); this._evt = dojo.mixin({faux: true}, evt);
} }
},stop:function(){ },
stop: function(){
// summary:
// Stop an ongoing timed, repeating callback sequence.
if(this._timer){ if(this._timer){
clearTimeout(this._timer); clearTimeout(this._timer);
this._timer = null; this._timer = null;
@@ -37,51 +86,106 @@ if(this._obj){
this._callback(-1, this._node, this._evt); this._callback(-1, this._node, this._evt);
this._obj = null; this._obj = null;
} }
},addKeyListener:function(_9,_a,_b,_c,_d,_e,_f){ },
if(_a.keyCode){
_a.charOrCode=_a.keyCode; addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
// summary:
// Start listening for a specific typematic key.
// See also the trigger method for other parameters.
// keyObject:
// an object defining the key to listen for:
// charOrCode:
// the printable character (string) or keyCode (number) to listen for.
// keyCode:
// (deprecated - use charOrCode) the keyCode (number) to listen for (implies charCode = 0).
// charCode:
// (deprecated - use charOrCode) the charCode (number) to listen for.
// ctrlKey:
// desired ctrl key state to initiate the callback sequence:
// - pressed (true)
// - released (false)
// - either (unspecified)
// altKey:
// same as ctrlKey but for the alt key
// shiftKey:
// same as ctrlKey but for the shift key
// returns:
// an array of dojo.connect handles
if(keyObject.keyCode){
keyObject.charOrCode = keyObject.keyCode;
dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0"); dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
}else{ }else if(keyObject.charCode){
if(_a.charCode){ keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
_a.charOrCode=String.fromCharCode(_a.charCode);
dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0"); dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
} }
} return [
return [dojo.connect(_9,"onkeypress",this,function(evt){ dojo.connect(node, "onkeypress", this, function(evt){
if(evt.charOrCode==_a.charOrCode&&(_a.ctrlKey===undefined||_a.ctrlKey==evt.ctrlKey)&&(_a.altKey===undefined||_a.altKey==evt.altKey)&&(_a.metaKey===undefined||_a.metaKey==(evt.metaKey||false))&&(_a.shiftKey===undefined||_a.shiftKey==evt.shiftKey)){ if(evt.charOrCode == keyObject.charOrCode &&
(keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
(keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
(keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) && // IE doesn't even set metaKey
(keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
dojo.stopEvent(evt); dojo.stopEvent(evt);
dijit.typematic.trigger(evt,_b,_9,_c,_a,_d,_e,_f); dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
}else{ }else if(dijit.typematic._obj == keyObject){
if(dijit.typematic._obj==_a){
dijit.typematic.stop(); dijit.typematic.stop();
} }
} }),
}),dojo.connect(_9,"onkeyup",this,function(evt){ dojo.connect(node, "onkeyup", this, function(evt){
if(dijit.typematic._obj==_a){ if(dijit.typematic._obj == keyObject){
dijit.typematic.stop(); dijit.typematic.stop();
} }
})]; })
},addMouseListener:function(_10,_11,_12,_13,_14,_15){ ];
},
addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
// summary:
// Start listening for a typematic mouse click.
// See the trigger method for other parameters.
// returns:
// an array of dojo.connect handles
var dc = dojo.connect; var dc = dojo.connect;
return [dc(_10,"mousedown",this,function(evt){ return [
dc(node, "mousedown", this, function(evt){
dojo.stopEvent(evt); dojo.stopEvent(evt);
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15); dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
}),dc(_10,"mouseup",this,function(evt){ }),
dc(node, "mouseup", this, function(evt){
dojo.stopEvent(evt); dojo.stopEvent(evt);
dijit.typematic.stop(); dijit.typematic.stop();
}),dc(_10,"mouseout",this,function(evt){ }),
dc(node, "mouseout", this, function(evt){
dojo.stopEvent(evt); dojo.stopEvent(evt);
dijit.typematic.stop(); dijit.typematic.stop();
}),dc(_10,"mousemove",this,function(evt){ }),
dc(node, "mousemove", this, function(evt){
evt.preventDefault(); evt.preventDefault();
}),dc(_10,"dblclick",this,function(evt){ }),
dc(node, "dblclick", this, function(evt){
dojo.stopEvent(evt); dojo.stopEvent(evt);
if(dojo.isIE){ if(dojo.isIE){
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15); dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
setTimeout(dojo.hitch(this, dijit.typematic.stop), 50); setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
} }
})]; })
},addListener:function(_16,_17,_18,_19,_1a,_1b,_1c,_1d){ ];
return this.addKeyListener(_17,_18,_19,_1a,_1b,_1c,_1d).concat(this.addMouseListener(_16,_19,_1a,_1b,_1c,_1d)); },
}};
addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
// summary:
// Start listening for a specific typematic key and mouseclick.
// This is a thin wrapper to addKeyListener and addMouseListener.
// See the addMouseListener and addKeyListener methods for other parameters.
// mouseNode:
// the DOM node object to listen on for mouse events.
// keyNode:
// the DOM node object to listen on for key events.
// returns:
// an array of dojo.connect handles
return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
}
};
} }

View File

@@ -1,64 +1,145 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.wai"]){ if(!dojo._hasResource["dijit._base.wai"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.wai"] = true; dojo._hasResource["dijit._base.wai"] = true;
dojo.provide("dijit._base.wai"); dojo.provide("dijit._base.wai");
dijit.wai={onload:function(){
var _1=dojo.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif"))+"\");"}},dojo.body());
var cs=dojo.getComputedStyle(_1); dijit.wai = {
onload: function(){
// summary:
// Detects if we are in high-contrast mode or not
// This must be a named function and not an anonymous
// function, so that the widget parsing code can make sure it
// registers its onload function after this function.
// DO NOT USE "this" within this function.
// create div for testing if high contrast mode is on or images are turned off
var div = dojo.create("div",{
id: "a11yTestNode",
style:{
cssText:'border: 1px solid;'
+ 'border-color:red green;'
+ 'position: absolute;'
+ 'height: 5px;'
+ 'top: -999px;'
+ 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
}
}, dojo.body());
// test it
var cs = dojo.getComputedStyle(div);
if(cs){ if(cs){
var _2=cs.backgroundImage; var bkImg = cs.backgroundImage;
var _3=(cs.borderTopColor==cs.borderRightColor)||(_2!=null&&(_2=="none"||_2=="url(invalid-url:)")); var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
dojo[_3?"addClass":"removeClass"](dojo.body(),"dijit_a11y"); dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
if(dojo.isIE){ if(dojo.isIE){
_1.outerHTML=""; div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
}else{ }else{
dojo.body().removeChild(_1); dojo.body().removeChild(div);
} }
} }
}}; }
if(dojo.isIE||dojo.isMoz){ };
// Test if computer is in high contrast mode.
// Make sure the a11y test runs first, before widgets are instantiated.
if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up
dojo._loaders.unshift(dijit.wai.onload); dojo._loaders.unshift(dijit.wai.onload);
} }
dojo.mixin(dijit,{_XhtmlRoles:/banner|contentinfo|definition|main|navigation|search|note|secondary|seealso/,hasWaiRole:function(_4,_5){
var _6=this.getWaiRole(_4); dojo.mixin(dijit, {
return _5?(_6.indexOf(_5)>-1):(_6.length>0); hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
},getWaiRole:function(_7){ // summary:
return dojo.trim((dojo.attr(_7,"role")||"").replace(this._XhtmlRoles,"").replace("wairole:","")); // Determines if an element has a particular role.
},setWaiRole:function(_8,_9){ // returns:
var _a=dojo.attr(_8,"role")||""; // True if elem has the specific role attribute and false if not.
if(!this._XhtmlRoles.test(_a)){ // For backwards compatibility if role parameter not provided,
dojo.attr(_8,"role",_9); // returns true if has a role
var waiRole = this.getWaiRole(elem);
return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
},
getWaiRole: function(/*Element*/ elem){
// summary:
// Gets the role for an element (which should be a wai role).
// returns:
// The role of elem or an empty string if elem
// does not have a role.
return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
},
setWaiRole: function(/*Element*/ elem, /*String*/ role){
// summary:
// Sets the role on an element.
// description:
// Replace existing role attribute with new role.
dojo.attr(elem, "role", role);
},
removeWaiRole: function(/*Element*/ elem, /*String*/ role){
// summary:
// Removes the specified role from an element.
// Removes role attribute if no specific role provided (for backwards compat.)
var roleValue = dojo.attr(elem, "role");
if(!roleValue){ return; }
if(role){
var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
dojo.attr(elem, "role", t);
}else{ }else{
if((" "+_a+" ").indexOf(" "+_9+" ")<0){ elem.removeAttribute("role");
var _b=dojo.trim(_a.replace(this._XhtmlRoles,""));
var _c=dojo.trim(_a.replace(_b,""));
dojo.attr(_8,"role",_c+(_c?" ":"")+_9);
} }
},
hasWaiState: function(/*Element*/ elem, /*String*/ state){
// summary:
// Determines if an element has a given state.
// description:
// Checks for an attribute called "aria-"+state.
// returns:
// true if elem has a value for the given state and
// false if it does not.
return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
},
getWaiState: function(/*Element*/ elem, /*String*/ state){
// summary:
// Gets the value of a state on an element.
// description:
// Checks for an attribute called "aria-"+state.
// returns:
// The value of the requested state on elem
// or an empty string if elem has no value for state.
return elem.getAttribute("aria-"+state) || "";
},
setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
// summary:
// Sets a state on an element.
// description:
// Sets an attribute called "aria-"+state.
elem.setAttribute("aria-"+state, value);
},
removeWaiState: function(/*Element*/ elem, /*String*/ state){
// summary:
// Removes a state from an element.
// description:
// Sets an attribute called "aria-"+state.
elem.removeAttribute("aria-"+state);
} }
},removeWaiRole:function(_d,_e){ });
var _f=dojo.attr(_d,"role");
if(!_f){
return;
}
if(_e){
var t=dojo.trim((" "+_f+" ").replace(" "+_e+" "," "));
dojo.attr(_d,"role",t);
}else{
_d.removeAttribute("role");
}
},hasWaiState:function(_10,_11){
return _10.hasAttribute?_10.hasAttribute("aria-"+_11):!!_10.getAttribute("aria-"+_11);
},getWaiState:function(_12,_13){
return _12.getAttribute("aria-"+_13)||"";
},setWaiState:function(_14,_15,_16){
_14.setAttribute("aria-"+_15,_16);
},removeWaiState:function(_17,_18){
_17.removeAttribute("aria-"+_18);
}});
} }

View File

@@ -1,15 +1,18 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._base.window"]){ if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._base.window"] = true; dojo._hasResource["dijit._base.window"] = true;
dojo.provide("dijit._base.window"); dojo.provide("dijit._base.window");
dojo.require("dojo.window"); dojo.require("dojo.window");
dijit.getDocumentWindow=function(_1){
return dojo.window.get(_1);
dijit.getDocumentWindow = function(doc){
return dojo.window.get(doc);
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +1,289 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._editor._Plugin"]){ if(!dojo._hasResource["dijit._editor._Plugin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._editor._Plugin"] = true; dojo._hasResource["dijit._editor._Plugin"] = true;
dojo.provide("dijit._editor._Plugin"); dojo.provide("dijit._editor._Plugin");
dojo.require("dijit._Widget"); dojo.require("dijit._Widget");
dojo.require("dijit.form.Button"); dojo.require("dijit.form.Button");
dojo.declare("dijit._editor._Plugin",null,{constructor:function(_1,_2){
this.params=_1||{};
dojo.declare("dijit._editor._Plugin", null, {
// summary
// Base class for a "plugin" to the editor, which is usually
// a single button on the Toolbar and some associated code
constructor: function(/*Object?*/args, /*DomNode?*/node){
this.params = args || {};
dojo.mixin(this, this.params); dojo.mixin(this, this.params);
this._connects=[]; this._connects=[];
},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:true,buttonClass:dijit.form.Button,getLabel:function(_3){ this._attrPairNames = {};
return this.editor.commands[_3]; },
},_initButton:function(){
// editor: [const] dijit.Editor
// Points to the parent editor
editor: null,
// iconClassPrefix: [const] String
// The CSS class name for the button node is formed from `iconClassPrefix` and `command`
iconClassPrefix: "dijitEditorIcon",
// button: dijit._Widget?
// Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`)
// that is added to the toolbar to control this plugin.
// If not specified, will be created on initialization according to `buttonClass`
button: null,
// command: String
// String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command.
// Passed to editor.execCommand() if `useDefaultCommand` is true.
command: "",
// useDefaultCommand: Boolean
// If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`.
useDefaultCommand: true,
// buttonClass: Widget Class
// Class of widget (ex: dijit.form.Button or dijit.form.FilteringSelect)
// that is added to the toolbar to control this plugin.
// This is used to instantiate the button, unless `button` itself is specified directly.
buttonClass: dijit.form.Button,
// disabled: Boolean
// Flag to indicate if this plugin has been disabled and should do nothing
// helps control button state, among other things. Set via the setter api.
disabled: false,
getLabel: function(/*String*/key){
// summary:
// Returns the label to use for the button
// tags:
// private
return this.editor.commands[key]; // String
},
_initButton: function(){
// summary:
// Initialize the button or other widget that will control this plugin.
// This code only works for plugins controlling built-in commands in the editor.
// tags:
// protected extension
if(this.command.length){ if(this.command.length){
var _4=this.getLabel(this.command),_5=this.editor,_6=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1); var label = this.getLabel(this.command),
editor = this.editor,
className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1);
if(!this.button){ if(!this.button){
var _7=dojo.mixin({label:_4,dir:_5.dir,lang:_5.lang,showLabel:false,iconClass:_6,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}); var props = dojo.mixin({
this.button=new this.buttonClass(_7); label: label,
dir: editor.dir,
lang: editor.lang,
showLabel: false,
iconClass: className,
dropDown: this.dropDown,
tabIndex: "-1"
}, this.params || {});
this.button = new this.buttonClass(props);
} }
} }
},destroy:function(){ if(this.get("disabled") && this.button){
this.button.set("disabled", this.get("disabled"));
}
},
destroy: function(){
// summary:
// Destroy this plugin
dojo.forEach(this._connects, dojo.disconnect); dojo.forEach(this._connects, dojo.disconnect);
if(this.dropDown){ if(this.dropDown){
this.dropDown.destroyRecursive(); this.dropDown.destroyRecursive();
} }
},connect:function(o,f,tf){ },
connect: function(o, f, tf){
// summary:
// Make a dojo.connect() that is automatically disconnected when this plugin is destroyed.
// Similar to `dijit._Widget.connect`.
// tags:
// protected
this._connects.push(dojo.connect(o, f, this, tf)); this._connects.push(dojo.connect(o, f, this, tf));
},updateState:function(){ },
var e=this.editor,c=this.command,_8,_9;
if(!e||!e.isLoaded||!c.length){ updateState: function(){
return; // summary:
} // Change state of the plugin to respond to events in the editor.
// description:
// This is called on meaningful events in the editor, such as change of selection
// or caret position (but not simple typing of alphanumeric keys). It gives the
// plugin a chance to update the CSS of its button.
//
// For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the
// characters next to the caret are bold or not.
//
// Only makes sense when `useDefaultCommand` is true, as it calls Editor.queryCommandEnabled(`command`).
var e = this.editor,
c = this.command,
checked, enabled;
if(!e || !e.isLoaded || !c.length){ return; }
var disabled = this.get("disabled");
if(this.button){ if(this.button){
try{ try{
_9=e.queryCommandEnabled(c); enabled = !disabled && e.queryCommandEnabled(c);
if(this.enabled!==_9){ if(this.enabled !== enabled){
this.enabled=_9; this.enabled = enabled;
this.button.set("disabled",!_9); this.button.set('disabled', !enabled);
} }
if(typeof this.button.checked=="boolean"){ if(typeof this.button.checked == 'boolean'){
_8=e.queryCommandState(c); checked = e.queryCommandState(c);
if(this.checked!==_8){ if(this.checked !== checked){
this.checked=_8; this.checked = checked;
this.button.set("checked",e.queryCommandState(c)); this.button.set('checked', e.queryCommandState(c));
} }
} }
} }catch(e){
catch(e){ console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error?
} }
} }
},setEditor:function(_a){ },
this.editor=_a;
setEditor: function(/*dijit.Editor*/ editor){
// summary:
// Tell the plugin which Editor it is associated with.
// TODO: refactor code to just pass editor to constructor.
// FIXME: detach from previous editor!!
this.editor = editor;
// FIXME: prevent creating this if we don't need to (i.e., editor can't handle our command)
this._initButton(); this._initButton();
// Processing for buttons that execute by calling editor.execCommand()
if(this.button && this.useDefaultCommand){ if(this.button && this.useDefaultCommand){
if(this.editor.queryCommandAvailable(this.command)){ if(this.editor.queryCommandAvailable(this.command)){
this.connect(this.button,"onClick",dojo.hitch(this.editor,"execCommand",this.command,this.commandArg)); this.connect(this.button, "onClick",
dojo.hitch(this.editor, "execCommand", this.command, this.commandArg)
);
}else{ }else{
// hide button because editor doesn't support command (due to browser limitations)
this.button.domNode.style.display = "none"; this.button.domNode.style.display = "none";
} }
} }
this.connect(this.editor, "onNormalizedDisplayChanged", "updateState"); this.connect(this.editor, "onNormalizedDisplayChanged", "updateState");
},setToolbar:function(_b){ },
setToolbar: function(/*dijit.Toolbar*/ toolbar){
// summary:
// Tell the plugin to add it's controller widget (often a button)
// to the toolbar. Does nothing if there is no controller widget.
// TODO: refactor code to just pass toolbar to constructor.
if(this.button){ if(this.button){
_b.addChild(this.button); toolbar.addChild(this.button);
} }
}}); // console.debug("adding", this.button, "to:", toolbar);
},
set: function(/* attribute */ name, /* anything */ value){
// summary:
// Set a property on a plugin
// name:
// The property to set.
// value:
// The value to set in the property.
// description:
// Sets named properties on a plugin which may potentially be handled by a
// setter in the plugin.
// For example, if the plugin has a properties "foo"
// and "bar" and a method named "_setFooAttr", calling:
// | plugin.set("foo", "Howdy!");
// would be equivalent to writing:
// | plugin._setFooAttr("Howdy!");
// and:
// | plugin.set("bar", 3);
// would be equivalent to writing:
// | plugin.bar = 3;
//
// set() may also be called with a hash of name/value pairs, ex:
// | plugin.set({
// | foo: "Howdy",
// | bar: 3
// | })
// This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
if(typeof name === "object"){
for(var x in name){
this.set(x, name[x]);
}
return this;
}
var names = this._getAttrNames(name);
if(this[names.s]){
// use the explicit setter
var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
}else{
this._set(name, value);
}
return result || this;
},
get: function(name){
// summary:
// Get a property from a plugin.
// name:
// The property to get.
// description:
// Get a named property from a plugin. The property may
// potentially be retrieved via a getter method. If no getter is defined, this
// just retrieves the object's property.
// For example, if the plugin has a properties "foo"
// and "bar" and a method named "_getFooAttr", calling:
// | plugin.get("foo");
// would be equivalent to writing:
// | plugin._getFooAttr();
// and:
// | plugin.get("bar");
// would be equivalent to writing:
// | plugin.bar;
var names = this._getAttrNames(name);
return this[names.g] ? this[names.g]() : this[name];
},
_setDisabledAttr: function(disabled){
// summary:
// Function to set the plugin state and call updateState to make sure the
// button is updated appropriately.
this.disabled = disabled;
this.updateState();
},
_getAttrNames: function(name){
// summary:
// Helper function for get() and set().
// Caches attribute name values so we don't do the string ops every time.
// tags:
// private
var apn = this._attrPairNames;
if(apn[name]){ return apn[name]; }
var uc = name.charAt(0).toUpperCase() + name.substr(1);
return (apn[name] = {
s: "_set"+uc+"Attr",
g: "_get"+uc+"Attr"
});
},
_set: function(/*String*/ name, /*anything*/ value){
// summary:
// Helper function to set new value for specified attribute
var oldValue = this[name];
this[name] = value;
}
});
} }

View File

@@ -1,147 +1,193 @@
/* /*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license. Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details see: http://dojotoolkit.org/license for details
*/ */
if(!dojo._hasResource["dijit._editor.html"]){ if(!dojo._hasResource["dijit._editor.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit._editor.html"] = true; dojo._hasResource["dijit._editor.html"] = true;
dojo.provide("dijit._editor.html"); dojo.provide("dijit._editor.html");
dijit._editor.escapeXml=function(_1,_2){
_1=_1.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;"); dojo.getObject("_editor", true, dijit);
if(!_2){
_1=_1.replace(/'/gm,"&#39;"); dijit._editor.escapeXml=function(/*String*/str, /*Boolean?*/noSingleQuotes){
// summary:
// Adds escape sequences for special characters in XML: &<>"'
// Optionally skips escapes for single quotes
str = str.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;").replace(/"/gm, "&quot;");
if(!noSingleQuotes){
str = str.replace(/'/gm, "&#39;");
} }
return _1; return str; // string
}; };
dijit._editor.getNodeHtml=function(_3){
var _4; dijit._editor.getNodeHtml=function(/* DomNode */node){
switch(_3.nodeType){ var output;
case 1: switch(node.nodeType){
var _5=_3.nodeName.toLowerCase(); case 1: //element node
if(!_5||_5.charAt(0)=="/"){ var lName = node.nodeName.toLowerCase();
if(!lName || lName.charAt(0) == "/"){
// IE does some strange things with malformed HTML input, like
// treating a close tag </span> without an open tag <span>, as
// a new tag with tagName of /span. Corrupts output HTML, remove
// them. Other browsers don't prefix tags that way, so will
// never show up.
return ""; return "";
} }
_4="<"+_5; output = '<' + lName;
var _6=[];
var _7; //store the list of attributes and sort it to have the
if(dojo.isIE&&_3.outerHTML){ //attributes appear in the dictionary order
var s=_3.outerHTML; var attrarray = [];
s=s.substr(0,s.indexOf(">")).replace(/(['"])[^"']*\1/g,""); var attr;
var _8=/(\b\w+)\s?=/g; if(dojo.isIE && node.outerHTML){
var m,_9; var s = node.outerHTML;
while((m=_8.exec(s))){ s = s.substr(0, s.indexOf('>'))
_9=m[1]; .replace(/(['"])[^"']*\1/g, ''); //to make the following regexp safe
if(_9.substr(0,3)!="_dj"){ var reg = /(\b\w+)\s?=/g;
if(_9=="src"||_9=="href"){ var m, key;
if(_3.getAttribute("_djrealurl")){ while((m = reg.exec(s))){
_6.push([_9,_3.getAttribute("_djrealurl")]); key = m[1];
if(key.substr(0,3) != '_dj'){
if(key == 'src' || key == 'href'){
if(node.getAttribute('_djrealurl')){
attrarray.push([key,node.getAttribute('_djrealurl')]);
continue; continue;
} }
} }
var _a,_b; var val, match;
switch(_9){ switch(key){
case "style": case 'style':
_a=_3.style.cssText.toLowerCase(); val = node.style.cssText.toLowerCase();
break; break;
case "class": case 'class':
_a=_3.className; val = node.className;
break; break;
case "width": case 'width':
if(_5==="img"){ if(lName === "img"){
_b=/width=(\S+)/i.exec(s); // This somehow gets lost on IE for IMG tags and the like
if(_b){ // and we have to find it in outerHTML, known IE oddity.
_a=_b[1]; match=/width=(\S+)/i.exec(s);
if(match){
val = match[1];
} }
break; break;
} }
case "height": case 'height':
if(_5==="img"){ if(lName === "img"){
_b=/height=(\S+)/i.exec(s); // This somehow gets lost on IE for IMG tags and the like
if(_b){ // and we have to find it in outerHTML, known IE oddity.
_a=_b[1]; match=/height=(\S+)/i.exec(s);
if(match){
val = match[1];
} }
break; break;
} }
default: default:
_a=_3.getAttribute(_9); val = node.getAttribute(key);
} }
if(_a!=null){ if(val != null){
_6.push([_9,_a.toString()]); attrarray.push([key, val.toString()]);
} }
} }
} }
}else{ }else{
var i = 0; var i = 0;
while((_7=_3.attributes[i++])){ while((attr = node.attributes[i++])){
var n=_7.name; //ignore all attributes starting with _dj which are
if(n.substr(0,3)!="_dj"){ //internal temporary attributes used by the editor
var v=_7.value; var n = attr.name;
if(n=="src"||n=="href"){ if(n.substr(0,3) != '_dj' /*&&
if(_3.getAttribute("_djrealurl")){ (attr.specified == undefined || attr.specified)*/){
v=_3.getAttribute("_djrealurl"); var v = attr.value;
if(n == 'src' || n == 'href'){
if(node.getAttribute('_djrealurl')){
v = node.getAttribute('_djrealurl');
} }
} }
_6.push([n,v]); attrarray.push([n,v]);
} }
} }
} }
_6.sort(function(a,b){ attrarray.sort(function(a,b){
return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1); return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1);
}); });
var j = 0; var j = 0;
while((_7=_6[j++])){ while((attr = attrarray[j++])){
_4+=" "+_7[0]+"=\""+(dojo.isString(_7[1])?dijit._editor.escapeXml(_7[1],true):_7[1])+"\""; output += ' ' + attr[0] + '="' +
(dojo.isString(attr[1]) ? dijit._editor.escapeXml(attr[1], true) : attr[1]) + '"';
} }
if(_5==="script"){ if(lName === "script"){
_4+=">"+_3.innerHTML+"</"+_5+">"; // Browsers handle script tags differently in how you get content,
// but innerHTML always seems to work, so insert its content that way
// Yes, it's bad to allow script tags in the editor code, but some people
// seem to want to do it, so we need to at least return them right.
// other plugins/filters can strip them.
output += '>' + node.innerHTML +'</' + lName + '>';
}else{ }else{
if(_3.childNodes.length){ if(node.childNodes.length){
_4+=">"+dijit._editor.getChildrenHtml(_3)+"</"+_5+">"; output += '>' + dijit._editor.getChildrenHtml(node)+'</' + lName +'>';
}else{ }else{
switch(_5){ switch(lName){
case "br": case 'br':
case "hr": case 'hr':
case "img": case 'img':
case "input": case 'input':
case "base": case 'base':
case "meta": case 'meta':
case "area": case 'area':
case "basefont": case 'basefont':
_4+=" />"; // These should all be singly closed
output += ' />';
break; break;
default: default:
_4+="></"+_5+">"; // Assume XML style separate closure for everything else.
output += '></' + lName + '>';
} }
} }
} }
break; break;
case 4: case 4: // cdata
case 3: case 3: // text
_4=dijit._editor.escapeXml(_3.nodeValue,true); // FIXME:
output = dijit._editor.escapeXml(node.nodeValue, true);
break; break;
case 8: case 8: //comment
_4="<!--"+dijit._editor.escapeXml(_3.nodeValue,true)+"-->"; // FIXME:
output = '<!--' + dijit._editor.escapeXml(node.nodeValue, true) + '-->';
break; break;
default: default:
_4="<!-- Element not recognized - Type: "+_3.nodeType+" Name: "+_3.nodeName+"-->"; output = "<!-- Element not recognized - Type: " + node.nodeType + " Name: " + node.nodeName + "-->";
} }
return _4; return output;
}; };
dijit._editor.getChildrenHtml=function(_c){
var _d=""; dijit._editor.getChildrenHtml = function(/* DomNode */dom){
if(!_c){ // summary:
return _d; // Returns the html content of a DomNode and children
} var out = "";
var _e=_c["childNodes"]||_c; if(!dom){ return out; }
var _f=!dojo.isIE||_e!==_c; var nodes = dom["childNodes"] || dom;
var _10,i=0;
while((_10=_e[i++])){ //IE issue.
if(!_f||_10.parentNode==_c){ //If we have an actual node we can check parent relationships on for IE,
_d+=dijit._editor.getNodeHtml(_10); //We should check, as IE sometimes builds invalid DOMS. If no parent, we can't check
//And should just process it and hope for the best.
var checkParent = !dojo.isIE || nodes !== dom;
var node, i = 0;
while((node = nodes[i++])){
//IE is broken. DOMs are supposed to be a tree. But in the case of malformed HTML, IE generates a graph
//meaning one node ends up with multiple references (multiple parents). This is totally wrong and invalid, but
//such is what it is. We have to keep track and check for this because otherise the source output HTML will have dups.
//No other browser generates a graph. Leave it to IE to break a fundamental DOM rule. So, we check the parent if we can
//If we can't, nothing more we can do other than walk it.
if(!checkParent || node.parentNode == dom){
out += dijit._editor.getNodeHtml(node);
} }
} }
return _d; return out; // String
}; };
} }

View File

@@ -1 +1 @@
({"1":"صغير جدا جدا","2":"صغير جدا","formatBlock":"النسق","3":"صغير","4":"متوسط","5":"كبير","6":"كبير جدا","7":"كبير جدا جدا","fantasy":"خيالي","serif":"serif","p":"فقرة","pre":"منسق بصفة مسبقة","sans-serif":"sans-serif","fontName":"طاقم طباعة","h1":"عنوان","h2":"عنوان فرعي","h3":"فرعي-عنوان فرعي","monospace":"أحادي المسافة","fontSize":"الحجم","cursive":"كتابة بحروف متصلة","noFormat":"None"}) ({"noFormat":"‏لا شيء‏","1":"صغير جدا جدا","2":"صغير جدا","formatBlock":"النسق","3":"صغير","4":"متوسط","5":"كبير","6":"كبير جدا","7":"كبير جدا جدا","fantasy":"خيالي","serif":"serif","p":"فقرة","pre":"منسق بصفة مسبقة","sans-serif":"sans-serif","fontName":"طاقم طباعة","h1":"عنوان","h2":"عنوان فرعي","h3":"فرعي-عنوان فرعي","monospace":"أحادي المسافة","fontSize":"الحجم","cursive":"كتابة بحروف متصلة"})

View File

@@ -1 +1 @@
({"text":"الوصف:","insertImageTitle":"خصائص الصورة","set":"تحديد","newWindow":"نافذة جديدة","topWindow":"النافذة العلوية","target":"الهدف: ","createLinkTitle":"خصائص الوصلة","parentWindow":"النافذة الرئيسية","currentWindow":"النافذة الحالية","url":"عنوان URL:"}) ({"text":"الوصف:","insertImageTitle":"خصائص الصورة","set":"تحديد","newWindow":"نافذة جديدة","topWindow":"النافذة العلوية","target":"الهدف:","createLinkTitle":"خصائص الوصلة","parentWindow":"النافذة الرئيسية","currentWindow":"النافذة الحالية","url":"عنوان URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"ازالة النسق","copy":"نسخ","paste":"لصق","selectAll":"اختيار كل","insertOrderedList":"‏كشف مرقم‏","insertTable":"ادراج/تحرير جدول","print":"طباعة","underline":"~تسطير","foreColor":"لون الواجهة الأمامية","htmlToggle":"مصدر HTML","formatBlock":"نمط الفقرة","newPage":"صفحة جديدة","insertHorizontalRule":"مسطرة أفقية","delete":"حذف","insertUnorderedList":"كشف نقطي","tableProp":"خصائص الجدول","insertImage":"ادراج صورة","superscript":"رمز علوي","subscript":"رمز سفلي","createLink":"تكوين وصلة","undo":"تراجع","fullScreen":"تبديل الشاشة الكاملة","italic":"~مائل","fontName":"اسم طاقم الطباعة","justifyLeft":"محاذاة الى اليسار","unlink":"ازالة وصلة","toggleTableBorder":"تبديل حدود الجدول","viewSource":"مشاهدة مصدر HTML","ctrlKey":"ctrl+${0}","fontSize":"حجم طاقم الطباعة","systemShortcut":"التصرف \"${0}\" يكون متاحا فقط في برنامج الاستعراض الخاص بك باستخدام المسار المختصر للوحة المفاتيح. استخدم ${1}.","indent":"ازاحة للداخل","redo":"‏اعادة‏","strikethrough":"تشطيب","justifyFull":"ضبط","justifyCenter":"محاذاة في الوسط","hiliteColor":"‏لون الخلفية‏","deleteTable":"حذف جدول","outdent":"ازاحة للخارج","cut":"قص","plainFormatBlock":"نمط الفقرة","toggleDir":"تبديل الاتجاه","bold":"عري~ض","tabIndent":"ازاحة للداخل باستخدام Tab","justifyRight":"محاذاة الى اليمين","appleKey":"⌘${0}"}) ({"removeFormat":"ازالة النسق","copy":"نسخ","paste":"لصق","selectAll":"اختيار كل","insertOrderedList":"‏كشف مرقم‏","insertTable":"ادراج/تحرير جدول","print":"طباعة","underline":"~تسطير","foreColor":"لون الواجهة الأمامية","htmlToggle":"مصدر HTML","formatBlock":"نمط الفقرة","newPage":"صفحة جديدة","insertHorizontalRule":"مسطرة أفقية","delete":"حذف","appleKey":"⌘${0}","insertUnorderedList":"كشف نقطي","tableProp":"خصائص الجدول","insertImage":"ادراج صورة","superscript":"رمز علوي","subscript":"رمز سفلي","createLink":"تكوين وصلة","undo":"تراجع","fullScreen":"تبديل الشاشة الكاملة","italic":"~مائل","fontName":"اسم طاقم الطباعة","justifyLeft":"محاذاة الى اليسار","unlink":"ازالة وصلة","toggleTableBorder":"تبديل حدود الجدول","viewSource":"مشاهدة مصدر HTML","ctrlKey":"ctrl+${0}","fontSize":"حجم طاقم الطباعة","systemShortcut":"يكون التصرف \"${0}\" متاحا فقط ببرنامج الاستعراض الخاص بك باستخدام المسار المختصر للوحة المفاتيح. استخدم ${1}.","indent":"ازاحة للداخل","redo":"‏اعادة‏","strikethrough":"تشطيب","justifyFull":"ضبط","justifyCenter":"محاذاة في الوسط","hiliteColor":"‏لون الخلفية‏","deleteTable":"حذف جدول","outdent":"ازاحة للخارج","cut":"قص","plainFormatBlock":"نمط الفقرة","toggleDir":"تبديل الاتجاه","bold":"عري~ض","tabIndent":"ازاحة علامة الجدولة للداخل","justifyRight":"محاذاة الى اليمين"})

View File

@@ -1 +1 @@
({"1":"xx-petit","2":"x-petit","formatBlock":"Format","3":"petit","4":"mitjà","5":"gran","6":"x-gran","7":"xx-gran","fantasy":"Fantasia","serif":"serif","p":"Paràgraf","pre":"Format previ","sans-serif":"sans-serif","fontName":"Tipus de lletra","h1":"Títol","h2":"Subtítol","h3":"Subsubtítol","monospace":"monoespai","fontSize":"Mida","cursive":"Cursiva","noFormat":"None"}) ({"noFormat":"Cap","1":"xx-petit","2":"x-petit","formatBlock":"Format","3":"petit","4":"mitjà","5":"gran","6":"x-gran","7":"xx-gran","fantasy":"Fantasia","serif":"serif","p":"Paràgraf","pre":"Format previ","sans-serif":"sans-serif","fontName":"Tipus de lletra","h1":"Títol","h2":"Subtítol","h3":"Subsubtítol","monospace":"monoespai","fontSize":"Mida","cursive":"Cursiva"})

View File

@@ -1 +1 @@
({"text":"Descipció:","insertImageTitle":"Propietats de la imatge","set":"Defineix","newWindow":"Finestra nova","topWindow":"Finestra superior","target":"Destinació:","createLinkTitle":"Propietats de l'enllaç","parentWindow":"Finestra pare","currentWindow":"Finestra actual","url":"URL:"}) ({"text":"Descripció:","insertImageTitle":"Propietats de la imatge","set":"Defineix","newWindow":"Finestra nova","topWindow":"Finestra superior","target":"Destinació:","createLinkTitle":"Propietats de l'enllaç","parentWindow":"Finestra pare","currentWindow":"Finestra actual","url":"URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"Elimina el format","copy":"Copia","paste":"Enganxa","selectAll":"Selecciona-ho tot","insertOrderedList":"Llista numerada","insertTable":"Insereix/edita la taula","print":"Imprimeix","underline":"Subratllat","foreColor":"Color de primer pla","htmlToggle":"Font HTML","formatBlock":"Estil de paràgraf","newPage":"Pàgina nova","insertHorizontalRule":"Regle horitzontal","delete":"Suprimeix","insertUnorderedList":"Llista de vinyetes","tableProp":"Propietat de taula","insertImage":"Insereix imatge","superscript":"Superíndex","subscript":"Subíndex","createLink":"Crea un enllaç","undo":"Desfés","fullScreen":"Commuta pantalla completa","italic":"Cursiva","fontName":"Nom del tipus de lletra","justifyLeft":"Alinea a la esquerra","unlink":"Elimina l'enllaç","toggleTableBorder":"Inverteix els contorns de taula","viewSource":"Visualitza font HTML","ctrlKey":"control+${0}","fontSize":"Cos de la lletra","systemShortcut":"L'acció \"${0}\" és l'única disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.","indent":"Sagnat","redo":"Refés","strikethrough":"Ratllat","justifyFull":"Justifica","justifyCenter":"Centra","hiliteColor":"Color de fons","deleteTable":"Suprimeix la taula","outdent":"Sagna a l'esquerra","cut":"Retalla","plainFormatBlock":"Estil de paràgraf","toggleDir":"Inverteix la direcció","bold":"Negreta","tabIndent":"Sagnat","justifyRight":"Alinea a la dreta","appleKey":"⌘${0}"}) ({"removeFormat":"Elimina el format","copy":"Copia","paste":"Enganxa","selectAll":"Selecciona-ho tot","insertOrderedList":"Llista numerada","insertTable":"Insereix/edita la taula","print":"Imprimeix","underline":"Subratllat","foreColor":"Color de primer pla","htmlToggle":"Font HTML","formatBlock":"Estil de paràgraf","newPage":"Pàgina nova","insertHorizontalRule":"Regla horitzontal","delete":"Suprimeix","insertUnorderedList":"Llista de vinyetes","tableProp":"Propietat de taula","insertImage":"Insereix imatge","superscript":"Superíndex","subscript":"Subíndex","createLink":"Crea un enllaç","undo":"Desfés","fullScreen":"Commuta pantalla completa","italic":"Cursiva","fontName":"Nom del tipus de lletra","justifyLeft":"Alinea a l'esquerra","unlink":"Elimina l'enllaç","toggleTableBorder":"Inverteix els contorns de taula","viewSource":"Visualitza font HTML","ctrlKey":"control+${0}","fontSize":"Cos de la lletra","systemShortcut":"L'acció \"${0}\" és l'única disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.","indent":"Sagnat","redo":"Refés","strikethrough":"Ratllat","justifyFull":"Justifica","justifyCenter":"Centra","hiliteColor":"Color de fons","deleteTable":"Suprimeix la taula","outdent":"Sagna a l'esquerra","cut":"Retalla","plainFormatBlock":"Estil de paràgraf","toggleDir":"Inverteix la direcció","bold":"Negreta","tabIndent":"Sagnat","justifyRight":"Alinea a la dreta","appleKey":"⌘${0}"})

View File

@@ -1 +1 @@
({"1":"extra malé","2":"velmi malé","formatBlock":"Formát","3":"malé","4":"střední","5":"velké","6":"velmi velké","7":"extra velké","fantasy":"fantasy","serif":"serif","p":"Odstavec","pre":"Předformátované","sans-serif":"sans-serif","fontName":"Písmo","h1":"Nadpis","h2":"Podnadpis","h3":"Podnadpis 2","monospace":"monospace","fontSize":"Velikost","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Žádný","1":"extra malé","2":"velmi malé","formatBlock":"Formát","3":"malé","4":"střední","5":"velké","6":"velmi velké","7":"extra velké","fantasy":"fantasy","serif":"serif","p":"Odstavec","pre":"Předformátované","sans-serif":"sans-serif","fontName":"Písmo","h1":"Nadpis","h2":"Podnadpis","h3":"Podnadpis 2","monospace":"monospace","fontSize":"Velikost","cursive":"cursive"})

View File

@@ -1 +1 @@
({"removeFormat":"Odebrat formát","copy":"Kopírovat","paste":"Vložit","selectAll":"Vybrat vše","insertOrderedList":"Číslovaný seznam","insertTable":"Vložit/upravit tabulku","print":"Tisk","underline":"Podtržení","foreColor":"Barva popředí","htmlToggle":"Zdroj HTML","formatBlock":"Styl odstavce","newPage":"Nová stránka","insertHorizontalRule":"Vodorovná čára","delete":"Odstranit","insertUnorderedList":"Seznam s odrážkami","tableProp":"Vlastnost tabulky","insertImage":"Vložit obrázek","superscript":"Horní index","subscript":"Dolní index","createLink":"Vytvořit odkaz","undo":"Zpět","fullScreen":"Přepnout režim celé obrazovky","italic":"Kurzíva","fontName":"Název písma","justifyLeft":"Zarovnat vlevo","unlink":"Odebrat odkaz","toggleTableBorder":"Přepnout ohraničení tabulky","viewSource":"Zobrazit zdroj ve formátu HTML","fontSize":"Velikost písma","systemShortcut":"Akce \"${0}\" je v prohlížeči dostupná pouze prostřednictvím klávesové zkratky. Použijte klávesovou zkratku ${1}.","indent":"Odsadit","redo":"Opakovat","strikethrough":"Přeškrtnutí","justifyFull":"Do bloku","justifyCenter":"Zarovnat na střed","hiliteColor":"Barva pozadí","deleteTable":"Odstranit tabulku","outdent":"Předsadit","cut":"Vyjmout","plainFormatBlock":"Styl odstavce","toggleDir":"Přepnout směr","bold":"Tučné","tabIndent":"Odsazení tabulátoru","justifyRight":"Zarovnat vpravo","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Odebrat formát","copy":"Kopírovat","paste":"Vložit","selectAll":"Vybrat vše","insertOrderedList":"Číslovaný seznam","insertTable":"Vložit/upravit tabulku","print":"Tisk","underline":"Podtržení","foreColor":"Barva popředí","htmlToggle":"Zdroj HTML","formatBlock":"Styl odstavce","newPage":"Nová stránka","insertHorizontalRule":"Vodorovná čára","delete":"Odstranit","insertUnorderedList":"Seznam s odrážkami","tableProp":"Vlastnost tabulky","insertImage":"Vložit obrázek","superscript":"Horní index","subscript":"Dolní index","createLink":"Vytvořit odkaz","undo":"Zpět","fullScreen":"Přepnout celou obrazovku","italic":"Kurzíva","fontName":"Název písma","justifyLeft":"Zarovnat vlevo","unlink":"Odebrat odkaz","toggleTableBorder":"Přepnout ohraničení tabulky","viewSource":"Zobrazit zdroj HTML","fontSize":"Velikost písma","systemShortcut":"Akce \"${0}\" je v prohlížeči dostupná pouze prostřednictvím klávesové zkratky. Použijte klávesovou zkratku ${1}.","indent":"Odsadit","redo":"Opakovat","strikethrough":"Přeškrtnutí","justifyFull":"Do bloku","justifyCenter":"Zarovnat na střed","hiliteColor":"Barva pozadí","deleteTable":"Odstranit tabulku","outdent":"Předsadit","cut":"Vyjmout","plainFormatBlock":"Styl odstavce","toggleDir":"Přepnout směr","bold":"Tučné","tabIndent":"Odsazení tabulátoru","justifyRight":"Zarovnat vpravo","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"xx-small","2":"x-small","formatBlock":"Format","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Afsnit","pre":"Forudformateret","sans-serif":"sans-serif","fontName":"Skrifttype","h1":"Overskrift","h2":"Underoverskrift","h3":"Underunderoverskrift","monospace":"monospace","fontSize":"Størrelse","cursive":"kursiv","noFormat":"None"}) ({"noFormat":"Ingen","1":"xx-small","2":"x-small","formatBlock":"Format","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Afsnit","pre":"Forudformateret","sans-serif":"sans-serif","fontName":"Skrifttype","h1":"Overskrift","h2":"Underoverskrift","h3":"Underunderoverskrift","monospace":"monospace","fontSize":"Størrelse","cursive":"kursiv"})

View File

@@ -1 +1 @@
({"removeFormat":"Fjern format","copy":"Kopiér","paste":"Sæt ind","selectAll":"Markér alle","insertOrderedList":"Nummereret liste","insertTable":"Indsæt/redigér tabel","print":"Udskriv","underline":"Understreget","foreColor":"Forgrundsfarve","htmlToggle":"HTML-kilde","formatBlock":"Afsnitstypografi","newPage":"Ny side","insertHorizontalRule":"Vandret linje","delete":"Slet","insertUnorderedList":"Punktliste","tableProp":"Tabelegenskab","insertImage":"Indsæt billede","superscript":"Hævet skrift","subscript":"Sænket skrift","createLink":"Opret link","undo":"Fortryd","fullScreen":"Aktivér/deaktivér fuldskærm","italic":"Kursiv","fontName":"Skriftnavn","justifyLeft":"Venstrejusteret","unlink":"Fjern link","toggleTableBorder":"Skift tabelramme","viewSource":"Vis HTML-kilde","ctrlKey":"Ctrl+${0}","fontSize":"Skriftstørrelse","systemShortcut":"Funktionen \"${0}\" kan kun bruges i din browser med en tastaturgenvej. Brug ${1}.","indent":"Indrykning","redo":"Annullér Fortryd","strikethrough":"Gennemstreget","justifyFull":"Lige margener","justifyCenter":"Centreret","hiliteColor":"Baggrundsfarve","deleteTable":"Slet tabel","outdent":"Udrykning","cut":"Klip","plainFormatBlock":"Afsnitstypografi","toggleDir":"Skift retning","bold":"Fed","tabIndent":"Indrykning med tabulator","justifyRight":"Højrejusteret","appleKey":"⌘${0}"}) ({"removeFormat":"Fjern format","copy":"Kopiér","paste":"Sæt ind","selectAll":"Markér alle","insertOrderedList":"Nummereret liste","insertTable":"Indsæt/redigér tabel","print":"Udskriv","underline":"Understreget","foreColor":"Forgrundsfarve","htmlToggle":"HTML-kilde","formatBlock":"Afsnitstypografi","newPage":"Ny side","insertHorizontalRule":"Vandret linje","delete":"Slet","insertUnorderedList":"Punktliste","tableProp":"Tabelegenskab","insertImage":"Indsæt billede","superscript":"Hævet skrift","subscript":"Sænket skrift","createLink":"Opret link","undo":"Fortryd","fullScreen":"Aktivér/deaktivér fuldskærm","italic":"Kursiv","fontName":"Skriftnavn","justifyLeft":"Venstrejusteret","unlink":"Fjern link","toggleTableBorder":"Skift tabelramme","viewSource":"Vis HTML-kilde","fontSize":"Skriftstørrelse","systemShortcut":"Funktionen \"${0}\" kan kun bruges i din browser med en tastaturgenvej. Brug ${1}.","indent":"Indrykning","redo":"Annullér Fortryd","strikethrough":"Gennemstreget","justifyFull":"Lige margener","justifyCenter":"Centreret","hiliteColor":"Baggrundsfarve","deleteTable":"Slet tabel","outdent":"Udrykning","cut":"Klip","plainFormatBlock":"Afsnitstypografi","toggleDir":"Skift retning","bold":"Fed","tabIndent":"Indrykning med tabulator","justifyRight":"Højrejusteret","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"XXS","2":"XS","formatBlock":"Format","3":"S","4":"M","5":"L","6":"XL","7":"XXL","fantasy":"Fantasie","serif":"Serife","p":"Absatz","pre":"Vorformatiert","sans-serif":"Serifenlos","fontName":"Schriftart","h1":"Überschrift","h2":"Unterüberschrift","h3":"Unterunterüberschrift","monospace":"Monospaceschrift","fontSize":"Größe","cursive":"Kursiv","noFormat":"None"}) ({"noFormat":"Keine Angabe","1":"XXS","2":"XS","formatBlock":"Format","3":"S","4":"M","5":"L","6":"XL","7":"XXL","fantasy":"Fantasie","serif":"Serife","p":"Absatz","pre":"Vorformatiert","sans-serif":"Serifenlos","fontName":"Schriftart","h1":"Überschrift","h2":"Unterüberschrift","h3":"Unterunterüberschrift","monospace":"Monospaceschrift","fontSize":"Größe","cursive":"Kursiv"})

View File

@@ -1 +1 @@
({"1":"xx-μικρά","2":"x-μικρά","formatBlock":"Μορφή","3":"μικρά","4":"μεσαία","5":"μεγάλα","6":"x-μεγάλα","7":"xx-μεγάλα","fantasy":"φαντασίας","serif":"με πατούρες (serif)","p":"Παράγραφος","pre":"Προ-μορφοποιημένο","sans-serif":"χωρίς πατούρες (sans-serif)","fontName":"Γραμματοσειρά","h1":"Επικεφαλίδα","h2":"Δευτερεύουσα επικεφαλίδα","h3":"Δευτερεύουσα επικεφαλίδα τρίτου επιπέδου","monospace":"σταθερού πλάτους","fontSize":"Μέγεθος","cursive":"πλάγιοι","noFormat":"None"}) ({"noFormat":"Χωρίς","1":"xx-μικρά","2":"x-μικρά","formatBlock":"Μορφή","3":"μικρά","4":"μεσαία","5":"μεγάλα","6":"x-μεγάλα","7":"xx-μεγάλα","fantasy":"φαντασίας","serif":"με πατούρες (serif)","p":"Παράγραφος","pre":"Προ-μορφοποιημένο","sans-serif":"χωρίς πατούρες (sans-serif)","fontName":"Γραμματοσειρά","h1":"Επικεφαλίδα","h2":"Δευτερεύουσα επικεφαλίδα","h3":"Δευτερεύουσα επικεφαλίδα τρίτου επιπέδου","monospace":"σταθερού πλάτους","fontSize":"Μέγεθος","cursive":"πλάγιοι"})

View File

@@ -1 +1 @@
({"1":"xx-pequeño","2":"x-pequeño","formatBlock":"Formato","3":"pequeño","4":"medio","5":"grande","6":"x-grande","7":"xx-grande","fantasy":"fantasía","serif":"serif","p":"Párrafo","pre":"Preformateado","sans-serif":"sans-serif","fontName":"Font","h1":"Cabecera","h2":"Subcabecera","h3":"Sub-subcabecera","monospace":"espacio sencillo","fontSize":"Tamaño","cursive":"cursiva","noFormat":"None"}) ({"noFormat":"Ninguno","1":"xx-pequeño","2":"x-pequeño","formatBlock":"Formato","3":"pequeño","4":"medio","5":"grande","6":"x-grande","7":"xx-grande","fantasy":"fantasía","serif":"serif","p":"Párrafo","pre":"Preformateado","sans-serif":"sans-serif","fontName":"Font","h1":"Cabecera","h2":"Subcabecera","h3":"Sub-subcabecera","monospace":"espacio sencillo","fontSize":"Tamaño","cursive":"cursiva"})

View File

@@ -1 +1 @@
({"1":"xx-small","2":"x-small","formatBlock":"Muoto","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Kappale","pre":"Esimuotoiltu","sans-serif":"sans-serif","fontName":"Fontti","h1":"Otsikko","h2":"Alatason otsikko","h3":"Alimman tason otsikko","monospace":"monospace","fontSize":"Koko","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Ei mitään","1":"xx-small","2":"x-small","formatBlock":"Muoto","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Kappale","pre":"Esimuotoiltu","sans-serif":"sans-serif","fontName":"Fontti","h1":"Otsikko","h2":"Alatason otsikko","h3":"Alimman tason otsikko","monospace":"monospace","fontSize":"Koko","cursive":"cursive"})

View File

@@ -1 +1 @@
({"1":"xxs","2":"xs","formatBlock":"Mise en forme","3":"s","4":"m","5":"l","6":"xl","7":"xxl","fantasy":"fantaisie","serif":"serif","p":"Paragraphe","pre":"Pré-mise en forme","sans-serif":"sans serif","fontName":"Police","h1":"En-tête","h2":"Sous-en-tête","h3":"Sous-sous-en-tête","monospace":"espacement fixe","fontSize":"Taille","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Néant","1":"xxs","2":"xs","formatBlock":"Mise en forme","3":"s","4":"m","5":"l","6":"xl","7":"xxl","fantasy":"fantaisie","serif":"serif","p":"Paragraphe","pre":"Pré-mise en forme","sans-serif":"sans serif","fontName":"Police","h1":"En-tête","h2":"Sous-en-tête","h3":"Sous-sous-en-tête","monospace":"espacement fixe","fontSize":"Taille","cursive":"cursive"})

View File

@@ -1 +1 @@
({"text":"Description :","insertImageTitle":"Propriétés des images","set":"Définir","newWindow":"Nouvelle fenêtre","topWindow":"Première fenêtre","target":"Cible :","createLinkTitle":"Propriétés des liens","parentWindow":"Fenêtre parent","currentWindow":"Fenêtre en cours","url":"URL :"}) ({"text":"Description :","insertImageTitle":"Propriétés de l'image","set":"Définir","newWindow":"Nouvelle fenêtre","topWindow":"Fenêtre supérieure","target":"Cible :","createLinkTitle":"Propriétés du lien","parentWindow":"Fenêtre parent","currentWindow":"Fenêtre actuelle","url":"URL :"})

View File

@@ -1 +1 @@
({"removeFormat":"Supprimer la mise en forme","copy":"Copier","paste":"Coller","selectAll":"Sélectionner tout","insertOrderedList":"Liste numérotée","insertTable":"Insérer/Modifier un tableau","print":"Imprimer","underline":"Souligner","foreColor":"Couleur avant-plan","htmlToggle":"Source HTML","formatBlock":"Style de paragraphe","newPage":"Nouvelle page","insertHorizontalRule":"Règle horizontale","delete":"Supprimer","insertUnorderedList":"Liste à puces","tableProp":"Propriété du tableau","insertImage":"Insérer une image","superscript":"Exposant","subscript":"Indice","createLink":"Créer un lien","undo":"Annuler","fullScreen":"Basculer vers le mode plein écran","italic":"Italique","fontName":"Nom de police","justifyLeft":"Aligner à gauche","unlink":"Supprimer le lien","toggleTableBorder":"Afficher/Masquer la bordure du tableau","viewSource":"Afficher la source HTML","fontSize":"Taille de police","systemShortcut":"Action \"${0}\" uniquement disponible dans votre navigateur via un raccourci clavier. Utilisez ${1}.","indent":"Retrait","redo":"Rétablir","strikethrough":"Barrer","justifyFull":"Justifier","justifyCenter":"Aligner au centre","hiliteColor":"Couleur arrière-plan","deleteTable":"Supprimer le tableau","outdent":"Retrait négatif","cut":"Couper","plainFormatBlock":"Style de paragraphe","toggleDir":"Changer de sens","bold":"Gras","tabIndent":"Retrait de tabulation","justifyRight":"Aligner à droite","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Supprimer la mise en forme","copy":"Copier","paste":"Coller","selectAll":"Sélectionner tout","insertOrderedList":"Liste numérotée","insertTable":"Insérer/Modifier un tableau","print":"Imprimer","underline":"Souligner","foreColor":"Couleur d'avant-plan","htmlToggle":"Source HTML","formatBlock":"Style de paragraphe","newPage":"Nouvelle page","insertHorizontalRule":"Règle horizontale","delete":"Supprimer","insertUnorderedList":"Liste à puces","tableProp":"Propriété du tableau","insertImage":"Insérer une image","superscript":"Exposant","subscript":"Indice","createLink":"Créer un lien","undo":"Annuler","fullScreen":"Basculer en plein écran","italic":"Italique","fontName":"Nom de police","justifyLeft":"Aligner à gauche","unlink":"Supprimer le lien","toggleTableBorder":"Afficher/Masquer la bordure du tableau","viewSource":"Afficher la source HTML","fontSize":"Taille de police","systemShortcut":"L'action \"${0}\" est disponible dans votre navigateur uniquement, par le biais d'un raccourci-clavier. Utilisez ${1}.","indent":"Retrait","redo":"Rétablir","strikethrough":"Barrer","justifyFull":"Justifier","justifyCenter":"Aligner au centre","hiliteColor":"Couleur d'arrière-plan","deleteTable":"Supprimer le tableau","outdent":"Retrait négatif","cut":"Couper","plainFormatBlock":"Style de paragraphe","toggleDir":"Changer de sens","bold":"Gras","tabIndent":"Retrait de tabulation","justifyRight":"Aligner à droite","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"קטן ביות","2":"קטן מאוד","formatBlock":"עיצוב","3":"קטן","4":"בינוני","5":"גדול","6":"גדול מאוד","7":"גדול ביותר","fantasy":"fantasy","serif":"serif","p":"פיסקה","pre":"מעוצב מראש","sans-serif":"sans-serif","fontName":"גופן","h1":"כותרת","h2":"תת-כותרת","h3":"תת-תת-כותרת","monospace":"monospace","fontSize":"גודל","cursive":"cursive","noFormat":"None"}) ({"noFormat":"ללא ","1":"קטן ביות","2":"קטן מאוד","formatBlock":"עיצוב","3":"קטן","4":"בינוני","5":"גדול","6":"גדול מאוד","7":"גדול ביותר","fantasy":"fantasy","serif":"serif","p":"פיסקה","pre":"מעוצב מראש","sans-serif":"sans-serif","fontName":"גופן","h1":"כותרת","h2":"תת-כותרת","h3":"תת-תת-כותרת","monospace":"monospace","fontSize":"גודל","cursive":"cursive"})

View File

@@ -1 +1 @@
({"1":"xx-kicsi","2":"x-kicsi","formatBlock":"Formátum","3":"kicsi","4":"közepes","5":"nagy","6":"x-nagy","7":"xx-nagy","fantasy":"fantázia","serif":"talpas","p":"Bekezdés","pre":"Előformázott","sans-serif":"talpatlan","fontName":"Betűtípus","h1":"Címsor","h2":"Alcím","h3":"Al-alcím","monospace":"rögzített szélességű","fontSize":"Méret","cursive":"kurzív","noFormat":"None"}) ({"noFormat":"Nincs","1":"xx-kicsi","2":"x-kicsi","formatBlock":"Formátum","3":"kicsi","4":"közepes","5":"nagy","6":"x-nagy","7":"xx-nagy","fantasy":"fantázia","serif":"talpas","p":"Bekezdés","pre":"Előformázott","sans-serif":"talpatlan","fontName":"Betűtípus","h1":"Címsor","h2":"Alcím","h3":"Al-alcím","monospace":"rögzített szélességű","fontSize":"Méret","cursive":"kurzív"})

View File

@@ -1 +1 @@
({"1":"xx-small","2":"x-small","formatBlock":"Formato","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Paragrafo","pre":"Preformattato","sans-serif":"sans-serif","fontName":"Carattere","h1":"Intestazione","h2":"Sottointestazione","h3":"Sottointestazione secondaria","monospace":"spaziatura fissa","fontSize":"Dimensione","cursive":"corsivo","noFormat":"None"}) ({"noFormat":"Nessuna","1":"xx-small","2":"x-small","formatBlock":"Formato","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Paragrafo","pre":"Preformattato","sans-serif":"sans-serif","fontName":"Carattere","h1":"Intestazione","h2":"Sottointestazione","h3":"Sottointestazione secondaria","monospace":"spaziatura fissa","fontSize":"Dimensione","cursive":"corsivo"})

View File

@@ -1 +1 @@
({"text":"Descrizione:","insertImageTitle":"Proprietà immagine","set":"Imposta","newWindow":"Nuova finestra","topWindow":"Finestra superiore","target":"Destinazione:","createLinkTitle":"Proprietà collegamento","parentWindow":"Finestra padre","currentWindow":"Finestra corrente","url":"URL:"}) ({"text":"Descrizione:","insertImageTitle":"Proprietà immagine","set":"Imposta","newWindow":"Nuova finestra","topWindow":"Finestra in primo piano","target":"Destinazione:","createLinkTitle":"Proprietà collegamento","parentWindow":"Finestra parent","currentWindow":"Finestra corrente","url":"URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"Rimuovi formato","copy":"Copia","paste":"Incolla","selectAll":"Seleziona tutto","insertOrderedList":"Elenco numerato","insertTable":"Inserisci/Modifica tabella","print":"Stampa","underline":"Sottolinea","foreColor":"Colore primo piano","htmlToggle":"Origine HTML","formatBlock":"Stile paragrafo","newPage":"Nuova pagina","insertHorizontalRule":"Righello orizzontale","delete":"Elimina","insertUnorderedList":"Elenco puntato","tableProp":"Proprietà tabella","insertImage":"Inserisci immagine","superscript":"Apice","subscript":"Pedice","createLink":"Crea collegamento","undo":"Annulla","fullScreen":"Attiva/Disattiva schermo intero","italic":"Corsivo","fontName":"Nome carattere","justifyLeft":"Allinea a sinistra","unlink":"Rimuovi collegamento","toggleTableBorder":"Attiva/Disattiva bordo tabella","viewSource":"Visualizza origine HTML","fontSize":"Dimensione carattere","systemShortcut":"La azione \"${0}\" è disponibile solo nel browser tramite un tasto di scelta rapida. Utilizzare ${1}.","indent":"Rientro","redo":"Ripristina","strikethrough":"Barrato","justifyFull":"Giustifica","justifyCenter":"Allinea al centro","hiliteColor":"Colore sfondo","deleteTable":"Elimina tabella","outdent":"Annulla rientro","cut":"Taglia","plainFormatBlock":"Stile paragrafo","toggleDir":"Attiva/Disattiva direzione","bold":"Grassetto","tabIndent":"Rientro tabulazione","justifyRight":"Allinea a destra","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Rimuovi formato","copy":"Copia","paste":"Incolla","selectAll":"Seleziona tutto","insertOrderedList":"Elenco numerato","insertTable":"Inserisci/Modifica tabella","print":"Stampa","underline":"Sottolineato","foreColor":"Colore primo piano","htmlToggle":"Origine HTML","formatBlock":"Stile paragrafo","newPage":"Nuova pagina","insertHorizontalRule":"Righello orizzontale","delete":"Elimina","insertUnorderedList":"Elenco puntato","tableProp":"Proprietà tabella","insertImage":"Inserisci immagine","superscript":"Apice","subscript":"Pedice","createLink":"Crea collegamento","undo":"Annulla","fullScreen":"Attiva/Disattiva schermo intero","italic":"Corsivo","fontName":"Nome carattere","justifyLeft":"Allinea a sinistra","unlink":"Rimuovi collegamento","toggleTableBorder":"Mostra/Nascondi margine tabella","viewSource":"Visualizza origine HTML","fontSize":"Dimensione carattere","systemShortcut":"Azione \"${0}\" disponibile sul proprio browser solo mediante i tasti di scelta rapida della tastiera. Utilizzare ${1}.","indent":"Rientra","redo":"Ripristina","strikethrough":"Barrato","justifyFull":"Giustifica","justifyCenter":"Allinea al centro","hiliteColor":"Colore sfondo","deleteTable":"Elimina tabella","outdent":"Rimuovi rientro","cut":"Taglia","plainFormatBlock":"Stile paragrafo","toggleDir":"Inverti direzione","bold":"Grassetto","tabIndent":"Rientranza tabulazione","justifyRight":"Allinea a destra","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"超極小","2":"極小","formatBlock":"フォーマット","3":"小","4":"標準","5":"大","6":"特大","7":"超特大","fantasy":"fantasy","serif":"serif","p":"段落","pre":"事前フォーマット済み","sans-serif":"sans-serif","fontName":"フォント","h1":"見出し","h2":"副見出し","h3":"副見出しの副見出し","monospace":"monospace","fontSize":"サイズ","cursive":"cursive","noFormat":"None"}) ({"noFormat":"なし","1":"超極小","2":"極小","formatBlock":"フォーマット","3":"小","4":"標準","5":"大","6":"特大","7":"超特大","fantasy":"fantasy","serif":"serif","p":"段落","pre":"事前フォーマット済み","sans-serif":"sans-serif","fontName":"フォント","h1":"見出し","h2":"副見出し","h3":"副見出しの副見出し","monospace":"monospace","fontSize":"サイズ","cursive":"cursive"})

View File

@@ -1 +1 @@
({"removeFormat":"式の除去","copy":"コピー","paste":"貼り付け","selectAll":"すべて選択","insertOrderedList":"番号付きリスト","insertTable":"テーブルの挿入/編集","print":"印刷","underline":"下線","foreColor":"前景色","htmlToggle":"HTML ソース","formatBlock":"段落スタイル","newPage":"新しいページ","insertHorizontalRule":"水平罫線","delete":"削除","insertUnorderedList":"黒丸付きリスト","tableProp":"テーブルプロパティ","insertImage":"イメージの挿入","superscript":"上付き文字","subscript":"下付き文字","createLink":"リンクの作成","undo":"元に戻す","fullScreen":"全画面表示に切り替え","italic":"斜体","fontName":"フォント名","justifyLeft":"左揃え","unlink":"リンクの削除","toggleTableBorder":"テーブルボーダーの切り替え","viewSource":"HTML ソースの表示","fontSize":"フォントサイズ","systemShortcut":"\"${0}\" アクションを使用できるのは、ブラウザーでキーボードショートカットを使用する場合のみです。 ${1} を使用してください。","indent":"インデント","redo":"やり直し","strikethrough":"取り消し線","justifyFull":"両端揃え","justifyCenter":"中央揃え","hiliteColor":"背景色","deleteTable":"テーブルの削除","outdent":"アウトデント","cut":"切り取り","plainFormatBlock":"段落スタイル","toggleDir":"方向の切り替え","bold":"太字","tabIndent":"タブインデント","justifyRight":"右揃え","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"式のクリア","copy":"コピー","paste":"貼り付け","selectAll":"すべて選択","insertOrderedList":"番号付きリスト","insertTable":"テーブルの挿入/編集","print":"印刷","underline":"下線","foreColor":"前景色","htmlToggle":"HTML ソース","formatBlock":"段落スタイル","newPage":"新ページ","insertHorizontalRule":"水平罫線","delete":"削除","insertUnorderedList":"黒丸付きリスト","tableProp":"テーブルプロパティ","insertImage":"イメージの挿入","superscript":"上付き文字","subscript":"下付き文字","createLink":"リンクの作成","undo":"元に戻す","fullScreen":"全画面表示に切り替え","italic":"イタリック","fontName":"フォント名","justifyLeft":"左揃え","unlink":"リンクの削除","toggleTableBorder":"テーブルボーダーの切り替え","viewSource":"HTML ソースの表示","ctrlKey":"Ctrl+${0}","fontSize":"フォントサイズ","systemShortcut":"\"${0}\" アクションを使用できるのは、ブラウザーでキーボードショートカットを使用する場合のみです。${1} を使用してください。","indent":"インデント","redo":"やり直し","strikethrough":"取り消し線","justifyFull":"両端揃え","justifyCenter":"中央揃え","hiliteColor":"マーカー","deleteTable":"テーブルの削除","outdent":"アウトデント","cut":"切り取り","plainFormatBlock":"段落スタイル","toggleDir":"方向の切り替え","bold":"太字","tabIndent":"タブインデント","justifyRight":"右揃え","appleKey":"⌘${0}"})

View File

@@ -0,0 +1 @@
({"noFormat":"Ешбір","1":"xx-кіші","2":"x-кіші","formatBlock":"Пішім","3":"кіші","4":"орташа","5":"үлкен","6":"x-үлкен","7":"xx-үлкен","fantasy":"қиял-ғажайып","serif":"serif","p":"Еже","pre":"Алдын ала пішімделген","sans-serif":"sans-serif","fontName":"Қаріп","h1":"Үстіңгі деректеме","h2":"Ішкі тақырып","h3":"Ішкі-ішкі тақырып","monospace":"monospace","fontSize":"Өлшемі","cursive":"көлбеу"})

View File

@@ -0,0 +1 @@
({"text":"Сипаттама:","insertImageTitle":"Сурет сипаттары","set":"Орнату","newWindow":"Жаңа терезе","topWindow":"Ең жоғарғы терезе","target":"Мақсат:","createLinkTitle":"Сілтеме сипаттары","parentWindow":"Басты терезе","currentWindow":"Ағымдағы терезе","url":"URL мекенжайы:"})

View File

@@ -0,0 +1 @@
({"removeFormat":"Пішімді алып тастау","copy":"Көшіру","paste":"Қою","selectAll":"Барлығын таңдау","insertOrderedList":"Нөмірленген тізім","insertTable":"Кестені кірістіру/өңдеу","print":"Басып шығару","underline":"Асты сызылған","foreColor":"Алды түсі","htmlToggle":"HTML көзі","formatBlock":"Еже мәнері","newPage":"Жаңа бет","insertHorizontalRule":"Көлденең сызғыш","delete":"Жою","insertUnorderedList":"Таңбалауыш тізім","tableProp":"Кесте сипаты","insertImage":"Сурет кірістіру","superscript":"Жолүсті","subscript":"Жоласты","createLink":"Сілтеме жасау","undo":"Болдырмау ","fullScreen":"Толық экранды қосу","italic":"Көлбеу","fontName":"Қаріп атауы","justifyLeft":"Сол жақ бойынша туралау","unlink":"Сілтемені жою","toggleTableBorder":"Кесте жиегін қосу","viewSource":"HTML көзін қарау","fontSize":"Қаріп өлшемі","systemShortcut":"\"${0}\" әрекеті шолғышта тек пернелер тіркесімі арқылы қол жетімді. ${1} пайдаланыңыз.","indent":"Шегіндіру","redo":"Қайтару","strikethrough":"Сызылған","justifyFull":"Туралау","justifyCenter":"Ортасы бойынша туралау","hiliteColor":"Өң түсі","deleteTable":"Кестені жою","outdent":"Шығыңқы","cut":"Қиып алу","plainFormatBlock":"Еже мәнері","toggleDir":"Бағытты қосу","bold":"Қалың","tabIndent":"Қойынды шегінісі","justifyRight":"Оң жақ бойынша туралау","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"가장 작게","2":"조금 작게","formatBlock":"서식","3":"작게","4":"중간","5":"크게","6":"조금 크게","7":"가장 크게","fantasy":"fantasy","serif":"serif","p":"단락","pre":"서식이 지정됨","sans-serif":"sans-serif","fontName":"글꼴","h1":"제목","h2":"부제목","h3":"하위 부제목","monospace":"monospace","fontSize":"크기","cursive":"cursive","noFormat":"None"}) ({"noFormat":"없음","1":"가장 작게","2":"조금 작게","formatBlock":"서식","3":"작게","4":"중간","5":"크게","6":"조금 크게","7":"가장 크게","fantasy":"fantasy","serif":"serif","p":"단락","pre":"서식이 지정됨","sans-serif":"sans-serif","fontName":"글꼴","h1":"제목","h2":"부제목","h3":"하위 부제목","monospace":"monospace","fontSize":"크기","cursive":"cursive"})

View File

@@ -1 +1 @@
({"text":"설명:","insertImageTitle":"이미지 특성","set":"설정","newWindow":"새 창","topWindow":"최상위 창","target":"대상:","createLinkTitle":"링크 특성","parentWindow":"상위 창","currentWindow":"현재 창","url":"URL:"}) ({"text":"설명:","insertImageTitle":"이미지 등록 정보","set":"설정","newWindow":"새 창","topWindow":"최상위 창","target":"대상","createLinkTitle":"링크 등록 정보","parentWindow":"상위 창","currentWindow":"현재 창","url":"URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"형식 제거","copy":"복사","paste":"붙여넣기","selectAll":"모두 선택","insertOrderedList":"번호 목록","insertTable":"테이블 삽입/편집","print":"인쇄","underline":"밑줄","foreColor":"전경색","htmlToggle":"HTML 소스","formatBlock":"단락 스타일","newPage":"새 페이지","insertHorizontalRule":"수평 자","delete":"삭제","insertUnorderedList":"글머리표 목록","tableProp":"테이블 특성","insertImage":"이미지 삽입","superscript":"위첨자","subscript":"아래첨자","createLink":"링크 작성","undo":"실행 취소","fullScreen":"토글 전체 화면","italic":"기울임","fontName":"글꼴 이름","justifyLeft":"왼쪽 맞춤","unlink":"링크 제거","toggleTableBorder":"토글 테이블 테두리","viewSource":"HTML 소스 보기","fontSize":"글꼴 크기","systemShortcut":"\"${0}\" 조치는 브라우저에서 키보드 단축키를 이용해서만 사용할 수 있습니다. ${1}을(를) 사용하십시오.","indent":"들여쓰기","redo":"다시 실행","strikethrough":"취소선","justifyFull":"양쪽 맞춤","justifyCenter":"가운데 맞춤","hiliteColor":"배경색","deleteTable":"테이블 삭제","outdent":"내어쓰기","cut":"잘라내기","plainFormatBlock":"단락 스타일","toggleDir":"토글 방향","bold":"굵은체","tabIndent":"탭 들여쓰기","justifyRight":"오른쪽 맞춤","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"형식 제거","copy":"복사","paste":"붙여넣기","selectAll":"모두 선택","insertOrderedList":"번호 목록","insertTable":"테이블 삽입/편집","print":"인쇄","underline":"밑줄","foreColor":"전경색","htmlToggle":"HTML 소스","formatBlock":"단락 양식","newPage":"새 페이지","insertHorizontalRule":"수평 자","delete":"삭제","insertUnorderedList":"글머리표 목록","tableProp":"테이블 특성","insertImage":"이미지 삽입","superscript":"위첨자","subscript":"아래첨자","createLink":"링크 작성","undo":"실행 취소","fullScreen":"전체 화면 토글","italic":"기울임","fontName":"글꼴 이름","justifyLeft":"왼쪽 맞춤","unlink":"링크 제거","toggleTableBorder":"테이블 외곽선 토글","viewSource":"HTML 소스 보기","fontSize":"글꼴 크기","systemShortcut":"\"${0}\" 조치는 브라우저에서 키보드 단축키를 해서만 사용 가능합니다. ${1}을(를) 사용하십시오.","indent":"들여쓰기","redo":"다시 실행","strikethrough":"취소선","justifyFull":"양쪽 맞춤","justifyCenter":"가운데 맞춤","hiliteColor":"배경색","deleteTable":"테이블 삭제","outdent":"내어쓰기","cut":"잘라내기","plainFormatBlock":"단락 양식","toggleDir":"방향 토글","bold":"굵","tabIndent":"탭 들여쓰기","justifyRight":"오른쪽 맞춤","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"xx-liten","2":"x-liten","formatBlock":"Format","3":"liten","4":"middels","5":"stor","6":"x-stor","7":"xx-stor","fantasy":"fantasi","serif":"serif","p":"Avsnitt","pre":"Forhåndsformatert","sans-serif":"sans-serif","fontName":"Skrift","h1":"Overskrift","h2":"Undertittel","h3":"Under-undertittel","monospace":"monospace","fontSize":"Størrelse","cursive":"kursiv","noFormat":"None"}) ({"noFormat":"Ingen","1":"xx-liten","2":"x-liten","formatBlock":"Format","3":"liten","4":"middels","5":"stor","6":"x-stor","7":"xx-stor","fantasy":"fantasi","serif":"serif","p":"Avsnitt","pre":"Forhåndsformatert","sans-serif":"sans-serif","fontName":"Skrift","h1":"Overskrift","h2":"Undertittel","h3":"Under-undertittel","monospace":"monospace","fontSize":"Størrelse","cursive":"kursiv"})

View File

@@ -1 +1 @@
({"removeFormat":"Fjern format","copy":"Kopier","paste":"Lim inn","selectAll":"Velg alle","insertOrderedList":"Nummerert liste","insertTable":"Sett inn/rediger tabell","print":"Skriv ut","underline":"Understreking","foreColor":"Forgrunnsfarge","htmlToggle":"HTML-kilde","formatBlock":"Avsnittsstil","newPage":"Ny side","insertHorizontalRule":"Vannrett strek","delete":"Slett","insertUnorderedList":"Punktliste","tableProp":"Tabellegenskap","insertImage":"Sett inn bilde","superscript":"Hevet skrift","subscript":"Senket skrift","createLink":"Opprett kobling","undo":"Angre","fullScreen":"Slå på/av full skjerm","italic":"Kursiv","fontName":"Skriftnavn","justifyLeft":"Venstrejuster","unlink":"Fjern kobling","toggleTableBorder":"Bytt tabellkant","viewSource":"Vis HTML-kilde","fontSize":"Skriftstørrelse","systemShortcut":"Handlingen \"${0}\" er bare tilgjengelig i nettleseren ved hjelp av en tastatursnarvei. Bruk ${1}.","indent":"Innrykk","redo":"Gjør om","strikethrough":"Gjennomstreking","justifyFull":"Juster","justifyCenter":"Midtstill","hiliteColor":"Bakgrunnsfarge","deleteTable":"Slett tabell","outdent":"Fjern innrykk","cut":"Klipp ut","plainFormatBlock":"Avsnittsstil","toggleDir":"Bytt retning","bold":"Fet","tabIndent":"Tabulatorinnrykk","justifyRight":"Høyrejuster","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Fjern format","copy":"Kopier","paste":"Lim inn","selectAll":"Velg alle","insertOrderedList":"Nummerert liste","insertTable":"Sett inn/rediger tabell","print":"Skriv ut","underline":"Understreking","foreColor":"Forgrunnsfarge","htmlToggle":"HTML-kilde","formatBlock":"Avsnittsstil","newPage":"Ny side","insertHorizontalRule":"Vannrett strek","delete":"Slett","appleKey":"⌘${0}","insertUnorderedList":"Punktliste","tableProp":"Tabellegenskap","insertImage":"Sett inn bilde","superscript":"Hevet skrift","subscript":"Senket skrift","createLink":"Opprett kobling","undo":"Angre","fullScreen":"Slå på/av full skjerm","italic":"Kursiv","fontName":"Skriftnavn","justifyLeft":"Venstrejuster","unlink":"Fjern kobling","toggleTableBorder":"Bytt tabellkant","viewSource":"Vis HTML-kilde","ctrlKey":"ctrl+${0}","fontSize":"Skriftstørrelse","systemShortcut":"Handlingen \"${0}\" er bare tilgjengelig i nettleseren ved hjelp av en tastatursnarvei. Bruk ${1}.","indent":"Innrykk","redo":"Gjør om","strikethrough":"Gjennomstreking","justifyFull":"Juster","justifyCenter":"Midtstill","hiliteColor":"Bakgrunnsfarge","deleteTable":"Slett tabell","outdent":"Fjern innrykk","cut":"Klipp ut","plainFormatBlock":"Avsnittsstil","toggleDir":"Bytt retning","bold":"Fet","tabIndent":"Tabulatorinnrykk","justifyRight":"Høyrejuster"})

View File

@@ -1 +1 @@
({"1":"xx-klein","2":"x-klein","formatBlock":"Opmaak","3":"klein","4":"gemiddeld","5":"groot","6":"x-groot","7":"xx-groot","fantasy":"fantasy","serif":"serif","p":"Alinea","pre":"Vooraf opgemaakt","sans-serif":"sans-serif","fontName":"Lettertype","h1":"Kop","h2":"Subkop","h3":"Sub-subkop","monospace":"monospace","fontSize":"Grootte","cursive":"cursief","noFormat":"None"}) ({"noFormat":"Geen","1":"xx-klein","2":"x-klein","formatBlock":"Opmaak","3":"klein","4":"gemiddeld","5":"groot","6":"x-groot","7":"xx-groot","fantasy":"fantasy","serif":"serif","p":"Alinea","pre":"Vooraf opgemaakt","sans-serif":"sans-serif","fontName":"Lettertype","h1":"Kop","h2":"Subkop","h3":"Sub-subkop","monospace":"monospace","fontSize":"Grootte","cursive":"cursief"})

View File

@@ -1 +1 @@
({"1":"najmniejsza","2":"mniejsza","formatBlock":"Format","3":"mała","4":"średnia","5":"duża","6":"większa","7":"największa","fantasy":"fantazyjna","serif":"szeryfowa","p":"Akapit","pre":"Wstępnie sformatowane","sans-serif":"bezszeryfowa","fontName":"Czcionka","h1":"Nagłówek","h2":"Nagłówek 2-go poziomu","h3":"Nagłówek 3-go poziomu","monospace":"czcionka o stałej szerokości","fontSize":"Wielkość","cursive":"kursywa","noFormat":"None"}) ({"noFormat":"Brak","1":"najmniejsza","2":"mniejsza","formatBlock":"Format","3":"mała","4":"średnia","5":"duża","6":"większa","7":"największa","fantasy":"fantazyjna","serif":"szeryfowa","p":"Akapit","pre":"Wstępnie sformatowane","sans-serif":"bezszeryfowa","fontName":"Czcionka","h1":"Nagłówek","h2":"Nagłówek 2-go poziomu","h3":"Nagłówek 3-go poziomu","monospace":"czcionka o stałej szerokości","fontSize":"Wielkość","cursive":"kursywa"})

View File

@@ -1 +1 @@
({"removeFormat":"Usuń formatowanie","copy":"Kopiuj","paste":"Wklej","selectAll":"Wybierz wszystko","insertOrderedList":"Lista numerowana","insertTable":"Wstaw/edytuj tabelę","print":"Drukuj","underline":"Podkreślenie","foreColor":"Kolor pierwszego planu","htmlToggle":"Źródło HTML","formatBlock":"Styl akapitu","newPage":"Nowa strona","insertHorizontalRule":"Linia pozioma","delete":"Usuń","insertUnorderedList":"Lista wypunktowana","tableProp":"Właściwość tabeli","insertImage":"Wstaw obraz","superscript":"Indeks górny","subscript":"Indeks dolny","createLink":"Utwórz odsyłacz","undo":"Cofnij","fullScreen":"Przełącz pełny ekran","italic":"Kursywa","fontName":"Nazwa czcionki","justifyLeft":"Wyrównaj do lewej","unlink":"Usuń odsyłacz","toggleTableBorder":"Przełącz ramkę tabeli","viewSource":"Wyświetl kod źródłowy HTML","ctrlKey":"Ctrl+${0}","fontSize":"Wielkość czcionki","systemShortcut":"Działanie ${0} jest dostępne w tej przeglądarce wyłącznie przy użyciu skrótu klawiaturowego. Należy użyć klawiszy ${1}.","indent":"Wcięcie","redo":"Ponów","strikethrough":"Przekreślenie","justifyFull":"Wyrównaj do lewej i prawej","justifyCenter":"Wyrównaj do środka","hiliteColor":"Kolor tła","deleteTable":"Usuń tabelę","outdent":"Usuń wcięcie","cut":"Wytnij","plainFormatBlock":"Styl akapitu","toggleDir":"Przełącz kierunek","bold":"Pogrubienie","tabIndent":"Wcięcie o tabulator","justifyRight":"Wyrównaj do prawej","appleKey":"⌘${0}"}) ({"removeFormat":"Usuń formatowanie","copy":"Kopiuj","paste":"Wklej","selectAll":"Wybierz wszystko","insertOrderedList":"Lista numerowana","insertTable":"Wstaw/edytuj tabelę","print":"Drukuj","underline":"Podkreślenie","foreColor":"Kolor pierwszego planu","htmlToggle":"Kod źródłowy HTML","formatBlock":"Styl akapitu","newPage":"Nowa strona","insertHorizontalRule":"Linia pozioma","delete":"Usuń","insertUnorderedList":"Lista wypunktowana","tableProp":"Właściwość tabeli","insertImage":"Wstaw obraz","superscript":"Indeks górny","subscript":"Indeks dolny","createLink":"Utwórz odsyłacz","undo":"Cofnij","fullScreen":"Przełącz pełny ekran","italic":"Kursywa","fontName":"Nazwa czcionki","justifyLeft":"Wyrównaj do lewej","unlink":"Usuń odsyłacz","toggleTableBorder":"Przełącz ramkę tabeli","viewSource":"Wyświetl kod źródłowy HTML","ctrlKey":"Ctrl+${0}","fontSize":"Wielkość czcionki","systemShortcut":"Działanie ${0} jest dostępne w tej przeglądarce wyłącznie przy użyciu skrótu klawiaturowego. Należy użyć klawiszy ${1}.","indent":"Wcięcie","redo":"Ponów","strikethrough":"Przekreślenie","justifyFull":"Wyrównaj do lewej i prawej","justifyCenter":"Wyrównaj do środka","hiliteColor":"Kolor tła","deleteTable":"Usuń tabelę","outdent":"Usuń wcięcie","cut":"Wytnij","plainFormatBlock":"Styl akapitu","toggleDir":"Przełącz kierunek","bold":"Pogrubienie","tabIndent":"Wcięcie o tabulator","justifyRight":"Wyrównaj do prawej","appleKey":"⌘${0}"})

View File

@@ -1 +1 @@
({"1":"xxs","2":"xs","formatBlock":"Formato","3":"small","4":"medium","5":"large","6":"xl","7":"xxl","fantasy":"fantasy","serif":"serif","p":"Parágrafo","pre":"Pré-formatado","sans-serif":"sans-serif","fontName":"Tipo de letra","h1":"Título","h2":"Sub-título","h3":"Sub-subtítulo","monospace":"monospace","fontSize":"Tamanho","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Nenhum","1":"xxs","2":"xs","formatBlock":"Formato","3":"small","4":"medium","5":"large","6":"xl","7":"xxl","fantasy":"fantasy","serif":"serif","p":"Parágrafo","pre":"Pré-formatado","sans-serif":"sans-serif","fontName":"Tipo de letra","h1":"Título","h2":"Sub-título","h3":"Sub-subtítulo","monospace":"monospace","fontSize":"Tamanho","cursive":"cursive"})

View File

@@ -1 +1 @@
({"removeFormat":"Remover formato","copy":"Copiar","paste":"Colar","selectAll":"Seleccionar tudo","insertOrderedList":"Lista numerada","insertTable":"Inserir/Editar tabela","print":"Imprimir","underline":"Sublinhado","foreColor":"Cor de primeiro plano","htmlToggle":"Origem HTML","formatBlock":"Estilo de parágrafo","newPage":"Nova página","insertHorizontalRule":"Régua horizontal","delete":"Eliminar","insertUnorderedList":"Lista marcada","tableProp":"Propriedades da tabela","insertImage":"Inserir imagem","superscript":"Superior à linha","subscript":"Inferior à linha","createLink":"Criar ligação","undo":"Anular","fullScreen":"Alternar ecrã completo","italic":"Itálico","fontName":"Nome do tipo de letra","justifyLeft":"Alinhar à esquerda","unlink":"Remover ligação","toggleTableBorder":"Alternar contorno da tabela","viewSource":"Ver origem HTML","fontSize":"Tamanho do tipo de letra","systemShortcut":"A acção \"${0}\" apenas está disponível no navegador utilizando um atalho de teclado. Utilize ${1}.","indent":"Indentar","redo":"Repetir","strikethrough":"Rasurado","justifyFull":"Justificar","justifyCenter":"Alinhar ao centro","hiliteColor":"Cor de segundo plano","deleteTable":"Eliminar tabela","outdent":"Recuar","cut":"Cortar","plainFormatBlock":"Estilo de parágrafo","toggleDir":"Alternar direcção","bold":"Negrito","tabIndent":"Indentar com a tecla Tab","justifyRight":"Alinhar à direita","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Remover formato","copy":"Copiar","paste":"Colar","selectAll":"Seleccionar tudo","insertOrderedList":"Lista numerada","insertTable":"Inserir/Editar tabela","print":"Imprimir","underline":"Sublinhado","foreColor":"Cor de primeiro plano","htmlToggle":"Código-fonte de HTML","formatBlock":"Estilo de parágrafo","newPage":"Nova página","insertHorizontalRule":"Régua horizontal","delete":"Eliminar","insertUnorderedList":"Lista marcada","tableProp":"Propriedades da tabela","insertImage":"Inserir imagem","superscript":"Superior à linha","subscript":"Inferior à linha","createLink":"Criar ligação","undo":"Anular","fullScreen":"Alternar ecrã completo","italic":"Itálico","fontName":"Nome do tipo de letra","justifyLeft":"Alinhar à esquerda","unlink":"Remover ligação","toggleTableBorder":"Alternar contorno da tabela","viewSource":"Ver origem HTML","fontSize":"Tamanho do tipo de letra","systemShortcut":"A acção \"${0}\" apenas está disponível no navegador utilizando um atalho de teclado. Utilize ${1}.","indent":"Indentar","redo":"Repetir","strikethrough":"Rasurado","justifyFull":"Justificar","justifyCenter":"Alinhar ao centro","hiliteColor":"Cor de segundo plano","deleteTable":"Eliminar tabela","outdent":"Recuar","cut":"Cortar","plainFormatBlock":"Estilo de parágrafo","toggleDir":"Alternar direcção","bold":"Negrito","tabIndent":"Indentar com a tecla Tab","justifyRight":"Alinhar à direita","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"extra-extra-pequeno","2":"extra-pequeno","formatBlock":"Formatar","3":"pequena","4":"médio","5":"grande","6":"extra-grande","7":"extra-extra-grande","fantasy":"fantasy","serif":"serif","p":"Parágrafo","pre":"Pré-formatado","sans-serif":"sans-serif","fontName":"Fonte","h1":"Título","h2":"Subtítulo","h3":"Sub-subtítulo","monospace":"espaço simples","fontSize":"Tamanho","cursive":"cursiva","noFormat":"None"}) ({"noFormat":"Nenhuma","1":"extra-extra-pequeno","2":"extra-pequeno","formatBlock":"Formatar","3":"pequena","4":"médio","5":"grande","6":"extra-grande","7":"extra-extra-grande","fantasy":"fantasy","serif":"serif","p":"Parágrafo","pre":"Pré-formatado","sans-serif":"sans-serif","fontName":"Fonte","h1":"Título","h2":"Subtítulo","h3":"Sub-subtítulo","monospace":"espaço simples","fontSize":"Tamanho","cursive":"cursiva"})

View File

@@ -1 +1 @@
({"removeFormat":"Remover Formato","copy":"Copiar","paste":"Colar","selectAll":"Selecionar Todos","insertOrderedList":"Lista Numerada","insertTable":"Inserir/Editar Tabela","print":"Impressão","underline":"Sublinhado","foreColor":"Cor do Primeiro Plano","htmlToggle":"Origem HTML","formatBlock":"Estilo de Parágrafo","newPage":"Nova Página","insertHorizontalRule":"Régua Horizontal","delete":"Excluir","insertUnorderedList":"Lista com Marcadores","tableProp":"Propriedade da Tabela","insertImage":"Inserir Imagem","superscript":"Sobrescrito","subscript":"Subscrito","createLink":"Criar Link","undo":"Desfazer","fullScreen":"Comutar Tela Cheia","italic":"Itálico","fontName":"Nome da Fonte","justifyLeft":"Alinhar pela Esquerda","unlink":"Remover Link","toggleTableBorder":"Alternar Moldura da Tabela","viewSource":"Visualizar Origem HTML","fontSize":"Tamanho da Fonte","systemShortcut":"A ação \"${0}\" está disponível em seu navegador apenas usando um atalho do teclado. Use ${1}.","indent":"Recuar","redo":"Refazer","strikethrough":"Tachado","justifyFull":"Justificar","justifyCenter":"Alinhar pelo Centro","hiliteColor":"Cor de segundo plano","deleteTable":"Excluir Tabela","outdent":"Não-chanfrado","cut":"Recortar","plainFormatBlock":"Estilo de Parágrafo","toggleDir":"Comutar Direção","bold":"Negrito","tabIndent":"Recuo de Guia","justifyRight":"Alinhar pela Direita","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Remover Formato","copy":"Copiar","paste":"Colar","selectAll":"Selecionar Todos","insertOrderedList":"Lista Numerada","insertTable":"Inserir/Editar Tabela","print":"Imprimir","underline":"Sublinhado","foreColor":"Cor do Primeiro Plano","htmlToggle":"Origem HTML","formatBlock":"Estilo de Parágrafo","newPage":"Nova Página","insertHorizontalRule":"Régua Horizontal","delete":"Excluir","insertUnorderedList":"Lista com Marcadores","tableProp":"Propriedade da Tabela","insertImage":"Inserir Imagem","superscript":"Sobrescrito","subscript":"Subscrito","createLink":"Criar Link","undo":"Desfazer","fullScreen":"Comutar Tela Cheia","italic":"Itálico","fontName":"Nome da Fonte","justifyLeft":"Alinhar à Esquerda","unlink":"Remover Link","toggleTableBorder":"Alternar Moldura da Tabela","viewSource":"Visualizar Origem HTML","fontSize":"Tamanho da Fonte","systemShortcut":"A ação \"${0}\" está disponível em seu navegador apenas usando um atalho de teclado. Use ${1}.","indent":"Recuar","redo":"Refazer","strikethrough":"Tachado","justifyFull":"Justificar","justifyCenter":"Alinhar pelo Centro","hiliteColor":"Cor do Segundo Plano","deleteTable":"Excluir Tabela","outdent":"Não chanfrado","cut":"Recortar","plainFormatBlock":"Estilo de Parágrafo","toggleDir":"Comutar Direção","bold":"Negrito","tabIndent":"Recuo de Guia","justifyRight":"Alinhar à Direita","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"text":"Descriere:","insertImageTitle":"Proprietăţi imagine","set":"Setare","newWindow":"Fereastră nouă","topWindow":"Fereastra cea mai de sus","target":"Ţintă:","createLinkTitle":"Proprietăţi legătură","parentWindow":"Fereastra părinte","currentWindow":"Fereastra curentă","url":"URL:"}) ({"text":"Descriere:","insertImageTitle":"Proprietăţi imagine","set":"Setare","newWindow":"Fereastra nouă","topWindow":"Fereastra cea mai de sus","target":"Destinaţie:","createLinkTitle":"Proprietăţi legătură","parentWindow":"Fereastra părinte","currentWindow":"Fereastra curentă","url":"URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"Înlăturare format","copy":"Copiere","paste":"Lipire","selectAll":"Selectare toate","insertOrderedList":"Listă numerotată","insertTable":"Inserare/Editare tabelă","print":"Tipărire","underline":"Subliniere","foreColor":"Culoare prim plan","htmlToggle":"Sursă HTML","formatBlock":"Stil paragraf","newPage":"Pagină nouă","insertHorizontalRule":"Regulă orizontală","delete":"Ştergere","insertUnorderedList":"Listă cu marcaje","tableProp":"Proprietăţi tabelă","insertImage":"Inserare imagine","superscript":"Scriere indice superior","subscript":"Scriere indice inferior","createLink":"Creare legătură","undo":"Anulare acţiune","fullScreen":"Comutare ecran complet","italic":"Cursive","fontName":"Nume font","justifyLeft":"Aliniere la stânga","unlink":"Înlăturare legătură","toggleTableBorder":"Comutare bordură tabelă","viewSource":"Vizualizare sursă HTML","fontSize":"Dimensiune font","systemShortcut":"Acţiunea \"${0}\" este disponibilă în browser folosind o scurtătură de la tastatură. Folosiţi ${1}.","indent":"Indentare","redo":"Repetare acţiune","strikethrough":"Suprascriere linie","justifyFull":"Aliniere","justifyCenter":"Aliniere pe centru","hiliteColor":"Culoare fundal","deleteTable":"Ştergere tabelă","outdent":"Outdentare","cut":"Tăiere","plainFormatBlock":"Stil paragraf","toggleDir":"Comutare direcţie","bold":"Aldine","tabIndent":"Indentare cu tab","justifyRight":"Aliniere la dreapta","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Înlăturare format","copy":"Copiere","paste":"Lipire","selectAll":"Selectează tot","insertOrderedList":"Listă numerotată","insertTable":"Inserare/Editare tabelă","print":"Tipărire","underline":"Subliniere","foreColor":"Culoare de prim-plan","htmlToggle":"Sursă HTML","formatBlock":"Stil paragraf","newPage":"Pagină nouă","insertHorizontalRule":"Linie delimitatoare","delete":"Ştergere","insertUnorderedList":"Listă cu marcator","tableProp":"Proprietate tabelă","insertImage":"Inserare imagine","superscript":"Scriere indice superior","subscript":"Scriere indice inferior","createLink":"Creare legătură","undo":"Anulare acţiune","fullScreen":"Comutare ecran complet","italic":"Cursiv","fontName":"Nume font","justifyLeft":"Aliniere stânga","unlink":"Înlăturare legătură","toggleTableBorder":"Comutare bordură tabelă","viewSource":"Vizualizara sursă HTML","fontSize":"Dimensiune font","systemShortcut":"Acţiunea \"${0}\" este disponibilă în browser doar utilizând o comandă rapidă de la tastatură. Utilizaţi ${1}.","indent":"Micşorare indent","redo":"Refacere acţiune","strikethrough":"Tăiere text cu o linie","justifyFull":"Aliniere stânga-dreapta","justifyCenter":"Aliniere centru","hiliteColor":"Culoare de fundal","deleteTable":"Ştergere tabelă","outdent":"Mărire indent","cut":"Tăiere","plainFormatBlock":"Stil paragraf","toggleDir":"Comutare direcţie","bold":"Aldin","tabIndent":"Indentare Tab","justifyRight":"Aliniere dreapta","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"самый маленький","2":"очень маленький","formatBlock":"Формат","3":"маленький","4":"средний","5":"большой","6":"очень большой","7":"самый большой","fantasy":"артистический","serif":"с засечками","p":"Абзац","pre":"Заранее отформатированный","sans-serif":"без засечек","fontName":"Шрифт","h1":"Заголовок","h2":"Подзаголовок","h3":"Вложенный подзаголовок","monospace":"непропорциональный","fontSize":"Размер","cursive":"курсив","noFormat":"None"}) ({"noFormat":"Нет","1":"самый маленький","2":"очень маленький","formatBlock":"Формат","3":"маленький","4":"средний","5":"большой","6":"очень большой","7":"самый большой","fantasy":"артистический","serif":"с засечками","p":"Абзац","pre":"Заранее отформатированный","sans-serif":"без засечек","fontName":"Шрифт","h1":"Заголовок","h2":"Подзаголовок","h3":"Вложенный подзаголовок","monospace":"непропорциональный","fontSize":"Размер","cursive":"курсив"})

View File

@@ -1 +1 @@
({"text":"Описание:","insertImageTitle":"Свойства изображения","set":"Задать","newWindow":"Новое окно","topWindow":"Окно верхнего уровня","target":"Целевой объект:","createLinkTitle":"Свойства ссылки","parentWindow":"Родительское окно","currentWindow":"Текущее окно","url":"URL:"}) ({"text":"Описание:","insertImageTitle":"Свойства изображения","set":"Задать","newWindow":"Новое окно","topWindow":"Верхнее окно","target":"Целевой объект:","createLinkTitle":"Свойства ссылки","parentWindow":"Родительское окно","currentWindow":"Текущее окно","url":"URL:"})

View File

@@ -1 +1 @@
({"1":"xx-small","2":"x-small","formatBlock":"Formát","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Odsek","pre":"Predformátované","sans-serif":"sans-serif","fontName":"Písmo","h1":"Hlavička","h2":"Podhlavička","h3":"Pod-podhlavička","monospace":"monospace","fontSize":"Veľkosť","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Žiadny","1":"xx-small","2":"x-small","formatBlock":"Formát","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Odsek","pre":"Predformátované","sans-serif":"sans-serif","fontName":"Písmo","h1":"Hlavička","h2":"Podhlavička","h3":"Pod-podhlavička","monospace":"monospace","fontSize":"Veľkosť","cursive":"cursive"})

View File

@@ -1 +1 @@
({"1":"xx-majhno","2":"x-majhno","formatBlock":"Oblika","3":"majhno","4":"srednje","5":"veliko","6":"x-veliko","7":"xx-veliko","fantasy":"fantasy","serif":"serif","p":"Odstavek","pre":"Vnaprej oblikovano","sans-serif":"sans-serif","fontName":"Pisava","h1":"Naslov","h2":"Podnaslov","h3":"Pod podnaslov","monospace":"monospace","fontSize":"Velikost","cursive":"cursive","noFormat":"None"}) ({"noFormat":"Brez","1":"xx-majhno","2":"x-majhno","formatBlock":"Oblika","3":"majhno","4":"srednje","5":"veliko","6":"x-veliko","7":"xx-veliko","fantasy":"fantasy","serif":"serif","p":"Odstavek","pre":"Vnaprej oblikovan","sans-serif":"sans-serif","fontName":"Pisava","h1":"Naslovni slog","h2":"Podnaslovni slog","h3":"Pod-podnaslovni slog","monospace":"monospace","fontSize":"Velikost","cursive":"cursive"})

View File

@@ -1 +1 @@
({"text":"Opis:","insertImageTitle":"Lastnosti slike","set":"Nastavi","newWindow":"Novo okno","topWindow":"Najvišje okno","target":"Cilj:","createLinkTitle":"Lastnosti povezave","parentWindow":"Nadrejeno okno","currentWindow":"Trenutno okno","url":"URL:"}) ({"text":"Opis:","insertImageTitle":"Lastnosti slike","set":"Nastavi","newWindow":"Novo okno","topWindow":"Okno na vrhu","target":"Cilj:","createLinkTitle":"Lastnosti povezave","parentWindow":"Nadrejeno okno","currentWindow":"Trenutno okno","url":"URL:"})

View File

@@ -1 +1 @@
({"removeFormat":"Odstrani obliko zapisa","copy":"Prekopiraj","paste":"Prilepi","selectAll":"Izberi vse","insertOrderedList":"Oštevilčen seznam","insertTable":"Vstavi/uredi tabelo","print":"Natisni","underline":"Podčrtano","foreColor":"Barva ospredja","htmlToggle":"Izvorna koda HTML","formatBlock":"Slog odstavka","newPage":"Nova stran","insertHorizontalRule":"Vodoravno ravnilo","delete":"Izbriši","insertUnorderedList":"Naštevni seznam","tableProp":"Lastnost tabele","insertImage":"Vstavi sliko","superscript":"Nadpisano","subscript":"Podpisano","createLink":"Ustvari povezavo","undo":"Razveljavi","fullScreen":"Preklopi na celozaslonski način","italic":"Ležeče","fontName":"Ime pisave","justifyLeft":"Poravnaj levo","unlink":"Odstrani povezavo","toggleTableBorder":"Preklopi na rob tabele","viewSource":"Prikaži izvorno kodo HTML","fontSize":"Velikost pisave","systemShortcut":"Dejanje \"${0}\" lahko v vašem brskalniku uporabite samo z bližnjico na tipkovnici. Uporabite ${1}.","indent":"Zamik","redo":"Znova uveljavi","strikethrough":"Prečrtano","justifyFull":"Obojestranska poravnava","justifyCenter":"Poravnaj na sredino","hiliteColor":"Barva ozadja","deleteTable":"Izbriši tabelo","outdent":"Viseč odstavek","cut":"Izreži","plainFormatBlock":"Slog odstavka","toggleDir":"Preklopi na usmeritev","bold":"Krepko","tabIndent":"Zamik tabulatorja","justifyRight":"Poravnaj desno","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"}) ({"removeFormat":"Odstrani oblikovanje","copy":"Prekopiraj","paste":"Prilepi","selectAll":"Izberi vse","insertOrderedList":"Oštevilčen seznam","insertTable":"Vstavi/uredi tabelo","print":"Natisni","underline":"Podčrtano","foreColor":"Barva ospredja","htmlToggle":"Izvorna koda HTML","formatBlock":"Slog odstavka","newPage":"Nova stran","insertHorizontalRule":"Vodoravno ravnilo","delete":"Izbriši","insertUnorderedList":"Naštevni seznam","tableProp":"Lastnost tabele","insertImage":"Vstavi sliko","superscript":"Nadpisano","subscript":"Podpisano","createLink":"Ustvari povezavo","undo":"Razveljavi","fullScreen":"Preklopi na celozaslonski način","italic":"Ležeče","fontName":"Ime pisave","justifyLeft":"Poravnaj levo","unlink":"Odstrani povezavo","toggleTableBorder":"Preklopi na rob tabele","viewSource":"Prikaži izvorno kodo HTML","fontSize":"Velikost pisave","systemShortcut":"Dejanje \"${0}\" lahko v vašem brskalniku uporabite samo z bližnjico na tipkovnici. Uporabite ${1}.","indent":"Zamik","redo":"Znova uveljavi","strikethrough":"Prečrtano","justifyFull":"Poravnaj obojestransko","justifyCenter":"Poravnaj na sredino","hiliteColor":"Barva ozadja","deleteTable":"Izbriši tabelo","outdent":"Primakni","cut":"Izreži","plainFormatBlock":"Slog odstavka","toggleDir":"Preklopi smer","bold":"Krepko","tabIndent":"Zamik tabulatorja","justifyRight":"Poravnaj desno","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"})

View File

@@ -1 +1 @@
({"1":"mycket, mycket litet","2":"mycket litet","formatBlock":"Format","3":"litet","4":"medelstort","5":"stort","6":"extra stort","7":"extra extra stort","fantasy":"fantasy","serif":"serif","p":"Stycke","pre":"Förformaterat","sans-serif":"sans-serif","fontName":"Teckensnitt","h1":"Rubrik","h2":"Underrubrik","h3":"Underunderrubrik","monospace":"monospace","fontSize":"Storlek","cursive":"kursivt","noFormat":"None"}) ({"noFormat":"Ingen","1":"mycket, mycket litet","2":"mycket litet","formatBlock":"Format","3":"litet","4":"medelstort","5":"stort","6":"extra stort","7":"extra extra stort","fantasy":"fantasy","serif":"serif","p":"Stycke","pre":"Förformaterat","sans-serif":"sans-serif","fontName":"Teckensnitt","h1":"Rubrik","h2":"Underrubrik","h3":"Underunderrubrik","monospace":"monospace","fontSize":"Storlek","cursive":"kursivt"})

View File

@@ -1 +1 @@
({"1":"xx-small","2":"x-small","formatBlock":"รูปแบบ","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"ย่อหน้า","pre":"การกำหนดรูปแบบล่วงหน้า","sans-serif":"sans-serif","fontName":"ฟอนต์","h1":"ส่วนหัว","h2":"ส่วนหัวย่อย","h3":"ส่วนย่อยของส่วนหัวย่อย","monospace":"monospace","fontSize":"ขนาด","cursive":"cursive","noFormat":"None"}) ({"noFormat":"ไม่มี","1":"xx-small","2":"x-small","formatBlock":"รูปแบบ","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"ย่อหน้า","pre":"การกำหนดรูปแบบล่วงหน้า","sans-serif":"sans-serif","fontName":"ฟอนต์","h1":"ส่วนหัว","h2":"ส่วนหัวย่อย","h3":"ส่วนย่อยของส่วนหัวย่อย","monospace":"monospace","fontSize":"ขนาด","cursive":"cursive"})

View File

@@ -1 +1 @@
({"text":"รายละเอียด","insertImageTitle":"คุณสมบัติอิมเมจ","set":"ตั้งค่า","newWindow":"หน้าต่างใหม่","topWindow":"หน้าต่างบนสุด","target":"เป้าหมาย:","createLinkTitle":"คุณสมบัติลิงก์","parentWindow":"หน้าต่างหลัก","currentWindow":"หน้าต่างปัจจุบัน","url":"URL:"}) ({"text":"รายละเอียด:","insertImageTitle":"คุณสมบัติอิมเมจ","set":"ตั้งค่า","newWindow":"หน้าต่างใหม่","topWindow":"หน้าต่างบนสุด","target":"เป้าหมาย:","createLinkTitle":"คุณสมบัติลิงก์","parentWindow":"หน้าต่างหลัก","currentWindow":"หน้าต่างปัจจุบัน","url":"URL:"})

View File

@@ -1 +1 @@
({"1":"xx-küçük","2":"x-küçük","formatBlock":"Biçim","3":"küçük","4":"orta","5":"büyük","6":"x-büyük","7":"xx-büyük","fantasy":"fantazi","serif":"serif","p":"Paragraf","pre":"Önceden Biçimlendirilmiş","sans-serif":"sans-serif","fontName":"Yazı Tipi","h1":"Başlık","h2":"Alt Başlık","h3":"Alt Alt Başlık","monospace":"tek aralıklı","fontSize":"Boyut","cursive":"el yazısı","noFormat":"None"}) ({"noFormat":"Yok","1":"xx-küçük","2":"x-küçük","formatBlock":"Biçim","3":"küçük","4":"orta","5":"büyük","6":"x-büyük","7":"xx-büyük","fantasy":"fantazi","serif":"serif","p":"Paragraf","pre":"Önceden Biçimlendirilmiş","sans-serif":"sans-serif","fontName":"Yazı Tipi","h1":"Başlık","h2":"Alt Başlık","h3":"Alt Alt Başlık","monospace":"tek aralıklı","fontSize":"Boyut","cursive":"el yazısı"})

Some files were not shown because too many files have changed in this diff Show More