1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 20:35: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,12 +1,12 @@
/* /*
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");
dojo.require("dojo.date"); dojo.require("dojo.date");
@@ -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.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.","","2.0");
this.set("value",_1);
},_getValueAttr:function(){ dojo.declare(
var _2=new this.dateClassObj(this.value); "dijit.Calendar",
_2.setHours(0,0,0,0); [dijit._Widget, dijit._Templated, dijit._CssStateMixin],
if(_2.getDate()<this.value.getDate()){ {
_2=this.dateFuncObj.add(_2,"hour",1); // summary:
} // A simple GUI for choosing a date in the context of a monthly calendar.
return _2; //
},_setValueAttr:function(_3){ // description:
if(!this.value||this.dateFuncObj.compare(_3,this.value)){ // A simple GUI for choosing a date in the context of a monthly calendar.
_3=new this.dateClassObj(_3); // This widget can't be used in a form because it doesn't serialize the date to an
_3.setHours(1); // `<input>` field. For a form element, use dijit.form.DateTextBox instead.
this.displayMonth=new this.dateClassObj(_3); //
if(!this.isDisabledDate(_3,this.lang)){ // Note that the parser takes all dates attributes passed in the
this.value=_3; // [RFC 3339 format](http://www.faqs.org/rfcs/rfc3339.html), e.g. `2005-06-30T08:05:00-07:00`
this.onChange(this.get("value")); // so that they are serializable and locale-independent.
} //
dojo.attr(this.domNode,"aria-label",this.dateLocaleModule.format(_3,{selector:"date",formatLength:"full"})); // example:
this._populateGrid(); // | var calendar = new dijit.Calendar({}, dojo.byId("calendarNode"));
} //
},_setText:function(_4,_5){ // example:
while(_4.firstChild){ // | <div dojoType="dijit.Calendar"></div>
_4.removeChild(_4.firstChild);
} 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"),
_4.appendChild(dojo.doc.createTextNode(_5)); widgetsInTemplate: true,
},_populateGrid:function(){
var _6=this.displayMonth; // value: Date
_6.setDate(1); // The currently selected Date, initially set to invalid date to indicate no selection.
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); value: new Date(""),
if(_b>_7){ // TODO: for 2.0 make this a string (ISO format) rather than a Date
_b-=7;
} // datePackage: String
dojo.query(".dijitCalendarDateTemplate",this.domNode).forEach(function(_c,i){ // JavaScript namespace to find Calendar routines. Uses Gregorian Calendar routines
i+=_b; // at dojo.date by default.
var _d=new this.dateClassObj(_6),_e,_f="dijitCalendar",adj=0; datePackage: "dojo.date",
if(i<_7){
_e=_9-_7+i+1; // dayWidth: String
adj=-1; // How to represent the days of the week in the calendar header. See dojo.date.locale
_f+="Previous"; dayWidth: "narrow",
}else{
if(i>=(_7+_8)){ // tabIndex: Integer
_e=i-_7-_8+1; // Order fields are traversed when user hits the tab key
adj=1; tabIndex: "0",
_f+="Next";
}else{ // currentFocus: Date
_e=i-_7+1; // Date object containing the currently focused date, or the date which would be focused
_f+="Current"; // 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(),
if(adj){
_d=this.dateFuncObj.add(_d,"month",adj); baseClass:"dijitCalendar",
}
_d.setDate(_e); // Set node classes for various mouse events, see dijit._CssStateMixin for more details
if(!this.dateFuncObj.compare(_d,_a,"date")){ cssStateNodes: {
_f="dijitCalendarCurrentDate "+_f; "decrementMonth": "dijitCalendarArrow",
} "incrementMonth": "dijitCalendarArrow",
if(this._isSelectedDate(_d,this.lang)){ "previousYearLabelNode": "dijitCalendarPreviousYear",
_f="dijitCalendarSelectedDate "+_f; "nextYearLabelNode": "dijitCalendarNextYear"
} },
if(this.isDisabledDate(_d,this.lang)){
_f="dijitCalendarDisabledDate "+_f; _isValidDate: function(/*Date*/ value){
} // summary:
var _10=this.getClassForDate(_d,this.lang); // Runs various tests on the value, checking that it's a valid date, rather
if(_10){ // than blank or NaN.
_f=_10+" "+_f; // tags:
} // private
_c.className=_f+"Month dijitCalendarDateTemplate"; return value && !isNaN(value) && typeof value == "object" &&
_c.dijitDateValue=_d.valueOf(); value.toString() != this.constructor.prototype.value.toString();
var _11=dojo.query(".dijitCalendarDateLabel",_c)[0],_12=_d.getDateLocalized?_d.getDateLocalized(this.lang):_d.getDate(); },
this._setText(_11,_12);
},this); setValue: function(/*Date*/ value){
var _13=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,_6); // summary:
this._setText(this.monthLabelNode,_13[_6.getMonth()]); // Deprecated. Use set('value', ...) instead.
dojo.query(".dijitCalendarMonthLabelTemplate",this.domNode).forEach(function(_14,i){ // tags:
dojo.toggleClass(_14,"dijitHidden",!(i in _13)); // deprecated
this._setText(_14,_13[i]); dojo.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
},this); this.set('value', value);
var y=_6.getFullYear()-1; },
var d=new this.dateClassObj();
dojo.forEach(["previous","current","next"],function(_15){ _getValueAttr: function(){
d.setFullYear(y++); // summary:
this._setText(this[_15+"YearLabelNode"],this.dateLocaleModule.format(d,{selector:"year",locale:this.lang})); // Support get('value')
},this);
var _16=this; // this.value is set to 1AM, but return midnight, local time for back-compat
var _17=function(_18,_19,adj){ var value = new this.dateClassObj(this.value);
_16._connects.push(dijit.typematic.addMouseListener(_16[_18],_16,function(_1a){ value.setHours(0, 0, 0, 0);
if(_1a>=0){
_16._adjustDisplay(_19,adj); // 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
},0.8,500)); if(value.getDate() < this.value.getDate()){
}; value = this.dateFuncObj.add(value, "hour", 1);
_17("incrementMonth","month",1); }
_17("decrementMonth","month",-1); return value;
_17("nextYearLabelNode","year",1); },
_17("previousYearLabelNode","year",-1);
},goToToday:function(){ _setValueAttr: function(/*Date|Number*/ value, /*Boolean*/ priorityChange){
this.set("value",new this.dateClassObj()); // summary:
},constructor:function(_1b){ // Support set("value", ...)
var _1c=(_1b.datePackage&&(_1b.datePackage!="dojo.date"))?_1b.datePackage+".Date":"Date"; // description:
this.dateClassObj=dojo.getObject(_1c,false); // Set the current date and update the UI. If the date is disabled, the value will
this.datePackage=_1b.datePackage||this.datePackage; // not change, but the display will change to the corresponding month.
this.dateFuncObj=dojo.getObject(this.datePackage,false); // value:
this.dateLocaleModule=dojo.getObject(this.datePackage+".locale",false); // Either a Date or the number of seconds since 1970.
},postMixInProperties:function(){ // tags:
if(isNaN(this.value)){ // protected
delete this.value; if(value){
} // convert from Number to Date, or make copy of Date object so that setHours() call below
this.inherited(arguments); // doesn't affect original value
},postCreate:function(){ value = new this.dateClassObj(value);
this.inherited(arguments); }
dojo.setSelectable(this.domNode,false); if(this._isValidDate(value)){
var _1d=dojo.hitch(this,function(_1e,n){ if(!this._isValidDate(this.value) || this.dateFuncObj.compare(value, this.value)){
var _1f=dojo.query(_1e,this.domNode)[0]; value.setHours(1, 0, 0, 0); // round to nearest day (1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
for(var i=0;i<n;i++){
_1f.parentNode.appendChild(_1f.cloneNode(true)); 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
}
}
}
}else{
// clear value, and repopulate grid (to deselect the previously selected day) without changing currentFocus
this._set("value", null);
this.set("currentFocus", this.currentFocus);
}
},
_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;
clazz += "Previous";
}else if(i >= (firstDay + daysInMonth)){
number = i - firstDay - daysInMonth + 1;
adj = 1;
clazz += "Next";
}else{
number = i - firstDay + 1;
clazz += "Current";
}
if(adj){
date = this.dateFuncObj.add(date, "month", adj);
}
date.setDate(number);
if(!this.dateFuncObj.compare(date, today, "date")){
clazz = "dijitCalendarCurrentDate " + clazz;
}
if(this._isSelectedDate(date, this.lang)){
clazz = "dijitCalendarSelectedDate " + clazz;
}
if(this.isDisabledDate(date, this.lang)){
clazz = "dijitCalendarDisabledDate " + clazz;
}
var clazz2 = this.getClassForDate(date, this.lang);
if(clazz2){
clazz = clazz2 + " " + clazz;
}
template.className = clazz + "Month dijitCalendarDateTemplate";
template.dijitDateValue = date.valueOf(); // original code
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);
// Repopulate month drop down list based on current year.
// Need to do this to hide leap months in Hebrew calendar.
var monthNames = this.dateLocaleModule.getNames('months', 'wide', 'standAlone', this.lang, month);
this.monthDropDownButton.dropDown.set("months", monthNames);
// 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();
dojo.forEach(["previous", "current", "next"], function(name){
d.setFullYear(y++);
this._setText(this[name+"YearLabelNode"],
this.dateLocaleModule.format(d, {selector:'year', locale:this.lang}));
}, this);
},
goToToday: function(){
// summary:
// Sets calendar's value to today's date
this.set('value', new this.dateClassObj());
},
constructor: function(/*Object*/args){
var dateClass = (args.datePackage && (args.datePackage != "dojo.date"))? args.datePackage + ".Date" : "Date";
this.dateClassObj = dojo.getObject(dateClass, false);
this.datePackage = args.datePackage || this.datePackage;
this.dateFuncObj = dojo.getObject(this.datePackage, false);
this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false);
},
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);
},
buildRendering: function(){
this.inherited(arguments);
dojo.setSelectable(this.domNode, false);
var cloneClass = dojo.hitch(this, function(clazz, n){
var template = dojo.query(clazz, this.domNode)[0];
for(var i=0; i<n; i++){
template.parentNode.appendChild(template.cloneNode(true));
}
});
// clone the day label and calendar day templates 6 times to make 7 columns
cloneClass(".dijitCalendarDayLabelTemplate", 6);
cloneClass(".dijitCalendarDateTemplate", 6);
// now make 6 week rows
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);
var dateObj = new this.dateClassObj(this.currentFocus);
this.monthDropDownButton.dropDown = new dijit.Calendar._MonthDropDown({
id: this.id + "_mdd",
onChange: dojo.hitch(this, "_onMonthSelect")
});
this.set('currentFocus', dateObj, false); // draw the grid to the month specified by currentFocus
// Set up repeating mouse behavior for increment/decrement of months/years
var _this = this;
var typematic = function(nodeProp, dateProp, adj){
_this._connects.push(
dijit.typematic.addMouseListener(_this[nodeProp], _this, function(count){
if(count >= 0){ _this._adjustDisplay(dateProp, adj); }
}, 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();
// set tabIndex=0 on new cell, and focus it (but only if Calendar itself is focused)
var newCell = dojo.query("[dijitDateValue=" + date.valueOf() + "]", this.domNode)[0];
newCell.setAttribute("tabIndex", this.tabIndex);
if(this._focused || forceFocus){
newCell.focus();
}
// set tabIndex=-1 on old focusable cell
if(oldCell && oldCell != newCell){
if(dojo.isWebKit){ // see #11064 about webkit bug
oldCell.setAttribute("tabIndex", "-1");
}else{
oldCell.removeAttribute("tabIndex");
}
}
},
focus: function(){
// 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();
},
_onDayClick: function(/*Event*/ evt){
// summary:
// Handler for day clicks, selects the date if appropriate
// tags:
// protected
dojo.stopEvent(evt);
for(var node = evt.target; node && !node.dijitDateValue; node = node.parentNode);
if(node && !dojo.hasClass(node, "dijitCalendarDisabledDate")){
this.set('value', node.dijitDateValue);
}
},
_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;
}
},
_onDayMouseOut: function(/*Event*/ evt){
// summary:
// Handler for mouse out events on days, clears hovered style
// tags:
// protected
if(!this._currentNode){ return; }
// if mouse out occurs moving from <td> to <span> inside <td>, ignore it
if(evt.relatedTarget && evt.relatedTarget.parentNode == this._currentNode){ return; }
var cls = "dijitCalendarHoveredDate";
if(dojo.hasClass(this._currentNode, "dijitCalendarActiveDate")) {
cls += " dijitCalendarActiveDate";
}
dojo.removeClass(this._currentNode, cls);
this._currentNode = null;
},
_onDayMouseDown: function(/*Event*/ evt){
var node = evt.target.parentNode;
if(node && node.dijitDateValue){
dojo.addClass(node, "dijitCalendarActiveDate");
this._currentNode = node;
}
},
_onDayMouseUp: function(/*Event*/ evt){
var node = evt.target.parentNode;
if(node && node.dijitDateValue){
dojo.removeClass(node, "dijitCalendarActiveDate");
}
},
//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){
case dk.RIGHT_ARROW:
increment = 1;
//fallthrough...
case dk.LEFT_ARROW:
interval = "day";
if(!this.isLeftToRight()){ increment *= -1; }
break;
case dk.DOWN_ARROW:
increment = 1;
//fallthrough...
case dk.UP_ARROW:
interval = "week";
break;
case dk.PAGE_DOWN:
increment = 1;
//fallthrough...
case dk.PAGE_UP:
interval = evt.ctrlKey || evt.altKey ? "year" : "month";
break;
case dk.END:
// go to the next month
newValue = this.dateFuncObj.add(newValue, "month", 1);
// subtract a day from the result when we're done
interval = "day";
//fallthrough...
case dk.HOME:
newValue = new this.dateClassObj(newValue);
newValue.setDate(1);
break;
case dk.ENTER:
case dk.SPACE:
this.set("value", this.currentFocus);
break;
default:
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);
}
},
onValueSelected: function(/*Date*/ date){
// summary:
// Notification that a date cell was selected. It may be the same as the previous value.
// description:
// 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");
}
}); });
_1d(".dijitCalendarDayLabelTemplate",6);
_1d(".dijitCalendarDateTemplate",6);
_1d(".dijitCalendarWeekTemplate",5);
var _20=this.dateLocaleModule.getNames("days",this.dayWidth,"standAlone",this.lang);
var _21=dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
dojo.query(".dijitCalendarDayLabel",this.domNode).forEach(function(_22,i){
this._setText(_22,_20[(i+_21)%7]);
},this);
var _23=new this.dateClassObj(this.value);
var _24=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,_23);
_1d(".dijitCalendarMonthLabelTemplate",_24.length-1);
dojo.query(".dijitCalendarMonthLabelTemplate",this.domNode).forEach(function(_25,i){
dojo.attr(_25,"month",i);
if(i in _24){
this._setText(_25,_24[i]);
}
dojo.place(_25.cloneNode(true),this.monthLabelSpacer);
},this);
this.value=null;
this.set("value",_23);
},_onMenuHover:function(e){
dojo.stopEvent(e);
dojo.toggleClass(e.target,"dijitMenuItemHover");
},_adjustDisplay:function(_26,_27){
this.displayMonth=this.dateFuncObj.add(this.displayMonth,_26,_27);
this._populateGrid();
},_onMonthToggle:function(evt){
dojo.stopEvent(evt);
if(evt.type=="mousedown"){
var _28=dojo.position(this.monthLabelNode);
var dim={width:_28.w+"px",top:-this.displayMonth.getMonth()*_28.h+"px"};
if((dojo.isIE&&dojo.isQuirks)||dojo.isIE<7){
dim.left=-_28.w/2+"px";
}
dojo.style(this.monthDropDown,dim);
this._popupHandler=this.connect(document,"onmouseup","_onMonthToggle");
}else{
this.disconnect(this._popupHandler);
delete this._popupHandler;
}
dojo.toggleClass(this.monthDropDown,"dijitHidden");
dojo.toggleClass(this.monthLabelNode,"dijitVisible");
},_onMonthSelect:function(evt){
this._onMonthToggle(evt);
this.displayMonth.setMonth(dojo.attr(evt.target,"month"));
this._populateGrid();
},_onDayClick:function(evt){
dojo.stopEvent(evt);
for(var _29=evt.target;_29&&!_29.dijitDateValue;_29=_29.parentNode){
}
if(_29&&!dojo.hasClass(_29,"dijitCalendarDisabledDate")){
this.set("value",_29.dijitDateValue);
this.onValueSelected(this.get("value"));
}
},_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)){
dojo.addClass(_2a,"dijitCalendarHoveredDate");
this._currentNode=_2a;
}
},_onDayMouseOut:function(evt){
if(!this._currentNode){
return;
}
if(evt.relatedTarget&&evt.relatedTarget.parentNode==this._currentNode){
return;
}
dojo.removeClass(this._currentNode,"dijitCalendarHoveredDate");
if(dojo.hasClass(this._currentNode,"dijitCalendarActiveDate")){
dojo.removeClass(this._currentNode,"dijitCalendarActiveDate");
}
this._currentNode=null;
},_onDayMouseDown:function(evt){
var _2b=evt.target.parentNode;
if(_2b&&_2b.dijitDateValue){
dojo.addClass(_2b,"dijitCalendarActiveDate");
this._currentNode=_2b;
}
},_onDayMouseUp:function(evt){
var _2c=evt.target.parentNode;
if(_2c&&_2c.dijitDateValue){
dojo.removeClass(_2c,"dijitCalendarActiveDate");
}
},_onKeyPress:function(evt){
var dk=dojo.keys,_2d=-1,_2e,_2f=this.value;
switch(evt.keyCode){
case dk.RIGHT_ARROW:
_2d=1;
case dk.LEFT_ARROW:
_2e="day";
if(!this.isLeftToRight()){
_2d*=-1;
}
break;
case dk.DOWN_ARROW:
_2d=1;
case dk.UP_ARROW:
_2e="week";
break;
case dk.PAGE_DOWN:
_2d=1;
case dk.PAGE_UP:
_2e=evt.ctrlKey?"year":"month";
break;
case dk.END:
_2f=this.dateFuncObj.add(_2f,"month",1);
_2e="day";
case dk.HOME:
_2f=new Date(_2f).setDate(1);
break;
case dk.ENTER:
this.onValueSelected(this.get("value"));
break;
case dk.ESCAPE:
default:
return;
}
dojo.stopEvent(evt);
if(_2e){
_2f=this.dateFuncObj.add(_2f,_2e,_2d);
}
this.set("value",_2f);
},onValueSelected:function(_30){
},onChange:function(_31){
},_isSelectedDate:function(_32,_33){
return !this.dateFuncObj.compare(_32,this.value,"date");
},isDisabledDate:function(_34,_35){
},getClassForDate:function(_36,_37){
}});
} }

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:
if(!this.disabled){ // A checkbox-like menu item for toggling on and off
this.set("checked",!this.checked);
this.onChange(this.checked); 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"),
}
this.inherited(arguments); // 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){
this.set("checked", !this.checked);
this.onChange(this.checked);
}
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(){
this.inherited(arguments);
this.imageNode.setAttribute("src",this._imagePaths[this.palette+(this.isLeftToRight()?"":"-rtl")].toString()); dojo.declare("dijit.ColorPalette",
var _1=dojo.i18n.getLocalization("dojo","colors",this.lang); [dijit._Widget, dijit._Templated, dijit._PaletteMixin],
this._preparePalette(this._palettes[this.palette],_1); {
}}); // summary:
dojo.declare("dijit._Color",dojo.Color,{constructor:function(_2){ // A keyboard accessible color-picking widget
this._alias=_2; // description:
this.setColor(dojo.Color.named[_2]); // Grid showing various colors, so the user can pick a certain color.
},getValue:function(){ // Can be used standalone, or as a popup.
return this.toHex(); //
},fillCell:function(_3,_4){ // example:
dojo.create("img",{src:_4,"class":"dijitPaletteImg",alt:this._alias},_3); // | <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);
// Creates <img> nodes in each cell of the template.
// Pass in "customized" dijit._Color constructor for specified palette and high-contrast vs. normal mode
this._preparePalette(
this._palettes[this.palette],
dojo.i18n.getLocalization("dojo", "colors", this.lang),
dojo.declare(dijit._Color, {
hc: dojo.hasClass(dojo.body(), "dijit_a11y"),
palette: this.palette
})
);
}
});
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,12 +1,12 @@
/* /*
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");
dojo.require("dojo.dnd.TimedMoveable"); dojo.require("dojo.dnd.TimedMoveable");
@@ -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(){
var _1=dojo.i18n.getLocalization("dijit","common");
dojo.mixin(this,_1);
this.inherited(arguments);
},postCreate:function(){
dojo.style(this.domNode,{display:"none",position:"absolute"});
dojo.body().appendChild(this.domNode);
this.inherited(arguments);
this.connect(this,"onExecute","hide");
this.connect(this,"onCancel","hide");
this._modalconnects=[];
},onLoad:function(){
this._position();
if(this.autofocus){
this._getFocusItems(this.domNode);
dijit.focus(this._firstFocusItem);
}
this.inherited(arguments);
},_endDrag:function(e){
if(e&&e.node&&e.node===this.domNode){
this._relativePosition=dojo.position(e.node);
}
},_setup:function(){
var _2=this.domNode;
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});
dojo.subscribe("/dnd/move/stop",this,"_endDrag");
}else{
dojo.addClass(_2,"dijitDialogFixed");
}
this.underlayAttrs={dialogId:this.id,"class":dojo.map(this["class"].split(/\s/),function(s){
return s+"_underlay";
}).join(" ")};
this._fadeIn=dojo.fadeIn({node:_2,duration:this.duration,beforeBegin:dojo.hitch(this,function(){
var _3=dijit._underlay;
if(!_3){
_3=dijit._underlay=new dijit.DialogUnderlay(this.underlayAttrs);
}else{
_3.set(this.underlayAttrs);
}
var ds=dijit._dialogStack,_4=948+ds.length*2;
if(ds.length==1){
_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();
if(this._singleChild){
if(this._singleChildOriginalStyle){
this._singleChild.domNode.style.cssText=this._singleChildOriginalStyle;
}
delete this._singleChildOriginalStyle;
}else{
dojo.style(this.containerNode,{width:"auto",height:"auto"});
}
var mb=dojo.marginBox(this.domNode);
var _7=dojo.window.getBox();
if(mb.w>=_7.w||mb.h>=_7.h){
var w=Math.min(mb.w,Math.floor(_7.w*0.75)),h=Math.min(mb.h,Math.floor(_7.h*0.75));
if(this._singleChild&&this._singleChild.resize){
this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;
this._singleChild.resize({w:w,h:h});
}else{
dojo.style(this.containerNode,{width:w+"px",height:h+"px",overflow:"auto",position:"relative"});
}
}else{
if(this._singleChild&&this._singleChild.resize){
this._singleChild.resize();
}
}
},_position:function(){
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));
dojo.style(_8,{left:l+"px",top:t+"px"});
}
},_onKey:function(_a){
var ds=dijit._dialogStack;
if(ds[ds.length-1]!=this){
return;
}
if(_a.charOrCode){
var dk=dojo.keys;
var _b=_a.target;
if(_a.charOrCode===dk.TAB){
this._getFocusItems(this.domNode);
}
var _c=(this._firstFocusItem==this._lastFocusItem);
if(_b==this._firstFocusItem&&_a.shiftKey&&_a.charOrCode===dk.TAB){
if(!_c){
dijit.focus(this._lastFocusItem);
}
dojo.stopEvent(_a);
}else{
if(_b==this._lastFocusItem&&_a.charOrCode===dk.TAB&&!_a.shiftKey){
if(!_c){
dijit.focus(this._firstFocusItem);
}
dojo.stopEvent(_a);
}else{
while(_b){
if(_b==this.domNode||dojo.hasClass(_b,"dijitPopup")){
if(_a.charOrCode==dk.ESCAPE){
this.onCancel();
}else{
return;
}
}
_b=_b.parentNode;
}
if(_a.charOrCode!==dk.TAB){
dojo.stopEvent(_a);
}else{
if(!dojo.isOpera){
try{
this._firstFocusItem.focus();
}
catch(e){
}
}
}
}
}
}
},show:function(){
if(this.open){
return;
}
if(!this._alreadyInitialized){
this._setup();
this._alreadyInitialized=true;
}
if(this._fadeOut.status()=="playing"){
this._fadeOut.stop();
}
this._modalconnects.push(dojo.connect(window,"onscroll",this,"layout"));
this._modalconnects.push(dojo.connect(window,"onresize",this,function(){
var _d=dojo.window.getBox();
if(!this._oldViewport||_d.h!=this._oldViewport.h||_d.w!=this._oldViewport.w){
this.layout();
this._oldViewport=_d;
}
}));
this._modalconnects.push(dojo.connect(dojo.doc.documentElement,"onkeypress",this,"_onKey"));
dojo.style(this.domNode,{opacity:0,display:""});
this.open=true;
this._onShow();
this._size();
this._position();
dijit._dialogStack.push(this);
this._fadeIn.play();
this._savedFocus=dijit.getFocus(this);
},hide:function(){
var ds=dijit._dialogStack;
if(!this._alreadyInitialized||this!=ds[ds.length-1]){
return;
}
if(this._fadeIn.status()=="playing"){
this._fadeIn.stop();
}
ds.pop();
this._fadeOut.play();
if(this._scrollConnected){
this._scrollConnected=false;
}
dojo.forEach(this._modalconnects,dojo.disconnect);
this._modalconnects=[];
if(this._relativePosition){
delete this._relativePosition;
}
this.open=false;
this.onHide();
},layout:function(){
if(this.domNode.style.display!="none"){
if(dijit._underlay){
dijit._underlay.layout();
}
this._position();
}
},destroy:function(){
dojo.forEach(this._modalconnects,dojo.disconnect);
if(this.refocus&&this.open){
setTimeout(dojo.hitch(dijit,"focus",this._savedFocus),25);
}
this.inherited(arguments);
}});
dojo.declare("dijit.Dialog",[dijit.layout.ContentPane,dijit._DialogBase],{});
dijit._dialogStack=[];
dojo.require("dijit.TooltipDialog"); dojo.require("dijit.TooltipDialog");
// 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);
},
postCreate: function(){
dojo.style(this.domNode, {
display: "none",
position:"absolute"
});
dojo.body().appendChild(this.domNode);
this.inherited(arguments);
this.connect(this, "onExecute", "hide");
this.connect(this, "onCancel", "hide");
this._modalconnects = [];
},
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();
if(this.autofocus && dijit._DialogLevelManager.isTop(this)){
this._getFocusItems(this.domNode);
dijit.focus(this._firstFocusItem);
}
this.inherited(arguments);
},
_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){
this._relativePosition = dojo.position(e.node);
}
},
_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){
this._moveable = (dojo.isIE == 6) ?
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{
dojo.addClass(node,"dijitDialogFixed");
}
this.underlayAttrs = {
dialogId: this.id,
"class": dojo.map(this["class"].split(/\s/), function(s){ return s+"_underlay"; }).join(" ")
};
},
_size: function(){
// summary:
// If necessary, shrink dialog contents so dialog fits in viewport
// tags:
// private
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._singleChildOriginalStyle){
this._singleChild.domNode.style.cssText = this._singleChildOriginalStyle;
}
delete this._singleChildOriginalStyle;
}else{
dojo.style(this.containerNode, {
width:"auto",
height:"auto"
});
}
var mb = dojo._getMarginSize(this.domNode);
var viewport = dojo.window.getBox();
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){
this._singleChildOriginalStyle = this._singleChild.domNode.style.cssText;
this._singleChild.resize({w: w, h: h});
}else{
dojo.style(this.containerNode, {
width: w + "px",
height: h + "px",
overflow: "auto",
position: "relative" // workaround IE bug moving scrollbar or dragging dialog
});
}
}else{
if(this._singleChild && this._singleChild.resize){
this._singleChild.resize();
}
}
},
_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")){
var node = this.domNode,
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(/*Event*/ evt){
// summary:
// Handles the keyboard events for accessibility reasons
// tags:
// private
if(evt.charOrCode){
var dk = dojo.keys;
var node = evt.target;
if(evt.charOrCode === dk.TAB){
this._getFocusItems(this.domNode);
}
var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
// see if we are shift-tabbing from first focusable item on dialog
if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
if(!singleFocusItem){
dijit.focus(this._lastFocusItem); // send focus to last item in dialog
}
dojo.stopEvent(evt);
}else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
if(!singleFocusItem){
dijit.focus(this._firstFocusItem); // send focus to first item in dialog
}
dojo.stopEvent(evt);
}else{
// see if the key is for the dialog
while(node){
if(node == this.domNode || dojo.hasClass(node, "dijitPopup")){
if(evt.charOrCode == dk.ESCAPE){
this.onCancel();
}else{
return; // just let it go
}
}
node = node.parentNode;
}
// this key is for the disabled document window
if(evt.charOrCode !== dk.TAB){ // allow tabbing into the dialog for a11y
dojo.stopEvent(evt);
// opera won't tab to a div
}else if(!dojo.isOpera){
try{
this._firstFocusItem.focus();
}catch(e){ /*squelch*/ }
}
}
}
},
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
if(!this._alreadyInitialized){
this._setup();
this._alreadyInitialized=true;
}
if(this._fadeOutDeferred){
this._fadeOutDeferred.cancel();
}
this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout"));
this._modalconnects.push(dojo.connect(window, "onresize", this, function(){
// IE gives spurious resize events and can actually get stuck
// 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._oldViewport = viewport;
}
}));
this._modalconnects.push(dojo.connect(this.domNode, "onkeypress", this, "_onKey"));
dojo.style(this.domNode, {
opacity:0,
display:""
});
this._set("open", true);
this._onShow(); // lazy load trigger
this._size();
this._position();
// fade-in Animation object, setup below
var fadeIn;
this._fadeInDeferred = new dojo.Deferred(dojo.hitch(this, function(){
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;
}
if(this._fadeInDeferred){
this._fadeInDeferred.cancel();
}
// 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){
this._scrollConnected = false;
}
dojo.forEach(this._modalconnects, dojo.disconnect);
this._modalconnects = [];
if(this._relativePosition){
delete this._relativePosition;
}
this._set("open", false);
return this._fadeOutDeferred;
},
layout: function(){
// summary:
// Position the Dialog and the underlay
// tags:
// private
if(this.domNode.style.display != "none"){
if(dijit._underlay){ // avoid race condition during show()
dijit._underlay.layout();
}
this._position();
}
},
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);
dijit._DialogLevelManager.hide(this);
this.inherited(arguments);
}
}
);
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.attr(this.node,"id",id+"_underlay");
},_setClassAttr:function(_1){ dojo.declare(
this.node.className="dijitDialogUnderlay "+_1; "dijit.DialogUnderlay",
},postCreate:function(){ [dijit._Widget, dijit._Templated],
dojo.body().appendChild(this.domNode); {
},layout:function(){ // summary:
var is=this.node.style,os=this.domNode.style; // The component that blocks the screen behind a `dijit.Dialog`
os.display="none"; //
var _2=dojo.window.getBox(); // description:
os.top=_2.t+"px"; // A component used to block input behind a `dijit.Dialog`. Only a single
os.left=_2.l+"px"; // instance of this widget is created by `dijit.Dialog`, and saved as
is.width=_2.w+"px"; // a reference to be shared between all Dialogs as `dijit._underlay`
is.height=_2.h+"px"; //
os.display="block"; // The underlay itself can be styled based on and id:
},show:function(){ // | #myDialog_underlay { background-color:red; }
this.domNode.style.display="block"; //
this.layout(); // In the case of `dijit.Dialog`, this id is based on the id of the Dialog,
this.bgIframe=new dijit.BackgroundIframe(this.domNode); // suffixed with _underlay.
},hide:function(){
this.bgIframe.destroy(); // Template has two divs; outer div is used for fade-in/fade-out, and also to hold background iframe.
this.domNode.style.display="none"; // Inner div has opacity specified in CSS file.
},uninitialize:function(){ templateString: "<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",
if(this.bgIframe){
this.bgIframe.destroy(); // Parameters on creation or updatable later
}
this.inherited(arguments); // 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");
this._set("dialogId", id);
},
_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);
},
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";
// then resize and show
var viewport = dojo.window.getBox();
os.top = viewport.t + "px";
os.left = viewport.l + "px";
is.width = viewport.w + "px";
is.height = viewport.h + "px";
os.display = "block";
},
show: function(){
// summary:
// Show the dialog underlay
this.domNode.style.display = "block";
this.layout();
this.bgIframe = new dijit.BackgroundIframe(this.domNode);
},
hide: function(){
// summary:
// Hides the dialog underlay
this.bgIframe.destroy();
delete this.bgIframe;
this.domNode.style.display = "none";
}
}
);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,231 +1,589 @@
/* /*
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");
dojo.require("dijit._Widget"); 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",
this.editorParams={}; dijit._Widget,
},postMixInProperties:function(){ {
this.inherited(arguments); // summary:
this.displayNode=this.srcNodeRef; // An element with in-line edit capabilites
var _2={ondijitclick:"_onClick",onmouseover:"_onMouseOver",onmouseout:"_onMouseOut",onfocus:"_onMouseOver",onblur:"_onMouseOut"}; //
for(var _3 in _2){ // description:
this.connect(this.displayNode,_3,_2[_3]); // Behavior for an existing node (`<p>`, `<div>`, `<span>`, etc.) so that
} // when you click it, an editor shows up in place of the original
dijit.setWaiRole(this.displayNode,"button"); // text. Optionally, Save and Cancel button are displayed below the edit widget.
if(!this.displayNode.getAttribute("tabIndex")){ // When Save is clicked, the text is pulled from the edit
this.displayNode.setAttribute("tabIndex",0); // widget and redisplayed and the edit widget is again hidden.
} // By default a plain Textarea widget is used as the editor (or for
if(!this.value&&!("value" in this.params)){ // inline values a TextBox), but you can specify an editor such as
this.value=dojo.trim(this.renderAsHtml?this.displayNode.innerHTML:(this.displayNode.innerText||this.displayNode.textContent||"")); // dijit.Editor (for editing HTML) or a Slider (for adjusting a number).
} // An edit widget must support the following API to be used:
if(!this.value){ // - displayedValue or value as initialization parameter,
this.displayNode.innerHTML=this.noValueIndicator; // and available through set('displayedValue') / set('value')
} // - void focus()
dojo.addClass(this.displayNode,"dijitInlineEditBoxDisplayMode"); // - DOM-node focusNode = node containing editable text
},setDisabled:function(_4){
dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.","","2.0"); // editing: [readonly] Boolean
this.set("disabled",_4); // Is the node currently in edit mode?
},_setDisabledAttr:function(_5){ editing: false,
this.disabled=_5;
dijit.setWaiState(this.domNode,"disabled",_5); // autoSave: Boolean
if(_5){ // Changing the value automatically saves it; don't have to push save button
this.displayNode.removeAttribute("tabIndex"); // (and save button isn't even displayed)
}else{ autoSave: true,
this.displayNode.setAttribute("tabIndex",0);
} // buttonSave: String
dojo.toggleClass(this.displayNode,"dijitInlineEditBoxDisplayModeDisabled",_5); // Save button label
},_onMouseOver:function(){ buttonSave: "",
if(!this.disabled){
dojo.addClass(this.displayNode,"dijitInlineEditBoxDisplayModeHover"); // buttonCancel: String
} // Cancel button label
},_onMouseOut:function(){ buttonCancel: "",
dojo.removeClass(this.displayNode,"dijitInlineEditBoxDisplayModeHover");
},_onClick:function(e){ // renderAsHtml: Boolean
if(this.disabled){ // Set this to true if the specified Editor's value should be interpreted as HTML
return; // rather than plain text (ex: `dijit.Editor`)
} renderAsHtml: false,
if(e){
dojo.stopEvent(e); // editor: String|Function
} // Class name (or reference to the Class) for Editor widget
this._onMouseOut(); editor: "dijit.form.TextBox",
setTimeout(dojo.hitch(this,"edit"),0);
},edit:function(){ // editorWrapper: String|Function
if(this.disabled||this.editing){ // Class name (or reference to the Class) for widget that wraps the editor widget, displaying save/cancel
return; // buttons.
} editorWrapper: "dijit._InlineEditor",
this.editing=true;
this._savedPosition=dojo.style(this.displayNode,"position")||"static"; // editorParams: Object
this._savedOpacity=dojo.style(this.displayNode,"opacity")||"1"; // Set of parameters for editor, like {required: true}
this._savedTabIndex=dojo.attr(this.displayNode,"tabIndex")||"0"; editorParams: {},
if(this.wrapperWidget){
var ew=this.wrapperWidget.editWidget; // disabled: Boolean
ew.set("displayedValue" in ew?"displayedValue":"value",this.value); // If true, clicking the InlineEditBox to edit it will have no effect.
}else{ disabled: false,
var _6=dojo.create("span",null,this.domNode,"before");
var _7=dojo.getObject(this.editorWrapper); onChange: function(value){
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); // summary:
} // Set this handler to be notified of changes to value.
var ww=this.wrapperWidget; // tags:
if(dojo.isIE){ // callback
dijit.focus(dijit.getFocus()); },
}
dojo.style(this.displayNode,{position:"absolute",opacity:"0",display:"none"}); onCancel: function(){
dojo.style(ww.domNode,{position:this._savedPosition,visibility:"visible",opacity:"1"}); // summary:
dojo.attr(this.displayNode,"tabIndex","-1"); // Set this handler to be notified when editing is cancelled.
setTimeout(dojo.hitch(this,function(){ // tags:
ww.focus(); // callback
ww._resetValue=ww.getValue(); },
}),0);
},_onBlur:function(){ // width: String
this.inherited(arguments); // Width of editor. By default it's width=100% (ie, block mode).
if(!this.editing){ width: "100%",
}
},destroy:function(){ // value: String
if(this.wrapperWidget){ // The display value of the widget in read-only mode
this.wrapperWidget.destroy(); value: "",
delete this.wrapperWidget;
} // noValueIndicator: [const] String
this.inherited(arguments); // The text that gets displayed when there is no value (so that the user has a place to click to edit)
},_showText:function(_8){ noValueIndicator: dojo.isIE <= 6 ? // font-family needed on IE6 but it messes up IE8
var ww=this.wrapperWidget; "<span style='font-family: wingdings; text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>" :
dojo.style(ww.domNode,{position:"absolute",visibility:"hidden",opacity:"0"}); "<span style='text-decoration: underline;'>&nbsp;&nbsp;&nbsp;&nbsp;&#x270d;&nbsp;&nbsp;&nbsp;&nbsp;</span>",
dojo.style(this.displayNode,{position:this._savedPosition,opacity:this._savedOpacity,display:""});
dojo.attr(this.displayNode,"tabIndex",this._savedTabIndex); constructor: function(){
if(_8){ // summary:
dijit.focus(this.displayNode); // Sets up private arrays etc.
} // tags:
},save:function(_9){ // private
if(this.disabled||!this.editing){ this.editorParams = {};
return; },
}
this.editing=false; postMixInProperties: function(){
var ww=this.wrapperWidget; this.inherited(arguments);
var _a=ww.getValue();
this.set("value",_a); // save pointer to original source node, since Widget nulls-out srcNodeRef
setTimeout(dojo.hitch(this,"onChange",_a),0); this.displayNode = this.srcNodeRef;
this._showText(_9);
},setValue:function(_b){ // connect handlers to the display node
dojo.deprecated("dijit.InlineEditBox.setValue() is deprecated. Use set('value', ...) instead.","","2.0"); var events = {
return this.set("value",_b); ondijitclick: "_onClick",
},_setValueAttr:function(_c){ onmouseover: "_onMouseOver",
this.value=_c=dojo.trim(_c); onmouseout: "_onMouseOut",
if(!this.renderAsHtml){ onfocus: "_onMouseOver",
_c=_c.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;").replace(/\n/g,"<br>"); onblur: "_onMouseOut"
} };
this.displayNode.innerHTML=_c||this.noValueIndicator; for(var name in events){
},getValue:function(){ this.connect(this.displayNode, name, events[name]);
dojo.deprecated("dijit.InlineEditBox.getValue() is deprecated. Use get('value') instead.","","2.0"); }
return this.get("value"); dijit.setWaiRole(this.displayNode, "button");
},cancel:function(_d){ if(!this.displayNode.getAttribute("tabIndex")){
if(this.disabled||!this.editing){ this.displayNode.setAttribute("tabIndex", 0);
return; }
}
this.editing=false; if(!this.value && !("value" in this.params)){ // "" is a good value if specified directly so check params){
setTimeout(dojo.hitch(this,"onCancel"),0); this.value = dojo.trim(this.renderAsHtml ? this.displayNode.innerHTML :
this._showText(_d); (this.displayNode.innerText||this.displayNode.textContent||""));
}}); }
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(){ if(!this.value){
this.inherited(arguments); this.displayNode.innerHTML = this.noValueIndicator;
this.messages=dojo.i18n.getLocalization("dijit","common",this.lang); }
dojo.forEach(["buttonSave","buttonCancel"],function(_e){
if(!this[_e]){ dojo.addClass(this.displayNode, 'dijitInlineEditBoxDisplayMode');
this[_e]=this.messages[_e]; },
}
},this); setDisabled: function(/*Boolean*/ disabled){
},postCreate:function(){ // summary:
var _f=dojo.getObject(this.editor); // Deprecated. Use set('disabled', ...) instead.
var _10=this.sourceStyle,_11="line-height:"+_10.lineHeight+";",_12=dojo.getComputedStyle(this.domNode); // tags:
dojo.forEach(["Weight","Family","Size","Style"],function(_13){ // deprecated
var _14=_10["font"+_13],_15=_12["font"+_13]; dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
if(_15!=_14){ this.set('disabled', disabled);
_11+="font-"+_13+":"+_10["font"+_13]+";"; },
}
},this); _setDisabledAttr: function(/*Boolean*/ disabled){
dojo.forEach(["marginTop","marginBottom","marginLeft","marginRight"],function(_16){ // summary:
this.domNode.style[_16]=_10[_16]; // Hook to make set("disabled", ...) work.
},this); // Set disabled state of widget.
var _17=this.inlineEditBox.width; dijit.setWaiState(this.domNode, "disabled", disabled);
if(_17=="100%"){ if(disabled){
_11+="width:100%;"; this.displayNode.removeAttribute("tabIndex");
this.domNode.style.display="block"; }else{
}else{ this.displayNode.setAttribute("tabIndex", 0);
_11+="width:"+(_17+(Number(_17)==_17?"px":""))+";"; }
} dojo.toggleClass(this.displayNode, "dijitInlineEditBoxDisplayModeDisabled", disabled);
var _18=dojo.delegate(this.inlineEditBox.editorParams,{style:_11,dir:this.dir,lang:this.lang}); this._set("disabled", disabled);
_18["displayedValue" in _f.prototype?"displayedValue":"value"]=this.value; },
var ew=(this.editWidget=new _f(_18,this.editorPlaceholder));
if(this.inlineEditBox.autoSave){ _onMouseOver: function(){
dojo.destroy(this.buttonContainer); // summary:
this.connect(ew,"onChange","_onChange"); // Handler for onmouseover and onfocus event.
this.connect(ew,"onKeyPress","_onKeyPress"); // tags:
}else{ // private
if("intermediateChanges" in _f.prototype){ if(!this.disabled){
ew.set("intermediateChanges",true); dojo.addClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
this.connect(ew,"onChange","_onIntermediateChange"); }
this.saveButton.set("disabled",true); },
}
} _onMouseOut: function(){
},_onIntermediateChange:function(val){ // summary:
this.saveButton.set("disabled",(this.getValue()==this._resetValue)||!this.enableSave()); // Handler for onmouseout and onblur event.
},destroy:function(){ // tags:
this.editWidget.destroy(true); // private
this.inherited(arguments); dojo.removeClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
},getValue:function(){ },
var ew=this.editWidget;
return String(ew.get("displayedValue" in ew?"displayedValue":"value")); _onClick: function(/*Event*/ e){
},_onKeyPress:function(e){ // summary:
if(this.inlineEditBox.autoSave&&this.inlineEditBox.editing){ // Handler for onclick event.
if(e.altKey||e.ctrlKey){ // tags:
return; // private
} if(this.disabled){ return; }
if(e.charOrCode==dojo.keys.ESCAPE){ if(e){ dojo.stopEvent(e); }
dojo.stopEvent(e); this._onMouseOut();
this.cancel(true);
}else{ // Since FF gets upset if you move a node while in an event handler for that node...
if(e.charOrCode==dojo.keys.ENTER&&e.target.tagName=="INPUT"){ setTimeout(dojo.hitch(this, "edit"), 0);
dojo.stopEvent(e); },
this._onChange();
} edit: function(){
} // summary:
} // Display the editor widget in place of the original (read only) markup.
},_onBlur:function(){ // tags:
this.inherited(arguments); // private
if(this.inlineEditBox.autoSave&&this.inlineEditBox.editing){
if(this.getValue()==this._resetValue){ if(this.disabled || this.editing){ return; }
this.cancel(false); this.editing = true;
}else{
if(this.enableSave()){ // save some display node values that can be restored later
this.save(false); this._savedPosition = dojo.style(this.displayNode, "position") || "static";
} this._savedOpacity = dojo.style(this.displayNode, "opacity") || "1";
} this._savedTabIndex = dojo.attr(this.displayNode, "tabIndex") || "0";
}
},_onChange:function(){ if(this.wrapperWidget){
if(this.inlineEditBox.autoSave&&this.inlineEditBox.editing&&this.enableSave()){ var ew = this.wrapperWidget.editWidget;
dojo.style(this.inlineEditBox.displayNode,{display:""}); ew.set("displayedValue" in ew ? "displayedValue" : "value", this.value);
dijit.focus(this.inlineEditBox.displayNode); }else{
} // Placeholder for edit widget
},enableSave:function(){ // Put place holder (and eventually editWidget) before the display node so that it's positioned correctly
return (this.editWidget.isValid?this.editWidget.isValid():true); // when Calendar dropdown appears, which happens automatically on focus.
},focus:function(){ var placeholder = dojo.create("span", null, this.domNode, "before");
this.editWidget.focus();
setTimeout(dojo.hitch(this,function(){ // Create the editor wrapper (the thing that holds the editor widget and the save/cancel buttons)
if(this.editWidget.focusNode&&this.editWidget.focusNode.tagName=="INPUT"){ var ewc = typeof this.editorWrapper == "string" ? dojo.getObject(this.editorWrapper) : this.editorWrapper;
dijit.selectInputText(this.editWidget.focusNode); this.wrapperWidget = new ewc({
} value: this.value,
}),0); 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;
if(dojo.isIE){
dijit.focus(dijit.getFocus()); // IE (at least 8) needs help with tab order changes
}
// 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.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(){
ww.focus(); // both nodes are showing, so we can switch focus safely
ww._resetValue = ww.getValue();
}), 0);
},
_onBlur: function(){
// summary:
// Called when focus moves outside the InlineEditBox.
// Performs garbage collection.
// tags:
// private
this.inherited(arguments);
if(!this.editing){
/* causes IE focus problems, see TooltipDialog_a11y.html...
setTimeout(dojo.hitch(this, function(){
if(this.wrapperWidget){
this.wrapperWidget.destroy();
delete this.wrapperWidget;
}
}), 0);
*/
}
},
destroy: function(){
if(this.wrapperWidget && !this.wrapperWidget._destroyed){
this.wrapperWidget.destroy();
delete this.wrapperWidget;
}
this.inherited(arguments);
},
_showText: function(/*Boolean*/ focus){
// summary:
// Revert to display mode, and optionally focus on display node
// tags:
// private
var ww = this.wrapperWidget;
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: "" }); // make the original text visible
dojo.attr(this.displayNode, "tabIndex", this._savedTabIndex);
if(focus){
dijit.focus(this.displayNode);
}
},
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;
var ww = this.wrapperWidget;
var value = ww.getValue();
this.set('value', value); // display changed, formatted value
this._showText(focus); // set focus as needed
},
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");
return this.set("value", val);
},
_setValueAttr: function(/*String*/ val){
// 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
}
},
getValue: function(){
// summary:
// Deprecated. Use get('value') instead.
// tags:
// deprecated
dojo.deprecated("dijit.InlineEditBox.getValue() is deprecated. Use get('value') instead.", "", "2.0");
return this.get("value");
},
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;
// tell the world that we have no changes
setTimeout(dojo.hitch(this, "onCancel"), 0); // setTimeout prevents browser freeze for long-running event handlers
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.messages = dojo.i18n.getLocalization("dijit", "common", this.lang);
dojo.forEach(["buttonSave", "buttonCancel"], function(prop){
if(!this[prop]){ this[prop] = this.messages[prop]; }
}, 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);
dojo.forEach(["marginTop","marginBottom","marginLeft", "marginRight"], function(prop){
this.domNode.style[prop] = srcStyle[prop];
}, this);
var width = this.inlineEditBox.width;
if(width == "100%"){
// block mode
editStyle += "width:100%;";
this.domNode.style.display = "block";
}else{
// inline-block mode
editStyle += "width:" + (width + (Number(width) == width ? "px" : "")) + ";";
}
var editorParams = dojo.delegate(this.inlineEditBox.editorParams, {
style: editStyle,
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){
// 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);
}
},
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");
// 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");
}else{
// If possible, enable/disable save button based on whether the user has changed the value
if("intermediateChanges" in ew){
ew.set("intermediateChanges", true);
this.connect(ew, "onChange", "_onIntermediateChange");
this.saveButton.set("disabled", true);
}
}
},
_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());
},
destroy: function(){
this.editWidget.destroy(true); // let the parent wrapper widget clean up the DOM
this.inherited(arguments);
},
getValue: function(){
// summary:
// Return the [display] value of the edit widget
var ew = this.editWidget;
return String(ew.get("displayedValue" in ew ? "displayedValue" : "value"));
},
_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(e.altKey || e.ctrlKey){ return; }
// If Enter/Esc pressed, treat as save/cancel.
if(e.charOrCode == dojo.keys.ESCAPE){
dojo.stopEvent(e);
this.cancel(true); // sets editing=false which short-circuits _onBlur processing
}else if(e.charOrCode == dojo.keys.ENTER && e.target.tagName == "INPUT"){
dojo.stopEvent(e);
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(){
// summary:
// Called when focus moves outside the editor
// tags:
// private
this.inherited(arguments);
if(this.inlineEditBox.autoSave && this.inlineEditBox.editing){
if(this.getValue() == this._resetValue){
this.cancel(false);
}else if(this.enableSave()){
this.save(false);
}
}
},
_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()){
dojo.style(this.inlineEditBox.displayNode, { display: "" });
dijit.focus(this.inlineEditBox.displayNode); // fires _onBlur which will save the formatted value
}
},
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();
setTimeout(dojo.hitch(this, function(){
if(this.editWidget.focusNode && this.editWidget.focusNode.tagName == "INPUT"){
dijit.selectInputText(this.editWidget.focusNode);
}
}), 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

File diff suppressed because it is too large Load Diff

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(){
var k=dojo.keys,l=this.isLeftToRight();
this.connectKeyNavHandlers(l?[k.LEFT_ARROW]:[k.RIGHT_ARROW],l?[k.RIGHT_ARROW]:[k.LEFT_ARROW]); dojo.declare("dijit.MenuBar", dijit._MenuBase, {
this._orient=this.isLeftToRight()?{BL:"TL"}:{BR:"TR"}; // summary:
},focusChild:function(_1){ // A menu bar, listing menu choices horizontally, like the "File" menu in most desktop applications
var _2=this.focusedChild,_3=_2&&_2.popup&&_2.popup.isShowingNow;
this.inherited(arguments); templateString: dojo.cache("dijit", "templates/MenuBar.html", "<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" role=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),
if(_3&&_1.popup&&!_1.disabled){
this._openPopup(); baseClass: "dijitMenuBar",
}
},_onKeyPress:function(_4){ // _isMenuBar: [protected] Boolean
if(_4.ctrlKey||_4.altKey){ // This is a MenuBar widget, not a (vertical) Menu widget.
return; _isMenuBar: true,
}
switch(_4.charOrCode){ postCreate: function(){
case dojo.keys.DOWN_ARROW: var k = dojo.keys, l = this.isLeftToRight();
this._moveToPopup(_4); this.connectKeyNavHandlers(
dojo.stopEvent(_4); l ? [k.LEFT_ARROW] : [k.RIGHT_ARROW],
} l ? [k.RIGHT_ARROW] : [k.LEFT_ARROW]
},onItemClick:function(_5,_6){ );
if(_5.popup&&_5.popup.isShowingNow){
_5.popup.onCancel(); // parameter to dijit.popup.open() about where to put popup (relative to this.domNode)
}else{ this._orient = this.isLeftToRight() ? {BL: 'TL'} : {BR: 'TR'};
this.inherited(arguments); },
}
}}); 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);
if(showpopup && item.popup && !item.disabled){
this._openPopup(); // TODO: on down arrow, _openPopup() is called here and in onItemClick()
}
},
_onKeyPress: function(/*Event*/ evt){
// summary:
// Handle keyboard based menu navigation.
// tags:
// protected
if(evt.ctrlKey || evt.altKey){ return; }
switch(evt.charOrCode){
case dojo.keys.DOWN_ARROW:
this._moveToPopup(evt);
dojo.stopEvent(evt);
}
},
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{
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],
},postCreate:function(){ {
this.inherited(arguments); // summary:
dojo.setSelectable(this.domNode,false); // A line item in a Menu Widget
var _2=this.id+"_text";
dojo.attr(this.containerNode,"id",_2); // Make 3 columns
if(this.accelKeyNode){ // icon, label, and expand arrow (BiDi-dependent) indicating sub-menu
dojo.attr(this.accelKeyNode,"id",this.id+"_accel"); 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"),
_2+=" "+this.id+"_accel";
} attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
dijit.setWaiState(this.domNode,"labelledby",_2); label: { node: "containerNode", type: "innerHTML" },
},_onHover:function(){ iconClass: { node: "iconNode", type: "class" }
this.getParent().onItemHover(this); }),
},_onUnhover:function(){
this.getParent().onItemUnhover(this); baseClass: "dijitMenuItem",
this._hovering=false;
this._setStateClass(); // label: String
},_onClick:function(_3){ // Menu text
this.getParent().onItemClick(this,_3); label: '',
dojo.stopEvent(_3);
},onClick:function(_4){ // iconClass: String
},focus:function(){ // Class to apply to DOMNode to make it display an icon.
try{ iconClass: "",
if(dojo.isIE==8){
this.containerNode.focus(); // accelKey: String
} // Text for the accelerator (shortcut) key combination.
dijit.focus(this.focusNode); // Note that although Menu can display accelerator keys there
} // is no infrastructure to actually catch and execute these
catch(e){ // accelerators.
} accelKey: "",
},_onFocus:function(){
this._setSelected(true); // disabled: Boolean
this.getParent()._onItemFocus(this); // If true, the menu item is disabled.
this.inherited(arguments); // If false, the menu item is enabled.
},_setSelected:function(_5){ disabled: false,
dojo.toggleClass(this.domNode,"dijitMenuItemSelected",_5);
},setLabel:function(_6){ _fillContent: function(/*DomNode*/ source){
dojo.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.","","2.0"); // If button label is specified as srcNodeRef.innerHTML rather than
this.set("label",_6); // this.params.label, handle it here.
},setDisabled:function(_7){ if(source && !("label" in this.params)){
dojo.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.","","2.0"); this.set('label', source.innerHTML);
this.set("disabled",_7); }
},_setDisabledAttr:function(_8){ },
this.disabled=_8;
dijit.setWaiState(this.focusNode,"disabled",_8?"true":"false"); buildRendering: function(){
},_setAccelKeyAttr:function(_9){ this.inherited(arguments);
this.accelKey=_9; var label = this.id+"_text";
this.accelKeyNode.style.display=_9?"":"none"; dojo.attr(this.containerNode, "id", label);
this.accelKeyNode.innerHTML=_9; if(this.accelKeyNode){
dojo.attr(this.containerNode,"colSpan",_9?"1":"2"); dojo.attr(this.accelKeyNode, "id", this.id + "_accel");
}}); label += " " + this.id + "_accel";
}
dijit.setWaiState(this.domNode, "labelledby", label);
dojo.setSelectable(this.domNode, false);
},
_onHover: function(){
// summary:
// Handler when mouse is moved onto menu item
// tags:
// protected
this.getParent().onItemHover(this);
},
_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);
// When menu is hidden (collapsed) due to clicking a MenuItem and having it execute,
// FF and IE don't generate an onmouseout event for the MenuItem.
// So, help out _CssStateMixin in this case.
this._set("hovering", false);
},
_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{
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();
}
dijit.focus(this.focusNode);
}catch(e){
// this throws on IE (at least) in some scenarios
}
},
_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.getParent()._onItemFocus(this);
this.inherited(arguments);
},
_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");
this.set("label", content);
},
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");
this.set('disabled', disabled);
},
_setDisabledAttr: function(/*Boolean*/ value){
// summary:
// Hook for attr('disabled', ...) to work.
// Enable or disable this menu item.
dijit.setWaiState(this.focusNode, 'disabled', value ? 'true' : 'false');
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.setSelectable(this.domNode,false);
},isFocusable:function(){ dojo.declare("dijit.MenuSeparator",
return false; [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);
},
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(){
if(this.srcNodeRef){
var _1=dojo.query("*",this.srcNodeRef); dojo.declare("dijit.PopupMenuItem",
dijit.PopupMenuItem.superclass._fillContent.call(this,_1[0]); dijit.MenuItem,
this.dropDownContainer=this.srcNodeRef; {
} _fillContent: function(){
},startup:function(){ // summary:
if(this._started){ // When Menu is declared in markup, this code gets the menu label and
return; // the popup widget from the srcNodeRef.
} // description:
this.inherited(arguments); // srcNodeRefinnerHTML contains both the menu item text and a popup widget
if(!this.popup){ // The first part holds the menu item text and the second part is the popup
var _2=dojo.query("[widgetId]",this.dropDownContainer)[0]; // example:
this.popup=dijit.byNode(_2); // | <div dojoType="dijit.PopupMenuItem">
} // | <span>pick me</span>
dojo.body().appendChild(this.popup.domNode); // | <popup> ... </popup>
this.popup.startup(); // | </div>
this.popup.domNode.style.display="none"; // tags:
if(this.arrowWrapper){ // protected
dojo.style(this.arrowWrapper,"visibility","");
} if(this.srcNodeRef){
dijit.setWaiState(this.focusNode,"haspopup","true"); var nodes = dojo.query("*", this.srcNodeRef);
},destroyDescendants:function(){ dijit.PopupMenuItem.superclass._fillContent.call(this, nodes[0]);
if(this.popup){
if(!this.popup._destroyed){ // save pointer to srcNode so we can grab the drop down widget after it's instantiated
this.popup.destroyRecursive(); this.dropDownContainer = this.srcNodeRef;
} }
delete this.popup; },
}
this.inherited(arguments); startup: function(){
}}); if(this._started){ return; }
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){
var node = dojo.query("[widgetId]", this.dropDownContainer)[0];
this.popup = dijit.byNode(node);
}
dojo.body().appendChild(this.popup.domNode);
this.popup.startup();
this.popup.domNode.style.display="none";
if(this.arrowWrapper){
dojo.style(this.arrowWrapper, "visibility", "");
}
dijit.setWaiState(this.focusNode, "haspopup", "true");
},
destroyDescendants: function(){
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){
this.popup.destroyRecursive();
}
delete this.popup;
}
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(){
this.inherited(arguments);
this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString()); dojo.declare("dijit.ProgressBar", [dijit._Widget, dijit._Templated], {
this.update(); // summary:
},update:function(_1){ // A progress indication widget, showing the amount completed
dojo.mixin(this,_1||{}); // (often the percentage completed) of a task.
var _2=this.internalProgress; //
var _3=1,_4; // example:
if(this.indeterminate){ // | <div dojoType="ProgressBar"
_4="addClass"; // | places="0"
dijit.removeWaiState(_2,"valuenow"); // | value="..." maximum="...">
dijit.removeWaiState(_2,"valuemin"); // | </div>
dijit.removeWaiState(_2,"valuemax");
}else{ // progress: [const] String (Percentage or Number)
_4="removeClass"; // Number or percentage indicating amount of task completed.
if(String(this.progress).indexOf("%")!=-1){ // Deprecated. Use "value" instead.
_3=Math.min(parseFloat(this.progress)/100,1); progress: "0",
this.progress=_3*this.maximum;
}else{ // value: String (Percentage or Number)
this.progress=Math.min(this.progress,this.maximum); // Number or percentage indicating amount of task completed.
_3=this.progress/this.maximum; // With "%": percentage value, 0% <= progress <= 100%, or
} // without "%": absolute value, 0 <= progress <= maximum.
var _5=this.report(_3); // Infinity means that the progress bar is indeterminate.
this.label.firstChild.nodeValue=_5; value: "",
dijit.setWaiState(_2,"describedby",this.label.id);
dijit.setWaiState(_2,"valuenow",this.progress); // maximum: [const] Float
dijit.setWaiState(_2,"valuemin",0); // Max sample number
dijit.setWaiState(_2,"valuemax",this.maximum); maximum: 100,
}
dojo[_4](this.domNode,"dijitProgressBarIndeterminate"); // places: [const] Number
_2.style.width=(_3*100)+"%"; // Number of places to show in values; 0 by default
this.onChange(); places: 0,
},_setValueAttr:function(v){
if(v==Infinity){ // indeterminate: [const] Boolean
this.update({indeterminate:true}); // If false: show progress value (number or percentage).
}else{ // If true: show that a process is underway but that the amount completed is unknown.
this.update({indeterminate:false,progress:v}); // Deprecated. Use "value" instead.
} indeterminate: false,
},_getValueAttr:function(){
return this.progress; // label: String?
},report:function(_6){ // Label on progress bar. Defaults to percentage for determinate progress bar and
return dojo.number.format(_6,{type:"percent",places:this.places,locale:this.lang}); // blank for indeterminate progress bar.
},onChange:function(){ 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);
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();
},
update: function(/*Object?*/attributes){
// 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){
dijit.removeWaiState(ap, "valuenow");
dijit.removeWaiState(ap, "valuemin");
dijit.removeWaiState(ap, "valuemax");
}else{
if(String(this.progress).indexOf("%") != -1){
percent = Math.min(parseFloat(this.progress)/100, 1);
this.progress = percent * this.maximum;
}else{
this.progress = Math.min(this.progress, this.maximum);
percent = this.progress / this.maximum;
}
dijit.setWaiState(ap, "describedby", this.labelNode.id);
dijit.setWaiState(ap, "valuenow", this.progress);
dijit.setWaiState(ap, "valuemin", 0);
dijit.setWaiState(ap, "valuemax", this.maximum);
}
this.labelNode.innerHTML = this.report(percent);
dojo.toggleClass(this.domNode, "dijitProgressBarIndeterminate", this.indeterminate);
tip.style.width = (percent * 100) + "%";
this.onChange();
},
_setValueAttr: function(v){
this._set("value", v);
if(v == Infinity){
this.update({indeterminate:true});
}else{
this.update({indeterminate:false, progress:v});
}
},
_setLabelAttr: function(label){
this._set("label", label);
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",
if(this.toggleable){ [dijit.layout.ContentPane, dijit._Templated, dijit._CssStateMixin],
this._trackMouseState(this.titleBarNode,"dijitTitlePaneTitle"); {
} // summary:
this._setCss(); // A pane with a title on top, that can be expanded or collapsed.
dojo.setSelectable(this.titleNode,false); //
var _1=this.hideNode,_2=this.wipeNode; // description:
this._wipeIn=dojo.fx.wipeIn({node:this.wipeNode,duration:this.duration,beforeBegin:function(){ // An accessible container with a title Heading, and a content
_1.style.display=""; // section that slides open and closed. TitlePane is an extension to
}}); // `dijit.layout.ContentPane`, providing all the useful content-control aspects from it.
this._wipeOut=dojo.fx.wipeOut({node:this.wipeNode,duration:this.duration,onEnd:function(){ //
_1.style.display="none"; // example:
}}); // | // load a TitlePane from remote file:
this.inherited(arguments); // | var foo = new dijit.TitlePane({ href: "foobar.html", title:"Title" });
},_setOpenAttr:function(_3){ // | foo.startup();
if(this.open!==_3){ //
this.toggle(); // example:
} // | <!-- markup href example: -->
dijit.setWaiState(this.containerNode,"hidden",this.open?"false":"true"); // | <div dojoType="dijit.TitlePane" href="foobar.html" title="Title"></div>
dijit.setWaiState(this.focusNode,"pressed",this.open?"true":"false"); //
},_setToggleableAttr:function(_4){ // example:
this.toggleable=_4; // | <!-- markup with inline data -->
dijit.setWaiRole(this.focusNode,_4?"button":"heading"); // | <div dojoType="dijit.TitlePane" title="Title">
if(_4){ // | <p>I am content</p>
dijit.setWaiState(this.focusNode,"controls",this.id+"_pane"); // | </div>
dojo.attr(this.focusNode,"tabIndex",this.tabIndex);
}else{ // title: String
dojo.removeAttr(this.focusNode,"tabIndex"); // Title of the pane
} title: "",
this._setCss();
},_setContentAttr:function(_5){ // open: Boolean
if(!this.open||!this._wipeOut||this._wipeOut.status()=="playing"){ // Whether pane is opened or closed.
this.inherited(arguments); open: true,
}else{
if(this._wipeIn&&this._wipeIn.status()=="playing"){ // toggleable: Boolean
this._wipeIn.stop(); // Whether pane can be opened or closed by clicking the title bar.
} toggleable: true,
dojo.marginBox(this.wipeNode,{h:dojo.marginBox(this.wipeNode).h});
this.inherited(arguments); // tabIndex: String
if(this._wipeIn){ // Tabindex setting for the title (so users can tab to the title then
this._wipeIn.play(); // use space/enter to open/close the title pane)
}else{ tabIndex: "0",
this.hideNode.style.display="";
} // duration: Integer
} // Time in milliseconds to fade in/fade out
},toggle:function(){ duration: dijit.defaultDuration,
dojo.forEach([this._wipeIn,this._wipeOut],function(_6){
if(_6&&_6.status()=="playing"){ // baseClass: [protected] String
_6.stop(); // 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){
this._trackMouseState(this.titleBarNode, "dijitTitlePaneTitle");
}
// setup open/close animations
var hideNode = this.hideNode, wipeNode = this.wipeNode;
this._wipeIn = dojo.fx.wipeIn({
node: this.wipeNode,
duration: this.duration,
beforeBegin: function(){
hideNode.style.display="";
}
});
this._wipeOut = dojo.fx.wipeOut({
node: this.wipeNode,
duration: this.duration,
onEnd: function(){
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");
dojo.attr(this.focusNode, "tabIndex", this.tabIndex);
}else{
dojo.removeAttr(this.focusNode, "tabIndex");
}
this._set("toggleable", canToggle);
this._setCss();
},
_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"){
// we are currently *closing* the pane (or the pane is closed), so just let that continue
this.inherited(arguments);
}else{
if(this._wipeIn && this._wipeIn.status() == "playing"){
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 });
// add the new content (erasing the old content, if any)
this.inherited(arguments);
// call _wipeIn.play() to animate from current height to new height
if(this._wipeIn){
this._wipeIn.play();
}else{
this.hideNode.style.display = "";
}
}
},
toggle: function(){
// summary:
// Switches between opened and closed state
// tags:
// private
this._setOpenAttr(!this.open, true);
},
_setCss: function(){
// summary:
// Set the open/close css state for the TitlePane
// tags:
// private
var node = this.titleBarNode || this.focusNode;
var oldCls = this._titleBarClass;
this._titleBarClass = "dijit" + (this.toggleable ? "" : "Fixed") + (this.open ? "Open" : "Closed");
dojo.replaceClass(node, this._titleBarClass, oldCls || "");
this.arrowNodeInner.innerHTML = this.open ? "-" : "+";
},
_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){
this.toggle();
}
dojo.stopEvent(e);
}else if(e.charOrCode == dojo.keys.DOWN_ARROW && this.open){
this.containerNode.focus();
e.preventDefault();
}
},
_onTitleClick: function(){
// summary:
// Handler when user clicks the title bar
// tags:
// private
if(this.toggleable){
this.toggle();
}
},
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");
this.set("title", title);
}
}); });
var _7=this[this.open?"_wipeOut":"_wipeIn"];
if(_7){
_7.play();
}else{
this.hideNode.style.display=this.open?"":"none";
}
this.open=!this.open;
if(this.open){
this._onShow();
}else{
this.onHide();
}
this._setCss();
},_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");
dojo.addClass(_8,this._titleBarClass);
this.arrowNodeInner.innerHTML=this.open?"-":"+";
},_onTitleKey:function(e){
if(e.charOrCode==dojo.keys.ENTER||e.charOrCode==" "){
if(this.toggleable){
this.toggle();
}
dojo.stopEvent(e);
}else{
if(e.charOrCode==dojo.keys.DOWN_ARROW&&this.open){
this.containerNode.focus();
e.preventDefault();
}
}
},_onTitleClick:function(){
if(this.toggleable){
this.toggle();
}
},setTitle:function(_9){
dojo.deprecated("dijit.TitlePane.setTitle() is deprecated. Use set('title', ...) instead.","","2.0");
this.set("title",_9);
}});
} }

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.setSelectable(this.domNode,false);
},isFocusable:function(){ dojo.declare("dijit.ToolbarSeparator",
return false; [ 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);
},
isFocusable: function(){
// summary:
// This widget isn't focusable, so pass along that fact.
// tags:
// protected
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.body().appendChild(this.domNode);
this.bgIframe=new dijit.BackgroundIframe(this.domNode); dojo.declare(
this.fadeIn=dojo.fadeIn({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onShow")}); "dijit._MasterTooltip",
this.fadeOut=dojo.fadeOut({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onHide")}); [dijit._Widget, dijit._Templated],
},show:function(_1,_2,_3,_4){ {
if(this.aroundNode&&this.aroundNode===_2){ // summary:
return; // Internal widget that holds the actual tooltip markup,
} // which occurs once per page.
if(this.fadeOut.status()=="playing"){ // Called by Tooltip widgets which are just containers to hold
this._onDeck=arguments; // the markup
return; // tags:
} // protected
this.containerNode.innerHTML=_1;
var _5=dijit.placeOnScreenAroundElement(this.domNode,_2,dijit.getPopupAroundAlignment((_3&&_3.length)?_3:dijit.Tooltip.defaultPosition,!_4),dojo.hitch(this,"orient")); // duration: Integer
dojo.style(this.domNode,"opacity",0); // Milliseconds to fade in/fade out
this.fadeIn.play(); duration: dijit.defaultDuration,
this.isShowingNow=true;
this.aroundNode=_2; 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"),
},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]; postCreate: function(){
},_onShow:function(){ dojo.body().appendChild(this.domNode);
if(dojo.isIE){
this.domNode.style.filter=""; this.bgIframe = new dijit.BackgroundIframe(this.domNode);
}
},hide:function(_9){ // Setup fade-in and fade-out functions.
if(this._onDeck&&this._onDeck[1]==_9){ this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
this._onDeck=null; this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
}else{ },
if(this.aroundNode===_9){
this.fadeIn.stop(); show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
this.isShowingNow=false; // summary:
this.aroundNode=null; // Display tooltip w/specified contents to right of specified node
this.fadeOut.play(); // (To left if there's no space on the right, or if rtl == true)
}else{
} if(this.aroundNode && this.aroundNode === aroundNode){
} return;
},_onHide:function(){ }
this.domNode.style.cssText="";
this.containerNode.innerHTML=""; // reset width; it may have been set by orient() on a previous tooltip show()
if(this._onDeck){ this.domNode.width = "auto";
this.show.apply(this,this._onDeck);
this._onDeck=null; if(this.fadeOut.status() == "playing"){
} // previous tooltip is being hidden; wait until the hide completes then show new one
}}); this._onDeck=arguments;
dijit.showTooltip=function(_a,_b,_c,_d){ return;
if(!dijit._masterTT){ }
dijit._masterTT=new dijit._MasterTooltip(); this.containerNode.innerHTML=innerHTML;
}
return dijit._masterTT.show(_a,_b,_c,_d); 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);
this.fadeIn.play();
this.isShowingNow = true;
this.aroundNode = aroundNode;
},
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){
// the arrow won't show up on a node w/an opacity filter
this.domNode.style.filter="";
}
},
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;
}else if(this.aroundNode === aroundNode){
// this hide request is for the currently displayed tooltip
this.fadeIn.stop();
this.isShowingNow = false;
this.aroundNode = null;
this.fadeOut.play();
}else{
// just ignore the call, it's for a tooltip that has already been erased
}
},
_onHide: function(){
// summary:
// Called at end of fade-out operation
// tags:
// protected
this.domNode.style.cssText=""; // to position offscreen again
this.containerNode.innerHTML="";
if(this._onDeck){
// a show request has been queued up; do it now
this.show.apply(this, this._onDeck);
this._onDeck=null;
}
}
}
);
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:
dojo.forEach(dojo.isArrayLike(_f)?_f:[_f],this.addTarget,this); // Pops up a tooltip (a help message) when you hover over a node.
},_getConnectIdAttr:function(){
var ary=[]; // label: String
for(var id in this._nodeConnectionsById){ // Text to display in the tooltip.
ary.push(id); // Specified as innerHTML when creating the widget from markup.
} label: "",
return ary;
},addTarget:function(id){ // showDelay: Integer
var _11=dojo.byId(id); // Number of milliseconds to wait after hovering over/focusing on the object, before
if(!_11){ // the tooltip is displayed.
return; showDelay: 400,
}
if(_11.id in this._nodeConnectionsById){ // connectId: String|String[]
return; // Id of domNode(s) to attach the tooltip to.
} // When user hovers over specified dom node, the tooltip will appear.
this._nodeConnectionsById[_11.id]=[this.connect(_11,"onmouseenter","_onTargetMouseEnter"),this.connect(_11,"onmouseleave","_onTargetMouseLeave"),this.connect(_11,"onfocus","_onTargetFocus"),this.connect(_11,"onblur","_onTargetBlur")]; connectId: [],
},removeTarget:function(_12){
var id=_12.id||_12; // position: String[]
if(id in this._nodeConnectionsById){ // See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
dojo.forEach(this._nodeConnectionsById[id],this.disconnect,this); position: [],
delete this._nodeConnectionsById[id];
} _setConnectIdAttr: function(/*String*/ newId){
},postCreate:function(){ // summary:
dojo.addClass(this.domNode,"dijitTooltipData"); // Connect to node(s) (specified by id)
},startup:function(){
this.inherited(arguments); // Remove connections to old nodes (if there are any)
var ids=this.connectId; dojo.forEach(this._connections || [], function(nested){
dojo.forEach(dojo.isArrayLike(ids)?ids:[ids],this.addTarget,this); dojo.forEach(nested, dojo.hitch(this, "disconnect"));
},_onTargetMouseEnter:function(e){ }, this);
this._onHover(e);
},_onTargetMouseLeave:function(e){ // Make connections to nodes in newIds.
this._onUnHover(e); var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
},_onTargetFocus:function(e){ this._connections = dojo.map(ary, function(id){
this._focus=true; var node = dojo.byId(id);
this._onHover(e); return node ? [
},_onTargetBlur:function(e){ this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
this._focus=false; this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
this._onUnHover(e); this.connect(node, "onfocus", "_onTargetFocus"),
},_onHover:function(e){ this.connect(node, "onblur", "_onTargetBlur")
if(!this._showTimer){ ] : [];
var _13=e.target; }, this);
this._showTimer=setTimeout(dojo.hitch(this,function(){
this.open(_13); this._set("connectId", newId);
}),this.showDelay);
} this._connectIds = ary; // save as array
},_onUnHover:function(e){ },
if(this._focus){
return; addTarget: function(/*DOMNODE || String*/ node){
} // summary:
if(this._showTimer){ // Attach tooltip to specified node if it's not already connected
clearTimeout(this._showTimer);
delete this._showTimer; // TODO: remove in 2.0 and just use set("connectId", ...) interface
}
this.close(); var id = node.id || node;
},open:function(_14){ if(dojo.indexOf(this._connectIds, id) == -1){
if(this._showTimer){ this.set("connectId", this._connectIds.concat(id));
clearTimeout(this._showTimer); }
delete this._showTimer; },
}
dijit.showTooltip(this.label||this.domNode.innerHTML,_14,this.position,!this.isLeftToRight()); removeTarget: function(/*DOMNODE || String*/ node){
this._connectNode=_14; // summary:
this.onShow(_14,this.position); // Detach tooltip from specified node
},close:function(){
if(this._connectNode){ // TODO: remove in 2.0 and just use set("connectId", ...) interface
dijit.hideTooltip(this._connectNode);
delete this._connectNode; var id = node.id || node, // map from DOMNode back to plain id string
this.onHide(); idx = dojo.indexOf(this._connectIds, id);
} if(idx >= 0){
if(this._showTimer){ // remove id (modifies original this._connectIds but that's OK in this case)
clearTimeout(this._showTimer); this._connectIds.splice(idx, 1);
delete this._showTimer; this.set("connectId", this._connectIds);
} }
},onShow:function(_15,_16){ },
},onHide:function(){
},uninitialize:function(){ buildRendering: function(){
this.close(); this.inherited(arguments);
this.inherited(arguments); dojo.addClass(this.domNode,"dijitTooltipData");
}}); },
dijit.Tooltip.defaultPosition=["after","before"];
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;
dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
},
_onTargetMouseEnter: function(/*Event*/ e){
// summary:
// Handler for mouseenter event on the target node
// tags:
// private
this._onHover(e);
},
_onTargetMouseLeave: function(/*Event*/ e){
// summary:
// Handler for mouseleave event on the target node
// tags:
// private
this._onUnHover(e);
},
_onTargetFocus: function(/*Event*/ e){
// summary:
// Handler for focus event on the target node
// tags:
// private
this._focus = true;
this._onHover(e);
},
_onTargetBlur: function(/*Event*/ e){
// summary:
// Handler for blur event on the target node
// tags:
// private
this._focus = false;
this._onUnHover(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){
var target = e.target;
this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
}
},
_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){
clearTimeout(this._showTimer);
delete this._showTimer;
}
this.close();
},
open: function(/*DomNode*/ target){
// summary:
// Display the tooltip; usually not called directly.
// tags:
// private
if(this._showTimer){
clearTimeout(this._showTimer);
delete this._showTimer;
}
dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position, !this.isLeftToRight());
this._connectNode = target;
this.onShow(target, this.position);
},
close: function(){
// summary:
// Hide the tooltip or cancel timer for show of tooltip
// tags:
// private
if(this._connectNode){
// if tooltip is currently shown
dijit.hideTooltip(this._connectNode);
delete this._connectNode;
this.onHide();
}
if(this._showTimer){
// if tooltip is scheduled to be shown (after a brief delay)
clearTimeout(this._showTimer);
delete this._showTimer;
}
},
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.inherited(arguments);
}
}
);
// 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(){
this.inherited(arguments);
this.connect(this.containerNode,"onkeypress","_onKey"); dojo.declare(
this.containerNode.title=this.title; "dijit.TooltipDialog",
},orient:function(_1,_2,_3){ [dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
var c=this._currentOrientClass; {
if(c){ // summary:
dojo.removeClass(this.domNode,c); // Pops up a dialog that appears like a Tooltip
}
c="dijitTooltipAB"+(_3.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(_3.charAt(0)=="T"?"Below":"Above"); // title: String
dojo.addClass(this.domNode,c); // Description of tooltip dialog (required for a11y)
this._currentOrientClass=c; title: "",
},onOpen:function(_4){
this.orient(this.domNode,_4.aroundCorner,_4.corner); // doLayout: [protected] Boolean
this._onShow(); // Don't change this parameter from the default value.
if(this.autofocus){ // This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
this._getFocusItems(this.containerNode); // is never a child of a layout container, nor can you specify the size of
dijit.focus(this._firstFocusItem); // TooltipDialog in order to control the size of an inner widget.
} doLayout: false,
},onClose:function(){
this.onHide(); // autofocus: Boolean
},_onKey:function(_5){ // A Toggle to modify the default focus behavior of a Dialog, which
var _6=_5.target; // is to focus on the first dialog element after opening the dialog.
var dk=dojo.keys; // False will disable autofocusing. Default: true
if(_5.charOrCode===dk.TAB){ autofocus: true,
this._getFocusItems(this.containerNode);
} // baseClass: [protected] String
var _7=(this._firstFocusItem==this._lastFocusItem); // The root className to use for the various states of this widget
if(_5.charOrCode==dk.ESCAPE){ baseClass: "dijitTooltipDialog",
setTimeout(dojo.hitch(this,"onCancel"),0);
dojo.stopEvent(_5); // _firstFocusItem: [private] [readonly] DomNode
}else{ // The pointer to the first focusable node in the dialog.
if(_6==this._firstFocusItem&&_5.shiftKey&&_5.charOrCode===dk.TAB){ // Set by `dijit._DialogMixin._getFocusItems`.
if(!_7){ _firstFocusItem: null,
dijit.focus(this._lastFocusItem);
} // _lastFocusItem: [private] [readonly] DomNode
dojo.stopEvent(_5); // The pointer to which node has focus prior to our dialog.
}else{ // Set by `dijit._DialogMixin._getFocusItems`.
if(_6==this._lastFocusItem&&_5.charOrCode===dk.TAB&&!_5.shiftKey){ _lastFocusItem: null,
if(!_7){
dijit.focus(this._firstFocusItem); 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"),
}
dojo.stopEvent(_5); _setTitleAttr: function(/*String*/ title){
}else{ this.containerNode.title = title;
if(_5.charOrCode===dk.TAB){ this._set("title", title)
_5.stopPropagation(); },
}
} postCreate: function(){
} this.inherited(arguments);
} this.connect(this.containerNode, "onkeypress", "_onKey");
}}); },
orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ corner){
// summary:
// 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
// directly.
// tags:
// protected
var newC = "dijitTooltipAB" + (corner.charAt(1) == 'L' ? "Left" : "Right")
+ " dijitTooltip"
+ (corner.charAt(0) == 'T' ? "Below" : "Above");
dojo.replaceClass(this.domNode, newC, this._currentOrientClass || "");
this._currentOrientClass = newC;
},
focus: function(){
// summary:
// Focus on first field
this._getFocusItems(this.containerNode);
dijit.focus(this._firstFocusItem);
},
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();
},
_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;
if(evt.charOrCode === dk.TAB){
this._getFocusItems(this.containerNode);
}
var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
if(evt.charOrCode == dk.ESCAPE){
// Use setTimeout to avoid crash on IE, see #10396.
setTimeout(dojo.hitch(this, "onCancel"), 0);
dojo.stopEvent(evt);
}else if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
if(!singleFocusItem){
dijit.focus(this._lastFocusItem); // send focus to last item in dialog
}
dojo.stopEvent(evt);
}else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
if(!singleFocusItem){
dijit.focus(this._firstFocusItem); // send focus to first item in dialog
}
dojo.stopEvent(evt);
}else if(evt.charOrCode === dk.TAB){
// we want the browser's default tab handling to move focus
// 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);
dijit._Calendar=dijit.Calendar;
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;
} }

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; {
do{ // summary:
_3=_3[_2+"Sibling"]; // Mixin for widgets that are children of a container widget
}while(_3&&_3.nodeType!=1); //
return _3&&dijit.byNode(_3); // example:
},getPreviousSibling:function(){ // | // make a basic custom widget that knows about it's parents
return this._getSibling("previous"); // | dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
},getNextSibling:function(){
return this._getSibling("next"); getParent: function(){
},getIndexInParent:function(){ // summary:
var p=this.getParent(); // Returns the parent widget of this widget, assuming the parent
if(!p||!p.getIndexOfChild){ // specifies isContainer
return -1; var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
} return parent && parent.isContainer ? parent : null;
return p.getIndexOfChild(this); },
}});
_getSibling: function(/*String*/ which){
// summary:
// Returns next or previous sibling
// which:
// Either "next" or "previous"
// tags:
// private
var node = this.domNode;
do{
node = node[which+"Sibling"];
}while(node && node.nodeType != 1);
return node && dijit.byNode(node); // dijit._Widget
},
getPreviousSibling: function(){
// summary:
// 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();
if(!p || !p.getIndexOfChild){
return -1; // int
}
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(){
this.inherited(arguments);
if(!this.containerNode){ dojo.declare("dijit._Container",
this.containerNode=this.domNode; null,
} {
},addChild:function(_1,_2){ // summary:
var _3=this.containerNode; // Mixin for widgets that contain a set of widget children.
if(_2&&typeof _2=="number"){ // description:
var _4=this.getChildren(); // Use this mixin for widgets that needs to know about and
if(_4&&_4.length>=_2){ // keep track of their widget children. Suitable for widgets like BorderContainer
_3=_4[_2-1].domNode; // and TabContainer which contain (only) a set of child widgets.
_2="after"; //
} // It's not suitable for widgets like ContentPane
} // which contains mixed HTML (plain DOM nodes in addition to widgets),
dojo.place(_1.domNode,_3,_2); // and where contained widgets are not necessarily directly below
if(this._started&&!_1._started){ // this.containerNode. In that case calls like addChild(node, position)
_1.startup(); // wouldn't make sense.
}
},removeChild:function(_5){ // isContainer: [protected] Boolean
if(typeof _5=="number"&&_5>0){ // Indicates that this widget acts as a "parent" to the descendant widgets.
_5=this.getChildren()[_5]; // When the parent is started it will call startup() on the child widgets.
} // See also `isLayoutContainer`.
if(_5){ isContainer: true,
var _6=_5.domNode;
if(_6&&_6.parentNode){ buildRendering: function(){
_6.parentNode.removeChild(_6); this.inherited(arguments);
} if(!this.containerNode){
} // all widgets with descendants must set containerNode
},hasChildren:function(){ this.containerNode = this.domNode;
return this.getChildren().length>0; }
},destroyDescendants:function(_7){ },
dojo.forEach(this.getChildren(),function(_8){
_8.destroyRecursive(_7); addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
}); // summary:
},_getSiblingOfChild:function(_9,_a){ // Makes the given widget a child of this widget.
var _b=_9.domNode,_c=(_a>0?"nextSibling":"previousSibling"); // description:
do{ // Inserts specified child widget's dom node as a child of this widget's
_b=_b[_c]; // container node, and possibly does other processing (such as layout).
}while(_b&&(_b.nodeType!=1||!dijit.byNode(_b)));
return _b&&dijit.byNode(_b); var refNode = this.containerNode;
},getIndexOfChild:function(_d){ if(insertIndex && typeof insertIndex == "number"){
return dojo.indexOf(this.getChildren(),_d); var children = this.getChildren();
},startup:function(){ if(children && children.length >= insertIndex){
if(this._started){ refNode = children[insertIndex-1].domNode;
return; insertIndex = "after";
} }
dojo.forEach(this.getChildren(),function(_e){ }
_e.startup(); dojo.place(widget.domNode, refNode, insertIndex);
});
this.inherited(arguments); // 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(/*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(widget){
var node = widget.domNode;
if(node && node.parentNode){
node.parentNode.removeChild(node); // detach but don't destroy
}
}
},
hasChildren: function(){
// summary:
// Returns true if widget has children, i.e. if this.containerNode contains something.
return this.getChildren().length > 0; // Boolean
},
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{
node = node[which];
}while(node && (node.nodeType != 1 || !dijit.byNode(node)));
return node && dijit.byNode(node); // dijit._Widget
},
getIndexOfChild: function(/*dijit._Widget*/ child){
// summary:
// Gets the index of the child in this container or -1 if not found
return dojo.indexOf(this.getChildren(), child); // int
},
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);
}
}
);
} }

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(){
this.inherited(arguments);
dojo.forEach(["onmouseenter","onmouseleave","onmousedown"],function(e){ dojo.declare("dijit._CssStateMixin", [], {
this.connect(this.domNode,e,"_cssMouseEvent"); // summary:
},this); // Mixin for widgets to set CSS classes on the widget DOM nodes depending on hover/mouse press/focus
this.connect(this,"set",function(_1,_2){ // state changes, and also higher-level state changes such becoming disabled or selected.
if(arguments.length>=2&&{disabled:true,readOnly:true,checked:true,selected:true}[_1]){ //
this._setStateClass(); // 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);
// Automatically monitor mouse events (essentially :hover and :active) on this.domNode
dojo.forEach(["onmouseenter", "onmouseleave", "onmousedown"], function(e){
this.connect(this.domNode, e, "_cssMouseEvent");
}, this);
// Monitoring changes to disabled, readonly, etc. state, and update CSS class of root node
dojo.forEach(["disabled", "readOnly", "checked", "selected", "focused", "state", "hovering", "active"], function(attr){
this.watch(attr, dojo.hitch(this, "_setStateClass"));
}, this);
// Events on sub nodes within the widget
for(var ap in this.cssStateNodes){
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();
},
_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){
switch(event.type){
case "mouseenter":
case "mouseover": // generated on non-IE browsers even though we connected to mouseenter
this._set("hovering", true);
this._set("active", this._mouseDown);
break;
case "mouseleave":
case "mouseout": // generated on non-IE browsers even though we connected to mouseleave
this._set("hovering", false);
this._set("active", false);
break;
case "mousedown" :
this._set("active", true);
this._mouseDown = true;
// Set a global event to handle mouseup, so it fires properly
// 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._set("active", false);
this.disconnect(mouseUpConnector);
});
break;
}
}
},
_setStateClass: function(){
// summary:
// Update the visual state of the widget by setting the css classes on this.domNode
// (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()){
// For RTL mode we need to set an addition class like dijitTextBoxRtl.
multiply("Rtl");
}
if(this.checked){
multiply("Checked");
}
if(this.state){
multiply(this.state);
}
if(this.selected){
multiply("Selected");
}
if(this.disabled){
multiply("Disabled");
}else if(this.readOnly){
multiply("ReadOnly");
}else{
if(this.active){
multiply("Active");
}else if(this.hovering){
multiply("Hover");
}
}
if(this._focused){
multiply("Focused");
}
// Remove old state classes and add new ones.
// 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){
dojo.forEach(this._stateClasses, function(c){ delete classHash[c]; });
}
dojo.forEach(newStateClasses, function(c){ classHash[c] = true; });
var newClasses = [];
for(var c in classHash){
newClasses.push(c);
}
tn.className = newClasses.join(" ");
this._stateClasses = newStateClasses;
},
_trackMouseState: function(/*DomNode*/ node, /*String*/ clazz){
// summary:
// Track mouse/focus events on specified node and set CSS class on that node to indicate
// current state. Usually not called directly, but via cssStateNodes attribute.
// 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(){
hovering = true;
setClass();
});
cn("onmouseleave", function(){
hovering = false;
active = false;
setClass();
});
cn("onmousedown", function(){
active = true;
setClass();
});
cn("onmouseup", function(){
active = false;
setClass();
});
// Focus
cn("onfocus", function(){
focused = true;
setClass();
});
cn("onblur", function(){
focused = false;
setClass();
});
// Just in case widget is enabled/disabled while it has focus/hover/active state.
// Maybe this is overkill.
this.watch("disabled", setClass);
this.watch("readOnly", setClass);
}
}); });
dojo.forEach(["_onFocus","_onBlur"],function(ap){
this.connect(this,ap,"_setStateClass");
},this);
for(var ap in this.cssStateNodes){
this._trackMouseState(this[ap],this.cssStateNodes[ap]);
}
this._setStateClass();
},_cssMouseEvent:function(_3){
if(!this.disabled){
switch(_3.type){
case "mouseenter":
case "mouseover":
this._hovering=true;
this._active=this._mouseDown;
break;
case "mouseleave":
case "mouseout":
this._hovering=false;
this._active=false;
break;
case "mousedown":
this._active=true;
this._mouseDown=true;
var _4=this.connect(dojo.body(),"onmouseup",function(){
this._active=false;
this._mouseDown=false;
this._setStateClass();
this.disconnect(_4);
});
break;
}
this._setStateClass();
}
},_setStateClass:function(){
var _5=this.baseClass.split(" ");
function _6(_7){
_5=_5.concat(dojo.map(_5,function(c){
return c+_7;
}),"dijit"+_7);
};
if(!this.isLeftToRight()){
_6("Rtl");
}
if(this.checked){
_6("Checked");
}
if(this.state){
_6(this.state);
}
if(this.selected){
_6("Selected");
}
if(this.disabled){
_6("Disabled");
}else{
if(this.readOnly){
_6("ReadOnly");
}else{
if(this._active){
_6("Active");
}else{
if(this._hovering){
_6("Hover");
}
}
}
}
if(this._focused){
_6("Focused");
}
var tn=this.stateNode||this.domNode,_8={};
dojo.forEach(tn.className.split(" "),function(c){
_8[c]=true;
});
if("_stateClasses" in this){
dojo.forEach(this._stateClasses,function(c){
delete _8[c];
});
}
dojo.forEach(_5,function(c){
_8[c]=true;
});
var _9=[];
for(var c in _8){
_9.push(c);
}
tn.className=_9.join(" ");
this._stateClasses=_5;
},_trackMouseState:function(_a,_b){
var _c=false,_d=false,_e=false;
var _f=this,cn=dojo.hitch(this,"connect",_a);
function _10(){
var _11=("disabled" in _f&&_f.disabled)||("readonly" in _f&&_f.readonly);
dojo.toggleClass(_a,_b+"Hover",_c&&!_d&&!_11);
dojo.toggleClass(_a,_b+"Active",_d&&!_11);
dojo.toggleClass(_a,_b+"Focused",_e&&!_11);
};
cn("onmouseenter",function(){
_c=true;
_10();
});
cn("onmouseleave",function(){
_c=false;
_d=false;
_10();
});
cn("onmousedown",function(){
_d=true;
_10();
});
cn("onmouseup",function(){
_d=false;
_10();
});
cn("onfocus",function(){
_e=true;
_10();
});
cn("onblur",function(){
_e=false;
_10();
});
this.connect(this,"set",function(_12,_13){
if(_12=="disabled"||_12=="readOnly"){
_10();
}
});
}});
} }

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,208 +1,443 @@
/* /*
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,
this._docHandler=this.connect(dojo.doc,"onmouseup","_onDropDownMouseUp"); {
this.toggleDropDown(); // summary:
},_onDropDownMouseUp:function(e){ // Mixin for widgets that need drop down ability.
if(e&&this._docHandler){
this.disconnect(this._docHandler); // _buttonNode: [protected] DomNode
} // The button/icon/node to click to display the drop down.
var _1=this.dropDown,_2=false; // Can be set via a dojoAttachPoint assignment.
if(e&&this._opened){ // If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
var c=dojo.position(this._buttonNode,true); _buttonNode: null,
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; // _arrowWrapperNode: [protected] DomNode
while(t&&!_2){ // Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
if(dojo.hasClass(t,"dijitPopup")){ // on where the drop down is set to be positioned.
_2=true; // Can be set via a dojoAttachPoint assignment.
}else{ // If missing, then _buttonNode will be used.
t=t.parentNode; _arrowWrapperNode: null,
}
} // _popupStateNode: [protected] DomNode
if(_2){ // The node to set the popupActive class on.
t=e.target; // Can be set via a dojoAttachPoint assignment.
if(_1.onItemClick){ // If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
var _3; _popupStateNode: null,
while(t&&!(_3=dijit.byNode(t))){
t=t.parentNode; // _aroundNode: [protected] DomNode
} // The node to display the popup around.
if(_3&&_3.onClick&&_3.getParent){ // Can be set via a dojoAttachPoint assignment.
_3.getParent().onItemClick(_3,e); // If missing, then domNode will be used.
} _aroundNode: null,
}
return; // dropDown: [protected] Widget
} // The widget to display as a popup. This widget *must* be
} // defined before the startup function is called.
} dropDown: null,
if(this._opened&&_1.focus){
window.setTimeout(dojo.hitch(_1,"focus"),1); // autoWidth: [protected] Boolean
} // Set to true to make the drop down at least as wide as this
},_onDropDownClick:function(e){ // widget. Set to false if the drop down should just be its
if(this._stopClickEvents){ // default width
dojo.stopEvent(e); autoWidth: true,
}
},_setupDropdown:function(){ // forceWidth: [protected] Boolean
this._buttonNode=this._buttonNode||this.focusNode||this.domNode; // Set to true to make the drop down exactly as wide as this
this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode; // widget. Overrides autoWidth.
this._aroundNode=this._aroundNode||this.domNode; forceWidth: false,
this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");
this.connect(this._buttonNode,"onclick","_onDropDownClick"); // maxHeight: [protected] Integer
this.connect(this._buttonNode,"onkeydown","_onDropDownKeydown"); // The max height for our dropdown.
this.connect(this._buttonNode,"onkeyup","_onKey"); // Any dropdown taller than this will have scrollbars.
if(this._setStateClass){ // Set to 0 for no max height, or -1 to limit height to available space in viewport
this.connect(this,"openDropDown","_setStateClass"); maxHeight: 0,
this.connect(this,"closeDropDown","_setStateClass");
} // dropDownPosition: [const] String[]
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"; // This variable controls the position of the drop down.
dojo.addClass(this._arrowWrapperNode||this._buttonNode,"dijit"+_4+"ArrowButton"); // It's an array of strings with the following values:
},postCreate:function(){ //
this._setupDropdown(); // * before: places drop down to the left of the target node/widget, or to the right in
this.inherited(arguments); // the case of RTL scripts like Hebrew and Arabic
},destroyDescendants:function(){ // * after: places drop down to the right of the target node/widget, or to the left in
if(this.dropDown){ // the case of RTL scripts like Hebrew and Arabic
if(!this.dropDown._destroyed){ // * above: drop down goes above target node
this.dropDown.destroyRecursive(); // * below: drop down goes below target node
} //
delete this.dropDown; // The list is positions is tried, in order, until a position is found where the drop down fits
} // within the viewport.
this.inherited(arguments); //
},_onDropDownKeydown:function(e){ dropDownPosition: ["below","above"],
if(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE){
e.preventDefault(); // _stopClickEvents: Boolean
} // When set to false, the click events will not be stopped, in
},_onKey:function(e){ // case you want to use them in your subwidget
if(this.disabled||this.readOnly){ _stopClickEvents: true,
return;
} _onDropDownMouseDown: function(/*Event*/ e){
var d=this.dropDown; // summary:
if(d&&this._opened&&d.handleKey){ // Callback when the user mousedown's on the arrow icon
if(d.handleKey(e)===false){
return; if(this.disabled || this.readOnly){ return; }
}
} dojo.stopEvent(e);
if(d&&this._opened&&e.keyCode==dojo.keys.ESCAPE){
this.toggleDropDown(); this._docHandler = this.connect(dojo.doc, "onmouseup", "_onDropDownMouseUp");
}else{
if(d&&!this._opened&&(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE)){ this.toggleDropDown();
this.toggleDropDown(); },
if(d.focus){
setTimeout(dojo.hitch(d,"focus"),1); _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
},_onBlur:function(){ // dropDown node. If the event is missing, then we are not
this.closeDropDown(); // a mouseup event.
this.inherited(arguments); //
},isLoaded:function(){ // This is useful for the common mouse movement pattern
return true; // with native browser <select> nodes:
},loadDropDown:function(_5){ // 1. mouse down on the select node (probably on the arrow)
_5(); // 2. move mouse to a menu item while holding down the mouse button
},toggleDropDown:function(){ // 3. mouse up. this selects the menu item as though the user had clicked it.
if(this.disabled||this.readOnly){ if(e && this._docHandler){
return; this.disconnect(this._docHandler);
} }
this.focus(); var dropDown = this.dropDown, overMenu = false;
var _6=this.dropDown;
if(!_6){ if(e && this._opened){
return; // 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.
if(!this._opened){ // Find out if our target is somewhere in our dropdown widget,
if(!this.isLoaded()){ // but not over our _buttonNode (the clickable node)
this.loadDropDown(dojo.hitch(this,"openDropDown")); var c = dojo.position(this._buttonNode, true);
return; if(!(e.pageX >= c.x && e.pageX <= c.x + c.w) ||
}else{ !(e.pageY >= c.y && e.pageY <= c.y + c.h)){
this.openDropDown(); var t = e.target;
} while(t && !overMenu){
}else{ if(dojo.hasClass(t, "dijitPopup")){
this.closeDropDown(); overMenu = true;
} }else{
},openDropDown:function(){ t = t.parentNode;
var _7=this.dropDown; }
var _8=_7.domNode; }
var _9=this; if(overMenu){
if(!this._preparedNode){ t = e.target;
dijit.popup.moveOffScreen(_8); if(dropDown.onItemClick){
this._preparedNode=true; var menuItem;
if(_8.style.width){ while(t && !(menuItem = dijit.byNode(t))){
this._explicitDDWidth=true; t = t.parentNode;
} }
if(_8.style.height){ if(menuItem && menuItem.onClick && menuItem.getParent){
this._explicitDDHeight=true; menuItem.getParent().onItemClick(menuItem, e);
} }
} }
if(this.maxHeight||this.forceWidth||this.autoWidth){ return;
var _a={display:"",visibility:"hidden"}; }
if(!this._explicitDDWidth){ }
_a.width=""; }
} if(this._opened && dropDown.focus && dropDown.autoFocus !== false){
if(!this._explicitDDHeight){ // Focus the dropdown widget - do it on a delay so that we
_a.height=""; // don't steal our own focus.
} window.setTimeout(dojo.hitch(dropDown, "focus"), 1);
dojo.style(_8,_a); }
var mb=dojo.marginBox(_8); },
var _b=(this.maxHeight&&mb.h>this.maxHeight);
dojo.style(_8,{overflowX:"hidden",overflowY:_b?"auto":"hidden"}); _onDropDownClick: function(/*Event*/ e){
if(_b){ // the drop down was already opened on mousedown/keydown; just need to call stopEvent()
mb.h=this.maxHeight; if(this._stopClickEvents){
if("w" in mb){ dojo.stopEvent(e);
mb.w+=16; }
} },
}else{
delete mb.h; buildRendering: function(){
} this.inherited(arguments);
delete mb.t;
delete mb.l; this._buttonNode = this._buttonNode || this.focusNode || this.domNode;
if(this.forceWidth){ this._popupStateNode = this._popupStateNode || this.focusNode || this._buttonNode;
mb.w=this.domNode.offsetWidth;
}else{ // Add a class to the "dijitDownArrowButton" type class to _buttonNode so theme can set direction of arrow
if(this.autoWidth){ // based on where drop down will normally appear
mb.w=Math.max(mb.w,this.domNode.offsetWidth); var defaultPos = {
}else{ "after" : this.isLeftToRight() ? "Right" : "Left",
delete mb.w; "before" : this.isLeftToRight() ? "Left" : "Right",
} "above" : "Up",
} "below" : "Down",
if(dojo.isFunction(_7.resize)){ "left" : "Left",
_7.resize(mb); "right" : "Right"
}else{ }[this.dropDownPosition[0]] || this.dropDownPosition[0] || "Down";
dojo.marginBox(_8,mb); dojo.addClass(this._arrowWrapperNode || this._buttonNode, "dijit" + defaultPos + "ArrowButton");
} },
}
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(){ postCreate: function(){
_9.closeDropDown(true); // summary:
},onCancel:function(){ // set up nodes and connect our mouse and keypress events
_9.closeDropDown(true);
},onClose:function(){ this.inherited(arguments);
dojo.attr(_9._popupStateNode,"popupActive",false);
dojo.removeClass(_9._popupStateNode,"dijitHasDropDownOpen"); this.connect(this._buttonNode, "onmousedown", "_onDropDownMouseDown");
_9._opened=false; this.connect(this._buttonNode, "onclick", "_onDropDownClick");
_9.state=""; this.connect(this.focusNode, "onkeypress", "_onKey");
}}); this.connect(this.focusNode, "onkeyup", "_onKeyUp");
dojo.attr(this._popupStateNode,"popupActive","true"); },
dojo.addClass(_9._popupStateNode,"dijitHasDropDownOpen");
this._opened=true; destroy: function(){
this.state="Opened"; if(this.dropDown){
return _c; // Destroy the drop down, unless it's already been destroyed. This can happen because
},closeDropDown:function(_d){ // the drop down is a direct child of <body> even though it's logically my child.
if(this._opened){ if(!this.dropDown._destroyed){
if(_d){ this.dropDown.destroyRecursive();
this.focus(); }
} delete this.dropDown;
dijit.popup.close(this.dropDown); }
this._opened=false; this.inherited(arguments);
this.state=""; },
}
}}); _onKey: function(/*Event*/ e){
// summary:
// Callback when the user presses a key while focused on the button node
if(this.disabled || this.readOnly){ return; }
var d = this.dropDown, target = e.target;
if(d && this._opened && d.handleKey){
if(d.handleKey(e) === false){
/* false return code means that the drop down handled the key */
dojo.stopEvent(e);
return;
}
}
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();
var d = this.dropDown; // drop down may not exist until toggleDropDown() call
if(d && d.focus){
setTimeout(dojo.hitch(d, "focus"), 1);
}
}
},
_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);
},
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;
},
loadDropDown: function(/* Function */ loadCallback){
// summary:
// Loads the data for the dropdown, and at some point, calls
// the given callback. This is basically a callback when the
// user presses the down arrow button to open the drop down.
// tags:
// protected
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 we aren't loaded, load it first so there isn't a flicker
if(!this.isLoaded()){
this.loadDropDown(dojo.hitch(this, "openDropDown"));
return;
}else{
this.openDropDown();
}
}else{
this.closeDropDown();
}
},
openDropDown: function(){
// 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){
this._preparedNode = true;
// Check if we have explicitly set width and height on the dropdown widget dom node
if(ddNode.style.width){
this._explicitDDWidth = true;
}
if(ddNode.style.height){
this._explicitDDHeight = true;
}
}
// Code for resizing dropdown (height limitation, or increasing width to match my width)
if(this.maxHeight || this.forceWidth || this.autoWidth){
var myStyle = {
display: "",
visibility: "hidden"
};
if(!this._explicitDDWidth){
myStyle.width = "";
}
if(!this._explicitDDHeight){
myStyle.height = "";
}
dojo.style(ddNode, myStyle);
// Figure out maximum height allowed (if there is a height restriction)
var maxHeight = this.maxHeight;
if(maxHeight == -1){
// 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){
mb.w += 16; // room for vertical scrollbar
}
}else{
delete mb.h;
}
// Adjust dropdown width to match or be larger than my width
if(this.forceWidth){
mb.w = aroundNode.offsetWidth;
}else if(this.autoWidth){
mb.w = Math.max(mb.w, aroundNode.offsetWidth);
}else{
delete mb.w;
}
// And finally, resize the dropdown to calculated height and width
if(dojo.isFunction(dropDown.resize)){
dropDown.resize(mb);
}else{
dojo.marginBox(ddNode, mb);
}
}
var retVal = dijit.popup.open({
parent: this,
popup: dropDown,
around: aroundNode,
orient: dijit.getPopupAroundAlignment((this.dropDownPosition && this.dropDownPosition.length) ? this.dropDownPosition : ["below"],this.isLeftToRight()),
onExecute: function(){
self.closeDropDown(true);
},
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.addClass(self._popupStateNode, "dijitHasDropDownOpen");
this._opened=true;
// TODO: set this.checked and call setStateClass(), to affect button look while drop down is shown
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(focus){ this.focus(); }
dijit.popup.close(this.dropDown);
this._opened = false;
}
}
}
);
} }

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
this.connect(this.domNode,"onkeypress","_onContainerKeypress"); // postCreate() and call startupKeyNavChildren() in startup().
this.connect(this.domNode,"onfocus","_onContainerFocus"); // It provides normalized keyboard and focusing code for Container
},startupKeyNavChildren:function(){ // widgets.
dojo.forEach(this.getChildren(),dojo.hitch(this,"_startupChild")); /*=====
},addChild:function(_8,_9){ // focusedChild: [protected] Widget
dijit._KeyNavContainer.superclass.addChild.apply(this,arguments); // The currently focused child widget, or null if there isn't one
this._startupChild(_8); focusedChild: null,
},focus:function(){ =====*/
this.focusFirstChild();
},focusFirstChild:function(){ // tabIndex: Integer
var _a=this._getFirstFocusableChild(); // Tab index of the container; same as HTML tabIndex attribute.
if(_a){ // Note then when user tabs into the container, focus is immediately
this.focusChild(_a); // moved to the first item in the container.
} tabIndex: "0",
},focusNext:function(){
var _b=this._getNextFocusableChild(this.focusedChild,1); _keyNavCodes: {},
this.focusChild(_b);
},focusPrev:function(){ connectKeyNavHandlers: function(/*dojo.keys[]*/ prevKeyCodes, /*dojo.keys[]*/ nextKeyCodes){
var _c=this._getNextFocusableChild(this.focusedChild,-1); // summary:
this.focusChild(_c,true); // Call in postCreate() to attach the keyboard handlers
},focusChild:function(_d,_e){ // to the container.
if(this.focusedChild&&_d!==this.focusedChild){ // preKeyCodes: dojo.keys[]
this._onChildBlur(this.focusedChild); // Key codes for navigating to the previous child.
} // nextKeyCodes: dojo.keys[]
_d.focus(_e?"end":"start"); // Key codes for navigating to the next child.
this.focusedChild=_d; // tags:
},_startupChild:function(_f){ // protected
_f.set("tabIndex","-1");
this.connect(_f,"_onFocus",function(){ var keyCodes = (this._keyNavCodes = {});
_f.set("tabIndex",this.tabIndex); var prev = dojo.hitch(this, this.focusPrev);
}); var next = dojo.hitch(this, this.focusNext);
this.connect(_f,"_onBlur",function(){ dojo.forEach(prevKeyCodes, function(code){ keyCodes[code] = prev; });
_f.set("tabIndex","-1"); dojo.forEach(nextKeyCodes, function(code){ keyCodes[code] = next; });
}); keyCodes[dojo.keys.HOME] = dojo.hitch(this, "focusFirstChild");
},_onContainerFocus:function(evt){ keyCodes[dojo.keys.END] = dojo.hitch(this, "focusLastChild");
if(evt.target!==this.domNode){ this.connect(this.domNode, "onkeypress", "_onContainerKeypress");
return; this.connect(this.domNode, "onfocus", "_onContainerFocus");
} },
this.focusFirstChild();
dojo.attr(this.domNode,"tabIndex","-1"); startupKeyNavChildren: function(){
},_onBlur:function(evt){ // summary:
if(this.tabIndex){ // Call in startup() to set child tabindexes to -1
dojo.attr(this.domNode,"tabIndex",this.tabIndex); // tags:
} // protected
this.inherited(arguments); dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild"));
},_onContainerKeypress:function(evt){ },
if(evt.ctrlKey||evt.altKey){
return; addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
} // summary:
var _10=this._keyNavCodes[evt.charOrCode]; // Add a child to our _Container
if(_10){ dijit._KeyNavContainer.superclass.addChild.apply(this, arguments);
_10(); this._startupChild(widget);
dojo.stopEvent(evt); },
}
},_onChildBlur:function(_11){ focus: function(){
},_getFirstFocusableChild:function(){ // summary:
return this._getNextFocusableChild(null,1); // Default focus() implementation: focus the first child.
},_getNextFocusableChild:function(_12,dir){ this.focusFirstChild();
if(_12){ },
_12=this._getSiblingOfChild(_12,dir);
} focusFirstChild: function(){
var _13=this.getChildren(); // summary:
for(var i=0;i<_13.length;i++){ // Focus the first focusable child in the container.
if(!_12){ // tags:
_12=_13[(dir>0)?0:(_13.length-1)]; // protected
} var child = this._getFirstFocusableChild();
if(_12.isFocusable()){ if(child){ // edge case: Menu could be empty or hidden
return _12; this.focusChild(child);
} }
_12=this._getSiblingOfChild(_12,dir); },
}
return null; focusLastChild: function(){
}}); // summary:
// Focus the last focusable child in the container.
// tags:
// protected
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);
}
widget.set("tabIndex", this.tabIndex); // for IE focus outline to appear, must set tabIndex before focs
widget.focus(last ? "end" : "start");
this._set("focusedChild", widget);
},
_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(widget, "_onBlur", function(){
widget.set("tabIndex", "-1");
});
},
_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();
// 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");
},
_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){
dojo.attr(this.domNode, "tabIndex", this.tabIndex);
}
this.inherited(arguments);
},
_onContainerKeypress: function(evt){
// summary:
// When a key is pressed, if it's an arrow key etc. then
// it's handled here.
// tags:
// private
if(evt.ctrlKey || evt.altKey){ return; }
var func = this._keyNavCodes[evt.charOrCode];
if(func){
func();
dojo.stopEvent(evt);
}
},
_onChildBlur: function(/*dijit._Widget*/ widget){
// summary:
// Called when focus leaves a child widget to go
// 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 children = this.getChildren();
for(var i=0; i < children.length; i++){
if(!child){
child = children[(dir>0) ? 0 : (children.length-1)];
}
if(child.isFocusable()){
return child; // dijit._Widget
}
child = this._getSiblingOfChild(child, dir);
}
// 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){
this._cells=[];
var _3=this._blankGif; dojo.declare("dijit._PaletteMixin",
var _4=dojo.getObject(this.dyeClass); [dijit._CssStateMixin],
for(var _5=0;_5<_1.length;_5++){ {
var _6=dojo.create("tr",{tabIndex:"-1"},this.gridNode); // summary:
for(var _7=0;_7<_1[_5].length;_7++){ // A keyboard accessible palette, for picking a color/emoticon/etc.
var _8=_1[_5][_7]; // description:
if(_8){ // A mixin for a grid showing various entities, so the user can pick a certain entity.
var _9=new _4(_8);
var _a=dojo.create("td",{"class":this.cellClass,tabIndex:"-1",title:_2[_8]}); // defaultTimeout: Number
_9.fillCell(_a,_3); // Number of milliseconds before a held key or button becomes typematic
this.connect(_a,"ondijitclick","_onCellClick"); defaultTimeout: 500,
this._trackMouseState(_a,this.cellClass);
dojo.place(_a,_6); // timeoutChangeRate: Number
_a.index=this._cells.length; // Fraction of time used to change the typematic timer between events
this._cells.push({node:_a,dye:_9}); // 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,
}
this._xDim=_1[0].length; // value: String
this._yDim=_1.length; // Currently selected color/emoticon/etc.
var _b={UP_ARROW:-this._xDim,DOWN_ARROW:this._xDim,RIGHT_ARROW:this.isLeftToRight()?1:-1,LEFT_ARROW:this.isLeftToRight()?-1:1}; value: null,
for(var _c in _b){
this._connects.push(dijit.typematic.addKeyListener(this.domNode,{charOrCode:dojo.keys[_c],ctrlKey:false,altKey:false,shiftKey:false},this,function(){ // _selectedCell: [private] Integer
var _d=_b[_c]; // Index of the currently selected cell. Initially, none selected
return function(_e){ _selectedCell: -1,
this._navigateByKey(_d,_e);
}; /*=====
}(),this.timeoutChangeRate,this.defaultTimeout)); // _currentFocus: [private] DomNode
} // The currently focused cell (if the palette itself has focus), or otherwise
},postCreate:function(){ // the cell to be focused when the palette itself gets focus.
this.inherited(arguments); // Different from value, which represents the selected (i.e. clicked) cell.
this._setCurrent(this._cells[0].node); _currentFocus: null,
},focus:function(){ =====*/
dijit.focus(this._currentFocus);
},_onCellClick:function(_f){ /*=====
var _10=_f.currentTarget,_11=this._getDye(_10).getValue(); // _xDim: [protected] Integer
this._setCurrent(_10); // This is the number of cells horizontally across.
setTimeout(dojo.hitch(this,function(){ _xDim: null,
dijit.focus(_10); =====*/
this._setValueAttr(_11,true);
})); /*=====
dojo.removeClass(_10,"dijitPaletteCellHover"); // _yDim: [protected] Integer
dojo.stopEvent(_f); // This is the number of cells vertically down.
},_setCurrent:function(_12){ _yDim: null,
if("_currentFocus" in this){ =====*/
dojo.attr(this._currentFocus,"tabIndex","-1");
} // tabIndex: String
this._currentFocus=_12; // Widget tab index.
if(_12){ tabIndex: "0",
dojo.attr(_12,"tabIndex",this.tabIndex);
} // cellClass: [protected] String
},_setValueAttr:function(_13,_14){ // CSS class applied to each cell in the palette
this.value=null; cellClass: "dijitPaletteCell",
if(this._selectedCell>=0){
dojo.removeClass(this._cells[this._selectedCell].node,"dijitPaletteCellSelected"); // dyeClass: [protected] String
} // Name of javascript class for Object created for each cell of the palette.
this._selectedCell=-1; // dyeClass should implements dijit.Dye interface
if(_13){ dyeClass: '',
for(var i=0;i<this._cells.length;i++){
if(_13==this._cells[i].dye.getValue()){ _preparePalette: function(choices, titles, dyeClassObj) {
this._selectedCell=i; // summary:
this.value=_13; // Subclass must call _preparePalette() from postCreate(), passing in the tooltip
dojo.addClass(this._cells[i].node,"dijitPaletteCellSelected"); // for each cell
if(_14||_14===undefined){ // choices: String[][]
this.onChange(_13); // id's for each cell of the palette, used to create Dye JS object for each cell
} // titles: String[]
break; // Localized tooltip for each cell
} // dyeClassObj: Constructor?
} // If specified, use this constructor rather than this.dyeClass
}
},onChange:function(_15){ this._cells = [];
},_navigateByKey:function(_16,_17){ var url = this._blankGif;
if(_17==-1){
return; dyeClassObj = dyeClassObj || dojo.getObject(this.dyeClass);
}
var _18=this._currentFocus.index+_16; for(var row=0; row < choices.length; row++){
if(_18<this._cells.length&&_18>-1){ var rowNode = dojo.create("tr", {tabIndex: "-1"}, this.gridNode);
var _19=this._cells[_18].node; for(var col=0; col < choices[row].length; col++){
this._setCurrent(_19); var value = choices[row][col];
setTimeout(dojo.hitch(dijit,"focus",_19),0); if(value){
} var cellObject = new dyeClassObj(value, row, col);
},_getDye:function(_1a){
return this._cells[_1a.index].dye; var cellNode = dojo.create("td", {
}}); "class": this.cellClass,
tabIndex: "-1",
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 = choices[0].length;
this._yDim = choices.length;
// Now set all events
// The palette itself is navigated to with the tab key on the keyboard
// Keyboard navigation within the Palette is with the arrow keys
// Spacebar selects the cell.
// 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
};
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(){
this.inherited(arguments);
// Set initial navigable node.
this._setCurrent(this._cells[0].node);
},
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);
},
_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(){
dijit.focus(target);
this._setValueAttr(value, true);
}));
// workaround bug where hover class is not removed on popup because the popup is
// 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){
// Remove tabIndex on old cell
dojo.attr(this._currentFocus, "tabIndex", "-1");
}
// Set tabIndex of new cell
this._currentFocus = node;
if(node){
dojo.attr(node, "tabIndex", this.tabIndex);
}
},
_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){
dojo.removeClass(this._cells[this._selectedCell].node, "dijitPaletteCellSelected");
}
this._selectedCell = -1;
// search for cell matching specified value
if(value){
for(var i = 0; i < this._cells.length; i++){
if(value == this._cells[i].dye.getValue()){
this._selectedCell = i;
dojo.addClass(this._cells[i].node, "dijitPaletteCellSelected");
break;
}
}
}
// record new value, or null if no matching cell
this._set("value", this._selectedCell >= 0 ? value : null);
if(priorityChange || priorityChange === undefined){
this.onChange(value);
}
},
onChange: function(value){
// summary:
// 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(/*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(){
this._attachPoints=[];
},_stringRepl:function(_1){ dojo.declare("dijit._Templated",
var _2=this.declaredClass,_3=this; null,
return dojo.string.substitute(_1,this,function(_4,_5){ {
if(_5.charAt(0)=="!"){ // summary:
_4=dojo.getObject(_5.substr(1),false,_3); // Mixin for widgets that are instantiated from a template
}
if(typeof _4=="undefined"){ // templateString: [protected] String
throw new Error(_2+" template:"+_5); // A string that represents the widget template. Pre-empts the
} // templatePath. In builds that have their strings "interned", the
if(_4==null){ // templatePath is converted to an inline templateString, thereby
return ""; // preventing a synchronous network call.
} //
return _5.charAt(0)=="!"?_4:_4.toString().replace(/"/g,"&quot;"); // Use in conjunction with dojo.cache() to load from a file.
},this); templateString: null,
},buildRendering:function(){
var _6=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache); // templatePath: [protected deprecated] String
var _7; // Path to template (HTML file) for this widget relative to dojo.baseUrl.
if(dojo.isString(_6)){ // Deprecated: use templateString with dojo.cache() instead.
_7=dojo._toDom(this._stringRepl(_6)); templatePath: null,
if(_7.nodeType!=1){
throw new Error("Invalid template: "+_6); // widgetsInTemplate: [protected] Boolean
} // Should we parse the template to find widgets that might be
}else{ // declared in markup inside it? False by default.
_7=_6.cloneNode(true); widgetsInTemplate: false,
}
this.domNode=_7; // skipNodeCache: [protected] Boolean
this._attachTemplateNodes(_7); // If using a cached widget template node poses issues for a
if(this.widgetsInTemplate){ // particular widget class, it can set this property to ensure
var _8=dojo.parser,_9,_a; // that its template is always re-built from a string
if(_8._query!="[dojoType]"){ _skipNodeCache: false,
_9=_8._query;
_a=_8._attrName; // _earlyTemplatedStartup: Boolean
_8._query="[dojoType]"; // A fallback to preserve the 1.0 - 1.3 behavior of children in
_8._attrName="dojoType"; // templates having their startup called before the parent widget
} // fires postCreate. Defaults to 'false', causing child widgets to
var cw=(this._startupWidgets=dojo.parser.parse(_7,{noStart:!this._earlyTemplatedStartup,inherited:{dir:this.dir,lang:this.lang}})); // have their .startup() called immediately before a parent widget
if(_9){ // .startup(), but always after the parent .postCreate(). Set to
_8._query=_9; // 'true' to re-enable to previous, arguably broken, behavior.
_8._attrName=_a; _earlyTemplatedStartup: false,
}
this._supportingWidgets=dijit.findWidgets(_7); /*=====
this._attachTemplateNodes(cw,function(n,p){ // _attachPoints: [private] String[]
return n[p]; // List of widget attribute names associated with dojoAttachPoint=... in the
}); // template, ex: ["containerNode", "labelNode"]
} _attachPoints: [],
this._fillContent(this.srcNodeRef); =====*/
},_fillContent:function(_b){
var _c=this.containerNode; /*=====
if(_b&&_c){ // _attachEvents: [private] Handle[]
while(_b.hasChildNodes()){ // List of connections associated with dojoAttachEvent=... in the
_c.appendChild(_b.firstChild); // template
} _attachEvents: [],
} =====*/
},_attachTemplateNodes:function(_d,_e){
_e=_e||function(n,p){ constructor: function(){
return n.getAttribute(p); this._attachPoints = [];
}; this._attachEvents = [];
var _f=dojo.isArray(_d)?_d:(_d.all||_d.getElementsByTagName("*")); },
var x=dojo.isArray(_d)?0:-1;
for(;x<_f.length;x++){ _stringRepl: function(tmpl){
var _10=(x==-1)?_d:_f[x]; // summary:
if(this.widgetsInTemplate&&_e(_10,"dojoType")){ // Does substitution of ${foo} type properties in template string
continue; // tags:
} // private
var _11=_e(_10,"dojoAttachPoint"); var className = this.declaredClass, _this = this;
if(_11){ // Cache contains a string because we need to do property replacement
var _12,_13=_11.split(/\s*,\s*/); // do the property replacement
while((_12=_13.shift())){ return dojo.string.substitute(tmpl, this, function(value, key){
if(dojo.isArray(this[_12])){ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
this[_12].push(_10); if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
}else{ if(value == null){ return ""; }
this[_12]=_10;
} // Substitution keys beginning with ! will skip the transform step,
this._attachPoints.push(_12); // in case a user wishes to insert unescaped markup, e.g. ${!foo}
} return key.charAt(0) == "!" ? value :
} // Safer substitution, see heading "Attribute values" in
var _14=_e(_10,"dojoAttachEvent"); // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
if(_14){ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
var _15,_16=_14.split(/\s*,\s*/); }, this);
var _17=dojo.trim; },
while((_15=_16.shift())){
if(_15){ buildRendering: function(){
var _18=null; // summary:
if(_15.indexOf(":")!=-1){ // Construct the UI for this widget from a template, setting this.domNode.
var _19=_15.split(":"); // tags:
_15=_17(_19[0]); // protected
_18=_17(_19[1]);
}else{ // Lookup cached version of template, and download to cache if it
_15=_17(_15); // isn't there already. Returns either a DomNode or a string, depending on
} // whether or not the template contains ${foo} replacement parameters.
if(!_18){ var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
_18=_15;
} var node;
this.connect(_10,_15,_18); 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)
var _1a=_e(_10,"waiRole"); throw new Error("Invalid template: " + cached);
if(_1a){ }
dijit.setWaiRole(_10,_1a); }else{
} // if it's a node, all we have to do is clone it
var _1b=_e(_10,"waiState"); node = cached.cloneNode(true);
if(_1b){ }
dojo.forEach(_1b.split(/\s*,\s*/),function(_1c){
if(_1c.indexOf("-")!=-1){ this.domNode = node;
var _1d=_1c.split("-");
dijit.setWaiState(_10,_1d[0],_1d[1]); // 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
},startup:function(){ // attachment points and events, which should be defined on the template node.
dojo.forEach(this._startupWidgets,function(w){ this._attachTemplateNodes(node);
if(w&&!w._started&&w.startup){
w.startup(); if(this.widgetsInTemplate){
} // Store widgets that we need to start at a later point in time
}); var cw = (this._startupWidgets = dojo.parser.parse(node, {
this.inherited(arguments); noStart: !this._earlyTemplatedStartup,
},destroyRendering:function(){ template: true,
dojo.forEach(this._attachPoints,function(_1e){ inherited: {dir: this.dir, lang: this.lang},
delete this[_1e]; propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me
},this); scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type
this._attachPoints=[]; }));
this.inherited(arguments);
}}); this._supportingWidgets = dijit.findWidgets(node);
dijit._Templated._templateCache={};
dijit._Templated.getCachedTemplate=function(_1f,_20,_21){ this._attachTemplateNodes(cw, function(n,p){
var _22=dijit._Templated._templateCache; return n[p];
var key=_20||_1f; });
var _23=_22[key]; }
if(_23){
try{ this._fillContent(this.srcNodeRef);
if(!_23.ownerDocument||_23.ownerDocument==dojo.doc){ },
return _23;
} _fillContent: function(/*DomNode*/ source){
} // summary:
catch(e){ // Relocate source contents to templated container node.
} // this.containerNode must be able to receive children, or exceptions will be thrown.
dojo.destroy(_23); // tags:
} // protected
if(!_20){ var dest = this.containerNode;
_20=dojo.cache(_1f,{sanitize:true}); if(source && dest){
} while(source.hasChildNodes()){
_20=dojo.string.trim(_20); dest.appendChild(source.firstChild);
if(_21||_20.match(/\$\{([^\}]+)\}/g)){ }
return (_22[key]=_20); }
}else{ },
var _24=dojo._toDom(_20);
if(_24.nodeType!=1){ _attachTemplateNodes: function(rootNode, getAttrFunc){
throw new Error("Invalid template: "+_20); // summary:
} // Iterate through the template and attach functions and nodes accordingly.
return (_22[key]=_24); // Alternately, if rootNode is an array of widgets, then will process dojoAttachPoint
} // etc. for those widgets.
// description:
// 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;
}
// Process dojoAttachPoint
var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
if(attachPoint){
var point, points = attachPoint.split(/\s*,\s*/);
while((point = points.shift())){
if(dojo.isArray(this[point])){
this[point].push(baseNode);
}else{
this[point]=baseNode;
}
this._attachPoints.push(point);
}
}
// Process dojoAttachEvent
var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");;
if(attachEvent){
// NOTE: we want to support attributes that have the form
// "domEvent: nativeEvent; ..."
var event, events = attachEvent.split(/\s*,\s*/);
var trim = dojo.trim;
while((event = events.shift())){
if(event){
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{
event = trim(event);
}
if(!thisFunc){
thisFunc = event;
}
this._attachEvents.push(this.connect(baseNode, event, thisFunc));
}
}
}
// waiRole, waiState
// 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 values = getAttrFunc(baseNode, "waiState");
if(values){
dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
if(stateValue.indexOf('-') != -1){
var pair = stateValue.split('-');
dijit.setWaiState(baseNode, pair[0], pair[1]);
}
});
}
}
},
startup: function(){
dojo.forEach(this._startupWidgets, function(w){
if(w && !w._started && w.startup){
w.startup();
}
});
this.inherited(arguments);
},
destroyRendering: function(){
// Delete all attach points to prevent IE6 memory leaks.
dojo.forEach(this._attachPoints, function(point){
delete this[point];
}, this);
this._attachPoints = [];
// And same for event handlers
dojo.forEach(this._attachEvents, this.disconnect, this);
this._attachEvents = [];
this.inherited(arguments);
}
}
);
// key is either templatePath or templateString; object is either string or DOM tree
dijit._Templated._templateCache = {};
dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
// summary:
// Static method to get a template based on the templatePath or
// 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{
// 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
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);
}
// If necessary, load template string from template path
if(!templateString){
templateString = dojo.cache(templatePath, {sanitize: true});
}
templateString = dojo.string.trim(templateString);
if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
// there are variables in the template so all we can do is cache the string
return (tmplts[key] = templateString); //String
}else{
// there are no variables in the template so we can cache the DOM tree
var node = dojo._toDom(templateString);
if(node.nodeType != 1){
throw new Error("Invalid template: " + templateString);
}
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];
}
});
} }
// 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:""
}); });
}
dojo.extend(dijit._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});
} }

View File

@@ -1,265 +1,481 @@
/* /*
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.deprecated("dijit._TimePicker:setValue() is deprecated. Use set('value', ...) instead.","","2.0");
this.set("value",_1); /*=====
},_setValueAttr:function(_2){ dojo.declare(
this.value=_2; "dijit._TimePicker.__Constraints",
this._showText(); dojo.date.locale.__FormatOptions,
},onOpen:function(_3){ {
if(this._beenOpened&&this.domNode.parentNode){ // clickableIncrement: String
var p=dijit.byId(this.domNode.parentNode.dijitPopupParent); // See `dijit._TimePicker.clickableIncrement`
if(p){ clickableIncrement: "T00:15:00",
var _4=p.get("displayedValue");
if(_4&&!p.parse(_4,p.constraints)){ // visibleIncrement: String
this._filterString=_4; // See `dijit._TimePicker.visibleIncrement`
}else{ visibleIncrement: "T01:00:00",
this._filterString="";
} // visibleRange: String
this._showText(); // See `dijit._TimePicker.visibleRange`
} visibleRange: "T05:00:00"
} }
this._beenOpened=true; );
},isDisabledDate:function(_5,_6){ =====*/
return false;
},_getFilteredNodes:function(_7,_8,_9){ dojo.declare("dijit._TimePicker",
var _a=[],n,i=_7,_b=this._maxIncrement+Math.abs(i),_c=_9?-1:1,_d=_9?1:0,_e=_9?0:1; [dijit._Widget, dijit._Templated],
do{ {
i=i-_d; // summary:
n=this._createOption(i); // A graphical time picker.
if(n){ // This widget is used internally by other widgets and is not available
_a.push(n); // as a standalone widget due to lack of accessibility support.
}
i=i+_e; 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"),
}while(_a.length<_8&&(i*_c)<_b);
if(_9){ // baseClass: [protected] String
_a.reverse(); // The root className to use for the various states of this widget
} baseClass: "dijitTimePicker",
return _a;
},_showText:function(){ // clickableIncrement: String
this.timeMenu.innerHTML=""; // ISO-8601 string representing the amount by which
var _f=dojo.date.stamp.fromISOString; // every clickable element in the time picker increases.
this._clickableIncrementDate=_f(this.clickableIncrement); // Set in local time, without a time zone.
this._visibleIncrementDate=_f(this.visibleIncrement); // Example: `T00:15:00` creates 15 minute increments
this._visibleRangeDate=_f(this.visibleRange); // Must divide dijit._TimePicker.visibleIncrement evenly
var _10=function(_11){ clickableIncrement: "T00:15:00",
return _11.getHours()*60*60+_11.getMinutes()*60+_11.getSeconds();
}; // visibleIncrement: String
var _12=_10(this._clickableIncrementDate); // ISO-8601 string representing the amount by which
var _13=_10(this._visibleIncrementDate); // every element with a visible time in the time picker increases.
var _14=_10(this._visibleRangeDate); // Set in local time, without a time zone.
var _15=this.value.getTime(); // Example: `T01:00:00` creates text in every 1 hour increment
this._refDate=new Date(_15-_15%(_13*1000)); visibleIncrement: "T01:00:00",
this._refDate.setFullYear(1970,0,1);
this._clickableIncrement=1; // visibleRange: String
this._totalIncrements=_14/_12; // ISO-8601 string representing the range of this TimePicker.
this._visibleIncrement=_13/_12; // The TimePicker will only display times in this range.
this._maxIncrement=(60*60*24)/_12; // Example: `T05:00:00` displays 5 hours of options
var _16=this._getFilteredNodes(0,this._totalIncrements>>1,true); visibleRange: "T05:00:00",
var _17=this._getFilteredNodes(0,this._totalIncrements>>1,false);
if(_16.length<this._totalIncrements>>1){ // value: String
_16=_16.slice(_16.length/2); // Date to display.
_17=_17.slice(0,_17.length/2); // Defaults to current time and date.
} // Can be a Date object or an ISO-8601 string.
dojo.forEach(_16.concat(_17),function(n){ // If you specify the GMT time zone (`-01:00`),
this.timeMenu.appendChild(n); // the time will be converted to the local time in the local time zone.
},this); // Otherwise, the time is considered to be in the local time zone.
},postCreate:function(){ // If you specify the date and isDate is true, the date is used.
if(this.constraints===dijit._TimePicker.prototype.constraints){ // Example: if your local time zone is `GMT -05:00`,
this.constraints={}; // `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),
dojo.mixin(this,this.constraints); // `T10:00:00Z` becomes `T05:00:00-05:00` (5 hour difference between Zulu and local time)
if(!this.constraints.locale){ // `yyyy-mm-ddThh:mm:ss` is the format to set the date and time
this.constraints.locale=this.lang; // Example: `2007-06-01T09:00:00`
} value: new Date(),
this.connect(this.timeMenu,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled");
var _18=this; _visibleIncrement:2,
var _19=function(){ _clickableIncrement:1,
_18._connects.push(dijit.typematic.addMouseListener.apply(null,arguments)); _totalIncrements:10,
};
_19(this.upArrow,this,this._onArrowUp,1,50); // constraints: dijit._TimePicker.__Constraints
_19(this.downArrow,this,this._onArrowDown,1,50); // Specifies valid range of times (start time, end time)
var _1a=function(cb){ constraints:{},
return function(cnt){
if(cnt>0){ /*=====
cb.call(this,arguments); serialize: function(val, options){
} // summary:
}; // User overridable function used to convert the attr('value') result to a String
}; // val: Date
var _1b=function(_1c,cb){ // The current value
return function(e){ // options: Object?
dojo.stopEvent(e); // tags:
dijit.typematic.trigger(e,this,_1c,_1a(cb),_1c,1,50); // protected
}; },
}; =====*/
this.connect(this.upArrow,"onmouseover",_1b(this.upArrow,this._onArrowUp)); serialize: dojo.date.stamp.toISOString,
this.connect(this.downArrow,"onmouseover",_1b(this.downArrow,this._onArrowDown));
this.inherited(arguments); /*=====
},_buttonMouse:function(e){ // filterString: string
dojo.toggleClass(e.currentTarget,e.currentTarget==this.upArrow?"dijitUpArrowHover":"dijitDownArrowHover",e.type=="mouseenter"||e.type=="mouseover"); // The string to filter by
},_createOption:function(_1d){ filterString: "",
var _1e=new Date(this._refDate); =====*/
var _1f=this._clickableIncrementDate;
_1e.setHours(_1e.getHours()+_1f.getHours()*_1d,_1e.getMinutes()+_1f.getMinutes()*_1d,_1e.getSeconds()+_1f.getSeconds()*_1d); setValue: function(/*Date*/ value){
if(this.constraints.selector=="time"){ // summary:
_1e.setFullYear(1970,0,1); // Deprecated. Used set('value') instead.
} // tags:
var _20=dojo.date.locale.format(_1e,this.constraints); // deprecated
if(this._filterString&&_20.toLowerCase().indexOf(this._filterString)!==0){ dojo.deprecated("dijit._TimePicker:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
return null; this.set('value', value);
} },
var div=dojo.create("div",{"class":this.baseClass+"Item"});
div.date=_1e; _setValueAttr: function(/*Date*/ date){
div.index=_1d; // summary:
dojo.create("div",{"class":this.baseClass+"ItemInner",innerHTML:_20},div); // Hook so set('value', ...) works.
if(_1d%this._visibleIncrement<1&&_1d%this._visibleIncrement>-1){ // description:
dojo.addClass(div,this.baseClass+"Marker"); // Set the value of the TimePicker.
}else{ // Redraws the TimePicker around the new date.
if(!(_1d%this._clickableIncrement)){ // tags:
dojo.addClass(div,this.baseClass+"Tick"); // protected
} this._set("value", date);
} this._showText();
if(this.isDisabledDate(_1e)){ },
dojo.addClass(div,this.baseClass+"ItemDisabled");
} _setFilterStringAttr: function(val){
if(!dojo.date.compare(this.value,_1e,this.constraints.selector)){ // summary:
div.selected=true; // Called by TimeTextBox to filter the values shown in my list
dojo.addClass(div,this.baseClass+"ItemSelected"); this._set("filterString", val);
if(dojo.hasClass(div,this.baseClass+"Marker")){ this._showText();
dojo.addClass(div,this.baseClass+"MarkerSelected"); },
}else{
dojo.addClass(div,this.baseClass+"TickSelected"); isDisabledDate: function(/*Date*/ dateObject, /*String?*/ locale){
} // summary:
} // May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend`
return div; // type:
},_onOptionSelected:function(tgt){ // extension
var _21=tgt.target.date||tgt.target.parentNode.date; return false; // Boolean
if(!_21||this.isDisabledDate(_21)){ },
return;
} _getFilteredNodes: function(/*number*/ start, /*number*/ maxNum, /*Boolean*/ before, /*DOMnode*/ lastNode){
this._highlighted_option=null; // summary:
this.set("value",_21); // Returns an array of nodes with the filter applied. At most maxNum nodes
this.onValueSelected(_21); // will be returned - but fewer may be returned as well. If the
},onValueSelected:function(_22){ // before parameter is set to true, then it will return the elements
},_highlightOption:function(_23,_24){ // before the given index
if(!_23){ // tags:
return; // private
} var
if(_24){ nodes = [],
if(this._highlighted_option){ lastValue = lastNode ? lastNode.date : this._refDate,
this._highlightOption(this._highlighted_option,false); n,
} i = start,
this._highlighted_option=_23; max = this._maxIncrement + Math.abs(i),
}else{ chk = before ? -1 : 1,
if(this._highlighted_option!==_23){ dec = before ? 1 : 0,
return; inc = 1 - dec;
}else{ do{
this._highlighted_option=null; i = i - dec;
} n = this._createOption(i);
} if(n){
dojo.toggleClass(_23,this.baseClass+"ItemHover",_24); if((before && n.date > lastValue) || (!before && n.date < lastValue)){
if(dojo.hasClass(_23,this.baseClass+"Marker")){ break; // don't wrap
dojo.toggleClass(_23,this.baseClass+"MarkerHover",_24); }
}else{ nodes[before ? "unshift" : "push"](n);
dojo.toggleClass(_23,this.baseClass+"TickHover",_24); lastValue = n.date;
} }
},onmouseover:function(e){ i = i + inc;
this._keyboardSelected=null; }while(nodes.length < maxNum && (i*chk) < max);
var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode; return nodes;
if(!dojo.hasClass(tgr,this.baseClass+"Item")){ },
return;
} _showText: function(){
this._highlightOption(tgr,true); // summary:
},onmouseout:function(e){ // Displays the relevant choices in the drop down list
this._keyboardSelected=null; // tags:
var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode; // private
this._highlightOption(tgr,false); var fromIso = dojo.date.stamp.fromISOString;
},_mouseWheeled:function(e){ this.timeMenu.innerHTML = "";
this._keyboardSelected=null; this._clickableIncrementDate=fromIso(this.clickableIncrement);
dojo.stopEvent(e); this._visibleIncrementDate=fromIso(this.visibleIncrement);
var _25=(dojo.isIE?e.wheelDelta:-e.detail); this._visibleRangeDate=fromIso(this.visibleRange);
this[(_25>0?"_onArrowUp":"_onArrowDown")](); // get the value of the increments and the range in seconds (since 00:00:00) to find out how many divs to create
},_onArrowUp:function(_26){ var
if(typeof _26=="number"&&_26==-1){ sinceMidnight = function(/*Date*/ date){
return; return date.getHours() * 60 * 60 + date.getMinutes() * 60 + date.getSeconds();
} },
if(!this.timeMenu.childNodes.length){ clickableIncrementSeconds = sinceMidnight(this._clickableIncrementDate),
return; visibleIncrementSeconds = sinceMidnight(this._visibleIncrementDate),
} visibleRangeSeconds = sinceMidnight(this._visibleRangeDate),
var _27=this.timeMenu.childNodes[0].index;
var _28=this._getFilteredNodes(_27,1,true); // round reference date to previous visible increment
if(_28.length){ time = (this.value || this.currentFocus).getTime();
this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length-1]);
this.timeMenu.insertBefore(_28[0],this.timeMenu.childNodes[0]); this._refDate = new Date(time - time % (visibleIncrementSeconds*1000));
} this._refDate.setFullYear(1970,0,1); // match parse defaults
},_onArrowDown:function(_29){
if(typeof _29=="number"&&_29==-1){ // assume clickable increment is the smallest unit
return; this._clickableIncrement = 1;
} // divide the visible range by the clickable increment to get the number of divs to create
if(!this.timeMenu.childNodes.length){ // example: 10:00:00/00:15:00 -> display 40 divs
return; this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds;
} // divide the visible increments by the clickable increments to get how often to display the time inline
var _2a=this.timeMenu.childNodes[this.timeMenu.childNodes.length-1].index+1; // example: 01:00:00/00:15:00 -> display the time every 4 divs
var _2b=this._getFilteredNodes(_2a,1,false); this._visibleIncrement = visibleIncrementSeconds / clickableIncrementSeconds;
if(_2b.length){ // divide the number of seconds in a day by the clickable increment in seconds to get the
this.timeMenu.removeChild(this.timeMenu.childNodes[0]); // absolute max number of increments.
this.timeMenu.appendChild(_2b[0]); this._maxIncrement = (60 * 60 * 24) / clickableIncrementSeconds;
}
},handleKey:function(e){ var
var dk=dojo.keys; // Find the nodes we should display based on our filter.
if(e.keyChar||e.charOrCode===dk.BACKSPACE||e.charOrCode==dk.DELETE){ // Limit to 10 nodes displayed as a half-hearted attempt to stop drop down from overlapping <input>.
setTimeout(dojo.hitch(this,function(){ after = this._getFilteredNodes(0, Math.min(this._totalIncrements >> 1, 10) - 1),
this._filterString=e.target.value.toLowerCase(); before = this._getFilteredNodes(0, Math.min(this._totalIncrements, 10) - after.length, true, after[0]);
this._showText(); dojo.forEach(before.concat(after), function(n){this.timeMenu.appendChild(n);}, this);
}),1); },
}else{
if(e.charOrCode==dk.DOWN_ARROW||e.charOrCode==dk.UP_ARROW){ constructor: function(){
dojo.stopEvent(e); this.constraints = {}; // create instance object
if(this._highlighted_option&&!this._highlighted_option.parentNode){ },
this._highlighted_option=null;
} postMixInProperties: function(){
var _2c=this.timeMenu,tgt=this._highlighted_option||dojo.query("."+this.baseClass+"ItemSelected",_2c)[0]; this.inherited(arguments);
if(!tgt){ this._setConstraintsAttr(this.constraints); // this needs to happen now (and later) due to codependency on _set*Attr calls
tgt=_2c.childNodes[0]; },
}else{
if(_2c.childNodes.length){ _setConstraintsAttr: function(/* Object */ constraints){
if(e.charOrCode==dk.DOWN_ARROW&&!tgt.nextSibling){ // brings in visibleRange, increments, etc.
this._onArrowDown(); dojo.mixin(this, constraints);
}else{
if(e.charOrCode==dk.UP_ARROW&&!tgt.previousSibling){ // dojo.date.locale needs the lang in the constraints as locale
this._onArrowUp(); if(!constraints.locale){
} constraints.locale = this.lang;
} }
if(e.charOrCode==dk.DOWN_ARROW){ },
tgt=tgt.nextSibling;
}else{ postCreate: function(){
tgt=tgt.previousSibling; // 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._highlightOption(tgt,true);
this._keyboardSelected=tgt; this.inherited(arguments);
}else{ },
if(this._highlighted_option&&(e.charOrCode==dk.ENTER||e.charOrCode===dk.TAB)){
if(!this._keyboardSelected&&e.charOrCode===dk.TAB){ _buttonMouse: function(/*Event*/ e){
return; // summary:
} // Handler for hover (and unhover) on up/down arrows
if(e.charOrCode==dk.ENTER){ // tags:
dojo.stopEvent(e); // private
}
this._onOptionSelected({target:this._highlighted_option}); // 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;
}
var div = dojo.create("div", {"class": this.baseClass+"Item"});
div.date = date;
div.index = index;
dojo.create('div',{
"class": this.baseClass + "ItemInner",
innerHTML: dateString
}, div);
if(index%this._visibleIncrement<1 && index%this._visibleIncrement>-1){
dojo.addClass(div, this.baseClass+"Marker");
}else if(!(index%this._clickableIncrement)){
dojo.addClass(div, this.baseClass+"Tick");
}
if(this.isDisabledDate(date)){
// set disabled
dojo.addClass(div, this.baseClass+"ItemDisabled");
}
if(this.value && !dojo.date.compare(this.value, date, this.constraints.selector)){
div.selected = true;
dojo.addClass(div, this.baseClass+"ItemSelected");
if(dojo.hasClass(div, this.baseClass+"Marker")){
dojo.addClass(div, this.baseClass+"MarkerSelected");
}else{
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;
},
_onOptionSelected: function(/*Object*/ tgt){
// 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.set('value', tdate);
this.onChange(tdate);
},
onChange: function(/*Date*/ time){
// summary:
// Notification that a time was selected. It may be the same as the previous value.
// 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){
this._highlightOption(this._highlighted_option, false);
}
this._highlighted_option = node;
}else if(this._highlighted_option !== node){
return;
}else{
this._highlighted_option = null;
}
dojo.toggleClass(node, this.baseClass+"ItemHover", highlight);
if(dojo.hasClass(node, this.baseClass+"Marker")){
dojo.toggleClass(node, this.baseClass+"MarkerHover", highlight);
}else{
dojo.toggleClass(node, this.baseClass+"TickHover", highlight);
}
},
onmouseover: function(/*Event*/ e){
// summary:
// Handler for onmouseover event
// tags:
// private
this._keyboardSelected = null;
var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
// if we aren't targeting an item, then we return
if(!dojo.hasClass(tgr, this.baseClass+"Item")){return;}
this._highlightOption(tgr, true);
},
onmouseout: function(/*Event*/ e){
// summary:
// Handler for onmouseout event
// tags:
// private
this._keyboardSelected = null;
var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
this._highlightOption(tgr, false);
},
_mouseWheeled: function(/*Event*/ e){
// summary:
// Handle the mouse wheel events
// tags:
// private
this._keyboardSelected = null;
dojo.stopEvent(e);
// we're not _measuring_ the scroll amount, just direction
var scrollAmount = (dojo.isIE ? e.wheelDelta : -e.detail);
this[(scrollAmount>0 ? "_onArrowUp" : "_onArrowDown")](); // yes, we're making a new dom node every time you mousewheel, or click
},
_onArrowUp: function(count){
// summary:
// Handler for up arrow key.
// description:
// Removes the bottom time and add one to the top
// tags:
// 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.insertBefore(divs[0], this.timeMenu.childNodes[0]);
}
},
_onArrowDown: function(count){
// summary:
// Handler for up arrow key.
// description:
// Remove the top time and add one to the bottom
// tags:
// private
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.appendChild(divs[0]);
}
},
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;
if(e.charOrCode == dk.DOWN_ARROW || e.charOrCode == dk.UP_ARROW){
dojo.stopEvent(e);
// Figure out which option to highlight now and then highlight it
if(this._highlighted_option && !this._highlighted_option.parentNode){
this._highlighted_option = null;
}
var timeMenu = this.timeMenu,
tgt = this._highlighted_option || dojo.query("." + this.baseClass + "ItemSelected", timeMenu)[0];
if(!tgt){
tgt = timeMenu.childNodes[0];
}else if(timeMenu.childNodes.length){
if(e.charOrCode == dk.DOWN_ARROW && !tgt.nextSibling){
this._onArrowDown();
}else if(e.charOrCode == dk.UP_ARROW && !tgt.previousSibling){
this._onArrowUp();
}
if(e.charOrCode == dk.DOWN_ARROW){
tgt = tgt.nextSibling;
}else{
tgt = tgt.previousSibling;
}
}
this._highlightOption(tgt, true);
this._keyboardSelected = tgt;
return false;
}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){
return true; // true means don't call stopEvent()
}
// Accept the currently-highlighted option as the value
if(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 ///////////////////
});
dijit._connectOnUseEventHandler=function(_3){ // 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.
dijit._lastKeyDownNode=null; dojo.connect(dojo, "_connect",
function(/*dijit._Widget*/ widget, /*String*/ event){
if(widget && dojo.isFunction(widget._onConnect)){
widget._onConnect(event);
}
});
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;
if(dojo.isIE){ if(dojo.isIE){
(function(){
var keydownCallback = function(evt){
dijit._lastKeyDownNode = evt.srcElement;
};
dojo.doc.attachEvent('onkeydown', keydownCallback);
dojo.addOnWindowUnload(function(){
dojo.doc.detachEvent('onkeydown', keydownCallback);
});
})();
}else{
dojo.doc.addEventListener('keydown', function(evt){
dijit._lastKeyDownNode = evt.target;
}, true);
}
(function(){ (function(){
var _4=function(_5){
dijit._lastKeyDownNode=_5.srcElement; dojo.declare("dijit._Widget", dijit._WidgetBase, {
}; // summary:
dojo.doc.attachEvent("onkeydown",_4); // Base class for all Dijit widgets.
dojo.addOnWindowUnload(function(){ //
dojo.doc.detachEvent("onkeydown",_4); // Extends _WidgetBase, adding support for:
// - deferred connections
// A call like dojo.connect(myWidget, "onMouseMove", func)
// will essentially do a dojo.connect(myWidget.domNode, "onMouseMove", func)
// - ondijitclick
// Support new dojoAttachEvent="ondijitclick: ..." that is triggered by a mouse click or a SPACE/ENTER keypress
// - focus related functions
// In particular, the onFocus()/onBlur() callbacks. Driven internally by
// dijit/_base/focus.js.
// - deprecated methods
// - onShow(), onHide(), onClose()
//
// Also, by loading code in dijit/_base, turns on:
// - 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);
for(var attr in this.attributeMap){
delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects
}
for(attr in this._deferredConnects){
if(this[attr] !== dijit._connectOnUseEventHandler){
delete this._deferredConnects[attr]; // redefined, probably dojoAttachEvent exists
}
}
this.inherited(arguments);
if(this.domNode){
// If the developer has specified a handler as a widget parameter
// (ex: new Button({onClick: ...})
// then naturally need to connect from DOM node to that handler immediately,
for(attr in this.params){
this._onConnect(attr);
}
}
},
_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];
}
},
////////////////// FOCUS RELATED ///////////////////
// _onFocus() and _onBlur() are called by the focus manager
// focused: [readonly] Boolean
// This widget or a widget it contains has focus, or is "active" because
// it was recently clicked.
focused: false,
isFocusable: function(){
// summary:
// Return true if this widget can currently be focused
// and false if not
return this.focus && (dojo.style(this.domNode, "display") != "none");
},
onFocus: function(){
// summary:
// Called when the widget becomes "active" because
// it or a widget inside of it either has focus, or has recently
// been clicked.
// tags:
// callback
},
onBlur: function(){
// summary:
// Called when the widget stops being "active" because
// focus moved to something outside of it, or the user
// clicked somewhere outside of it, or the widget was
// hidden.
// tags:
// callback
},
_onFocus: function(e){
// summary:
// This is where widgets do processing for when they are active,
// such as changing CSS classes. See onFocus() for more details.
// tags:
// protected
this.onFocus();
},
_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();
},
////////////////// DEPRECATED METHODS ///////////////////
setAttribute: function(/*String*/ attr, /*anything*/ value){
// summary:
// Deprecated. Use set() instead.
// tags:
// deprecated
dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0");
this.set(attr, value);
},
attr: function(/*String|Object*/name, /*Object?*/value){
// summary:
// Set or get properties on a widget instance.
// name:
// The property to get or set. If an object is passed here and not
// a string, its keys are used as names of attributes to be set
// and the value of the object as values to set in the widget.
// value:
// Optional. If provided, attr() operates as a setter. If omitted,
// the current value of the named property is returned.
// description:
// This method is deprecated, use get() or set() directly.
// Print deprecation warning but only once per calling function
if(dojo.config.isDebug){
var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
caller = (arguments.callee.caller || "unknown caller").toString();
if(!alreadyCalledHash[caller]){
dojo.deprecated(this.declaredClass + "::attr() is deprecated. Use get() or set() instead, called from " +
caller, "", "2.0");
alreadyCalledHash[caller] = true;
}
}
var args = arguments.length;
if(args >= 2 || typeof name === "object"){ // setter
return this.set.apply(this, arguments);
}else{ // getter
return this.get(name);
}
},
////////////////// ONDIJITCLICK SUPPORT ///////////////////
// nodesWithKeyClick: [private] String[]
// List of nodes that correctly handle click events via native browser support,
// and don't need dijit's help
nodesWithKeyClick: ["input", "button"],
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.
// This version of connect also provides a special "ondijitclick"
// event which triggers on a click or space or enter keyup.
// 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 d = dojo,
dc = d._connect,
handles = this.inherited(arguments, [obj, event == "ondijitclick" ? "onclick" : event, method]);
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;
// 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();
}
}
}),
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;
return m(e);
}
})
);
}
}
return handles; // _Widget.Handle
},
////////////////// MISCELLANEOUS METHODS ///////////////////
_onShow: function(){
// summary:
// Internal method called when this widget is made visible.
// See `onShow` for details.
this.onShow();
},
onShow: function(){
// 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
}
}); });
})(); })();
}else{
dojo.doc.addEventListener("keydown",function(_6){
dijit._lastKeyDownNode=_6.target;
},true);
}
(function(){
var _7={},_8=function(_9){
var dc=_9.declaredClass;
if(!_7[dc]){
var r=[],_a,_b=_9.constructor.prototype;
for(var _c in _b){
if(dojo.isFunction(_b[_c])&&(_a=_c.match(/^_set([a-zA-Z]*)Attr$/))&&_a[1]){
r.push(_a[1].charAt(0).toLowerCase()+_a[1].substr(1));
}
}
_7[dc]=r;
}
return _7[dc]||[];
};
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){
this.create(_d,_e);
},create:function(_f,_10){
this.srcNodeRef=dojo.byId(_10);
this._connects=[];
this._subscribes=[];
this._deferredConnects=dojo.clone(this._deferredConnects);
for(var _11 in this.attributeMap){
delete this._deferredConnects[_11];
}
for(_11 in this._deferredConnects){
if(this[_11]!==dijit._connectOnUseEventHandler){
delete this._deferredConnects[_11];
}
}
if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){
this.id=this.srcNodeRef.id;
}
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){
this._applyAttributes();
var _12=this.srcNodeRef;
if(_12&&_12.parentNode){
_12.parentNode.replaceChild(this.domNode,_12);
}
for(_11 in this.params){
this._onConnect(_11);
}
}
if(this.domNode){
this.domNode.setAttribute("widgetId",this.id);
}
this.postCreate();
if(this.srcNodeRef&&!this.srcNodeRef.parentNode){
delete this.srcNodeRef;
}
this._created=true;
},_applyAttributes:function(){
var _13=function(_14,_15){
if((_15.params&&_14 in _15.params)||_15[_14]){
_15.set(_14,_15[_14]);
}
};
for(var _16 in this.attributeMap){
_13(_16,this);
}
dojo.forEach(_8(this),function(a){
if(!(a in this.attributeMap)){
_13(a,this);
}
},this);
},postMixInProperties:function(){
},buildRendering:function(){
this.domNode=this.srcNodeRef||dojo.create("div");
},postCreate:function(){
if(this.baseClass){
var _17=this.baseClass.split(" ");
if(!this.isLeftToRight()){
_17=_17.concat(dojo.map(_17,function(_18){
return _18+"Rtl";
}));
}
dojo.addClass(this.domNode,_17);
}
},startup:function(){
this._started=true;
},destroyRecursive:function(_19){
this._beingDestroyed=true;
this.destroyDescendants(_19);
this.destroy(_19);
},destroy:function(_1a){
this._beingDestroyed=true;
this.uninitialize();
var d=dojo,dfe=d.forEach,dun=d.unsubscribe;
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();
},_onBlur:function(){
this.onBlur();
},_onConnect:function(_20){
if(_20 in this._deferredConnects){
var _21=this[this._deferredConnects[_20]||"domNode"];
this.connect(_21,_20.toLowerCase(),_20);
delete this._deferredConnects[_20];
}
},_setClassAttr:function(_22){
var _23=this[this.attributeMap["class"]||"domNode"];
dojo.removeClass(_23,this["class"]);
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");
this.set(_26,_27);
},_attrToDom:function(_28,_29){
var _2a=this.attributeMap[_28];
dojo.forEach(dojo.isArray(_2a)?_2a:[_2a],function(_2b){
var _2c=this[_2b.node||_2b||"domNode"];
var _2d=_2b.type||"attribute";
switch(_2d){
case "attribute":
if(dojo.isFunction(_29)){
_29=dojo.hitch(this,_29);
}
var _2e=_2b.attribute?_2b.attribute:(/^on[A-Z][a-zA-Z]*$/.test(_28)?_28.toLowerCase():_28);
dojo.attr(_2c,_2e,_29);
break;
case "innerText":
_2c.innerHTML="";
_2c.appendChild(dojo.doc.createTextNode(_29));
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){
var _31=arguments.callee._ach||(arguments.callee._ach={}),_32=(arguments.callee.caller||"unknown caller").toString();
if(!_31[_32]){
dojo.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_32,"","2.0");
_31[_32]=true;
}
}
var _33=arguments.length;
if(_33>=2||typeof _2f==="object"){
return this.set.apply(this,arguments);
}else{
return this.get(_2f);
}
},get:function(_34){
var _35=this._getAttrNames(_34);
return this[_35.g]?this[_35.g]():this[_34];
},set:function(_36,_37){
if(typeof _36==="object"){
for(var x in _36){
this.set(x,_36[x]);
}
return this;
}
var _38=this._getAttrNames(_36);
if(this[_38.s]){
var _39=this[_38.s].apply(this,Array.prototype.slice.call(arguments,1));
}else{
if(_36 in this.attributeMap){
this._attrToDom(_36,_37);
}
var _3a=this[_36];
this[_36]=_37;
}
return _39||this;
},_attrPairNames:{},_getAttrNames:function(_3b){
var apn=this._attrPairNames;
if(apn[_3b]){
return apn[_3b];
}
var uc=_3b.charAt(0).toUpperCase()+_3b.substr(1);
return (apn[_3b]={n:_3b+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});
},toString:function(){
return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";
},getDescendants:function(){
return this.containerNode?dojo.query("[widgetId]",this.containerNode).map(dijit.byNode):[];
},getChildren:function(){
return this.containerNode?dijit.findWidgets(this.containerNode):[];
},nodesWithKeyClick:["input","button"],connect:function(obj,_3c,_3d){
var d=dojo,dc=d._connect,_3e=[];
if(_3c=="ondijitclick"){
if(dojo.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){
var m=d.hitch(this,_3d);
_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){
dijit._lastKeyDownNode=e.target;
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){
dijit._lastKeyDownNode=null;
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);
this._subscribes.push(_42);
return _42;
},unsubscribe:function(_43){
for(var i=0;i<this._subscribes.length;i++){
if(this._subscribes[i]==_43){
dojo.unsubscribe(_43);
this._subscribes.splice(i,1);
return;
}
}
},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();
},onShow:function(){
},onHide:function(){
},onClose:function(){
return true;
}});
})();
} }

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,12 +1,12 @@
/* /*
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");
dojo.require("dijit._base.manager"); dojo.require("dijit._base.manager");
@@ -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,299 +1,530 @@
/* /*
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(){
return dijit.getBookmark().isCollapsed;
},getBookmark:function(){ // summary:
var bm,rg,tg,_1=dojo.doc.selection,cf=dijit._curFocus; // These functions are used to query or set the focus and selection.
if(dojo.global.getSelection){ //
_1=dojo.global.getSelection(); // Also, they trace when widgets become activated/deactivated,
if(_1){ // so that the widget can fire _onFocus/_onBlur events.
if(_1.isCollapsed){ // "Active" here means something similar to "focused", but
tg=cf?cf.tagName:""; // "focus" isn't quite the right word because we keep track of
if(tg){ // a whole stack of "active" widgets. Example: ComboButton --> Menu -->
tg=tg.toLowerCase(); // MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){ // on the Menu or a MenuItem, since they are considered part of the
_1={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true}; // ComboButton widget. It only happens when focus is shifted
return {isCollapsed:(_1.end<=_1.start),mark:_1}; // somewhere completely different.
}
} dojo.mixin(dijit, {
bm={isCollapsed:true}; // _curFocus: DomNode
}else{ // Currently focused item on screen
rg=_1.getRangeAt(0); _curFocus: null,
bm={isCollapsed:false,mark:rg.cloneRange()};
} // _prevFocus: DomNode
} // Previously focused item on screen
}else{ _prevFocus: null,
if(_1){
tg=cf?cf.tagName:""; isCollapsed: function(){
tg=tg.toLowerCase(); // summary:
if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){ // Returns true if there is no text selected
if(_1.type&&_1.type.toLowerCase()=="none"){ return dijit.getBookmark().isCollapsed;
return {isCollapsed:true,mark:null}; },
}else{
rg=_1.createRange(); getBookmark: function(){
return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}}; // 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;
bm={};
try{ if(dojo.global.getSelection){
rg=_1.createRange(); //W3C Range API for selections.
bm.isCollapsed=!(_1.type=="Text"?rg.htmlText.length:rg.length); sel = dojo.global.getSelection();
} if(sel){
catch(e){ if(sel.isCollapsed){
bm.isCollapsed=true; tg = cf? cf.tagName : "";
return bm; if(tg){
} //Create a fake rangelike item to restore selections.
if(_1.type.toUpperCase()=="CONTROL"){ tg = tg.toLowerCase();
if(rg.length){ if(tg == "textarea" ||
bm.mark=[]; (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
var i=0,_2=rg.length; sel = {
while(i<_2){ start: cf.selectionStart,
bm.mark.push(rg.item(i++)); end: cf.selectionEnd,
} node: cf,
}else{ pRange: true
bm.isCollapsed=true; };
bm.mark=null; return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
} }
}else{ }
bm.mark=rg.getBookmark(); bm = {isCollapsed:true};
} if(sel.rangeCount){
}else{ bm.mark = sel.getRangeAt(0).cloneRange();
console.warn("No idea how to store the current selection for this browser!"); }
} }else{
} rg = sel.getRangeAt(0);
return bm; bm = {isCollapsed: false, mark: rg.cloneRange()};
},moveToBookmark:function(_3){ }
var _4=dojo.doc,_5=_3.mark; }
if(_5){ }else if(sel){
if(dojo.global.getSelection){ // If the current focus was a input of some sort and no selection, don't bother saving
var _6=dojo.global.getSelection(); // a native bookmark. This is because it causes issues with dialog/page selection restore.
if(_6&&_6.removeAllRanges){ // So, we need to create psuedo bookmarks to work with.
if(_5.pRange){ tg = cf ? cf.tagName : "";
var r=_5; tg = tg.toLowerCase();
var n=r.node; if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
n.selectionStart=r.start; if(sel.type && sel.type.toLowerCase() == "none"){
n.selectionEnd=r.end; return {
}else{ isCollapsed: true,
_6.removeAllRanges(); mark: null
_6.addRange(_5); }
} }else{
}else{ rg = sel.createRange();
console.warn("No idea how to restore selection for this browser!"); return {
} isCollapsed: rg.text && rg.text.length?false:true,
}else{ mark: {
if(_4.selection&&_5){ range: rg,
var rg; pRange: true
if(_5.pRange){ }
rg=_5.range; };
}else{ }
if(dojo.isArray(_5)){ }
rg=_4.body.createControlRange(); bm = {};
dojo.forEach(_5,function(n){
rg.addElement(n); //'IE' way for selections.
try{
// createRange() throws exception when dojo in iframe
//and nothing selected, see #9632
rg = sel.createRange();
bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
}catch(e){
bm.isCollapsed = true;
return bm;
}
if(sel.type.toUpperCase() == 'CONTROL'){
if(rg.length){
bm.mark=[];
var i=0,len=rg.length;
while(i<len){
bm.mark.push(rg.item(i++));
}
}else{
bm.isCollapsed = true;
bm.mark = null;
}
}else{
bm.mark = rg.getBookmark();
}
}else{
console.warn("No idea how to store the current selection for this browser!");
}
return bm; // Object
},
moveToBookmark: function(/*Object*/bookmark){
// 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){
//W3C Rangi API (FF, WebKit, Opera, etc)
var sel = dojo.global.getSelection();
if(sel && sel.removeAllRanges){
if(mark.pRange){
var r = mark;
var n = r.node;
n.selectionStart = r.start;
n.selectionEnd = r.end;
}else{
sel.removeAllRanges();
sel.addRange(mark);
}
}else{
console.warn("No idea how to restore selection for this browser!");
}
}else if(_doc.selection && mark){
//'IE' way.
var rg;
if(mark.pRange){
rg = mark.range;
}else if(dojo.isArray(mark)){
rg = _doc.body.createControlRange();
//rg.addElement does not have call/apply method, so can not call it directly
//rg is not available in "range.addElement(item)", so can't use that either
dojo.forEach(mark, function(n){
rg.addElement(n);
});
}else{
rg = _doc.body.createTextRange();
rg.moveToBookmark(mark);
}
rg.select();
}
}
},
getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
// summary:
// Called as getFocus(), this returns an Object showing the current focus
// and selected text.
//
// Called as getFocus(widget), where widget is a (widget representing) a button
// that was just pressed, it returns where focus was before that button
// was pressed. (Pressing the button may have either shifted focus to the button,
// or removed focus altogether.) In this case the selected text is not returned,
// 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{
// Gecko throws sometimes if setting focus is impossible,
// node not displayed or something like that
focusNode.focus();
}catch(e){/*quiet*/}
}
dijit._onFocusNode(node);
}
// set the selection
// do not need to restore if current selection is not empty
// (use keyboard to select a menu item) or if previous selection was collapsed
// as it may cause focus shift (Esp in IE).
if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
if(openedForWindow){
openedForWindow.focus();
}
try{
dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
}catch(e2){
/*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
}
}
},
// _activeStack: dijit._Widget[]
// List of currently active widgets (focused widget and it's ancestors)
_activeStack: [],
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;
setTimeout(function(){ 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){
return;
}
dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
};
//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(dojo.isIE){
targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
var activateListener = function(evt){
// IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
// 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{
dijit._onTouchNode(effectiveNode || evt.srcElement);
}
};
doc.attachEvent('onactivate', activateListener);
var deactivateListener = function(evt){
dijit._onBlurNode(effectiveNode || evt.srcElement);
};
doc.attachEvent('ondeactivate', deactivateListener);
return function(){
targetWindow.document.detachEvent('onmousedown', mousedownListener);
doc.detachEvent('onactivate', activateListener);
doc.detachEvent('ondeactivate', deactivateListener);
doc = null; // prevent memory leak (apparent circular reference via closure)
};
}else{
doc.body.addEventListener('mousedown', mousedownListener, true);
var focusListener = function(evt){
dijit._onFocusNode(effectiveNode || evt.target);
};
doc.addEventListener('focus', focusListener, true);
var blurListener = function(evt){
dijit._onBlurNode(effectiveNode || evt.target);
};
doc.addEventListener('blur', blurListener, true);
return function(){
doc.body.removeEventListener('mousedown', mousedownListener, true);
doc.removeEventListener('focus', focusListener, true);
doc.removeEventListener('blur', blurListener, true);
doc = null; // prevent memory leak (apparent circular reference via closure)
};
}
}
},
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._curFocus = null;
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;
}
// if the blur event isn't followed by a focus event then mark all widgets as inactive.
if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
}
dijit._clearActiveWidgetsTimer = setTimeout(function(){
delete dijit._clearActiveWidgetsTimer;
dijit._setStack([]);
dijit._prevFocus = null;
}, 100);
},
_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){
clearTimeout(dijit._clearActiveWidgetsTimer);
delete dijit._clearActiveWidgetsTimer;
}
// compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
var newStack=[];
try{
while(node){
var popupParent = dojo.attr(node, "dijitPopupParent");
if(popupParent){
node=dijit.byId(popupParent).domNode;
}else if(node.tagName && node.tagName.toLowerCase() == "body"){
// is this the root of the document or just the root of an iframe?
if(node === dojo.body()){
// node is the root of the main document
break;
}
// 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{
// if this node is the root node of a widget, then add widget id to stack,
// except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
// 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);
}
node=node.parentNode;
}
}
}catch(e){ /* squelch */ }
dijit._setStack(newStack, by);
},
_onFocusNode: function(/*DomNode*/ node){
// summary:
// Callback when node is focused
if(!node){
return;
}
if(node.nodeType == 9){
// Ignore focus events on the document itself. This is here so that
// (for example) clicking the up/down arrows of a spinner
// (which don't get focus) won't cause that widget to blur. (FF issue)
return;
}
dijit._onTouchNode(node);
if(node == dijit._curFocus){ return; }
if(dijit._curFocus){
dijit._prevFocus = dijit._curFocus;
}
dijit._curFocus = node;
dojo.publish("focusNode", [node]);
},
_setStack: function(/*String[]*/ newStack, /*String*/ by){
// summary:
// 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;
}
}
var widget;
// for all elements that have gone out of focus, send blur event
for(var i=oldStack.length-1; i>=nCommon; i--){
widget = dijit.byId(oldStack[i]);
if(widget){
widget._focused = false;
widget.set("focused", false);
widget._hasBeenBlurred = true;
if(widget._onBlur){
widget._onBlur(by);
}
dojo.publish("widgetBlur", [widget, by]);
}
}
// for all element that have come into focus, send focus event
for(i=nCommon; i<newStack.length; i++){
widget = dijit.byId(newStack[i]);
if(widget){
widget._focused = true;
widget.set("focused", true);
if(widget._onFocus){
widget._onFocus(by);
}
dojo.publish("widgetFocus", [widget, by]);
}
}
}
}); });
}else{
rg=_4.body.createTextRange(); // register top window and all the iframes it contains
rg.moveToBookmark(_5);
}
}
rg.select();
}
}
}
},getFocus:function(_7,_8){
var _9=!dijit._curFocus||(_7&&dojo.isDescendant(dijit._curFocus,_7.domNode))?dijit._prevFocus:dijit._curFocus;
return {node:_9,bookmark:(_9==dijit._curFocus)&&dojo.withGlobal(_8||dojo.global,dijit.getBookmark),openedForWindow:_8};
},focus:function(_a){
if(!_a){
return;
}
var _b="node" in _a?_a.node:_a,_c=_a.bookmark,_d=_a.openedForWindow,_e=_c?_c.isCollapsed:false;
if(_b){
var _f=(_b.tagName.toLowerCase()=="iframe")?_b.contentWindow:_b;
if(_f&&_f.focus){
try{
_f.focus();
}
catch(e){
}
}
dijit._onFocusNode(_b);
}
if(_c&&dojo.withGlobal(_d||dojo.global,dijit.isCollapsed)&&!_e){
if(_d){
_d.focus();
}
try{
dojo.withGlobal(_d||dojo.global,dijit.moveToBookmark,null,[_c]);
}
catch(e2){
}
}
},_activeStack:[],registerIframe:function(_10){
return dijit.registerWin(_10.contentWindow,_10);
},unregisterIframe:function(_11){
dijit.unregisterWin(_11);
},registerWin:function(_12,_13){
var _14=function(evt){
dijit._justMouseDowned=true;
setTimeout(function(){
dijit._justMouseDowned=false;
},0);
if(dojo.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){
return;
}
dijit._onTouchNode(_13||evt.target||evt.srcElement,"mouse");
};
var doc=dojo.isIE?_12.document.documentElement:_12.document;
if(doc){
if(dojo.isIE){
doc.attachEvent("onmousedown",_14);
var _15=function(evt){
if(evt.srcElement.tagName.toLowerCase()!="#document"&&dijit.isTabNavigable(evt.srcElement)){
dijit._onFocusNode(_13||evt.srcElement);
}else{
dijit._onTouchNode(_13||evt.srcElement);
}
};
doc.attachEvent("onactivate",_15);
var _16=function(evt){
dijit._onBlurNode(_13||evt.srcElement);
};
doc.attachEvent("ondeactivate",_16);
return function(){
doc.detachEvent("onmousedown",_14);
doc.detachEvent("onactivate",_15);
doc.detachEvent("ondeactivate",_16);
doc=null;
};
}else{
doc.addEventListener("mousedown",_14,true);
var _17=function(evt){
dijit._onFocusNode(_13||evt.target);
};
doc.addEventListener("focus",_17,true);
var _18=function(evt){
dijit._onBlurNode(_13||evt.target);
};
doc.addEventListener("blur",_18,true);
return function(){
doc.removeEventListener("mousedown",_14,true);
doc.removeEventListener("focus",_17,true);
doc.removeEventListener("blur",_18,true);
doc=null;
};
}
}
},unregisterWin:function(_19){
_19&&_19();
},_onBlurNode:function(_1a){
dijit._prevFocus=dijit._curFocus;
dijit._curFocus=null;
if(dijit._justMouseDowned){
return;
}
if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
}
dijit._clearActiveWidgetsTimer=setTimeout(function(){
delete dijit._clearActiveWidgetsTimer;
dijit._setStack([]);
dijit._prevFocus=null;
},100);
},_onTouchNode:function(_1b,by){
if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
delete dijit._clearActiveWidgetsTimer;
}
var _1c=[];
try{
while(_1b){
var _1d=dojo.attr(_1b,"dijitPopupParent");
if(_1d){
_1b=dijit.byId(_1d).domNode;
}else{
if(_1b.tagName&&_1b.tagName.toLowerCase()=="body"){
if(_1b===dojo.body()){
break;
}
_1b=dojo.window.get(_1b.ownerDocument).frameElement;
}else{
var id=_1b.getAttribute&&_1b.getAttribute("widgetId"),_1e=id&&dijit.byId(id);
if(_1e&&!(by=="mouse"&&_1e.get("disabled"))){
_1c.unshift(id);
}
_1b=_1b.parentNode;
}
}
}
}
catch(e){
}
dijit._setStack(_1c,by);
},_onFocusNode:function(_1f){
if(!_1f){
return;
}
if(_1f.nodeType==9){
return;
}
dijit._onTouchNode(_1f);
if(_1f==dijit._curFocus){
return;
}
if(dijit._curFocus){
dijit._prevFocus=dijit._curFocus;
}
dijit._curFocus=_1f;
dojo.publish("focusNode",[_1f]);
},_setStack:function(_20,by){
var _21=dijit._activeStack;
dijit._activeStack=_20;
for(var _22=0;_22<Math.min(_21.length,_20.length);_22++){
if(_21[_22]!=_20[_22]){
break;
}
}
var _23;
for(var i=_21.length-1;i>=_22;i--){
_23=dijit.byId(_21[i]);
if(_23){
_23._focused=false;
_23._hasBeenBlurred=true;
if(_23._onBlur){
_23._onBlur(by);
}
dojo.publish("widgetBlur",[_23,by]);
}
}
for(i=_22;i<_20.length;i++){
_23=dijit.byId(_20[i]);
if(_23){
_23._focused=true;
if(_23._onFocus){
_23._onFocus(by);
}
dojo.publish("widgetFocus",[_23,by]);
}
}
}});
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(){
this._hash={};
this.length=0; dojo.declare("dijit.WidgetSet", null, {
},add:function(_1){ // summary:
if(this._hash[_1.id]){ // A set of widgets indexed by id. A default instance of this class is
throw new Error("Tried to register widget with id=="+_1.id+" but that id is already registered"); // available as `dijit.registry`
} //
this._hash[_1.id]=_1; // example:
this.length++; // Create a small list of widgets:
},remove:function(id){ // | var ws = new dijit.WidgetSet();
if(this._hash[id]){ // | ws.add(dijit.byId("one"));
delete this._hash[id]; // | ws.add(dijit.byId("two"));
this.length--; // | // destroy both:
} // | ws.forEach(function(w){ w.destroy(); });
},forEach:function(_2,_3){ //
_3=_3||dojo.global; // example:
var i=0,id; // Using dijit.registry:
for(id in this._hash){ // | dijit.registry.forEach(function(w){ /* do something */ });
_2.call(_3,this._hash[id],i++,this._hash);
} constructor: function(){
return this; this._hash = {};
},filter:function(_4,_5){ this.length = 0;
_5=_5||dojo.global; },
var _6=new dijit.WidgetSet(),i=0,id;
for(id in this._hash){ add: function(/*dijit._Widget*/ widget){
var w=this._hash[id]; // summary:
if(_4.call(_5,w,i++,this._hash)){ // Add a widget to this list. If a duplicate ID is detected, a error is thrown.
_6.add(w); //
} // widget: dijit._Widget
} // Any dijit._Widget subclass.
return _6; if(this._hash[widget.id]){
},byId:function(id){ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
return this._hash[id]; }
},byClass:function(_7){ this._hash[widget.id] = widget;
var _8=new dijit.WidgetSet(),id,_9; this.length++;
for(id in this._hash){ },
_9=this._hash[id];
if(_9.declaredClass==_7){ remove: function(/*String*/ id){
_8.add(_9); // summary:
} // Remove a widget from this WidgetSet. Does not destroy the widget; simply
} // removes the reference.
return _8; if(this._hash[id]){
},toArray:function(){ delete this._hash[id];
var ar=[]; this.length--;
for(var id in this._hash){ }
ar.push(this._hash[id]); },
}
return ar; forEach: function(/*Function*/ func, /* Object? */thisObj){
},map:function(_a,_b){ // summary:
return dojo.map(this.toArray(),_a,_b); // Call specified function for each widget in this set.
},every:function(_c,_d){ //
_d=_d||dojo.global; // func:
var x=0,i; // A callback function to run for each item. Is passed the widget, the index
for(i in this._hash){ // in the iteration, and the full hash, similar to `dojo.forEach`.
if(!_c.call(_d,this._hash[i],x++,this._hash)){ //
return false; // thisObj:
} // An optional scope parameter
} //
return true; // example:
},some:function(_e,_f){ // Using the default `dijit.registry` instance:
_f=_f||dojo.global; // | dijit.registry.forEach(function(widget){
var x=0,i; // | console.log(widget.declaredClass);
for(i in this._hash){ // | });
if(_e.call(_f,this._hash[i],x++,this._hash)){ //
return true; // returns:
} // Returns self, in order to allow for further chaining.
}
return false; thisObj = thisObj || dojo.global;
}}); var i = 0, id;
for(id in this._hash){
func.call(thisObj, this._hash[id], i++, this._hash);
}
return this; // dijit.WidgetSet
},
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){
var w = this._hash[id];
if(filter.call(thisObj, w, i++, this._hash)){
res.add(w);
}
}
return res; // dijit.WidgetSet
},
byId: function(/*String*/ id){
// 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){
widget = this._hash[id];
if(widget.declaredClass == cls){
res.add(widget);
}
}
return res; // dijit.WidgetSet
},
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 = [];
for(var id in this._hash){
ar.push(this._hash[id]);
}
return ar; // dijit._Widget[]
},
map: function(/* Function */func, /* Object? */thisObj){
// 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;
for(i in this._hash){
if(!func.call(thisObj, this._hash[i], x++, this._hash)){
return false; // Boolean
}
}
return true; // Boolean
},
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;
for(i in this._hash){
if(func.call(thisObj, this._hash[i], x++, this._hash)){
return true; // Boolean
}
}
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.
var _14={}; // description:
dijit.getUniqueId=function(_15){ // Is an instance of `dijit.WidgetSet`
var id; };
do{ =====*/
id=_15+"_"+(_15 in _14?++_14[_15]:_14[_15]=0); dijit.registry = new dijit.WidgetSet();
}while(_10[id]);
return dijit._scopeName=="dijit"?id:dijit._scopeName+"_"+id; var hash = dijit.registry._hash,
}; attr = dojo.attr,
dijit.findWidgets=function(_16){ hasAttr = dojo.hasAttr,
var _17=[]; style = dojo.style;
function _18(_19){
for(var _1a=_19.firstChild;_1a;_1a=_1a.nextSibling){ dijit.byId = function(/*String|dijit._Widget*/ id){
if(_1a.nodeType==1){ // summary:
var _1b=_1a.getAttribute("widgetId"); // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
if(_1b){ return typeof id == "string" ? hash[id] : id; // dijit._Widget
_17.push(_10[_1b]); };
}else{
_18(_1a); var _widgetTypeCtr = {};
} dijit.getUniqueId = function(/*String*/widgetType){
} // summary:
} // Generates a unique id for a given widgetType
};
_18(_16); var id;
return _17; do{
}; id = widgetType + "_" +
dijit._destroyAll=function(){ (widgetType in _widgetTypeCtr ?
dijit._curFocus=null; ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
dijit._prevFocus=null; }while(hash[id]);
dijit._activeStack=[]; return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
dojo.forEach(dijit.findWidgets(dojo.body()),function(_1c){ };
if(!_1c._destroyed){
if(_1c.destroyRecursive){ dijit.findWidgets = function(/*DomNode*/ root){
_1c.destroyRecursive(); // summary:
}else{ // Search subtree under root returning widgets found.
if(_1c.destroy){ // Doesn't search for nested widgets (ie, widgets inside other widgets).
_1c.destroy();
} var outAry = [];
}
} function getChildrenHelper(root){
}); for(var node = root.firstChild; node; node = node.nextSibling){
}; if(node.nodeType == 1){
if(dojo.isIE){ var widgetId = node.getAttribute("widgetId");
dojo.addOnWindowUnload(function(){ if(widgetId){
dijit._destroyAll(); var widget = hash[widgetId];
}); if(widget){ // may be null on page w/multiple dojo's loaded
} outAry.push(widget);
dijit.byNode=function(_1d){ }
return _10[_1d.getAttribute("widgetId")]; }else{
}; getChildrenHelper(node);
dijit.getEnclosingWidget=function(_1e){ }
while(_1e){ }
var id=_1e.getAttribute&&_1e.getAttribute("widgetId"); }
if(id){ }
return _10[id];
} getChildrenHelper(root);
_1e=_1e.parentNode; return outAry;
} };
return null;
}; dijit._destroyAll = function(){
var _1f=(dijit._isElementShown=function(_20){ // summary:
var s=_13(_20); // Code to destroy all widgets and do other cleanup on page unload
return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_11(_20,"type")!="hidden");
}); // Clean up focus manager lingering references to widgets and nodes
dijit.hasDefaultTabStop=function(_21){ dijit._curFocus = null;
switch(_21.nodeName.toLowerCase()){ dijit._prevFocus = null;
case "a": dijit._activeStack = [];
return _12(_21,"href");
case "area": // Destroy all the widgets, top down
case "button": dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
case "input": // Avoid double destroy of widgets like Menu that are attached to <body>
case "object": // even though they are logically children of other widgets.
case "select": if(!widget._destroyed){
case "textarea": if(widget.destroyRecursive){
return true; widget.destroyRecursive();
case "iframe": }else if(widget.destroy){
if(dojo.isMoz){ widget.destroy();
try{ }
return _21.contentDocument.designMode=="on"; }
} });
catch(err){ };
return false;
} if(dojo.isIE){
}else{ // Only run _destroyAll() for IE because we think it's only necessary in that case,
if(dojo.isWebKit){ // and because it causes problems on FF. See bug #3531 for details.
var doc=_21.contentDocument,_22=doc&&doc.body; dojo.addOnWindowUnload(function(){
return _22&&_22.contentEditable=="true"; dijit._destroyAll();
}else{ });
try{ }
doc=_21.contentWindow.document;
_22=doc&&doc.body; dijit.byNode = function(/*DOMNode*/ node){
return _22&&_22.firstChild&&_22.firstChild.contentEditable=="true"; // summary:
} // Returns the widget corresponding to the given DOMNode
catch(e){ return hash[node.getAttribute("widgetId")]; // dijit._Widget
return false; };
}
} dijit.getEnclosingWidget = function(/*DOMNode*/ node){
} // summary:
default: // Returns the widget whose DOM tree contains the specified DOMNode, or null if
return _21.contentEditable=="true"; // the node is not contained within the DOM tree of any widget
} while(node){
}; var id = node.getAttribute && node.getAttribute("widgetId");
var _23=(dijit.isTabNavigable=function(_24){ if(id){
if(_11(_24,"disabled")){ return hash[id];
return false; }
}else{ node = node.parentNode;
if(_12(_24,"tabIndex")){ }
return _11(_24,"tabIndex")>=0; return null;
}else{ };
return dijit.hasDefaultTabStop(_24);
} var shown = (dijit._isElementShown = function(/*Element*/ elem){
} var s = style(elem);
}); return (s.visibility != "hidden")
dijit._getTabNavigable=function(_25){ && (s.visibility != "collapsed")
var _26,_27,_28,_29,_2a,_2b; && (s.display != "none")
var _2c=function(_2d){ && (attr(elem, "type") != "hidden");
dojo.query("> *",_2d).forEach(function(_2e){ });
if((dojo.isIE&&_2e.scopeName!=="HTML")||!_1f(_2e)){
return; dijit.hasDefaultTabStop = function(/*Element*/ elem){
} // summary:
if(_23(_2e)){ // Tests if element is tab-navigable even without an explicit tabIndex setting
var _2f=_11(_2e,"tabIndex");
if(!_12(_2e,"tabIndex")||_2f==0){ // No explicit tabIndex setting, need to investigate node type
if(!_26){ switch(elem.nodeName.toLowerCase()){
_26=_2e; case "a":
} // An <a> w/out a tabindex is only navigable if it has an href
_27=_2e; return hasAttr(elem, "href");
}else{ case "area":
if(_2f>0){ case "button":
if(!_28||_2f<_29){ case "input":
_29=_2f; case "object":
_28=_2e; case "select":
} case "textarea":
if(!_2a||_2f>=_2b){ // These are navigable by default
_2b=_2f; return true;
_2a=_2e; case "iframe":
} // If it's an editor <iframe> then it's tab navigable.
} var body;
} try{
} // non-IE
if(_2e.nodeName.toUpperCase()!="SELECT"){ var contentDocument = elem.contentDocument;
_2c(_2e); if("designMode" in contentDocument && contentDocument.designMode == "on"){
} return true;
}); }
}; body = contentDocument.body;
if(_1f(_25)){ }catch(e1){
_2c(_25); // contentWindow.document isn't accessible within IE7/8
} // if the iframe.src points to a foreign url and this
return {first:_26,last:_27,lowest:_28,highest:_2a}; // page contains an element, that could get focus
}; try{
dijit.getFirstInTabbingOrder=function(_30){ body = elem.contentWindow.document.body;
var _31=dijit._getTabNavigable(dojo.byId(_30)); }catch(e2){
return _31.lowest?_31.lowest:_31.first; return false;
}; }
dijit.getLastInTabbingOrder=function(_32){ }
var _33=dijit._getTabNavigable(dojo.byId(_32)); return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
return _33.last?_33.last:_33.highest; default:
}; return elem.contentEditable == 'true';
dijit.defaultDuration=dojo.config["defaultDuration"]||200; }
};
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;
}else if(hasAttr(elem, "tabIndex")){
// Explicit tab index setting
return attr(elem, "tabIndex") >= 0; // boolean
}else{
// No explicit tabIndex setting, so depends on node type
return dijit.hasDefaultTabStop(elem);
}
});
dijit._getTabNavigable = function(/*DOMNode*/ root){
// summary:
// Finds descendants of the specified root node.
//
// 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;
}
if(isTabNavigable(child)){
var tabindex = attr(child, "tabIndex");
if(!hasAttr(child, "tabIndex") || tabindex == 0){
if(!first){ first = child; }
last = child;
}else if(tabindex > 0){
if(!lowest || tabindex < lowestTabindex){
lowestTabindex = tabindex;
lowest = child;
}
if(!highest || tabindex >= highestTabindex){
highestTabindex = tabindex;
highest = child;
}
}
var rn = radioName(child);
if(dojo.attr(child, "checked") && rn) {
radioSelected[rn] = child;
}
}
if(child.nodeName.toUpperCase() != 'SELECT'){
walkTree(child);
}
});
};
if(shown(root)){ walkTree(root) }
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: 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.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
// summary:
// Finds the descendant of the specified root node
// that is last in the tabbing order
var elems = dijit._getTabNavigable(dojo.byId(root));
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;
})(); })();
} }

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(){
return dojo.window.getBox();
dijit.getViewport = function(){
// summary:
// Returns the dimensions and scroll position of the viewable area of a browser window
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;
} }
return c; =====*/
});
return dijit._place(_1,_5);
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 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
};
// configure node to be displayed in given position relative to button
// (need to do this in order to get an accurate size for the node, because
// 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;
}
// get node's size
var style = node.style;
var oldDisplay = style.display;
var oldVis = style.visibility;
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
};
}
return !overflow;
});
// In case the best position is not the last one we checked, need to call
// layoutNode() again.
if(best.overflow && layoutNode){
layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
}
// And then position the node. Do this last, after the layoutNode() above
// has sized the node, due to browser quirks when the viewport is scrolled
// (specifically that a Tooltip will shrink to fit as though the window was
// scrolled to the left).
//
// In RTL mode, set style.right rather than style.left so in the common case,
// window resizes move the popup along with the aroundNode.
var l = dojo._isBodyLtr(),
s = node.style;
s.top = best.y + "px";
s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
return best;
}
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._place=function(_7,_8,_9){
var _a=dojo.window.getBox(); /*=====
if(!_7.parentNode||String(_7.parentNode.tagName).toLowerCase()!="body"){ dijit.__Rectangle = function(){
dojo.body().appendChild(_7); // 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;
} }
var _b=null; =====*/
dojo.some(_8,function(_c){
var _d=_c.corner;
var _e=_c.pos; dijit.placeOnScreenAroundRectangle = function(
if(_9){ /* DomNode */ node,
_9(_7,_c.aroundCorner,_d); /* dijit.__Rectangle */ aroundRect,
} /* Object */ aroundCorners,
var _f=_7.style; /* Function */ layoutNode){
var _10=_f.display;
var _11=_f.visibility; // summary:
_f.visibility="hidden"; // Like dijit.placeOnScreenAroundNode(), except that the "around"
_f.display=""; // parameter is an arbitrary rectangle on the screen (x, y, width, height)
var mb=dojo.marginBox(_7); // instead of a dom node.
_f.display=_10;
_f.visibility=_11; return dijit._placeOnScreenAroundRect(node,
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); aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
if(_b==null||_18<_b.overflow){ aroundCorners, layoutNode);
_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";
if(_b.overflow&&_9){
_9(_7,_b.aroundCorner,_b.corner);
}
return _b;
}; };
dijit.placeOnScreenAroundNode=function(_19,_1a,_1b,_1c){
_1a=dojo.byId(_1a); dijit._placeOnScreenAroundRect = function(
var _1d=_1a.style.display; /* DomNode */ node,
_1a.style.display=""; /* Number */ x,
var _1e=dojo.position(_1a,true); /* Number */ y,
_1a.style.display=_1d; /* Number */ width,
return dijit._placeOnScreenAroundRect(_19,_1e.x,_1e.y,_1e.w,_1e.h,_1b,_1c); /* 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.placeOnScreenAroundRectangle=function(_1f,_20,_21,_22){
return dijit._placeOnScreenAroundRect(_1f,_20.x,_20.y,_20.width,_20.height,_21,_22); dijit.placementRegistry= new dojo.AdapterRegistry();
}; dijit.placementRegistry.register("node",
dijit._placeOnScreenAroundRect=function(_23,x,y,_24,_25,_26,_27){ function(n, x){
var _28=[]; return typeof x == "object" &&
for(var _29 in _26){ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
_28.push({aroundCorner:_29,corner:_26[_29],pos:{x:x+(_29.charAt(1)=="L"?0:_24),y:y+(_29.charAt(0)=="T"?0:_25)}}); },
} dijit.placeOnScreenAroundNode);
return dijit._place(_23,_28,_27); dijit.placementRegistry.register("rect",
}; function(n, x){
dijit.placementRegistry=new dojo.AdapterRegistry(); return typeof x == "object" &&
dijit.placementRegistry.register("node",function(n,x){ "x" in x && "y" in x && "width" in x && "height" in x;
return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined"; },
},dijit.placeOnScreenAroundNode); dijit.placeOnScreenAroundRectangle);
dijit.placementRegistry.register("rect",function(n,x){
return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x; dijit.placeOnScreenAroundElement = function(
},dijit.placeOnScreenAroundRectangle); /* DomNode */ node,
dijit.placeOnScreenAroundElement=function(_2a,_2b,_2c,_2d){ /* Object */ aroundElement,
return dijit.placementRegistry.match.apply(dijit.placementRegistry,arguments); /* Object */ aroundCorners,
}; /* Function */ layoutNode){
dijit.getPopupAroundAlignment=function(_2e,_2f){
var _30={}; // summary:
dojo.forEach(_2e,function(pos){ // Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
switch(pos){ // for the "around" argument and finds a proper processor to place a node.
case "after":
_30[_2f?"BR":"BL"]=_2f?"BL":"BR"; return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
break;
case "before":
_30[_2f?"BL":"BR"]=_2f?"BR":"BL";
break;
case "below":
_30[_2f?"BL":"BR"]=_2f?"TL":"TR";
_30[_2f?"BR":"BL"]=_2f?"TR":"TL";
break;
case "above":
default:
_30[_2f?"TL":"TR"]=_2f?"BL":"BR";
_30[_2f?"TR":"TL"]=_2f?"BR":"BL";
break;
}
});
return _30;
}; };
dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
// 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){
case "after":
align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
break;
case "before":
align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
break;
case "below-alt":
leftToRight = !leftToRight;
// fall through
case "below":
// first try to align left borders, next try to align right borders (or reverse for RTL mode)
align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
break;
case "above-alt":
leftToRight = !leftToRight;
// fall through
case "above":
default:
// first try to align left borders, next try to align right borders (or reverse for RTL mode)
align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
break;
}
});
return align;
};
} }

View File

@@ -1,158 +1,405 @@
/* /*
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; =====*/
s.display="";
s.visibility=""; dijit.popup = {
s.position=""; // summary:
s.top="0px"; // This singleton is used to show/hide widgets as popups.
dojo.style(_2,{visibility:"hidden",top:"-9999px"});
},getTopPopup:function(){ // _stack: dijit._Widget[]
var _3=this._stack; // Stack of currently popped up widgets.
for(var pi=_3.length-1;pi>0&&_3[pi].parent===_3[pi-1].widget;pi--){ // (someone opened _stack[0], and then it opened _stack[1], etc.)
} _stack: [],
return _3[pi];
},open:function(_4){ // _beginZIndex: Number
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++); // Z-index of the first popup. (If first popup opens other
var _9=_6.domNode.parentNode; // popups they get a higher z-index.)
if(!_9||!dojo.hasClass(_9,"dijitPopup")){ _beginZIndex: 1000,
this.moveOffScreen(_6.domNode);
_9=_6.domNode.parentNode; _idGen: 1,
}
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:""}); _createWrapper: function(/*Widget || DomNode*/ widget){
if(dojo.isIE||dojo.isMoz){ // summary:
var _a=_9.childNodes[1]; // Initialization for widgets that will be used as popups.
if(!_a){ // Puts widget inside a wrapper DIV (if not already in one),
_a=new dijit.BackgroundIframe(_9); // and returns pointer to that wrapper DIV.
}
} var wrapper = widget.declaredClass ? widget._popupWrapper : (widget.parentNode && dojo.hasClass(widget.parentNode, "dijitPopup")),
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); node = widget.domNode || widget;
_9.style.visibility="visible";
_6.domNode.style.visibility="visible"; if(!wrapper){
var _c=[]; // Create wrapper <div> for when this widget [in the future] will be used as a popup.
_c.push(dojo.connect(_9,"onkeypress",this,function(_d){ // This is done early because of IE bugs where creating/moving DOM nodes causes focus
if(_d.charOrCode==dojo.keys.ESCAPE&&_4.onCancel){ // to go wonky, see tests/robot/Toolbar.html to reproduce
dojo.stopEvent(_d); wrapper = dojo.create("div",{
_4.onCancel(); "class":"dijitPopup",
}else{ style:{ display: "none"},
if(_d.charOrCode===dojo.keys.TAB){ role: "presentation"
dojo.stopEvent(_d); }, dojo.body());
var _e=this.getTopPopup(); wrapper.appendChild(node);
if(_e&&_e.onCancel){
_e.onCancel(); var s = node.style;
} s.display = "";
} s.visibility = "";
} s.position = "";
})); s.top = "0px";
if(_6.onCancel){
_c.push(dojo.connect(_6,"onCancel",_4.onCancel)); if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
} widget._popupWrapper = wrapper;
_c.push(dojo.connect(_6,_6.onExecute?"onExecute":"onChange",this,function(){ dojo.connect(widget, "destroy", function(){
var _f=this.getTopPopup(); dojo.destroy(wrapper);
if(_f&&_f.onExecute){ delete widget._popupWrapper;
_f.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){ return wrapper;
_6.onOpen(_b); },
}
return _b; moveOffScreen: function(/*Widget || DomNode*/ widget){
},close:function(_10){ // summary:
var _11=this._stack; // Moves the popup widget off-screen.
while(dojo.some(_11,function(_12){ // Do not use this method to hide popups when not in use, because
return _12.widget==_10; // that will create an accessibility issue: the offscreen popup is
})){ // still in the tabbing order.
var top=_11.pop(),_13=top.wrapper,_14=top.iframe,_15=top.widget,_16=top.onClose;
if(_15.onClose){ // Create wrapper if not already there
_15.onClose(); var wrapper = this._createWrapper(widget);
}
dojo.forEach(top.handlers,dojo.disconnect); dojo.style(wrapper, {
if(_15&&_15.domNode){ visibility: "hidden",
this.moveOffScreen(_15.domNode); top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
}else{ display: ""
dojo.destroy(_13); });
} },
if(_16){
_16(); 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
dijit._frames=new function(){ //
var _17=[]; // Also puts widget inside a wrapper DIV (if not already in one)
this.pop=function(){ //
var _18; // If popup widget needs to layout it should
if(_17.length){ // do so when it is made visible, and popup._onShow() is called.
_18=_17.pop();
_18.style.display=""; // Create wrapper if not already there
}else{ var wrapper = this._createWrapper(widget);
if(dojo.isIE){
var _19=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\""; dojo.style(wrapper, "display", "none");
var _1a="<iframe src='"+_19+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>"; },
_18=dojo.doc.createElement(_1a);
}else{ getTopPopup: function(){
_18=dojo.create("iframe"); // summary:
_18.src="javascript:\"\""; // Compute the closest ancestor popup that's *not* a child of another popup.
_18.className="dijitBackgroundIframe"; // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
dojo.style(_18,"opacity",0.1); var stack = this._stack;
} for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
_18.tabIndex=-1; /* do nothing, just trying to get right value for pi */
dijit.setWaiRole(_18,"presentation"); }
} return stack[pi];
return _18; },
};
this.push=function(_1b){ open: function(/*dijit.popup.__OpenArgs*/ args){
_1b.style.display="none"; // summary:
_17.push(_1b); // 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(!widget.bgIframe){
// setting widget.bgIframe triggers cleanup in _Widget.destroy()
widget.bgIframe = new dijit.BackgroundIframe(wrapper);
}
}
// position the wrapper node and make it visible
var best = around ?
dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
wrapper.style.display = "";
wrapper.style.visibility = "visible";
widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
var handlers = [];
// provide default escape and tab key handling
// (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();
}
}
}));
// 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));
}
handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
var topPopup = this.getTopPopup();
if(topPopup && topPopup.onExecute){
topPopup.onExecute();
}
}));
stack.push({
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 best;
},
close: function(/*dijit._Widget?*/ popup){
// summary:
// Close specified popup and any popups that it parented.
// If no popup is specified, closes all popups.
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);
// Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
if(widget && widget.domNode){
this.hide(widget);
}
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(){
// summary:
// cache of iframes
var queue = [];
this.pop = function(){
var iframe;
if(queue.length){
iframe = queue.pop();
iframe.style.display="";
}else{
if(dojo.isIE < 9){
var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
var html="<iframe src='" + burl + "'"
+ " style='position: absolute; left: 0px; top: 0px;"
+ "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
iframe = dojo.doc.createElement(html);
}else{
iframe = dojo.create("iframe");
iframe.src = 'javascript:""';
iframe.className = "dijitBackgroundIframe";
dojo.style(iframe, "opacity", 0.1);
}
iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
dijit.setWaiRole(iframe,"presentation");
}
return iframe;
};
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:
if(dojo.isIE||dojo.isMoz){ // For IE/FF z-index schenanigans. id attribute is required.
var _1d=dijit._frames.pop(); //
_1c.appendChild(_1d); // description:
if(dojo.isIE<7){ // new dijit.BackgroundIframe(node)
this.resize(_1c); // Makes a background iframe as a child of node, that fills
this._conn=dojo.connect(_1c,"onresize",this,function(){ // area (and position) of node
this.resize(_1c);
}); if(!node.id){ throw new Error("no id"); }
}else{ if(dojo.isIE || dojo.isMoz){
dojo.style(_1d,{width:"100%",height:"100%"}); var iframe = (this.iframe = dijit._frames.pop());
} node.appendChild(iframe);
this.iframe=_1d; if(dojo.isIE<7 || dojo.isQuirks){
} this.resize(node);
this._conn = dojo.connect(node, 'onresize', this, function(){
this.resize(node);
});
}else{
dojo.style(iframe, {
width: '100%',
height: '100%'
});
}
}
}; };
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:
},destroy:function(){ // Resize the iframe so it's the same size as node.
if(this._conn){ // Needed on IE6 and IE/quirks because height:100% doesn't work right.
dojo.disconnect(this._conn); if(this.iframe){
this._conn=null; dojo.style(this.iframe, {
} width: node.offsetWidth + 'px',
if(this.iframe){ height: node.offsetHeight + 'px'
dijit._frames.push(this.iframe); });
delete this.iframe; }
} },
}}); destroy: function(){
// summary:
// destroy the iframe
if(this._conn){
dojo.disconnect(this._conn);
this._conn = null;
}
if(this.iframe){
dijit._frames.push(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,87 +1,191 @@
/* /*
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(){
this._timer=null;
this._callback(++this._count,this._node,this._evt); dijit.typematic = {
this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay); // summary:
this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout); // These functions are used to repetitively call a user specified callback
},trigger:function(_1,_2,_3,_4,_5,_6,_7,_8){ // method when a specific key or mouse click over a specific DOM node is
if(_5!=this._obj){ // held down for a specific amount of time.
this.stop(); // Only 1 such event is allowed to occur on the browser page at 1 time.
this._initialDelay=_7||500;
this._subsequentDelay=_6||0.9; _fireEventAndReload: function(){
this._minDelay=_8||10; this._timer = null;
this._obj=_5; this._callback(++this._count, this._node, this._evt);
this._evt=_1;
this._node=_3; // Schedule next event, timer is at most minDelay (default 10ms) to avoid
this._currentTimeout=-1; // browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
this._count=-1; this._currentTimeout = Math.max(
this._callback=dojo.hitch(_2,_4); this._currentTimeout < 0 ? this._initialDelay :
this._fireEventAndReload(); (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
this._evt=dojo.mixin({faux:true},_1); this._minDelay);
} this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
},stop:function(){ },
if(this._timer){
clearTimeout(this._timer); trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
this._timer=null; // summary:
} // Start a timed, repeating callback sequence.
if(this._obj){ // If already started, the function call is ignored.
this._callback(-1,this._node,this._evt); // This method is not normally called by the user but can be
this._obj=null; // when the normal listener code is insufficient.
} // evt:
},addKeyListener:function(_9,_a,_b,_c,_d,_e,_f){ // key or mouse event object to pass to the user callback
if(_a.keyCode){ // _this:
_a.charOrCode=_a.keyCode; // pointer to the user's widget space.
dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0"); // node:
}else{ // the DOM node object to pass the the callback function
if(_a.charCode){ // callback:
_a.charOrCode=String.fromCharCode(_a.charCode); // function to call until the sequence is stopped called with 3 parameters:
dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0"); // count:
} // integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
} // node:
return [dojo.connect(_9,"onkeypress",this,function(evt){ // the DOM node object passed in
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)){ // evt:
dojo.stopEvent(evt); // key or mouse event object
dijit.typematic.trigger(evt,_b,_9,_c,_a,_d,_e,_f); // obj:
}else{ // user space object used to uniquely identify each typematic sequence
if(dijit.typematic._obj==_a){ // subsequentDelay (optional):
dijit.typematic.stop(); // 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):
}),dojo.connect(_9,"onkeyup",this,function(evt){ // the number of milliseconds until the 2nd event occurs, default=500ms
if(dijit.typematic._obj==_a){ // minDelay (optional):
dijit.typematic.stop(); // the maximum delay in milliseconds for event to fire, default=10ms
} if(obj != this._obj){
})]; this.stop();
},addMouseListener:function(_10,_11,_12,_13,_14,_15){ this._initialDelay = initialDelay || 500;
var dc=dojo.connect; this._subsequentDelay = subsequentDelay || 0.90;
return [dc(_10,"mousedown",this,function(evt){ this._minDelay = minDelay || 10;
dojo.stopEvent(evt); this._obj = obj;
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15); this._evt = evt;
}),dc(_10,"mouseup",this,function(evt){ this._node = node;
dojo.stopEvent(evt); this._currentTimeout = -1;
dijit.typematic.stop(); this._count = -1;
}),dc(_10,"mouseout",this,function(evt){ this._callback = dojo.hitch(_this, callback);
dojo.stopEvent(evt); this._fireEventAndReload();
dijit.typematic.stop(); this._evt = dojo.mixin({faux: true}, evt);
}),dc(_10,"mousemove",this,function(evt){ }
evt.preventDefault(); },
}),dc(_10,"dblclick",this,function(evt){
dojo.stopEvent(evt); stop: function(){
if(dojo.isIE){ // summary:
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15); // Stop an ongoing timed, repeating callback sequence.
setTimeout(dojo.hitch(this,dijit.typematic.stop),50); if(this._timer){
} clearTimeout(this._timer);
})]; this._timer = null;
},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)); if(this._obj){
}}; this._callback(-1, this._node, this._evt);
this._obj = null;
}
},
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");
}else if(keyObject.charCode){
keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
}
return [
dojo.connect(node, "onkeypress", this, function(evt){
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);
dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
}else if(dijit.typematic._obj == keyObject){
dijit.typematic.stop();
}
}),
dojo.connect(node, "onkeyup", this, function(evt){
if(dijit.typematic._obj == keyObject){
dijit.typematic.stop();
}
})
];
},
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;
return [
dc(node, "mousedown", this, function(evt){
dojo.stopEvent(evt);
dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
}),
dc(node, "mouseup", this, function(evt){
dojo.stopEvent(evt);
dijit.typematic.stop();
}),
dc(node, "mouseout", this, function(evt){
dojo.stopEvent(evt);
dijit.typematic.stop();
}),
dc(node, "mousemove", this, function(evt){
evt.preventDefault();
}),
dc(node, "dblclick", this, function(evt){
dojo.stopEvent(evt);
if(dojo.isIE){
dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
}
})
];
},
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 = {
if(cs){ onload: function(){
var _2=cs.backgroundImage; // summary:
var _3=(cs.borderTopColor==cs.borderRightColor)||(_2!=null&&(_2=="none"||_2=="url(invalid-url:)")); // Detects if we are in high-contrast mode or not
dojo[_3?"addClass":"removeClass"](dojo.body(),"dijit_a11y");
if(dojo.isIE){ // This must be a named function and not an anonymous
_1.outerHTML=""; // function, so that the widget parsing code can make sure it
}else{ // registers its onload function after this function.
dojo.body().removeChild(_1); // 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){
var bkImg = cs.backgroundImage;
var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
if(dojo.isIE){
div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
}else{
dojo.body().removeChild(div);
}
}
}
};
// 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.mixin(dijit, {
if(dojo.isIE||dojo.isMoz){ hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
dojo._loaders.unshift(dijit.wai.onload); // summary:
} // Determines if an element has a particular role.
dojo.mixin(dijit,{_XhtmlRoles:/banner|contentinfo|definition|main|navigation|search|note|secondary|seealso/,hasWaiRole:function(_4,_5){ // returns:
var _6=this.getWaiRole(_4); // True if elem has the specific role attribute and false if not.
return _5?(_6.indexOf(_5)>-1):(_6.length>0); // For backwards compatibility if role parameter not provided,
},getWaiRole:function(_7){ // returns true if has a role
return dojo.trim((dojo.attr(_7,"role")||"").replace(this._XhtmlRoles,"").replace("wairole:","")); var waiRole = this.getWaiRole(elem);
},setWaiRole:function(_8,_9){ return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
var _a=dojo.attr(_8,"role")||""; },
if(!this._XhtmlRoles.test(_a)){
dojo.attr(_8,"role",_9); getWaiRole: function(/*Element*/ elem){
}else{ // summary:
if((" "+_a+" ").indexOf(" "+_9+" ")<0){ // Gets the role for an element (which should be a wai role).
var _b=dojo.trim(_a.replace(this._XhtmlRoles,"")); // returns:
var _c=dojo.trim(_a.replace(_b,"")); // The role of elem or an empty string if elem
dojo.attr(_8,"role",_c+(_c?" ":"")+_9); // does not have a role.
} return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
} },
},removeWaiRole:function(_d,_e){
var _f=dojo.attr(_d,"role"); setWaiRole: function(/*Element*/ elem, /*String*/ role){
if(!_f){ // summary:
return; // Sets the role on an element.
} // description:
if(_e){ // Replace existing role attribute with new role.
var t=dojo.trim((" "+_f+" ").replace(" "+_e+" "," "));
dojo.attr(_d,"role",t); dojo.attr(elem, "role", role);
}else{ },
_d.removeAttribute("role");
} removeWaiRole: function(/*Element*/ elem, /*String*/ role){
},hasWaiState:function(_10,_11){ // summary:
return _10.hasAttribute?_10.hasAttribute("aria-"+_11):!!_10.getAttribute("aria-"+_11); // Removes the specified role from an element.
},getWaiState:function(_12,_13){ // Removes role attribute if no specific role provided (for backwards compat.)
return _12.getAttribute("aria-"+_13)||"";
},setWaiState:function(_14,_15,_16){ var roleValue = dojo.attr(elem, "role");
_14.setAttribute("aria-"+_15,_16); if(!roleValue){ return; }
},removeWaiState:function(_17,_18){ if(role){
_17.removeAttribute("aria-"+_18); var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
}}); dojo.attr(elem, "role", t);
}else{
elem.removeAttribute("role");
}
},
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);
}
});
} }

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.mixin(this,this.params); dojo.declare("dijit._editor._Plugin", null, {
this._connects=[]; // summary
},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:true,buttonClass:dijit.form.Button,getLabel:function(_3){ // Base class for a "plugin" to the editor, which is usually
return this.editor.commands[_3]; // a single button on the Toolbar and some associated code
},_initButton:function(){
if(this.command.length){ constructor: function(/*Object?*/args, /*DomNode?*/node){
var _4=this.getLabel(this.command),_5=this.editor,_6=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1); this.params = args || {};
if(!this.button){ dojo.mixin(this, this.params);
var _7=dojo.mixin({label:_4,dir:_5.dir,lang:_5.lang,showLabel:false,iconClass:_6,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}); this._connects=[];
this.button=new this.buttonClass(_7); this._attrPairNames = {};
} },
}
},destroy:function(){ // editor: [const] dijit.Editor
dojo.forEach(this._connects,dojo.disconnect); // Points to the parent editor
if(this.dropDown){ editor: null,
this.dropDown.destroyRecursive();
} // iconClassPrefix: [const] String
},connect:function(o,f,tf){ // The CSS class name for the button node is formed from `iconClassPrefix` and `command`
this._connects.push(dojo.connect(o,f,this,tf)); iconClassPrefix: "dijitEditorIcon",
},updateState:function(){
var e=this.editor,c=this.command,_8,_9; // button: dijit._Widget?
if(!e||!e.isLoaded||!c.length){ // Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`)
return; // that is added to the toolbar to control this plugin.
} // If not specified, will be created on initialization according to `buttonClass`
if(this.button){ button: null,
try{
_9=e.queryCommandEnabled(c); // command: String
if(this.enabled!==_9){ // String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command.
this.enabled=_9; // Passed to editor.execCommand() if `useDefaultCommand` is true.
this.button.set("disabled",!_9); command: "",
}
if(typeof this.button.checked=="boolean"){ // useDefaultCommand: Boolean
_8=e.queryCommandState(c); // If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`.
if(this.checked!==_8){ useDefaultCommand: true,
this.checked=_8;
this.button.set("checked",e.queryCommandState(c)); // 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.
catch(e){ buttonClass: dijit.form.Button,
}
} // disabled: Boolean
},setEditor:function(_a){ // Flag to indicate if this plugin has been disabled and should do nothing
this.editor=_a; // helps control button state, among other things. Set via the setter api.
this._initButton(); disabled: false,
if(this.button&&this.useDefaultCommand){
if(this.editor.queryCommandAvailable(this.command)){ getLabel: function(/*String*/key){
this.connect(this.button,"onClick",dojo.hitch(this.editor,"execCommand",this.command,this.commandArg)); // summary:
}else{ // Returns the label to use for the button
this.button.domNode.style.display="none"; // tags:
} // private
} return this.editor.commands[key]; // String
this.connect(this.editor,"onNormalizedDisplayChanged","updateState"); },
},setToolbar:function(_b){
if(this.button){ _initButton: function(){
_b.addChild(this.button); // 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){
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){
var props = dojo.mixin({
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);
}
}
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);
if(this.dropDown){
this.dropDown.destroyRecursive();
}
},
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));
},
updateState: function(){
// 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){
try{
enabled = !disabled && e.queryCommandEnabled(c);
if(this.enabled !== enabled){
this.enabled = enabled;
this.button.set('disabled', !enabled);
}
if(typeof this.button.checked == 'boolean'){
checked = e.queryCommandState(c);
if(this.checked !== checked){
this.checked = checked;
this.button.set('checked', e.queryCommandState(c));
}
}
}catch(e){
console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error?
}
}
},
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();
// Processing for buttons that execute by calling editor.execCommand()
if(this.button && this.useDefaultCommand){
if(this.editor.queryCommandAvailable(this.command)){
this.connect(this.button, "onClick",
dojo.hitch(this.editor, "execCommand", this.command, this.commandArg)
);
}else{
// hide button because editor doesn't support command (due to browser limitations)
this.button.domNode.style.display = "none";
}
}
this.connect(this.editor, "onNormalizedDisplayChanged", "updateState");
},
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){
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:
return _1; // 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 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();
return ""; if(!lName || lName.charAt(0) == "/"){
} // IE does some strange things with malformed HTML input, like
_4="<"+_5; // treating a close tag </span> without an open tag <span>, as
var _6=[]; // a new tag with tagName of /span. Corrupts output HTML, remove
var _7; // them. Other browsers don't prefix tags that way, so will
if(dojo.isIE&&_3.outerHTML){ // never show up.
var s=_3.outerHTML; return "";
s=s.substr(0,s.indexOf(">")).replace(/(['"])[^"']*\1/g,""); }
var _8=/(\b\w+)\s?=/g; output = '<' + lName;
var m,_9;
while((m=_8.exec(s))){ //store the list of attributes and sort it to have the
_9=m[1]; //attributes appear in the dictionary order
if(_9.substr(0,3)!="_dj"){ var attrarray = [];
if(_9=="src"||_9=="href"){ var attr;
if(_3.getAttribute("_djrealurl")){ if(dojo.isIE && node.outerHTML){
_6.push([_9,_3.getAttribute("_djrealurl")]); var s = node.outerHTML;
continue; s = s.substr(0, s.indexOf('>'))
} .replace(/(['"])[^"']*\1/g, ''); //to make the following regexp safe
} var reg = /(\b\w+)\s?=/g;
var _a,_b; var m, key;
switch(_9){ while((m = reg.exec(s))){
case "style": key = m[1];
_a=_3.style.cssText.toLowerCase(); if(key.substr(0,3) != '_dj'){
break; if(key == 'src' || key == 'href'){
case "class": if(node.getAttribute('_djrealurl')){
_a=_3.className; attrarray.push([key,node.getAttribute('_djrealurl')]);
break; continue;
case "width": }
if(_5==="img"){ }
_b=/width=(\S+)/i.exec(s); var val, match;
if(_b){ switch(key){
_a=_b[1]; case 'style':
} val = node.style.cssText.toLowerCase();
break; break;
} case 'class':
case "height": val = node.className;
if(_5==="img"){ break;
_b=/height=(\S+)/i.exec(s); case 'width':
if(_b){ if(lName === "img"){
_a=_b[1]; // This somehow gets lost on IE for IMG tags and the like
} // and we have to find it in outerHTML, known IE oddity.
break; match=/width=(\S+)/i.exec(s);
} if(match){
default: val = match[1];
_a=_3.getAttribute(_9); }
} break;
if(_a!=null){ }
_6.push([_9,_a.toString()]); case 'height':
} if(lName === "img"){
} // This somehow gets lost on IE for IMG tags and the like
} // and we have to find it in outerHTML, known IE oddity.
}else{ match=/height=(\S+)/i.exec(s);
var i=0; if(match){
while((_7=_3.attributes[i++])){ val = match[1];
var n=_7.name; }
if(n.substr(0,3)!="_dj"){ break;
var v=_7.value; }
if(n=="src"||n=="href"){ default:
if(_3.getAttribute("_djrealurl")){ val = node.getAttribute(key);
v=_3.getAttribute("_djrealurl"); }
} if(val != null){
} attrarray.push([key, val.toString()]);
_6.push([n,v]); }
} }
} }
} }else{
_6.sort(function(a,b){ var i = 0;
return a[0]<b[0]?-1:(a[0]==b[0]?0:1); while((attr = node.attributes[i++])){
}); //ignore all attributes starting with _dj which are
var j=0; //internal temporary attributes used by the editor
while((_7=_6[j++])){ var n = attr.name;
_4+=" "+_7[0]+"=\""+(dojo.isString(_7[1])?dijit._editor.escapeXml(_7[1],true):_7[1])+"\""; if(n.substr(0,3) != '_dj' /*&&
} (attr.specified == undefined || attr.specified)*/){
if(_5==="script"){ var v = attr.value;
_4+=">"+_3.innerHTML+"</"+_5+">"; if(n == 'src' || n == 'href'){
}else{ if(node.getAttribute('_djrealurl')){
if(_3.childNodes.length){ v = node.getAttribute('_djrealurl');
_4+=">"+dijit._editor.getChildrenHtml(_3)+"</"+_5+">"; }
}else{ }
switch(_5){ attrarray.push([n,v]);
case "br": }
case "hr": }
case "img": }
case "input": attrarray.sort(function(a,b){
case "base": return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1);
case "meta": });
case "area": var j = 0;
case "basefont": while((attr = attrarray[j++])){
_4+=" />"; output += ' ' + attr[0] + '="' +
break; (dojo.isString(attr[1]) ? dijit._editor.escapeXml(attr[1], true) : attr[1]) + '"';
default: }
_4+="></"+_5+">"; if(lName === "script"){
} // 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
break; // seem to want to do it, so we need to at least return them right.
case 4: // other plugins/filters can strip them.
case 3: output += '>' + node.innerHTML +'</' + lName + '>';
_4=dijit._editor.escapeXml(_3.nodeValue,true); }else{
break; if(node.childNodes.length){
case 8: output += '>' + dijit._editor.getChildrenHtml(node)+'</' + lName +'>';
_4="<!--"+dijit._editor.escapeXml(_3.nodeValue,true)+"-->"; }else{
break; switch(lName){
default: case 'br':
_4="<!-- Element not recognized - Type: "+_3.nodeType+" Name: "+_3.nodeName+"-->"; case 'hr':
} case 'img':
return _4; case 'input':
case 'base':
case 'meta':
case 'area':
case 'basefont':
// These should all be singly closed
output += ' />';
break;
default:
// Assume XML style separate closure for everything else.
output += '></' + lName + '>';
}
}
}
break;
case 4: // cdata
case 3: // text
// FIXME:
output = dijit._editor.escapeXml(node.nodeValue, true);
break;
case 8: //comment
// FIXME:
output = '<!--' + dijit._editor.escapeXml(node.nodeValue, true) + '-->';
break;
default:
output = "<!-- Element not recognized - Type: " + node.nodeType + " Name: " + node.nodeName + "-->";
}
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;
return _d;
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 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 @@
({"text":"Descripción: ","insertImageTitle":"Propiedades de la imagen","set":"Establecer","newWindow":"Nueva ventana","topWindow":"Ventana superior","target":"Destino: ","createLinkTitle":"Propiedades del enlace","parentWindow":"Ventana padre","currentWindow":"Ventana actual","url":"URL:"}) ({"text":"Descripción:","insertImageTitle":"Propiedades de la imagen","set":"Establecer","newWindow":"Nueva ventana","topWindow":"Ventana superior","target":"Destino:","createLinkTitle":"Propiedades del enlace","parentWindow":"Ventana padre","currentWindow":"Ventana actual","url":"URL:"})

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 @@
({"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":"מחיקה","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":"יישור לימין"}) ({"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-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"})

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