upgrade Dojo to 1.6.1
parent
870a70e109
commit
81bea17aef
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.CheckedMenuItem"]){
|
||||
dojo._hasResource["dijit.CheckedMenuItem"]=true;
|
||||
if(!dojo._hasResource["dijit.CheckedMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.CheckedMenuItem"] = true;
|
||||
dojo.provide("dijit.CheckedMenuItem");
|
||||
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\">✓</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\"> </td>\n</tr>\n"),checked:false,_setCheckedAttr:function(_1){
|
||||
dojo.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",_1);
|
||||
dijit.setWaiState(this.domNode,"checked",_1);
|
||||
this.checked=_1;
|
||||
},onChange:function(_2){
|
||||
},_onClick:function(e){
|
||||
if(!this.disabled){
|
||||
this.set("checked",!this.checked);
|
||||
this.onChange(this.checked);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.CheckedMenuItem",
|
||||
dijit.MenuItem,
|
||||
{
|
||||
// summary:
|
||||
// A checkbox-like menu item for toggling on and off
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/CheckedMenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">✓</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\"> </td>\n</tr>\n"),
|
||||
|
||||
// checked: Boolean
|
||||
// Our checked state
|
||||
checked: false,
|
||||
_setCheckedAttr: function(/*Boolean*/ checked){
|
||||
// summary:
|
||||
// Hook so attr('checked', bool) works.
|
||||
// Sets the class and state for the check box.
|
||||
dojo.toggleClass(this.domNode, "dijitCheckedMenuItemChecked", checked);
|
||||
dijit.setWaiState(this.domNode, "checked", checked);
|
||||
this._set("checked", checked);
|
||||
},
|
||||
|
||||
onChange: function(/*Boolean*/ checked){
|
||||
// summary:
|
||||
// User defined function to handle check/uncheck events
|
||||
// tags:
|
||||
// callback
|
||||
},
|
||||
|
||||
_onClick: function(/*Event*/ e){
|
||||
// summary:
|
||||
// Clicking this item just toggles its state
|
||||
// tags:
|
||||
// private
|
||||
if(!this.disabled){
|
||||
this.set("checked", !this.checked);
|
||||
this.onChange(this.checked);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.ColorPalette"]){
|
||||
dojo._hasResource["dijit.ColorPalette"]=true;
|
||||
if(!dojo._hasResource["dijit.ColorPalette"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.ColorPalette"] = true;
|
||||
dojo.provide("dijit.ColorPalette");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dojo.colors");
|
||||
dojo.require("dojo.i18n");
|
||||
dojo.require("dojo.string");
|
||||
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.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());
|
||||
var _1=dojo.i18n.getLocalization("dojo","colors",this.lang);
|
||||
this._preparePalette(this._palettes[this.palette],_1);
|
||||
}});
|
||||
dojo.declare("dijit._Color",dojo.Color,{constructor:function(_2){
|
||||
this._alias=_2;
|
||||
this.setColor(dojo.Color.named[_2]);
|
||||
},getValue:function(){
|
||||
return this.toHex();
|
||||
},fillCell:function(_3,_4){
|
||||
dojo.create("img",{src:_4,"class":"dijitPaletteImg",alt:this._alias},_3);
|
||||
}});
|
||||
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],
|
||||
{
|
||||
// summary:
|
||||
// A keyboard accessible color-picking widget
|
||||
// description:
|
||||
// Grid showing various colors, so the user can pick a certain color.
|
||||
// Can be used standalone, or as a popup.
|
||||
//
|
||||
// example:
|
||||
// | <div dojoType="dijit.ColorPalette"></div>
|
||||
//
|
||||
// example:
|
||||
// | var picker = new dijit.ColorPalette({ },srcNode);
|
||||
// | picker.startup();
|
||||
|
||||
|
||||
// palette: [const] String
|
||||
// Size of grid, either "7x10" or "3x4".
|
||||
palette: "7x10",
|
||||
|
||||
// _palettes: [protected] Map
|
||||
// This represents the value of the colors.
|
||||
// The first level is a hashmap of the different palettes available.
|
||||
// The next two dimensions represent the columns and rows of colors.
|
||||
_palettes: {
|
||||
"7x10": [["white", "seashell", "cornsilk", "lemonchiffon","lightyellow", "palegreen", "paleturquoise", "lightcyan", "lavender", "plum"],
|
||||
["lightgray", "pink", "bisque", "moccasin", "khaki", "lightgreen", "lightseagreen", "lightskyblue", "cornflowerblue", "violet"],
|
||||
["silver", "lightcoral", "sandybrown", "orange", "palegoldenrod", "chartreuse", "mediumturquoise", "skyblue", "mediumslateblue","orchid"],
|
||||
["gray", "red", "orangered", "darkorange", "yellow", "limegreen", "darkseagreen", "royalblue", "slateblue", "mediumorchid"],
|
||||
["dimgray", "crimson", "chocolate", "coral", "gold", "forestgreen", "seagreen", "blue", "blueviolet", "darkorchid"],
|
||||
["darkslategray","firebrick","saddlebrown", "sienna", "olive", "green", "darkcyan", "mediumblue","darkslateblue", "darkmagenta" ],
|
||||
["black", "darkred", "maroon", "brown", "darkolivegreen", "darkgreen", "midnightblue", "navy", "indigo", "purple"]],
|
||||
|
||||
"3x4": [["white", "lime", "green", "blue"],
|
||||
["silver", "yellow", "fuchsia", "navy"],
|
||||
["gray", "red", "purple", "black"]]
|
||||
},
|
||||
|
||||
// templateString: String
|
||||
// The template of this widget.
|
||||
templateString: dojo.cache("dijit", "templates/ColorPalette.html", "<div class=\"dijitInline dijitColorPalette\">\n\t<table class=\"dijitPaletteTable\" cellSpacing=\"0\" cellPadding=\"0\">\n\t\t<tbody dojoAttachPoint=\"gridNode\"></tbody>\n\t</table>\n</div>\n"),
|
||||
|
||||
baseClass: "dijitColorPalette",
|
||||
|
||||
buildRendering: function(){
|
||||
// Instantiate the template, which makes a skeleton into which we'll insert a bunch of
|
||||
// <img> nodes
|
||||
this.inherited(arguments);
|
||||
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.Declaration"]){
|
||||
dojo._hasResource["dijit.Declaration"]=true;
|
||||
if(!dojo._hasResource["dijit.Declaration"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.Declaration"] = true;
|
||||
dojo.provide("dijit.Declaration");
|
||||
dojo.require("dijit._Widget");
|
||||
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.forEach(_2,function(s){
|
||||
var _7=s.getAttribute("event"),_8=dojo.parser._functionFromScript(s);
|
||||
_6[_7]=_8;
|
||||
});
|
||||
this.mixins=this.mixins.length?dojo.map(this.mixins,function(_9){
|
||||
return dojo.getObject(_9);
|
||||
}):[dijit._Widget,dijit._Templated];
|
||||
_6.widgetsInTemplate=true;
|
||||
_6._skipNodeCache=true;
|
||||
_6.templateString="<"+_5+" class='"+_1.className+"' dojoAttachPoint='"+(_1.getAttribute("dojoAttachPoint")||"")+"' dojoAttachEvent='"+(_1.getAttribute("dojoAttachEvent")||"")+"' >"+_1.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+_5+">";
|
||||
dojo.query("[dojoType]",_1).forEach(function(_a){
|
||||
_a.removeAttribute("dojoType");
|
||||
});
|
||||
var wc=dojo.declare(this.widgetClass,this.mixins,_6);
|
||||
var _b=_4.concat(_3);
|
||||
dojo.forEach(_b,function(s){
|
||||
var _c=s.getAttribute("event")||"postscript",_d=dojo.parser._functionFromScript(s);
|
||||
dojo.connect(wc.prototype,_c,_d);
|
||||
});
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare(
|
||||
"dijit.Declaration",
|
||||
dijit._Widget,
|
||||
{
|
||||
// summary:
|
||||
// The Declaration widget allows a developer to declare new widget
|
||||
// classes directly from a snippet of markup.
|
||||
|
||||
// _noScript: [private] Boolean
|
||||
// Flag to parser to leave alone the script tags contained inside of me
|
||||
_noScript: true,
|
||||
|
||||
// stopParser: [private] Boolean
|
||||
// Flag to parser to not try and parse widgets declared inside of me
|
||||
stopParser: true,
|
||||
|
||||
// widgetClass: [const] String
|
||||
// Name of class being declared, ex: "acme.myWidget"
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.DialogUnderlay"]){
|
||||
dojo._hasResource["dijit.DialogUnderlay"]=true;
|
||||
if(!dojo._hasResource["dijit.DialogUnderlay"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.DialogUnderlay"] = true;
|
||||
dojo.provide("dijit.DialogUnderlay");
|
||||
dojo.require("dojo.window");
|
||||
dojo.require("dijit._Widget");
|
||||
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){
|
||||
this.node.className="dijitDialogUnderlay "+_1;
|
||||
},postCreate:function(){
|
||||
dojo.body().appendChild(this.domNode);
|
||||
},layout:function(){
|
||||
var is=this.node.style,os=this.domNode.style;
|
||||
os.display="none";
|
||||
var _2=dojo.window.getBox();
|
||||
os.top=_2.t+"px";
|
||||
os.left=_2.l+"px";
|
||||
is.width=_2.w+"px";
|
||||
is.height=_2.h+"px";
|
||||
os.display="block";
|
||||
},show:function(){
|
||||
this.domNode.style.display="block";
|
||||
this.layout();
|
||||
this.bgIframe=new dijit.BackgroundIframe(this.domNode);
|
||||
},hide:function(){
|
||||
this.bgIframe.destroy();
|
||||
this.domNode.style.display="none";
|
||||
},uninitialize:function(){
|
||||
if(this.bgIframe){
|
||||
this.bgIframe.destroy();
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare(
|
||||
"dijit.DialogUnderlay",
|
||||
[dijit._Widget, dijit._Templated],
|
||||
{
|
||||
// summary:
|
||||
// The component that blocks the screen behind a `dijit.Dialog`
|
||||
//
|
||||
// description:
|
||||
// A component used to block input behind a `dijit.Dialog`. Only a single
|
||||
// instance of this widget is created by `dijit.Dialog`, and saved as
|
||||
// a reference to be shared between all Dialogs as `dijit._underlay`
|
||||
//
|
||||
// The underlay itself can be styled based on and id:
|
||||
// | #myDialog_underlay { background-color:red; }
|
||||
//
|
||||
// In the case of `dijit.Dialog`, this id is based on the id of the Dialog,
|
||||
// suffixed with _underlay.
|
||||
|
||||
// Template has two divs; outer div is used for fade-in/fade-out, and also to hold background iframe.
|
||||
// Inner div has opacity specified in CSS file.
|
||||
templateString: "<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",
|
||||
|
||||
// Parameters on creation or updatable later
|
||||
|
||||
// dialogId: String
|
||||
// Id of the dialog.... DialogUnderlay's id is based on this id
|
||||
dialogId: "",
|
||||
|
||||
// class: String
|
||||
// This class name is used on the DialogUnderlay node, in addition to dijitDialogUnderlay
|
||||
"class": "",
|
||||
|
||||
attributeMap: { id: "domNode" },
|
||||
|
||||
_setDialogIdAttr: function(id){
|
||||
dojo.attr(this.node, "id", id + "_underlay");
|
||||
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
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.InlineEditBox"]){
|
||||
dojo._hasResource["dijit.InlineEditBox"]=true;
|
||||
if(!dojo._hasResource["dijit.InlineEditBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.InlineEditBox"] = true;
|
||||
dojo.provide("dijit.InlineEditBox");
|
||||
dojo.require("dojo.i18n");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Container");
|
||||
dojo.require("dijit.form.Button");
|
||||
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.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;'> ✍ </span>":"<span style='text-decoration: underline;'> ✍ </span>",constructor:function(){
|
||||
this.editorParams={};
|
||||
},postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this.displayNode=this.srcNodeRef;
|
||||
var _2={ondijitclick:"_onClick",onmouseover:"_onMouseOver",onmouseout:"_onMouseOut",onfocus:"_onMouseOver",onblur:"_onMouseOut"};
|
||||
for(var _3 in _2){
|
||||
this.connect(this.displayNode,_3,_2[_3]);
|
||||
}
|
||||
dijit.setWaiRole(this.displayNode,"button");
|
||||
if(!this.displayNode.getAttribute("tabIndex")){
|
||||
this.displayNode.setAttribute("tabIndex",0);
|
||||
}
|
||||
if(!this.value&&!("value" in this.params)){
|
||||
this.value=dojo.trim(this.renderAsHtml?this.displayNode.innerHTML:(this.displayNode.innerText||this.displayNode.textContent||""));
|
||||
}
|
||||
if(!this.value){
|
||||
this.displayNode.innerHTML=this.noValueIndicator;
|
||||
}
|
||||
dojo.addClass(this.displayNode,"dijitInlineEditBoxDisplayMode");
|
||||
},setDisabled:function(_4){
|
||||
dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.","","2.0");
|
||||
this.set("disabled",_4);
|
||||
},_setDisabledAttr:function(_5){
|
||||
this.disabled=_5;
|
||||
dijit.setWaiState(this.domNode,"disabled",_5);
|
||||
if(_5){
|
||||
this.displayNode.removeAttribute("tabIndex");
|
||||
}else{
|
||||
this.displayNode.setAttribute("tabIndex",0);
|
||||
}
|
||||
dojo.toggleClass(this.displayNode,"dijitInlineEditBoxDisplayModeDisabled",_5);
|
||||
},_onMouseOver:function(){
|
||||
if(!this.disabled){
|
||||
dojo.addClass(this.displayNode,"dijitInlineEditBoxDisplayModeHover");
|
||||
}
|
||||
},_onMouseOut:function(){
|
||||
dojo.removeClass(this.displayNode,"dijitInlineEditBoxDisplayModeHover");
|
||||
},_onClick:function(e){
|
||||
if(this.disabled){
|
||||
return;
|
||||
}
|
||||
if(e){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
this._onMouseOut();
|
||||
setTimeout(dojo.hitch(this,"edit"),0);
|
||||
},edit:function(){
|
||||
if(this.disabled||this.editing){
|
||||
return;
|
||||
}
|
||||
this.editing=true;
|
||||
this._savedPosition=dojo.style(this.displayNode,"position")||"static";
|
||||
this._savedOpacity=dojo.style(this.displayNode,"opacity")||"1";
|
||||
this._savedTabIndex=dojo.attr(this.displayNode,"tabIndex")||"0";
|
||||
if(this.wrapperWidget){
|
||||
var ew=this.wrapperWidget.editWidget;
|
||||
ew.set("displayedValue" in ew?"displayedValue":"value",this.value);
|
||||
}else{
|
||||
var _6=dojo.create("span",null,this.domNode,"before");
|
||||
var _7=dojo.getObject(this.editorWrapper);
|
||||
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);
|
||||
}
|
||||
var ww=this.wrapperWidget;
|
||||
if(dojo.isIE){
|
||||
dijit.focus(dijit.getFocus());
|
||||
}
|
||||
dojo.style(this.displayNode,{position:"absolute",opacity:"0",display:"none"});
|
||||
dojo.style(ww.domNode,{position:this._savedPosition,visibility:"visible",opacity:"1"});
|
||||
dojo.attr(this.displayNode,"tabIndex","-1");
|
||||
setTimeout(dojo.hitch(this,function(){
|
||||
ww.focus();
|
||||
ww._resetValue=ww.getValue();
|
||||
}),0);
|
||||
},_onBlur:function(){
|
||||
this.inherited(arguments);
|
||||
if(!this.editing){
|
||||
}
|
||||
},destroy:function(){
|
||||
if(this.wrapperWidget){
|
||||
this.wrapperWidget.destroy();
|
||||
delete this.wrapperWidget;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_showText:function(_8){
|
||||
var ww=this.wrapperWidget;
|
||||
dojo.style(ww.domNode,{position:"absolute",visibility:"hidden",opacity:"0"});
|
||||
dojo.style(this.displayNode,{position:this._savedPosition,opacity:this._savedOpacity,display:""});
|
||||
dojo.attr(this.displayNode,"tabIndex",this._savedTabIndex);
|
||||
if(_8){
|
||||
dijit.focus(this.displayNode);
|
||||
}
|
||||
},save:function(_9){
|
||||
if(this.disabled||!this.editing){
|
||||
return;
|
||||
}
|
||||
this.editing=false;
|
||||
var ww=this.wrapperWidget;
|
||||
var _a=ww.getValue();
|
||||
this.set("value",_a);
|
||||
setTimeout(dojo.hitch(this,"onChange",_a),0);
|
||||
this._showText(_9);
|
||||
},setValue:function(_b){
|
||||
dojo.deprecated("dijit.InlineEditBox.setValue() is deprecated. Use set('value', ...) instead.","","2.0");
|
||||
return this.set("value",_b);
|
||||
},_setValueAttr:function(_c){
|
||||
this.value=_c=dojo.trim(_c);
|
||||
if(!this.renderAsHtml){
|
||||
_c=_c.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""").replace(/\n/g,"<br>");
|
||||
}
|
||||
this.displayNode.innerHTML=_c||this.noValueIndicator;
|
||||
},getValue:function(){
|
||||
dojo.deprecated("dijit.InlineEditBox.getValue() is deprecated. Use get('value') instead.","","2.0");
|
||||
return this.get("value");
|
||||
},cancel:function(_d){
|
||||
if(this.disabled||!this.editing){
|
||||
return;
|
||||
}
|
||||
this.editing=false;
|
||||
setTimeout(dojo.hitch(this,"onCancel"),0);
|
||||
this._showText(_d);
|
||||
}});
|
||||
dojo.declare("dijit._InlineEditor",[dijit._Widget,dijit._Templated],{templateString:dojo.cache("dijit","templates/InlineEditBox.html","<span dojoAttachPoint=\"editNode\" waiRole=\"presentation\" style=\"position: absolute; visibility:hidden\" class=\"dijitReset dijitInline\"\n\tdojoAttachEvent=\"onkeypress: _onKeyPress\"\n\t><span dojoAttachPoint=\"editorPlaceholder\"></span\n\t><span dojoAttachPoint=\"buttonContainer\"\n\t\t><button class='saveButton' dojoAttachPoint=\"saveButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:save\" label=\"${buttonSave}\"></button\n\t\t><button class='cancelButton' dojoAttachPoint=\"cancelButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:cancel\" label=\"${buttonCancel}\"></button\n\t></span\n></span>\n"),widgetsInTemplate:true,postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this.messages=dojo.i18n.getLocalization("dijit","common",this.lang);
|
||||
dojo.forEach(["buttonSave","buttonCancel"],function(_e){
|
||||
if(!this[_e]){
|
||||
this[_e]=this.messages[_e];
|
||||
}
|
||||
},this);
|
||||
},postCreate:function(){
|
||||
var _f=dojo.getObject(this.editor);
|
||||
var _10=this.sourceStyle,_11="line-height:"+_10.lineHeight+";",_12=dojo.getComputedStyle(this.domNode);
|
||||
dojo.forEach(["Weight","Family","Size","Style"],function(_13){
|
||||
var _14=_10["font"+_13],_15=_12["font"+_13];
|
||||
if(_15!=_14){
|
||||
_11+="font-"+_13+":"+_10["font"+_13]+";";
|
||||
}
|
||||
},this);
|
||||
dojo.forEach(["marginTop","marginBottom","marginLeft","marginRight"],function(_16){
|
||||
this.domNode.style[_16]=_10[_16];
|
||||
},this);
|
||||
var _17=this.inlineEditBox.width;
|
||||
if(_17=="100%"){
|
||||
_11+="width:100%;";
|
||||
this.domNode.style.display="block";
|
||||
}else{
|
||||
_11+="width:"+(_17+(Number(_17)==_17?"px":""))+";";
|
||||
}
|
||||
var _18=dojo.delegate(this.inlineEditBox.editorParams,{style:_11,dir:this.dir,lang:this.lang});
|
||||
_18["displayedValue" in _f.prototype?"displayedValue":"value"]=this.value;
|
||||
var ew=(this.editWidget=new _f(_18,this.editorPlaceholder));
|
||||
if(this.inlineEditBox.autoSave){
|
||||
dojo.destroy(this.buttonContainer);
|
||||
this.connect(ew,"onChange","_onChange");
|
||||
this.connect(ew,"onKeyPress","_onKeyPress");
|
||||
}else{
|
||||
if("intermediateChanges" in _f.prototype){
|
||||
ew.set("intermediateChanges",true);
|
||||
this.connect(ew,"onChange","_onIntermediateChange");
|
||||
this.saveButton.set("disabled",true);
|
||||
}
|
||||
}
|
||||
},_onIntermediateChange:function(val){
|
||||
this.saveButton.set("disabled",(this.getValue()==this._resetValue)||!this.enableSave());
|
||||
},destroy:function(){
|
||||
this.editWidget.destroy(true);
|
||||
this.inherited(arguments);
|
||||
},getValue:function(){
|
||||
var ew=this.editWidget;
|
||||
return String(ew.get("displayedValue" in ew?"displayedValue":"value"));
|
||||
},_onKeyPress:function(e){
|
||||
if(this.inlineEditBox.autoSave&&this.inlineEditBox.editing){
|
||||
if(e.altKey||e.ctrlKey){
|
||||
return;
|
||||
}
|
||||
if(e.charOrCode==dojo.keys.ESCAPE){
|
||||
dojo.stopEvent(e);
|
||||
this.cancel(true);
|
||||
}else{
|
||||
if(e.charOrCode==dojo.keys.ENTER&&e.target.tagName=="INPUT"){
|
||||
dojo.stopEvent(e);
|
||||
this._onChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
},_onBlur:function(){
|
||||
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(){
|
||||
if(this.inlineEditBox.autoSave&&this.inlineEditBox.editing&&this.enableSave()){
|
||||
dojo.style(this.inlineEditBox.displayNode,{display:""});
|
||||
dijit.focus(this.inlineEditBox.displayNode);
|
||||
}
|
||||
},enableSave:function(){
|
||||
return (this.editWidget.isValid?this.editWidget.isValid():true);
|
||||
},focus:function(){
|
||||
this.editWidget.focus();
|
||||
setTimeout(dojo.hitch(this,function(){
|
||||
if(this.editWidget.focusNode&&this.editWidget.focusNode.tagName=="INPUT"){
|
||||
dijit.selectInputText(this.editWidget.focusNode);
|
||||
}
|
||||
}),0);
|
||||
}});
|
||||
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,
|
||||
{
|
||||
// summary:
|
||||
// An element with in-line edit capabilites
|
||||
//
|
||||
// description:
|
||||
// Behavior for an existing node (`<p>`, `<div>`, `<span>`, etc.) so that
|
||||
// when you click it, an editor shows up in place of the original
|
||||
// text. Optionally, Save and Cancel button are displayed below the edit widget.
|
||||
// When Save is clicked, the text is pulled from the edit
|
||||
// widget and redisplayed and the edit widget is again hidden.
|
||||
// By default a plain Textarea widget is used as the editor (or for
|
||||
// inline values a TextBox), but you can specify an editor such as
|
||||
// dijit.Editor (for editing HTML) or a Slider (for adjusting a number).
|
||||
// An edit widget must support the following API to be used:
|
||||
// - displayedValue or value as initialization parameter,
|
||||
// and available through set('displayedValue') / set('value')
|
||||
// - void focus()
|
||||
// - DOM-node focusNode = node containing editable text
|
||||
|
||||
// editing: [readonly] Boolean
|
||||
// Is the node currently in edit mode?
|
||||
editing: false,
|
||||
|
||||
// autoSave: Boolean
|
||||
// Changing the value automatically saves it; don't have to push save button
|
||||
// (and save button isn't even displayed)
|
||||
autoSave: true,
|
||||
|
||||
// buttonSave: String
|
||||
// Save button label
|
||||
buttonSave: "",
|
||||
|
||||
// buttonCancel: String
|
||||
// Cancel button label
|
||||
buttonCancel: "",
|
||||
|
||||
// renderAsHtml: Boolean
|
||||
// Set this to true if the specified Editor's value should be interpreted as HTML
|
||||
// rather than plain text (ex: `dijit.Editor`)
|
||||
renderAsHtml: false,
|
||||
|
||||
// editor: String|Function
|
||||
// Class name (or reference to the Class) for Editor widget
|
||||
editor: "dijit.form.TextBox",
|
||||
|
||||
// editorWrapper: String|Function
|
||||
// Class name (or reference to the Class) for widget that wraps the editor widget, displaying save/cancel
|
||||
// buttons.
|
||||
editorWrapper: "dijit._InlineEditor",
|
||||
|
||||
// editorParams: Object
|
||||
// Set of parameters for editor, like {required: true}
|
||||
editorParams: {},
|
||||
|
||||
// disabled: Boolean
|
||||
// If true, clicking the InlineEditBox to edit it will have no effect.
|
||||
disabled: false,
|
||||
|
||||
onChange: function(value){
|
||||
// summary:
|
||||
// Set this handler to be notified of changes to value.
|
||||
// tags:
|
||||
// callback
|
||||
},
|
||||
|
||||
onCancel: function(){
|
||||
// summary:
|
||||
// Set this handler to be notified when editing is cancelled.
|
||||
// tags:
|
||||
// callback
|
||||
},
|
||||
|
||||
// width: String
|
||||
// Width of editor. By default it's width=100% (ie, block mode).
|
||||
width: "100%",
|
||||
|
||||
// value: String
|
||||
// The display value of the widget in read-only mode
|
||||
value: "",
|
||||
|
||||
// noValueIndicator: [const] String
|
||||
// The text that gets displayed when there is no value (so that the user has a place to click to edit)
|
||||
noValueIndicator: dojo.isIE <= 6 ? // font-family needed on IE6 but it messes up IE8
|
||||
"<span style='font-family: wingdings; text-decoration: underline;'> ✍ </span>" :
|
||||
"<span style='text-decoration: underline;'> ✍ </span>",
|
||||
|
||||
constructor: function(){
|
||||
// summary:
|
||||
// Sets up private arrays etc.
|
||||
// tags:
|
||||
// private
|
||||
this.editorParams = {};
|
||||
},
|
||||
|
||||
postMixInProperties: function(){
|
||||
this.inherited(arguments);
|
||||
|
||||
// save pointer to original source node, since Widget nulls-out srcNodeRef
|
||||
this.displayNode = this.srcNodeRef;
|
||||
|
||||
// connect handlers to the display node
|
||||
var events = {
|
||||
ondijitclick: "_onClick",
|
||||
onmouseover: "_onMouseOver",
|
||||
onmouseout: "_onMouseOut",
|
||||
onfocus: "_onMouseOver",
|
||||
onblur: "_onMouseOut"
|
||||
};
|
||||
for(var name in events){
|
||||
this.connect(this.displayNode, name, events[name]);
|
||||
}
|
||||
dijit.setWaiRole(this.displayNode, "button");
|
||||
if(!this.displayNode.getAttribute("tabIndex")){
|
||||
this.displayNode.setAttribute("tabIndex", 0);
|
||||
}
|
||||
|
||||
if(!this.value && !("value" in this.params)){ // "" is a good value if specified directly so check params){
|
||||
this.value = dojo.trim(this.renderAsHtml ? this.displayNode.innerHTML :
|
||||
(this.displayNode.innerText||this.displayNode.textContent||""));
|
||||
}
|
||||
if(!this.value){
|
||||
this.displayNode.innerHTML = this.noValueIndicator;
|
||||
}
|
||||
|
||||
dojo.addClass(this.displayNode, 'dijitInlineEditBoxDisplayMode');
|
||||
},
|
||||
|
||||
setDisabled: function(/*Boolean*/ disabled){
|
||||
// summary:
|
||||
// Deprecated. Use set('disabled', ...) instead.
|
||||
// tags:
|
||||
// deprecated
|
||||
dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
|
||||
this.set('disabled', disabled);
|
||||
},
|
||||
|
||||
_setDisabledAttr: function(/*Boolean*/ disabled){
|
||||
// summary:
|
||||
// Hook to make set("disabled", ...) work.
|
||||
// Set disabled state of widget.
|
||||
dijit.setWaiState(this.domNode, "disabled", disabled);
|
||||
if(disabled){
|
||||
this.displayNode.removeAttribute("tabIndex");
|
||||
}else{
|
||||
this.displayNode.setAttribute("tabIndex", 0);
|
||||
}
|
||||
dojo.toggleClass(this.displayNode, "dijitInlineEditBoxDisplayModeDisabled", disabled);
|
||||
this._set("disabled", disabled);
|
||||
},
|
||||
|
||||
_onMouseOver: function(){
|
||||
// summary:
|
||||
// Handler for onmouseover and onfocus event.
|
||||
// tags:
|
||||
// private
|
||||
if(!this.disabled){
|
||||
dojo.addClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
|
||||
}
|
||||
},
|
||||
|
||||
_onMouseOut: function(){
|
||||
// summary:
|
||||
// Handler for onmouseout and onblur event.
|
||||
// tags:
|
||||
// private
|
||||
dojo.removeClass(this.displayNode, "dijitInlineEditBoxDisplayModeHover");
|
||||
},
|
||||
|
||||
_onClick: function(/*Event*/ e){
|
||||
// summary:
|
||||
// Handler for onclick event.
|
||||
// tags:
|
||||
// private
|
||||
if(this.disabled){ return; }
|
||||
if(e){ dojo.stopEvent(e); }
|
||||
this._onMouseOut();
|
||||
|
||||
// Since FF gets upset if you move a node while in an event handler for that node...
|
||||
setTimeout(dojo.hitch(this, "edit"), 0);
|
||||
},
|
||||
|
||||
edit: function(){
|
||||
// summary:
|
||||
// Display the editor widget in place of the original (read only) markup.
|
||||
// tags:
|
||||
// private
|
||||
|
||||
if(this.disabled || this.editing){ return; }
|
||||
this.editing = true;
|
||||
|
||||
// save some display node values that can be restored later
|
||||
this._savedPosition = dojo.style(this.displayNode, "position") || "static";
|
||||
this._savedOpacity = dojo.style(this.displayNode, "opacity") || "1";
|
||||
this._savedTabIndex = dojo.attr(this.displayNode, "tabIndex") || "0";
|
||||
|
||||
if(this.wrapperWidget){
|
||||
var ew = this.wrapperWidget.editWidget;
|
||||
ew.set("displayedValue" in ew ? "displayedValue" : "value", this.value);
|
||||
}else{
|
||||
// Placeholder for edit widget
|
||||
// Put place holder (and eventually editWidget) before the display node so that it's positioned correctly
|
||||
// when Calendar dropdown appears, which happens automatically on focus.
|
||||
var placeholder = dojo.create("span", null, this.domNode, "before");
|
||||
|
||||
// Create the editor wrapper (the thing that holds the editor widget and the save/cancel buttons)
|
||||
var ewc = typeof this.editorWrapper == "string" ? dojo.getObject(this.editorWrapper) : this.editorWrapper;
|
||||
this.wrapperWidget = new ewc({
|
||||
value: this.value,
|
||||
buttonSave: this.buttonSave,
|
||||
buttonCancel: this.buttonCancel,
|
||||
dir: this.dir,
|
||||
lang: this.lang,
|
||||
tabIndex: this._savedTabIndex,
|
||||
editor: this.editor,
|
||||
inlineEditBox: this,
|
||||
sourceStyle: dojo.getComputedStyle(this.displayNode),
|
||||
save: dojo.hitch(this, "save"),
|
||||
cancel: dojo.hitch(this, "cancel")
|
||||
}, placeholder);
|
||||
if(!this._started){
|
||||
this.startup();
|
||||
}
|
||||
}
|
||||
var ww = this.wrapperWidget;
|
||||
|
||||
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, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """).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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.MenuBar"]){
|
||||
dojo._hasResource["dijit.MenuBar"]=true;
|
||||
if(!dojo._hasResource["dijit.MenuBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.MenuBar"] = true;
|
||||
dojo.provide("dijit.MenuBar");
|
||||
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]);
|
||||
this._orient=this.isLeftToRight()?{BL:"TL"}:{BR:"TR"};
|
||||
},focusChild:function(_1){
|
||||
var _2=this.focusedChild,_3=_2&&_2.popup&&_2.popup.isShowingNow;
|
||||
this.inherited(arguments);
|
||||
if(_3&&_1.popup&&!_1.disabled){
|
||||
this._openPopup();
|
||||
}
|
||||
},_onKeyPress:function(_4){
|
||||
if(_4.ctrlKey||_4.altKey){
|
||||
return;
|
||||
}
|
||||
switch(_4.charOrCode){
|
||||
case dojo.keys.DOWN_ARROW:
|
||||
this._moveToPopup(_4);
|
||||
dojo.stopEvent(_4);
|
||||
}
|
||||
},onItemClick:function(_5,_6){
|
||||
if(_5.popup&&_5.popup.isShowingNow){
|
||||
_5.popup.onCancel();
|
||||
}else{
|
||||
this.inherited(arguments);
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.MenuBar", dijit._MenuBase, {
|
||||
// summary:
|
||||
// A menu bar, listing menu choices horizontally, like the "File" menu in most desktop applications
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/MenuBar.html", "<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" role=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),
|
||||
|
||||
baseClass: "dijitMenuBar",
|
||||
|
||||
// _isMenuBar: [protected] Boolean
|
||||
// This is a MenuBar widget, not a (vertical) Menu widget.
|
||||
_isMenuBar: true,
|
||||
|
||||
postCreate: function(){
|
||||
var k = dojo.keys, l = this.isLeftToRight();
|
||||
this.connectKeyNavHandlers(
|
||||
l ? [k.LEFT_ARROW] : [k.RIGHT_ARROW],
|
||||
l ? [k.RIGHT_ARROW] : [k.LEFT_ARROW]
|
||||
);
|
||||
|
||||
// parameter to dijit.popup.open() about where to put popup (relative to this.domNode)
|
||||
this._orient = this.isLeftToRight() ? {BL: 'TL'} : {BR: 'TR'};
|
||||
},
|
||||
|
||||
focusChild: function(item){
|
||||
// overload focusChild so that whenever the focus is moved to a new item,
|
||||
// check the previous focused whether it has its popup open, if so, after
|
||||
// focusing the new item, open its submenu immediately
|
||||
var prev_item = this.focusedChild,
|
||||
showpopup = prev_item && prev_item.popup && prev_item.popup.isShowingNow;
|
||||
this.inherited(arguments);
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.MenuBarItem"]){
|
||||
dojo._hasResource["dijit.MenuBarItem"]=true;
|
||||
if(!dojo._hasResource["dijit.MenuBarItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.MenuBarItem"] = true;
|
||||
dojo.provide("dijit.MenuBarItem");
|
||||
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)
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.MenuItem"]){
|
||||
dojo._hasResource["dijit.MenuItem"]=true;
|
||||
if(!dojo._hasResource["dijit.MenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.MenuItem"] = true;
|
||||
dojo.provide("dijit.MenuItem");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dijit._Contained");
|
||||
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);
|
||||
}
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
dojo.setSelectable(this.domNode,false);
|
||||
var _2=this.id+"_text";
|
||||
dojo.attr(this.containerNode,"id",_2);
|
||||
if(this.accelKeyNode){
|
||||
dojo.attr(this.accelKeyNode,"id",this.id+"_accel");
|
||||
_2+=" "+this.id+"_accel";
|
||||
}
|
||||
dijit.setWaiState(this.domNode,"labelledby",_2);
|
||||
},_onHover:function(){
|
||||
this.getParent().onItemHover(this);
|
||||
},_onUnhover:function(){
|
||||
this.getParent().onItemUnhover(this);
|
||||
this._hovering=false;
|
||||
this._setStateClass();
|
||||
},_onClick:function(_3){
|
||||
this.getParent().onItemClick(this,_3);
|
||||
dojo.stopEvent(_3);
|
||||
},onClick:function(_4){
|
||||
},focus:function(){
|
||||
try{
|
||||
if(dojo.isIE==8){
|
||||
this.containerNode.focus();
|
||||
}
|
||||
dijit.focus(this.focusNode);
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
},_onFocus:function(){
|
||||
this._setSelected(true);
|
||||
this.getParent()._onItemFocus(this);
|
||||
this.inherited(arguments);
|
||||
},_setSelected:function(_5){
|
||||
dojo.toggleClass(this.domNode,"dijitMenuItemSelected",_5);
|
||||
},setLabel:function(_6){
|
||||
dojo.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.","","2.0");
|
||||
this.set("label",_6);
|
||||
},setDisabled:function(_7){
|
||||
dojo.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.","","2.0");
|
||||
this.set("disabled",_7);
|
||||
},_setDisabledAttr:function(_8){
|
||||
this.disabled=_8;
|
||||
dijit.setWaiState(this.focusNode,"disabled",_8?"true":"false");
|
||||
},_setAccelKeyAttr:function(_9){
|
||||
this.accelKey=_9;
|
||||
this.accelKeyNode.style.display=_9?"":"none";
|
||||
this.accelKeyNode.innerHTML=_9;
|
||||
dojo.attr(this.containerNode,"colSpan",_9?"1":"2");
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.MenuItem",
|
||||
[dijit._Widget, dijit._Templated, dijit._Contained, dijit._CssStateMixin],
|
||||
{
|
||||
// summary:
|
||||
// A line item in a Menu Widget
|
||||
|
||||
// Make 3 columns
|
||||
// icon, label, and expand arrow (BiDi-dependent) indicating sub-menu
|
||||
templateString: dojo.cache("dijit", "templates/MenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">\n\t\t<div dojoAttachPoint=\"arrowWrapper\" style=\"visibility: hidden\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuExpand\"/>\n\t\t\t<span class=\"dijitMenuExpandA11y\">+</span>\n\t\t</div>\n\t</td>\n</tr>\n"),
|
||||
|
||||
attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
|
||||
label: { node: "containerNode", type: "innerHTML" },
|
||||
iconClass: { node: "iconNode", type: "class" }
|
||||
}),
|
||||
|
||||
baseClass: "dijitMenuItem",
|
||||
|
||||
// label: String
|
||||
// Menu text
|
||||
label: '',
|
||||
|
||||
// iconClass: String
|
||||
// Class to apply to DOMNode to make it display an icon.
|
||||
iconClass: "",
|
||||
|
||||
// accelKey: String
|
||||
// Text for the accelerator (shortcut) key combination.
|
||||
// Note that although Menu can display accelerator keys there
|
||||
// is no infrastructure to actually catch and execute these
|
||||
// accelerators.
|
||||
accelKey: "",
|
||||
|
||||
// disabled: Boolean
|
||||
// If true, the menu item is disabled.
|
||||
// If false, the menu item is enabled.
|
||||
disabled: false,
|
||||
|
||||
_fillContent: function(/*DomNode*/ source){
|
||||
// If button label is specified as srcNodeRef.innerHTML rather than
|
||||
// this.params.label, handle it here.
|
||||
if(source && !("label" in this.params)){
|
||||
this.set('label', source.innerHTML);
|
||||
}
|
||||
},
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
var label = this.id+"_text";
|
||||
dojo.attr(this.containerNode, "id", label);
|
||||
if(this.accelKeyNode){
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.MenuSeparator"]){
|
||||
dojo._hasResource["dijit.MenuSeparator"]=true;
|
||||
if(!dojo._hasResource["dijit.MenuSeparator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.MenuSeparator"] = true;
|
||||
dojo.provide("dijit.MenuSeparator");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
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(){
|
||||
return false;
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.MenuSeparator",
|
||||
[dijit._Widget, dijit._Templated, dijit._Contained],
|
||||
{
|
||||
// summary:
|
||||
// A line between two menu items
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/MenuSeparator.html", "<tr class=\"dijitMenuSeparator\">\n\t<td class=\"dijitMenuSeparatorIconCell\">\n\t\t<div class=\"dijitMenuSeparatorTop\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n\t<td colspan=\"3\" class=\"dijitMenuSeparatorLabelCell\">\n\t\t<div class=\"dijitMenuSeparatorTop dijitMenuSeparatorLabel\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n</tr>\n"),
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
dojo.setSelectable(this.domNode, false);
|
||||
},
|
||||
|
||||
isFocusable: function(){
|
||||
// summary:
|
||||
// Override to always return false
|
||||
// tags:
|
||||
// protected
|
||||
|
||||
return false; // Boolean
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.PopupMenuBarItem"]){
|
||||
dojo._hasResource["dijit.PopupMenuBarItem"]=true;
|
||||
if(!dojo._hasResource["dijit.PopupMenuBarItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.PopupMenuBarItem"] = true;
|
||||
dojo.provide("dijit.PopupMenuBarItem");
|
||||
dojo.require("dijit.PopupMenuItem");
|
||||
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)
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.PopupMenuItem"]){
|
||||
dojo._hasResource["dijit.PopupMenuItem"]=true;
|
||||
if(!dojo._hasResource["dijit.PopupMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.PopupMenuItem"] = true;
|
||||
dojo.provide("dijit.PopupMenuItem");
|
||||
dojo.require("dijit.MenuItem");
|
||||
dojo.declare("dijit.PopupMenuItem",dijit.MenuItem,{_fillContent:function(){
|
||||
if(this.srcNodeRef){
|
||||
var _1=dojo.query("*",this.srcNodeRef);
|
||||
dijit.PopupMenuItem.superclass._fillContent.call(this,_1[0]);
|
||||
this.dropDownContainer=this.srcNodeRef;
|
||||
}
|
||||
},startup:function(){
|
||||
if(this._started){
|
||||
return;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
if(!this.popup){
|
||||
var _2=dojo.query("[widgetId]",this.dropDownContainer)[0];
|
||||
this.popup=dijit.byNode(_2);
|
||||
}
|
||||
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){
|
||||
if(!this.popup._destroyed){
|
||||
this.popup.destroyRecursive();
|
||||
}
|
||||
delete this.popup;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.PopupMenuItem",
|
||||
dijit.MenuItem,
|
||||
{
|
||||
_fillContent: function(){
|
||||
// summary:
|
||||
// When Menu is declared in markup, this code gets the menu label and
|
||||
// the popup widget from the srcNodeRef.
|
||||
// description:
|
||||
// srcNodeRefinnerHTML contains both the menu item text and a popup widget
|
||||
// The first part holds the menu item text and the second part is the popup
|
||||
// example:
|
||||
// | <div dojoType="dijit.PopupMenuItem">
|
||||
// | <span>pick me</span>
|
||||
// | <popup> ... </popup>
|
||||
// | </div>
|
||||
// tags:
|
||||
// protected
|
||||
|
||||
if(this.srcNodeRef){
|
||||
var nodes = dojo.query("*", this.srcNodeRef);
|
||||
dijit.PopupMenuItem.superclass._fillContent.call(this, nodes[0]);
|
||||
|
||||
// save pointer to srcNode so we can grab the drop down widget after it's instantiated
|
||||
this.dropDownContainer = this.srcNodeRef;
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.ProgressBar"]){
|
||||
dojo._hasResource["dijit.ProgressBar"]=true;
|
||||
if(!dojo._hasResource["dijit.ProgressBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.ProgressBar"] = true;
|
||||
dojo.provide("dijit.ProgressBar");
|
||||
dojo.require("dojo.fx");
|
||||
dojo.require("dojo.number");
|
||||
dojo.require("dijit._Widget");
|
||||
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\"> </span\n\t></div\n\t><div dojoAttachPoint=\"label\" class=\"dijitProgressBarLabel\" id=\"${id}_label\"> </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());
|
||||
this.update();
|
||||
},update:function(_1){
|
||||
dojo.mixin(this,_1||{});
|
||||
var _2=this.internalProgress;
|
||||
var _3=1,_4;
|
||||
if(this.indeterminate){
|
||||
_4="addClass";
|
||||
dijit.removeWaiState(_2,"valuenow");
|
||||
dijit.removeWaiState(_2,"valuemin");
|
||||
dijit.removeWaiState(_2,"valuemax");
|
||||
}else{
|
||||
_4="removeClass";
|
||||
if(String(this.progress).indexOf("%")!=-1){
|
||||
_3=Math.min(parseFloat(this.progress)/100,1);
|
||||
this.progress=_3*this.maximum;
|
||||
}else{
|
||||
this.progress=Math.min(this.progress,this.maximum);
|
||||
_3=this.progress/this.maximum;
|
||||
}
|
||||
var _5=this.report(_3);
|
||||
this.label.firstChild.nodeValue=_5;
|
||||
dijit.setWaiState(_2,"describedby",this.label.id);
|
||||
dijit.setWaiState(_2,"valuenow",this.progress);
|
||||
dijit.setWaiState(_2,"valuemin",0);
|
||||
dijit.setWaiState(_2,"valuemax",this.maximum);
|
||||
}
|
||||
dojo[_4](this.domNode,"dijitProgressBarIndeterminate");
|
||||
_2.style.width=(_3*100)+"%";
|
||||
this.onChange();
|
||||
},_setValueAttr:function(v){
|
||||
if(v==Infinity){
|
||||
this.update({indeterminate:true});
|
||||
}else{
|
||||
this.update({indeterminate:false,progress:v});
|
||||
}
|
||||
},_getValueAttr:function(){
|
||||
return this.progress;
|
||||
},report:function(_6){
|
||||
return dojo.number.format(_6,{type:"percent",places:this.places,locale:this.lang});
|
||||
},onChange:function(){
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.ProgressBar", [dijit._Widget, dijit._Templated], {
|
||||
// summary:
|
||||
// A progress indication widget, showing the amount completed
|
||||
// (often the percentage completed) of a task.
|
||||
//
|
||||
// example:
|
||||
// | <div dojoType="ProgressBar"
|
||||
// | places="0"
|
||||
// | value="..." maximum="...">
|
||||
// | </div>
|
||||
|
||||
// progress: [const] String (Percentage or Number)
|
||||
// Number or percentage indicating amount of task completed.
|
||||
// Deprecated. Use "value" instead.
|
||||
progress: "0",
|
||||
|
||||
// value: String (Percentage or Number)
|
||||
// Number or percentage indicating amount of task completed.
|
||||
// With "%": percentage value, 0% <= progress <= 100%, or
|
||||
// without "%": absolute value, 0 <= progress <= maximum.
|
||||
// Infinity means that the progress bar is indeterminate.
|
||||
value: "",
|
||||
|
||||
// maximum: [const] Float
|
||||
// Max sample number
|
||||
maximum: 100,
|
||||
|
||||
// places: [const] Number
|
||||
// Number of places to show in values; 0 by default
|
||||
places: 0,
|
||||
|
||||
// indeterminate: [const] Boolean
|
||||
// If false: show progress value (number or percentage).
|
||||
// If true: show that a process is underway but that the amount completed is unknown.
|
||||
// Deprecated. Use "value" instead.
|
||||
indeterminate: false,
|
||||
|
||||
// label: String?
|
||||
// Label on progress bar. Defaults to percentage for determinate progress bar and
|
||||
// blank for indeterminate progress bar.
|
||||
label:"",
|
||||
|
||||
// name: String
|
||||
// this is the field name (for a form) if set. This needs to be set if you want to use
|
||||
// this widget in a dijit.form.Form widget (such as dijit.Dialog)
|
||||
name: '',
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/ProgressBar.html", "<div class=\"dijitProgressBar dijitProgressBarEmpty\" role=\"progressbar\"\n\t><div dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\n\t\t><div class=\"dijitProgressBarTile\" role=\"presentation\"></div\n\t\t><span style=\"visibility:hidden\"> </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 ? " " : dojo.number.format(percent, { type: "percent", places: this.places, locale: this.lang }));
|
||||
},
|
||||
|
||||
onChange: function(){
|
||||
// summary:
|
||||
// Callback fired when progress updates.
|
||||
// tags:
|
||||
// extension
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.TitlePane"]){
|
||||
dojo._hasResource["dijit.TitlePane"]=true;
|
||||
if(!dojo._hasResource["dijit.TitlePane"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.TitlePane"] = true;
|
||||
dojo.provide("dijit.TitlePane");
|
||||
dojo.require("dojo.fx");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dijit.layout.ContentPane");
|
||||
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";
|
||||
}
|
||||
if(this.toggleable){
|
||||
this._trackMouseState(this.titleBarNode,"dijitTitlePaneTitle");
|
||||
}
|
||||
this._setCss();
|
||||
dojo.setSelectable(this.titleNode,false);
|
||||
var _1=this.hideNode,_2=this.wipeNode;
|
||||
this._wipeIn=dojo.fx.wipeIn({node:this.wipeNode,duration:this.duration,beforeBegin:function(){
|
||||
_1.style.display="";
|
||||
}});
|
||||
this._wipeOut=dojo.fx.wipeOut({node:this.wipeNode,duration:this.duration,onEnd:function(){
|
||||
_1.style.display="none";
|
||||
}});
|
||||
this.inherited(arguments);
|
||||
},_setOpenAttr:function(_3){
|
||||
if(this.open!==_3){
|
||||
this.toggle();
|
||||
}
|
||||
dijit.setWaiState(this.containerNode,"hidden",this.open?"false":"true");
|
||||
dijit.setWaiState(this.focusNode,"pressed",this.open?"true":"false");
|
||||
},_setToggleableAttr:function(_4){
|
||||
this.toggleable=_4;
|
||||
dijit.setWaiRole(this.focusNode,_4?"button":"heading");
|
||||
if(_4){
|
||||
dijit.setWaiState(this.focusNode,"controls",this.id+"_pane");
|
||||
dojo.attr(this.focusNode,"tabIndex",this.tabIndex);
|
||||
}else{
|
||||
dojo.removeAttr(this.focusNode,"tabIndex");
|
||||
}
|
||||
this._setCss();
|
||||
},_setContentAttr:function(_5){
|
||||
if(!this.open||!this._wipeOut||this._wipeOut.status()=="playing"){
|
||||
this.inherited(arguments);
|
||||
}else{
|
||||
if(this._wipeIn&&this._wipeIn.status()=="playing"){
|
||||
this._wipeIn.stop();
|
||||
}
|
||||
dojo.marginBox(this.wipeNode,{h:dojo.marginBox(this.wipeNode).h});
|
||||
this.inherited(arguments);
|
||||
if(this._wipeIn){
|
||||
this._wipeIn.play();
|
||||
}else{
|
||||
this.hideNode.style.display="";
|
||||
}
|
||||
}
|
||||
},toggle:function(){
|
||||
dojo.forEach([this._wipeIn,this._wipeOut],function(_6){
|
||||
if(_6&&_6.status()=="playing"){
|
||||
_6.stop();
|
||||
}
|
||||
|
||||
|
||||
dojo.declare(
|
||||
"dijit.TitlePane",
|
||||
[dijit.layout.ContentPane, dijit._Templated, dijit._CssStateMixin],
|
||||
{
|
||||
// summary:
|
||||
// A pane with a title on top, that can be expanded or collapsed.
|
||||
//
|
||||
// description:
|
||||
// An accessible container with a title Heading, and a content
|
||||
// section that slides open and closed. TitlePane is an extension to
|
||||
// `dijit.layout.ContentPane`, providing all the useful content-control aspects from it.
|
||||
//
|
||||
// example:
|
||||
// | // load a TitlePane from remote file:
|
||||
// | var foo = new dijit.TitlePane({ href: "foobar.html", title:"Title" });
|
||||
// | foo.startup();
|
||||
//
|
||||
// example:
|
||||
// | <!-- markup href example: -->
|
||||
// | <div dojoType="dijit.TitlePane" href="foobar.html" title="Title"></div>
|
||||
//
|
||||
// example:
|
||||
// | <!-- markup with inline data -->
|
||||
// | <div dojoType="dijit.TitlePane" title="Title">
|
||||
// | <p>I am content</p>
|
||||
// | </div>
|
||||
|
||||
// title: String
|
||||
// Title of the pane
|
||||
title: "",
|
||||
|
||||
// open: Boolean
|
||||
// Whether pane is opened or closed.
|
||||
open: true,
|
||||
|
||||
// toggleable: Boolean
|
||||
// Whether pane can be opened or closed by clicking the title bar.
|
||||
toggleable: true,
|
||||
|
||||
// tabIndex: String
|
||||
// Tabindex setting for the title (so users can tab to the title then
|
||||
// use space/enter to open/close the title pane)
|
||||
tabIndex: "0",
|
||||
|
||||
// duration: Integer
|
||||
// Time in milliseconds to fade in/fade out
|
||||
duration: dijit.defaultDuration,
|
||||
|
||||
// baseClass: [protected] String
|
||||
// The root className to be placed on this widget's domNode.
|
||||
baseClass: "dijitTitlePane",
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/TitlePane.html", "<div>\n\t<div dojoAttachEvent=\"onclick:_onTitleClick, onkeypress:_onTitleKey\"\n\t\t\tclass=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode\">\n\t\t<div class=\"dijitTitlePaneTitleFocus\" dojoAttachPoint=\"focusNode\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"arrowNode\" class=\"dijitArrowNode\" role=\"presentation\"\n\t\t\t/><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span\n\t\t\t><span dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></span>\n\t\t</div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\" role=\"presentation\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\" role=\"presentation\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" role=\"region\" id=\"${id}_pane\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc. Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"),
|
||||
|
||||
attributeMap: dojo.delegate(dijit.layout.ContentPane.prototype.attributeMap, {
|
||||
title: { node: "titleNode", type: "innerHTML" },
|
||||
tooltip: {node: "focusNode", type: "attribute", attribute: "title"}, // focusNode spans the entire width, titleNode doesn't
|
||||
id:""
|
||||
}),
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
dojo.setSelectable(this.titleNode, false);
|
||||
},
|
||||
|
||||
postCreate: function(){
|
||||
this.inherited(arguments);
|
||||
|
||||
// Hover and focus effect on title bar, except for non-toggleable TitlePanes
|
||||
// This should really be controlled from _setToggleableAttr() but _CssStateMixin
|
||||
// doesn't provide a way to disconnect a previous _trackMouseState() call
|
||||
if(this.toggleable){
|
||||
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);
|
||||
}});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.Toolbar"]){
|
||||
dojo._hasResource["dijit.Toolbar"]=true;
|
||||
if(!dojo._hasResource["dijit.Toolbar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.Toolbar"] = true;
|
||||
dojo.provide("dijit.Toolbar");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._KeyNavContainer");
|
||||
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");
|
||||
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.ToolbarSeparator"]){
|
||||
dojo._hasResource["dijit.ToolbarSeparator"]=true;
|
||||
if(!dojo._hasResource["dijit.ToolbarSeparator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.ToolbarSeparator"] = true;
|
||||
dojo.provide("dijit.ToolbarSeparator");
|
||||
dojo.require("dijit._Widget");
|
||||
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(){
|
||||
return false;
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit.ToolbarSeparator",
|
||||
[ dijit._Widget, dijit._Templated ],
|
||||
{
|
||||
// summary:
|
||||
// A spacer between two `dijit.Toolbar` items
|
||||
templateString: '<div class="dijitToolbarSeparator dijitInline" role="presentation"></div>',
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
dojo.setSelectable(this.domNode, false);
|
||||
},
|
||||
isFocusable: function(){
|
||||
// summary:
|
||||
// This widget isn't focusable, so pass along that fact.
|
||||
// tags:
|
||||
// protected
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.Tooltip"]){
|
||||
dojo._hasResource["dijit.Tooltip"]=true;
|
||||
if(!dojo._hasResource["dijit.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.Tooltip"] = true;
|
||||
dojo.provide("dijit.Tooltip");
|
||||
dojo.require("dijit._Widget");
|
||||
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);
|
||||
this.fadeIn=dojo.fadeIn({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onShow")});
|
||||
this.fadeOut=dojo.fadeOut({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onHide")});
|
||||
},show:function(_1,_2,_3,_4){
|
||||
if(this.aroundNode&&this.aroundNode===_2){
|
||||
return;
|
||||
}
|
||||
if(this.fadeOut.status()=="playing"){
|
||||
this._onDeck=arguments;
|
||||
return;
|
||||
}
|
||||
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"));
|
||||
dojo.style(this.domNode,"opacity",0);
|
||||
this.fadeIn.play();
|
||||
this.isShowingNow=true;
|
||||
this.aroundNode=_2;
|
||||
},orient:function(_6,_7,_8){
|
||||
_6.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_7+"-"+_8];
|
||||
},_onShow:function(){
|
||||
if(dojo.isIE){
|
||||
this.domNode.style.filter="";
|
||||
}
|
||||
},hide:function(_9){
|
||||
if(this._onDeck&&this._onDeck[1]==_9){
|
||||
this._onDeck=null;
|
||||
}else{
|
||||
if(this.aroundNode===_9){
|
||||
this.fadeIn.stop();
|
||||
this.isShowingNow=false;
|
||||
this.aroundNode=null;
|
||||
this.fadeOut.play();
|
||||
}else{
|
||||
}
|
||||
}
|
||||
},_onHide:function(){
|
||||
this.domNode.style.cssText="";
|
||||
this.containerNode.innerHTML="";
|
||||
if(this._onDeck){
|
||||
this.show.apply(this,this._onDeck);
|
||||
this._onDeck=null;
|
||||
}
|
||||
}});
|
||||
dijit.showTooltip=function(_a,_b,_c,_d){
|
||||
if(!dijit._masterTT){
|
||||
dijit._masterTT=new dijit._MasterTooltip();
|
||||
}
|
||||
return dijit._masterTT.show(_a,_b,_c,_d);
|
||||
|
||||
|
||||
dojo.declare(
|
||||
"dijit._MasterTooltip",
|
||||
[dijit._Widget, dijit._Templated],
|
||||
{
|
||||
// summary:
|
||||
// Internal widget that holds the actual tooltip markup,
|
||||
// which occurs once per page.
|
||||
// Called by Tooltip widgets which are just containers to hold
|
||||
// the markup
|
||||
// tags:
|
||||
// protected
|
||||
|
||||
// duration: Integer
|
||||
// Milliseconds to fade in/fade out
|
||||
duration: dijit.defaultDuration,
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/Tooltip.html", "<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\n></div>\n"),
|
||||
|
||||
postCreate: function(){
|
||||
dojo.body().appendChild(this.domNode);
|
||||
|
||||
this.bgIframe = new dijit.BackgroundIframe(this.domNode);
|
||||
|
||||
// Setup fade-in and fade-out functions.
|
||||
this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
|
||||
this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
|
||||
},
|
||||
|
||||
show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
|
||||
// summary:
|
||||
// Display tooltip w/specified contents to right of specified node
|
||||
// (To left if there's no space on the right, or if rtl == true)
|
||||
|
||||
if(this.aroundNode && this.aroundNode === aroundNode){
|
||||
return;
|
||||
}
|
||||
|
||||
// reset width; it may have been set by orient() on a previous tooltip show()
|
||||
this.domNode.width = "auto";
|
||||
|
||||
if(this.fadeOut.status() == "playing"){
|
||||
// previous tooltip is being hidden; wait until the hide completes then show new one
|
||||
this._onDeck=arguments;
|
||||
return;
|
||||
}
|
||||
this.containerNode.innerHTML=innerHTML;
|
||||
|
||||
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._masterTT=new dijit._MasterTooltip();
|
||||
}
|
||||
return dijit._masterTT.hide(_e);
|
||||
|
||||
dijit.hideTooltip = function(aroundNode){
|
||||
// summary:
|
||||
// Hide the tooltip
|
||||
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={};
|
||||
},_setConnectIdAttr:function(_f){
|
||||
for(var _10 in this._nodeConnectionsById){
|
||||
this.removeTarget(_10);
|
||||
}
|
||||
dojo.forEach(dojo.isArrayLike(_f)?_f:[_f],this.addTarget,this);
|
||||
},_getConnectIdAttr:function(){
|
||||
var ary=[];
|
||||
for(var id in this._nodeConnectionsById){
|
||||
ary.push(id);
|
||||
}
|
||||
return ary;
|
||||
},addTarget:function(id){
|
||||
var _11=dojo.byId(id);
|
||||
if(!_11){
|
||||
return;
|
||||
}
|
||||
if(_11.id in this._nodeConnectionsById){
|
||||
return;
|
||||
}
|
||||
this._nodeConnectionsById[_11.id]=[this.connect(_11,"onmouseenter","_onTargetMouseEnter"),this.connect(_11,"onmouseleave","_onTargetMouseLeave"),this.connect(_11,"onfocus","_onTargetFocus"),this.connect(_11,"onblur","_onTargetBlur")];
|
||||
},removeTarget:function(_12){
|
||||
var id=_12.id||_12;
|
||||
if(id in this._nodeConnectionsById){
|
||||
dojo.forEach(this._nodeConnectionsById[id],this.disconnect,this);
|
||||
delete this._nodeConnectionsById[id];
|
||||
}
|
||||
},postCreate:function(){
|
||||
dojo.addClass(this.domNode,"dijitTooltipData");
|
||||
},startup:function(){
|
||||
this.inherited(arguments);
|
||||
var ids=this.connectId;
|
||||
dojo.forEach(dojo.isArrayLike(ids)?ids:[ids],this.addTarget,this);
|
||||
},_onTargetMouseEnter:function(e){
|
||||
this._onHover(e);
|
||||
},_onTargetMouseLeave:function(e){
|
||||
this._onUnHover(e);
|
||||
},_onTargetFocus:function(e){
|
||||
this._focus=true;
|
||||
this._onHover(e);
|
||||
},_onTargetBlur:function(e){
|
||||
this._focus=false;
|
||||
this._onUnHover(e);
|
||||
},_onHover:function(e){
|
||||
if(!this._showTimer){
|
||||
var _13=e.target;
|
||||
this._showTimer=setTimeout(dojo.hitch(this,function(){
|
||||
this.open(_13);
|
||||
}),this.showDelay);
|
||||
}
|
||||
},_onUnHover:function(e){
|
||||
if(this._focus){
|
||||
return;
|
||||
}
|
||||
if(this._showTimer){
|
||||
clearTimeout(this._showTimer);
|
||||
delete this._showTimer;
|
||||
}
|
||||
this.close();
|
||||
},open:function(_14){
|
||||
if(this._showTimer){
|
||||
clearTimeout(this._showTimer);
|
||||
delete this._showTimer;
|
||||
}
|
||||
dijit.showTooltip(this.label||this.domNode.innerHTML,_14,this.position,!this.isLeftToRight());
|
||||
this._connectNode=_14;
|
||||
this.onShow(_14,this.position);
|
||||
},close:function(){
|
||||
if(this._connectNode){
|
||||
dijit.hideTooltip(this._connectNode);
|
||||
delete this._connectNode;
|
||||
this.onHide();
|
||||
}
|
||||
if(this._showTimer){
|
||||
clearTimeout(this._showTimer);
|
||||
delete this._showTimer;
|
||||
}
|
||||
},onShow:function(_15,_16){
|
||||
},onHide:function(){
|
||||
},uninitialize:function(){
|
||||
this.close();
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dijit.Tooltip.defaultPosition=["after","before"];
|
||||
|
||||
dojo.declare(
|
||||
"dijit.Tooltip",
|
||||
dijit._Widget,
|
||||
{
|
||||
// summary:
|
||||
// Pops up a tooltip (a help message) when you hover over a node.
|
||||
|
||||
// label: String
|
||||
// Text to display in the tooltip.
|
||||
// Specified as innerHTML when creating the widget from markup.
|
||||
label: "",
|
||||
|
||||
// showDelay: Integer
|
||||
// Number of milliseconds to wait after hovering over/focusing on the object, before
|
||||
// the tooltip is displayed.
|
||||
showDelay: 400,
|
||||
|
||||
// connectId: String|String[]
|
||||
// Id of domNode(s) to attach the tooltip to.
|
||||
// When user hovers over specified dom node, the tooltip will appear.
|
||||
connectId: [],
|
||||
|
||||
// position: String[]
|
||||
// See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
|
||||
position: [],
|
||||
|
||||
_setConnectIdAttr: function(/*String*/ newId){
|
||||
// summary:
|
||||
// Connect to node(s) (specified by id)
|
||||
|
||||
// Remove connections to old nodes (if there are any)
|
||||
dojo.forEach(this._connections || [], function(nested){
|
||||
dojo.forEach(nested, dojo.hitch(this, "disconnect"));
|
||||
}, this);
|
||||
|
||||
// Make connections to nodes in newIds.
|
||||
var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
|
||||
this._connections = dojo.map(ary, function(id){
|
||||
var node = dojo.byId(id);
|
||||
return node ? [
|
||||
this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
|
||||
this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
|
||||
this.connect(node, "onfocus", "_onTargetFocus"),
|
||||
this.connect(node, "onblur", "_onTargetBlur")
|
||||
] : [];
|
||||
}, this);
|
||||
|
||||
this._set("connectId", newId);
|
||||
|
||||
this._connectIds = ary; // save as array
|
||||
},
|
||||
|
||||
addTarget: function(/*DOMNODE || String*/ node){
|
||||
// summary:
|
||||
// Attach tooltip to specified node if it's not already connected
|
||||
|
||||
// TODO: remove in 2.0 and just use set("connectId", ...) interface
|
||||
|
||||
var id = node.id || node;
|
||||
if(dojo.indexOf(this._connectIds, id) == -1){
|
||||
this.set("connectId", this._connectIds.concat(id));
|
||||
}
|
||||
},
|
||||
|
||||
removeTarget: function(/*DOMNODE || String*/ node){
|
||||
// summary:
|
||||
// Detach tooltip from specified node
|
||||
|
||||
// TODO: remove in 2.0 and just use set("connectId", ...) interface
|
||||
|
||||
var id = node.id || node, // map from DOMNode back to plain id string
|
||||
idx = dojo.indexOf(this._connectIds, id);
|
||||
if(idx >= 0){
|
||||
// remove id (modifies original this._connectIds but that's OK in this case)
|
||||
this._connectIds.splice(idx, 1);
|
||||
this.set("connectId", this._connectIds);
|
||||
}
|
||||
},
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
dojo.addClass(this.domNode,"dijitTooltipData");
|
||||
},
|
||||
|
||||
startup: function(){
|
||||
this.inherited(arguments);
|
||||
|
||||
// If this tooltip was created in a template, or for some other reason the specified connectId[s]
|
||||
// didn't exist during the widget's initialization, then connect now.
|
||||
var ids = this.connectId;
|
||||
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"];
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit.TooltipDialog"]){
|
||||
dojo._hasResource["dijit.TooltipDialog"]=true;
|
||||
if(!dojo._hasResource["dijit.TooltipDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit.TooltipDialog"] = true;
|
||||
dojo.provide("dijit.TooltipDialog");
|
||||
dojo.require("dijit.layout.ContentPane");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dijit.form._FormMixin");
|
||||
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");
|
||||
this.containerNode.title=this.title;
|
||||
},orient:function(_1,_2,_3){
|
||||
var c=this._currentOrientClass;
|
||||
if(c){
|
||||
dojo.removeClass(this.domNode,c);
|
||||
}
|
||||
c="dijitTooltipAB"+(_3.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(_3.charAt(0)=="T"?"Below":"Above");
|
||||
dojo.addClass(this.domNode,c);
|
||||
this._currentOrientClass=c;
|
||||
},onOpen:function(_4){
|
||||
this.orient(this.domNode,_4.aroundCorner,_4.corner);
|
||||
this._onShow();
|
||||
if(this.autofocus){
|
||||
this._getFocusItems(this.containerNode);
|
||||
dijit.focus(this._firstFocusItem);
|
||||
}
|
||||
},onClose:function(){
|
||||
this.onHide();
|
||||
},_onKey:function(_5){
|
||||
var _6=_5.target;
|
||||
var dk=dojo.keys;
|
||||
if(_5.charOrCode===dk.TAB){
|
||||
this._getFocusItems(this.containerNode);
|
||||
}
|
||||
var _7=(this._firstFocusItem==this._lastFocusItem);
|
||||
if(_5.charOrCode==dk.ESCAPE){
|
||||
setTimeout(dojo.hitch(this,"onCancel"),0);
|
||||
dojo.stopEvent(_5);
|
||||
}else{
|
||||
if(_6==this._firstFocusItem&&_5.shiftKey&&_5.charOrCode===dk.TAB){
|
||||
if(!_7){
|
||||
dijit.focus(this._lastFocusItem);
|
||||
}
|
||||
dojo.stopEvent(_5);
|
||||
}else{
|
||||
if(_6==this._lastFocusItem&&_5.charOrCode===dk.TAB&&!_5.shiftKey){
|
||||
if(!_7){
|
||||
dijit.focus(this._firstFocusItem);
|
||||
}
|
||||
dojo.stopEvent(_5);
|
||||
}else{
|
||||
if(_5.charOrCode===dk.TAB){
|
||||
_5.stopPropagation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare(
|
||||
"dijit.TooltipDialog",
|
||||
[dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
|
||||
{
|
||||
// summary:
|
||||
// Pops up a dialog that appears like a Tooltip
|
||||
|
||||
// title: String
|
||||
// Description of tooltip dialog (required for a11y)
|
||||
title: "",
|
||||
|
||||
// doLayout: [protected] Boolean
|
||||
// Don't change this parameter from the default value.
|
||||
// This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
|
||||
// is never a child of a layout container, nor can you specify the size of
|
||||
// TooltipDialog in order to control the size of an inner widget.
|
||||
doLayout: false,
|
||||
|
||||
// autofocus: Boolean
|
||||
// A Toggle to modify the default focus behavior of a Dialog, which
|
||||
// is to focus on the first dialog element after opening the dialog.
|
||||
// False will disable autofocusing. Default: true
|
||||
autofocus: true,
|
||||
|
||||
// baseClass: [protected] String
|
||||
// The root className to use for the various states of this widget
|
||||
baseClass: "dijitTooltipDialog",
|
||||
|
||||
// _firstFocusItem: [private] [readonly] DomNode
|
||||
// The pointer to the first focusable node in the dialog.
|
||||
// Set by `dijit._DialogMixin._getFocusItems`.
|
||||
_firstFocusItem: null,
|
||||
|
||||
// _lastFocusItem: [private] [readonly] DomNode
|
||||
// The pointer to which node has focus prior to our dialog.
|
||||
// Set by `dijit._DialogMixin._getFocusItems`.
|
||||
_lastFocusItem: null,
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/TooltipDialog.html", "<div role=\"presentation\" tabIndex=\"-1\">\n\t<div class=\"dijitTooltipContainer\" role=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" role=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" role=\"presentation\"></div>\n</div>\n"),
|
||||
|
||||
_setTitleAttr: function(/*String*/ title){
|
||||
this.containerNode.title = title;
|
||||
this._set("title", title)
|
||||
},
|
||||
|
||||
postCreate: function(){
|
||||
this.inherited(arguments);
|
||||
this.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
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._Calendar"]){
|
||||
dojo._hasResource["dijit._Calendar"]=true;
|
||||
if(!dojo._hasResource["dijit._Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._Calendar"] = true;
|
||||
dojo.provide("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;
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._Contained"]){
|
||||
dojo._hasResource["dijit._Contained"]=true;
|
||||
if(!dojo._hasResource["dijit._Contained"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._Contained"] = true;
|
||||
dojo.provide("dijit._Contained");
|
||||
dojo.declare("dijit._Contained",null,{getParent:function(){
|
||||
var _1=dijit.getEnclosingWidget(this.domNode.parentNode);
|
||||
return _1&&_1.isContainer?_1:null;
|
||||
},_getSibling:function(_2){
|
||||
var _3=this.domNode;
|
||||
do{
|
||||
_3=_3[_2+"Sibling"];
|
||||
}while(_3&&_3.nodeType!=1);
|
||||
return _3&&dijit.byNode(_3);
|
||||
},getPreviousSibling:function(){
|
||||
return this._getSibling("previous");
|
||||
},getNextSibling:function(){
|
||||
return this._getSibling("next");
|
||||
},getIndexInParent:function(){
|
||||
var p=this.getParent();
|
||||
if(!p||!p.getIndexOfChild){
|
||||
return -1;
|
||||
}
|
||||
return p.getIndexOfChild(this);
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._Contained",
|
||||
null,
|
||||
{
|
||||
// summary:
|
||||
// Mixin for widgets that are children of a container widget
|
||||
//
|
||||
// example:
|
||||
// | // make a basic custom widget that knows about it's parents
|
||||
// | dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
|
||||
|
||||
getParent: function(){
|
||||
// summary:
|
||||
// Returns the parent widget of this widget, assuming the parent
|
||||
// specifies isContainer
|
||||
var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
|
||||
return parent && parent.isContainer ? parent : null;
|
||||
},
|
||||
|
||||
_getSibling: function(/*String*/ which){
|
||||
// summary:
|
||||
// Returns next or previous sibling
|
||||
// which:
|
||||
// Either "next" or "previous"
|
||||
// tags:
|
||||
// private
|
||||
var node = this.domNode;
|
||||
do{
|
||||
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
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._Container"]){
|
||||
dojo._hasResource["dijit._Container"]=true;
|
||||
if(!dojo._hasResource["dijit._Container"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._Container"] = true;
|
||||
dojo.provide("dijit._Container");
|
||||
dojo.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){
|
||||
this.inherited(arguments);
|
||||
if(!this.containerNode){
|
||||
this.containerNode=this.domNode;
|
||||
}
|
||||
},addChild:function(_1,_2){
|
||||
var _3=this.containerNode;
|
||||
if(_2&&typeof _2=="number"){
|
||||
var _4=this.getChildren();
|
||||
if(_4&&_4.length>=_2){
|
||||
_3=_4[_2-1].domNode;
|
||||
_2="after";
|
||||
}
|
||||
}
|
||||
dojo.place(_1.domNode,_3,_2);
|
||||
if(this._started&&!_1._started){
|
||||
_1.startup();
|
||||
}
|
||||
},removeChild:function(_5){
|
||||
if(typeof _5=="number"&&_5>0){
|
||||
_5=this.getChildren()[_5];
|
||||
}
|
||||
if(_5){
|
||||
var _6=_5.domNode;
|
||||
if(_6&&_6.parentNode){
|
||||
_6.parentNode.removeChild(_6);
|
||||
}
|
||||
}
|
||||
},hasChildren:function(){
|
||||
return this.getChildren().length>0;
|
||||
},destroyDescendants:function(_7){
|
||||
dojo.forEach(this.getChildren(),function(_8){
|
||||
_8.destroyRecursive(_7);
|
||||
});
|
||||
},_getSiblingOfChild:function(_9,_a){
|
||||
var _b=_9.domNode,_c=(_a>0?"nextSibling":"previousSibling");
|
||||
do{
|
||||
_b=_b[_c];
|
||||
}while(_b&&(_b.nodeType!=1||!dijit.byNode(_b)));
|
||||
return _b&&dijit.byNode(_b);
|
||||
},getIndexOfChild:function(_d){
|
||||
return dojo.indexOf(this.getChildren(),_d);
|
||||
},startup:function(){
|
||||
if(this._started){
|
||||
return;
|
||||
}
|
||||
dojo.forEach(this.getChildren(),function(_e){
|
||||
_e.startup();
|
||||
});
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._Container",
|
||||
null,
|
||||
{
|
||||
// summary:
|
||||
// Mixin for widgets that contain a set of widget children.
|
||||
// description:
|
||||
// Use this mixin for widgets that needs to know about and
|
||||
// keep track of their widget children. Suitable for widgets like BorderContainer
|
||||
// and TabContainer which contain (only) a set of child widgets.
|
||||
//
|
||||
// It's not suitable for widgets like ContentPane
|
||||
// which contains mixed HTML (plain DOM nodes in addition to widgets),
|
||||
// and where contained widgets are not necessarily directly below
|
||||
// this.containerNode. In that case calls like addChild(node, position)
|
||||
// wouldn't make sense.
|
||||
|
||||
// isContainer: [protected] Boolean
|
||||
// Indicates that this widget acts as a "parent" to the descendant widgets.
|
||||
// When the parent is started it will call startup() on the child widgets.
|
||||
// See also `isLayoutContainer`.
|
||||
isContainer: true,
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
if(!this.containerNode){
|
||||
// all widgets with descendants must set containerNode
|
||||
this.containerNode = this.domNode;
|
||||
}
|
||||
},
|
||||
|
||||
addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
|
||||
// summary:
|
||||
// Makes the given widget a child of this widget.
|
||||
// description:
|
||||
// Inserts specified child widget's dom node as a child of this widget's
|
||||
// container node, and possibly does other processing (such as layout).
|
||||
|
||||
var refNode = this.containerNode;
|
||||
if(insertIndex && typeof insertIndex == "number"){
|
||||
var children = this.getChildren();
|
||||
if(children && children.length >= insertIndex){
|
||||
refNode = children[insertIndex-1].domNode;
|
||||
insertIndex = "after";
|
||||
}
|
||||
}
|
||||
dojo.place(widget.domNode, refNode, insertIndex);
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._CssStateMixin"]){
|
||||
dojo._hasResource["dijit._CssStateMixin"]=true;
|
||||
if(!dojo._hasResource["dijit._CssStateMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._CssStateMixin"] = true;
|
||||
dojo.provide("dijit._CssStateMixin");
|
||||
dojo.declare("dijit._CssStateMixin",[],{cssStateNodes:{},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
dojo.forEach(["onmouseenter","onmouseleave","onmousedown"],function(e){
|
||||
this.connect(this.domNode,e,"_cssMouseEvent");
|
||||
},this);
|
||||
this.connect(this,"set",function(_1,_2){
|
||||
if(arguments.length>=2&&{disabled:true,readOnly:true,checked:true,selected:true}[_1]){
|
||||
this._setStateClass();
|
||||
}
|
||||
});
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
dojo.declare("dijit._CssStateMixin", [], {
|
||||
// summary:
|
||||
// Mixin for widgets to set CSS classes on the widget DOM nodes depending on hover/mouse press/focus
|
||||
// state changes, and also higher-level state changes such becoming disabled or selected.
|
||||
//
|
||||
// description:
|
||||
// By mixing this class into your widget, and setting the this.baseClass attribute, it will automatically
|
||||
// maintain CSS classes on the widget root node (this.domNode) depending on hover,
|
||||
// active, focus, etc. state. Ex: with a baseClass of dijitButton, it will apply the classes
|
||||
// dijitButtonHovered and dijitButtonActive, as the user moves the mouse over the widget and clicks it.
|
||||
//
|
||||
// It also sets CSS like dijitButtonDisabled based on widget semantic state.
|
||||
//
|
||||
// By setting the cssStateNodes attribute, a widget can also track events on subnodes (like buttons
|
||||
// within the widget).
|
||||
|
||||
// cssStateNodes: [protected] Object
|
||||
// List of sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus
|
||||
//.
|
||||
// Each entry in the hash is a an attachpoint names (like "upArrowButton") mapped to a CSS class names
|
||||
// (like "dijitUpArrowButton"). Example:
|
||||
// | {
|
||||
// | "upArrowButton": "dijitUpArrowButton",
|
||||
// | "downArrowButton": "dijitDownArrowButton"
|
||||
// | }
|
||||
// The above will set the CSS class dijitUpArrowButton to the this.upArrowButton DOMNode when it
|
||||
// is hovered, etc.
|
||||
cssStateNodes: {},
|
||||
|
||||
// hovering: [readonly] Boolean
|
||||
// True if cursor is over this widget
|
||||
hovering: false,
|
||||
|
||||
// active: [readonly] Boolean
|
||||
// True if mouse was pressed while over this widget, and hasn't been released yet
|
||||
active: false,
|
||||
|
||||
_applyAttributes: function(){
|
||||
// This code would typically be in postCreate(), but putting in _applyAttributes() for
|
||||
// performance: so the class changes happen before DOM is inserted into the document.
|
||||
// Change back to postCreate() in 2.0. See #11635.
|
||||
|
||||
this.inherited(arguments);
|
||||
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
}});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._DialogMixin"]){
|
||||
dojo._hasResource["dijit._DialogMixin"]=true;
|
||||
if(!dojo._hasResource["dijit._DialogMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._DialogMixin"] = true;
|
||||
dojo.provide("dijit._DialogMixin");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.declare("dijit._DialogMixin",null,{attributeMap:dijit._Widget.prototype.attributeMap,execute:function(_1){
|
||||
},onCancel:function(){
|
||||
},onExecute:function(){
|
||||
},_onSubmit:function(){
|
||||
this.onExecute();
|
||||
this.execute(this.get("value"));
|
||||
},_getFocusItems:function(_2){
|
||||
var _3=dijit._getTabNavigable(dojo.byId(_2));
|
||||
this._firstFocusItem=_3.lowest||_3.first||_2;
|
||||
this._lastFocusItem=_3.last||_3.highest||this._firstFocusItem;
|
||||
if(dojo.isMoz&&this._firstFocusItem.tagName.toLowerCase()=="input"&&dojo.getNodeProp(this._firstFocusItem,"type").toLowerCase()=="file"){
|
||||
dojo.attr(_2,"tabIndex","0");
|
||||
this._firstFocusItem=_2;
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._DialogMixin", null,
|
||||
{
|
||||
// summary:
|
||||
// This provides functions useful to Dialog and TooltipDialog
|
||||
|
||||
attributeMap: dijit._Widget.prototype.attributeMap,
|
||||
|
||||
execute: function(/*Object*/ formContents){
|
||||
// summary:
|
||||
// Callback when the user hits the submit button.
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._HasDropDown"]){
|
||||
dojo._hasResource["dijit._HasDropDown"]=true;
|
||||
if(!dojo._hasResource["dijit._HasDropDown"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._HasDropDown"] = true;
|
||||
dojo.provide("dijit._HasDropDown");
|
||||
dojo.require("dijit._base.place");
|
||||
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;
|
||||
}
|
||||
this._docHandler=this.connect(dojo.doc,"onmouseup","_onDropDownMouseUp");
|
||||
this.toggleDropDown();
|
||||
},_onDropDownMouseUp:function(e){
|
||||
if(e&&this._docHandler){
|
||||
this.disconnect(this._docHandler);
|
||||
}
|
||||
var _1=this.dropDown,_2=false;
|
||||
if(e&&this._opened){
|
||||
var c=dojo.position(this._buttonNode,true);
|
||||
if(!(e.pageX>=c.x&&e.pageX<=c.x+c.w)||!(e.pageY>=c.y&&e.pageY<=c.y+c.h)){
|
||||
var t=e.target;
|
||||
while(t&&!_2){
|
||||
if(dojo.hasClass(t,"dijitPopup")){
|
||||
_2=true;
|
||||
}else{
|
||||
t=t.parentNode;
|
||||
}
|
||||
}
|
||||
if(_2){
|
||||
t=e.target;
|
||||
if(_1.onItemClick){
|
||||
var _3;
|
||||
while(t&&!(_3=dijit.byNode(t))){
|
||||
t=t.parentNode;
|
||||
}
|
||||
if(_3&&_3.onClick&&_3.getParent){
|
||||
_3.getParent().onItemClick(_3,e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this._opened&&_1.focus){
|
||||
window.setTimeout(dojo.hitch(_1,"focus"),1);
|
||||
}
|
||||
},_onDropDownClick:function(e){
|
||||
if(this._stopClickEvents){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
},_setupDropdown:function(){
|
||||
this._buttonNode=this._buttonNode||this.focusNode||this.domNode;
|
||||
this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;
|
||||
this._aroundNode=this._aroundNode||this.domNode;
|
||||
this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");
|
||||
this.connect(this._buttonNode,"onclick","_onDropDownClick");
|
||||
this.connect(this._buttonNode,"onkeydown","_onDropDownKeydown");
|
||||
this.connect(this._buttonNode,"onkeyup","_onKey");
|
||||
if(this._setStateClass){
|
||||
this.connect(this,"openDropDown","_setStateClass");
|
||||
this.connect(this,"closeDropDown","_setStateClass");
|
||||
}
|
||||
var _4={"after":this.isLeftToRight()?"Right":"Left","before":this.isLeftToRight()?"Left":"Right","above":"Up","below":"Down","left":"Left","right":"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";
|
||||
dojo.addClass(this._arrowWrapperNode||this._buttonNode,"dijit"+_4+"ArrowButton");
|
||||
},postCreate:function(){
|
||||
this._setupDropdown();
|
||||
this.inherited(arguments);
|
||||
},destroyDescendants:function(){
|
||||
if(this.dropDown){
|
||||
if(!this.dropDown._destroyed){
|
||||
this.dropDown.destroyRecursive();
|
||||
}
|
||||
delete this.dropDown;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_onDropDownKeydown:function(e){
|
||||
if(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE){
|
||||
e.preventDefault();
|
||||
}
|
||||
},_onKey:function(e){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
var d=this.dropDown;
|
||||
if(d&&this._opened&&d.handleKey){
|
||||
if(d.handleKey(e)===false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(d&&this._opened&&e.keyCode==dojo.keys.ESCAPE){
|
||||
this.toggleDropDown();
|
||||
}else{
|
||||
if(d&&!this._opened&&(e.keyCode==dojo.keys.DOWN_ARROW||e.keyCode==dojo.keys.ENTER||e.keyCode==dojo.keys.SPACE)){
|
||||
this.toggleDropDown();
|
||||
if(d.focus){
|
||||
setTimeout(dojo.hitch(d,"focus"),1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},_onBlur:function(){
|
||||
this.closeDropDown();
|
||||
this.inherited(arguments);
|
||||
},isLoaded:function(){
|
||||
return true;
|
||||
},loadDropDown:function(_5){
|
||||
_5();
|
||||
},toggleDropDown:function(){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
this.focus();
|
||||
var _6=this.dropDown;
|
||||
if(!_6){
|
||||
return;
|
||||
}
|
||||
if(!this._opened){
|
||||
if(!this.isLoaded()){
|
||||
this.loadDropDown(dojo.hitch(this,"openDropDown"));
|
||||
return;
|
||||
}else{
|
||||
this.openDropDown();
|
||||
}
|
||||
}else{
|
||||
this.closeDropDown();
|
||||
}
|
||||
},openDropDown:function(){
|
||||
var _7=this.dropDown;
|
||||
var _8=_7.domNode;
|
||||
var _9=this;
|
||||
if(!this._preparedNode){
|
||||
dijit.popup.moveOffScreen(_8);
|
||||
this._preparedNode=true;
|
||||
if(_8.style.width){
|
||||
this._explicitDDWidth=true;
|
||||
}
|
||||
if(_8.style.height){
|
||||
this._explicitDDHeight=true;
|
||||
}
|
||||
}
|
||||
if(this.maxHeight||this.forceWidth||this.autoWidth){
|
||||
var _a={display:"",visibility:"hidden"};
|
||||
if(!this._explicitDDWidth){
|
||||
_a.width="";
|
||||
}
|
||||
if(!this._explicitDDHeight){
|
||||
_a.height="";
|
||||
}
|
||||
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"});
|
||||
if(_b){
|
||||
mb.h=this.maxHeight;
|
||||
if("w" in mb){
|
||||
mb.w+=16;
|
||||
}
|
||||
}else{
|
||||
delete mb.h;
|
||||
}
|
||||
delete mb.t;
|
||||
delete mb.l;
|
||||
if(this.forceWidth){
|
||||
mb.w=this.domNode.offsetWidth;
|
||||
}else{
|
||||
if(this.autoWidth){
|
||||
mb.w=Math.max(mb.w,this.domNode.offsetWidth);
|
||||
}else{
|
||||
delete mb.w;
|
||||
}
|
||||
}
|
||||
if(dojo.isFunction(_7.resize)){
|
||||
_7.resize(mb);
|
||||
}else{
|
||||
dojo.marginBox(_8,mb);
|
||||
}
|
||||
}
|
||||
var _c=dijit.popup.open({parent:this,popup:_7,around:this._aroundNode,orient:dijit.getPopupAroundAlignment((this.dropDownPosition&&this.dropDownPosition.length)?this.dropDownPosition:["below"],this.isLeftToRight()),onExecute:function(){
|
||||
_9.closeDropDown(true);
|
||||
},onCancel:function(){
|
||||
_9.closeDropDown(true);
|
||||
},onClose:function(){
|
||||
dojo.attr(_9._popupStateNode,"popupActive",false);
|
||||
dojo.removeClass(_9._popupStateNode,"dijitHasDropDownOpen");
|
||||
_9._opened=false;
|
||||
_9.state="";
|
||||
}});
|
||||
dojo.attr(this._popupStateNode,"popupActive","true");
|
||||
dojo.addClass(_9._popupStateNode,"dijitHasDropDownOpen");
|
||||
this._opened=true;
|
||||
this.state="Opened";
|
||||
return _c;
|
||||
},closeDropDown:function(_d){
|
||||
if(this._opened){
|
||||
if(_d){
|
||||
this.focus();
|
||||
}
|
||||
dijit.popup.close(this.dropDown);
|
||||
this._opened=false;
|
||||
this.state="";
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._HasDropDown",
|
||||
null,
|
||||
{
|
||||
// summary:
|
||||
// Mixin for widgets that need drop down ability.
|
||||
|
||||
// _buttonNode: [protected] DomNode
|
||||
// The button/icon/node to click to display the drop down.
|
||||
// Can be set via a dojoAttachPoint assignment.
|
||||
// If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
|
||||
_buttonNode: null,
|
||||
|
||||
// _arrowWrapperNode: [protected] DomNode
|
||||
// Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
|
||||
// on where the drop down is set to be positioned.
|
||||
// Can be set via a dojoAttachPoint assignment.
|
||||
// If missing, then _buttonNode will be used.
|
||||
_arrowWrapperNode: null,
|
||||
|
||||
// _popupStateNode: [protected] DomNode
|
||||
// The node to set the popupActive class on.
|
||||
// Can be set via a dojoAttachPoint assignment.
|
||||
// If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
|
||||
_popupStateNode: null,
|
||||
|
||||
// _aroundNode: [protected] DomNode
|
||||
// The node to display the popup around.
|
||||
// Can be set via a dojoAttachPoint assignment.
|
||||
// If missing, then domNode will be used.
|
||||
_aroundNode: null,
|
||||
|
||||
// dropDown: [protected] Widget
|
||||
// The widget to display as a popup. This widget *must* be
|
||||
// defined before the startup function is called.
|
||||
dropDown: null,
|
||||
|
||||
// autoWidth: [protected] Boolean
|
||||
// Set to true to make the drop down at least as wide as this
|
||||
// widget. Set to false if the drop down should just be its
|
||||
// default width
|
||||
autoWidth: true,
|
||||
|
||||
// forceWidth: [protected] Boolean
|
||||
// Set to true to make the drop down exactly as wide as this
|
||||
// widget. Overrides autoWidth.
|
||||
forceWidth: false,
|
||||
|
||||
// maxHeight: [protected] Integer
|
||||
// The max height for our dropdown.
|
||||
// Any dropdown taller than this will have scrollbars.
|
||||
// Set to 0 for no max height, or -1 to limit height to available space in viewport
|
||||
maxHeight: 0,
|
||||
|
||||
// dropDownPosition: [const] String[]
|
||||
// This variable controls the position of the drop down.
|
||||
// It's an array of strings with the following values:
|
||||
//
|
||||
// * before: places drop down to the left of the target node/widget, or to the right in
|
||||
// the case of RTL scripts like Hebrew and Arabic
|
||||
// * after: places drop down to the right of the target node/widget, or to the left in
|
||||
// the case of RTL scripts like Hebrew and Arabic
|
||||
// * above: drop down goes above target node
|
||||
// * below: drop down goes below target node
|
||||
//
|
||||
// The list is positions is tried, in order, until a position is found where the drop down fits
|
||||
// within the viewport.
|
||||
//
|
||||
dropDownPosition: ["below","above"],
|
||||
|
||||
// _stopClickEvents: Boolean
|
||||
// When set to false, the click events will not be stopped, in
|
||||
// case you want to use them in your subwidget
|
||||
_stopClickEvents: true,
|
||||
|
||||
_onDropDownMouseDown: function(/*Event*/ e){
|
||||
// summary:
|
||||
// Callback when the user mousedown's on the arrow icon
|
||||
|
||||
if(this.disabled || this.readOnly){ return; }
|
||||
|
||||
dojo.stopEvent(e);
|
||||
|
||||
this._docHandler = this.connect(dojo.doc, "onmouseup", "_onDropDownMouseUp");
|
||||
|
||||
this.toggleDropDown();
|
||||
},
|
||||
|
||||
_onDropDownMouseUp: function(/*Event?*/ e){
|
||||
// summary:
|
||||
// Callback when the user lifts their mouse after mouse down on the arrow icon.
|
||||
// If the drop is a simple menu and the mouse is over the menu, we execute it, otherwise, we focus our
|
||||
// dropDown node. If the event is missing, then we are not
|
||||
// a mouseup event.
|
||||
//
|
||||
// This is useful for the common mouse movement pattern
|
||||
// with native browser <select> nodes:
|
||||
// 1. mouse down on the select node (probably on the arrow)
|
||||
// 2. move mouse to a menu item while holding down the mouse button
|
||||
// 3. mouse up. this selects the menu item as though the user had clicked it.
|
||||
if(e && this._docHandler){
|
||||
this.disconnect(this._docHandler);
|
||||
}
|
||||
var dropDown = this.dropDown, overMenu = false;
|
||||
|
||||
if(e && this._opened){
|
||||
// This code deals with the corner-case when the drop down covers the original widget,
|
||||
// because it's so large. In that case mouse-up shouldn't select a value from the menu.
|
||||
// Find out if our target is somewhere in our dropdown widget,
|
||||
// but not over our _buttonNode (the clickable node)
|
||||
var c = dojo.position(this._buttonNode, true);
|
||||
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;
|
||||
while(t && !overMenu){
|
||||
if(dojo.hasClass(t, "dijitPopup")){
|
||||
overMenu = true;
|
||||
}else{
|
||||
t = t.parentNode;
|
||||
}
|
||||
}
|
||||
if(overMenu){
|
||||
t = e.target;
|
||||
if(dropDown.onItemClick){
|
||||
var menuItem;
|
||||
while(t && !(menuItem = dijit.byNode(t))){
|
||||
t = t.parentNode;
|
||||
}
|
||||
if(menuItem && menuItem.onClick && menuItem.getParent){
|
||||
menuItem.getParent().onItemClick(menuItem, e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this._opened && dropDown.focus && dropDown.autoFocus !== false){
|
||||
// Focus the dropdown widget - do it on a delay so that we
|
||||
// don't steal our own focus.
|
||||
window.setTimeout(dojo.hitch(dropDown, "focus"), 1);
|
||||
}
|
||||
},
|
||||
|
||||
_onDropDownClick: function(/*Event*/ e){
|
||||
// the drop down was already opened on mousedown/keydown; just need to call stopEvent()
|
||||
if(this._stopClickEvents){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
},
|
||||
|
||||
buildRendering: function(){
|
||||
this.inherited(arguments);
|
||||
|
||||
this._buttonNode = this._buttonNode || this.focusNode || this.domNode;
|
||||
this._popupStateNode = this._popupStateNode || this.focusNode || this._buttonNode;
|
||||
|
||||
// Add a class to the "dijitDownArrowButton" type class to _buttonNode so theme can set direction of arrow
|
||||
// based on where drop down will normally appear
|
||||
var defaultPos = {
|
||||
"after" : this.isLeftToRight() ? "Right" : "Left",
|
||||
"before" : this.isLeftToRight() ? "Left" : "Right",
|
||||
"above" : "Up",
|
||||
"below" : "Down",
|
||||
"left" : "Left",
|
||||
"right" : "Right"
|
||||
}[this.dropDownPosition[0]] || this.dropDownPosition[0] || "Down";
|
||||
dojo.addClass(this._arrowWrapperNode || this._buttonNode, "dijit" + defaultPos + "ArrowButton");
|
||||
},
|
||||
|
||||
postCreate: function(){
|
||||
// summary:
|
||||
// set up nodes and connect our mouse and keypress events
|
||||
|
||||
this.inherited(arguments);
|
||||
|
||||
this.connect(this._buttonNode, "onmousedown", "_onDropDownMouseDown");
|
||||
this.connect(this._buttonNode, "onclick", "_onDropDownClick");
|
||||
this.connect(this.focusNode, "onkeypress", "_onKey");
|
||||
this.connect(this.focusNode, "onkeyup", "_onKeyUp");
|
||||
},
|
||||
|
||||
destroy: function(){
|
||||
if(this.dropDown){
|
||||
// Destroy the drop down, unless it's already been destroyed. This can happen because
|
||||
// the drop down is a direct child of <body> even though it's logically my child.
|
||||
if(!this.dropDown._destroyed){
|
||||
this.dropDown.destroyRecursive();
|
||||
}
|
||||
delete this.dropDown;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},
|
||||
|
||||
_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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._KeyNavContainer"]){
|
||||
dojo._hasResource["dijit._KeyNavContainer"]=true;
|
||||
if(!dojo._hasResource["dijit._KeyNavContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._KeyNavContainer"] = true;
|
||||
dojo.provide("dijit._KeyNavContainer");
|
||||
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);
|
||||
var _5=dojo.hitch(this,this.focusNext);
|
||||
dojo.forEach(_1,function(_6){
|
||||
_3[_6]=_4;
|
||||
});
|
||||
dojo.forEach(_2,function(_7){
|
||||
_3[_7]=_5;
|
||||
});
|
||||
this.connect(this.domNode,"onkeypress","_onContainerKeypress");
|
||||
this.connect(this.domNode,"onfocus","_onContainerFocus");
|
||||
},startupKeyNavChildren:function(){
|
||||
dojo.forEach(this.getChildren(),dojo.hitch(this,"_startupChild"));
|
||||
},addChild:function(_8,_9){
|
||||
dijit._KeyNavContainer.superclass.addChild.apply(this,arguments);
|
||||
this._startupChild(_8);
|
||||
},focus:function(){
|
||||
this.focusFirstChild();
|
||||
},focusFirstChild:function(){
|
||||
var _a=this._getFirstFocusableChild();
|
||||
if(_a){
|
||||
this.focusChild(_a);
|
||||
}
|
||||
},focusNext:function(){
|
||||
var _b=this._getNextFocusableChild(this.focusedChild,1);
|
||||
this.focusChild(_b);
|
||||
},focusPrev:function(){
|
||||
var _c=this._getNextFocusableChild(this.focusedChild,-1);
|
||||
this.focusChild(_c,true);
|
||||
},focusChild:function(_d,_e){
|
||||
if(this.focusedChild&&_d!==this.focusedChild){
|
||||
this._onChildBlur(this.focusedChild);
|
||||
}
|
||||
_d.focus(_e?"end":"start");
|
||||
this.focusedChild=_d;
|
||||
},_startupChild:function(_f){
|
||||
_f.set("tabIndex","-1");
|
||||
this.connect(_f,"_onFocus",function(){
|
||||
_f.set("tabIndex",this.tabIndex);
|
||||
});
|
||||
this.connect(_f,"_onBlur",function(){
|
||||
_f.set("tabIndex","-1");
|
||||
});
|
||||
},_onContainerFocus:function(evt){
|
||||
if(evt.target!==this.domNode){
|
||||
return;
|
||||
}
|
||||
this.focusFirstChild();
|
||||
dojo.attr(this.domNode,"tabIndex","-1");
|
||||
},_onBlur:function(evt){
|
||||
if(this.tabIndex){
|
||||
dojo.attr(this.domNode,"tabIndex",this.tabIndex);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_onContainerKeypress:function(evt){
|
||||
if(evt.ctrlKey||evt.altKey){
|
||||
return;
|
||||
}
|
||||
var _10=this._keyNavCodes[evt.charOrCode];
|
||||
if(_10){
|
||||
_10();
|
||||
dojo.stopEvent(evt);
|
||||
}
|
||||
},_onChildBlur:function(_11){
|
||||
},_getFirstFocusableChild:function(){
|
||||
return this._getNextFocusableChild(null,1);
|
||||
},_getNextFocusableChild:function(_12,dir){
|
||||
if(_12){
|
||||
_12=this._getSiblingOfChild(_12,dir);
|
||||
}
|
||||
var _13=this.getChildren();
|
||||
for(var i=0;i<_13.length;i++){
|
||||
if(!_12){
|
||||
_12=_13[(dir>0)?0:(_13.length-1)];
|
||||
}
|
||||
if(_12.isFocusable()){
|
||||
return _12;
|
||||
}
|
||||
_12=this._getSiblingOfChild(_12,dir);
|
||||
}
|
||||
return null;
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._KeyNavContainer",
|
||||
dijit._Container,
|
||||
{
|
||||
|
||||
// summary:
|
||||
// A _Container with keyboard navigation of its children.
|
||||
// description:
|
||||
// To use this mixin, call connectKeyNavHandlers() in
|
||||
// postCreate() and call startupKeyNavChildren() in startup().
|
||||
// It provides normalized keyboard and focusing code for Container
|
||||
// widgets.
|
||||
/*=====
|
||||
// focusedChild: [protected] Widget
|
||||
// The currently focused child widget, or null if there isn't one
|
||||
focusedChild: null,
|
||||
=====*/
|
||||
|
||||
// tabIndex: Integer
|
||||
// Tab index of the container; same as HTML tabIndex attribute.
|
||||
// Note then when user tabs into the container, focus is immediately
|
||||
// moved to the first item in the container.
|
||||
tabIndex: "0",
|
||||
|
||||
_keyNavCodes: {},
|
||||
|
||||
connectKeyNavHandlers: function(/*dojo.keys[]*/ prevKeyCodes, /*dojo.keys[]*/ nextKeyCodes){
|
||||
// summary:
|
||||
// Call in postCreate() to attach the keyboard handlers
|
||||
// to the container.
|
||||
// preKeyCodes: dojo.keys[]
|
||||
// Key codes for navigating to the previous child.
|
||||
// nextKeyCodes: dojo.keys[]
|
||||
// Key codes for navigating to the next child.
|
||||
// tags:
|
||||
// protected
|
||||
|
||||
var keyCodes = (this._keyNavCodes = {});
|
||||
var prev = dojo.hitch(this, this.focusPrev);
|
||||
var next = dojo.hitch(this, this.focusNext);
|
||||
dojo.forEach(prevKeyCodes, function(code){ keyCodes[code] = prev; });
|
||||
dojo.forEach(nextKeyCodes, function(code){ keyCodes[code] = next; });
|
||||
keyCodes[dojo.keys.HOME] = dojo.hitch(this, "focusFirstChild");
|
||||
keyCodes[dojo.keys.END] = dojo.hitch(this, "focusLastChild");
|
||||
this.connect(this.domNode, "onkeypress", "_onContainerKeypress");
|
||||
this.connect(this.domNode, "onfocus", "_onContainerFocus");
|
||||
},
|
||||
|
||||
startupKeyNavChildren: function(){
|
||||
// summary:
|
||||
// Call in startup() to set child tabindexes to -1
|
||||
// tags:
|
||||
// protected
|
||||
dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild"));
|
||||
},
|
||||
|
||||
addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
|
||||
// summary:
|
||||
// Add a child to our _Container
|
||||
dijit._KeyNavContainer.superclass.addChild.apply(this, arguments);
|
||||
this._startupChild(widget);
|
||||
},
|
||||
|
||||
focus: function(){
|
||||
// summary:
|
||||
// Default focus() implementation: focus the first child.
|
||||
this.focusFirstChild();
|
||||
},
|
||||
|
||||
focusFirstChild: function(){
|
||||
// summary:
|
||||
// Focus the first focusable child in the container.
|
||||
// tags:
|
||||
// protected
|
||||
var child = this._getFirstFocusableChild();
|
||||
if(child){ // edge case: Menu could be empty or hidden
|
||||
this.focusChild(child);
|
||||
}
|
||||
},
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._PaletteMixin"]){
|
||||
dojo._hasResource["dijit._PaletteMixin"]=true;
|
||||
if(!dojo._hasResource["dijit._PaletteMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._PaletteMixin"] = true;
|
||||
dojo.provide("dijit._PaletteMixin");
|
||||
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;
|
||||
var _4=dojo.getObject(this.dyeClass);
|
||||
for(var _5=0;_5<_1.length;_5++){
|
||||
var _6=dojo.create("tr",{tabIndex:"-1"},this.gridNode);
|
||||
for(var _7=0;_7<_1[_5].length;_7++){
|
||||
var _8=_1[_5][_7];
|
||||
if(_8){
|
||||
var _9=new _4(_8);
|
||||
var _a=dojo.create("td",{"class":this.cellClass,tabIndex:"-1",title:_2[_8]});
|
||||
_9.fillCell(_a,_3);
|
||||
this.connect(_a,"ondijitclick","_onCellClick");
|
||||
this._trackMouseState(_a,this.cellClass);
|
||||
dojo.place(_a,_6);
|
||||
_a.index=this._cells.length;
|
||||
this._cells.push({node:_a,dye:_9});
|
||||
}
|
||||
}
|
||||
}
|
||||
this._xDim=_1[0].length;
|
||||
this._yDim=_1.length;
|
||||
var _b={UP_ARROW:-this._xDim,DOWN_ARROW:this._xDim,RIGHT_ARROW:this.isLeftToRight()?1:-1,LEFT_ARROW:this.isLeftToRight()?-1:1};
|
||||
for(var _c in _b){
|
||||
this._connects.push(dijit.typematic.addKeyListener(this.domNode,{charOrCode:dojo.keys[_c],ctrlKey:false,altKey:false,shiftKey:false},this,function(){
|
||||
var _d=_b[_c];
|
||||
return function(_e){
|
||||
this._navigateByKey(_d,_e);
|
||||
};
|
||||
}(),this.timeoutChangeRate,this.defaultTimeout));
|
||||
}
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
this._setCurrent(this._cells[0].node);
|
||||
},focus:function(){
|
||||
dijit.focus(this._currentFocus);
|
||||
},_onCellClick:function(_f){
|
||||
var _10=_f.currentTarget,_11=this._getDye(_10).getValue();
|
||||
this._setCurrent(_10);
|
||||
setTimeout(dojo.hitch(this,function(){
|
||||
dijit.focus(_10);
|
||||
this._setValueAttr(_11,true);
|
||||
}));
|
||||
dojo.removeClass(_10,"dijitPaletteCellHover");
|
||||
dojo.stopEvent(_f);
|
||||
},_setCurrent:function(_12){
|
||||
if("_currentFocus" in this){
|
||||
dojo.attr(this._currentFocus,"tabIndex","-1");
|
||||
}
|
||||
this._currentFocus=_12;
|
||||
if(_12){
|
||||
dojo.attr(_12,"tabIndex",this.tabIndex);
|
||||
}
|
||||
},_setValueAttr:function(_13,_14){
|
||||
this.value=null;
|
||||
if(this._selectedCell>=0){
|
||||
dojo.removeClass(this._cells[this._selectedCell].node,"dijitPaletteCellSelected");
|
||||
}
|
||||
this._selectedCell=-1;
|
||||
if(_13){
|
||||
for(var i=0;i<this._cells.length;i++){
|
||||
if(_13==this._cells[i].dye.getValue()){
|
||||
this._selectedCell=i;
|
||||
this.value=_13;
|
||||
dojo.addClass(this._cells[i].node,"dijitPaletteCellSelected");
|
||||
if(_14||_14===undefined){
|
||||
this.onChange(_13);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},onChange:function(_15){
|
||||
},_navigateByKey:function(_16,_17){
|
||||
if(_17==-1){
|
||||
return;
|
||||
}
|
||||
var _18=this._currentFocus.index+_16;
|
||||
if(_18<this._cells.length&&_18>-1){
|
||||
var _19=this._cells[_18].node;
|
||||
this._setCurrent(_19);
|
||||
setTimeout(dojo.hitch(dijit,"focus",_19),0);
|
||||
}
|
||||
},_getDye:function(_1a){
|
||||
return this._cells[_1a.index].dye;
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._PaletteMixin",
|
||||
[dijit._CssStateMixin],
|
||||
{
|
||||
// summary:
|
||||
// A keyboard accessible palette, for picking a color/emoticon/etc.
|
||||
// description:
|
||||
// A mixin for a grid showing various entities, so the user can pick a certain entity.
|
||||
|
||||
// defaultTimeout: Number
|
||||
// Number of milliseconds before a held key or button becomes typematic
|
||||
defaultTimeout: 500,
|
||||
|
||||
// timeoutChangeRate: Number
|
||||
// Fraction of time used to change the typematic timer between events
|
||||
// 1.0 means that each typematic event fires at defaultTimeout intervals
|
||||
// < 1.0 means that each typematic event fires at an increasing faster rate
|
||||
timeoutChangeRate: 0.90,
|
||||
|
||||
// value: String
|
||||
// Currently selected color/emoticon/etc.
|
||||
value: null,
|
||||
|
||||
// _selectedCell: [private] Integer
|
||||
// Index of the currently selected cell. Initially, none selected
|
||||
_selectedCell: -1,
|
||||
|
||||
/*=====
|
||||
// _currentFocus: [private] DomNode
|
||||
// The currently focused cell (if the palette itself has focus), or otherwise
|
||||
// the cell to be focused when the palette itself gets focus.
|
||||
// Different from value, which represents the selected (i.e. clicked) cell.
|
||||
_currentFocus: null,
|
||||
=====*/
|
||||
|
||||
/*=====
|
||||
// _xDim: [protected] Integer
|
||||
// This is the number of cells horizontally across.
|
||||
_xDim: null,
|
||||
=====*/
|
||||
|
||||
/*=====
|
||||
// _yDim: [protected] Integer
|
||||
// This is the number of cells vertically down.
|
||||
_yDim: null,
|
||||
=====*/
|
||||
|
||||
// tabIndex: String
|
||||
// Widget tab index.
|
||||
tabIndex: "0",
|
||||
|
||||
// cellClass: [protected] String
|
||||
// CSS class applied to each cell in the palette
|
||||
cellClass: "dijitPaletteCell",
|
||||
|
||||
// dyeClass: [protected] String
|
||||
// Name of javascript class for Object created for each cell of the palette.
|
||||
// dyeClass should implements dijit.Dye interface
|
||||
dyeClass: '',
|
||||
|
||||
_preparePalette: function(choices, titles, dyeClassObj) {
|
||||
// summary:
|
||||
// Subclass must call _preparePalette() from postCreate(), passing in the tooltip
|
||||
// for each cell
|
||||
// choices: String[][]
|
||||
// id's for each cell of the palette, used to create Dye JS object for each cell
|
||||
// titles: String[]
|
||||
// Localized tooltip for each cell
|
||||
// dyeClassObj: Constructor?
|
||||
// If specified, use this constructor rather than this.dyeClass
|
||||
|
||||
this._cells = [];
|
||||
var url = this._blankGif;
|
||||
|
||||
dyeClassObj = dyeClassObj || dojo.getObject(this.dyeClass);
|
||||
|
||||
for(var row=0; row < choices.length; row++){
|
||||
var rowNode = dojo.create("tr", {tabIndex: "-1"}, this.gridNode);
|
||||
for(var col=0; col < choices[row].length; col++){
|
||||
var value = choices[row][col];
|
||||
if(value){
|
||||
var cellObject = new dyeClassObj(value, row, col);
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
);
|
||||
=====*/
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._Templated"]){
|
||||
dojo._hasResource["dijit._Templated"]=true;
|
||||
if(!dojo._hasResource["dijit._Templated"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._Templated"] = true;
|
||||
dojo.provide("dijit._Templated");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dojo.string");
|
||||
dojo.require("dojo.parser");
|
||||
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){
|
||||
var _2=this.declaredClass,_3=this;
|
||||
return dojo.string.substitute(_1,this,function(_4,_5){
|
||||
if(_5.charAt(0)=="!"){
|
||||
_4=dojo.getObject(_5.substr(1),false,_3);
|
||||
}
|
||||
if(typeof _4=="undefined"){
|
||||
throw new Error(_2+" template:"+_5);
|
||||
}
|
||||
if(_4==null){
|
||||
return "";
|
||||
}
|
||||
return _5.charAt(0)=="!"?_4:_4.toString().replace(/"/g,""");
|
||||
},this);
|
||||
},buildRendering:function(){
|
||||
var _6=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);
|
||||
var _7;
|
||||
if(dojo.isString(_6)){
|
||||
_7=dojo._toDom(this._stringRepl(_6));
|
||||
if(_7.nodeType!=1){
|
||||
throw new Error("Invalid template: "+_6);
|
||||
}
|
||||
}else{
|
||||
_7=_6.cloneNode(true);
|
||||
}
|
||||
this.domNode=_7;
|
||||
this._attachTemplateNodes(_7);
|
||||
if(this.widgetsInTemplate){
|
||||
var _8=dojo.parser,_9,_a;
|
||||
if(_8._query!="[dojoType]"){
|
||||
_9=_8._query;
|
||||
_a=_8._attrName;
|
||||
_8._query="[dojoType]";
|
||||
_8._attrName="dojoType";
|
||||
}
|
||||
var cw=(this._startupWidgets=dojo.parser.parse(_7,{noStart:!this._earlyTemplatedStartup,inherited:{dir:this.dir,lang:this.lang}}));
|
||||
if(_9){
|
||||
_8._query=_9;
|
||||
_8._attrName=_a;
|
||||
}
|
||||
this._supportingWidgets=dijit.findWidgets(_7);
|
||||
this._attachTemplateNodes(cw,function(n,p){
|
||||
return n[p];
|
||||
});
|
||||
}
|
||||
this._fillContent(this.srcNodeRef);
|
||||
},_fillContent:function(_b){
|
||||
var _c=this.containerNode;
|
||||
if(_b&&_c){
|
||||
while(_b.hasChildNodes()){
|
||||
_c.appendChild(_b.firstChild);
|
||||
}
|
||||
}
|
||||
},_attachTemplateNodes:function(_d,_e){
|
||||
_e=_e||function(n,p){
|
||||
return n.getAttribute(p);
|
||||
};
|
||||
var _f=dojo.isArray(_d)?_d:(_d.all||_d.getElementsByTagName("*"));
|
||||
var x=dojo.isArray(_d)?0:-1;
|
||||
for(;x<_f.length;x++){
|
||||
var _10=(x==-1)?_d:_f[x];
|
||||
if(this.widgetsInTemplate&&_e(_10,"dojoType")){
|
||||
continue;
|
||||
}
|
||||
var _11=_e(_10,"dojoAttachPoint");
|
||||
if(_11){
|
||||
var _12,_13=_11.split(/\s*,\s*/);
|
||||
while((_12=_13.shift())){
|
||||
if(dojo.isArray(this[_12])){
|
||||
this[_12].push(_10);
|
||||
}else{
|
||||
this[_12]=_10;
|
||||
}
|
||||
this._attachPoints.push(_12);
|
||||
}
|
||||
}
|
||||
var _14=_e(_10,"dojoAttachEvent");
|
||||
if(_14){
|
||||
var _15,_16=_14.split(/\s*,\s*/);
|
||||
var _17=dojo.trim;
|
||||
while((_15=_16.shift())){
|
||||
if(_15){
|
||||
var _18=null;
|
||||
if(_15.indexOf(":")!=-1){
|
||||
var _19=_15.split(":");
|
||||
_15=_17(_19[0]);
|
||||
_18=_17(_19[1]);
|
||||
}else{
|
||||
_15=_17(_15);
|
||||
}
|
||||
if(!_18){
|
||||
_18=_15;
|
||||
}
|
||||
this.connect(_10,_15,_18);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _1a=_e(_10,"waiRole");
|
||||
if(_1a){
|
||||
dijit.setWaiRole(_10,_1a);
|
||||
}
|
||||
var _1b=_e(_10,"waiState");
|
||||
if(_1b){
|
||||
dojo.forEach(_1b.split(/\s*,\s*/),function(_1c){
|
||||
if(_1c.indexOf("-")!=-1){
|
||||
var _1d=_1c.split("-");
|
||||
dijit.setWaiState(_10,_1d[0],_1d[1]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},startup:function(){
|
||||
dojo.forEach(this._startupWidgets,function(w){
|
||||
if(w&&!w._started&&w.startup){
|
||||
w.startup();
|
||||
}
|
||||
});
|
||||
this.inherited(arguments);
|
||||
},destroyRendering:function(){
|
||||
dojo.forEach(this._attachPoints,function(_1e){
|
||||
delete this[_1e];
|
||||
},this);
|
||||
this._attachPoints=[];
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dijit._Templated._templateCache={};
|
||||
dijit._Templated.getCachedTemplate=function(_1f,_20,_21){
|
||||
var _22=dijit._Templated._templateCache;
|
||||
var key=_20||_1f;
|
||||
var _23=_22[key];
|
||||
if(_23){
|
||||
try{
|
||||
if(!_23.ownerDocument||_23.ownerDocument==dojo.doc){
|
||||
return _23;
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
dojo.destroy(_23);
|
||||
}
|
||||
if(!_20){
|
||||
_20=dojo.cache(_1f,{sanitize:true});
|
||||
}
|
||||
_20=dojo.string.trim(_20);
|
||||
if(_21||_20.match(/\$\{([^\}]+)\}/g)){
|
||||
return (_22[key]=_20);
|
||||
}else{
|
||||
var _24=dojo._toDom(_20);
|
||||
if(_24.nodeType!=1){
|
||||
throw new Error("Invalid template: "+_20);
|
||||
}
|
||||
return (_22[key]=_24);
|
||||
}
|
||||
|
||||
|
||||
dojo.declare("dijit._Templated",
|
||||
null,
|
||||
{
|
||||
// summary:
|
||||
// Mixin for widgets that are instantiated from a template
|
||||
|
||||
// templateString: [protected] String
|
||||
// A string that represents the widget template. Pre-empts the
|
||||
// templatePath. In builds that have their strings "interned", the
|
||||
// templatePath is converted to an inline templateString, thereby
|
||||
// preventing a synchronous network call.
|
||||
//
|
||||
// Use in conjunction with dojo.cache() to load from a file.
|
||||
templateString: null,
|
||||
|
||||
// templatePath: [protected deprecated] String
|
||||
// Path to template (HTML file) for this widget relative to dojo.baseUrl.
|
||||
// Deprecated: use templateString with dojo.cache() instead.
|
||||
templatePath: null,
|
||||
|
||||
// widgetsInTemplate: [protected] Boolean
|
||||
// Should we parse the template to find widgets that might be
|
||||
// declared in markup inside it? False by default.
|
||||
widgetsInTemplate: false,
|
||||
|
||||
// skipNodeCache: [protected] Boolean
|
||||
// If using a cached widget template node poses issues for a
|
||||
// particular widget class, it can set this property to ensure
|
||||
// that its template is always re-built from a string
|
||||
_skipNodeCache: false,
|
||||
|
||||
// _earlyTemplatedStartup: Boolean
|
||||
// A fallback to preserve the 1.0 - 1.3 behavior of children in
|
||||
// templates having their startup called before the parent widget
|
||||
// fires postCreate. Defaults to 'false', causing child widgets to
|
||||
// have their .startup() called immediately before a parent widget
|
||||
// .startup(), but always after the parent .postCreate(). Set to
|
||||
// 'true' to re-enable to previous, arguably broken, behavior.
|
||||
_earlyTemplatedStartup: false,
|
||||
|
||||
/*=====
|
||||
// _attachPoints: [private] String[]
|
||||
// List of widget attribute names associated with dojoAttachPoint=... in the
|
||||
// template, ex: ["containerNode", "labelNode"]
|
||||
_attachPoints: [],
|
||||
=====*/
|
||||
|
||||
/*=====
|
||||
// _attachEvents: [private] Handle[]
|
||||
// List of connections associated with dojoAttachEvent=... in the
|
||||
// template
|
||||
_attachEvents: [],
|
||||
=====*/
|
||||
|
||||
constructor: function(){
|
||||
this._attachPoints = [];
|
||||
this._attachEvents = [];
|
||||
},
|
||||
|
||||
_stringRepl: function(tmpl){
|
||||
// summary:
|
||||
// Does substitution of ${foo} type properties in template string
|
||||
// tags:
|
||||
// private
|
||||
var className = this.declaredClass, _this = this;
|
||||
// Cache contains a string because we need to do property replacement
|
||||
// do the property replacement
|
||||
return dojo.string.substitute(tmpl, this, function(value, key){
|
||||
if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
|
||||
if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
|
||||
if(value == null){ return ""; }
|
||||
|
||||
// Substitution keys beginning with ! will skip the transform step,
|
||||
// in case a user wishes to insert unescaped markup, e.g. ${!foo}
|
||||
return key.charAt(0) == "!" ? value :
|
||||
// Safer substitution, see heading "Attribute values" in
|
||||
// http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
|
||||
value.toString().replace(/"/g,"""); //TODO: add &? use encodeXML method?
|
||||
}, this);
|
||||
},
|
||||
|
||||
buildRendering: function(){
|
||||
// summary:
|
||||
// Construct the UI for this widget from a template, setting this.domNode.
|
||||
// tags:
|
||||
// protected
|
||||
|
||||
// Lookup cached version of template, and download to cache if it
|
||||
// isn't there already. Returns either a DomNode or a string, depending on
|
||||
// whether or not the template contains ${foo} replacement parameters.
|
||||
var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
|
||||
|
||||
var node;
|
||||
if(dojo.isString(cached)){
|
||||
node = dojo._toDom(this._stringRepl(cached));
|
||||
if(node.nodeType != 1){
|
||||
// Flag common problems such as templates with multiple top level nodes (nodeType == 11)
|
||||
throw new Error("Invalid template: " + cached);
|
||||
}
|
||||
}else{
|
||||
// if it's a node, all we have to do is clone it
|
||||
node = cached.cloneNode(true);
|
||||
}
|
||||
|
||||
this.domNode = node;
|
||||
|
||||
// Call down to _Widget.buildRendering() to get base classes assigned
|
||||
// TODO: change the baseClass assignment to attributeMap
|
||||
this.inherited(arguments);
|
||||
|
||||
// recurse through the node, looking for, and attaching to, our
|
||||
// attachment points and events, which should be defined on the template node.
|
||||
this._attachTemplateNodes(node);
|
||||
|
||||
if(this.widgetsInTemplate){
|
||||
// Store widgets that we need to start at a later point in time
|
||||
var cw = (this._startupWidgets = dojo.parser.parse(node, {
|
||||
noStart: !this._earlyTemplatedStartup,
|
||||
template: true,
|
||||
inherited: {dir: this.dir, lang: this.lang},
|
||||
propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me
|
||||
scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type
|
||||
}));
|
||||
|
||||
this._supportingWidgets = dijit.findWidgets(node);
|
||||
|
||||
this._attachTemplateNodes(cw, function(n,p){
|
||||
return n[p];
|
||||
});
|
||||
}
|
||||
|
||||
this._fillContent(this.srcNodeRef);
|
||||
},
|
||||
|
||||
_fillContent: function(/*DomNode*/ source){
|
||||
// summary:
|
||||
// Relocate source contents to templated container node.
|
||||
// this.containerNode must be able to receive children, or exceptions will be thrown.
|
||||
// tags:
|
||||
// protected
|
||||
var dest = this.containerNode;
|
||||
if(source && dest){
|
||||
while(source.hasChildNodes()){
|
||||
dest.appendChild(source.firstChild);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_attachTemplateNodes: function(rootNode, getAttrFunc){
|
||||
// summary:
|
||||
// Iterate through the template and attach functions and nodes accordingly.
|
||||
// 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){
|
||||
dojo.addOnWindowUnload(function(){
|
||||
var _25=dijit._Templated._templateCache;
|
||||
for(var key in _25){
|
||||
var _26=_25[key];
|
||||
if(typeof _26=="object"){
|
||||
dojo.destroy(_26);
|
||||
}
|
||||
delete _25[key];
|
||||
dojo.addOnWindowUnload(function(){
|
||||
var cache = dijit._Templated._templateCache;
|
||||
for(var key in cache){
|
||||
var value = cache[key];
|
||||
if(typeof value == "object"){ // value is either a string or a DOM node template
|
||||
dojo.destroy(value);
|
||||
}
|
||||
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:""});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._TimePicker"]){
|
||||
dojo._hasResource["dijit._TimePicker"]=true;
|
||||
if(!dojo._hasResource["dijit._TimePicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._TimePicker"] = true;
|
||||
dojo.provide("dijit._TimePicker");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
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\"> </div\n\t\t><div class=\"dijitArrowButtonChar\">▲</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\"> </div\n\t\t><div class=\"dijitArrowButtonChar\">▼</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){
|
||||
this.value=_2;
|
||||
this._showText();
|
||||
},onOpen:function(_3){
|
||||
if(this._beenOpened&&this.domNode.parentNode){
|
||||
var p=dijit.byId(this.domNode.parentNode.dijitPopupParent);
|
||||
if(p){
|
||||
var _4=p.get("displayedValue");
|
||||
if(_4&&!p.parse(_4,p.constraints)){
|
||||
this._filterString=_4;
|
||||
}else{
|
||||
this._filterString="";
|
||||
}
|
||||
this._showText();
|
||||
}
|
||||
}
|
||||
this._beenOpened=true;
|
||||
},isDisabledDate:function(_5,_6){
|
||||
return false;
|
||||
},_getFilteredNodes:function(_7,_8,_9){
|
||||
var _a=[],n,i=_7,_b=this._maxIncrement+Math.abs(i),_c=_9?-1:1,_d=_9?1:0,_e=_9?0:1;
|
||||
do{
|
||||
i=i-_d;
|
||||
n=this._createOption(i);
|
||||
if(n){
|
||||
_a.push(n);
|
||||
}
|
||||
i=i+_e;
|
||||
}while(_a.length<_8&&(i*_c)<_b);
|
||||
if(_9){
|
||||
_a.reverse();
|
||||
}
|
||||
return _a;
|
||||
},_showText:function(){
|
||||
this.timeMenu.innerHTML="";
|
||||
var _f=dojo.date.stamp.fromISOString;
|
||||
this._clickableIncrementDate=_f(this.clickableIncrement);
|
||||
this._visibleIncrementDate=_f(this.visibleIncrement);
|
||||
this._visibleRangeDate=_f(this.visibleRange);
|
||||
var _10=function(_11){
|
||||
return _11.getHours()*60*60+_11.getMinutes()*60+_11.getSeconds();
|
||||
};
|
||||
var _12=_10(this._clickableIncrementDate);
|
||||
var _13=_10(this._visibleIncrementDate);
|
||||
var _14=_10(this._visibleRangeDate);
|
||||
var _15=this.value.getTime();
|
||||
this._refDate=new Date(_15-_15%(_13*1000));
|
||||
this._refDate.setFullYear(1970,0,1);
|
||||
this._clickableIncrement=1;
|
||||
this._totalIncrements=_14/_12;
|
||||
this._visibleIncrement=_13/_12;
|
||||
this._maxIncrement=(60*60*24)/_12;
|
||||
var _16=this._getFilteredNodes(0,this._totalIncrements>>1,true);
|
||||
var _17=this._getFilteredNodes(0,this._totalIncrements>>1,false);
|
||||
if(_16.length<this._totalIncrements>>1){
|
||||
_16=_16.slice(_16.length/2);
|
||||
_17=_17.slice(0,_17.length/2);
|
||||
}
|
||||
dojo.forEach(_16.concat(_17),function(n){
|
||||
this.timeMenu.appendChild(n);
|
||||
},this);
|
||||
},postCreate:function(){
|
||||
if(this.constraints===dijit._TimePicker.prototype.constraints){
|
||||
this.constraints={};
|
||||
}
|
||||
dojo.mixin(this,this.constraints);
|
||||
if(!this.constraints.locale){
|
||||
this.constraints.locale=this.lang;
|
||||
}
|
||||
this.connect(this.timeMenu,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled");
|
||||
var _18=this;
|
||||
var _19=function(){
|
||||
_18._connects.push(dijit.typematic.addMouseListener.apply(null,arguments));
|
||||
};
|
||||
_19(this.upArrow,this,this._onArrowUp,1,50);
|
||||
_19(this.downArrow,this,this._onArrowDown,1,50);
|
||||
var _1a=function(cb){
|
||||
return function(cnt){
|
||||
if(cnt>0){
|
||||
cb.call(this,arguments);
|
||||
}
|
||||
};
|
||||
};
|
||||
var _1b=function(_1c,cb){
|
||||
return function(e){
|
||||
dojo.stopEvent(e);
|
||||
dijit.typematic.trigger(e,this,_1c,_1a(cb),_1c,1,50);
|
||||
};
|
||||
};
|
||||
this.connect(this.upArrow,"onmouseover",_1b(this.upArrow,this._onArrowUp));
|
||||
this.connect(this.downArrow,"onmouseover",_1b(this.downArrow,this._onArrowDown));
|
||||
this.inherited(arguments);
|
||||
},_buttonMouse:function(e){
|
||||
dojo.toggleClass(e.currentTarget,e.currentTarget==this.upArrow?"dijitUpArrowHover":"dijitDownArrowHover",e.type=="mouseenter"||e.type=="mouseover");
|
||||
},_createOption:function(_1d){
|
||||
var _1e=new Date(this._refDate);
|
||||
var _1f=this._clickableIncrementDate;
|
||||
_1e.setHours(_1e.getHours()+_1f.getHours()*_1d,_1e.getMinutes()+_1f.getMinutes()*_1d,_1e.getSeconds()+_1f.getSeconds()*_1d);
|
||||
if(this.constraints.selector=="time"){
|
||||
_1e.setFullYear(1970,0,1);
|
||||
}
|
||||
var _20=dojo.date.locale.format(_1e,this.constraints);
|
||||
if(this._filterString&&_20.toLowerCase().indexOf(this._filterString)!==0){
|
||||
return null;
|
||||
}
|
||||
var div=dojo.create("div",{"class":this.baseClass+"Item"});
|
||||
div.date=_1e;
|
||||
div.index=_1d;
|
||||
dojo.create("div",{"class":this.baseClass+"ItemInner",innerHTML:_20},div);
|
||||
if(_1d%this._visibleIncrement<1&&_1d%this._visibleIncrement>-1){
|
||||
dojo.addClass(div,this.baseClass+"Marker");
|
||||
}else{
|
||||
if(!(_1d%this._clickableIncrement)){
|
||||
dojo.addClass(div,this.baseClass+"Tick");
|
||||
}
|
||||
}
|
||||
if(this.isDisabledDate(_1e)){
|
||||
dojo.addClass(div,this.baseClass+"ItemDisabled");
|
||||
}
|
||||
if(!dojo.date.compare(this.value,_1e,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");
|
||||
}
|
||||
}
|
||||
return div;
|
||||
},_onOptionSelected:function(tgt){
|
||||
var _21=tgt.target.date||tgt.target.parentNode.date;
|
||||
if(!_21||this.isDisabledDate(_21)){
|
||||
return;
|
||||
}
|
||||
this._highlighted_option=null;
|
||||
this.set("value",_21);
|
||||
this.onValueSelected(_21);
|
||||
},onValueSelected:function(_22){
|
||||
},_highlightOption:function(_23,_24){
|
||||
if(!_23){
|
||||
return;
|
||||
}
|
||||
if(_24){
|
||||
if(this._highlighted_option){
|
||||
this._highlightOption(this._highlighted_option,false);
|
||||
}
|
||||
this._highlighted_option=_23;
|
||||
}else{
|
||||
if(this._highlighted_option!==_23){
|
||||
return;
|
||||
}else{
|
||||
this._highlighted_option=null;
|
||||
}
|
||||
}
|
||||
dojo.toggleClass(_23,this.baseClass+"ItemHover",_24);
|
||||
if(dojo.hasClass(_23,this.baseClass+"Marker")){
|
||||
dojo.toggleClass(_23,this.baseClass+"MarkerHover",_24);
|
||||
}else{
|
||||
dojo.toggleClass(_23,this.baseClass+"TickHover",_24);
|
||||
}
|
||||
},onmouseover:function(e){
|
||||
this._keyboardSelected=null;
|
||||
var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode;
|
||||
if(!dojo.hasClass(tgr,this.baseClass+"Item")){
|
||||
return;
|
||||
}
|
||||
this._highlightOption(tgr,true);
|
||||
},onmouseout:function(e){
|
||||
this._keyboardSelected=null;
|
||||
var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode;
|
||||
this._highlightOption(tgr,false);
|
||||
},_mouseWheeled:function(e){
|
||||
this._keyboardSelected=null;
|
||||
dojo.stopEvent(e);
|
||||
var _25=(dojo.isIE?e.wheelDelta:-e.detail);
|
||||
this[(_25>0?"_onArrowUp":"_onArrowDown")]();
|
||||
},_onArrowUp:function(_26){
|
||||
if(typeof _26=="number"&&_26==-1){
|
||||
return;
|
||||
}
|
||||
if(!this.timeMenu.childNodes.length){
|
||||
return;
|
||||
}
|
||||
var _27=this.timeMenu.childNodes[0].index;
|
||||
var _28=this._getFilteredNodes(_27,1,true);
|
||||
if(_28.length){
|
||||
this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length-1]);
|
||||
this.timeMenu.insertBefore(_28[0],this.timeMenu.childNodes[0]);
|
||||
}
|
||||
},_onArrowDown:function(_29){
|
||||
if(typeof _29=="number"&&_29==-1){
|
||||
return;
|
||||
}
|
||||
if(!this.timeMenu.childNodes.length){
|
||||
return;
|
||||
}
|
||||
var _2a=this.timeMenu.childNodes[this.timeMenu.childNodes.length-1].index+1;
|
||||
var _2b=this._getFilteredNodes(_2a,1,false);
|
||||
if(_2b.length){
|
||||
this.timeMenu.removeChild(this.timeMenu.childNodes[0]);
|
||||
this.timeMenu.appendChild(_2b[0]);
|
||||
}
|
||||
},handleKey:function(e){
|
||||
var dk=dojo.keys;
|
||||
if(e.keyChar||e.charOrCode===dk.BACKSPACE||e.charOrCode==dk.DELETE){
|
||||
setTimeout(dojo.hitch(this,function(){
|
||||
this._filterString=e.target.value.toLowerCase();
|
||||
this._showText();
|
||||
}),1);
|
||||
}else{
|
||||
if(e.charOrCode==dk.DOWN_ARROW||e.charOrCode==dk.UP_ARROW){
|
||||
dojo.stopEvent(e);
|
||||
if(this._highlighted_option&&!this._highlighted_option.parentNode){
|
||||
this._highlighted_option=null;
|
||||
}
|
||||
var _2c=this.timeMenu,tgt=this._highlighted_option||dojo.query("."+this.baseClass+"ItemSelected",_2c)[0];
|
||||
if(!tgt){
|
||||
tgt=_2c.childNodes[0];
|
||||
}else{
|
||||
if(_2c.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;
|
||||
}else{
|
||||
if(this._highlighted_option&&(e.charOrCode==dk.ENTER||e.charOrCode===dk.TAB)){
|
||||
if(!this._keyboardSelected&&e.charOrCode===dk.TAB){
|
||||
return;
|
||||
}
|
||||
if(e.charOrCode==dk.ENTER){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
this._onOptionSelected({target:this._highlighted_option});
|
||||
}
|
||||
}
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
/*=====
|
||||
dojo.declare(
|
||||
"dijit._TimePicker.__Constraints",
|
||||
dojo.date.locale.__FormatOptions,
|
||||
{
|
||||
// clickableIncrement: String
|
||||
// See `dijit._TimePicker.clickableIncrement`
|
||||
clickableIncrement: "T00:15:00",
|
||||
|
||||
// visibleIncrement: String
|
||||
// See `dijit._TimePicker.visibleIncrement`
|
||||
visibleIncrement: "T01:00:00",
|
||||
|
||||
// visibleRange: String
|
||||
// See `dijit._TimePicker.visibleRange`
|
||||
visibleRange: "T05:00:00"
|
||||
}
|
||||
);
|
||||
=====*/
|
||||
|
||||
dojo.declare("dijit._TimePicker",
|
||||
[dijit._Widget, dijit._Templated],
|
||||
{
|
||||
// summary:
|
||||
// A graphical time picker.
|
||||
// This widget is used internally by other widgets and is not available
|
||||
// as a standalone widget due to lack of accessibility support.
|
||||
|
||||
templateString: dojo.cache("dijit", "templates/TimePicker.html", "<div id=\"widget_${id}\" class=\"dijitMenu\"\n ><div dojoAttachPoint=\"upArrow\" class=\"dijitButtonNode dijitUpArrowButton\" dojoAttachEvent=\"onmouseenter:_buttonMouse,onmouseleave:_buttonMouse\"\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" role=\"presentation\"> </div\n\t\t><div class=\"dijitArrowButtonChar\">▲</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\"> </div\n\t\t><div class=\"dijitArrowButtonChar\">▼</div></div\n></div>\n"),
|
||||
|
||||
// baseClass: [protected] String
|
||||
// The root className to use for the various states of this widget
|
||||
baseClass: "dijitTimePicker",
|
||||
|
||||
// clickableIncrement: String
|
||||
// ISO-8601 string representing the amount by which
|
||||
// every clickable element in the time picker increases.
|
||||
// Set in local time, without a time zone.
|
||||
// Example: `T00:15:00` creates 15 minute increments
|
||||
// Must divide dijit._TimePicker.visibleIncrement evenly
|
||||
clickableIncrement: "T00:15:00",
|
||||
|
||||
// visibleIncrement: String
|
||||
// ISO-8601 string representing the amount by which
|
||||
// every element with a visible time in the time picker increases.
|
||||
// Set in local time, without a time zone.
|
||||
// Example: `T01:00:00` creates text in every 1 hour increment
|
||||
visibleIncrement: "T01:00:00",
|
||||
|
||||
// visibleRange: String
|
||||
// ISO-8601 string representing the range of this TimePicker.
|
||||
// The TimePicker will only display times in this range.
|
||||
// Example: `T05:00:00` displays 5 hours of options
|
||||
visibleRange: "T05:00:00",
|
||||
|
||||
// value: String
|
||||
// Date to display.
|
||||
// Defaults to current time and date.
|
||||
// Can be a Date object or an ISO-8601 string.
|
||||
// If you specify the GMT time zone (`-01:00`),
|
||||
// the time will be converted to the local time in the local time zone.
|
||||
// Otherwise, the time is considered to be in the local time zone.
|
||||
// If you specify the date and isDate is true, the date is used.
|
||||
// Example: if your local time zone is `GMT -05:00`,
|
||||
// `T10:00:00` becomes `T10:00:00-05:00` (considered to be local time),
|
||||
// `T10:00:00-01:00` becomes `T06:00:00-05:00` (4 hour difference),
|
||||
// `T10:00:00Z` becomes `T05:00:00-05:00` (5 hour difference between Zulu and local time)
|
||||
// `yyyy-mm-ddThh:mm:ss` is the format to set the date and time
|
||||
// Example: `2007-06-01T09:00:00`
|
||||
value: new Date(),
|
||||
|
||||
_visibleIncrement:2,
|
||||
_clickableIncrement:1,
|
||||
_totalIncrements:10,
|
||||
|
||||
// constraints: dijit._TimePicker.__Constraints
|
||||
// Specifies valid range of times (start time, end time)
|
||||
constraints:{},
|
||||
|
||||
/*=====
|
||||
serialize: function(val, options){
|
||||
// summary:
|
||||
// User overridable function used to convert the attr('value') result to a String
|
||||
// val: Date
|
||||
// The current value
|
||||
// options: Object?
|
||||
// tags:
|
||||
// protected
|
||||
},
|
||||
=====*/
|
||||
serialize: dojo.date.stamp.toISOString,
|
||||
|
||||
/*=====
|
||||
// filterString: string
|
||||
// The string to filter by
|
||||
filterString: "",
|
||||
=====*/
|
||||
|
||||
setValue: function(/*Date*/ value){
|
||||
// summary:
|
||||
// Deprecated. Used set('value') instead.
|
||||
// tags:
|
||||
// deprecated
|
||||
dojo.deprecated("dijit._TimePicker:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
|
||||
this.set('value', value);
|
||||
},
|
||||
|
||||
_setValueAttr: function(/*Date*/ date){
|
||||
// summary:
|
||||
// Hook so set('value', ...) works.
|
||||
// description:
|
||||
// Set the value of the TimePicker.
|
||||
// Redraws the TimePicker around the new date.
|
||||
// tags:
|
||||
// protected
|
||||
this._set("value", date);
|
||||
this._showText();
|
||||
},
|
||||
|
||||
_setFilterStringAttr: function(val){
|
||||
// summary:
|
||||
// Called by TimeTextBox to filter the values shown in my list
|
||||
this._set("filterString", val);
|
||||
this._showText();
|
||||
},
|
||||
|
||||
isDisabledDate: function(/*Date*/ dateObject, /*String?*/ locale){
|
||||
// summary:
|
||||
// May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend`
|
||||
// type:
|
||||
// extension
|
||||
return false; // Boolean
|
||||
},
|
||||
|
||||
_getFilteredNodes: function(/*number*/ start, /*number*/ maxNum, /*Boolean*/ before, /*DOMnode*/ lastNode){
|
||||
// summary:
|
||||
// Returns an array of nodes with the filter applied. At most maxNum nodes
|
||||
// will be returned - but fewer may be returned as well. If the
|
||||
// before parameter is set to true, then it will return the elements
|
||||
// before the given index
|
||||
// tags:
|
||||
// private
|
||||
var
|
||||
nodes = [],
|
||||
lastValue = lastNode ? lastNode.date : this._refDate,
|
||||
n,
|
||||
i = start,
|
||||
max = this._maxIncrement + Math.abs(i),
|
||||
chk = before ? -1 : 1,
|
||||
dec = before ? 1 : 0,
|
||||
inc = 1 - dec;
|
||||
do{
|
||||
i = i - dec;
|
||||
n = this._createOption(i);
|
||||
if(n){
|
||||
if((before && n.date > lastValue) || (!before && n.date < lastValue)){
|
||||
break; // don't wrap
|
||||
}
|
||||
nodes[before ? "unshift" : "push"](n);
|
||||
lastValue = n.date;
|
||||
}
|
||||
i = i + inc;
|
||||
}while(nodes.length < maxNum && (i*chk) < max);
|
||||
return nodes;
|
||||
},
|
||||
|
||||
_showText: function(){
|
||||
// summary:
|
||||
// Displays the relevant choices in the drop down list
|
||||
// tags:
|
||||
// private
|
||||
var fromIso = dojo.date.stamp.fromISOString;
|
||||
this.timeMenu.innerHTML = "";
|
||||
this._clickableIncrementDate=fromIso(this.clickableIncrement);
|
||||
this._visibleIncrementDate=fromIso(this.visibleIncrement);
|
||||
this._visibleRangeDate=fromIso(this.visibleRange);
|
||||
// get the value of the increments and the range in seconds (since 00:00:00) to find out how many divs to create
|
||||
var
|
||||
sinceMidnight = function(/*Date*/ date){
|
||||
return date.getHours() * 60 * 60 + date.getMinutes() * 60 + date.getSeconds();
|
||||
},
|
||||
clickableIncrementSeconds = sinceMidnight(this._clickableIncrementDate),
|
||||
visibleIncrementSeconds = sinceMidnight(this._visibleIncrementDate),
|
||||
visibleRangeSeconds = sinceMidnight(this._visibleRangeDate),
|
||||
|
||||
// round reference date to previous visible increment
|
||||
time = (this.value || this.currentFocus).getTime();
|
||||
|
||||
this._refDate = new Date(time - time % (visibleIncrementSeconds*1000));
|
||||
this._refDate.setFullYear(1970,0,1); // match parse defaults
|
||||
|
||||
// assume clickable increment is the smallest unit
|
||||
this._clickableIncrement = 1;
|
||||
// divide the visible range by the clickable increment to get the number of divs to create
|
||||
// example: 10:00:00/00:15:00 -> display 40 divs
|
||||
this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds;
|
||||
// divide the visible increments by the clickable increments to get how often to display the time inline
|
||||
// example: 01:00:00/00:15:00 -> display the time every 4 divs
|
||||
this._visibleIncrement = visibleIncrementSeconds / clickableIncrementSeconds;
|
||||
// divide the number of seconds in a day by the clickable increment in seconds to get the
|
||||
// absolute max number of increments.
|
||||
this._maxIncrement = (60 * 60 * 24) / clickableIncrementSeconds;
|
||||
|
||||
var
|
||||
// Find the nodes we should display based on our filter.
|
||||
// Limit to 10 nodes displayed as a half-hearted attempt to stop drop down from overlapping <input>.
|
||||
after = this._getFilteredNodes(0, Math.min(this._totalIncrements >> 1, 10) - 1),
|
||||
before = this._getFilteredNodes(0, Math.min(this._totalIncrements, 10) - after.length, true, after[0]);
|
||||
dojo.forEach(before.concat(after), function(n){this.timeMenu.appendChild(n);}, this);
|
||||
},
|
||||
|
||||
constructor: function(){
|
||||
this.constraints = {}; // create instance object
|
||||
},
|
||||
|
||||
postMixInProperties: function(){
|
||||
this.inherited(arguments);
|
||||
this._setConstraintsAttr(this.constraints); // this needs to happen now (and later) due to codependency on _set*Attr calls
|
||||
},
|
||||
|
||||
_setConstraintsAttr: function(/* Object */ constraints){
|
||||
// brings in visibleRange, increments, etc.
|
||||
dojo.mixin(this, constraints);
|
||||
|
||||
// dojo.date.locale needs the lang in the constraints as locale
|
||||
if(!constraints.locale){
|
||||
constraints.locale = this.lang;
|
||||
}
|
||||
},
|
||||
|
||||
postCreate: function(){
|
||||
// assign typematic mouse listeners to the arrow buttons
|
||||
this.connect(this.timeMenu, dojo.isIE ? "onmousewheel" : 'DOMMouseScroll', "_mouseWheeled");
|
||||
this._connects.push(dijit.typematic.addMouseListener(this.upArrow, this, "_onArrowUp", 33, 250));
|
||||
this._connects.push(dijit.typematic.addMouseListener(this.downArrow, this, "_onArrowDown", 33, 250));
|
||||
|
||||
this.inherited(arguments);
|
||||
},
|
||||
|
||||
_buttonMouse: function(/*Event*/ e){
|
||||
// summary:
|
||||
// Handler for hover (and unhover) on up/down arrows
|
||||
// tags:
|
||||
// private
|
||||
|
||||
// in non-IE browser the "mouseenter" event will become "mouseover",
|
||||
// but in IE it's still "mouseenter"
|
||||
dojo.toggleClass(e.currentTarget, e.currentTarget == this.upArrow ? "dijitUpArrowHover" : "dijitDownArrowHover",
|
||||
e.type == "mouseenter" || e.type == "mouseover");
|
||||
},
|
||||
|
||||
_createOption: function(/*Number*/ index){
|
||||
// summary:
|
||||
// Creates a clickable time option
|
||||
// tags:
|
||||
// private
|
||||
var date = new Date(this._refDate);
|
||||
var incrementDate = this._clickableIncrementDate;
|
||||
date.setHours(date.getHours() + incrementDate.getHours() * index,
|
||||
date.getMinutes() + incrementDate.getMinutes() * index,
|
||||
date.getSeconds() + incrementDate.getSeconds() * index);
|
||||
if(this.constraints.selector == "time"){
|
||||
date.setFullYear(1970,0,1); // make sure each time is for the same date
|
||||
}
|
||||
var dateString = dojo.date.locale.format(date, this.constraints);
|
||||
if(this.filterString && dateString.toLowerCase().indexOf(this.filterString) !== 0){
|
||||
// Doesn't match the filter - return null
|
||||
return null;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._Widget"]){
|
||||
dojo._hasResource["dijit._Widget"]=true;
|
||||
if(!dojo._hasResource["dijit._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dijit._Widget"] = true;
|
||||
dojo.provide("dijit._Widget");
|
||||
dojo.require("dijit._WidgetBase");
|
||||
dojo.require("dijit._base");
|
||||
dojo.connect(dojo,"_connect",function(_1,_2){
|
||||
if(_1&&dojo.isFunction(_1._onConnect)){
|
||||
_1._onConnect(_2);
|
||||
}
|
||||
});
|
||||
dijit._connectOnUseEventHandler=function(_3){
|
||||
};
|
||||
dijit._lastKeyDownNode=null;
|
||||
|
||||
|
||||
|
||||
////////////////// DEFERRED CONNECTS ///////////////////
|
||||
|
||||
// This code is to assist deferring dojo.connect() calls in widgets (connecting to events on the widgets'
|
||||
// DOM nodes) until someone actually needs to monitor that event.
|
||||
dojo.connect(dojo, "_connect",
|
||||
function(/*dijit._Widget*/ widget, /*String*/ event){
|
||||
if(widget && dojo.isFunction(widget._onConnect)){
|
||||
widget._onConnect(event);
|
||||
}
|
||||
});
|
||||
|
||||
dijit._connectOnUseEventHandler = function(/*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){
|
||||
(function(){
|
||||
var _4=function(_5){
|
||||
dijit._lastKeyDownNode=_5.srcElement;
|
||||
};
|
||||
dojo.doc.attachEvent("onkeydown",_4);
|
||||
dojo.addOnWindowUnload(function(){
|
||||
dojo.doc.detachEvent("onkeydown",_4);
|
||||
});
|
||||
})();
|
||||
(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(_6){
|
||||
dijit._lastKeyDownNode=_6.target;
|
||||
},true);
|
||||
dojo.doc.addEventListener('keydown', function(evt){
|
||||
dijit._lastKeyDownNode = evt.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);
|
||||
}
|
||||
|
||||
dojo.declare("dijit._Widget", dijit._WidgetBase, {
|
||||
// summary:
|
||||
// Base class for all Dijit widgets.
|
||||
//
|
||||
// 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
|
||||
}
|
||||
});
|
||||
},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;
|
||||
}});
|
||||
|
||||
})();
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
}
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.focus"]){
|
||||
dojo._hasResource["dijit._base.focus"]=true;
|
||||
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.provide("dijit._base.focus");
|
||||
dojo.require("dojo.window");
|
||||
dojo.require("dijit._base.manager");
|
||||
dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){
|
||||
return dijit.getBookmark().isCollapsed;
|
||||
},getBookmark:function(){
|
||||
var bm,rg,tg,_1=dojo.doc.selection,cf=dijit._curFocus;
|
||||
if(dojo.global.getSelection){
|
||||
_1=dojo.global.getSelection();
|
||||
if(_1){
|
||||
if(_1.isCollapsed){
|
||||
tg=cf?cf.tagName:"";
|
||||
if(tg){
|
||||
tg=tg.toLowerCase();
|
||||
if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){
|
||||
_1={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};
|
||||
return {isCollapsed:(_1.end<=_1.start),mark:_1};
|
||||
}
|
||||
}
|
||||
bm={isCollapsed:true};
|
||||
}else{
|
||||
rg=_1.getRangeAt(0);
|
||||
bm={isCollapsed:false,mark:rg.cloneRange()};
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(_1){
|
||||
tg=cf?cf.tagName:"";
|
||||
tg=tg.toLowerCase();
|
||||
if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){
|
||||
if(_1.type&&_1.type.toLowerCase()=="none"){
|
||||
return {isCollapsed:true,mark:null};
|
||||
}else{
|
||||
rg=_1.createRange();
|
||||
return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};
|
||||
}
|
||||
}
|
||||
bm={};
|
||||
try{
|
||||
rg=_1.createRange();
|
||||
bm.isCollapsed=!(_1.type=="Text"?rg.htmlText.length:rg.length);
|
||||
}
|
||||
catch(e){
|
||||
bm.isCollapsed=true;
|
||||
return bm;
|
||||
}
|
||||
if(_1.type.toUpperCase()=="CONTROL"){
|
||||
if(rg.length){
|
||||
bm.mark=[];
|
||||
var i=0,_2=rg.length;
|
||||
while(i<_2){
|
||||
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;
|
||||
},moveToBookmark:function(_3){
|
||||
var _4=dojo.doc,_5=_3.mark;
|
||||
if(_5){
|
||||
if(dojo.global.getSelection){
|
||||
var _6=dojo.global.getSelection();
|
||||
if(_6&&_6.removeAllRanges){
|
||||
if(_5.pRange){
|
||||
var r=_5;
|
||||
var n=r.node;
|
||||
n.selectionStart=r.start;
|
||||
n.selectionEnd=r.end;
|
||||
}else{
|
||||
_6.removeAllRanges();
|
||||
_6.addRange(_5);
|
||||
}
|
||||
}else{
|
||||
console.warn("No idea how to restore selection for this browser!");
|
||||
}
|
||||
}else{
|
||||
if(_4.selection&&_5){
|
||||
var rg;
|
||||
if(_5.pRange){
|
||||
rg=_5.range;
|
||||
}else{
|
||||
if(dojo.isArray(_5)){
|
||||
rg=_4.body.createControlRange();
|
||||
dojo.forEach(_5,function(n){
|
||||
rg.addElement(n);
|
||||
|
||||
|
||||
// summary:
|
||||
// These functions are used to query or set the focus and selection.
|
||||
//
|
||||
// Also, they trace when widgets become activated/deactivated,
|
||||
// so that the widget can fire _onFocus/_onBlur events.
|
||||
// "Active" here means something similar to "focused", but
|
||||
// "focus" isn't quite the right word because we keep track of
|
||||
// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
|
||||
// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
|
||||
// on the Menu or a MenuItem, since they are considered part of the
|
||||
// ComboButton widget. It only happens when focus is shifted
|
||||
// somewhere completely different.
|
||||
|
||||
dojo.mixin(dijit, {
|
||||
// _curFocus: DomNode
|
||||
// Currently focused item on screen
|
||||
_curFocus: null,
|
||||
|
||||
// _prevFocus: DomNode
|
||||
// Previously focused item on screen
|
||||
_prevFocus: null,
|
||||
|
||||
isCollapsed: function(){
|
||||
// summary:
|
||||
// Returns true if there is no text selected
|
||||
return dijit.getBookmark().isCollapsed;
|
||||
},
|
||||
|
||||
getBookmark: function(){
|
||||
// summary:
|
||||
// Retrieves a bookmark that can be used with moveToBookmark to return to the same range
|
||||
var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
|
||||
|
||||
if(dojo.global.getSelection){
|
||||
//W3C Range API for selections.
|
||||
sel = dojo.global.getSelection();
|
||||
if(sel){
|
||||
if(sel.isCollapsed){
|
||||
tg = cf? cf.tagName : "";
|
||||
if(tg){
|
||||
//Create a fake rangelike item to restore selections.
|
||||
tg = tg.toLowerCase();
|
||||
if(tg == "textarea" ||
|
||||
(tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
|
||||
sel = {
|
||||
start: cf.selectionStart,
|
||||
end: cf.selectionEnd,
|
||||
node: cf,
|
||||
pRange: true
|
||||
};
|
||||
return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
|
||||
}
|
||||
}
|
||||
bm = {isCollapsed:true};
|
||||
if(sel.rangeCount){
|
||||
bm.mark = sel.getRangeAt(0).cloneRange();
|
||||
}
|
||||
}else{
|
||||
rg = sel.getRangeAt(0);
|
||||
bm = {isCollapsed: false, mark: rg.cloneRange()};
|
||||
}
|
||||
}
|
||||
}else if(sel){
|
||||
// If the current focus was a input of some sort and no selection, don't bother saving
|
||||
// a native bookmark. This is because it causes issues with dialog/page selection restore.
|
||||
// So, we need to create psuedo bookmarks to work with.
|
||||
tg = cf ? cf.tagName : "";
|
||||
tg = tg.toLowerCase();
|
||||
if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
|
||||
if(sel.type && sel.type.toLowerCase() == "none"){
|
||||
return {
|
||||
isCollapsed: true,
|
||||
mark: null
|
||||
}
|
||||
}else{
|
||||
rg = sel.createRange();
|
||||
return {
|
||||
isCollapsed: rg.text && rg.text.length?false:true,
|
||||
mark: {
|
||||
range: rg,
|
||||
pRange: true
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
bm = {};
|
||||
|
||||
//'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();
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}});
|
||||
|
||||
// register top window and all the iframes it contains
|
||||
dojo.addOnLoad(function(){
|
||||
var _24=dijit.registerWin(window);
|
||||
if(dojo.isIE){
|
||||
dojo.addOnWindowUnload(function(){
|
||||
dijit.unregisterWin(_24);
|
||||
_24=null;
|
||||
});
|
||||
}
|
||||
var handle = dijit.registerWin(window);
|
||||
if(dojo.isIE){
|
||||
dojo.addOnWindowUnload(function(){
|
||||
dijit.unregisterWin(handle);
|
||||
handle = null;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.manager"]){
|
||||
dojo._hasResource["dijit._base.manager"]=true;
|
||||
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.provide("dijit._base.manager");
|
||||
dojo.declare("dijit.WidgetSet",null,{constructor:function(){
|
||||
this._hash={};
|
||||
this.length=0;
|
||||
},add:function(_1){
|
||||
if(this._hash[_1.id]){
|
||||
throw new Error("Tried to register widget with id=="+_1.id+" but that id is already registered");
|
||||
}
|
||||
this._hash[_1.id]=_1;
|
||||
this.length++;
|
||||
},remove:function(id){
|
||||
if(this._hash[id]){
|
||||
delete this._hash[id];
|
||||
this.length--;
|
||||
}
|
||||
},forEach:function(_2,_3){
|
||||
_3=_3||dojo.global;
|
||||
var i=0,id;
|
||||
for(id in this._hash){
|
||||
_2.call(_3,this._hash[id],i++,this._hash);
|
||||
}
|
||||
return this;
|
||||
},filter:function(_4,_5){
|
||||
_5=_5||dojo.global;
|
||||
var _6=new dijit.WidgetSet(),i=0,id;
|
||||
for(id in this._hash){
|
||||
var w=this._hash[id];
|
||||
if(_4.call(_5,w,i++,this._hash)){
|
||||
_6.add(w);
|
||||
}
|
||||
}
|
||||
return _6;
|
||||
},byId:function(id){
|
||||
return this._hash[id];
|
||||
},byClass:function(_7){
|
||||
var _8=new dijit.WidgetSet(),id,_9;
|
||||
for(id in this._hash){
|
||||
_9=this._hash[id];
|
||||
if(_9.declaredClass==_7){
|
||||
_8.add(_9);
|
||||
}
|
||||
}
|
||||
return _8;
|
||||
},toArray:function(){
|
||||
var ar=[];
|
||||
for(var id in this._hash){
|
||||
ar.push(this._hash[id]);
|
||||
}
|
||||
return ar;
|
||||
},map:function(_a,_b){
|
||||
return dojo.map(this.toArray(),_a,_b);
|
||||
},every:function(_c,_d){
|
||||
_d=_d||dojo.global;
|
||||
var x=0,i;
|
||||
for(i in this._hash){
|
||||
if(!_c.call(_d,this._hash[i],x++,this._hash)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},some:function(_e,_f){
|
||||
_f=_f||dojo.global;
|
||||
var x=0,i;
|
||||
for(i in this._hash){
|
||||
if(_e.call(_f,this._hash[i],x++,this._hash)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}});
|
||||
(function(){
|
||||
dijit.registry=new dijit.WidgetSet();
|
||||
var _10=dijit.registry._hash,_11=dojo.attr,_12=dojo.hasAttr,_13=dojo.style;
|
||||
dijit.byId=function(id){
|
||||
return typeof id=="string"?_10[id]:id;
|
||||
};
|
||||
var _14={};
|
||||
dijit.getUniqueId=function(_15){
|
||||
var id;
|
||||
do{
|
||||
id=_15+"_"+(_15 in _14?++_14[_15]:_14[_15]=0);
|
||||
}while(_10[id]);
|
||||
return dijit._scopeName=="dijit"?id:dijit._scopeName+"_"+id;
|
||||
};
|
||||
dijit.findWidgets=function(_16){
|
||||
var _17=[];
|
||||
function _18(_19){
|
||||
for(var _1a=_19.firstChild;_1a;_1a=_1a.nextSibling){
|
||||
if(_1a.nodeType==1){
|
||||
var _1b=_1a.getAttribute("widgetId");
|
||||
if(_1b){
|
||||
_17.push(_10[_1b]);
|
||||
}else{
|
||||
_18(_1a);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
_18(_16);
|
||||
return _17;
|
||||
};
|
||||
dijit._destroyAll=function(){
|
||||
dijit._curFocus=null;
|
||||
dijit._prevFocus=null;
|
||||
dijit._activeStack=[];
|
||||
dojo.forEach(dijit.findWidgets(dojo.body()),function(_1c){
|
||||
if(!_1c._destroyed){
|
||||
if(_1c.destroyRecursive){
|
||||
_1c.destroyRecursive();
|
||||
}else{
|
||||
if(_1c.destroy){
|
||||
_1c.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
if(dojo.isIE){
|
||||
dojo.addOnWindowUnload(function(){
|
||||
dijit._destroyAll();
|
||||
});
|
||||
}
|
||||
dijit.byNode=function(_1d){
|
||||
return _10[_1d.getAttribute("widgetId")];
|
||||
};
|
||||
dijit.getEnclosingWidget=function(_1e){
|
||||
while(_1e){
|
||||
var id=_1e.getAttribute&&_1e.getAttribute("widgetId");
|
||||
if(id){
|
||||
return _10[id];
|
||||
}
|
||||
_1e=_1e.parentNode;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
var _1f=(dijit._isElementShown=function(_20){
|
||||
var s=_13(_20);
|
||||
return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_11(_20,"type")!="hidden");
|
||||
});
|
||||
dijit.hasDefaultTabStop=function(_21){
|
||||
switch(_21.nodeName.toLowerCase()){
|
||||
case "a":
|
||||
return _12(_21,"href");
|
||||
case "area":
|
||||
case "button":
|
||||
case "input":
|
||||
case "object":
|
||||
case "select":
|
||||
case "textarea":
|
||||
return true;
|
||||
case "iframe":
|
||||
if(dojo.isMoz){
|
||||
try{
|
||||
return _21.contentDocument.designMode=="on";
|
||||
}
|
||||
catch(err){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
if(dojo.isWebKit){
|
||||
var doc=_21.contentDocument,_22=doc&&doc.body;
|
||||
return _22&&_22.contentEditable=="true";
|
||||
}else{
|
||||
try{
|
||||
doc=_21.contentWindow.document;
|
||||
_22=doc&&doc.body;
|
||||
return _22&&_22.firstChild&&_22.firstChild.contentEditable=="true";
|
||||
}
|
||||
catch(e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
return _21.contentEditable=="true";
|
||||
}
|
||||
};
|
||||
var _23=(dijit.isTabNavigable=function(_24){
|
||||
if(_11(_24,"disabled")){
|
||||
return false;
|
||||
}else{
|
||||
if(_12(_24,"tabIndex")){
|
||||
return _11(_24,"tabIndex")>=0;
|
||||
}else{
|
||||
return dijit.hasDefaultTabStop(_24);
|
||||
}
|
||||
}
|
||||
});
|
||||
dijit._getTabNavigable=function(_25){
|
||||
var _26,_27,_28,_29,_2a,_2b;
|
||||
var _2c=function(_2d){
|
||||
dojo.query("> *",_2d).forEach(function(_2e){
|
||||
if((dojo.isIE&&_2e.scopeName!=="HTML")||!_1f(_2e)){
|
||||
return;
|
||||
}
|
||||
if(_23(_2e)){
|
||||
var _2f=_11(_2e,"tabIndex");
|
||||
if(!_12(_2e,"tabIndex")||_2f==0){
|
||||
if(!_26){
|
||||
_26=_2e;
|
||||
}
|
||||
_27=_2e;
|
||||
}else{
|
||||
if(_2f>0){
|
||||
if(!_28||_2f<_29){
|
||||
_29=_2f;
|
||||
_28=_2e;
|
||||
}
|
||||
if(!_2a||_2f>=_2b){
|
||||
_2b=_2f;
|
||||
_2a=_2e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_2e.nodeName.toUpperCase()!="SELECT"){
|
||||
_2c(_2e);
|
||||
}
|
||||
|
||||
|
||||
dojo.declare("dijit.WidgetSet", null, {
|
||||
// summary:
|
||||
// A set of widgets indexed by id. A default instance of this class is
|
||||
// available as `dijit.registry`
|
||||
//
|
||||
// example:
|
||||
// Create a small list of widgets:
|
||||
// | var ws = new dijit.WidgetSet();
|
||||
// | ws.add(dijit.byId("one"));
|
||||
// | ws.add(dijit.byId("two"));
|
||||
// | // destroy both:
|
||||
// | ws.forEach(function(w){ w.destroy(); });
|
||||
//
|
||||
// example:
|
||||
// Using dijit.registry:
|
||||
// | dijit.registry.forEach(function(w){ /* do something */ });
|
||||
|
||||
constructor: function(){
|
||||
this._hash = {};
|
||||
this.length = 0;
|
||||
},
|
||||
|
||||
add: function(/*dijit._Widget*/ widget){
|
||||
// summary:
|
||||
// Add a widget to this list. If a duplicate ID is detected, a error is thrown.
|
||||
//
|
||||
// widget: dijit._Widget
|
||||
// Any dijit._Widget subclass.
|
||||
if(this._hash[widget.id]){
|
||||
throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
|
||||
}
|
||||
this._hash[widget.id] = widget;
|
||||
this.length++;
|
||||
},
|
||||
|
||||
remove: function(/*String*/ id){
|
||||
// summary:
|
||||
// Remove a widget from this WidgetSet. Does not destroy the widget; simply
|
||||
// removes the reference.
|
||||
if(this._hash[id]){
|
||||
delete this._hash[id];
|
||||
this.length--;
|
||||
}
|
||||
},
|
||||
|
||||
forEach: function(/*Function*/ func, /* Object? */thisObj){
|
||||
// summary:
|
||||
// Call specified function for each widget in this set.
|
||||
//
|
||||
// func:
|
||||
// A callback function to run for each item. Is passed the widget, the index
|
||||
// in the iteration, and the full hash, similar to `dojo.forEach`.
|
||||
//
|
||||
// thisObj:
|
||||
// An optional scope parameter
|
||||
//
|
||||
// example:
|
||||
// Using the default `dijit.registry` instance:
|
||||
// | dijit.registry.forEach(function(widget){
|
||||
// | console.log(widget.declaredClass);
|
||||
// | });
|
||||
//
|
||||
// returns:
|
||||
// Returns self, in order to allow for further chaining.
|
||||
|
||||
thisObj = thisObj || dojo.global;
|
||||
var i = 0, id;
|
||||
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
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
if(_1f(_25)){
|
||||
_2c(_25);
|
||||
}
|
||||
return {first:_26,last:_27,lowest:_28,highest:_2a};
|
||||
};
|
||||
dijit.getFirstInTabbingOrder=function(_30){
|
||||
var _31=dijit._getTabNavigable(dojo.byId(_30));
|
||||
return _31.lowest?_31.lowest:_31.first;
|
||||
};
|
||||
dijit.getLastInTabbingOrder=function(_32){
|
||||
var _33=dijit._getTabNavigable(dojo.byId(_32));
|
||||
return _33.last?_33.last:_33.highest;
|
||||
};
|
||||
dijit.defaultDuration=dojo.config["defaultDuration"]||200;
|
||||
|
||||
(function(){
|
||||
|
||||
/*=====
|
||||
dijit.registry = {
|
||||
// summary:
|
||||
// A list of widgets on a page.
|
||||
// description:
|
||||
// Is an instance of `dijit.WidgetSet`
|
||||
};
|
||||
=====*/
|
||||
dijit.registry = new dijit.WidgetSet();
|
||||
|
||||
var hash = dijit.registry._hash,
|
||||
attr = dojo.attr,
|
||||
hasAttr = dojo.hasAttr,
|
||||
style = dojo.style;
|
||||
|
||||
dijit.byId = function(/*String|dijit._Widget*/ id){
|
||||
// summary:
|
||||
// Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
|
||||
return typeof id == "string" ? hash[id] : id; // dijit._Widget
|
||||
};
|
||||
|
||||
var _widgetTypeCtr = {};
|
||||
dijit.getUniqueId = function(/*String*/widgetType){
|
||||
// summary:
|
||||
// Generates a unique id for a given widgetType
|
||||
|
||||
var id;
|
||||
do{
|
||||
id = widgetType + "_" +
|
||||
(widgetType in _widgetTypeCtr ?
|
||||
++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
|
||||
}while(hash[id]);
|
||||
return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
|
||||
};
|
||||
|
||||
dijit.findWidgets = function(/*DomNode*/ root){
|
||||
// summary:
|
||||
// Search subtree under root returning widgets found.
|
||||
// Doesn't search for nested widgets (ie, widgets inside other widgets).
|
||||
|
||||
var outAry = [];
|
||||
|
||||
function getChildrenHelper(root){
|
||||
for(var node = root.firstChild; node; node = node.nextSibling){
|
||||
if(node.nodeType == 1){
|
||||
var widgetId = node.getAttribute("widgetId");
|
||||
if(widgetId){
|
||||
var widget = hash[widgetId];
|
||||
if(widget){ // may be null on page w/multiple dojo's loaded
|
||||
outAry.push(widget);
|
||||
}
|
||||
}else{
|
||||
getChildrenHelper(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getChildrenHelper(root);
|
||||
return outAry;
|
||||
};
|
||||
|
||||
dijit._destroyAll = function(){
|
||||
// summary:
|
||||
// Code to destroy all widgets and do other cleanup on page unload
|
||||
|
||||
// Clean up focus manager lingering references to widgets and nodes
|
||||
dijit._curFocus = null;
|
||||
dijit._prevFocus = null;
|
||||
dijit._activeStack = [];
|
||||
|
||||
// Destroy all the widgets, top down
|
||||
dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
|
||||
// Avoid double destroy of widgets like Menu that are attached to <body>
|
||||
// even though they are logically children of other widgets.
|
||||
if(!widget._destroyed){
|
||||
if(widget.destroyRecursive){
|
||||
widget.destroyRecursive();
|
||||
}else if(widget.destroy){
|
||||
widget.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if(dojo.isIE){
|
||||
// Only run _destroyAll() for IE because we think it's only necessary in that case,
|
||||
// and because it causes problems on FF. See bug #3531 for details.
|
||||
dojo.addOnWindowUnload(function(){
|
||||
dijit._destroyAll();
|
||||
});
|
||||
}
|
||||
|
||||
dijit.byNode = function(/*DOMNode*/ node){
|
||||
// summary:
|
||||
// Returns the widget corresponding to the given DOMNode
|
||||
return hash[node.getAttribute("widgetId")]; // dijit._Widget
|
||||
};
|
||||
|
||||
dijit.getEnclosingWidget = function(/*DOMNode*/ node){
|
||||
// summary:
|
||||
// Returns the widget whose DOM tree contains the specified DOMNode, or null if
|
||||
// the node is not contained within the DOM tree of any widget
|
||||
while(node){
|
||||
var id = node.getAttribute && node.getAttribute("widgetId");
|
||||
if(id){
|
||||
return hash[id];
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var shown = (dijit._isElementShown = function(/*Element*/ elem){
|
||||
var s = style(elem);
|
||||
return (s.visibility != "hidden")
|
||||
&& (s.visibility != "collapsed")
|
||||
&& (s.display != "none")
|
||||
&& (attr(elem, "type") != "hidden");
|
||||
});
|
||||
|
||||
dijit.hasDefaultTabStop = function(/*Element*/ elem){
|
||||
// summary:
|
||||
// Tests if element is tab-navigable even without an explicit tabIndex setting
|
||||
|
||||
// No explicit tabIndex setting, need to investigate node type
|
||||
switch(elem.nodeName.toLowerCase()){
|
||||
case "a":
|
||||
// An <a> w/out a tabindex is only navigable if it has an href
|
||||
return hasAttr(elem, "href");
|
||||
case "area":
|
||||
case "button":
|
||||
case "input":
|
||||
case "object":
|
||||
case "select":
|
||||
case "textarea":
|
||||
// These are navigable by default
|
||||
return true;
|
||||
case "iframe":
|
||||
// If it's an editor <iframe> then it's tab navigable.
|
||||
var body;
|
||||
try{
|
||||
// non-IE
|
||||
var contentDocument = elem.contentDocument;
|
||||
if("designMode" in contentDocument && contentDocument.designMode == "on"){
|
||||
return true;
|
||||
}
|
||||
body = contentDocument.body;
|
||||
}catch(e1){
|
||||
// contentWindow.document isn't accessible within IE7/8
|
||||
// if the iframe.src points to a foreign url and this
|
||||
// page contains an element, that could get focus
|
||||
try{
|
||||
body = elem.contentWindow.document.body;
|
||||
}catch(e2){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
|
||||
default:
|
||||
return elem.contentEditable == 'true';
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
})();
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.place"]){
|
||||
dojo._hasResource["dijit._base.place"]=true;
|
||||
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.provide("dijit._base.place");
|
||||
dojo.require("dojo.window");
|
||||
dojo.require("dojo.AdapterRegistry");
|
||||
dijit.getViewport=function(){
|
||||
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}};
|
||||
if(_4){
|
||||
c.pos.x+=_6.charAt(1)=="L"?_4.x:-_4.x;
|
||||
c.pos.y+=_6.charAt(0)=="T"?_4.y:-_4.y;
|
||||
}
|
||||
return c;
|
||||
});
|
||||
return dijit._place(_1,_5);
|
||||
|
||||
|
||||
dijit.getViewport = function(){
|
||||
// summary:
|
||||
// Returns the dimensions and scroll position of the viewable area of a browser window
|
||||
|
||||
return dojo.window.getBox();
|
||||
};
|
||||
dijit._place=function(_7,_8,_9){
|
||||
var _a=dojo.window.getBox();
|
||||
if(!_7.parentNode||String(_7.parentNode.tagName).toLowerCase()!="body"){
|
||||
dojo.body().appendChild(_7);
|
||||
}
|
||||
var _b=null;
|
||||
dojo.some(_8,function(_c){
|
||||
var _d=_c.corner;
|
||||
var _e=_c.pos;
|
||||
if(_9){
|
||||
_9(_7,_c.aroundCorner,_d);
|
||||
|
||||
/*=====
|
||||
dijit.__Position = function(){
|
||||
// x: Integer
|
||||
// horizontal coordinate in pixels, relative to document body
|
||||
// y: Integer
|
||||
// vertical coordinate in pixels, relative to document body
|
||||
|
||||
thix.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
var _f=_7.style;
|
||||
var _10=_f.display;
|
||||
var _11=_f.visibility;
|
||||
_f.visibility="hidden";
|
||||
_f.display="";
|
||||
var mb=dojo.marginBox(_7);
|
||||
_f.display=_10;
|
||||
_f.visibility=_11;
|
||||
var _12=Math.max(_a.l,_d.charAt(1)=="L"?_e.x:(_e.x-mb.w)),_13=Math.max(_a.t,_d.charAt(0)=="T"?_e.y:(_e.y-mb.h)),_14=Math.min(_a.l+_a.w,_d.charAt(1)=="L"?(_12+mb.w):_e.x),_15=Math.min(_a.t+_a.h,_d.charAt(0)=="T"?(_13+mb.h):_e.y),_16=_14-_12,_17=_15-_13,_18=(mb.w-_16)+(mb.h-_17);
|
||||
if(_b==null||_18<_b.overflow){
|
||||
_b={corner:_d,aroundCorner:_c.aroundCorner,x:_12,y:_13,w:_16,h:_17,overflow:_18};
|
||||
=====*/
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
return !_18;
|
||||
});
|
||||
_7.style.left=_b.x+"px";
|
||||
_7.style.top=_b.y+"px";
|
||||
if(_b.overflow&&_9){
|
||||
_9(_7,_b.aroundCorner,_b.corner);
|
||||
|
||||
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;
|
||||
}
|
||||
return _b;
|
||||
};
|
||||
dijit.placeOnScreenAroundNode=function(_19,_1a,_1b,_1c){
|
||||
_1a=dojo.byId(_1a);
|
||||
var _1d=_1a.style.display;
|
||||
_1a.style.display="";
|
||||
var _1e=dojo.position(_1a,true);
|
||||
_1a.style.display=_1d;
|
||||
return dijit._placeOnScreenAroundRect(_19,_1e.x,_1e.y,_1e.w,_1e.h,_1b,_1c);
|
||||
};
|
||||
dijit.placeOnScreenAroundRectangle=function(_1f,_20,_21,_22){
|
||||
return dijit._placeOnScreenAroundRect(_1f,_20.x,_20.y,_20.width,_20.height,_21,_22);
|
||||
|
||||
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._placeOnScreenAroundRect=function(_23,x,y,_24,_25,_26,_27){
|
||||
var _28=[];
|
||||
for(var _29 in _26){
|
||||
_28.push({aroundCorner:_29,corner:_26[_29],pos:{x:x+(_29.charAt(1)=="L"?0:_24),y:y+(_29.charAt(0)=="T"?0:_25)}});
|
||||
|
||||
/*=====
|
||||
dijit.__Rectangle = function(){
|
||||
// x: Integer
|
||||
// horizontal offset in pixels, relative to document body
|
||||
// y: Integer
|
||||
// vertical offset in pixels, relative to document body
|
||||
// width: Integer
|
||||
// width in pixels
|
||||
// height: Integer
|
||||
// height in pixels
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
return dijit._place(_23,_28,_27);
|
||||
=====*/
|
||||
|
||||
|
||||
dijit.placeOnScreenAroundRectangle = function(
|
||||
/* DomNode */ node,
|
||||
/* dijit.__Rectangle */ aroundRect,
|
||||
/* Object */ aroundCorners,
|
||||
/* Function */ layoutNode){
|
||||
|
||||
// summary:
|
||||
// Like dijit.placeOnScreenAroundNode(), except that the "around"
|
||||
// parameter is an arbitrary rectangle on the screen (x, y, width, height)
|
||||
// instead of a dom node.
|
||||
|
||||
return dijit._placeOnScreenAroundRect(node,
|
||||
aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
|
||||
aroundCorners, layoutNode);
|
||||
};
|
||||
|
||||
dijit._placeOnScreenAroundRect = function(
|
||||
/* DomNode */ node,
|
||||
/* Number */ x,
|
||||
/* Number */ y,
|
||||
/* Number */ width,
|
||||
/* Number */ height,
|
||||
/* Object */ aroundCorners,
|
||||
/* Function */ layoutNode){
|
||||
|
||||
// summary:
|
||||
// Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
|
||||
// of a rectangle to place node adjacent to.
|
||||
|
||||
// TODO: combine with placeOnScreenAroundRectangle()
|
||||
|
||||
// Generate list of possible positions for node
|
||||
var choices = [];
|
||||
for(var nodeCorner in aroundCorners){
|
||||
choices.push( {
|
||||
aroundCorner: nodeCorner,
|
||||
corner: aroundCorners[nodeCorner],
|
||||
pos: {
|
||||
x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
|
||||
y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return dijit._place(node, choices, layoutNode, {w: width, h: height});
|
||||
};
|
||||
dijit.placementRegistry=new dojo.AdapterRegistry();
|
||||
dijit.placementRegistry.register("node",function(n,x){
|
||||
return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";
|
||||
},dijit.placeOnScreenAroundNode);
|
||||
dijit.placementRegistry.register("rect",function(n,x){
|
||||
return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;
|
||||
},dijit.placeOnScreenAroundRectangle);
|
||||
dijit.placeOnScreenAroundElement=function(_2a,_2b,_2c,_2d){
|
||||
return dijit.placementRegistry.match.apply(dijit.placementRegistry,arguments);
|
||||
|
||||
dijit.placementRegistry= new dojo.AdapterRegistry();
|
||||
dijit.placementRegistry.register("node",
|
||||
function(n, x){
|
||||
return typeof x == "object" &&
|
||||
typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
|
||||
},
|
||||
dijit.placeOnScreenAroundNode);
|
||||
dijit.placementRegistry.register("rect",
|
||||
function(n, x){
|
||||
return typeof x == "object" &&
|
||||
"x" in x && "y" in x && "width" in x && "height" in x;
|
||||
},
|
||||
dijit.placeOnScreenAroundRectangle);
|
||||
|
||||
dijit.placeOnScreenAroundElement = function(
|
||||
/* DomNode */ node,
|
||||
/* Object */ aroundElement,
|
||||
/* Object */ aroundCorners,
|
||||
/* Function */ layoutNode){
|
||||
|
||||
// summary:
|
||||
// Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
|
||||
// for the "around" argument and finds a proper processor to place a node.
|
||||
|
||||
return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
|
||||
};
|
||||
dijit.getPopupAroundAlignment=function(_2e,_2f){
|
||||
var _30={};
|
||||
dojo.forEach(_2e,function(pos){
|
||||
switch(pos){
|
||||
case "after":
|
||||
_30[_2f?"BR":"BL"]=_2f?"BL":"BR";
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.popup"]){
|
||||
dojo._hasResource["dijit._base.popup"]=true;
|
||||
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.provide("dijit._base.popup");
|
||||
dojo.require("dijit._base.focus");
|
||||
dojo.require("dijit._base.place");
|
||||
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.setWaiRole(_2,"presentation");
|
||||
_2.appendChild(_1);
|
||||
}
|
||||
var s=_1.style;
|
||||
s.display="";
|
||||
s.visibility="";
|
||||
s.position="";
|
||||
s.top="0px";
|
||||
dojo.style(_2,{visibility:"hidden",top:"-9999px"});
|
||||
},getTopPopup:function(){
|
||||
var _3=this._stack;
|
||||
for(var pi=_3.length-1;pi>0&&_3[pi].parent===_3[pi-1].widget;pi--){
|
||||
}
|
||||
return _3[pi];
|
||||
},open:function(_4){
|
||||
var _5=this._stack,_6=_4.popup,_7=_4.orient||((_4.parent?_4.parent.isLeftToRight():dojo._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_8=_4.around,id=(_4.around&&_4.around.id)?(_4.around.id+"_dropdown"):("popup_"+this._idGen++);
|
||||
var _9=_6.domNode.parentNode;
|
||||
if(!_9||!dojo.hasClass(_9,"dijitPopup")){
|
||||
this.moveOffScreen(_6.domNode);
|
||||
_9=_6.domNode.parentNode;
|
||||
}
|
||||
dojo.attr(_9,{id:id,style:{zIndex:this._beginZIndex+_5.length},"class":"dijitPopup "+(_6.baseClass||_6["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_4.parent?_4.parent.id:""});
|
||||
if(dojo.isIE||dojo.isMoz){
|
||||
var _a=_9.childNodes[1];
|
||||
if(!_a){
|
||||
_a=new dijit.BackgroundIframe(_9);
|
||||
}
|
||||
}
|
||||
var _b=_8?dijit.placeOnScreenAroundElement(_9,_8,_7,_6.orient?dojo.hitch(_6,"orient"):null):dijit.placeOnScreen(_9,_4,_7=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_4.padding);
|
||||
_9.style.visibility="visible";
|
||||
_6.domNode.style.visibility="visible";
|
||||
var _c=[];
|
||||
_c.push(dojo.connect(_9,"onkeypress",this,function(_d){
|
||||
if(_d.charOrCode==dojo.keys.ESCAPE&&_4.onCancel){
|
||||
dojo.stopEvent(_d);
|
||||
_4.onCancel();
|
||||
}else{
|
||||
if(_d.charOrCode===dojo.keys.TAB){
|
||||
dojo.stopEvent(_d);
|
||||
var _e=this.getTopPopup();
|
||||
if(_e&&_e.onCancel){
|
||||
_e.onCancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
if(_6.onCancel){
|
||||
_c.push(dojo.connect(_6,"onCancel",_4.onCancel));
|
||||
}
|
||||
_c.push(dojo.connect(_6,_6.onExecute?"onExecute":"onChange",this,function(){
|
||||
var _f=this.getTopPopup();
|
||||
if(_f&&_f.onExecute){
|
||||
_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){
|
||||
_6.onOpen(_b);
|
||||
}
|
||||
return _b;
|
||||
},close:function(_10){
|
||||
var _11=this._stack;
|
||||
while(dojo.some(_11,function(_12){
|
||||
return _12.widget==_10;
|
||||
})){
|
||||
var top=_11.pop(),_13=top.wrapper,_14=top.iframe,_15=top.widget,_16=top.onClose;
|
||||
if(_15.onClose){
|
||||
_15.onClose();
|
||||
}
|
||||
dojo.forEach(top.handlers,dojo.disconnect);
|
||||
if(_15&&_15.domNode){
|
||||
this.moveOffScreen(_15.domNode);
|
||||
}else{
|
||||
dojo.destroy(_13);
|
||||
}
|
||||
if(_16){
|
||||
_16();
|
||||
}
|
||||
}
|
||||
}};
|
||||
dijit._frames=new function(){
|
||||
var _17=[];
|
||||
this.pop=function(){
|
||||
var _18;
|
||||
if(_17.length){
|
||||
_18=_17.pop();
|
||||
_18.style.display="";
|
||||
}else{
|
||||
if(dojo.isIE){
|
||||
var _19=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";
|
||||
var _1a="<iframe src='"+_19+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";
|
||||
_18=dojo.doc.createElement(_1a);
|
||||
}else{
|
||||
_18=dojo.create("iframe");
|
||||
_18.src="javascript:\"\"";
|
||||
_18.className="dijitBackgroundIframe";
|
||||
dojo.style(_18,"opacity",0.1);
|
||||
}
|
||||
_18.tabIndex=-1;
|
||||
dijit.setWaiRole(_18,"presentation");
|
||||
|
||||
|
||||
/*=====
|
||||
dijit.popup.__OpenArgs = function(){
|
||||
// popup: Widget
|
||||
// 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;
|
||||
}
|
||||
return _18;
|
||||
};
|
||||
this.push=function(_1b){
|
||||
_1b.style.display="none";
|
||||
_17.push(_1b);
|
||||
=====*/
|
||||
|
||||
dijit.popup = {
|
||||
// summary:
|
||||
// This singleton is used to show/hide widgets as popups.
|
||||
|
||||
// _stack: dijit._Widget[]
|
||||
// Stack of currently popped up widgets.
|
||||
// (someone opened _stack[0], and then it opened _stack[1], etc.)
|
||||
_stack: [],
|
||||
|
||||
// _beginZIndex: Number
|
||||
// Z-index of the first popup. (If first popup opens other
|
||||
// popups they get a higher z-index.)
|
||||
_beginZIndex: 1000,
|
||||
|
||||
_idGen: 1,
|
||||
|
||||
_createWrapper: function(/*Widget || DomNode*/ widget){
|
||||
// summary:
|
||||
// Initialization for widgets that will be used as popups.
|
||||
// Puts widget inside a wrapper DIV (if not already in one),
|
||||
// and returns pointer to that wrapper DIV.
|
||||
|
||||
var wrapper = widget.declaredClass ? widget._popupWrapper : (widget.parentNode && dojo.hasClass(widget.parentNode, "dijitPopup")),
|
||||
node = widget.domNode || widget;
|
||||
|
||||
if(!wrapper){
|
||||
// Create wrapper <div> for when this widget [in the future] will be used as a popup.
|
||||
// This is done early because of IE bugs where creating/moving DOM nodes causes focus
|
||||
// to go wonky, see tests/robot/Toolbar.html to reproduce
|
||||
wrapper = dojo.create("div",{
|
||||
"class":"dijitPopup",
|
||||
style:{ display: "none"},
|
||||
role: "presentation"
|
||||
}, dojo.body());
|
||||
wrapper.appendChild(node);
|
||||
|
||||
var s = node.style;
|
||||
s.display = "";
|
||||
s.visibility = "";
|
||||
s.position = "";
|
||||
s.top = "0px";
|
||||
|
||||
if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
|
||||
widget._popupWrapper = wrapper;
|
||||
dojo.connect(widget, "destroy", function(){
|
||||
dojo.destroy(wrapper);
|
||||
delete widget._popupWrapper;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return wrapper;
|
||||
},
|
||||
|
||||
moveOffScreen: function(/*Widget || DomNode*/ widget){
|
||||
// summary:
|
||||
// Moves the popup widget off-screen.
|
||||
// Do not use this method to hide popups when not in use, because
|
||||
// that will create an accessibility issue: the offscreen popup is
|
||||
// still in the tabbing order.
|
||||
|
||||
// Create wrapper if not already there
|
||||
var wrapper = this._createWrapper(widget);
|
||||
|
||||
dojo.style(wrapper, {
|
||||
visibility: "hidden",
|
||||
top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
|
||||
display: ""
|
||||
});
|
||||
},
|
||||
|
||||
hide: function(/*dijit._Widget*/ widget){
|
||||
// summary:
|
||||
// Hide this popup widget (until it is ready to be shown).
|
||||
// Initialization for widgets that will be used as popups
|
||||
//
|
||||
// Also puts widget inside a wrapper DIV (if not already in one)
|
||||
//
|
||||
// If popup widget needs to layout it should
|
||||
// do so when it is made visible, and popup._onShow() is called.
|
||||
|
||||
// Create wrapper if not already there
|
||||
var wrapper = this._createWrapper(widget);
|
||||
|
||||
dojo.style(wrapper, "display", "none");
|
||||
},
|
||||
|
||||
getTopPopup: function(){
|
||||
// summary:
|
||||
// Compute the closest ancestor popup that's *not* a child of another popup.
|
||||
// Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
|
||||
var stack = this._stack;
|
||||
for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
|
||||
/* do nothing, just trying to get right value for pi */
|
||||
}
|
||||
return stack[pi];
|
||||
},
|
||||
|
||||
open: function(/*dijit.popup.__OpenArgs*/ args){
|
||||
// summary:
|
||||
// Popup the widget at the specified position
|
||||
//
|
||||
// example:
|
||||
// opening at the mouse position
|
||||
// | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
|
||||
//
|
||||
// example:
|
||||
// opening the widget as a dropdown
|
||||
// | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
|
||||
//
|
||||
// Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
|
||||
// (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
|
||||
|
||||
var stack = this._stack,
|
||||
widget = args.popup,
|
||||
orient = args.orient || (
|
||||
(args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
|
||||
{'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
|
||||
{'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
|
||||
),
|
||||
around = args.around,
|
||||
id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
|
||||
|
||||
// If we are opening a new popup that isn't a child of a currently opened popup, then
|
||||
// close currently opened popup(s). This should happen automatically when the old popups
|
||||
// gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
|
||||
while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
|
||||
dijit.popup.close(stack[stack.length-1].widget);
|
||||
}
|
||||
|
||||
// Get pointer to popup wrapper, and create wrapper if it doesn't exist
|
||||
var wrapper = this._createWrapper(widget);
|
||||
|
||||
|
||||
dojo.attr(wrapper, {
|
||||
id: id,
|
||||
style: {
|
||||
zIndex: this._beginZIndex + stack.length
|
||||
},
|
||||
"class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
|
||||
dijitPopupParent: args.parent ? args.parent.id : ""
|
||||
});
|
||||
|
||||
if(dojo.isIE || dojo.isMoz){
|
||||
if(!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");
|
||||
}
|
||||
if(dojo.isIE||dojo.isMoz){
|
||||
var _1d=dijit._frames.pop();
|
||||
_1c.appendChild(_1d);
|
||||
if(dojo.isIE<7){
|
||||
this.resize(_1c);
|
||||
this._conn=dojo.connect(_1c,"onresize",this,function(){
|
||||
this.resize(_1c);
|
||||
});
|
||||
}else{
|
||||
dojo.style(_1d,{width:"100%",height:"100%"});
|
||||
}
|
||||
this.iframe=_1d;
|
||||
}
|
||||
|
||||
|
||||
dijit.BackgroundIframe = function(/*DomNode*/ node){
|
||||
// summary:
|
||||
// For IE/FF z-index schenanigans. id attribute is required.
|
||||
//
|
||||
// description:
|
||||
// new dijit.BackgroundIframe(node)
|
||||
// Makes a background iframe as a child of node, that fills
|
||||
// area (and position) of node
|
||||
|
||||
if(!node.id){ throw new Error("no id"); }
|
||||
if(dojo.isIE || dojo.isMoz){
|
||||
var iframe = (this.iframe = dijit._frames.pop());
|
||||
node.appendChild(iframe);
|
||||
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.style(this.iframe,{width:_1e.offsetWidth+"px",height:_1e.offsetHeight+"px"});
|
||||
}
|
||||
},destroy:function(){
|
||||
if(this._conn){
|
||||
dojo.disconnect(this._conn);
|
||||
this._conn=null;
|
||||
}
|
||||
if(this.iframe){
|
||||
dijit._frames.push(this.iframe);
|
||||
delete this.iframe;
|
||||
}
|
||||
}});
|
||||
|
||||
dojo.extend(dijit.BackgroundIframe, {
|
||||
resize: function(node){
|
||||
// summary:
|
||||
// Resize the iframe so it's the same size as node.
|
||||
// Needed on IE6 and IE/quirks because height:100% doesn't work right.
|
||||
if(this.iframe){
|
||||
dojo.style(this.iframe, {
|
||||
width: node.offsetWidth + 'px',
|
||||
height: node.offsetHeight + 'px'
|
||||
});
|
||||
}
|
||||
},
|
||||
destroy: function(){
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.scroll"]){
|
||||
dojo._hasResource["dijit._base.scroll"]=true;
|
||||
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.provide("dijit._base.scroll");
|
||||
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);
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.sniff"]){
|
||||
dojo._hasResource["dijit._base.sniff"]=true;
|
||||
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.provide("dijit._base.sniff");
|
||||
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.
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.typematic"]){
|
||||
dojo._hasResource["dijit._base.typematic"]=true;
|
||||
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.provide("dijit._base.typematic");
|
||||
dijit.typematic={_fireEventAndReload:function(){
|
||||
this._timer=null;
|
||||
this._callback(++this._count,this._node,this._evt);
|
||||
this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);
|
||||
this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout);
|
||||
},trigger:function(_1,_2,_3,_4,_5,_6,_7,_8){
|
||||
if(_5!=this._obj){
|
||||
this.stop();
|
||||
this._initialDelay=_7||500;
|
||||
this._subsequentDelay=_6||0.9;
|
||||
this._minDelay=_8||10;
|
||||
this._obj=_5;
|
||||
this._evt=_1;
|
||||
this._node=_3;
|
||||
this._currentTimeout=-1;
|
||||
this._count=-1;
|
||||
this._callback=dojo.hitch(_2,_4);
|
||||
this._fireEventAndReload();
|
||||
this._evt=dojo.mixin({faux:true},_1);
|
||||
}
|
||||
},stop:function(){
|
||||
if(this._timer){
|
||||
clearTimeout(this._timer);
|
||||
this._timer=null;
|
||||
}
|
||||
if(this._obj){
|
||||
this._callback(-1,this._node,this._evt);
|
||||
this._obj=null;
|
||||
}
|
||||
},addKeyListener:function(_9,_a,_b,_c,_d,_e,_f){
|
||||
if(_a.keyCode){
|
||||
_a.charOrCode=_a.keyCode;
|
||||
dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");
|
||||
}else{
|
||||
if(_a.charCode){
|
||||
_a.charOrCode=String.fromCharCode(_a.charCode);
|
||||
dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");
|
||||
}
|
||||
}
|
||||
return [dojo.connect(_9,"onkeypress",this,function(evt){
|
||||
if(evt.charOrCode==_a.charOrCode&&(_a.ctrlKey===undefined||_a.ctrlKey==evt.ctrlKey)&&(_a.altKey===undefined||_a.altKey==evt.altKey)&&(_a.metaKey===undefined||_a.metaKey==(evt.metaKey||false))&&(_a.shiftKey===undefined||_a.shiftKey==evt.shiftKey)){
|
||||
dojo.stopEvent(evt);
|
||||
dijit.typematic.trigger(evt,_b,_9,_c,_a,_d,_e,_f);
|
||||
}else{
|
||||
if(dijit.typematic._obj==_a){
|
||||
dijit.typematic.stop();
|
||||
}
|
||||
}
|
||||
}),dojo.connect(_9,"onkeyup",this,function(evt){
|
||||
if(dijit.typematic._obj==_a){
|
||||
dijit.typematic.stop();
|
||||
}
|
||||
})];
|
||||
},addMouseListener:function(_10,_11,_12,_13,_14,_15){
|
||||
var dc=dojo.connect;
|
||||
return [dc(_10,"mousedown",this,function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15);
|
||||
}),dc(_10,"mouseup",this,function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
dijit.typematic.stop();
|
||||
}),dc(_10,"mouseout",this,function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
dijit.typematic.stop();
|
||||
}),dc(_10,"mousemove",this,function(evt){
|
||||
evt.preventDefault();
|
||||
}),dc(_10,"dblclick",this,function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
if(dojo.isIE){
|
||||
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15);
|
||||
setTimeout(dojo.hitch(this,dijit.typematic.stop),50);
|
||||
}
|
||||
})];
|
||||
},addListener:function(_16,_17,_18,_19,_1a,_1b,_1c,_1d){
|
||||
return this.addKeyListener(_17,_18,_19,_1a,_1b,_1c,_1d).concat(this.addMouseListener(_16,_19,_1a,_1b,_1c,_1d));
|
||||
}};
|
||||
|
||||
|
||||
dijit.typematic = {
|
||||
// summary:
|
||||
// These functions are used to repetitively call a user specified callback
|
||||
// method when a specific key or mouse click over a specific DOM node is
|
||||
// held down for a specific amount of time.
|
||||
// Only 1 such event is allowed to occur on the browser page at 1 time.
|
||||
|
||||
_fireEventAndReload: function(){
|
||||
this._timer = null;
|
||||
this._callback(++this._count, this._node, this._evt);
|
||||
|
||||
// Schedule next event, timer is at most minDelay (default 10ms) to avoid
|
||||
// browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
|
||||
this._currentTimeout = Math.max(
|
||||
this._currentTimeout < 0 ? this._initialDelay :
|
||||
(this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
|
||||
this._minDelay);
|
||||
this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
|
||||
},
|
||||
|
||||
trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
|
||||
// summary:
|
||||
// Start a timed, repeating callback sequence.
|
||||
// If already started, the function call is ignored.
|
||||
// This method is not normally called by the user but can be
|
||||
// when the normal listener code is insufficient.
|
||||
// evt:
|
||||
// key or mouse event object to pass to the user callback
|
||||
// _this:
|
||||
// pointer to the user's widget space.
|
||||
// node:
|
||||
// the DOM node object to pass the the callback function
|
||||
// callback:
|
||||
// function to call until the sequence is stopped called with 3 parameters:
|
||||
// count:
|
||||
// integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
|
||||
// node:
|
||||
// the DOM node object passed in
|
||||
// evt:
|
||||
// key or mouse event object
|
||||
// obj:
|
||||
// user space object used to uniquely identify each typematic sequence
|
||||
// subsequentDelay (optional):
|
||||
// if > 1, the number of milliseconds until the 3->n events occur
|
||||
// or else the fractional time multiplier for the next event's delay, default=0.9
|
||||
// initialDelay (optional):
|
||||
// the number of milliseconds until the 2nd event occurs, default=500ms
|
||||
// minDelay (optional):
|
||||
// the maximum delay in milliseconds for event to fire, default=10ms
|
||||
if(obj != this._obj){
|
||||
this.stop();
|
||||
this._initialDelay = initialDelay || 500;
|
||||
this._subsequentDelay = subsequentDelay || 0.90;
|
||||
this._minDelay = minDelay || 10;
|
||||
this._obj = obj;
|
||||
this._evt = evt;
|
||||
this._node = node;
|
||||
this._currentTimeout = -1;
|
||||
this._count = -1;
|
||||
this._callback = dojo.hitch(_this, callback);
|
||||
this._fireEventAndReload();
|
||||
this._evt = dojo.mixin({faux: true}, evt);
|
||||
}
|
||||
},
|
||||
|
||||
stop: function(){
|
||||
// summary:
|
||||
// Stop an ongoing timed, repeating callback sequence.
|
||||
if(this._timer){
|
||||
clearTimeout(this._timer);
|
||||
this._timer = null;
|
||||
}
|
||||
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));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.wai"]){
|
||||
dojo._hasResource["dijit._base.wai"]=true;
|
||||
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.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);
|
||||
if(cs){
|
||||
var _2=cs.backgroundImage;
|
||||
var _3=(cs.borderTopColor==cs.borderRightColor)||(_2!=null&&(_2=="none"||_2=="url(invalid-url:)"));
|
||||
dojo[_3?"addClass":"removeClass"](dojo.body(),"dijit_a11y");
|
||||
if(dojo.isIE){
|
||||
_1.outerHTML="";
|
||||
}else{
|
||||
dojo.body().removeChild(_1);
|
||||
}
|
||||
}
|
||||
}};
|
||||
if(dojo.isIE||dojo.isMoz){
|
||||
dojo._loaders.unshift(dijit.wai.onload);
|
||||
}
|
||||
dojo.mixin(dijit,{_XhtmlRoles:/banner|contentinfo|definition|main|navigation|search|note|secondary|seealso/,hasWaiRole:function(_4,_5){
|
||||
var _6=this.getWaiRole(_4);
|
||||
return _5?(_6.indexOf(_5)>-1):(_6.length>0);
|
||||
},getWaiRole:function(_7){
|
||||
return dojo.trim((dojo.attr(_7,"role")||"").replace(this._XhtmlRoles,"").replace("wairole:",""));
|
||||
},setWaiRole:function(_8,_9){
|
||||
var _a=dojo.attr(_8,"role")||"";
|
||||
if(!this._XhtmlRoles.test(_a)){
|
||||
dojo.attr(_8,"role",_9);
|
||||
}else{
|
||||
if((" "+_a+" ").indexOf(" "+_9+" ")<0){
|
||||
var _b=dojo.trim(_a.replace(this._XhtmlRoles,""));
|
||||
var _c=dojo.trim(_a.replace(_b,""));
|
||||
dojo.attr(_8,"role",_c+(_c?" ":"")+_9);
|
||||
}
|
||||
}
|
||||
},removeWaiRole:function(_d,_e){
|
||||
var _f=dojo.attr(_d,"role");
|
||||
if(!_f){
|
||||
return;
|
||||
}
|
||||
if(_e){
|
||||
var t=dojo.trim((" "+_f+" ").replace(" "+_e+" "," "));
|
||||
dojo.attr(_d,"role",t);
|
||||
}else{
|
||||
_d.removeAttribute("role");
|
||||
|
||||
|
||||
dijit.wai = {
|
||||
onload: function(){
|
||||
// summary:
|
||||
// Detects if we are in high-contrast mode or not
|
||||
|
||||
// This must be a named function and not an anonymous
|
||||
// function, so that the widget parsing code can make sure it
|
||||
// registers its onload function after this function.
|
||||
// DO NOT USE "this" within this function.
|
||||
|
||||
// create div for testing if high contrast mode is on or images are turned off
|
||||
var div = dojo.create("div",{
|
||||
id: "a11yTestNode",
|
||||
style:{
|
||||
cssText:'border: 1px solid;'
|
||||
+ 'border-color:red green;'
|
||||
+ 'position: absolute;'
|
||||
+ 'height: 5px;'
|
||||
+ 'top: -999px;'
|
||||
+ 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
|
||||
}
|
||||
}, dojo.body());
|
||||
|
||||
// test it
|
||||
var cs = dojo.getComputedStyle(div);
|
||||
if(cs){
|
||||
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);
|
||||
}
|
||||
},hasWaiState:function(_10,_11){
|
||||
return _10.hasAttribute?_10.hasAttribute("aria-"+_11):!!_10.getAttribute("aria-"+_11);
|
||||
},getWaiState:function(_12,_13){
|
||||
return _12.getAttribute("aria-"+_13)||"";
|
||||
},setWaiState:function(_14,_15,_16){
|
||||
_14.setAttribute("aria-"+_15,_16);
|
||||
},removeWaiState:function(_17,_18){
|
||||
_17.removeAttribute("aria-"+_18);
|
||||
}});
|
||||
|
||||
dojo.mixin(dijit, {
|
||||
hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
|
||||
// summary:
|
||||
// Determines if an element has a particular role.
|
||||
// returns:
|
||||
// True if elem has the specific role attribute and false if not.
|
||||
// For backwards compatibility if role parameter not provided,
|
||||
// returns true if has a role
|
||||
var waiRole = this.getWaiRole(elem);
|
||||
return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
|
||||
},
|
||||
|
||||
getWaiRole: function(/*Element*/ elem){
|
||||
// summary:
|
||||
// Gets the role for an element (which should be a wai role).
|
||||
// returns:
|
||||
// The role of elem or an empty string if elem
|
||||
// does not have a role.
|
||||
return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
|
||||
},
|
||||
|
||||
setWaiRole: function(/*Element*/ elem, /*String*/ role){
|
||||
// summary:
|
||||
// Sets the role on an element.
|
||||
// description:
|
||||
// Replace existing role attribute with new role.
|
||||
|
||||
dojo.attr(elem, "role", role);
|
||||
},
|
||||
|
||||
removeWaiRole: function(/*Element*/ elem, /*String*/ role){
|
||||
// summary:
|
||||
// Removes the specified role from an element.
|
||||
// Removes role attribute if no specific role provided (for backwards compat.)
|
||||
|
||||
var roleValue = dojo.attr(elem, "role");
|
||||
if(!roleValue){ return; }
|
||||
if(role){
|
||||
var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
|
||||
dojo.attr(elem, "role", t);
|
||||
}else{
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._base.window"]){
|
||||
dojo._hasResource["dijit._base.window"]=true;
|
||||
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.provide("dijit._base.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
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._editor._Plugin"]){
|
||||
dojo._hasResource["dijit._editor._Plugin"]=true;
|
||||
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.provide("dijit._editor._Plugin");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit.form.Button");
|
||||
dojo.declare("dijit._editor._Plugin",null,{constructor:function(_1,_2){
|
||||
this.params=_1||{};
|
||||
dojo.mixin(this,this.params);
|
||||
this._connects=[];
|
||||
},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:true,buttonClass:dijit.form.Button,getLabel:function(_3){
|
||||
return this.editor.commands[_3];
|
||||
},_initButton:function(){
|
||||
if(this.command.length){
|
||||
var _4=this.getLabel(this.command),_5=this.editor,_6=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);
|
||||
if(!this.button){
|
||||
var _7=dojo.mixin({label:_4,dir:_5.dir,lang:_5.lang,showLabel:false,iconClass:_6,dropDown:this.dropDown,tabIndex:"-1"},this.params||{});
|
||||
this.button=new this.buttonClass(_7);
|
||||
}
|
||||
}
|
||||
},destroy:function(){
|
||||
dojo.forEach(this._connects,dojo.disconnect);
|
||||
if(this.dropDown){
|
||||
this.dropDown.destroyRecursive();
|
||||
}
|
||||
},connect:function(o,f,tf){
|
||||
this._connects.push(dojo.connect(o,f,this,tf));
|
||||
},updateState:function(){
|
||||
var e=this.editor,c=this.command,_8,_9;
|
||||
if(!e||!e.isLoaded||!c.length){
|
||||
return;
|
||||
}
|
||||
if(this.button){
|
||||
try{
|
||||
_9=e.queryCommandEnabled(c);
|
||||
if(this.enabled!==_9){
|
||||
this.enabled=_9;
|
||||
this.button.set("disabled",!_9);
|
||||
}
|
||||
if(typeof this.button.checked=="boolean"){
|
||||
_8=e.queryCommandState(c);
|
||||
if(this.checked!==_8){
|
||||
this.checked=_8;
|
||||
this.button.set("checked",e.queryCommandState(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
}
|
||||
},setEditor:function(_a){
|
||||
this.editor=_a;
|
||||
this._initButton();
|
||||
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{
|
||||
this.button.domNode.style.display="none";
|
||||
}
|
||||
}
|
||||
this.connect(this.editor,"onNormalizedDisplayChanged","updateState");
|
||||
},setToolbar:function(_b){
|
||||
if(this.button){
|
||||
_b.addChild(this.button);
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
dojo.declare("dijit._editor._Plugin", null, {
|
||||
// summary
|
||||
// Base class for a "plugin" to the editor, which is usually
|
||||
// a single button on the Toolbar and some associated code
|
||||
|
||||
constructor: function(/*Object?*/args, /*DomNode?*/node){
|
||||
this.params = args || {};
|
||||
dojo.mixin(this, this.params);
|
||||
this._connects=[];
|
||||
this._attrPairNames = {};
|
||||
},
|
||||
|
||||
// editor: [const] dijit.Editor
|
||||
// Points to the parent editor
|
||||
editor: null,
|
||||
|
||||
// iconClassPrefix: [const] String
|
||||
// The CSS class name for the button node is formed from `iconClassPrefix` and `command`
|
||||
iconClassPrefix: "dijitEditorIcon",
|
||||
|
||||
// button: dijit._Widget?
|
||||
// Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`)
|
||||
// that is added to the toolbar to control this plugin.
|
||||
// If not specified, will be created on initialization according to `buttonClass`
|
||||
button: null,
|
||||
|
||||
// command: String
|
||||
// String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command.
|
||||
// Passed to editor.execCommand() if `useDefaultCommand` is true.
|
||||
command: "",
|
||||
|
||||
// useDefaultCommand: Boolean
|
||||
// If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`.
|
||||
useDefaultCommand: true,
|
||||
|
||||
// buttonClass: Widget Class
|
||||
// Class of widget (ex: dijit.form.Button or dijit.form.FilteringSelect)
|
||||
// that is added to the toolbar to control this plugin.
|
||||
// This is used to instantiate the button, unless `button` itself is specified directly.
|
||||
buttonClass: dijit.form.Button,
|
||||
|
||||
// disabled: Boolean
|
||||
// Flag to indicate if this plugin has been disabled and should do nothing
|
||||
// helps control button state, among other things. Set via the setter api.
|
||||
disabled: false,
|
||||
|
||||
getLabel: function(/*String*/key){
|
||||
// summary:
|
||||
// Returns the label to use for the button
|
||||
// tags:
|
||||
// private
|
||||
return this.editor.commands[key]; // String
|
||||
},
|
||||
|
||||
_initButton: function(){
|
||||
// summary:
|
||||
// Initialize the button or other widget that will control this plugin.
|
||||
// This code only works for plugins controlling built-in commands in the editor.
|
||||
// tags:
|
||||
// protected extension
|
||||
if(this.command.length){
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -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.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
|
||||
|
||||
if(!dojo._hasResource["dijit._editor.html"]){
|
||||
dojo._hasResource["dijit._editor.html"]=true;
|
||||
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.provide("dijit._editor.html");
|
||||
dijit._editor.escapeXml=function(_1,_2){
|
||||
_1=_1.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");
|
||||
if(!_2){
|
||||
_1=_1.replace(/'/gm,"'");
|
||||
}
|
||||
return _1;
|
||||
|
||||
dojo.getObject("_editor", true, dijit);
|
||||
|
||||
dijit._editor.escapeXml=function(/*String*/str, /*Boolean?*/noSingleQuotes){
|
||||
// summary:
|
||||
// Adds escape sequences for special characters in XML: &<>"'
|
||||
// Optionally skips escapes for single quotes
|
||||
str = str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """);
|
||||
if(!noSingleQuotes){
|
||||
str = str.replace(/'/gm, "'");
|
||||
}
|
||||
return str; // string
|
||||
};
|
||||
dijit._editor.getNodeHtml=function(_3){
|
||||
var _4;
|
||||
switch(_3.nodeType){
|
||||
case 1:
|
||||
var _5=_3.nodeName.toLowerCase();
|
||||
if(!_5||_5.charAt(0)=="/"){
|
||||
return "";
|
||||
}
|
||||
_4="<"+_5;
|
||||
var _6=[];
|
||||
var _7;
|
||||
if(dojo.isIE&&_3.outerHTML){
|
||||
var s=_3.outerHTML;
|
||||
s=s.substr(0,s.indexOf(">")).replace(/(['"])[^"']*\1/g,"");
|
||||
var _8=/(\b\w+)\s?=/g;
|
||||
var m,_9;
|
||||
while((m=_8.exec(s))){
|
||||
_9=m[1];
|
||||
if(_9.substr(0,3)!="_dj"){
|
||||
if(_9=="src"||_9=="href"){
|
||||
if(_3.getAttribute("_djrealurl")){
|
||||
_6.push([_9,_3.getAttribute("_djrealurl")]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var _a,_b;
|
||||
switch(_9){
|
||||
case "style":
|
||||
_a=_3.style.cssText.toLowerCase();
|
||||
break;
|
||||
case "class":
|
||||
_a=_3.className;
|
||||
break;
|
||||
case "width":
|
||||
if(_5==="img"){
|
||||
_b=/width=(\S+)/i.exec(s);
|
||||
if(_b){
|
||||
_a=_b[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "height":
|
||||
if(_5==="img"){
|
||||
_b=/height=(\S+)/i.exec(s);
|
||||
if(_b){
|
||||
_a=_b[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
_a=_3.getAttribute(_9);
|
||||
}
|
||||
if(_a!=null){
|
||||
_6.push([_9,_a.toString()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var i=0;
|
||||
while((_7=_3.attributes[i++])){
|
||||
var n=_7.name;
|
||||
if(n.substr(0,3)!="_dj"){
|
||||
var v=_7.value;
|
||||
if(n=="src"||n=="href"){
|
||||
if(_3.getAttribute("_djrealurl")){
|
||||
v=_3.getAttribute("_djrealurl");
|
||||
}
|
||||
}
|
||||
_6.push([n,v]);
|
||||
}
|
||||
}
|
||||
}
|
||||
_6.sort(function(a,b){
|
||||
return a[0]<b[0]?-1:(a[0]==b[0]?0:1);
|
||||
});
|
||||
var j=0;
|
||||
while((_7=_6[j++])){
|
||||
_4+=" "+_7[0]+"=\""+(dojo.isString(_7[1])?dijit._editor.escapeXml(_7[1],true):_7[1])+"\"";
|
||||
}
|
||||
if(_5==="script"){
|
||||
_4+=">"+_3.innerHTML+"</"+_5+">";
|
||||
}else{
|
||||
if(_3.childNodes.length){
|
||||
_4+=">"+dijit._editor.getChildrenHtml(_3)+"</"+_5+">";
|
||||
}else{
|
||||
switch(_5){
|
||||
case "br":
|
||||
case "hr":
|
||||
case "img":
|
||||
case "input":
|
||||
case "base":
|
||||
case "meta":
|
||||
case "area":
|
||||
case "basefont":
|
||||
_4+=" />";
|
||||
break;
|
||||
default:
|
||||
_4+="></"+_5+">";
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
_4=dijit._editor.escapeXml(_3.nodeValue,true);
|
||||
break;
|
||||
case 8:
|
||||
_4="<!--"+dijit._editor.escapeXml(_3.nodeValue,true)+"-->";
|
||||
break;
|
||||
default:
|
||||
_4="<!-- Element not recognized - Type: "+_3.nodeType+" Name: "+_3.nodeName+"-->";
|
||||
}
|
||||
return _4;
|
||||
|
||||
dijit._editor.getNodeHtml=function(/* DomNode */node){
|
||||
var output;
|
||||
switch(node.nodeType){
|
||||
case 1: //element node
|
||||
var lName = node.nodeName.toLowerCase();
|
||||
if(!lName || lName.charAt(0) == "/"){
|
||||
// IE does some strange things with malformed HTML input, like
|
||||
// treating a close tag </span> without an open tag <span>, as
|
||||
// a new tag with tagName of /span. Corrupts output HTML, remove
|
||||
// them. Other browsers don't prefix tags that way, so will
|
||||
// never show up.
|
||||
return "";
|
||||
}
|
||||
output = '<' + lName;
|
||||
|
||||
//store the list of attributes and sort it to have the
|
||||
//attributes appear in the dictionary order
|
||||
var attrarray = [];
|
||||
var attr;
|
||||
if(dojo.isIE && node.outerHTML){
|
||||
var s = node.outerHTML;
|
||||
s = s.substr(0, s.indexOf('>'))
|
||||
.replace(/(['"])[^"']*\1/g, ''); //to make the following regexp safe
|
||||
var reg = /(\b\w+)\s?=/g;
|
||||
var m, key;
|
||||
while((m = reg.exec(s))){
|
||||
key = m[1];
|
||||
if(key.substr(0,3) != '_dj'){
|
||||
if(key == 'src' || key == 'href'){
|
||||
if(node.getAttribute('_djrealurl')){
|
||||
attrarray.push([key,node.getAttribute('_djrealurl')]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var val, match;
|
||||
switch(key){
|
||||
case 'style':
|
||||
val = node.style.cssText.toLowerCase();
|
||||
break;
|
||||
case 'class':
|
||||
val = node.className;
|
||||
break;
|
||||
case 'width':
|
||||
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.
|
||||
match=/width=(\S+)/i.exec(s);
|
||||
if(match){
|
||||
val = match[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
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.
|
||||
match=/height=(\S+)/i.exec(s);
|
||||
if(match){
|
||||
val = match[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
val = node.getAttribute(key);
|
||||
}
|
||||
if(val != null){
|
||||
attrarray.push([key, val.toString()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var i = 0;
|
||||
while((attr = node.attributes[i++])){
|
||||
//ignore all attributes starting with _dj which are
|
||||
//internal temporary attributes used by the editor
|
||||
var n = attr.name;
|
||||
if(n.substr(0,3) != '_dj' /*&&
|
||||
(attr.specified == undefined || attr.specified)*/){
|
||||
var v = attr.value;
|
||||
if(n == 'src' || n == 'href'){
|
||||
if(node.getAttribute('_djrealurl')){
|
||||
v = node.getAttribute('_djrealurl');
|
||||
}
|
||||
}
|
||||
attrarray.push([n,v]);
|
||||
}
|
||||
}
|
||||
}
|
||||
attrarray.sort(function(a,b){
|
||||
return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1);
|
||||
});
|
||||
var j = 0;
|
||||
while((attr = attrarray[j++])){
|
||||
output += ' ' + attr[0] + '="' +
|
||||
(dojo.isString(attr[1]) ? dijit._editor.escapeXml(attr[1], true) : attr[1]) + '"';
|
||||
}
|
||||
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
|
||||
// seem to want to do it, so we need to at least return them right.
|
||||
// other plugins/filters can strip them.
|
||||
output += '>' + node.innerHTML +'</' + lName + '>';
|
||||
}else{
|
||||
if(node.childNodes.length){
|
||||
output += '>' + dijit._editor.getChildrenHtml(node)+'</' + lName +'>';
|
||||
}else{
|
||||
switch(lName){
|
||||
case 'br':
|
||||
case 'hr':
|
||||
case 'img':
|
||||
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="";
|
||||
if(!_c){
|
||||
return _d;
|
||||
}
|
||||
var _e=_c["childNodes"]||_c;
|
||||
var _f=!dojo.isIE||_e!==_c;
|
||||
var _10,i=0;
|
||||
while((_10=_e[i++])){
|
||||
if(!_f||_10.parentNode==_c){
|
||||
_d+=dijit._editor.getNodeHtml(_10);
|
||||
}
|
||||
}
|
||||
return _d;
|
||||
|
||||
dijit._editor.getChildrenHtml = function(/* DomNode */dom){
|
||||
// summary:
|
||||
// Returns the html content of a DomNode and children
|
||||
var out = "";
|
||||
if(!dom){ return out; }
|
||||
var nodes = dom["childNodes"] || dom;
|
||||
|
||||
//IE issue.
|
||||
//If we have an actual node we can check parent relationships on for IE,
|
||||
//We should check, as IE sometimes builds invalid DOMS. If no parent, we can't check
|
||||
//And should just process it and hope for the best.
|
||||
var checkParent = !dojo.isIE || nodes !== dom;
|
||||
|
||||
var node, i = 0;
|
||||
while((node = nodes[i++])){
|
||||
//IE is broken. DOMs are supposed to be a tree. But in the case of malformed HTML, IE generates a graph
|
||||
//meaning one node ends up with multiple references (multiple parents). This is totally wrong and invalid, but
|
||||
//such is what it is. We have to keep track and check for this because otherise the source output HTML will have dups.
|
||||
//No other browser generates a graph. Leave it to IE to break a fundamental DOM rule. So, we check the parent if we can
|
||||
//If we can't, nothing more we can do other than walk it.
|
||||
if(!checkParent || node.parentNode == dom){
|
||||
out += dijit._editor.getNodeHtml(node);
|
||||
}
|
||||
}
|
||||
return out; // String
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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":"كتابة بحروف متصلة"})
|
@ -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"})
|
@ -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:"})
|
@ -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}"})
|
@ -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"})
|
@ -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}"})
|
@ -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"})
|
@ -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}"})
|
@ -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"})
|
@ -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":"πλάγιοι"})
|
@ -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"})
|
@ -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:"})
|
@ -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"})
|
@ -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"})
|
@ -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 :"})
|
@ -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}"})
|
@ -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"})
|
@ -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"})
|
@ -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"})
|
@ -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:"})
|
@ -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}"})
|
@ -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"})
|
@ -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}"})
|
@ -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":"көлбеу"})
|
@ -0,0 +1 @@
|
||||
({"text":"Сипаттама:","insertImageTitle":"Сурет сипаттары","set":"Орнату","newWindow":"Жаңа терезе","topWindow":"Ең жоғарғы терезе","target":"Мақсат:","createLinkTitle":"Сілтеме сипаттары","parentWindow":"Басты терезе","currentWindow":"Ағымдағы терезе","url":"URL мекенжайы:"})
|
@ -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}"})
|
@ -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"})
|
@ -1 +1 @@
|
||||
({"text":"설명:","insertImageTitle":"이미지 특성","set":"설정","newWindow":"새 창","topWindow":"최상위 창","target":"대상:","createLinkTitle":"링크 특성","parentWindow":"상위 창","currentWindow":"현재 창","url":"URL:"})
|
||||
({"text":"설명:","insertImageTitle":"이미지 등록 정보","set":"설정","newWindow":"새 창","topWindow":"최상위 창","target":"대상","createLinkTitle":"링크 등록 정보","parentWindow":"상위 창","currentWindow":"현재 창","url":"URL:"})
|
@ -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}"})
|
@ -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"})
|
@ -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"})
|
@ -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"})
|
@ -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"})
|
@ -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}"})
|
@ -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"})
|
@ -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}"})
|
@ -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"})
|
@ -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}"})
|
@ -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:"})
|
@ -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}"})
|
@ -1 +1 @@
|
||||
({"text":"Описание:","insertImageTitle":"Свойства изображения","set":"Задать","newWindow":"Новое окно","topWindow":"Окно верхнего уровня","target":"Целевой объект:","createLinkTitle":"Свойства ссылки","parentWindow":"Родительское окно","currentWindow":"Текущее окно","url":"URL:"})
|
||||
({"text":"Описание:","insertImageTitle":"Свойства изображения","set":"Задать","newWindow":"Новое окно","topWindow":"Верхнее окно","target":"Целевой объект:","createLinkTitle":"Свойства ссылки","parentWindow":"Родительское окно","currentWindow":"Текущее окно","url":"URL:"})
|
@ -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"})
|
@ -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"})
|
@ -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:"})
|
@ -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}"})
|
@ -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
Loading…
Reference in New Issue