dojox/widget/Loader.js

  • Provides:

    • dojox.widget.Loader
  • Requires:

    • dijit._Widget in common in project dijit
    • dijit._Templated in common in project dijit
  • dojox.widget.Loader

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
      • dijit._Templated: (call)
    • mixins:
      • dijit._Templated.prototype: (prototype)
    • summary
      a configurable global xhr-listener to display
      a loading message during running xhr's or to simply provide
      base-level topic to subscribe to for custom loading messages
  • dojox.widget.Loader.loadIcon

    • type
      String
    • summary
      location to the icon used.
  • dojox.widget.Loader.loadMessage

    • type
      String
    • summary
      string to use for progress loading
  • dojox.widget.Loader.hasVisuals

    • type
      Boolean
    • summary
      true to display a fixed loading message in TR cornder, false to unly provide
      "Loader" topic to subscribe to for your own custom loading message.
  • dojox.widget.Loader.attachToPointer

    • summary
  • dojox.widget.Loader.duration

    • type
      Integer
    • summary
      time in ms to toggle in/out the visual load indicator
  • dojox.widget.Loader._offset

    • type
      Integer
    • summary
      distance in px from the mouse pointer to show attachToPointer avatar
  • dojox.widget.Loader._pointerConnect

    • summary
  • dojox.widget.Loader._xhrStart

    • summary
  • dojox.widget.Loader._xhrEnd

    • summary
  • dojox.widget.Loader.templateString

    • summary
  • dojox.widget.Loader.postCreate

    • type
      Function
    • source: [view]
        if(!this.hasVisuals){
         this.loadNode.style.display = "none"; // _destroy()?
        }else{
         if(this.attachToPointer){
          dojo.removeClass(this.loadNode,"dojoxLoader");
          dojo.addClass(this.loadNode,"dojoxLoaderPointer");
         }
         this._hide();
        }
        this._setMessage(this.loadMessage);


        // FIXME: create our connections. would be easier, and this might be redundant
        // if Deferred published something. XHR published stuff. FIXME to use that.
        this._xhrStart = this.connect(dojo,"_ioSetArgs","_show");
        this._xhrEnd = this.connect(dojo.Deferred.prototype,"_fire","_hide");
    • summary
      setup the loader
  • dojox.widget.Loader._setMessage

    • type
      Function
    • parameters:
      • message: (typeof String)
    • source: [view]
        this.loadMessageNode.innerHTML = message;
    • summary
      set's the message in the loader
  • dojox.widget.Loader._putLoader

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
        dijit.placeOnScreen(this.loadNode,{ x: e.clientX+this._offset, y:e.clientY+this._offset }, ["TL","BR"]);
    • summary
      place the floating loading element based on mousemove connection position
  • dojox.widget.Loader._show

    • type
      Function
    • source: [view]
        dojo.publish("Loader",[{ message: 'started' }]);
        if(this.hasVisuals){
         if(this.attachToPointer){
          this._pointerConnect = this.connect(document,"onmousemove","_putLoader");
         }
         dojo.style(this.loadNode, {
          opacity:0, display:""
         });
         dojo.fadeIn({ node: this.loadNode, duration:this.duration }).play();
        }
    • summary
      publish and show progress indicator
  • dojox.widget.Loader._hide

    • type
      Function
    • source: [view]
        dojo.publish("Loader",[{ message: 'ended' }]);
        if(this.hasVisuals){
         if(this.attachToPointer){
          this.disconnect(this._pointerConnect);
         }
         dojo.fadeOut({
          node: this.loadNode,
          duration:this.duration,
          onEnd: dojo.partial(dojo.style, this.loadNode, "display", "none")
         }).play();
        }
    • summary
      publish "xhr ended" and hide progress indicator
  • dojox.widget.Loader.loadNode.style.display

    • summary
  • dojox.widget.Loader.loadMessageNode.innerHTML

    • summary
  • dojox.widget

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary