📄 dijit.js.uncompressed.js
字号:
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){ // 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. // Parameters: // 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: 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: the number of milliseconds until the 2nd event occurs, default=500ms if(obj != this._obj){ this.stop(); this._initialDelay = initialDelay || 500; this._subsequentDelay = subsequentDelay || 0.90; this._obj = obj; this._evt = evt; this._node = node; this._currentTimeout = -1; this._count = -1; this._callback = dojo.hitch(_this, callback); this._fireEventAndReload(); } }, 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){ // summary: Start listening for a specific typematic key. // keyObject: an object defining the key to listen for. // key: (mandatory) the keyCode (number) or character (string) to listen for. // ctrlKey: desired ctrl key state to initiate the calback 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 // See the trigger method for other parameters. // Returns an array of dojo.connect handles return [ dojo.connect(node, "onkeypress", this, function(evt){ if(evt.keyCode == keyObject.keyCode && (!keyObject.charCode || keyObject.charCode == evt.charCode) && (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) && (keyObject.altKey === undefined || keyObject.altKey == evt.ctrlKey) && (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.ctrlKey)){ dojo.stopEvent(evt); dijit.typematic.trigger(keyObject, _this, node, callback, keyObject, subsequentDelay, initialDelay); }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){ // 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); }), 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){ dojo.stopEvent(evt); }), dc(node, "dblclick", this, function(evt){ dojo.stopEvent(evt); if(dojo.isIE){ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay); setTimeout(dojo.hitch(this, dijit.typematic.stop), 50); } }) ]; }, addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay){ // summary: Start listening for a specific typematic key and mouseclick. // This is a thin wrapper to addKeyListener and addMouseListener. // mouseNode: the DOM node object to listen on for mouse events. // keyNode: the DOM node object to listen on for key events. // See the addMouseListener and addKeyListener methods for other parameters. // Returns an array of dojo.connect handles return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay).concat( this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay)); }};}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(){ // 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.doc.createElement("div"); div.id = "a11yTestNode"; div.style.cssText = 'border: 1px solid;' + 'border-color:red green;' + 'position: absolute;' + 'height: 5px;' + 'top: -999px;' + 'background-image: url("' + dojo.moduleUrl("dojo", "resources/blank.gif") + '");'; dojo.body().appendChild(div); // 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"); dojo.body().removeChild(div); } }};// Test if computer is in high contrast mode.// Make sure the a11y test runs first, before widgets are instantiated.if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up dojo._loaders.unshift(dijit.wai.onload);}dojo.mixin(dijit,{ hasWaiRole: function(/*Element*/ elem){ // summary: Determines if an element has a role. // returns: true if elem has a role attribute and false if not. return elem.hasAttribute ? elem.hasAttribute("role") : !!elem.getAttribute("role"); }, getWaiRole: function(/*Element*/ elem){ // summary: Gets the role for an element. // returns: // The role of elem or an empty string if elem // does not have a role. var value = elem.getAttribute("role"); if(value){ var prefixEnd = value.indexOf(":"); return prefixEnd == -1 ? value : value.substring(prefixEnd+1); }else{ return ""; } }, setWaiRole: function(/*Element*/ elem, /*String*/ role){ // summary: Sets the role on an element. // description: // On Firefox 2 and below, "wairole:" is // prepended to the provided role value. elem.setAttribute("role", (dojo.isFF && dojo.isFF < 3) ? "wairole:" + role : role); }, removeWaiRole: function(/*Element*/ elem){ // summary: Removes the role from an element. elem.removeAttribute("role"); }, hasWaiState: function(/*Element*/ elem, /*String*/ state){ // summary: Determines if an element has a given state. // description: // On Firefox 2 and below, we check for an attribute in namespace // "http://www.w3.org/2005/07/aaa" with a name of the given state. // On all other browsers, we check for an attribute // called "aria-"+state. // returns: // true if elem has a value for the given state and // false if it does not. if(dojo.isFF && dojo.isFF < 3){ return elem.hasAttributeNS("http://www.w3.org/2005/07/aaa", state); }else{ 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: // On Firefox 2 and below, we check for an attribute in namespace // "http://www.w3.org/2005/07/aaa" with a name of the given state. // On all other browsers, we check 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. if(dojo.isFF && dojo.isFF < 3){ return elem.getAttributeNS("http://www.w3.org/2005/07/aaa", state); }else{ var value = elem.getAttribute("aria-"+state); return value ? value : ""; } }, setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){ // summary: Sets a state on an element. // description: // On Firefox 2 and below, we set an attribute in namespace // "http://www.w3.org/2005/07/aaa" with a name of the given state. // On all other browsers, we set an attribute called // "aria-"+state. if(dojo.isFF && dojo.isFF < 3){ elem.setAttributeNS("http://www.w3.org/2005/07/aaa", "aaa:"+state, value); }else{ elem.setAttribute("aria-"+state, value); } }, removeWaiState: function(/*Element*/ elem, /*String*/ state){ // summary: Removes a state from an element. // description: // On Firefox 2 and below, we remove the attribute in namespace // "http://www.w3.org/2005/07/aaa" with a name of the given state. // On all other browsers, we remove the attribute called // "aria-"+state. if(dojo.isFF && dojo.isFF < 3){ elem.removeAttributeNS("http://www.w3.org/2005/07/aaa", state); }else{ elem.removeAttribute("aria-"+state); } }});}if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.dojo._hasResource["dijit._base"] = true;dojo.provide("dijit._base");// FIXME: Find a better way of solving this bug!if(dojo.isSafari){ // Ugly-ass hack to solve bug #5626 for 1.1; basically force Safari to re-layout. // Note that we can't reliably use dojo.addOnLoad here because this bug is basically // a timing / race condition; so instead we use window.onload. dojo.connect(window, "load", function(){ window.resizeBy(1,0); setTimeout(function(){ window.resizeBy(-1,0); }, 10); });}}if(!dojo._hasResource["dojo.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.dojo._hasResource["dojo.date.stamp"] = true;dojo.provide("dojo.date.stamp");// Methods to convert dates to or from a wire (string) format using well-known conventionsdojo.date.stamp.fromISOString = function(/*String*/formattedString, /*Number?*/defaultTime){ // summary: // Returns a Date object given a string formatted according to a subset of the ISO-8601 standard. // // description: // Accepts a string formatted according to a profile of ISO8601 as defined by // [RFC3339](http://www.ietf.org/rfc/rfc3339.txt), except that partial input is allowed. // Can also process dates as specified [by the W3C](http://www.w3.org/TR/NOTE-datetime) // The following combinations are valid: // // * dates only // | * yyyy // | * yyyy-MM // | * yyyy-MM-dd // * times only, with an optional time zone appended // | * THH:mm // | * THH:mm:ss // | * THH:mm:ss.SSS // * and "datetimes" which could be any combination of the above // // timezones may be specified as Z (for UTC) or +/- followed by a time expression HH:mm // Assumes the local time zone if not specified. Does not validate. Improperly formatted // input may return null. Arguments which are out of bounds will be handled // by the Date constructor (e.g. January 32nd typically gets resolved to February 1st) // Only years between 100 and 9999 are supported. // // formattedString: // A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00 // // defaultTime: // Used for defaults for fields omitted in the formattedString. // Uses 1970-01-01T00:00:00.0Z by default. if(!dojo.date.stamp._isoRegExp){ dojo.date.stamp._isoRegExp =//TODO: could be more restrictive and check for 00-59, etc. /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/; } var match = dojo.date.stamp._isoRegExp.exec(formattedString); var result = null; if(match){ match.shift(); if(match[1]){match[1]--;} // Javascript Date months are 0-based if(match[6]){match[6] *= 1000;} // Javascript Date expects fractional seconds as milliseconds if(defaultTime){ // mix in defaultTime. Relatively expensive, so use || operators for the fast path of defaultTime === 0 defaultTime = new Date(defaultTime); dojo.map(["FullYear", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"], function(prop){ return defaultTime["get" + prop](); }).forEach(function(value, index){ if(match[index] === undefined){ match[index] = value; } }); } result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0);// result.setFullYear(match[0]||1970); // for year < 100 var offset = 0; var zoneSign = match[7] && match[7].charAt(0); if(zoneSign != 'Z'){ offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0); if(zoneSign != '-'){ offset *= -1; } } if(zoneSign){ offset -= result.getTimezoneOffset(); } if(offset){ result.setTime(result.getTime() + offset * 60000); } } return result; // Date or null}/*===== dojo.date.stamp.__Options = function(){ // selector: String // "date" or "time" for partial formatting of the Date object. // Both date and time will be formatted by default. // zulu: Boolean // if true, UTC/GMT is used for a timezone // milliseconds: Boolean // if true, output milliseconds this.selector = selector; this.zulu = zulu; this.milliseconds = milliseconds; }=====*/dojo.date.stamp.toISOString = function(/*Date*/dateObject, /*dojo.date.stamp.__Options?*/options){ // summary:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -